wangliang 9 月之前
父节点
当前提交
0079f0ae11

+ 4 - 14
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -850,20 +850,6 @@ public class ActivitiServiceImpl implements ActivitiService {
             }
 
             TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
-            //            TFCustomFlow tfCustomFlow = tfCustomFlowService.findById(tfCustomFlowEntity.gettFCustomFlowId());
-
-            //            if (tfCustomFlow.getType() == TFCustomTypeEnum.OFFICE_SOP_FLOW && tfFlowApprove.getSetup().intValue() >= 4
-            //                    && tfFlowApprove.getSetup().intValue() < 8) {
-            //                FlowTaskResult flowTaskResultDeviceOut = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 4);
-            //                tbDeviceDeliveryService.updateDeviceRelated(flowTaskResultDeviceOut, tfCustomFlowEntity.getCode(), null,
-            //                        sysUser.getId(), false);
-            //            } else if (tfCustomFlow.getType() == TFCustomTypeEnum.CLOUD_MARK_SOP_FLOW
-            //                    && tfFlowApprove.getSetup().intValue() >= 4) {
-            //                FlowTaskResult flowTaskResultDeviceOut = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 4);
-            //                tbDeviceDeliveryService.updateDeviceRelated(flowTaskResultDeviceOut, tfCustomFlowEntity.getCode(),
-            //                        DeviceDeliveryStatusEnum.RECEIVE, sysUser.getId(), true);
-            //            }
-
             FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
             LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
             List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
@@ -884,6 +870,10 @@ public class ActivitiServiceImpl implements ActivitiService {
             tfFlowApprove.setSetup(FlowApproveSetupEnum.END.getSetup());
             tfFlowApproveService.updateById(tfFlowApprove);
 
+            int count = tfFlowApproveService.findFlowPassageSopByCrmNo(tfCustomFlowEntity.getCrmNo());
+            if (count == 0) {
+                tbCrmService.updateCrmStatus(tfCustomFlowEntity.getCrmNo(), CrmStatusEnum.UN_PUBLISH);
+            }
             runtimeService.deleteProcessInstance(String.valueOf(flowId), "结束");
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);