feat: 企标更改流程部分字段翻译

This commit is contained in:
2023-12-06 11:41:11 +08:00
parent 6b6a1c71f8
commit 09c4f87e8d
5 changed files with 50 additions and 2 deletions
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -89,6 +90,20 @@ public class EsChangeOpinion implements Serializable {
@ApiModelProperty(value = "修改理由")
private String updateReason;
/**
* 提出人
*/
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
@ApiModelProperty(value = "提出人")
private String createUser;
/**
* 提出部门
*/
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
@ApiModelProperty(value = "提出部门")
private String createUnit;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
@@ -9,6 +9,7 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
@@ -58,6 +59,7 @@ public class ProcessEsChange implements Serializable {
/**
* 所属部门
*/
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
@ApiModelProperty(value = "所属部门")
private String orgCode;
@@ -140,18 +142,21 @@ public class ProcessEsChange implements Serializable {
/**
* 零部件名称
*/
@Dict(dicCode = "part_name")
@ApiModelProperty(value = "零部件名称")
private String partName;
/**
* 主起草人
*/
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
@ApiModelProperty(value = "主起草人")
private String mainDraftingUser;
/**
* 主起草单位
*/
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
@ApiModelProperty(value = "主起草单位")
private String mainDraftingUnit;
@@ -25,6 +25,8 @@ import com.jero.modules.activiti.service.ProcessAllService;
import com.jero.modules.activiti.service.ProcessNodeLinkService;
import com.jero.modules.activiti.service.ProcessNodeService;
import com.jero.modules.sys.utils.UserUtils;
import com.jero.modules.system.model.DepartIdModel;
import com.jero.modules.system.service.ISysUserDepartService;
import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.ProcessInstance;
@@ -33,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author ThinkBook
@@ -57,6 +60,9 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
@Resource
private EsChangeOpinionService esChangeOpinionService;
@Resource
private ISysUserDepartService userDepartService;
@Override
public void startProcess(ESChangeDataVO changeData) {
// 执行流程发起前的操作
@@ -88,8 +94,13 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
// 保存到业务流程表
saveOrUpdate(esChange);
if (opinionList != null && !opinionList.isEmpty()) {
String deptId = userDepartService.getFirstDeptIdByUserId(userId);
// 遍历 opinionList,设置 opinion 的 BusinessId
opinionList.forEach(opinion -> opinion.setBusinessId(esChange.getId()));
opinionList.forEach(opinion -> {
opinion.setBusinessId(esChange.getId());
if (StrUtil.isBlank(opinion.getCreateUser())) opinion.setCreateUser(userId);
if (StrUtil.isBlank(opinion.getCreateUnit())) opinion.setCreateUnit(deptId);
});
esChangeOpinionService.saveOrUpdateBatch(opinionList);
}
// 保存选人信息
@@ -125,6 +136,7 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
@Override
public void saveToDraft(ESChangeDataVO changeData) {
String userId = UserUtils.getUserId();
CommonVO commonVO = changeData.getCommon();
ProcessEsChange esChange = changeData.getData();
List<EsChangeOpinion> opinionList = esChange.getList();
@@ -132,8 +144,13 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
if (existDraft != null) esChange.setId(existDraft.getProjectId());
saveOrUpdate(esChange);
if (opinionList != null && !opinionList.isEmpty()) {
String deptId = userDepartService.getFirstDeptIdByUserId(userId);
// 遍历 opinionList,设置 opinion 的 BusinessId
opinionList.forEach(opinion -> opinion.setBusinessId(esChange.getId()));
opinionList.forEach(opinion -> {
opinion.setBusinessId(esChange.getId());
if (StrUtil.isBlank(opinion.getCreateUser())) opinion.setCreateUser(userId);
if (StrUtil.isBlank(opinion.getCreateUnit())) opinion.setCreateUnit(deptId);
});
esChangeOpinionService.saveOrUpdateBatch(opinionList);
}
actFlowCommonService.addDraft(commonVO, ProcessTypeEnum.ES_CHANGE, esChange.getId());