|
@@ -4,7 +4,6 @@ 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;
|
|
|
import com.platform.common.exception.DeniedException;
|
|
|
import com.platform.common.model.UserInfo;
|
|
@@ -15,7 +14,6 @@ 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;
|
|
|
-import com.platform.dao.entity.sb.SbPosition;
|
|
|
import com.platform.dao.entity.upms.SysFile;
|
|
|
import com.platform.dao.entity.upms.SysUser;
|
|
|
import com.platform.dao.enums.*;
|
|
@@ -789,34 +787,94 @@ public class PreparationServiceImpl extends BaseServiceImpl<PreparationMapper, P
|
|
|
PreparationVO vo = new PreparationVO();
|
|
|
BigDecimal initNum= new BigDecimal(0);
|
|
|
PreparationDTO preparationDTO = new PreparationDTO();
|
|
|
- preparationDTO.setTempUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ UserInfo userInfo = SecurityUtils.getUserInfo();
|
|
|
+ // 获取用户角色
|
|
|
+ StringBuilder roleCodes = new StringBuilder();
|
|
|
+ userInfo.getRoleCodes().forEach(item-> {
|
|
|
+ roleCodes.append(item).append(",");
|
|
|
+ });
|
|
|
+ String roles = roleCodes.toString();
|
|
|
+ // 角色标识
|
|
|
+ int roleFlag = 1; // 1 申请人 2 执行人 3 部门主管 4 部门负责人
|
|
|
+ if(userInfo.getSuperAdmin() != 1){
|
|
|
+ preparationDTO.setDelUserId(userInfo.getUserId());
|
|
|
+ if(roles.contains(SysRoleCodeEnum.DEPT_LEADER.name())){
|
|
|
+ // 部门负责人(执行和申请)
|
|
|
+ roleFlag = 4;
|
|
|
+ preparationDTO.setTempUserId(userInfo.getUserId());
|
|
|
+ }else if(roles.contains(SysRoleCodeEnum.DEPT_MANAGER.name())){
|
|
|
+ // 申请部门主管
|
|
|
+ roleFlag = 3;
|
|
|
+ preparationDTO.setApplyVerifyUserId(userInfo.getUserId());
|
|
|
+ }else if(roles.contains(SysRoleCodeEnum.PREPARATION_USER.name())){
|
|
|
+ // 执行人
|
|
|
+ roleFlag = 2;
|
|
|
+ preparationDTO.setRepairUserId(userInfo.getUserId());
|
|
|
+ }else {
|
|
|
+ // 申请人
|
|
|
+ preparationDTO.setUserId(userInfo.getUserId());
|
|
|
+ }
|
|
|
+ }
|
|
|
List<PreparationVO> preparationVOS = mapper.getCountByUserId(preparationDTO);
|
|
|
vo.setWaitVerifyNum(initNum);
|
|
|
vo.setRefusedNum(initNum);
|
|
|
vo.setBackNum(initNum);
|
|
|
vo.setWorkingNum(initNum);
|
|
|
if(preparationVOS != null && preparationVOS.size() > 0){
|
|
|
- preparationVOS.forEach(item->{
|
|
|
+ for(PreparationVO item : preparationVOS){
|
|
|
BigDecimal tempVal = item.getCounts() == null ? initNum : item.getCounts();
|
|
|
- if (item.getStatus() == PreparationStatusEnum.NOT_ALLOCATED.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.FIRST_PROCESSING_VERIFYING.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING_VERIFYING.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.APPLY_LEADER_VERIFY_SUCCESS.getValue()){ // 待审核
|
|
|
- vo.setWaitVerifyNum(vo.getWaitVerifyNum().add(tempVal));
|
|
|
- }else if(item.getStatus() == PreparationStatusEnum.CLOSE.getValue()){ // 被拒工单
|
|
|
- vo.setRefusedNum(vo.getRefusedNum().add(tempVal));
|
|
|
- }else if(item.getStatus() == PreparationStatusEnum.APPLY_MANAGER_VERIFY_BACK.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.APPLY_LEADER_VERIFY_BACK.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.RECEIVE_VERIFY_BACK.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.FIRST_PROCESSING_VERIFY_BACK.getValue() ||
|
|
|
- item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING_BACK.getValue()){ // 待审核
|
|
|
- vo.setBackNum(vo.getBackNum().add(tempVal));
|
|
|
- }else if(item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING.getValue()){
|
|
|
- // 执行工单
|
|
|
- vo.setWorkingNum(vo.getWorkingNum().add(tempVal));
|
|
|
+ switch (roleFlag){
|
|
|
+ case 1: // 申请人
|
|
|
+ if (item.getStatus() == PreparationStatusEnum.FIRST_PROCESSING_VERIFYING.getValue() ||
|
|
|
+ item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING_VERIFYING.getValue()){ // 待审核
|
|
|
+ vo.setWaitVerifyNum(vo.getWaitVerifyNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.CLOSE.getValue()){ // 被拒工单
|
|
|
+ vo.setRefusedNum(vo.getRefusedNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.APPLY_MANAGER_VERIFY_BACK.getValue()){ // 回退
|
|
|
+ vo.setBackNum(vo.getBackNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING.getValue()){
|
|
|
+ // 执行工单
|
|
|
+ vo.setWorkingNum(vo.getWorkingNum().add(tempVal));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 2: // 执行人
|
|
|
+ if(item.getStatus() == PreparationStatusEnum.CLOSE.getValue()){ // 被拒工单
|
|
|
+ vo.setRefusedNum(vo.getRefusedNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.FIRST_PROCESSING_VERIFY_BACK.getValue() ||
|
|
|
+ item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING_BACK.getValue()){ // 回退工单
|
|
|
+ vo.setBackNum(vo.getBackNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING.getValue() || item.getStatus() == PreparationStatusEnum.PROCESSING.getValue()){
|
|
|
+ // 执行工单
|
|
|
+ vo.setWorkingNum(vo.getWorkingNum().add(tempVal));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3: // 部门主管
|
|
|
+ if (item.getStatus() == PreparationStatusEnum.NOT_ALLOCATED.getValue()){ // 待审核
|
|
|
+ vo.setWaitVerifyNum(vo.getWaitVerifyNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.CLOSE.getValue()){ // 被拒工单
|
|
|
+ vo.setRefusedNum(vo.getRefusedNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.APPLY_LEADER_VERIFY_BACK.getValue()){ // 回退工单
|
|
|
+ vo.setBackNum(vo.getBackNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING.getValue()){
|
|
|
+ // 执行工单
|
|
|
+ vo.setWorkingNum(vo.getWorkingNum().add(tempVal));
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4: // 部门负责人
|
|
|
+ if (item.getStatus() == PreparationStatusEnum.APPLY_MANAGER_VERIFY_SUCCESS.getValue() ||
|
|
|
+ item.getStatus() == PreparationStatusEnum.APPLY_LEADER_VERIFY_SUCCESS.getValue()){ // 待审核
|
|
|
+ vo.setWaitVerifyNum(vo.getWaitVerifyNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.CLOSE.getValue()){ // 被拒工单
|
|
|
+ vo.setRefusedNum(vo.getRefusedNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.RECEIVE_VERIFY_BACK.getValue()){ // 待审核
|
|
|
+ vo.setBackNum(vo.getBackNum().add(tempVal));
|
|
|
+ }else if(item.getStatus() == PreparationStatusEnum.SECOND_PROCESSING.getValue()){
|
|
|
+ // 执行工单
|
|
|
+ vo.setWorkingNum(vo.getWorkingNum().add(tempVal));
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
return vo;
|
|
|
}
|