Parcourir la source

保存自动生成流程描述

jzh il y a 1 an
Parent
commit
a908799ddc

+ 5 - 4
zjugis-business/src/main/java/com/zjugis/business/flow/interview/service/InterviewServiceImpl.java

@@ -81,7 +81,7 @@ public class InterviewServiceImpl implements InterviewService {
     @Override
     public void update(InterviewVO vo) {
         //当userid为空时说明是新用户 这时候需要校验手机号唯一性
-        if(StrUtil.isEmpty(vo.getUserId())){
+        if (StrUtil.isEmpty(vo.getUserId())) {
             validMobile(vo.getMobile());
         }
         validIdCard(vo.getSfzh());
@@ -90,9 +90,10 @@ public class InterviewServiceImpl implements InterviewService {
 
 
         //保存时生成流程描述
-        String applyTime = LocalDateTimeUtils.format(interviewDO.getCreateTime(), null);
-        String flowDesc = StringUtils.join(Arrays.asList(interviewDO.getNickname(), applyTime, interviewDO.getDeptName()), "/");
-        workflowClient.saveFlowDescribe(interviewDO.getInstanceId(), flowDesc);
+        InterviewDO entity = interviewDAO.selectById(interviewDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     private void validIdCard(String idCard) {

+ 4 - 4
zjugis-business/src/main/java/com/zjugis/business/flow/jobTransfer/service/impl/JobTransferServiceImpl.java

@@ -104,10 +104,10 @@ public class JobTransferServiceImpl implements JobTransferService {
         JobTransferDO jobTransferDO = JobTransferConvert.INSTANCE.convert(updateReqVO);
         jobTransferDAO.updateById(jobTransferDO);
 
-
-        String applyTime = LocalDateTimeUtils.format(jobTransferDO.getCreateTime(), null);
-        String flowDesc = StringUtils.join(Arrays.asList(jobTransferDO.getNickname(), applyTime, jobTransferDO.getDeptName()), "/");
-        workflowClient.saveFlowDescribe(jobTransferDO.getInstanceId(), flowDesc);
+        JobTransferDO entity= jobTransferDAO.selectById(jobTransferDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     @Override

+ 4 - 4
zjugis-business/src/main/java/com/zjugis/business/flow/recruit/service/impl/RecruitDemandServiceImpl.java

@@ -116,10 +116,10 @@ public class RecruitDemandServiceImpl implements RecruitDemandService {
         }
 
 
-
-        String applyTime = LocalDateTimeUtils.format(detailDO.getCreateTime(), null);
-        String flowDesc = StringUtils.join(Arrays.asList(detailDO.getUserNickname(), applyTime, detailDO.getDeptName()), "/");
-        workflowClient.saveFlowDescribe(detailDO.getInstanceId(), flowDesc);
+        RecruitDO entity = recruitDAO.selectById(detailDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getUserNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     @Transactional(rollbackFor = Exception.class)

+ 4 - 3
zjugis-business/src/main/java/com/zjugis/business/flow/regular/service/impl/RegularServiceImpl.java

@@ -93,9 +93,10 @@ public class RegularServiceImpl implements RegularService {
         RegularDO regularDO = RegularConvert.INSTANCE.convert(updateReqVO);
         regularDAO.updateById(regularDO);
 
-        String applyTime = LocalDateTimeUtils.format(regularDO.getCreateTime(), null);
-        String flowDesc = StringUtils.join(Arrays.asList(regularDO.getNickname(), applyTime, regularDO.getDeptName()), "/");
-        workflowClient.saveFlowDescribe(regularDO.getInstanceId(), flowDesc);
+        RegularDO entity =regularDAO.selectById(regularDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     private void validateExists(String id) {

+ 6 - 5
zjugis-business/src/main/java/com/zjugis/business/flow/resign/service/impl/ResignServiceImpl.java

@@ -133,13 +133,13 @@ public class ResignServiceImpl implements ResignService {
     @Transactional
     @Override
     public void update(ResignPageReqVO vo) {
-        ResignDO aDo=resignDAO.selectById(vo.getId());
+        ResignDO aDo = resignDAO.selectById(vo.getId());
         if (aDo == null) {
             throw exception(RESIGN_NOT_EXISTS);
         }
 
         ResignApplyDO resignApplyDO = resignApplyService.findByUserId(aDo.getUserId());
-        if(resignApplyDO==null){
+        if (resignApplyDO == null) {
             throw exception(RESIGN_APPLY_FIRST);
         }
 
@@ -172,9 +172,10 @@ public class ResignServiceImpl implements ResignService {
         }
 
 
-        String applyTime = LocalDateTimeUtils.format(resignDO.getCreateTime(), null);
-        String flowDesc = StringUtils.join(Arrays.asList(resignDO.getNickname(), applyTime, resignDO.getDeptName()), "/");
-        workflowClient.saveFlowDescribe(resignDO.getInstanceId(), flowDesc);
+        ResignDO entity = resignDAO.selectById(resignDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
 
     }
 

+ 5 - 3
zjugis-business/src/main/java/com/zjugis/business/flow/resignApply/service/impl/ResignApplyApplyServiceImpl.java

@@ -107,9 +107,11 @@ public class ResignApplyApplyServiceImpl implements ResignApplyService {
         ResignApplyDO resignDO = ResignApplyConvert.INSTANCE.convert01(vo);
         resignApplyDAO.updateById(resignDO);
 
-        String applyTime = LocalDateTimeUtils.format(resignDO.getCreateTime(), null);
-        String flowDesc = StringUtils.join(Arrays.asList(resignDO.getNickname(), applyTime, resignDO.getDeptName()), "/");
-        workflowClient.saveFlowDescribe(resignDO.getInstanceId(), flowDesc);
+
+        ResignApplyDO entity=resignApplyDAO.selectById(resignDO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     @Transactional

+ 9 - 0
zjugis-business/src/main/java/com/zjugis/business/flow/staff/service/impl/StaffServiceImpl.java

@@ -22,6 +22,7 @@ import com.zjugis.business.flow.staff.service.StaffService;
 import com.zjugis.business.utils.IdCardUtil;
 import com.zjugis.framework.common.pojo.CommonResult;
 import com.zjugis.framework.common.pojo.PageResult;
+import com.zjugis.framework.common.util.date.LocalDateTimeUtils;
 import com.zjugis.framework.mybatis.core.query.LambdaQueryWrapperX;
 import com.zjugis.framework.workflow.model.IFlowInstance;
 import com.zjugis.framework.workflow.rpc.remote.WorkflowClient;
@@ -32,6 +33,7 @@ import com.zjugis.module.adm.api.staff.dto.StaffStateDTO;
 import com.zjugis.module.system.api.dict.DictDataApi;
 import com.zjugis.module.system.api.dict.dto.DictDataRespDTO;
 import com.zjugis.module.system.api.user.AdminUserApi;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -41,6 +43,7 @@ import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+import static com.zjugis.business.constants.FlowStatusConstants.FLOW_PROCESS;
 import static com.zjugis.business.enums.ErrorCodeConstants.STAFF_NOT_EXISTS;
 import static com.zjugis.framework.common.exception.util.ServiceExceptionUtil.exception;
 import static com.zjugis.framework.common.util.collection.CollectionUtils.convertSet;
@@ -92,6 +95,12 @@ public class StaffServiceImpl implements StaffService {
         }
 
         staffDAO.updateById(staffDO);
+
+
+        StaffDO entity=staffDAO.selectById(staffVO.getId());
+        String applyTime = LocalDateTimeUtils.format(entity.getCreateTime(), null);
+        String flowDesc = StringUtils.join(Arrays.asList(entity.getNickname(), applyTime, entity.getDeptName()), "/");
+        workflowClient.saveFlowDescribe(entity.getInstanceId(), flowDesc);
     }
 
     @Transactional(rollbackFor = Exception.class)