| | |
| | | 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; |
| | |
| | | * @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; |
| | | } |
| | | |
| | | |
| | | |