Browse Source

Merge remote-tracking branch 'origin/dev_v3.2.7' into dev_v3.2.7

xiaofei 1 year ago
parent
commit
0e54203ecf

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java

@@ -405,7 +405,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             tfFlowApprove.insertInfo(sysUser.getId());
             tfFlowApprove.updateInfo(sysUser.getId());
             tfFlowApprove.setFlowId(SystemConstant.convertIdToLong(flowId));
-            tfFlowApprove.setStatus(flowStatusEnum);
+            tfFlowApprove.setStatus(FlowStatusEnum.REJECT);
             tfFlowApprove.setSetup(FlowApproveSetupEnum.SUBMIT.getSetup());
         } else {
             tfFlowApprove = new TFFlowApprove(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(flowId), sysUser.getId(), flowStatusEnum, sysUser.getId());
@@ -427,7 +427,7 @@ public class ActivitiServiceImpl implements ActivitiService {
 //        tfFlowJoinList.get(0).setObjectTable(flowType.getTable());
 //        tfFlowJoinService.updateById(tfFlowJoinList.get(0));
         Task task = taskService.createTaskQuery().processInstanceId(flowId).singleResult();
-        tfFlowLogService.save(new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(flowId), objectId, sysUser.getId(), sysUser.getId(), "提交流程", approveId, FlowApproveOperationEnum.SUBMIT, flowType.getTable(), Objects.nonNull(task) ? Long.parseLong(task.getId()) : null));
+        tfFlowLogService.save(new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(flowId), objectId, sysUser.getId(), sysUser.getId(), Objects.nonNull(map.get(SystemConstant.APPROVE_REMARK)) ? (String) map.get(SystemConstant.APPROVE_REMARK) : "提交流程", approveId, FlowApproveOperationEnum.SUBMIT, flowType.getTable(), Objects.nonNull(task) ? Long.parseLong(task.getId()) : null));
     }
 
     /**

+ 33 - 16
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskDetailServiceImpl.java

@@ -457,6 +457,7 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
 
     /**
      * 重启流程
+     *
      * @param examTaskDetail
      * @return
      */
@@ -495,6 +496,8 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
                     false);
             map.computeIfAbsent(SystemConstant.OLD_FLOW_ID, v -> examTask.getFlowId());
             map.computeIfAbsent(SystemConstant.FLOW_JOIN_TYPE, v -> FlowJoinTypeEnum.RESTART);
+            String remark = Objects.nonNull(sysOrg) ? sysOrg.getName() : "无机构";
+            map.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> requestUser.getRealName() + "(" + remark + ")" + FlowApprovePassEnum.RESTART.getTitle());
             map = activitiService.customFlowStart(map);
             Long flowId = SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID));
             UpdateWrapper<ExamTask> updateWrapper = new UpdateWrapper<>();
@@ -504,22 +507,36 @@ public class ExamTaskDetailServiceImpl extends ServiceImpl<ExamTaskDetailMapper,
             mapVar.put(SystemConstant.SEND_FLOW_START_MQ, true);
 
             tfFlowJoinService.saveOrUpdate(map);
-            if (Objects.nonNull(flowId)) {
-                // 审核一级
-                Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).singleResult();
-                if (Objects.nonNull(task)) {
-                    Map<String, Object> approverMap = new HashMap<>();
-                    approverMap.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
-                    approverMap.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
-                    approverMap.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
-                    String remark = Objects.nonNull(sysOrg) ? sysOrg.getName() : "无机构";
-                    approverMap.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> requestUser.getRealName() + "(" + remark + ")" + FlowApprovePassEnum.RESTART.getTitle());
-                    activitiService.taskApprove(approverMap);
-                    mapVar.putAll(approverMap);
-                    mapVar.remove(SystemConstant.SEND_FLOW_START_MQ);
-                    mapVar.put(SystemConstant.SEND_FLOW_MQ, true);
-                }
-            }
+//            if (Objects.nonNull(flowId)) {
+//                // 审核一级
+//                Task task = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).singleResult();
+//                if (Objects.nonNull(task)) {
+//                    Map<String, Object> approverMap = new HashMap<>();
+//                    approverMap.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
+//                    approverMap.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
+//                    approverMap.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
+////                    map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> Arrays.asList(examTask.getUserId()));
+//                    String remark = Objects.nonNull(sysOrg) ? sysOrg.getName() : "无机构";
+//                    approverMap.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> requestUser.getRealName() + "(" + remark + ")" + FlowApprovePassEnum.RESTART.getTitle());
+//                    activitiService.taskApprove(approverMap);
+//
+//                    try {
+//                        Thread.sleep(1000);
+//                    } catch (InterruptedException e) {
+//                        e.printStackTrace();
+//                    }
+//                    Task taskReject = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).singleResult();
+//                    Map<String, Object> approverRejectMap = new HashMap<>();
+//                    approverRejectMap.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> taskReject.getId());
+//                    approverRejectMap.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
+//                    approverRejectMap.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.REJECT);
+//                    approverRejectMap.computeIfAbsent(SystemConstant.APPROVE_SETUP, v -> FlowApproveSetupEnum.SUBMIT.getSetup());
+//                    activitiService.taskApprove(approverRejectMap);
+//                    mapVar.putAll(approverMap);
+//                    mapVar.remove(SystemConstant.SEND_FLOW_START_MQ);
+//                    mapVar.put(SystemConstant.SEND_FLOW_MQ, true);
+//                }
+//            }
         }
         mapVar.put(SystemConstant.SUCCESS, true);
         return mapVar;

+ 6 - 6
distributed-print-business/src/main/resources/db/log/脚本-xiaof.sql

@@ -286,12 +286,12 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 
 UPDATE `sys_privilege` SET `related` = '490,540,667,669,671,672,754,855,882,883' WHERE (`id` = '670');
 UPDATE `sys_privilege` SET `name` = '分班阅(开关)', `url` = 'OpenClassReading', `type` = 'BUTTON', `sequence` = '9', `related` = NULL, `enable` = '1', `default_auth` = '0', `front_display` = '1' WHERE (`id` = '495');
-DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '496');
-DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '497');
-DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '666');
-DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '668');
-DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '753');
-DELETE FROM `distributed-print-3.2.7`.`sys_privilege` WHERE (`id` = '854');
+DELETE FROM `sys_privilege` WHERE (`id` = '496');
+DELETE FROM `sys_privilege` WHERE (`id` = '497');
+DELETE FROM `sys_privilege` WHERE (`id` = '666');
+DELETE FROM `sys_privilege` WHERE (`id` = '668');
+DELETE FROM `sys_privilege` WHERE (`id` = '753');
+DELETE FROM `sys_privilege` WHERE (`id` = '854');
 
 ALTER TABLE `exam_paper_structure`
     ADD COLUMN `is_finish` TINYINT(1) NULL DEFAULT 0 COMMENT '是否完成。根据status中组合状态计算。用于当查询条件' AFTER `status`;