فهرست منبع

绑定识别添加成员

ljy121 1 سال پیش
والد
کامیت
cccc26ed0d

+ 9 - 0
zjugis-business/src/main/java/com/zjugis/business/bean/entity/ProjectWorkerRelation.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
+import lombok.NoArgsConstructor;
 
 import java.time.LocalDateTime;
 
@@ -17,7 +18,15 @@ import java.time.LocalDateTime;
 
 
 @Data
+@NoArgsConstructor
 public class ProjectWorkerRelation{
+
+
+    public ProjectWorkerRelation(String projectId,String workerId){
+        this.projectId = projectId;
+        this.workerId = workerId;
+
+    }
 /**
      * ID
      */

+ 7 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/project/event/ProjectEvent.java

@@ -1,10 +1,12 @@
 package com.zjugis.business.flow.project.event;
 
 import com.zjugis.business.bean.entity.Project;
+import com.zjugis.business.bean.entity.ProjectWorkerRelation;
 import com.zjugis.business.constants.FlowStatusConstants;
 import com.zjugis.business.constants.XmztConstants;
 import com.zjugis.business.flow.project.service.FlowProjectService;
 import com.zjugis.business.service.ProjectService;
+import com.zjugis.business.service.ProjectWorkerRelationService;
 import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.workflow.exception.BusinessException;
 import com.zjugis.framework.workflow.model.BaseController;
@@ -40,6 +42,9 @@ public class ProjectEvent extends BaseController {
     @Resource
     private FlowProjectService flowProjectService;
 
+    @Autowired
+    private ProjectWorkerRelationService projectWorkerRelationService;
+
     @Autowired
     WorkflowClient workflowClient;
 
@@ -88,6 +93,8 @@ public class ProjectEvent extends BaseController {
                 entity.setXmzt(XmztConstants.STATUS_PROCESS);
                 entity.setFlowFinishtime(LocalDateTime.now());
                 flowProjectService.updateById(entity);
+                projectWorkerRelationService.bind(new ProjectWorkerRelation(entity.getId(),entity.getXmjlId()));
+                projectWorkerRelationService.bind(new ProjectWorkerRelation(entity.getId(),entity.getXsryId()));
                 return ok("true");
             } else {
                 throw new BusinessException("执行事件出错,请联系管理员!");