|
@@ -1,10 +1,14 @@
|
|
package com.ruoyi.project.production.service.impl;
|
|
package com.ruoyi.project.production.service.impl;
|
|
|
|
|
|
|
|
+import com.github.pagehelper.Page;
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
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.framework.web.page.PageDomain;
|
|
|
|
+import com.ruoyi.framework.web.page.TableSupport;
|
|
import com.ruoyi.project.production.controller.vo.SaiApplyQueryVO;
|
|
import com.ruoyi.project.production.controller.vo.SaiApplyQueryVO;
|
|
import com.ruoyi.project.production.domain.TSaiApply;
|
|
import com.ruoyi.project.production.domain.TSaiApply;
|
|
import com.ruoyi.project.production.mapper.TSaiApplyMapper;
|
|
import com.ruoyi.project.production.mapper.TSaiApplyMapper;
|
|
@@ -20,6 +24,7 @@ import com.ruoyi.project.system.service.ISysUserService;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
@@ -77,13 +82,38 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
@Override
|
|
@Override
|
|
public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO tSaiApply)
|
|
public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO 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());
|
|
|
|
|
|
+// // 当前登录用户userId
|
|
|
|
+// LoginUser loginUser = SpringUtils.getBean(TokenService.class).getLoginUser(ServletUtils.getRequest());
|
|
|
|
+// Long userId = loginUser.getUser().getUserId();
|
|
|
|
+//
|
|
|
|
+// List<TSaiApply> result = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
|
|
|
|
+//
|
|
|
|
+// List<TSaiApply> tSaiApplies = new ArrayList<>();
|
|
|
|
+//
|
|
|
|
+// for (TSaiApply saiApply : result) {
|
|
|
|
+// // 待处理:当前用户为流程当前处理人(之一),申请流程未结束
|
|
|
|
+// if (tSaiApply.getTab() == 1) {
|
|
|
|
+// if (saiApply.getHandler().indexOf(userId.toString()) != -1 && saiApply.getApplyStatus() != 4 && saiApply.getApplyStatus() != 5) {
|
|
|
|
+// tSaiApplies.add(saiApply);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// // 我的:当前用户为登记人、评估人、整改负责人或验证人(之一)
|
|
|
|
+// else if (tSaiApply.getTab() == 2) {
|
|
|
|
+// if ((saiApply.getApplicant() != null && saiApply.getApplicant().indexOf(userId.toString()) != -1)
|
|
|
|
+// || (saiApply.getAssessor() != null && saiApply.getAssessor().indexOf(userId.toString()) != -1)
|
|
|
|
+// || (saiApply.getExecutor() != null && saiApply.getExecutor().indexOf(userId.toString()) != -1)
|
|
|
|
+// || (saiApply.getInspectors() != null && saiApply.getInspectors().indexOf(userId.toString()) != -1)) {
|
|
|
|
+// tSaiApplies.add(saiApply);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// // 总数据
|
|
|
|
+// else if (tSaiApply.getTab() == 3) {
|
|
|
|
+// tSaiApplies.add(saiApply);
|
|
|
|
+// }
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
+ List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
|
|
|
|
+
|
|
List<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
|
|
List<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
|
|
|
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(20);
|
|
ExecutorService executorService = Executors.newFixedThreadPool(20);
|
|
@@ -104,7 +134,6 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (applicant != null) {
|
|
if (applicant != null) {
|
|
-// saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());
|
|
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(applicant));
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(applicant));
|
|
if (sysUser!=null) {
|
|
if (sysUser!=null) {
|
|
String applicantName = sysUser.getNickName();
|
|
String applicantName = sysUser.getNickName();
|
|
@@ -118,7 +147,6 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
String[] split = handler.split(",");
|
|
String[] split = handler.split(",");
|
|
StringBuilder handlerName = new StringBuilder();
|
|
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();
|
|
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(split[i]));
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(split[i]));
|
|
if (sysUser!=null) {
|
|
if (sysUser!=null) {
|
|
String name = sysUser.getNickName();
|
|
String name = sysUser.getNickName();
|
|
@@ -132,7 +160,6 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
}
|
|
}
|
|
saiApply.setHandlerName(handlerName.toString());
|
|
saiApply.setHandlerName(handlerName.toString());
|
|
} else {
|
|
} else {
|
|
-// saiApply.setHandlerName(sysUserMapper.selectUserById(Long.parseLong(handler)).getNickName());
|
|
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(handler));
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(handler));
|
|
if (sysUser!=null) {
|
|
if (sysUser!=null) {
|
|
String handlerName = sysUser.getNickName();
|
|
String handlerName = sysUser.getNickName();
|
|
@@ -143,7 +170,6 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (executor != null) {
|
|
if (executor != null) {
|
|
-// saiApply.setExecutorName(sysUserMapper.selectUserById(Long.parseLong(executor)).getNickName());
|
|
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(executor));
|
|
SysUser sysUser = sysUserMapper.selectNickNameById(Long.parseLong(executor));
|
|
if (sysUser!=null) {
|
|
if (sysUser!=null) {
|
|
String executorName = sysUser.getNickName();
|
|
String executorName = sysUser.getNickName();
|
|
@@ -164,15 +190,16 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
|
|
}
|
|
}
|
|
executorService.shutdown();
|
|
executorService.shutdown();
|
|
|
|
|
|
- boolean specialRole = this.isSpecialRole();
|
|
|
|
- if (specialRole) { // 当前登录用户是特殊角色
|
|
|
|
- for (TSaiApply saiApply : tSaiApplies) {
|
|
|
|
- long applyStatus = saiApply.getApplyStatus();
|
|
|
|
- if (Long.toString(applyStatus).equals("5")) { // 申请状态为“已取消”的数据
|
|
|
|
- tSaiApplies.remove(saiApply); // 从列表中移除
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+// boolean specialRole = this.isSpecialRole();
|
|
|
|
+// if (specialRole) { // 当前登录用户是特殊角色
|
|
|
|
+// for (TSaiApply saiApply : tSaiApplies) {
|
|
|
|
+// long applyStatus = saiApply.getApplyStatus();
|
|
|
|
+// if (Long.toString(applyStatus).equals("5")) { // 申请状态为“已取消”的数据
|
|
|
|
+// tSaiApplies.remove(saiApply); // 从列表中移除
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+
|
|
return tSaiApplies;
|
|
return tSaiApplies;
|
|
}
|
|
}
|
|
|
|
|