| | |
| | | //处理人员类信息 |
| | | this.dealNoticeData(workorder); |
| | | //处理SHE事件状态 |
| | | workorder.setStatus(Constants.equalsInteger(workorder.getType(),Constants.ZERO)?Constants.workOrderStatus.close.getStatus():Constants.workOrderStatus.waitConfirm.getStatus()); |
| | | workorder.setStatus(Constants.equalsInteger(workorder.getType(),Constants.ZERO)?Constants.WorkOrderStatus.close.getKey():Constants.WorkOrderStatus.waitConfirm.getKey()); |
| | | workorderMapper.insert(workorder); |
| | | //存储DCA 问题记录表 |
| | | this.saveProblemData(workorder); |
| | |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"SHE工单无法进行该操作"); |
| | | } |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.sheClose)||Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.wtsClose)||Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.close)){ |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.sheClose.getKey())||Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.wtsClose.getKey())||Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.close.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"工单状态已流转"); |
| | | } |
| | | //提交后的 待确认/待初审状态 如果去关闭 只有工单里绑定的SHE人员可以关闭 |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitConfirm)){ |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())){ |
| | | //判断SHE人员内是否有当前登录账号 |
| | | if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,当前工单非您的工单,无法进行处理"); |
| | | } |
| | | workorder.setStatus(Constants.workOrderStatus.sheClose); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | workorder.setStatus(Constants.WorkOrderStatus.sheClose.getKey()); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | //判断SHE人员内是否有当前登录账号 |
| | | if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO && !workorder.getManagerId().equals(closeDTO.getMember().getQwId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,当前工单非您的工单,无法进行处理"); |
| | | } |
| | | workorder.setStatus(Constants.workOrderStatus.wtsClose); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitDeal)){ |
| | | workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey()); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey())){ |
| | | //判断SHE人员内是否有当前登录账号 |
| | | if(workorder.getQwnoticeMemberIds().indexOf(closeDTO.getMember().getQwId())<Constants.ZERO && !workorder.getManagerId().equals(closeDTO.getMember().getQwId()) |
| | | && !workorder.getDealerId().equals(closeDTO.getMember().getQwId()) ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,当前工单非您的工单,无法进行处理"); |
| | | } |
| | | workorder.setStatus(Constants.workOrderStatus.wtsClose); |
| | | workorder.setStatus(Constants.WorkOrderStatus.wtsClose.getKey()); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"工单状态已流转"); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"SHE工单无法进行该操作"); |
| | | } |
| | | if(Constants.equalsInteger(passOnDTO.getPassOnType(),Constants.ZERO)){ |
| | | if(!Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitConfirm)){ |
| | | if(!Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitConfirm.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"工单状态已流转"); |
| | | } |
| | | workorder.setManagerId(member.getQwId()); |
| | | workorder.setStatus(Constants.workOrderStatus.waitAllocation); |
| | | workorder.setStatus(Constants.WorkOrderStatus.waitAllocation.getKey()); |
| | | }else{ |
| | | if(!(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitDeal))){ |
| | | if(!(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey()) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitDeal.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"工单状态已流转"); |
| | | } |
| | | workorder.setDealerId(member.getQwId()); |
| | | workorder.setStatus(Constants.workOrderStatus.waitDeal); |
| | | workorder.setStatus(Constants.WorkOrderStatus.waitDeal.getKey()); |
| | | } |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | |
| | | } |
| | | Member urgeUser = new Member(); |
| | | //如果已分配 wts 则是催促wts |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getManagerId()).last("limit 1 ")); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getDealerId()).last("limit 1 ")); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"状态已流转无法进行该操作"); |
| | |
| | | @Override |
| | | public void jobUrge(){ |
| | | List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().lambda().eq(Workorder::getIsdeleted,Constants.ZERO) |
| | | .in(Workorder::getStatus,Constants.workOrderStatus.waitAllocation,Constants.workOrderStatus.waitDeal) |
| | | .in(Workorder::getStatus,Constants.WorkOrderStatus.waitAllocation.getKey(),Constants.WorkOrderStatus.waitDeal.getKey()) |
| | | .apply(" urge_time > now() ") |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(workorderList)){ |
| | |
| | | } |
| | | Member urgeUser = new Member(); |
| | | //如果已分配 wts 则是催促wts |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getManagerId()).last("limit 1 ")); |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | }else if(Constants.equalsInteger(workorder.getStatus(),Constants.WorkOrderStatus.waitAllocation.getKey())){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getDealerId()).last("limit 1 ")); |
| | | }else{ |
| | | return; |
| | |
| | | workOrderDataVO.setTotal(Constants.ZERO); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(dataList)){ |
| | | workOrderDataVO.setTotal(dataList.size()); |
| | | workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.close)).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.sheClose)).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.wtsClose)).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.close.getKey())).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.sheClose.getKey())).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.wtsClose.getKey())).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal()); |
| | | } |
| | | workOrderDataVOList.add(workOrderDataVO); |
| | |
| | | workOrderDataVO.setTotal(Constants.ZERO); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(dataList)){ |
| | | workOrderDataVO.setTotal(dataList.size()); |
| | | workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.close)).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.sheClose)).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.workOrderStatus.wtsClose)).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setGcsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.close.getKey())).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setSheTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.sheClose.getKey())).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setWtsTotal(dataList.stream().filter(j->Constants.equalsInteger(j.getStatus(),Constants.WorkOrderStatus.wtsClose.getKey())).collect(Collectors.toList()).size()); |
| | | workOrderDataVO.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal()); |
| | | } |
| | | workOrderDataVOList.add(workOrderDataVO); |