feat: 企标更改流程部分字段翻译
This commit is contained in:
+5
@@ -2,14 +2,17 @@ package com.jero.modules.system.service;
|
|||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
import com.jero.modules.system.entity.SysUser;
|
import com.jero.modules.system.entity.SysUser;
|
||||||
import com.jero.modules.system.entity.SysUserDepart;
|
import com.jero.modules.system.entity.SysUserDepart;
|
||||||
import com.jero.modules.system.model.DepartIdModel;
|
import com.jero.modules.system.model.DepartIdModel;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -51,4 +54,6 @@ public interface ISysUserDepartService extends IService<SysUserDepart> {
|
|||||||
*/
|
*/
|
||||||
IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo);
|
IPage<SysUser> queryDepartUserPageList(String departId, String username, String realname, int pageSize, int pageNo);
|
||||||
|
|
||||||
|
|
||||||
|
String getFirstDeptIdByUserId(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -153,4 +153,10 @@ public class SysUserDepartServiceImpl extends ServiceImpl<SysUserDepartMapper, S
|
|||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getFirstDeptIdByUserId(String userId) {
|
||||||
|
List<DepartIdModel> departIdModels = this.queryDepartIdsOfUser(userId);
|
||||||
|
List<String> departIds = departIdModels.stream().map(DepartIdModel::getKey).collect(Collectors.toList());
|
||||||
|
return departIds.get(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -89,6 +90,20 @@ public class EsChangeOpinion implements Serializable {
|
|||||||
@ApiModelProperty(value = "修改理由")
|
@ApiModelProperty(value = "修改理由")
|
||||||
private String updateReason;
|
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)
|
@TableField(exist = false)
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|||||||
+5
@@ -9,6 +9,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.jero.common.aspect.annotation.Dict;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
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 = "所属部门")
|
@ApiModelProperty(value = "所属部门")
|
||||||
private String orgCode;
|
private String orgCode;
|
||||||
|
|
||||||
@@ -140,18 +142,21 @@ public class ProcessEsChange implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 零部件名称
|
* 零部件名称
|
||||||
*/
|
*/
|
||||||
|
@Dict(dicCode = "part_name")
|
||||||
@ApiModelProperty(value = "零部件名称")
|
@ApiModelProperty(value = "零部件名称")
|
||||||
private String partName;
|
private String partName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主起草人
|
* 主起草人
|
||||||
*/
|
*/
|
||||||
|
@Dict(dictTable = "sys_user", dicCode = "id", dicText = "realname")
|
||||||
@ApiModelProperty(value = "主起草人")
|
@ApiModelProperty(value = "主起草人")
|
||||||
private String mainDraftingUser;
|
private String mainDraftingUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主起草单位
|
* 主起草单位
|
||||||
*/
|
*/
|
||||||
|
@Dict(dictTable = "sys_depart", dicCode = "id", dicText = "depart_name")
|
||||||
@ApiModelProperty(value = "主起草单位")
|
@ApiModelProperty(value = "主起草单位")
|
||||||
private String mainDraftingUnit;
|
private String mainDraftingUnit;
|
||||||
|
|
||||||
|
|||||||
+19
-2
@@ -25,6 +25,8 @@ import com.jero.modules.activiti.service.ProcessAllService;
|
|||||||
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
import com.jero.modules.activiti.service.ProcessNodeLinkService;
|
||||||
import com.jero.modules.activiti.service.ProcessNodeService;
|
import com.jero.modules.activiti.service.ProcessNodeService;
|
||||||
import com.jero.modules.sys.utils.UserUtils;
|
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 lombok.extern.slf4j.Slf4j;
|
||||||
import org.activiti.engine.RuntimeService;
|
import org.activiti.engine.RuntimeService;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
@@ -33,6 +35,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author ThinkBook
|
* @author ThinkBook
|
||||||
@@ -57,6 +60,9 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
|
|||||||
@Resource
|
@Resource
|
||||||
private EsChangeOpinionService esChangeOpinionService;
|
private EsChangeOpinionService esChangeOpinionService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserDepartService userDepartService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startProcess(ESChangeDataVO changeData) {
|
public void startProcess(ESChangeDataVO changeData) {
|
||||||
// 执行流程发起前的操作
|
// 执行流程发起前的操作
|
||||||
@@ -88,8 +94,13 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
|
|||||||
// 保存到业务流程表
|
// 保存到业务流程表
|
||||||
saveOrUpdate(esChange);
|
saveOrUpdate(esChange);
|
||||||
if (opinionList != null && !opinionList.isEmpty()) {
|
if (opinionList != null && !opinionList.isEmpty()) {
|
||||||
|
String deptId = userDepartService.getFirstDeptIdByUserId(userId);
|
||||||
// 遍历 opinionList,设置 opinion 的 BusinessId
|
// 遍历 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);
|
esChangeOpinionService.saveOrUpdateBatch(opinionList);
|
||||||
}
|
}
|
||||||
// 保存选人信息
|
// 保存选人信息
|
||||||
@@ -125,6 +136,7 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveToDraft(ESChangeDataVO changeData) {
|
public void saveToDraft(ESChangeDataVO changeData) {
|
||||||
|
String userId = UserUtils.getUserId();
|
||||||
CommonVO commonVO = changeData.getCommon();
|
CommonVO commonVO = changeData.getCommon();
|
||||||
ProcessEsChange esChange = changeData.getData();
|
ProcessEsChange esChange = changeData.getData();
|
||||||
List<EsChangeOpinion> opinionList = esChange.getList();
|
List<EsChangeOpinion> opinionList = esChange.getList();
|
||||||
@@ -132,8 +144,13 @@ public class ProcessEsChangeServiceImpl extends ServiceImpl<ProcessEsChangeMappe
|
|||||||
if (existDraft != null) esChange.setId(existDraft.getProjectId());
|
if (existDraft != null) esChange.setId(existDraft.getProjectId());
|
||||||
saveOrUpdate(esChange);
|
saveOrUpdate(esChange);
|
||||||
if (opinionList != null && !opinionList.isEmpty()) {
|
if (opinionList != null && !opinionList.isEmpty()) {
|
||||||
|
String deptId = userDepartService.getFirstDeptIdByUserId(userId);
|
||||||
// 遍历 opinionList,设置 opinion 的 BusinessId
|
// 遍历 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);
|
esChangeOpinionService.saveOrUpdateBatch(opinionList);
|
||||||
}
|
}
|
||||||
actFlowCommonService.addDraft(commonVO, ProcessTypeEnum.ES_CHANGE, esChange.getId());
|
actFlowCommonService.addDraft(commonVO, ProcessTypeEnum.ES_CHANGE, esChange.getId());
|
||||||
|
|||||||
Reference in New Issue
Block a user