[修改] 流程中心 效率优化
This commit is contained in:
@@ -36,18 +36,12 @@ import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.IncorrectCredentialsException;
|
||||
import org.apache.shiro.authc.UnknownAccountException;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
@@ -362,10 +356,10 @@ public class LoginRestController {
|
||||
return Result.error("r0012", "您输入的验证码不正确", systemAuthorizingRealm.isNeedValidCode(username));
|
||||
} catch (UnknownAccountException e) {
|
||||
log.info("用户[{}]身份验证失败", username);
|
||||
return Result.error("r0011", "您输入的帐号或密码有误", systemAuthorizingRealm.isNeedValidCode(username));
|
||||
return Result.error("r0011", "您输入的用户名或密码有误", systemAuthorizingRealm.isNeedValidCode(username));
|
||||
} catch (IncorrectCredentialsException e) {
|
||||
log.info("用户[{}]密码验证失败", username);
|
||||
return Result.error("r0011", "您输入的帐号或密码有误", systemAuthorizingRealm.isNeedValidCode(username));
|
||||
return Result.error("r0011", "您输入的用户名或密码有误", systemAuthorizingRealm.isNeedValidCode(username));
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return Result.error("r0013", e.getMessage(), systemAuthorizingRealm.isNeedValidCode(username));
|
||||
|
||||
@@ -119,8 +119,8 @@ public class UserEOController extends BaseController<UserEO> {
|
||||
|
||||
@ApiOperation("获取所有用户")
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage list(int pageNo, int pageSize, String account, String roleName) {
|
||||
IPage<Map<String, Object>> list = userEOService.list(pageNo, pageSize, account, roleName);
|
||||
public ResponseMessage list(int page, int pageSize, String account, String roleName) {
|
||||
IPage<Map<String, Object>> list = userEOService.list(page, pageSize, account, roleName);
|
||||
list.getRecords().forEach(c -> {
|
||||
try {
|
||||
c.put("CELLPHONE_NUMBER", StringUtils.isNotEmpty(c.get("CELLPHONE_NUMBER")) ? EncryptUtil.decrypt(c.get("CELLPHONE_NUMBER").toString())
|
||||
|
||||
+55
-38
@@ -39,6 +39,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
@@ -940,15 +941,24 @@ public class TodoTaskController {
|
||||
eq(BusProcessName::getSubmitStatus,SubmitStatusEnum.STOP.getValue());
|
||||
});
|
||||
|
||||
List<BusProcessName> list = iBusProcessNameService.list(queryWrapper);
|
||||
IPage<BusProcessName> page1 =new com.baomidou.mybatisplus.extension.plugins.pagination.Page();
|
||||
page1.setCurrent(taskCommonQuery.getCurrent());
|
||||
page1.setSize(taskCommonQuery.getSize());
|
||||
page1 = iBusProcessNameService.page(page1, queryWrapper);
|
||||
List<BusProcessName> list = page1.getRecords();
|
||||
|
||||
List<Task> taskList = taskService.createTaskQuery().active().list();
|
||||
Map<String, List<Task>> taskCollect =
|
||||
taskList.stream().collect(Collectors.groupingBy(Task::getProcessInstanceId));
|
||||
|
||||
Page page = new Page();
|
||||
if (list != null && list.size() > 0) {
|
||||
List<BusProcessName> list1 = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
// List<BusProcessName> list1 = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
for (BusProcessName busProcessName : list1) {
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(busProcessName.getPrcId()).active().list();
|
||||
if (list2.size() > 0) {
|
||||
for (BusProcessName busProcessName : list) {
|
||||
List<Task> list2 = taskCollect.get(busProcessName.getPrcId());
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
for (Task task : list2) {
|
||||
if (task.getAssignee() != null && !task.getAssignee().equals("")) {
|
||||
userIdList.add(task.getAssignee());
|
||||
@@ -979,10 +989,10 @@ public class TodoTaskController {
|
||||
userVOList.addAll(userInfoList);
|
||||
}
|
||||
|
||||
for (BusProcessName busProcessName : list1) {
|
||||
for (BusProcessName busProcessName : list) {
|
||||
String assignee = "";
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(busProcessName.getPrcId()).active().list();
|
||||
if (list2.size() > 0) {
|
||||
List<Task> list2 = taskCollect.get(busProcessName.getPrcId());
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
for (Task task : list2) {
|
||||
if (task.getAssignee() != null && !task.getAssignee().equals("")) {
|
||||
if(CollectionUtils.isNotEmpty(userVOList)){
|
||||
@@ -1079,7 +1089,7 @@ public class TodoTaskController {
|
||||
}
|
||||
|
||||
}
|
||||
page.setList(list1);
|
||||
page.setList(list);
|
||||
page.setCount(Long.valueOf(list.size()));
|
||||
page.setPageSize(taskCommonQuery.getSize());
|
||||
page.setPageNo(taskCommonQuery.getCurrent());
|
||||
@@ -1134,14 +1144,23 @@ public class TodoTaskController {
|
||||
eq(BusProcessName::getSubmitStatus,SubmitStatusEnum.STOP.getValue());
|
||||
});
|
||||
|
||||
List<BusProcessName> list = iBusProcessNameService.list(queryWrapper);
|
||||
// List<BusProcessName> list = iBusProcessNameService.list(queryWrapper);
|
||||
IPage<BusProcessName> page1 =new com.baomidou.mybatisplus.extension.plugins.pagination.Page();
|
||||
page1.setCurrent(taskCommonQuery.getCurrent());
|
||||
page1.setSize(taskCommonQuery.getSize());
|
||||
page1 = iBusProcessNameService.page(page1, queryWrapper);
|
||||
List<BusProcessName> list = page1.getRecords();
|
||||
// List<BusProcessName> listPage = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
|
||||
List<Task> taskList = taskService.createTaskQuery().active().list();
|
||||
Map<String, List<Task>> taskCollect =
|
||||
taskList.stream().collect(Collectors.groupingBy(Task::getProcessInstanceId));
|
||||
|
||||
List<BusProcessName> listPage = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
if (list != null && list.size() > 0) {
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
for (BusProcessName busProcessName : listPage) {
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(busProcessName.getPrcId()).active().list();
|
||||
if (list2.size() > 0) {
|
||||
for (BusProcessName busProcessName : list) {
|
||||
List<Task> list2 = taskCollect.get(busProcessName.getPrcId());
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
for (Task task : list2) {
|
||||
if (task.getAssignee() != null && !task.getAssignee().equals("")) {
|
||||
userIdList.add(task.getAssignee());
|
||||
@@ -1163,10 +1182,10 @@ public class TodoTaskController {
|
||||
userVOList.addAll(userInfoList);
|
||||
}
|
||||
|
||||
for (BusProcessName busProcessName : listPage) {
|
||||
for (BusProcessName busProcessName : list) {
|
||||
String assignee = "";
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(busProcessName.getPrcId()).active().list();
|
||||
if (list2.size() > 0) {
|
||||
List<Task> list2 = taskCollect.get(busProcessName.getPrcId());
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
for (Task task : list2) {
|
||||
if (task.getAssignee() != null && !task.getAssignee().equals("")) {
|
||||
if(CollectionUtils.isNotEmpty(userVOList)){
|
||||
@@ -1229,17 +1248,6 @@ public class TodoTaskController {
|
||||
busProcessName.setTaskDefinitionKey(task.getActivityId());
|
||||
}
|
||||
});
|
||||
//获取 审批结果
|
||||
// if (StringUtils.isNotEmpty(busProcessName.getTaskId())) {
|
||||
// List<BusProcessApprove> busProcessApproves = iBusProcessApproveService.selectEoByPrcIdAndTask(busProcessName.getPrcId());
|
||||
// if(busProcessApproves.size() != 0){
|
||||
// BusProcessApprove busProcessApprove = busProcessApproves.get(0);
|
||||
// JSONObject dataJson = JSONObject.parseObject(busProcessApprove.getFromValsJson());
|
||||
// if (StringUtils.isNotEmpty(dataJson.getString("flag"))) {
|
||||
// busProcessName.setStatus(dataJson.getString("flag"));
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
Date createTime = null;
|
||||
Date endTime = null;
|
||||
@@ -1256,7 +1264,7 @@ public class TodoTaskController {
|
||||
busProcessName.setApprovalTime(approvalTime + "天");
|
||||
|
||||
}
|
||||
page.setList(listPage);
|
||||
page.setList(list);
|
||||
page.setCount(Long.valueOf(list.size()));
|
||||
page.setPageSize(taskCommonQuery.getSize());
|
||||
page.setPageNo(taskCommonQuery.getCurrent());
|
||||
@@ -1311,19 +1319,28 @@ public class TodoTaskController {
|
||||
eq(BusProcessName::getSubmitStatus,SubmitStatusEnum.STOP.getValue());
|
||||
});
|
||||
|
||||
List<BusProcessName> list = iBusProcessNameService.list(queryWrapper);
|
||||
IPage<BusProcessName> page1 =new com.baomidou.mybatisplus.extension.plugins.pagination.Page();
|
||||
page1.setCurrent(taskCommonQuery.getCurrent());
|
||||
page1.setSize(taskCommonQuery.getSize());
|
||||
page1 = iBusProcessNameService.page(page1, queryWrapper);
|
||||
List<BusProcessName> list = page1.getRecords();
|
||||
// List<BusProcessName> listPage = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
|
||||
List<Task> taskList = taskService.createTaskQuery().active().list();
|
||||
Map<String, List<Task>> taskCollect =
|
||||
taskList.stream().collect(Collectors.groupingBy(Task::getProcessInstanceId));
|
||||
|
||||
|
||||
Page page = new Page();
|
||||
if (list != null && list.size() > 0) {
|
||||
List<BusProcessName> list1 = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
// List<BusProcessName> list1 = this.startPage(list, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
|
||||
long startTime1 = System.currentTimeMillis();
|
||||
|
||||
List<String> userIdList = new ArrayList<>();
|
||||
for (BusProcessName busProcessName : list1) {
|
||||
for (BusProcessName busProcessName : list) {
|
||||
if (busProcessName.getPrcId() != null) {
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(busProcessName.getPrcId()).active().list();
|
||||
if (list2.size() > 0) {
|
||||
List<Task> list2 = taskCollect.get(busProcessName.getPrcId());
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
for (Task task : list2) {
|
||||
if (task.getAssignee() != null && !task.getAssignee().equals("")) {
|
||||
userIdList.add(task.getAssignee());
|
||||
@@ -1345,11 +1362,11 @@ public class TodoTaskController {
|
||||
List<UserVO> userInfoList = getUserInfoByIdList(userIdList);
|
||||
userVOList.addAll(userInfoList);
|
||||
}
|
||||
for (BusProcessName busProcessName : list1) {
|
||||
for (BusProcessName busProcessName : list) {
|
||||
String assignee = "";
|
||||
if (busProcessName.getPrcId() != null) {
|
||||
List<Task> list2 = taskService.createTaskQuery().processInstanceId(busProcessName.getPrcId()).active().list();
|
||||
if (list2.size() > 0) {
|
||||
List<Task> list2 = taskCollect.get(busProcessName.getPrcId());
|
||||
if (list2 != null && list2.size() > 0) {
|
||||
for (Task task : list2) {
|
||||
if (task.getAssignee() != null && !task.getAssignee().equals("")) {
|
||||
if(CollectionUtils.isNotEmpty(userVOList)){
|
||||
@@ -1426,7 +1443,7 @@ public class TodoTaskController {
|
||||
long endTime1 = System.currentTimeMillis() - startTime1;
|
||||
System.out.println("11111浪费时间为:" + endTime1);
|
||||
|
||||
page.setList(list1);
|
||||
page.setList(list);
|
||||
page.setCount(Long.valueOf(list.size()));
|
||||
page.setPageSize(taskCommonQuery.getSize());
|
||||
page.setPageNo(taskCommonQuery.getCurrent());
|
||||
|
||||
Reference in New Issue
Block a user