|
@@ -2,6 +2,7 @@ package com.platform.service.preparation.impl;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.platform.common.bean.AbstractPageResultBean;
|
|
|
+import com.platform.common.bean.DataScope;
|
|
|
import com.platform.common.cache.ConfigCache;
|
|
|
import com.platform.common.cache.DictCache;
|
|
|
import com.platform.common.constant.CommonConstants;
|
|
@@ -10,6 +11,7 @@ import com.platform.common.model.UserInfo;
|
|
|
import com.platform.common.util.*;
|
|
|
import com.platform.dao.bean.MyPage;
|
|
|
import com.platform.dao.dto.preparation.PreparationDTO;
|
|
|
+import com.platform.dao.dto.preparation.PreparationRecordDTO;
|
|
|
import com.platform.dao.dto.upms.SysUserDTO;
|
|
|
import com.platform.dao.entity.preparation.Preparation;
|
|
|
import com.platform.dao.entity.preparation.PreparationRecord;
|
|
@@ -28,6 +30,7 @@ import com.platform.dao.util.MessageTemplateUtil;
|
|
|
import com.platform.dao.vo.SysUserRoleVO;
|
|
|
import com.platform.dao.vo.SysUserVO;
|
|
|
import com.platform.dao.vo.export.preparation.ExportPreparationNumVO;
|
|
|
+import com.platform.dao.vo.query.preparation.PreparationRecordVO;
|
|
|
import com.platform.dao.vo.query.preparation.PreparationVO;
|
|
|
import com.platform.dao.vo.report.AllPreparationReportVO;
|
|
|
import com.platform.dao.vo.report.PreparationReportByStatusVO;
|
|
@@ -280,6 +283,10 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
record.setTempUserId(null);
|
|
|
} else if (record.getSearchType() == 2) { // 待审核工单
|
|
|
statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
+ statusList.add(PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue());
|
|
|
+ statusList.add(PreparationStatusEnum.APPLY_LEADER_VERIFY_SUCCESS.getValue());
|
|
|
+ statusList.add(PreparationStatusEnum.FIRST_PROCESSING_VERIFYING.getValue());
|
|
|
+ statusList.add(PreparationStatusEnum.SECOND_PROCESSING_VERIFYING.getValue());
|
|
|
} else if (record.getSearchType() == 3) { // 我的工单
|
|
|
statusList.add(PreparationStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
statusList.add(PreparationStatusEnum.PROCESSING.getValue());
|
|
@@ -457,28 +464,32 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
if (!StringUtils.isEmpty(vo.getApplyVerifyUserId())) {
|
|
|
vo.setApplyVerifyUser(sysUserMapper.selectUserNameById(vo.getApplyVerifyUserId()));
|
|
|
}
|
|
|
+ // 部门审批负责人
|
|
|
+ if (!StringUtils.isEmpty(vo.getApplyVerifyLeader())) {
|
|
|
+ vo.setApplyVerifyLeaderName(sysUserMapper.selectUserNameById(vo.getApplyVerifyLeader()));
|
|
|
+ }
|
|
|
+ // 收件部门
|
|
|
+ if (!StringUtils.isEmpty(vo.getReceiveDept())) {
|
|
|
+ vo.setReceiveDeptName(sysDeptMapper.selectByPrimaryKey(vo.getReceiveDept()).getName());
|
|
|
+ }
|
|
|
+ // 收件部门审批负责人
|
|
|
+ if (!StringUtils.isEmpty(vo.getReceiveVerifyLeader())) {
|
|
|
+ vo.setReceiveVerifyLeaderName(sysUserMapper.selectUserNameById(vo.getReceiveVerifyLeader()));
|
|
|
+ }
|
|
|
// 执行部门
|
|
|
if (!StringUtils.isEmpty(vo.getExecuteDept())) {
|
|
|
vo.setExecuteDeptName(sysDeptMapper.selectByPrimaryKey(vo.getExecuteDept()).getName());
|
|
|
- if (vo.getStatus() == PreparationStatusEnum.PROCESSING.getValue()
|
|
|
- || vo.getStatus() == PreparationStatusEnum.FINISHED.getValue()) {
|
|
|
- vo.setDispatchUserName(sysUserMapper.selectUserNameById(vo.getDispatchUserId()));
|
|
|
- } else {
|
|
|
- // 获取筹建主管角色
|
|
|
- SysUserDTO queryUserDTO = new SysUserDTO();
|
|
|
- queryUserDTO.setRoleCode(SysRoleCodeEnum.PREPARATION_MANAGER.name());
|
|
|
- queryUserDTO.setDeptId(vo.getExecuteDept());
|
|
|
- List<SysUserVO> userVOS = sysUserMapper.selectDeptRoleUser(queryUserDTO);
|
|
|
- // 判断执行部门是否有人接单
|
|
|
- if (userVOS != null || userVOS.size() > 0) {
|
|
|
- StringBuilder info = new StringBuilder();
|
|
|
- userVOS.forEach(item -> {
|
|
|
- info.append(item.getRealName()).append("、");
|
|
|
- });
|
|
|
- vo.setExecuteMangers(info.toString());
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
+ // 获取审核记录
|
|
|
+ PreparationRecordDTO recordDTO = new PreparationRecordDTO();
|
|
|
+ recordDTO.setPreparationId(vo.getId());
|
|
|
+ recordDTO.setType(PreparationRecordTypeEnum.VERIFY.getValue());
|
|
|
+ DataScope dataScope = new DataScope();
|
|
|
+ dataScope.put("sortName","created_time");
|
|
|
+ dataScope.put("sortBy","asc");
|
|
|
+ recordDTO.setDataScope(dataScope);
|
|
|
+ List<PreparationRecordVO> recordList = preparationRecordMapper.selectList(recordDTO);
|
|
|
+ vo.setRecordList(recordList);
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
@@ -509,7 +520,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
switch (preparation.getStatus()) {
|
|
|
case CommonConstants.PREPARATION_NOT_ALLOCATED:
|
|
|
// 主管审批
|
|
|
- if (!roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name()) || currentUserId.equals(preparation.getApplyVerifyUserId())) {
|
|
|
+ if (!roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name()) || !currentUserId.equals(preparation.getApplyVerifyUserId())) {
|
|
|
throw new DeniedException("不具备审核权限");
|
|
|
}
|
|
|
if (model.getVerifyStatus() == 1) { // 通过
|
|
@@ -527,7 +538,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
break;
|
|
|
case CommonConstants.APPLY_MANAGER_VERIFY_SUCCESS:
|
|
|
// 负责人审批
|
|
|
- if (!roles.contains(SysRoleCodeEnum.DEPT_LEADER.name()) || currentUserId.equals(preparation.getApplyVerifyLeader())) {
|
|
|
+ if (!roles.contains(SysRoleCodeEnum.DEPT_LEADER.name()) || !currentUserId.equals(preparation.getApplyVerifyLeader())) {
|
|
|
throw new DeniedException("不具备审核权限");
|
|
|
}
|
|
|
if (model.getVerifyStatus() == 1) { // 通过
|
|
@@ -545,7 +556,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
break;
|
|
|
case CommonConstants.FIRST_PROCESSING_VERIFYING:
|
|
|
// 申请人费用审批
|
|
|
- if (currentUserId.equals(preparation.getUserId())) {
|
|
|
+ if (!currentUserId.equals(preparation.getUserId())) {
|
|
|
throw new DeniedException("不具备审核权限");
|
|
|
}
|
|
|
if (model.getVerifyStatus() == 1) { // 通过
|
|
@@ -561,7 +572,7 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
break;
|
|
|
case CommonConstants.SECOND_PROCESSING_VERIFYING:
|
|
|
// 申请人验收审批
|
|
|
- if (currentUserId.equals(preparation.getUserId())) {
|
|
|
+ if (!currentUserId.equals(preparation.getUserId())) {
|
|
|
throw new DeniedException("不具备审核权限");
|
|
|
}
|
|
|
if (model.getVerifyStatus() == 1) { // 通过
|