| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.core.utils.qiyeweixin.QywxUtil; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.dto.CloseDTO; |
| | | import com.doumee.dao.web.dto.DCANoProblemDTO; |
| | | import com.doumee.dao.web.dto.PassOnDTO; |
| | | import com.doumee.dao.web.vo.WorkOrderDataVO; |
| | | import com.doumee.service.business.WorkorderService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setMemberId(workorder.getMemberId()); |
| | | workorder.setIsdeleted(Constants.ZERO); |
| | | workorder.setStatus(Constants.ZERO); |
| | | workorder.setCode(this.getNextCode(workorder.getType())); |
| | | //å¤ç人åç±»ä¿¡æ¯ |
| | | this.dealNoticeData(workorder); |
| | | //å¤çSHEäºä»¶ç¶æ |
| | | workorder.setStatus(Constants.equalsInteger(workorder.getType(),Constants.ZERO)?Constants.workOrderStatus.close:Constants.workOrderStatus.waitConfirm); |
| | | workorderMapper.insert(workorder); |
| | | //åå¨DCA é®é¢è®°å½è¡¨ |
| | | this.saveProblemData(workorder); |
| | | //åå¨éä»¶ä¿¡æ¯ |
| | | this.saveMutiFile(workorder); |
| | | //å¤ç䏿¥æ¥å¿ |
| | | this.saveLog(null,workorder,Constants.ZERO,workorder.getMemberId()); |
| | | //TODO åééç¥ |
| | | //å卿¥å¿ |
| | | this.dealLogData(workorder); |
| | | //TODO åéä¼å¾®éç¥ |
| | | |
| | | return workorder.getId(); |
| | | } |
| | | |
| | | |
| | | public void dealLogData(Workorder workorder){ |
| | | //å¤ç䏿¥æ¥å¿ DCAå·¥å æ¥å¿åå¨è³åä¸å¡ ä¸åå¨äºç¶çº§ |
| | | if(!Constants.equalsInteger(workorder.getType(),Constants.ONE)){ |
| | | String logTitle = "工忿¥"; |
| | | if(!Constants.equalsInteger(workorder.getType(),Constants.ZERO)){ |
| | | logTitle = Constants.equalsInteger(workorder.getType(),Constants.ONE)?"è·ç»æ»é£é©ææ¥":"DCA䏿¥"; |
| | | } |
| | | this.saveLog(null,workorder,Constants.ZERO,workorder.getMemberId(),logTitle,null); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åå¨éä»¶ä¿¡æ¯ |
| | |
| | | for (Multifile multifile:multifileList) { |
| | | multifile.setObjId(workorder.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.ZERO)){//SHEäºä»¶ä¸æ¥å¾ç |
| | | multifile.setObjType(Constants.multiFileType.sheUpload); |
| | | }else if(Constants.equalsInteger(workorder.getType(),Constants.THREE)){//è·ç»æ»äºä»¶ä¸æ¥å¾ç |
| | | multifile.setObjType(Constants.multiFileType.dbhUpload); |
| | | }else if(Constants.equalsInteger(workorder.getType(),Constants.ONE)){//DCAäºä»¶ä¸æ¥ |
| | | multifile.setObjType(Constants.multiFileType.dcaUpload); |
| | | } |
| | | multifile.setObjType(Constants.multiFileType.upload); |
| | | } |
| | | multifileMapper.insert(multifileList); |
| | | } |
| | |
| | | dcaWorkOrder.setProblemId(problem.getId()); |
| | | dcaWorkOrder.setProblemInfo(problem.getRemark()); |
| | | dcaWorkOrder.setDcaRecordId(workorder.getId()); |
| | | dcaWorkOrder.setEventInfo(dcaNoProblemDTO.getEventInfo()); |
| | | workorderMapper.insert(dcaWorkOrder); |
| | | //å卿¥å¿ |
| | | this.dealLogData(dcaWorkOrder); |
| | | List<Multifile> multifileList = dcaNoProblemDTO.getMultifileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |
| | | multifile.setObjId(dcaWorkOrder.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjType(Constants.multiFileType.dcaWorkOrder); |
| | | multifile.setObjType(Constants.multiFileType.upload); |
| | | } |
| | | multifileMapper.insert(multifileList); |
| | | } |
| | |
| | | * |
| | | * @param beforeJson |
| | | * @param afterWorkorder |
| | | * @param objType æä½ç±»å 0ä»»å¡ä¸æ¥ 1ä»»å¡ç¡®è®¤ 2ä»»å¡åé
ç©ä¸ä¸»ç®¡ 3ä»»å¡å
³é 4ä»»å¡åé
å¤ç人 5ä»»å¡å¬ä¿ |
| | | * @param objType æä½ç±»å 0ä»»å¡ä¸æ¥ 1ä»»å¡åé
ç©ä¸ä¸»ç®¡ 2ä»»å¡åé
å¤ç人 3ä»»å¡å¤çå
³é 4ä»»å¡å¬ä¿ |
| | | * @param memberId |
| | | */ |
| | | public void saveLog(String beforeJson,Workorder afterWorkorder,Integer objType,Integer memberId){ |
| | | public Integer saveLog(String beforeJson,Workorder afterWorkorder,Integer objType,Integer memberId,String title,String content){ |
| | | WorkorderLog workorderLog = new WorkorderLog(); |
| | | workorderLog.setCreateDate(new Date()); |
| | | workorderLog.setEditDate(new Date()); |
| | |
| | | workorderLog.setParam1(memberId.toString()); |
| | | workorderLog.setObjId(afterWorkorder.getId().toString()); |
| | | workorderLog.setObjType(objType); |
| | | workorderLog.setTitle(title); |
| | | workorderLog.setContent(content); |
| | | workorderLogMapper.insert(workorderLog); |
| | | return workorderLog.getId(); |
| | | } |
| | | |
| | | |
| | |
| | | workorder.setMultifileList(multifileList); |
| | | } |
| | | } |
| | | //æ¥è¯¢æ¥å¿ä¿¡æ¯ |
| | | workorder.setLogList(this.getLogList(workorder.getId())); |
| | | return workorder; |
| | | } |
| | | |
| | | |
| | | public List<WorkorderLog> getLogList(Integer orderId){ |
| | | List<WorkorderLog> logList = workorderLogMapper.selectJoinList(WorkorderLog.class, |
| | | new MPJLambdaWrapper<WorkorderLog>() |
| | | .selectAll(WorkorderLog.class) |
| | | .selectAs(Member::getName,WorkorderLog::getUserName) |
| | | .selectAs(Member::getCompanyName,WorkorderLog::getCompanyName) |
| | | .leftJoin(Member.class,Member::getId,WorkorderLog::getParam1) |
| | | .eq(WorkorderLog::getObjId,orderId) |
| | | .orderByAsc(WorkorderLog::getId) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(logList)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.FTP,Constants.WORKORDER_FILE_PATH).getCode(); |
| | | for (WorkorderLog workorderLog:logList) { |
| | | //æ¥è¯¢éä»¶ä¿¡æ¯ |
| | | List<Multifile> multifileList = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getIsdeleted,Constants.ZERO) |
| | | .ne(Multifile::getObjType,Constants.multiFileType.upload) |
| | | .eq(Multifile::getObjId,workorderLog.getId()) |
| | | .orderByAsc(Multifile::getId)); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |
| | | multifile.setFileurlFull(path+multifile.getFileurl()); |
| | | } |
| | | workorderLog.setMultifileList(multifileList); |
| | | } |
| | | } |
| | | } |
| | | return logList; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void closeWorkOrder(CloseDTO closeDTO){ |
| | | if(Objects.isNull(closeDTO) |
| | | || Objects.isNull(closeDTO.getWorkorderId()) |
| | | || org.apache.commons.lang3.StringUtils.isBlank(closeDTO.getInfo()) |
| | | || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(closeDTO.getMultifileList())){ |
| | | || Objects.isNull(closeDTO.getWorkorderId()) |
| | | || org.apache.commons.lang3.StringUtils.isBlank(closeDTO.getInfo()) |
| | | || com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(closeDTO.getMultifileList())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Workorder workorder = workorderMapper.selectById(closeDTO.getWorkorderId()); |
| | | String beforeJson = JSONObject.toJSONString(workorder); |
| | | if(Objects.isNull(workorder)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å·¥åæ°æ®"); |
| | | } |
| | | if(!(Constants.equalsInteger(workorder.getStatus(),Constants.ZERO) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.ONE) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.TWO))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"å·¥åç¶æå·²æµè½¬æ æ³è¿è¡æä½"); |
| | | 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)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å·¥åç¶æå·²æµè½¬"); |
| | | } |
| | | //æäº¤åç å¾
确认/å¾
åå®¡ç¶æ 妿å»å
³é åªæå·¥åéç»å®çSHE人åå¯ä»¥å
³é |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitConfirm)){ |
| | | //夿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)){ |
| | | //夿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)){ |
| | | //夿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); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å·¥åç¶æå·²æµè½¬"); |
| | | } |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setDealTime(new Date()); |
| | | workorder.setDealInfo(closeDTO.getInfo()); |
| | | workorderMapper.updateById(workorder); |
| | | //å¤ç䏿¥æ¥å¿ |
| | | Integer logId = this.saveLog(beforeJson,workorder,Constants.THREE,workorder.getMemberId(),"ä»»å¡å·²å¤ç",closeDTO.getInfo()); |
| | | List<Multifile> multifileList = workorder.getMultifileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |
| | | multifile.setObjId(logId); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjType(Constants.multiFileType.deal); |
| | | } |
| | | multifileMapper.insert(multifileList); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void passOn(PassOnDTO passOnDTO){ |
| | | if(Objects.isNull(passOnDTO) |
| | | || Objects.isNull(passOnDTO.getWorkorderId()) |
| | | || Objects.isNull(passOnDTO.getPassOnUserId()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Member member = memberMapper.selectById(passOnDTO.getPassOnUserId()); |
| | | if(Objects.isNull(member)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°è¢«è½¬äº¤äººä¿¡æ¯"); |
| | | } |
| | | Workorder workorder = workorderMapper.selectById(passOnDTO.getWorkorderId()); |
| | | String beforeJson = JSONObject.toJSONString(workorder); |
| | | if(Objects.isNull(workorder)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å·¥åæ°æ®"); |
| | | } |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"SHEå·¥åæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(Constants.equalsInteger(passOnDTO.getPassOnType(),Constants.ZERO)){ |
| | | if(!Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitConfirm)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å·¥åç¶æå·²æµè½¬"); |
| | | } |
| | | workorder.setManagerId(member.getQwId()); |
| | | workorder.setStatus(Constants.workOrderStatus.waitAllocation); |
| | | }else{ |
| | | if(!(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation) |
| | | || Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitDeal))){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"å·¥åç¶æå·²æµè½¬"); |
| | | } |
| | | workorder.setDealerId(member.getQwId()); |
| | | workorder.setStatus(Constants.workOrderStatus.waitDeal); |
| | | } |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | | workorderMapper.updateById(workorder); |
| | | //å¤ç䏿¥æ¥å¿ |
| | | Integer logId = this.saveLog(beforeJson,workorder, |
| | | Constants.equalsInteger(passOnDTO.getPassOnType(),Constants.ZERO)?Constants.ONE:Constants.TWO |
| | | ,workorder.getMemberId(),"ä»»å¡åé
",passOnDTO.getInfo()); |
| | | List<Multifile> multifileList = workorder.getMultifileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){ |
| | | for (Multifile multifile:multifileList) { |
| | | multifile.setObjId(logId); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjType(Constants.multiFileType.passOn); |
| | | } |
| | | multifileMapper.insert(multifileList); |
| | | } |
| | | //TODO ä¼ä¸å¾®ä¿¡éç¥ |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void urge(Integer workorderId,Member member){ |
| | | Workorder workorder = workorderMapper.selectById(workorderId); |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | | workorderMapper.updateById(workorder); |
| | | if(Objects.isNull(workorder)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"æªæ¥è¯¢å°å·¥åæ°æ®"); |
| | | } |
| | | Member urgeUser = new Member(); |
| | | //妿已åé
wts 忝å¬ä¿wts |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | 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)){ |
| | | 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(),"ç¶æå·²æµè½¬æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | |
| | | this.saveLog(null,workorder, |
| | | Constants.ONE |
| | | ,member.getId(),"å¬ä¿","å·²å¬ä¿ "+urgeUser.getCompanyName() + "/" + urgeUser.getName()); |
| | | //TODO åéä¼å¾®éç¥ |
| | | |
| | | } |
| | | |
| | | @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) |
| | | .apply(" urge_time > now() ") |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(workorderList)){ |
| | | for (Workorder workorder:workorderList) { |
| | | this.autoUrge(workorder); |
| | | workorder.setEditDate(new Date()); |
| | | workorder.setUrgeDate(DateUtil.afterHoursDate(new Date(),24)); |
| | | workorderMapper.updateById(workorder); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void autoUrge(Workorder workorder){ |
| | | if(Objects.isNull(workorder)){ |
| | | return; |
| | | } |
| | | Member urgeUser = new Member(); |
| | | //妿已åé
wts 忝å¬ä¿wts |
| | | if(Constants.equalsInteger(workorder.getStatus(),Constants.workOrderStatus.waitAllocation)){ |
| | | 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)){ |
| | | urgeUser = memberMapper.selectOne(new QueryWrapper<Member>().lambda().eq(Member::getIsdeleted,Constants.ZERO).eq(Member::getQwId,workorder.getDealerId()).last("limit 1 ")); |
| | | }else{ |
| | | return; |
| | | } |
| | | //TODO åéä¼å¾®éç¥ |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * æ°æ®æ¥è¡¨ |
| | | * @param queryType 0=æç
§æä»½ï¼1=æç
§å£åº¦ï¼2=æç
§å¹´ä»½ï¼æä¸å¤çï¼ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<WorkOrderDataVO> getWorkOrderData(Integer queryType) throws Exception { |
| | | String year = DateUtil.getNowYear(); |
| | | Integer nowMonth = DateUtil.getNowMonth(); |
| | | Integer quarter = (nowMonth - 1) / 3 + 1; |
| | | List<WorkOrderDataVO> workOrderDataVOList = new ArrayList<>(); |
| | | //æ¥è¯¢ä»å¹´ææçæ°æ® |
| | | List<Workorder> workorderList = workorderMapper.selectList(new QueryWrapper<Workorder>().lambda().like(Workorder::getCreateDate,year) |
| | | .eq(Workorder::getIsdeleted,Constants.ZERO)); |
| | | if(Constants.equalsInteger(queryType,Constants.ZERO)){ |
| | | for (int i = 1 ; i <= nowMonth; i++) { |
| | | WorkOrderDataVO workOrderDataVO = new WorkOrderDataVO(); |
| | | String monthDay = year + "-" + org.apache.commons.lang3.StringUtils.leftPad(nowMonth.toString(),2,"0"); |
| | | List<Workorder> dataList = workorderList.stream().filter(j->DateUtil.formatDate(j.getCreateDate(),"yyyy-MM").equals(monthDay)) |
| | | .collect(Collectors.toList()); |
| | | workOrderDataVO.setDateStr(monthDay); |
| | | workOrderDataVO.setGcsTotal(Constants.ZERO); |
| | | workOrderDataVO.setWtsTotal(Constants.ZERO); |
| | | workOrderDataVO.setSheTotal(Constants.ZERO); |
| | | workOrderDataVO.setUnCloseTotal(Constants.ZERO); |
| | | 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.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal()); |
| | | } |
| | | workOrderDataVOList.add(workOrderDataVO); |
| | | } |
| | | }else if(Constants.equalsInteger(queryType,Constants.ONE)){ |
| | | //æç
§å£åº¦æ¥è¯¢ |
| | | for (int i = 1 ; i <= quarter; i++) { |
| | | List<Workorder> dataList = new ArrayList<>(); |
| | | if(Constants.equalsInteger(i,Constants.ONE)){ |
| | | dataList = workorderList.stream().filter(j->Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM"))<=3 ) |
| | | .collect(Collectors.toList()); |
| | | }else if(Constants.equalsInteger(i,Constants.TWO)){ |
| | | dataList = workorderList.stream().filter(j->Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM"))<=6 && Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM"))>=4 ) |
| | | .collect(Collectors.toList()); |
| | | }else if(Constants.equalsInteger(i,Constants.THREE)){ |
| | | dataList = workorderList.stream().filter(j->Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM"))<=9 && Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM"))>=7 ) |
| | | .collect(Collectors.toList()); |
| | | }else { |
| | | dataList = workorderList.stream().filter(j-> Integer.valueOf(DateUtil.formatDate(j.getCreateDate(),"MM"))>=10 ) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | WorkOrderDataVO workOrderDataVO = new WorkOrderDataVO(); |
| | | workOrderDataVO.setDateStr(i+"å£åº¦"); |
| | | workOrderDataVO.setGcsTotal(Constants.ZERO); |
| | | workOrderDataVO.setWtsTotal(Constants.ZERO); |
| | | workOrderDataVO.setSheTotal(Constants.ZERO); |
| | | workOrderDataVO.setUnCloseTotal(Constants.ZERO); |
| | | 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.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal()); |
| | | } |
| | | workOrderDataVOList.add(workOrderDataVO); |
| | | |
| | | } |
| | | } |
| | | return workOrderDataVOList; |
| | | } |
| | | |
| | | |