| | |
| | | import com.doumee.core.utils.qiyeweixin.model.request.QywxTextCardMsgRequest; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.WorkorderIndexNumVO; |
| | | import com.doumee.dao.web.dto.*; |
| | | import com.doumee.dao.web.vo.WorkOrderDataVO; |
| | | import com.doumee.service.business.WorkorderService; |
| | |
| | | message = Constants.equalsInteger(workorder.getMemberType(),Constants.ONE)?"同事":"供应商"; |
| | | } |
| | | message = message + "-" + workorder.getMemberNames() + " " + DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm") + workorder.getLocationName() + categoryName; |
| | | textCard.setDescription(" <div class=\"normal\">"+message+"</div>"); |
| | | textCard.setDescription("<div class=\"normal\">"+message+"</div>"); |
| | | |
| | | }else{ |
| | | textCard.setTitle(Constants.equalsInteger(workorder.getType(),Constants.ONE)?"【DCA上报】":"【跌绊滑风险上报】"); |
| | | if(Constants.equalsInteger(workorder.getType(),Constants.THREE)){ |
| | | message = message + " <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"系统") + (Constants.equalsInteger(contentType,Constants.ZERO)?"任务分配给你":(Constants.equalsInteger(contentType,Constants.ONE)?"对该工单进行了催促,请尽快处理":"任务已处理")) +"</div>"; |
| | | message = message + " <div class=\"normal\">"+ DateUtil.formatDate(new Date(),"yyyy-MM-dd HH:mm") +"/"+ workorder.getLocationName() +"/"+ categoryName+"</div>"; |
| | | }else{ |
| | | message = message + " <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"系统") + (Constants.equalsInteger(contentType,Constants.ZERO)?"任务分配给你":(Constants.equalsInteger(contentType,Constants.ONE)?"对该工单进行了催促,请尽快处理":((Constants.equalsInteger(contentType,Constants.TWO)?"抄送给你":"已处理一项")))) +"</div>"; |
| | | message = message + " <div class=\"normal\">观察主题"+ categoryName +"</div>"; |
| | | message = message + " <div class=\"normal\">符合:"+ workorder.getDcaYesNum() +" 不符合:"+workorder.getDcaNoNum()+"</div>"; |
| | | message = message + " <div class=\"normal\">"+ (org.apache.commons.lang3.StringUtils.isNotBlank(userName)?userName:"系统") + (Constants.equalsInteger(contentType,Constants.ZERO)?"任务分配给你":(Constants.equalsInteger(contentType,Constants.ONE)?"对该工单进行了催促,请尽快处理":((Constants.equalsInteger(contentType,Constants.TWO)?"抄送给你":"已处理一项")))) +"</div>"; |
| | | message = message + " <div class=\"normal\">观察主题"+ categoryName +"</div>"; |
| | | message = message + " <div class=\"normal\">符合:"+ workorder.getDcaYesNum() +" 不符合:"+workorder.getDcaNoNum()+"</div>"; |
| | | if(Constants.equalsInteger(contentType,Constants.TWO)){ |
| | | message = message + " <div class=\"normal\">说明:"+ csInfo +"</div>"; |
| | | message = message + " <div class=\"normal\">说明:"+ csInfo +"</div>"; |
| | | } |
| | | } |
| | | textCard.setDescription(message); |
| | |
| | | multifile.setObjId(workorder.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjType(Constants.multiFileType.upload); |
| | | multifileMapper.insert(multifile); |
| | | } |
| | | multifileMapper.insert(multifileList); |
| | | } |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public List<WorkOrderDataVO> getWorkOrderData(OrderDataDTO orderDataDTO) throws Exception { |
| | | public List<WorkOrderDataVO> getWorkOrderData(OrderDataDTO orderDataDTO) { |
| | | if (Objects.isNull(orderDataDTO.getQueryType())||Objects.isNull(orderDataDTO.getOrderType())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | String year = DateUtil.getNowYear(); |
| | | Integer nowMonth = DateUtil.getNowMonth(); |
| | | Integer quarter = (nowMonth - 1) / 3 + 1; |
| | | // Integer nowMonth = DateUtil.getNowMonth(); |
| | | Integer nowMonth = 12; |
| | | // Integer quarter = (nowMonth - 1) / 3 + 1; |
| | | Integer quarter =4; |
| | | List<WorkOrderDataVO> workOrderDataVOList = new ArrayList<>(); |
| | | //查询今年所有的数据 |
| | | List<Workorder> workorderList = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>() |
| | |
| | | if(Constants.equalsInteger(orderDataDTO.getQueryType(),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"); |
| | | String monthDay = year + "-" + org.apache.commons.lang3.StringUtils.leftPad(i+"",2,"0"); |
| | | List<Workorder> dataList = workorderList.stream().filter(j->DateUtil.formatDate(j.getCreateDate(),"yyyy-MM").equals(monthDay)) |
| | | .collect(Collectors.toList()); |
| | | workOrderDataVO.setDateStr(monthDay); |
| | | workOrderDataVO.setDateStr(i+"月"); |
| | | workOrderDataVO.setGcsTotal(Constants.ZERO); |
| | | workOrderDataVO.setWtsTotal(Constants.ZERO); |
| | | workOrderDataVO.setSheTotal(Constants.ZERO); |
| | |
| | | workOrderDataVO.setUnCloseTotal(workOrderDataVO.getTotal() - workOrderDataVO.getSheTotal() - workOrderDataVO.getWtsTotal() - workOrderDataVO.getGcsTotal()); |
| | | } |
| | | workOrderDataVOList.add(workOrderDataVO); |
| | | |
| | | } |
| | | } |
| | | return workOrderDataVOList; |
| | | } |
| | | /** |
| | | * SHE / 跌绊滑报表 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public WorkorderIndexNumVO getIndexData(Workorder workorder) { |
| | | WorkorderIndexNumVO model = new WorkorderIndexNumVO(); |
| | | List<WorkOrderDataVO> workOrderDataVOList = new ArrayList<>(); |
| | | //查询今年所有的数据 |
| | | List<Workorder> list = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>() |
| | | .select("type,count(id) as num") |
| | | .eq(Workorder::getIsdeleted,Constants.ZERO) |
| | | .groupBy(Workorder::getType )); |
| | | if(list !=null){ |
| | | for(Workorder w : list){ |
| | | if(Constants.equalsInteger(w.getType(),Constants.ZERO)){ |
| | | //SHE |
| | | model.setSheNum(Constants.formatLongNum(w.getNum())); |
| | | }else if(Constants.equalsInteger(w.getType(),Constants.ONE)){ |
| | | //DCA提交数 |
| | | model.setDcaNum(Constants.formatLongNum(w.getNum())); |
| | | }else if(Constants.equalsInteger(w.getType(),Constants.TWO)){ |
| | | //DCA子工单 |
| | | model.setDcaChildNum(Constants.formatLongNum(w.getNum())); |
| | | }else if(Constants.equalsInteger(w.getType(),Constants.THREE)){ |
| | | //跌绊滑 |
| | | model.setDbhNum(Constants.formatLongNum(w.getNum())); |
| | | } |
| | | } |
| | | } |
| | | List<Workorder> todays = workorderMapper.selectJoinList(Workorder.class,new MPJLambdaWrapper<Workorder>() |
| | | .select("type,count(id) as num") |
| | | .eq(Workorder::getIsdeleted,Constants.ZERO) |
| | | .apply("to_days(create_date)=to_days(now())") |
| | | .groupBy(Workorder::getType )); |
| | | if(todays !=null){ |
| | | for(Workorder w : todays){ |
| | | if(Constants.equalsInteger(w.getType(),Constants.ZERO)){ |
| | | //SHE |
| | | model.setTodaySheNum(Constants.formatLongNum(w.getNum())); |
| | | }else if(Constants.equalsInteger(w.getType(),Constants.ONE)){ |
| | | //DCA提交数 |
| | | model.setTodayDcaNum(Constants.formatLongNum(w.getNum())); |
| | | }else if(Constants.equalsInteger(w.getType(),Constants.TWO)){ |
| | | //DCA子工单 |
| | | model.setTodayDcaChildNum(Constants.formatLongNum(w.getNum())); |
| | | }else if(Constants.equalsInteger(w.getType(),Constants.THREE)){ |
| | | //跌绊滑 |
| | | model.setTodayDbhNum(Constants.formatLongNum(w.getNum())); |
| | | } |
| | | } |
| | | } |
| | | return model; |
| | | } |
| | | |
| | | |
| | | |