Browse Source

自定义流程接口-修复命题任务申请BUG

wangliang 3 years ago
parent
commit
97adbcd4e5

+ 6 - 16
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -266,22 +266,12 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
 
             if (Objects.nonNull(examTask.getUserId())) {
             if (Objects.nonNull(examTask.getUserId())) {
                 examStatusEnum = ExamStatusEnum.STAGE;
                 examStatusEnum = ExamStatusEnum.STAGE;
-//                Map<String, Object> map = new HashMap<>();
-//                map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
-//                map.computeIfAbsent(SystemConstant.TEACHING_ROOM_ID, v -> examTask.getTeachingRoomId());
-//                ProcessInstance processInstance = activitiService.flowStart(map);
-//                flowId = SystemConstant.convertIdToLong(processInstance.getId());
-//                Map<String, Object> texamTaskFlowMap = new HashMap<>();
-//                texamTaskFlowMap.computeIfAbsent(SystemConstant.SCHOOL_ID, v -> examTask.getSchoolId());
-//                texamTaskFlowMap.computeIfAbsent(SystemConstant.EXAM_TASK_ID, v -> examTask.getId());
-//                texamTaskFlowMap.computeIfAbsent(SystemConstant.FLOW_ID, v -> SystemConstant.convertIdToLong(processInstance.getId()));
-//                tExamTaskFlowService.saveOrUpdate(texamTaskFlowMap);
-
                 Map<String, Object> map = new HashMap<>();
                 Map<String, Object> map = new HashMap<>();
                 map.computeIfAbsent(SystemConstant.OBJECT_ID, v -> examTask.getId());
                 map.computeIfAbsent(SystemConstant.OBJECT_ID, v -> examTask.getId());
                 map.computeIfAbsent(SystemConstant.FLOW_TYPE, v -> TFCustomTypeEnum.ELECTRON_FLOW);
                 map.computeIfAbsent(SystemConstant.FLOW_TYPE, v -> TFCustomTypeEnum.ELECTRON_FLOW);
                 map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> examTask.getUserId());
                 map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> examTask.getUserId());
                 map = activitiService.customFlowStart(map);
                 map = activitiService.customFlowStart(map);
+                flowId = SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID));
                 tfFlowJoinService.saveOrUpdate(map);
                 tfFlowJoinService.saveOrUpdate(map);
             }
             }
         }
         }
@@ -425,21 +415,21 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             Long teachingRoomId = basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, courseCode);
             Long teachingRoomId = basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, courseCode);
             examTask.setOrgId(teachingRoomId);
             examTask.setOrgId(teachingRoomId);
             examTask.setTeachingRoomId(teachingRoomId);
             examTask.setTeachingRoomId(teachingRoomId);
-            Map<String, Object> map = new HashMap<>();
-            map.computeIfAbsent(SystemConstant.OBJECT_ID, v -> examTask.getId());
-            map.computeIfAbsent(SystemConstant.FLOW_TYPE, v -> TFCustomTypeEnum.ELECTRON_FLOW);
-            map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> examTask.getUserId());
             if (examTask.getUserId() == null) {
             if (examTask.getUserId() == null) {
                 examTask.setStatus(ExamStatusEnum.DRAFT);
                 examTask.setStatus(ExamStatusEnum.DRAFT);
             } else if (examTask.getReview()) {
             } else if (examTask.getReview()) {
                 examTask.setStatus(ExamStatusEnum.STAGE);
                 examTask.setStatus(ExamStatusEnum.STAGE);
+                Map<String, Object> map = new HashMap<>();
+                map.computeIfAbsent(SystemConstant.OBJECT_ID, v -> examTask.getId());
+                map.computeIfAbsent(SystemConstant.FLOW_TYPE, v -> TFCustomTypeEnum.ELECTRON_FLOW);
+                map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> examTask.getUserId());
                 map = activitiService.customFlowStart(map);
                 map = activitiService.customFlowStart(map);
                 examTask.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
                 examTask.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
+                tfFlowJoinService.saveOrUpdate(map);
             } else if (!examTask.getReview()) {
             } else if (!examTask.getReview()) {
                 examTask.setStatus(ExamStatusEnum.STAGE);
                 examTask.setStatus(ExamStatusEnum.STAGE);
             }
             }
             this.save(examTask);
             this.save(examTask);
-            tfFlowJoinService.saveOrUpdate(map);
         } catch (Exception e) {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             log.error(SystemConstant.LOG_ERROR, e);
             if (e instanceof ActivitiObjectNotFoundException) {
             if (e instanceof ActivitiObjectNotFoundException) {