手机端-查询待办任务接口开发。
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
|||||||
|
package com.jero.modules.phone.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.common.aspect.annotation.AutoLog;
|
||||||
|
import com.jero.modules.phone.service.IToDoCenterService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Api(tags = "手机端-待办中心")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/phone/toDoCenter")
|
||||||
|
public class ToDoCenterController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IToDoCenterService toDoCenterService;
|
||||||
|
|
||||||
|
@AutoLog(value = "手机端-待办中心-查询待办任务分页列表")
|
||||||
|
@ApiOperation(value = "手机端-待办中心-查询待办任务分页列表", notes = "手机端-待办中心-查询待办任务分页列表")
|
||||||
|
@GetMapping(value = "/queryTodoTaskPage")
|
||||||
|
public Result<?> queryTodoTaskPage(@RequestParam Map<String,Object> params) {
|
||||||
|
IPage page = this.toDoCenterService.queryTodoTaskPage(params);
|
||||||
|
return Result.OK(page);
|
||||||
|
}
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
package com.jero.modules.phone.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface IToDoCenterService {
|
||||||
|
IPage queryTodoTaskPage(Map<String, Object> params);
|
||||||
|
}
|
||||||
+400
@@ -0,0 +1,400 @@
|
|||||||
|
package com.jero.modules.phone.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.jero.common.constant.enums.CutEnum;
|
||||||
|
import com.jero.common.system.vo.LoginUser;
|
||||||
|
import com.jero.modules.phone.service.IToDoCenterService;
|
||||||
|
import com.jero.modules.project.entity.ProjectLawsInventoryEO;
|
||||||
|
import com.jero.modules.project.entity.ProjectTaskInventoryDetailEO;
|
||||||
|
import com.jero.modules.project.enums.CertificationFlowNodeEnum;
|
||||||
|
import com.jero.modules.project.enums.ProjectInventoryFieldEnum;
|
||||||
|
import com.jero.modules.project.enums.TaskStatusEnum;
|
||||||
|
import com.jero.modules.project.service.IProjectLawsInventoryEOService;
|
||||||
|
import com.jero.modules.project.service.IProjectTaskInventoryDetailEOService;
|
||||||
|
import com.jero.modules.project.service.IProjectTaskInventoryEOService;
|
||||||
|
import com.jero.modules.system.entity.SysCategory;
|
||||||
|
import com.jero.modules.system.entity.SysDictItem;
|
||||||
|
import com.jero.modules.system.entity.SysUser;
|
||||||
|
import com.jero.modules.system.service.ISysCategoryService;
|
||||||
|
import com.jero.modules.system.service.ISysUserService;
|
||||||
|
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||||
|
import com.jero.modules.todoCenter.entity.ProcessInfoDetailEO;
|
||||||
|
import com.jero.modules.todoCenter.enums.DesignComplianceFlowNodeKeyEnum;
|
||||||
|
import com.jero.modules.todoCenter.enums.TodoCenterStatusEnum;
|
||||||
|
import com.jero.modules.todoCenter.enums.VerifyComplianceFlowNodeKeyEnum;
|
||||||
|
import com.jero.modules.todoCenter.mapper.ProcessInfoEOMapper;
|
||||||
|
import com.jero.modules.todoCenter.service.IProcessInfoDetailEOService;
|
||||||
|
import com.jero.modules.todoCenter.service.IProcessInfoEOService;
|
||||||
|
import com.jero.modules.todoCenter.vo.ProcessInfoVO;
|
||||||
|
import com.jero.modules.wkflow.enums.DesignComplianceNodeEnum;
|
||||||
|
import com.jero.modules.wkflow.enums.FlowTypeEnum;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ToDoCenterServiceImpl implements IToDoCenterService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProcessInfoEOMapper processInfoEOMapper;
|
||||||
|
@Autowired
|
||||||
|
private IProcessInfoEOService processInfoEOService;
|
||||||
|
@Autowired
|
||||||
|
private IProcessInfoDetailEOService processInfoDetailEOService;
|
||||||
|
@Autowired
|
||||||
|
private IProjectTaskInventoryDetailEOService projectTaskInventoryDetailEOService;
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
|
@Autowired
|
||||||
|
private IProjectLawsInventoryEOService projectLawsInventoryEOService;
|
||||||
|
@Autowired
|
||||||
|
private ISysCategoryService sysCategoryService;
|
||||||
|
@Autowired
|
||||||
|
private SysDictItemServiceImpl sysDictItemServiceImpl;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage queryTodoTaskPage(Map<String, Object> params) {
|
||||||
|
String cut = (String) params.get("cut");
|
||||||
|
Integer pageNo = Integer.parseInt(params.get("pageNo").toString());
|
||||||
|
Integer pageSize = Integer.parseInt(params.get("pageSize").toString());
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
||||||
|
List<String> flowTypeList = new ArrayList<>();
|
||||||
|
flowTypeList.add(FlowTypeEnum.RWQRLC.getValue());
|
||||||
|
flowTypeList.add(FlowTypeEnum.SJFHXSHLC.getValue());
|
||||||
|
flowTypeList.add(FlowTypeEnum.YZFHXSCLC.getValue());
|
||||||
|
|
||||||
|
params.put("flowTypeList", flowTypeList);
|
||||||
|
params.put("taskStatus", TaskStatusEnum.NOT_DONE.getValue());
|
||||||
|
params.put("currentUserId", currentUser.getId());
|
||||||
|
|
||||||
|
List<String> qdqrFlowTypeValue = new ArrayList<>();
|
||||||
|
qdqrFlowTypeValue.add(FlowTypeEnum.QDQR.getValue());
|
||||||
|
qdqrFlowTypeValue.add(FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||||
|
params.put("qdqrFlowTypeValue", qdqrFlowTypeValue);
|
||||||
|
|
||||||
|
IPage page = new Page(pageNo, pageSize);
|
||||||
|
|
||||||
|
IPage<ProcessInfoVO> result = this.processInfoEOMapper.queryPhoneTodoTaskListList(page, params);
|
||||||
|
List<ProcessInfoVO> datas = result.getRecords();
|
||||||
|
|
||||||
|
this.disposeData(cut, datas);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void disposeData(String cut, List<ProcessInfoVO> datas) {
|
||||||
|
if(CollectionUtils.isNotEmpty(datas)){
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
||||||
|
QueryWrapper<ProcessInfoDetailEO> pidQueryWrap = new QueryWrapper<>();
|
||||||
|
pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getFlowType,FlowTypeEnum.CERTIFICATION_LC.getValue());
|
||||||
|
pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getUserId,currentUser.getId());
|
||||||
|
pidQueryWrap.lambda().eq(ProcessInfoDetailEO::getStatus,TaskStatusEnum.NOT_DONE.getValue());
|
||||||
|
List<ProcessInfoDetailEO> pidEoList = this.processInfoDetailEOService.list(pidQueryWrap);
|
||||||
|
Iterator<ProcessInfoVO> datasIt = datas.iterator();
|
||||||
|
List<ProcessInfoVO> datasTemp = new ArrayList<>();
|
||||||
|
while (datasIt.hasNext()) {
|
||||||
|
ProcessInfoVO data = datasIt.next();
|
||||||
|
if (StringUtils.equals(data.getFlowType(), FlowTypeEnum.CERTIFICATION_LC.getValue())) {
|
||||||
|
List<ProcessInfoDetailEO> pidEos = pidEoList.stream().filter(pidEo -> {
|
||||||
|
boolean flag = StringUtils.equals(pidEo.getProcessInfoId(), data.getId());
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
// 判断当前用户在这个认证流程中 有几个任务。 责任人 接受、责任人 提交交付物、认证工程审批
|
||||||
|
if(CollectionUtils.isNotEmpty(pidEos)){
|
||||||
|
List<ProcessInfoDetailEO> zrrjsrwPidEos = pidEos.stream().filter(pidEo -> {
|
||||||
|
return StringUtils.equals(pidEo.getTaskDefinitionKey(), CertificationFlowNodeEnum.ZRRJSRW.getKey());
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(zrrjsrwPidEos)){
|
||||||
|
ProcessInfoVO processInfoVOTemp = new ProcessInfoVO();
|
||||||
|
BeanUtils.copyProperties(data,processInfoVOTemp);
|
||||||
|
processInfoVOTemp.setTaskDefinitionKey(CertificationFlowNodeEnum.TASK_RESPONSIBILITY_CONFIRMATION.getKey());
|
||||||
|
datasTemp.add(processInfoVOTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ProcessInfoDetailEO> rzgcsscPidEos = pidEos.stream().filter(pidEo -> {
|
||||||
|
return StringUtils.equals(pidEo.getTaskDefinitionKey(), CertificationFlowNodeEnum.RZGCSSC.getKey());
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(rzgcsscPidEos)){
|
||||||
|
ProcessInfoVO processInfoVOTemp = new ProcessInfoVO();
|
||||||
|
BeanUtils.copyProperties(data,processInfoVOTemp);
|
||||||
|
processInfoVOTemp.setTaskDefinitionKey(CertificationFlowNodeEnum.TASK_REVIEW.getKey());
|
||||||
|
datasTemp.add(processInfoVOTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ProcessInfoDetailEO> zrrtjrwPidEos = pidEos.stream().filter(pidEo -> {
|
||||||
|
return StringUtils.equals(pidEo.getTaskDefinitionKey(), CertificationFlowNodeEnum.ZRRTJRW.getKey());
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
if(CollectionUtils.isNotEmpty(zrrtjrwPidEos)){
|
||||||
|
ProcessInfoVO processInfoVOTemp = new ProcessInfoVO();
|
||||||
|
BeanUtils.copyProperties(data,processInfoVOTemp);
|
||||||
|
processInfoVOTemp.setTaskDefinitionKey(CertificationFlowNodeEnum.TASK_HANDLING.getKey());
|
||||||
|
datasTemp.add(processInfoVOTemp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datasIt.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datas.addAll(datasTemp);
|
||||||
|
this.disposeData(datas, cut, TaskStatusEnum.NOT_DONE.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disposeData(List<ProcessInfoVO> datas, String cut, String taskStatus) {
|
||||||
|
if (CollectionUtils.isNotEmpty(datas)) {
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date currentDate = new Date();
|
||||||
|
try {
|
||||||
|
currentDate = sdf.parse(sdf.format(currentDate));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> processInfoIdList = datas.stream().map(ProcessInfoVO::getId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
QueryWrapper<ProcessInfoDetailEO> processInfoDetailQueryWrap = new QueryWrapper<>();
|
||||||
|
processInfoDetailQueryWrap.lambda().in(ProcessInfoDetailEO::getProcessInfoId, processInfoIdList);
|
||||||
|
List<ProcessInfoDetailEO> processInfoDetailEOList = this.processInfoDetailEOService.list(processInfoDetailQueryWrap);
|
||||||
|
|
||||||
|
Map<String, List<ProcessInfoDetailEO>> lastAssigneeDetailMap = processInfoDetailEOList.stream().filter(processInfoDetailEO -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.equals(processInfoDetailEO.getStatus(), TaskStatusEnum.HAVE_DONE.getValue()) && processInfoDetailEO.getSubmitTime() != null) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.groupingBy(ProcessInfoDetailEO::getProcessInfoId));
|
||||||
|
|
||||||
|
Map<String, List<ProcessInfoDetailEO>> assigneeDetailMap = processInfoDetailEOList.stream().filter(processInfoDetailEO -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.equals(processInfoDetailEO.getStatus(), TaskStatusEnum.NOT_DONE.getValue()) && processInfoDetailEO.getSubmitTime() == null) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.groupingBy(ProcessInfoDetailEO::getProcessInfoId));
|
||||||
|
//设置责任人反馈意见
|
||||||
|
this.processInfoEOService.setPersonChargeFeedback(datas);
|
||||||
|
|
||||||
|
List<String> userIdList = new ArrayList<>();
|
||||||
|
datas.forEach(data -> {
|
||||||
|
String standardInfo = data.getStandardInfo();
|
||||||
|
if (StringUtils.isNotBlank(standardInfo)) {
|
||||||
|
String standardInfoTemp = standardInfo.replaceAll("、", " ");
|
||||||
|
data.setStandardInfo(standardInfoTemp);
|
||||||
|
}
|
||||||
|
//设置上一个操作人。
|
||||||
|
for (Map.Entry<String, List<ProcessInfoDetailEO>> detailMap : lastAssigneeDetailMap.entrySet()) {
|
||||||
|
if (StringUtils.equals(data.getId(), detailMap.getKey())) {
|
||||||
|
List<ProcessInfoDetailEO> detailEOList = detailMap.getValue();
|
||||||
|
|
||||||
|
Collections.sort(detailEOList, new Comparator<ProcessInfoDetailEO>() {
|
||||||
|
@Override
|
||||||
|
public int compare(ProcessInfoDetailEO o1, ProcessInfoDetailEO o2) {
|
||||||
|
return o2.getSubmitTime().compareTo(o1.getSubmitTime());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
String userId = detailEOList.get(0).getUserId();
|
||||||
|
userIdList.add(userId);
|
||||||
|
data.setLastAssignee(userId);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置当前操作人
|
||||||
|
for (Map.Entry<String, List<ProcessInfoDetailEO>> detailMap : assigneeDetailMap.entrySet()) {
|
||||||
|
if (StringUtils.equals(data.getId(), detailMap.getKey())) {
|
||||||
|
List<ProcessInfoDetailEO> detailEOList = detailMap.getValue();
|
||||||
|
data.setAssignee(detailEOList.stream().map(ProcessInfoDetailEO::getUserId).collect(Collectors.joining(",")));
|
||||||
|
userIdList.addAll(detailEOList.stream().map(ProcessInfoDetailEO::getUserId).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
// 如果上一操作人是空,则证明该流程当前处理人也是上一个操作人。
|
||||||
|
if (StringUtils.isEmpty(data.getLastAssignee())) {
|
||||||
|
List<String> collect = detailEOList.stream().filter(detailEO -> {
|
||||||
|
return (StringUtils.equals(detailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.THE_RESPONSIBLE_PERSON_HANDLES_THE_TASK.getKey())
|
||||||
|
|| StringUtils.equals(detailEO.getTaskDefinitionKey(), DesignComplianceNodeEnum.SPONSOR_REVIEW.getKey()));
|
||||||
|
}).map(ProcessInfoDetailEO::getUserId).collect(Collectors.toList());
|
||||||
|
if (CollectionUtils.isNotEmpty(collect)) {
|
||||||
|
data.setLastAssignee(collect.get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<String> taskIdList = datas.stream().map(ProcessInfoVO::getTaskId).distinct().collect(Collectors.toList());
|
||||||
|
List<ProjectTaskInventoryDetailEO> taskInventoryDetailList = new ArrayList<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(taskIdList)) {
|
||||||
|
QueryWrapper<ProjectTaskInventoryDetailEO> taskInventoryDetailQueryWrap = new QueryWrapper<>();
|
||||||
|
taskInventoryDetailQueryWrap.lambda().in(ProjectTaskInventoryDetailEO::getTaskId, taskIdList);
|
||||||
|
taskInventoryDetailList = this.projectTaskInventoryDetailEOService.list(taskInventoryDetailQueryWrap);
|
||||||
|
}
|
||||||
|
List<ProjectTaskInventoryDetailEO> finalTaskInventoryDetailList = taskInventoryDetailList;
|
||||||
|
|
||||||
|
List<SysUser> sysUserList = this.sysUserService.querySysUserListByIdList(userIdList);
|
||||||
|
|
||||||
|
Date finalCurrentDate = currentDate;
|
||||||
|
datas.forEach(data -> {
|
||||||
|
if (StringUtils.isNotEmpty(data.getFlowType())) {
|
||||||
|
data.setFlowTypeShow(FlowTypeEnum.getTextByValue(data.getFlowType(), cut));
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotEmpty(data.getStatus())) {
|
||||||
|
data.setStatusShow(TodoCenterStatusEnum.getTextByValue(data.getStatus(), cut));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(sysUserList)) {
|
||||||
|
if (StringUtils.isNotEmpty(data.getLastAssignee())) {
|
||||||
|
String lastUserName = sysUserList.stream().filter(sysUser -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.equals(data.getLastAssignee(), sysUser.getId())) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||||
|
data.setLastAssigneeName(lastUserName);
|
||||||
|
}
|
||||||
|
//如果流程没有结束,才可以展示当前处理人。
|
||||||
|
if (!StringUtils.equals(data.getStatus(), TodoCenterStatusEnum.COMPLETED.getValue())) {
|
||||||
|
if (StringUtils.isNotEmpty(data.getAssignee())) {
|
||||||
|
String[] assigneeArr = data.getAssignee().split(",");
|
||||||
|
String currentUserName = sysUserList.stream().filter(sysUser -> {
|
||||||
|
boolean flag = false;
|
||||||
|
for (String assignee : assigneeArr) {
|
||||||
|
if (StringUtils.equals(assignee, sysUser.getId())) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).map(SysUser::getUsername).collect(Collectors.joining(","));
|
||||||
|
data.setAssigneeName(currentUserName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置任务清单明细表id
|
||||||
|
if (CollectionUtils.isNotEmpty(finalTaskInventoryDetailList)) {
|
||||||
|
String primaryKeyId = finalTaskInventoryDetailList.stream().filter(taskInventoryDetail -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.equals(data.getTaskId(), taskInventoryDetail.getTaskId())) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).map(ProjectTaskInventoryDetailEO::getId).collect(Collectors.joining(","));
|
||||||
|
data.setPrimaryKeyId(primaryKeyId);
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断当前任务是否过期
|
||||||
|
Date endTime = data.getEndTime();
|
||||||
|
if (ObjectUtils.isNotEmpty(endTime)) {
|
||||||
|
try {
|
||||||
|
endTime = sdf.parse(sdf.format(endTime));
|
||||||
|
} catch (ParseException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (finalCurrentDate.after(endTime) || finalCurrentDate.equals(endTime)) {
|
||||||
|
data.setEndTimePastDueFlag(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<String> createByUserIdList = datas.stream().map(ProcessInfoVO::getCreateBy).distinct().collect(Collectors.toList());
|
||||||
|
List<SysUser> createByUserList = this.sysUserService.querySysUserListByIdList(createByUserIdList);
|
||||||
|
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
||||||
|
List<String> projectLawsInventoryIdList = datas.stream().filter(data -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.isNotEmpty(data.getProjectLawsInventoryId())) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).map(ProcessInfoVO::getProjectLawsInventoryId).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<ProjectLawsInventoryEO> projectLawsInventoryEOList = new ArrayList<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(projectLawsInventoryIdList)) {
|
||||||
|
QueryWrapper<ProjectLawsInventoryEO> lawsInventoryEOQueryWrapper = new QueryWrapper<>();
|
||||||
|
lawsInventoryEOQueryWrapper.lambda().in(ProjectLawsInventoryEO::getId, projectLawsInventoryIdList);
|
||||||
|
projectLawsInventoryEOList = this.projectLawsInventoryEOService.list(lawsInventoryEOQueryWrapper);
|
||||||
|
}
|
||||||
|
List<SysCategory> categoryList = this.sysCategoryService.list();
|
||||||
|
|
||||||
|
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.getBaseMapper().selectItemsAll();
|
||||||
|
for (ProcessInfoVO data : datas) {
|
||||||
|
if (CollectionUtils.isNotEmpty(projectLawsInventoryEOList)) {
|
||||||
|
// 处理展示的交付物类型信息
|
||||||
|
String projectLawsInventoryId = data.getProjectLawsInventoryId();
|
||||||
|
String deliverableTypeName = this.projectLawsInventoryEOService.getDeliverableTypeNameById(projectLawsInventoryId, cut, data.getFlowType(), projectLawsInventoryEOList, categoryList);
|
||||||
|
data.setDeliverableTypeName(deliverableTypeName);
|
||||||
|
|
||||||
|
// 处理责任领域展示信息
|
||||||
|
String dutyTerritoryName = this.projectLawsInventoryEOService.getDutyTerritoryNameById(projectLawsInventoryId, cut, projectLawsInventoryEOList, sysDictItems, ProjectInventoryFieldEnum.DUTY_TERRITORY.getValue());
|
||||||
|
data.setDutyTerritoryName(dutyTerritoryName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
datas.forEach(data -> {
|
||||||
|
// 设置发起人的名称
|
||||||
|
if (CollectionUtils.isNotEmpty(createByUserList) && StringUtils.isNotEmpty(data.getCreateBy())) {
|
||||||
|
String createBy = createByUserList.stream().filter(createByUser -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.equals(createByUser.getId(), data.getCreateBy())) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).map(SysUser::getUsername).distinct().collect(Collectors.joining(","));
|
||||||
|
data.setCreateBy(createBy);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!StringUtils.equals(data.getFlowType(), FlowTypeEnum.QDQR.getValue()) && !StringUtils.equals(data.getFlowType(), FlowTypeEnum.CERTIFICATION_LC.getValue())) {
|
||||||
|
// 获取当前用户所拥有的待办任务信息
|
||||||
|
List<ProcessInfoDetailEO> currentUserProcessInfoDetailInfos = processInfoDetailEOList.stream().filter(detail -> {
|
||||||
|
boolean flag = false;
|
||||||
|
if (StringUtils.isNotEmpty(taskStatus)) {
|
||||||
|
flag = (StringUtils.equals(detail.getProcessInfoId(), data.getId()) && StringUtils.equals(detail.getUserId(), currentUser.getId()) && StringUtils.equals(taskStatus, detail.getStatus()));
|
||||||
|
} else {
|
||||||
|
flag = (StringUtils.equals(detail.getProcessInfoId(), data.getId()) && StringUtils.equals(detail.getUserId(), currentUser.getId()));
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
if (CollectionUtils.isNotEmpty(currentUserProcessInfoDetailInfos)) {
|
||||||
|
// 设置taskId
|
||||||
|
data.setTaskId(currentUserProcessInfoDetailInfos.get(0).getTaskId());
|
||||||
|
// 设置taskDefinitionKey
|
||||||
|
data.setTaskDefinitionKey(currentUserProcessInfoDetailInfos.get(0).getTaskDefinitionKey());
|
||||||
|
String taskDefinitionKeyName = "";
|
||||||
|
if (StringUtils.equals(data.getFlowType(), FlowTypeEnum.SJFHXSHLC.getValue())) {
|
||||||
|
taskDefinitionKeyName = DesignComplianceFlowNodeKeyEnum.getTextByValue(currentUserProcessInfoDetailInfos.get(0).getTaskDefinitionKey(), cut);
|
||||||
|
} else if (StringUtils.equals(data.getFlowType(), FlowTypeEnum.YZFHXSCLC.getValue())) {
|
||||||
|
taskDefinitionKeyName = VerifyComplianceFlowNodeKeyEnum.getTextByValue(currentUserProcessInfoDetailInfos.get(0).getTaskDefinitionKey(), cut);
|
||||||
|
}
|
||||||
|
data.setTaskDefinitionKeyName(taskDefinitionKeyName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果是清单确认流程,将任务节点设置为 清单校核:Checklist verification
|
||||||
|
if (StringUtils.equals(data.getFlowType(), FlowTypeEnum.QDQR.getValue())) {
|
||||||
|
String taskDefinitionKeyName = "清单校核";
|
||||||
|
if (StringUtils.equals(cut, CutEnum.EN.getValue())) {
|
||||||
|
taskDefinitionKeyName = "Checklist verification";
|
||||||
|
}
|
||||||
|
data.setTaskDefinitionKeyName(taskDefinitionKeyName);
|
||||||
|
}
|
||||||
|
// 如果是Pre-Homo流程
|
||||||
|
if (StringUtils.equals(data.getFlowType(), FlowTypeEnum.CERTIFICATION_LC.getValue()) && data.getEndTime() != null) {
|
||||||
|
data.setTaskDefinitionKeyName(CertificationFlowNodeEnum.getTextByValue(data.getTaskDefinitionKey(), cut));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -37,4 +37,11 @@ public interface ProcessInfoEOMapper extends BaseMapper<ProcessInfoEO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<ProcessInfoVO> queryLawsAssessPageList(IPage page, Map<String, Object> params);
|
IPage<ProcessInfoVO> queryLawsAssessPageList(IPage page, Map<String, Object> params);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机端-查询待办任务数据
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<ProcessInfoVO> queryPhoneTodoTaskListList(IPage page, Map<String, Object> params);
|
||||||
}
|
}
|
||||||
|
|||||||
+157
@@ -374,4 +374,161 @@
|
|||||||
order by temp.end_time desc
|
order by temp.end_time desc
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryPhoneTodoTaskListList" resultType="com.jero.modules.todoCenter.vo.ProcessInfoVO">
|
||||||
|
select
|
||||||
|
temp.*,
|
||||||
|
(case temp.flow_type when '10' THEN '1' when '21' THEN '2' when '2' THEN '3' when '4' THEN '4' END) as flow_type_show_order_by
|
||||||
|
from (
|
||||||
|
SELECT
|
||||||
|
pi.id,
|
||||||
|
pi.project_library_id,
|
||||||
|
pi.project_laws_inventory_id,
|
||||||
|
pi.buss_document_library_id,
|
||||||
|
pi.acti_proc_inst_id,
|
||||||
|
concat(
|
||||||
|
pni.project_name,
|
||||||
|
'-',
|
||||||
|
pyni.year_name,
|
||||||
|
'-',
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
<if test="params.cut == 'cn'">
|
||||||
|
CASE WHEN GROUP_CONCAT( item_text SEPARATOR ',' ) IS NULL THEN '' ELSE GROUP_CONCAT( item_text SEPARATOR ',' ) END AS item_text
|
||||||
|
</if>
|
||||||
|
<if test="params.cut == 'en'">
|
||||||
|
CASE WHEN GROUP_CONCAT( en_name SEPARATOR ',' ) IS NULL THEN '' ELSE GROUP_CONCAT( en_name SEPARATOR ',' ) END AS item_text
|
||||||
|
</if>
|
||||||
|
FROM
|
||||||
|
sys_dict_item
|
||||||
|
WHERE
|
||||||
|
FIND_IN_SET( item_value, plb.target_market ) > 0
|
||||||
|
AND dict_id = ( SELECT id FROM sys_dict WHERE dict_code = 'region' )
|
||||||
|
) ,
|
||||||
|
'-',
|
||||||
|
plb.project_version
|
||||||
|
) AS project_name,
|
||||||
|
pyni.year_name,
|
||||||
|
pli.serial_number,
|
||||||
|
pli.title,
|
||||||
|
bdl.title_en,
|
||||||
|
<if test="params.cut == 'cn'">
|
||||||
|
concat(pli.serial_number,' ',pli.title) as standard_info,
|
||||||
|
</if>
|
||||||
|
<if test="params.cut == 'en'">
|
||||||
|
concat(pli.serial_number,' ',bdl.title_en) as standard_info,
|
||||||
|
</if>
|
||||||
|
(case pi.flow_type when '32' THEN '2' when '34' THEN '4' else pi.flow_type END) as flow_type,
|
||||||
|
pi.create_by,
|
||||||
|
pi.end_time,
|
||||||
|
pi.STATUS,
|
||||||
|
pi.prc_num,
|
||||||
|
pi.prc_name,
|
||||||
|
plb.project_name_id,
|
||||||
|
plb.target_market,
|
||||||
|
plb.studio_engineer,
|
||||||
|
plb.project_version,
|
||||||
|
plb.parent_id
|
||||||
|
FROM
|
||||||
|
process_info pi
|
||||||
|
LEFT JOIN project_library_base plb ON plb.id = pi.project_library_id
|
||||||
|
LEFT JOIN project_name_info pni ON pni.id = plb.project_name_id
|
||||||
|
LEFT JOIN project_year_name_info pyni ON pyni.id = plb.year_name_id
|
||||||
|
LEFT JOIN project_laws_inventory pli ON pi.project_laws_inventory_id = pli.id
|
||||||
|
LEFT JOIN buss_document_library bdl ON pi.buss_document_library_id = bdl.id
|
||||||
|
where (
|
||||||
|
pi.id IN (
|
||||||
|
SELECT
|
||||||
|
pid.process_info_id
|
||||||
|
FROM
|
||||||
|
process_info_detail pid
|
||||||
|
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
AND pi.flow_type IN
|
||||||
|
<foreach collection="params.flowTypeList" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
union
|
||||||
|
SELECT
|
||||||
|
pi.id,
|
||||||
|
pi.project_library_id,
|
||||||
|
pi.project_laws_inventory_id,
|
||||||
|
pi.buss_document_library_id,
|
||||||
|
pi.acti_proc_inst_id,
|
||||||
|
concat(
|
||||||
|
pni.project_name,
|
||||||
|
'-',
|
||||||
|
pyni.year_name,
|
||||||
|
'-',
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
<if test="params.cut == 'cn'">
|
||||||
|
CASE WHEN GROUP_CONCAT( item_text SEPARATOR ',' ) IS NULL THEN '' ELSE GROUP_CONCAT( item_text SEPARATOR ',' ) END AS item_text
|
||||||
|
</if>
|
||||||
|
<if test="params.cut == 'en'">
|
||||||
|
CASE WHEN GROUP_CONCAT( en_name SEPARATOR ',' ) IS NULL THEN '' ELSE GROUP_CONCAT( en_name SEPARATOR ',' ) END AS item_text
|
||||||
|
</if>
|
||||||
|
FROM
|
||||||
|
sys_dict_item
|
||||||
|
WHERE
|
||||||
|
FIND_IN_SET( item_value, plb.target_market ) > 0
|
||||||
|
AND dict_id = ( SELECT id FROM sys_dict WHERE dict_code = 'region' )
|
||||||
|
) ,
|
||||||
|
'-',
|
||||||
|
plb.project_version
|
||||||
|
) AS project_name,
|
||||||
|
pyni.year_name,
|
||||||
|
'--' as serial_number,
|
||||||
|
'--' as standard_info,
|
||||||
|
'' as title,
|
||||||
|
'' as title_en,
|
||||||
|
pi.flow_type,
|
||||||
|
pi.create_by,
|
||||||
|
(
|
||||||
|
select
|
||||||
|
pid.end_time
|
||||||
|
from
|
||||||
|
process_info_detail pid
|
||||||
|
where pid.process_info_id = pi.id and pid.STATUS = 'NotDone' and pid.end_time is not null order by pid.end_time asc limit 1
|
||||||
|
) as end_time,
|
||||||
|
pi.STATUS,
|
||||||
|
pi.prc_num,
|
||||||
|
pi.prc_name,
|
||||||
|
plb.project_name_id,
|
||||||
|
plb.target_market,
|
||||||
|
plb.studio_engineer,
|
||||||
|
plb.project_version,
|
||||||
|
plb.parent_id
|
||||||
|
FROM
|
||||||
|
process_info pi
|
||||||
|
LEFT JOIN project_library_base plb ON plb.id = pi.project_library_id
|
||||||
|
LEFT JOIN project_name_info pni ON pni.id = plb.project_name_id
|
||||||
|
LEFT JOIN project_year_name_info pyni ON pyni.id = plb.year_name_id
|
||||||
|
LEFT JOIN project_laws_inventory pli ON pi.project_laws_inventory_id = pli.id
|
||||||
|
WHERE (
|
||||||
|
pi.id IN (
|
||||||
|
SELECT
|
||||||
|
pid.process_info_id
|
||||||
|
FROM
|
||||||
|
process_info_detail pid
|
||||||
|
where pid.user_id = #{params.currentUserId} and pid.status = #{params.taskStatus}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
AND pi.flow_type IN
|
||||||
|
<foreach collection="params.qdqrFlowTypeValue" index="index" item="item" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)temp
|
||||||
|
<include refid="BaseQuerySql"/>
|
||||||
|
order by
|
||||||
|
temp.end_time IS NULL,
|
||||||
|
temp.end_time,
|
||||||
|
temp.project_name IS NULL,
|
||||||
|
temp.project_name,
|
||||||
|
standard_info IS NULL,
|
||||||
|
standard_info,
|
||||||
|
flow_type_show_order_by
|
||||||
|
ASC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+6
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
import com.jero.modules.todoCenter.entity.ProcessInfoEO;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.jero.modules.todoCenter.vo.ProcessInfoVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -126,4 +128,8 @@ public interface IProcessInfoEOService extends IService<ProcessInfoEO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result<?> complianceDataMigration(Map<String, Object> params);
|
Result<?> complianceDataMigration(Map<String, Object> params);
|
||||||
|
|
||||||
|
void disposeData(List<ProcessInfoVO> datas, String cut, String taskStatus);
|
||||||
|
|
||||||
|
public void setPersonChargeFeedback(List<ProcessInfoVO> datas);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -528,6 +528,7 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl<ProcessInfoEOMapper, P
|
|||||||
* @param datas
|
* @param datas
|
||||||
* @param cut
|
* @param cut
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void disposeData(List<ProcessInfoVO> datas, String cut, String taskStatus){
|
public void disposeData(List<ProcessInfoVO> datas, String cut, String taskStatus){
|
||||||
if(CollectionUtils.isNotEmpty(datas)){
|
if(CollectionUtils.isNotEmpty(datas)){
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
@@ -847,6 +848,7 @@ public class ProcessInfoEOServiceImpl extends ServiceImpl<ProcessInfoEOMapper, P
|
|||||||
* 设置符合性流程中责任人反馈意见
|
* 设置符合性流程中责任人反馈意见
|
||||||
* @param datas
|
* @param datas
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setPersonChargeFeedback(List<ProcessInfoVO> datas){
|
public void setPersonChargeFeedback(List<ProcessInfoVO> datas){
|
||||||
//符合性流程实例id
|
//符合性流程实例id
|
||||||
List<String> complianceProcessPrcIdList = datas.stream().filter(data -> {
|
List<String> complianceProcessPrcIdList = datas.stream().filter(data -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user