diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 27af13b9..544f2154 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -425,7 +425,7 @@ public class ResultRecordController extends AbstractController { @RequestMapping("/recordIdsSubmit") public R recordIdsSubmit(String recordIds) { if (StringUtil.isBlank(recordIds)) { - return R.error("请选择状态为待提交的记录"); + return R.error("请选择提交"); } List records = new ArrayList<>(); String ids[] = recordIds.split(","); @@ -436,7 +436,7 @@ public class ResultRecordController extends AbstractController { } } } - if (recordIds == null) { + if (records == null) { return R.error("请选择状态为待提交的记录"); } List resultRecords = resultRecordService.selectResultRecordByIds(records); @@ -447,16 +447,18 @@ public class ResultRecordController extends AbstractController { } - R r = null; for (ResultRecord resultRecord : resultRecords) { r = resultRecordService.approval(resultRecord.getId(), getUserId()); + if (!r.isSuccess()) { + return r; + } } - if(r != null && r.isSuccess()){//批量提交 - StaffEntity mySelf = (StaffEntity)r.get("from"); - StaffEntity toSelf = (StaffEntity)r.get("to"); - WorkMsgTypeEnum workMsgTypeEnum = (WorkMsgTypeEnum)r.get("type"); + if (r != null && r.isSuccess()) {//批量提交 + StaffEntity mySelf = (StaffEntity) r.get("from"); + StaffEntity toSelf = (StaffEntity) r.get("to"); + WorkMsgTypeEnum workMsgTypeEnum = (WorkMsgTypeEnum) r.get("type"); sendWorkMSG(mySelf, toSelf, workMsgTypeEnum, 0L, 2); } diff --git a/src/main/java/com/lz/modules/flow/service/impl/RecordAuthServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/RecordAuthServiceImpl.java index f5413cd0..19ae7d35 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/RecordAuthServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/RecordAuthServiceImpl.java @@ -143,8 +143,11 @@ public class RecordAuthServiceImpl extends ServiceImpl list = flowInfo.getSecond(); List flowRelations = flowRelationService.selectFlowRelationAll(); Map staffEntityMap = list.stream().collect(Collectors.toMap(FlowDepartment::getDepartmentLevel, p -> p)); - // approvalList = [ME,ONE_D,TWO_D,HR,BOSS] + //approvalList = [ME,ONE_D,TWO_D,HR,BOSS] List approvalList = new ArrayList<>(); approvalList.add("ME"); for (FlowRelation flowRelation : flowRelations) { @@ -364,19 +363,15 @@ public class ResultRecordServiceImpl extends ServiceImpl= approvalList.size()) { //表示流程己经结束 lastFlowRecord.setFlowName(mySelf.getName() + "-审批通过"); flowRecordService.updateCoverFlowRecordById(lastFlowRecord); - - - resultRecordService.updateFlowStaffIdRoleToNull(resultRecord.getId());// 更新用户权限 return R.ok("流程审批结束") .put("from", staff) .put("to", staff) .put("type", WorkMsgTypeEnum.PASS); } - FlowRecord flowRecord = new FlowRecord(); flowRecord.setRecordId(resultRecordId); flowRecord.setRecordStaffId(resultRecord.getStaffId()); @@ -384,35 +379,36 @@ public class ResultRecordServiceImpl extends ServiceImpl staffRoleDtos = new ArrayList<>(); + Long roleId = flows.get(flowIndex - 1).getRoleId(); if (Constant.ME.equals(departmentLevel)) { //如果是自己 approvalStaff = staff; // 是自己进行审批 - StaffRoleDto staffRoleDto = new StaffRoleDto(staff.getId(), flows.get(flowIndex - 1).getRoleId()); + StaffRoleDto staffRoleDto = new StaffRoleDto(staff.getId(), roleId); staffRoleDtos.add(staffRoleDto); } else { FlowDepartment flowD = staffEntityMap.get(departmentLevel); if (flowD == null) { List staffRoles = staffRoleService.selectByRole(departmentLevel); - for (StaffRole staffRole : staffRoles) { List staffRoleDepartments = staffRoleDepartmentService.selectStaffRoleDepartmentByStaffRoleId(staffRole.getId()); Map departmentIdMap = departmentsService.selectUserAllDepartmentIds(resultRecord.getDepartmentId()); for (StaffRoleDepartment staffRoleDepartment : staffRoleDepartments) { String value = departmentIdMap.get(staffRoleDepartment.getDepartmentId()); if (StringUtil.isNotBlank(value)) { - StaffRoleDto staffRoleDto = new StaffRoleDto(staffRole.getStaffId(), TypeRoleDto.getRoleId(staffRole.getTypeRoleIds(), resultRecord.getType())); + StaffRoleDto staffRoleDto = new StaffRoleDto(staffRole.getStaffId(), roleId != null && roleId > 0 ? roleId : + TypeRoleDto.getRoleId(staffRole.getTypeRoleIds(), resultRecord.getType())); staffRoleDtos.add(staffRoleDto); } } } - if (staffRoleDtos.size() >= 1) { //表示只有一个审批的用户 approvalStaff = staffService.selectStaffById(staffRoleDtos.get(0).getStaffId()); } } else { approvalStaff = staffService.selectStaffById(flowD.getStaffId()); - StaffRoleDto staffRoleDto = new StaffRoleDto(approvalStaff.getId(), flows.get(flowIndex - 1).getRoleId()); + StaffRoleDto staffRoleDto = new StaffRoleDto(approvalStaff.getId(), roleId); staffRoleDtos.add(staffRoleDto); } } diff --git a/src/main/resources/logback-dev.xml b/src/main/resources/logback-dev.xml index 47de9285..7004bf98 100644 --- a/src/main/resources/logback-dev.xml +++ b/src/main/resources/logback-dev.xml @@ -3,7 +3,7 @@ - +