|
@@ -1,6 +1,9 @@
|
|
|
package com.ruoyi.project.production.service.impl;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
@@ -14,6 +17,7 @@ import com.ruoyi.project.system.mapper.SysUserMapper;
|
|
|
import com.ruoyi.project.system.mapper.SysUserRoleMapper;
|
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
|
import com.ruoyi.project.system.service.ISysRoleService;
|
|
|
+import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.ruoyi.project.production.mapper.TSaiApplyMapper;
|
|
@@ -47,6 +51,9 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
|
@Autowired
|
|
|
private SysUserRoleMapper userRoleMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService userService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询SAI开项管理
|
|
|
*
|
|
@@ -72,6 +79,12 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
|
@Override
|
|
|
public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO tSaiApply)
|
|
|
{
|
|
|
+ List<SysUser> userList = userService.selectUserList(new SysUser());
|
|
|
+ Map<Long, String> nameMap = new HashMap<Long, String>();
|
|
|
+ for (SysUser sysUser : userList) {
|
|
|
+ nameMap.put(sysUser.getUserId(), sysUser.getNickName());
|
|
|
+ }
|
|
|
+
|
|
|
List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
|
|
|
List<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
|
|
|
for (TSaiApply saiApply : tSaiApplies) {
|
|
@@ -87,25 +100,41 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
|
}
|
|
|
}
|
|
|
if (applicant != null) {
|
|
|
- saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());
|
|
|
+// saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());
|
|
|
+ String applicantName = nameMap.get(Long.parseLong(applicant));
|
|
|
+ if (applicantName != null && !"null".equals(applicantName)) {
|
|
|
+ saiApply.setApplicantName(applicantName);
|
|
|
+ }
|
|
|
}
|
|
|
if (handler != null) {
|
|
|
if (handler.indexOf(",") != -1) {
|
|
|
String[] split = handler.split(",");
|
|
|
String handlerName = "";
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
- handlerName += sysUserMapper.selectUserById(Long.parseLong(split[i])).getNickName();
|
|
|
- if (i < split.length - 1) {
|
|
|
- handlerName += ",";
|
|
|
+// handlerName += sysUserMapper.selectUserById(Long.parseLong(split[i])).getNickName();
|
|
|
+ String name = nameMap.get(Long.parseLong(split[i]));
|
|
|
+ if (name != null && !"null".equals(name)) {
|
|
|
+ handlerName += name;
|
|
|
+ if (i < split.length - 1) {
|
|
|
+ handlerName += ",";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
saiApply.setHandlerName(handlerName);
|
|
|
} else {
|
|
|
- saiApply.setHandlerName(sysUserMapper.selectUserById(Long.parseLong(handler)).getNickName());
|
|
|
+// saiApply.setHandlerName(sysUserMapper.selectUserById(Long.parseLong(handler)).getNickName());
|
|
|
+ String handlerName = nameMap.get(Long.parseLong(handler));
|
|
|
+ if (handlerName != null && !"null".equals(handlerName)) {
|
|
|
+ saiApply.setHandlerName(handlerName);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (executor != null) {
|
|
|
- saiApply.setExecutorName(sysUserMapper.selectUserById(Long.parseLong(executor)).getNickName());
|
|
|
+// saiApply.setExecutorName(sysUserMapper.selectUserById(Long.parseLong(executor)).getNickName());
|
|
|
+ String executorName = nameMap.get(Long.parseLong(executor));
|
|
|
+ if (executorName != null && !"null".equals(executorName)) {
|
|
|
+ saiApply.setExecutorName(executorName);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
boolean specialRole = this.isSpecialRole();
|