|
@@ -1,32 +1,26 @@
|
|
package com.ruoyi.project.production.service.impl;
|
|
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.DateUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
|
import com.ruoyi.framework.security.LoginUser;
|
|
import com.ruoyi.framework.security.LoginUser;
|
|
import com.ruoyi.framework.security.service.TokenService;
|
|
import com.ruoyi.framework.security.service.TokenService;
|
|
import com.ruoyi.project.production.controller.vo.SaiApplyQueryVO;
|
|
import com.ruoyi.project.production.controller.vo.SaiApplyQueryVO;
|
|
-import com.ruoyi.project.system.domain.*;
|
|
|
|
|
|
+import com.ruoyi.project.production.domain.TSaiApply;
|
|
|
|
+import com.ruoyi.project.production.mapper.TSaiApplyMapper;
|
|
|
|
+import com.ruoyi.project.production.service.ITSaiApplyService;
|
|
|
|
+import com.ruoyi.project.system.domain.SysDictData;
|
|
|
|
+import com.ruoyi.project.system.domain.SysRole;
|
|
|
|
+import com.ruoyi.project.system.domain.SysUser;
|
|
import com.ruoyi.project.system.mapper.SysDeptMapper;
|
|
import com.ruoyi.project.system.mapper.SysDeptMapper;
|
|
-import com.ruoyi.project.system.mapper.SysRoleMapper;
|
|
|
|
import com.ruoyi.project.system.mapper.SysUserMapper;
|
|
import com.ruoyi.project.system.mapper.SysUserMapper;
|
|
import com.ruoyi.project.system.mapper.SysUserRoleMapper;
|
|
import com.ruoyi.project.system.mapper.SysUserRoleMapper;
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
-import com.ruoyi.project.system.service.ISysRoleService;
|
|
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import com.ruoyi.project.production.mapper.TSaiApplyMapper;
|
|
|
|
-import com.ruoyi.project.production.domain.TSaiApply;
|
|
|
|
-import com.ruoyi.project.production.service.ITSaiApplyService;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import javax.validation.constraints.NotBlank;
|
|
|
|
-import javax.validation.constraints.Size;
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* SAI开项管理Service业务层处理
|
|
* SAI开项管理Service业务层处理
|
|
@@ -81,11 +75,11 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO tSaiApply)
|
|
public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO tSaiApply)
|
|
{
|
|
{
|
|
List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
|
|
List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(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<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<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
|
|
List<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
|
|
for (TSaiApply saiApply : tSaiApplies) {
|
|
for (TSaiApply saiApply : tSaiApplies) {
|
|
@@ -102,47 +96,59 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
}
|
|
}
|
|
if (applicant != null) {
|
|
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);
|
|
|
|
|
|
+ SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(applicant));
|
|
|
|
+ if (sysUser!=null) {
|
|
|
|
+ String applicantName = sysUser.getNickName();
|
|
|
|
+ if (applicantName != null && !"null".equals(applicantName)) {
|
|
|
|
+ saiApply.setApplicantName(applicantName);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (handler != null) {
|
|
if (handler != null) {
|
|
- if (handler.indexOf(",") != -1) {
|
|
|
|
|
|
+ if (handler.contains(",")) {
|
|
String[] split = handler.split(",");
|
|
String[] split = handler.split(",");
|
|
- String handlerName = "";
|
|
|
|
|
|
+ StringBuilder handlerName = new StringBuilder();
|
|
for (int i = 0; i < split.length; i++) {
|
|
for (int i = 0; i < split.length; i++) {
|
|
// handlerName += sysUserMapper.selectUserById(Long.parseLong(split[i])).getNickName();
|
|
// 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 += ",";
|
|
|
|
|
|
+ SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(split[i]));
|
|
|
|
+ if (sysUser!=null) {
|
|
|
|
+ String name = sysUser.getNickName();
|
|
|
|
+ if (name != null && !"null".equals(name)) {
|
|
|
|
+ handlerName.append(name);
|
|
|
|
+ if (i < split.length - 1) {
|
|
|
|
+ handlerName.append(",");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- saiApply.setHandlerName(handlerName);
|
|
|
|
|
|
+ saiApply.setHandlerName(handlerName.toString());
|
|
} else {
|
|
} 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);
|
|
|
|
|
|
+ SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(handler));
|
|
|
|
+ if (sysUser!=null) {
|
|
|
|
+ String handlerName = sysUser.getNickName();
|
|
|
|
+ if (handlerName != null && !"null".equals(handlerName)) {
|
|
|
|
+ saiApply.setHandlerName(handlerName);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (executor != null) {
|
|
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);
|
|
|
|
|
|
+ SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(executor));
|
|
|
|
+ if (sysUser!=null) {
|
|
|
|
+ String executorName = sysUser.getNickName();
|
|
|
|
+ if (executorName != null && !"null".equals(executorName)) {
|
|
|
|
+ saiApply.setExecutorName(executorName);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
boolean specialRole = this.isSpecialRole();
|
|
boolean specialRole = this.isSpecialRole();
|
|
if (specialRole) { // 当前登录用户是特殊角色
|
|
if (specialRole) { // 当前登录用户是特殊角色
|
|
for (TSaiApply saiApply : tSaiApplies) {
|
|
for (TSaiApply saiApply : tSaiApplies) {
|
|
- Long applyStatus = saiApply.getApplyStatus();
|
|
|
|
- if (applyStatus.toString().equals("5")) { // 申请状态为“已取消”的数据
|
|
|
|
|
|
+ long applyStatus = saiApply.getApplyStatus();
|
|
|
|
+ if (Long.toString(applyStatus).equals("5")) { // 申请状态为“已取消”的数据
|
|
tSaiApplies.remove(saiApply); // 从列表中移除
|
|
tSaiApplies.remove(saiApply); // 从列表中移除
|
|
}
|
|
}
|
|
}
|
|
}
|