diff --git a/APT.MicroApi/APT.FO.WebApi/Controllers/CurrentClassRecord.cs b/APT.MicroApi/APT.FO.WebApi/Controllers/CurrentClassRecord.cs index dfed288..7746af4 100644 --- a/APT.MicroApi/APT.FO.WebApi/Controllers/CurrentClassRecord.cs +++ b/APT.MicroApi/APT.FO.WebApi/Controllers/CurrentClassRecord.cs @@ -126,10 +126,10 @@ namespace APT.FO.WebApi.Controllers.Api.FO //throw new Exception("未找到排班班次,请联系管理员排查"); } } - //if (entity.CLASS_ID == null) - //{ - // throw new Exception("班次不能为空,请联系管理员排查"); - //} + if (entity.CLASS_ID == null) + { + throw new Exception("班次不能为空!"); + } entity.EDITOR_ID = userID; var files = entity.Nav_Files; @@ -255,6 +255,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO } } entity.Nav_Users = null; + entity.Nav_Class = null; entity.Nav_Files = null; entity.Nav_LabourSupplies = null; UnifiedCommit(() => @@ -301,6 +302,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO List currRecordUsers = null; if (entity.CODE.Equals("1")) { + //判断班次 if (entity.CLASS_ID == null || entity.CLASS_ID == Guid.Empty) { currRecord.AUDIT_DATE = DateTime.Now; @@ -309,6 +311,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO currRecord.AUDIT_OPINION = entity.AUDIT_OPINION; var users = currRecord.Nav_Users; var files = currRecord.Nav_Files; + //直接创建交接班 CreateChangeShiftRecord(currRecord, users, files, null); } else @@ -318,7 +321,7 @@ namespace APT.FO.WebApi.Controllers.Api.FO currRecord.AUDIT_DATE = DateTime.Now; currRecord.SHIFT_STATUS = (int)FOShiftStatusEnum.审批归档; currRecord.AUDIT_OPINION = entity.AUDIT_OPINION; - if (currDepartmentConfig.Nav_DepartmentCalendarConfig.IS_HANDOVER == true) + if (currDepartmentConfig!=null && currDepartmentConfig.Nav_DepartmentCalendarConfig.IS_HANDOVER == true) { var users = currRecord.Nav_Users; var files = currRecord.Nav_Files;