feat: 企标制修订流程-回显接口大部分逻辑
This commit is contained in:
+21
-72
@@ -1,11 +1,16 @@
|
||||
package com.jero.modules.activiti.process.esRevision.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -13,144 +18,88 @@ import lombok.Data;
|
||||
*/
|
||||
@TableName(value ="process_es_revision_advice")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class EsRevisionAdvice implements Serializable {
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String orgCode;
|
||||
|
||||
/**
|
||||
* 流程实例Id
|
||||
*/
|
||||
@ApiModelProperty(value = "流程实例Id")
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 执行id
|
||||
*/
|
||||
@ApiModelProperty(value = "执行id")
|
||||
private String executionId;
|
||||
|
||||
/**
|
||||
* 条款号
|
||||
*/
|
||||
@ApiModelProperty(value = "条款号")
|
||||
private String clauseNum;
|
||||
|
||||
/**
|
||||
* 条款名称
|
||||
*/
|
||||
@ApiModelProperty(value = "条款名称")
|
||||
private String clauseName;
|
||||
|
||||
/**
|
||||
* 修改意见内容(包括修改理由和依据)
|
||||
*/
|
||||
@ApiModelProperty(value = "修改意见内容(包括修改理由和依据)")
|
||||
private String editAdvice;
|
||||
|
||||
/**
|
||||
* 意见提出人
|
||||
*/
|
||||
@ApiModelProperty(value = "意见提出人")
|
||||
private String createUserId;
|
||||
|
||||
/**
|
||||
* 1采纳 2部分采纳 3不采纳
|
||||
*/
|
||||
@ApiModelProperty(value = "1采纳 2部分采纳 3不采纳")
|
||||
private String handleAdvice;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
EsRevisionAdvice other = (EsRevisionAdvice) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
|
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
|
||||
&& (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
|
||||
&& (this.getOrgCode() == null ? other.getOrgCode() == null : this.getOrgCode().equals(other.getOrgCode()))
|
||||
&& (this.getProcessInstanceId() == null ? other.getProcessInstanceId() == null : this.getProcessInstanceId().equals(other.getProcessInstanceId()))
|
||||
&& (this.getExecutionId() == null ? other.getExecutionId() == null : this.getExecutionId().equals(other.getExecutionId()))
|
||||
&& (this.getClauseNum() == null ? other.getClauseNum() == null : this.getClauseNum().equals(other.getClauseNum()))
|
||||
&& (this.getClauseName() == null ? other.getClauseName() == null : this.getClauseName().equals(other.getClauseName()))
|
||||
&& (this.getEditAdvice() == null ? other.getEditAdvice() == null : this.getEditAdvice().equals(other.getEditAdvice()))
|
||||
&& (this.getCreateUserId() == null ? other.getCreateUserId() == null : this.getCreateUserId().equals(other.getCreateUserId()))
|
||||
&& (this.getHandleAdvice() == null ? other.getHandleAdvice() == null : this.getHandleAdvice().equals(other.getHandleAdvice()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
|
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
|
||||
result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
result = prime * result + ((getOrgCode() == null) ? 0 : getOrgCode().hashCode());
|
||||
result = prime * result + ((getProcessInstanceId() == null) ? 0 : getProcessInstanceId().hashCode());
|
||||
result = prime * result + ((getExecutionId() == null) ? 0 : getExecutionId().hashCode());
|
||||
result = prime * result + ((getClauseNum() == null) ? 0 : getClauseNum().hashCode());
|
||||
result = prime * result + ((getClauseName() == null) ? 0 : getClauseName().hashCode());
|
||||
result = prime * result + ((getEditAdvice() == null) ? 0 : getEditAdvice().hashCode());
|
||||
result = prime * result + ((getCreateUserId() == null) ? 0 : getCreateUserId().hashCode());
|
||||
result = prime * result + ((getHandleAdvice() == null) ? 0 : getHandleAdvice().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", createBy=").append(createBy);
|
||||
sb.append(", createTime=").append(createTime);
|
||||
sb.append(", updateBy=").append(updateBy);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append(", orgCode=").append(orgCode);
|
||||
sb.append(", processInstanceId=").append(processInstanceId);
|
||||
sb.append(", executionId=").append(executionId);
|
||||
sb.append(", clauseNum=").append(clauseNum);
|
||||
sb.append(", clauseName=").append(clauseName);
|
||||
sb.append(", editAdvice=").append(editAdvice);
|
||||
sb.append(", createUserId=").append(createUserId);
|
||||
sb.append(", handleAdvice=").append(handleAdvice);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
+7
@@ -205,6 +205,13 @@ public class ProcessEsRevision implements Serializable {
|
||||
@ApiModelProperty(value = "相关部门领导")
|
||||
private String relatedLeader;
|
||||
|
||||
/**
|
||||
* 其他起草人上传文件Id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "其他起草人上传文件Id")
|
||||
private String otherDrafterUploadFileId;
|
||||
|
||||
/**
|
||||
* 总工程师
|
||||
*/
|
||||
|
||||
+6
@@ -3,6 +3,7 @@ package com.jero.modules.activiti.process.esRevision.entity.vo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
@@ -27,4 +28,9 @@ public class OtherDraftUserVO {
|
||||
|
||||
@ApiModelProperty(value = "文件ID")
|
||||
private String fileId;
|
||||
|
||||
public String getISODeadlineTime() {
|
||||
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
|
||||
return isoFormat.format(this.deadline);
|
||||
}
|
||||
}
|
||||
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.jero.modules.activiti.process.esRevision.listener;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.TaskService;
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/12/21 14:01
|
||||
* @Description: 其他起草人上传文件节点需要设置每个节点的截止时间也就是流程图上
|
||||
* 的时间边界事件,需要从流程变量中取出对应的时间然后放入对应子流程中
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class OtherDrafterUploadCreateListener implements ExecutionListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
log.info("企标制修订流程 其他起草人上传节点 创建监听执行器开始执行");
|
||||
// 获取流程实例ID
|
||||
String processInstanceId = delegateExecution.getProcessInstanceId();
|
||||
// 获取执行人
|
||||
String otherDraftUser = (String) delegateExecution.getVariable("otherDraftUser");
|
||||
// 获取对应的结束时间
|
||||
String deadline = (String) delegateExecution.getVariable(otherDraftUser + "-deadline");
|
||||
// 设置流程变量
|
||||
delegateExecution.setVariableLocal("deadline", deadline);
|
||||
log.info("企标制修订流程 其他起草人上传节点 创建监听执行器开始执行");
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -1,8 +1,16 @@
|
||||
package com.jero.modules.activiti.process.esRevision.listener;
|
||||
|
||||
import org.activiti.engine.delegate.DelegateExecution;
|
||||
import org.activiti.engine.delegate.ExecutionListener;
|
||||
|
||||
/**
|
||||
* @author: Mzaxd
|
||||
* @Date: 2023/12/19 11:59
|
||||
*/
|
||||
public class ProcessESRevisionEndListener {
|
||||
public class ProcessESRevisionEndListener implements ExecutionListener {
|
||||
|
||||
@Override
|
||||
public void notify(DelegateExecution delegateExecution) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+76
-13
@@ -12,13 +12,14 @@ import com.jero.modules.activiti.enums.ProcessTypeEnum;
|
||||
import com.jero.modules.activiti.process.common.entity.CommonVO;
|
||||
import com.jero.modules.activiti.process.common.enums.ProcessType;
|
||||
import com.jero.modules.activiti.process.common.service.ActFlowCommonService;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.enums.ESPRevisionType;
|
||||
import com.jero.modules.activiti.process.esRevision.entity.EsRevisionAdvice;
|
||||
import com.jero.modules.activiti.process.esRevision.entity.vo.InspectContentVO;
|
||||
import com.jero.modules.activiti.process.esRevision.entity.vo.OtherDraftUserVO;
|
||||
import com.jero.modules.activiti.process.esRevision.entity.ProcessEsRevision;
|
||||
import com.jero.modules.activiti.process.esRevision.entity.vo.ESRevisionDataVO;
|
||||
import com.jero.modules.activiti.process.esRevision.entity.vo.ReviewMeetingDetailVO;
|
||||
import com.jero.modules.activiti.process.esRevision.service.EsRevisionAdviceService;
|
||||
import com.jero.modules.activiti.process.esRevision.service.EsRevisionService;
|
||||
import com.jero.modules.activiti.process.esRevision.mapper.EsRevisionMapper;
|
||||
import com.jero.modules.activiti.process.fb.dto.BasicProcessInfoDTO;
|
||||
@@ -28,7 +29,6 @@ import com.jero.modules.activiti.service.ProcessAllService;
|
||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandardPlan;
|
||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardPlanService;
|
||||
import com.jero.modules.laws.standard.entity.LawsEnterpriseStandard;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.RuntimeService;
|
||||
@@ -45,15 +45,15 @@ import java.util.stream.Collectors;
|
||||
import static com.jero.modules.activiti.process.esRevision.entity.RevisionTaskNodeIdConstant.*;
|
||||
|
||||
/**
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_revision】的数据库操作Service实现
|
||||
* @createDate 2023-12-19 11:58:59
|
||||
*/
|
||||
* @author ThinkBook
|
||||
* @description 针对表【process_es_revision】的数据库操作Service实现
|
||||
* @createDate 2023-12-19 11:58:59
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
@Transactional(rollbackFor = JeroBootException.class)
|
||||
public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, ProcessEsRevision>
|
||||
implements EsRevisionService{
|
||||
implements EsRevisionService {
|
||||
|
||||
@Resource
|
||||
private ActFlowCommonService actFlowCommonService;
|
||||
@@ -76,6 +76,9 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
@Resource
|
||||
private EnterpriseStandardPlanService espService;
|
||||
|
||||
@Resource
|
||||
private EsRevisionAdviceService adviceService;
|
||||
|
||||
@Override
|
||||
public void startProcess(ESRevisionDataVO revisionData) {
|
||||
// 执行流程发起前的操作
|
||||
@@ -147,7 +150,7 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
@Override
|
||||
public void autoStartProcess(ESRevisionDataVO revisionData) {
|
||||
// 自动发起制修订流程 需要定义制定还是修订 并且存储对应的企标计划id 所有数据由第一个节点之后再保存
|
||||
// 1. 根据企标编号找到对应企标的主起草人
|
||||
// 1. 找到对应企标的主起草人
|
||||
String espId = revisionData.getData().getEspId();
|
||||
EnterpriseStandardPlan esp = espService.getById(espId);
|
||||
String mainDraftUser = esp.getMainDraftingUser();
|
||||
@@ -205,10 +208,18 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
commonVO.setDueTime(process.getDueTime());
|
||||
commonVO.setNodeId(process.getNodeId());
|
||||
revisionDataVO.setCommon(commonVO);
|
||||
ProcessApprovalRecord record = actFlowCommonService.getNodeIdByTaskId(taskId);
|
||||
String xmlNodeId = record.getNodeId();
|
||||
// 获取流程实例数据
|
||||
LambdaQueryWrapper<ProcessEsRevision> wrapper = new LambdaQueryWrapper<>();
|
||||
LambdaQueryWrapper<EsRevisionAdvice> advicesWrapper = new LambdaQueryWrapper<>();
|
||||
advicesWrapper.eq(EsRevisionAdvice::getProcessInstanceId, processInstanceId);
|
||||
advicesWrapper.eq(EsRevisionAdvice::getExecutionId, executionId);
|
||||
List<EsRevisionAdvice> adviceList = adviceService.list(advicesWrapper);
|
||||
wrapper.eq(ProcessEsRevision::getProcessInstanceId, processInstanceId);
|
||||
revisionDataVO.setData(getOne(wrapper));
|
||||
ProcessEsRevision data = getOne(wrapper);
|
||||
data.setAdvices(adviceList);
|
||||
revisionDataVO.setData(data);
|
||||
return revisionDataVO;
|
||||
}
|
||||
|
||||
@@ -238,13 +249,36 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
|
||||
String processDefinitionId = processInstance.getProcessDefinitionId();
|
||||
Map<String, Object> userMap = new HashMap<>();
|
||||
List<EsRevisionAdvice> advices;
|
||||
ProcessEsRevision data;
|
||||
switch (xmlNodeId) {
|
||||
case MAIN_DRAFT_USER_DISTRIBUTE:
|
||||
// TODO 判断是否分发 设置流程变量 别忘了时间边界变量
|
||||
// 判断是否分发 设置流程变量
|
||||
data = revisionData.getData();
|
||||
List<OtherDraftUserVO> otherDraftUserVOS = data.getOtherDraftUserVOS();
|
||||
if (otherDraftUserVOS == null || otherDraftUserVOS.isEmpty()) {
|
||||
taskService.setVariable(taskId, "distribute", false);
|
||||
} else {
|
||||
taskService.setVariable(taskId, "distribute", true);
|
||||
taskService.setVariable(taskId, "otherDraftUserList", otherDraftUserVOS.stream().map(OtherDraftUserVO::getUser)
|
||||
.collect(Collectors.toList()));
|
||||
// 遍历其他起草人列表,将截止时间放置到流程变量中
|
||||
Map<String, Object> deadlineMap = new HashMap<>();
|
||||
otherDraftUserVOS.forEach(otherDraftUserVO -> deadlineMap
|
||||
.put(otherDraftUserVO.getUser() + "-deadline", otherDraftUserVO.getISODeadlineTime()));
|
||||
taskService.setVariables(taskId, deadlineMap);
|
||||
}
|
||||
break;
|
||||
case OTHER_DRAFT_USER_UPLOAD:
|
||||
// TODO
|
||||
data = revisionData.getData();
|
||||
ProcessEsRevision dataDb = getOne(wrapper);
|
||||
List<OtherDraftUserVO> otherDraftUserVOListDB = dataDb.parseOtherDraftUserVOS();
|
||||
Map<String, OtherDraftUserVO> map = otherDraftUserVOListDB.stream()
|
||||
.collect(Collectors.toMap(OtherDraftUserVO::getUser, o -> o));
|
||||
OtherDraftUserVO otherDraftUserVO = map.get(userId);
|
||||
otherDraftUserVO.setFileId(data.getOtherDrafterUploadFileId());
|
||||
dataDb.setOtherDrafterUploadFileJson(otherDraftUserVOListDB);
|
||||
saveOrUpdate(dataDb);
|
||||
break;
|
||||
case MAIN_DRAFT_USER_COLLECT_FIRST:
|
||||
// 判断是否需要稽查 设置流程变量 保存稽查列表
|
||||
@@ -290,14 +324,43 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
}
|
||||
break;
|
||||
case CONTACT_USER_DISTRIBUTE:
|
||||
data = revisionData.getData();
|
||||
Map<String, Object> flowUser = revisionData.getFlowUser();
|
||||
String adviceUsers = (String) flowUser.get("adviceUserList");
|
||||
List<String> adviceUserList = Arrays.asList(adviceUsers.split(","));
|
||||
taskService.setVariable(taskId, "adviceUserList", adviceUserList);
|
||||
userMap.put("adviceUserList", adviceUserList);
|
||||
saveOrUpdate(data);
|
||||
break;
|
||||
case ADVICE:
|
||||
data = revisionData.getData();
|
||||
advices = data.getAdvices();
|
||||
advices.forEach(advice -> advice.setCreateUserId(userId));
|
||||
advices.forEach(advice -> advice.setProcessInstanceId(processInstanceId));
|
||||
advices.forEach(advice -> advice.setExecutionId(executionId));
|
||||
adviceService.saveBatch(advices);
|
||||
break;
|
||||
case CONTACT_USER_COLLECT:
|
||||
break;
|
||||
case CONTACT_USER_LEADER_APPROVAL:
|
||||
// 保存流程数据
|
||||
data = revisionData.getData();
|
||||
saveOrUpdate(data);
|
||||
// 保存征求意见记录 先删后增
|
||||
adviceService.remove(new LambdaQueryWrapper<EsRevisionAdvice>()
|
||||
.eq(EsRevisionAdvice::getProcessInstanceId, processInstanceId)
|
||||
.eq(EsRevisionAdvice::getExecutionId, executionId));
|
||||
advices = data.getAdvices();
|
||||
advices.forEach(advice -> advice.setProcessInstanceId(processInstanceId));
|
||||
advices.forEach(advice -> advice.setExecutionId(executionId));
|
||||
adviceService.saveBatch(advices);
|
||||
break;
|
||||
case MAIN_DRAFT_USER_COLLECT_SECOND:
|
||||
// 保存流程数据
|
||||
data = revisionData.getData();
|
||||
saveOrUpdate(data);
|
||||
// 更改保存征求意见记录
|
||||
advices = data.getAdvices();
|
||||
adviceService.saveOrUpdateBatch(advices);
|
||||
break;
|
||||
case MAIN_DRAFT_USER_UPLOAD:
|
||||
// 设置后续节点的办理人
|
||||
@@ -316,7 +379,7 @@ public class EsRevisionServiceImpl extends ServiceImpl<EsRevisionMapper, Process
|
||||
saveOrUpdate(data);
|
||||
break;
|
||||
case MAIN_DRAFT_USER_RELEASE:
|
||||
// do nothing now
|
||||
// do nothing now TODO 在线编辑 插入签章
|
||||
break;
|
||||
}
|
||||
if (pass) {
|
||||
|
||||
Reference in New Issue
Block a user