Przeglądaj źródła

sop编辑和保存修改

wangliang 1 rok temu
rodzic
commit
2ae3e63f96

+ 3 - 2
sop-api/src/main/java/com/qmth/sop/server/api/TFCustomFlowController.java

@@ -85,8 +85,9 @@ public class TFCustomFlowController {
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result formPropertiesGet(@ApiParam(value = "流程部署id") @RequestParam(required = false) String flowDeploymentId,
                                     @ApiParam(value = "流程id") @RequestParam(required = false) Long flowId,
-                                    @ApiParam(value = "流程任务id") @RequestParam(required = false) Long taskId) throws Exception {
-        return ResultUtil.ok(activitiService.formPropertiesGet(flowDeploymentId, flowId, taskId, false));
+                                    @ApiParam(value = "流程任务id") @RequestParam(required = false) Long taskId,
+                                    @ApiParam(value = "crm单号") @RequestParam(required = false) String crmNo) throws Exception {
+        return ResultUtil.ok(activitiService.formPropertiesGet(flowDeploymentId, flowId, taskId, false, crmNo));
     }
 
     @ApiOperation(value = "流程审批接口")

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/activiti/service/ActivitiService.java

@@ -63,9 +63,10 @@ public interface ActivitiService {
      * @param flowId
      * @param taskId
      * @param dynamicTable
+     * @param crmNo
      * @return
      */
-    public Map<String, Object> formPropertiesGet(String flowDeploymentId, Long flowId, Long taskId, Boolean dynamicTable) throws Exception;
+    public Map<String, Object> formPropertiesGet(String flowDeploymentId, Long flowId, Long taskId, Boolean dynamicTable, String crmNo) throws Exception;
 
     /**
      * 获取用户待办

+ 21 - 5
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -112,6 +112,9 @@ public class ActivitiServiceImpl implements ActivitiService {
     @Resource
     TBSopInfoService tbSopInfoService;
 
+    @Resource
+    TBCrmService tbCrmService;
+
     /**
      * 根据deploymentId查找processDefinitionId
      *
@@ -137,7 +140,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         DeploymentBuilder builder = repositoryService.createDeployment();
         ZipInputStream zip = new ZipInputStream(file.getInputStream());
         builder.addZipInputStream(zip);
-        return formPropertiesGet(builder.deploy().getId(), null, null, true);
+        return formPropertiesGet(builder.deploy().getId(), null, null, true, null);
     }
 
     /**
@@ -157,10 +160,10 @@ public class ActivitiServiceImpl implements ActivitiService {
                 ClassPathResource resource = new ClassPathResource(tfCustomTypeEnum.getFileName());
                 ZipInputStream zip = new ZipInputStream(resource.getInputStream());
                 builder.addZipInputStream(zip);
-                Map<String, Object> mapData = formPropertiesGet(builder.deploy().getId(), null, null, true);
+                Map<String, Object> mapData = formPropertiesGet(builder.deploy().getId(), null, null, true, null);
                 map.put(tfCustomTypeEnum.name(), mapData);
             } else {
-                Map<String, Object> mapData = formPropertiesGet(tfCustomFlowList.get(0).getFlowDeploymentId(), null, null, true);
+                Map<String, Object> mapData = formPropertiesGet(tfCustomFlowList.get(0).getFlowDeploymentId(), null, null, true, null);
                 map.put(tfCustomTypeEnum.name(), mapData);
             }
         }
@@ -412,6 +415,7 @@ public class ActivitiServiceImpl implements ActivitiService {
      * @param flowId
      * @param taskId
      * @param dynamicTable
+     * @param crmNo
      * @return
      */
     @Override
@@ -419,7 +423,8 @@ public class ActivitiServiceImpl implements ActivitiService {
     public Map<String, Object> formPropertiesGet(String flowDeploymentId,
                                                  Long flowId,
                                                  Long taskId,
-                                                 Boolean dynamicTable) throws Exception {
+                                                 Boolean dynamicTable,
+                                                 String crmNo) throws Exception {
         Map<String, Object> map = new HashMap<>();
         FlowResult flowResult = null;
         TFCustomFlow tfCustomFlow = null;
@@ -469,6 +474,12 @@ public class ActivitiServiceImpl implements ActivitiService {
         }
         map.put(SystemConstant.FLOW_DEPLOYMENT_ID, tfCustomFlow.getFlowDeploymentId());
         map.put(SystemConstant.ID, tfCustomFlow.getId());
+        if (Objects.nonNull(crmNo)) {
+            CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectBySopNoOrCrmNo(null, crmNo);
+            if (Objects.nonNull(crmProjectResult)) {
+                map.put(SystemConstant.CRM_INFO, crmProjectResult);
+            }
+        }
         return map;
     }
 
@@ -721,6 +732,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (Objects.isNull(flowId) && Objects.isNull(code)) {
             throw ExceptionResultEnum.ERROR.exception("流程id和流程编码必须有一个不能为空");
         }
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
         TFCustomFlowEntity tfCustomFlowEntity = null;
         if (Objects.nonNull(flowId)) {
             tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
@@ -769,7 +781,11 @@ public class ActivitiServiceImpl implements ActivitiService {
                 }
             }
         }
-        return new FlowViewResult(flowId, tfFlowApprove.getStatus(), String.valueOf(tfFlowApprove.getId()), taskIdList, flowTaskHistoryList, currFlowTaskResult, flowApproveHistoryList);
+        CrmProjectResult crmProjectResult = null;
+        if (Objects.nonNull(tfCustomFlowEntity.getCrmNo())) {
+            crmProjectResult = tbCrmService.findCrmProjectBySopNoOrCrmNo(tfCustomFlowEntity.getCode(), tfCustomFlowEntity.getCrmNo());
+        }
+        return new FlowViewResult(flowId, tfFlowApprove.getStatus(), tfCustomFlowEntity.getCode(), taskIdList, flowTaskHistoryList, currFlowTaskResult, flowApproveHistoryList, crmProjectResult);
     }
 
     /**

+ 13 - 1
sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowViewResult.java

@@ -47,11 +47,22 @@ public class FlowViewResult extends BaseFlowData implements Serializable {
     @ApiModelProperty(value = "流程审批信息")
     List<TFFlowViewLogResult> flowApproveHistoryList;
 
+    @ApiModelProperty(value = "crm信息")
+    CrmProjectResult crmInfo;
+
+    public CrmProjectResult getCrmInfo() {
+        return crmInfo;
+    }
+
+    public void setCrmInfo(CrmProjectResult crmInfo) {
+        this.crmInfo = crmInfo;
+    }
+
     public FlowViewResult() {
 
     }
 
-    public FlowViewResult(Long flowId, FlowStatusEnum status, String sopNo, List<Long> taskIdList, List<FlowTaskResult> flowTaskHistoryList, FlowTaskResult currFlowTaskResult, List<TFFlowViewLogResult> flowApproveHistoryList) {
+    public FlowViewResult(Long flowId, FlowStatusEnum status, String sopNo, List<Long> taskIdList, List<FlowTaskResult> flowTaskHistoryList, FlowTaskResult currFlowTaskResult, List<TFFlowViewLogResult> flowApproveHistoryList, CrmProjectResult crmInfo) {
         this.flowId = flowId;
         this.status = status;
         this.sopNo = sopNo;
@@ -59,6 +70,7 @@ public class FlowViewResult extends BaseFlowData implements Serializable {
         this.flowTaskHistoryList = flowTaskHistoryList;
         this.flowApproveHistoryList = flowApproveHistoryList;
         this.currFlowTaskResult = currFlowTaskResult;
+        this.crmInfo = crmInfo;
     }
 
     public Long getFlowId() {

+ 0 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -490,9 +490,6 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
 
         tfCustomFlowEntity.setObjId(tbSopInfo.getId());
         tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
-
-        //todo 查询派单信息
-        tbCrmService.findCrmProjectBySopNoOrCrmNo(sopNo, crmNo);
         return tbSopInfoService.save(tbSopInfo);
     }
 

+ 8 - 8
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -42,23 +42,23 @@
     </select>
 
     <select id="list" resultType="java.util.Map">
-        select distinct tbsi.id,
-               tbs.id as serviceId,
+        select distinct cast(tbsi.id as char) as id,
+               cast(tbs.id as char) as serviceId,
                tbs.name as serviceName,
                tbsi.sop_no as sopNo,
                tbsi.crm_no as crmNo,
                tbc.begin_time as beginTime,
-               sc.manager_id as customManagerId,
+               cast(sc.manager_id as char) as customManagerId,
                su1.real_name as customManagerName,
                sc.type as customManagerType,
                IF(sc.type = 'OFFICE','教务处','研究生') as customManagerTypeStr,
                sc.name as customName,
                tbc.name as crmName,
-               tbp.id as productId,
+               cast(tbp.id as char) as productId,
                tbp.name as productName,
                tbc.exam_start_time as examStartTime,
                tbc.exam_end_time as examEndTime,
-               tfcfe.create_id as flowCreateId,
+               cast(tfcfe.create_id as char) as flowCreateId,
                su2.real_name as flowCreateName,
                tffa.create_time as flowCreateTime,
                tffa.update_time as flowUpdateTime,
@@ -71,11 +71,11 @@
                tfcf.type,
                IF(tfcf.type = 'OFFICE_SOP_FLOW','教务处SOP','研究生SOP') as typeStr,
                tfcf.version,
-               tfcf.flow_deployment_id as flowDeploymentId,
-               art.PROC_INST_ID_ as flowId,
+               cast(tfcf.flow_deployment_id as char) as flowDeploymentId,
+               cast(art.PROC_INST_ID_ as char) as flowId,
                art.NAME_ as taskName,
                art.TASK_DEF_KEY_ as taskDefKey,
-               art.ID_ as taskId,
+               cast(art.ID_ as char) as taskId,
                (select group_concat(us1.real_name SEPARATOR ';') from sys_user us1
                 where find_in_set(us1.id, (select tffl.pend_approve_id from t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id order by tffl.create_time desc limit 1))) as pendApproveName
                 <if test="fieldName != null and fieldName != ''">

+ 1 - 0
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -290,6 +290,7 @@ public class SystemConstant {
     public static final String FLOW_APPROVE_LOG = "tfFlowApproveLog";
     public static final String FLOW_ENTITY = "tfCustomFlowEntity";
     public static final String FLOW_SYS_USER = "sysUser";
+    public static final String CRM_INFO = "crmInfo";
 
     /**
      * 锁