feat: 办理接口字段翻译
This commit is contained in:
@@ -10,14 +10,11 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.sys.entity.LawsWorkingGroupUser;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupService;
|
||||
import com.jero.modules.sys.service.ILawsWorkingGroupUserService;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -95,12 +92,12 @@ public class UserController {
|
||||
IPage<SysUser> pageList = sysUserService.queryPage(page, subDepIds, roleId, queryWrapper);
|
||||
|
||||
//批量查询用户的所属部门
|
||||
//step.1 先拿到全部的 useids
|
||||
//step.1 先拿到全部的 useIds
|
||||
List<String> userIds = pageList.getRecords().stream().map(SysUser::getId).collect(Collectors.toList());
|
||||
if (!userIds.isEmpty()) {
|
||||
//step.2 通过 useids,一次性查询用户的所属部门名字
|
||||
//step.2 通过 useIds,一次性查询用户的所属部门名字
|
||||
Map<String, String> useDepNames = sysUserService.getDepNamesByUserIds(userIds);
|
||||
//step.3 通过 useids,一次性查询用户的角色名字
|
||||
//step.3 通过 useIds,一次性查询用户的角色名字
|
||||
Map<String, String> useRoleNames = sysUserService.getRoleNamesByUserIds(userIds);
|
||||
//step.4 遍历赋值
|
||||
pageList.getRecords().forEach(item -> {
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class ActFlowCommonService {
|
||||
|
||||
IActFlowCustomService customService = (IActFlowCustomService) SpringContextUtil.getBean(beanName);
|
||||
// 修改业务的状态
|
||||
customService.startRunTask(businessId);
|
||||
// customService.startRunTask(businessId);
|
||||
Map<String, Object> variables = customService.setVariables(businessId);
|
||||
// 第一个节点默认通过
|
||||
variables.put("pass", true);
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
package com.jero.modules.activiti.process.esInitChange.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.modules.activiti.process.esInitChange.entity.ProcessEsInitChange;
|
||||
@@ -62,7 +61,7 @@ public class ProcessESInitChangeController {
|
||||
@AutoLog(value = "企标立项变更流程-保存")
|
||||
@ApiOperation(value="企标立项变更流程-保存", notes="企标立项变更流程-保存")
|
||||
@PostMapping("/save")
|
||||
public Result<?> saveToWait(@RequestParam(value = "taskId", required = false) String taskId,
|
||||
public Result<?> save(@RequestParam(value = "taskId", required = false) String taskId,
|
||||
@RequestBody List<ProcessEsInitChange> esInitChangeList) {
|
||||
initChangeService.saveToDraft(taskId, esInitChangeList);
|
||||
return Result.OK();
|
||||
|
||||
+29
@@ -8,6 +8,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -264,6 +265,13 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
private String mainDraftingUnit;
|
||||
|
||||
/**
|
||||
* 主起草单位
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUnit_dictText")
|
||||
private String mainDraftingUnitDictText;
|
||||
|
||||
/**
|
||||
* 主起草单位责任人
|
||||
*/
|
||||
@@ -406,11 +414,32 @@ public class ProcessEsInitChange implements Serializable {
|
||||
*/
|
||||
private String mainDraftUserLeader;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUserLeader_dictText")
|
||||
private String mainDraftUserLeaderDictText;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导上级领导
|
||||
*/
|
||||
private String mainDraftUserLeaderLeader;
|
||||
|
||||
/**
|
||||
* 主起草人主管级领导上级领导
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUserLeaderLeader_dictText")
|
||||
private String mainDraftUserLeaderLeaderDictText;
|
||||
|
||||
/**
|
||||
* 主起草人
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@JsonProperty("mainDraftingUser_dictText")
|
||||
private String mainDraftUserDictText;
|
||||
|
||||
/**
|
||||
* 标准化审批人
|
||||
*/
|
||||
|
||||
+47
-1
@@ -16,6 +16,10 @@ import com.jero.modules.activiti.process.esInitChange.mapper.ProcessEsInitChange
|
||||
import com.jero.modules.laws.enterprise.service.ESSequenceNumberProvider;
|
||||
import com.jero.modules.laws.enterprise.util.EnterpriseStandardUtil;
|
||||
import com.jero.modules.sys.utils.UserUtils;
|
||||
import com.jero.modules.system.entity.SysDepart;
|
||||
import com.jero.modules.system.entity.SysUser;
|
||||
import com.jero.modules.system.service.ISysDepartService;
|
||||
import com.jero.modules.system.service.ISysUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,6 +50,12 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
@Resource
|
||||
private EnterpriseStandardUtil esUtil;
|
||||
|
||||
@Resource
|
||||
private ISysUserService sysUserService;
|
||||
|
||||
@Resource
|
||||
private ISysDepartService sysDepartService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> setVariables(String id) {
|
||||
ProcessEsInitChange initChange = getById(id);
|
||||
@@ -87,7 +97,43 @@ public class ProcessEsInitChangeServiceImpl extends ServiceImpl<ProcessEsInitCha
|
||||
LambdaQueryWrapper<ProcessEsInitChange> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getProcessInstanceId, processInstanceId);
|
||||
lambdaQueryWrapper.eq(ProcessEsInitChange::getDelFlag, YesOrNoEnum.NO.getValue());
|
||||
return list(lambdaQueryWrapper);
|
||||
return translateData(list(lambdaQueryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动翻译数据
|
||||
* @return
|
||||
*/
|
||||
private List<ProcessEsInitChange> translateData(List<ProcessEsInitChange> initChangeList) {
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
List<String> departIdList = new ArrayList<>();
|
||||
|
||||
// 制作需要的Id集合
|
||||
for (ProcessEsInitChange initChange : initChangeList) {
|
||||
userIdList.add(initChange.getMainDraftUserLeader());
|
||||
userIdList.add(initChange.getMainDraftUserLeaderLeader());
|
||||
departIdList.add(initChange.getMainDraftingUnit());
|
||||
}
|
||||
// 根据Id集合获取所需数据
|
||||
LambdaQueryWrapper<SysUser> userLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
userLambdaQueryWrapper.in(SysUser::getId, userIdList);
|
||||
List<SysUser> userList = sysUserService.list(userLambdaQueryWrapper);
|
||||
// 转成Map
|
||||
Map<String, SysUser> userMap = userList.stream().collect(Collectors.toMap(SysUser::getId, sysUser -> sysUser));
|
||||
|
||||
LambdaQueryWrapper<SysDepart> deptLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
deptLambdaQueryWrapper.in(SysDepart::getId, departIdList);
|
||||
List<SysDepart> departList = sysDepartService.list(deptLambdaQueryWrapper);
|
||||
// 转成Map
|
||||
Map<String, SysDepart> departMap = departList.stream().collect(Collectors.toMap(SysDepart::getId, sysDepart -> sysDepart));
|
||||
|
||||
// 翻译数据
|
||||
for (ProcessEsInitChange initChange : initChangeList) {
|
||||
initChange.setMainDraftUserLeaderDictText(userMap.get(initChange.getMainDraftUserLeader()).getUsername());
|
||||
initChange.setMainDraftUserLeaderLeaderDictText(userMap.get(initChange.getMainDraftUserLeaderLeader()).getUsername());
|
||||
initChange.setMainDraftingUnit(departMap.get(initChange.getMainDraftingUnit()).getDepartName());
|
||||
}
|
||||
return initChangeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user