| | |
| | | package com.doumee.service.business.impl.thrid; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | |
| | | import com.doumee.core.haikang.model.param.respose.*; |
| | | import com.doumee.core.haikang.service.HKCarOpenService; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.tms.model.TMSContants; |
| | | import com.doumee.core.tms.model.request.TmsFacrotyCodeListRequest; |
| | | import com.doumee.core.tms.model.request.TmsOrderNoFinishListRequest; |
| | | import com.doumee.core.tms.model.request.TmsOutQtyAndVehicleQtyRequest; |
| | | import com.doumee.core.tms.model.response.TmsDistributionOfDeliveryLocResponse; |
| | | import com.doumee.core.tms.model.response.TmsInventoryListResponse; |
| | | import com.doumee.core.tms.model.response.TmsOutQtyAndVehicleQtyResponse; |
| | | import com.doumee.core.tms.model.response.TmsTotalAndReportVehicleQtyResponse; |
| | | import com.doumee.core.tms.model.request.TmsSevenArrivalDetailsRequest; |
| | | import com.doumee.core.tms.model.response.*; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | private PlatformGroupMapper platformGroupMapper; |
| | | @Autowired |
| | | private TmsService tmsService; |
| | | |
| | | @Value("${debug_model}") |
| | | private Boolean isDebug; |
| | | /** |
| | | * 获取区域树形结构数据 |
| | | * @return |
| | |
| | | .apply("to_days(done_date) = to_days(now())") ); |
| | | if(jobs!=null){ |
| | | for(PlatformJob j :jobs){ |
| | | if(Objects.nonNull(j)&&Objects.nonNull(j.getTotalNum())){ |
| | | num =num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | |
| | | } |
| | | } |
| | | }else{ |
| | |
| | | , Constants.PlatformJobStatus.LEAVED.getKey()) ); |
| | | if(jobs!=null){ |
| | | for(PlatformJob j :jobs){ |
| | | if(Objects.nonNull(j)&&Objects.nonNull(j.getTotalNum())){ |
| | | num = num.add(Constants.formatBigdecimal(j.getTotalNum())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | BaseResponse<CamerasPreviewURLsResponse> result = HKService.cameraPreviewURLs(request); |
| | | if(result!=null && StringUtils.equals(result.getCode(),HKConstants.RESPONSE_SUCCEE) && result.getData()!=null){ |
| | | return result.getData().getUrl(); |
| | | |
| | | } |
| | | return null; |
| | | } |
| | |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | | .selectAs(PlatformJob::getCreateDate,PlatformJob::getCreateDate) |
| | | .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum) |
| | | .selectAs(PlatformJob::getStatus,PlatformJob::getStatus) |
| | | // .select("select sum(io_qty) from platform_wms_details a where a.isdeleted=0 and a.job_id=t.id",create_date) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .apply(queryType==0,"to_days(create_date) >= to_days(now()) -7") |
| | |
| | | .isNotNull(PlatformLog::getParam3) |
| | | .ne(PlatformLog::getParam3,Constants.ZERO+"")); |
| | | if(platformLogList!=null && platformLogList.size()>0){ |
| | | return new BigDecimal((double)(platformLogList.stream().map(m->Long.valueOf(m.getParam3())).reduce(Long.valueOf(0),Long::sum))/(double)60); |
| | | return new BigDecimal((double)(platformLogList.stream().map(m->Long.valueOf(m.getParam3())).reduce(Long.valueOf(0),Long::sum))/(double)3600); |
| | | } |
| | | } |
| | | return r; |
| | |
| | | } |
| | | if( data.getGasQuantity().getTotalNum().compareTo(new BigDecimal(0)) !=0){ |
| | | //计算用气同比环比 |
| | | data.getGasQuantity().setSameRate(Constants.formatBigdecimal4Float(data.getGasQuantity().getSameNum().divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""); |
| | | data.getGasQuantity().setRingRate(Constants.formatBigdecimal4Float(data.getGasQuantity().getRingNum().divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""); |
| | | data.getGasQuantity().setSameRate( |
| | | (data.getGasQuantity().getTotalNum().subtract(data.getGasQuantity().getSameNum())).divide(data.getGasQuantity().getSameNum()).doubleValue()*100 +"" |
| | | /*Constants.formatBigdecimal4Float(data.getGasQuantity().getSameNum() |
| | | .divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +""*/); |
| | | data.getGasQuantity().setRingRate( |
| | | (data.getGasQuantity().getTotalNum().subtract(data.getGasQuantity().getRingNum())).divide(data.getGasQuantity().getRingNum()).doubleValue()*100 +"" |
| | | //Constants.formatBigdecimal4Float(data.getGasQuantity().getRingNum().divide(data.getGasQuantity().getTotalNum(),4,BigDecimal.ROUND_HALF_UP)).doubleValue()*100 +"" |
| | | ); |
| | | } |
| | | if( data.getWaterQuantity().getTotalNum().compareTo(new BigDecimal(0)) !=0){ |
| | | // //计算用水同比环比 |
| | |
| | | * @param data |
| | | */ |
| | | private void getLastMonthElectricityData(EnergyModelDataVO data) { |
| | | BaseResponse<LastMonthFeeByMeterTypeResponse> response = HKService.lastMonthFeeByMeterType("1"); |
| | | // BaseResponse<LastMonthFeeByMeterTypeResponse> response = HKService.lastMonthFeeByMeterType("1"); |
| | | // if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | // data.setRingRate(StringUtils.defaultString(response.getData().getRingPercent(),"0")); |
| | | // data.setSameRate(StringUtils.defaultString(response.getData().getSamePercent(),"0")); |
| | |
| | | * @param data |
| | | */ |
| | | private void getCurrentDateElectircityData(EnergyModelDataVO data,int days) { |
| | | EnergyTrendRequest param = new EnergyTrendRequest(); |
| | | param.setDate(DateUtil.getFomartDate(DateUtil.addDaysToDate(new Date(),days),"yyyy-MM-dd"));//日期 |
| | | param.setMeterType(1); |
| | | param.setShowType("4"); |
| | | param.setNodeType(2); |
| | | param.setNodeId("root000000"); |
| | | // EnergyTrendRequest param = new EnergyTrendRequest(); |
| | | // param.setDate(DateUtil.getFomartDate(DateUtil.addDaysToDate(new Date(),days),"yyyy-MM-dd"));//日期 |
| | | // param.setMeterType(1); |
| | | // param.setShowType("4"); |
| | | // param.setNodeType(2); |
| | | // param.setNodeId("root000000"); |
| | | // param.setPeriodType("day"); |
| | | // BigDecimal total = new BigDecimal(0); |
| | | // BaseResponse<EnergyTrendResponse> response = HKService.energyTrend(param); |
| | | // if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | // && response.getData()!=null&& response.getData().getYvalues()!=null ){ |
| | | // for (int i = 0; i < response.getData().getYvalues().get(0).getValue().length; i++) { |
| | | // total = total.add(new BigDecimal(StringUtils.defaultString( response.getData().getYvalues().get(0).getValue()[i],"0"))); |
| | | // } |
| | | // |
| | | // } |
| | | // data.setTotal(Constants.formatBigdecimal2Float(total).toString()); |
| | | EnergyTotalDataRequest param = new EnergyTotalDataRequest(); |
| | | param.setPeriodType("day"); |
| | | BigDecimal total = new BigDecimal(0); |
| | | BaseResponse<EnergyTrendResponse> response = HKService.energyTrend(param); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response.getData()!=null&& response.getData().getYvalues()!=null ){ |
| | | for (int i = 0; i < response.getData().getYvalues().get(0).getValue().length; i++) { |
| | | total = total.add(new BigDecimal(StringUtils.defaultString( response.getData().getYvalues().get(0).getValue()[i],"0"))); |
| | | param.setDate(DateUtil.getFomartDate(DateUtil.addDaysToDate(new Date(),days),"yyyy-MM-dd")); |
| | | BaseResponse<EnergyTotalDataResponse> beforMonthResponse = HKService.energyTotal(param); |
| | | if(beforMonthResponse != null && StringUtils.equals(beforMonthResponse.getCode(), HKConstants.RESPONSE_SUCCEE) && beforMonthResponse.getData()!=null ){ |
| | | data.setTotal(beforMonthResponse.getData().getElectricity()); |
| | | data.setTotalNum(new BigDecimal(beforMonthResponse.getData().getElectricity())); |
| | | } |
| | | |
| | | } |
| | | data.setTotal(Constants.formatBigdecimal2Float(total).toString()); |
| | | } |
| | | |
| | | private EnergyModelDataVO getDefaultData() { |
| | |
| | | for (int i = 0; i < 12; i++) { |
| | | Date tempDate = DateUtil.increaseMonth(lastMonth,i); |
| | | EnergyDataVO data = new EnergyDataVO(); |
| | | data.setTimeData(DateUtil.getFomartDate(tempDate,(i+1)+"月")); |
| | | data.setTimeData(DateUtil.getFomartDate(tempDate,"YYYY-MM")); |
| | | // data.setTimeData(DateUtil.getFomartDate(tempDate,(i+1)+"月")); |
| | | data.setEnergy(new BigDecimal(0)); |
| | | energyDataVOList.add(data); |
| | | } |
| | |
| | | (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Objects.isNull(i.getCompanyType())).count() |
| | | ); |
| | | //在园车辆 |
| | | data.setInternalCarTotal( |
| | | data.setInParkCarTotal( |
| | | (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() |
| | | ); |
| | | //在园相关方车辆 |
| | |
| | | curtotalNum += Constants.formatIntegerNum(workEfficiencyVO.getWorkNum()) ; |
| | | } |
| | | workEfficiencyVO.setTotalWorkNum(curtotalNum);//累计值 |
| | | if(System.currentTimeMillis() < curTime){ |
| | | workEfficiencyVO.setTotalWorkNum(0); |
| | | } |
| | | workEfficiencyVOList.add(workEfficiencyVO); |
| | | } |
| | | return workEfficiencyVOList; |
| | |
| | | data.setReservationCar(data.getReservationCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | data.setCalledNum(data.getCalledNum()+Constants.formatIntegerNum(model.getCountum())); |
| | | data.setWorkedNum(data.getWorkedNum()+Constants.formatIntegerNum(model.getCountum())); |
| | | data.setWorkingCar(data.getWorkingCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | } |
| | | // 作业完成(预约车、签到数、已叫号、作业车、已完成) |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.PlatformJobStatus.DONE.getKey())){ |
| | |
| | | } |
| | | // 已离园 |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.PlatformJobStatus.LEAVED.getKey())){ |
| | | data.setWorkingCar(data.getWorkingCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | // data.setWorkingCar(data.getWorkingCar()+Constants.formatIntegerNum(model.getCountum())); |
| | | } |
| | | // 已过号(预约车、签到数、排队车) |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.PlatformJobStatus.OVER_NUMBER.getKey())){ |
| | |
| | | } |
| | | BaseResponse<List<RegionDataRankingDataResponse>> response = HKService.regionDataRanking(request); |
| | | if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE) && response.getData()!=null ){ |
| | | return response.getData(); |
| | | List<RegionDataRankingDataResponse> regionDataRankingDataResponseList = new ArrayList<>(); |
| | | for (RegionDataRankingDataResponse regionDataRankingDataResponse:response.getData()) { |
| | | if(StringUtils.isNotBlank(regionDataRankingDataResponse.getPercent())){ |
| | | if(Constants.equalsInteger(Integer.valueOf(new BigDecimal(regionDataRankingDataResponse.getPercent()).intValue()),Constants.ONE)){ |
| | | continue; |
| | | } |
| | | regionDataRankingDataResponseList.add(regionDataRankingDataResponse); |
| | | } |
| | | } |
| | | return regionDataRankingDataResponseList; |
| | | }else{ |
| | | return null; |
| | | } |
| | | } |
| | | /** |
| | | * 出库能力李永利 |
| | | * 出库能力 |
| | | * @return |
| | | */ |
| | | @Override |
| | |
| | | if(paramList!=null){ |
| | | String startDate = DateUtil.formatDate(new Date(),"yyyy-MM-dd"); |
| | | String endDate = DateUtil.formatDate(new Date(),"yyyy-MM-dd"); |
| | | if(isDebug){ |
| | | startDate = "2024-12-01"; |
| | | endDate = "2024-12-05"; |
| | | } |
| | | for(TmsFactoryParam p : paramList){ |
| | | WholeProvinceZxtDetailVO t = new WholeProvinceZxtDetailVO(); |
| | | t.setFactoryName(p.getName()); |
| | | t.setCurrentNum(new BigDecimal(0)); |
| | | t.setUseRate(new BigDecimal(0)); |
| | | t.setTotalNum(Constants.formatBigdecimal(p.getNum2()));//总出库能力 |
| | | if(StringUtils.isBlank(p.getCode())){ |
| | | t.setTotalNum(Constants.formatBigdecimal(p.getParam3()));//8小时出库能力 |
| | | if(StringUtils.isNotBlank(p.getCode())){ |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.setDateStart(startDate); |
| | | param.setDateEnd(endDate); |
| | |
| | | return result; |
| | | } |
| | | /** |
| | | * 全身出库能力 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public WholeProvinceBoardVO centerProvinceData(String factoryCode){ |
| | | WholeProvinceBoardVO data = new WholeProvinceBoardVO(); |
| | | data.setMaxAbility(new BigDecimal(0)); |
| | | data.setHoursAbility(new BigDecimal(0)); |
| | | List<TmsFactoryParam> paramList = factoryList(); |
| | | String code = null; |
| | | if(paramList!=null){ |
| | | //处理最大出库能力和8小时出库能力 |
| | | for(TmsFactoryParam param : paramList){ |
| | | if(StringUtils.isNotBlank(factoryCode)){ |
| | | if(StringUtils.equals(param.getCode(),factoryCode)){ |
| | | data.setHoursAbility(data.getHoursAbility().add(Constants.formatBigdecimal(param.getParam3()))); |
| | | data.setMaxAbility(data.getMaxAbility().add(Constants.formatBigdecimal(param.getNum2()))); |
| | | code = param.getCode(); |
| | | break; |
| | | } |
| | | }else{ |
| | | data.setHoursAbility(data.getHoursAbility().add(Constants.formatBigdecimal(param.getParam3()))); |
| | | data.setMaxAbility(data.getMaxAbility().add(Constants.formatBigdecimal(param.getNum2()))); |
| | | } |
| | | } |
| | | } |
| | | if(isDebug){ |
| | | data.setCurrentPlanNum(new BigDecimal(1220)); |
| | | data.setCurrentOrderNum(new BigDecimal(32340)); |
| | | data.setCrrentOutNum(new BigDecimal(3450)); |
| | | data.setCrrentRestNum(new BigDecimal(456450)); |
| | | } |
| | | Date date = new Date(); |
| | | TmsOutQtyAndVehicleQtyRequest param = new TmsOutQtyAndVehicleQtyRequest(); |
| | | param.setDateEnd(DateUtil.getShortTime(date)); |
| | | param.setDateStart(DateUtil.getShortTime(date)); |
| | | if(StringUtils.isNotBlank(code)){ |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.getFacrotyCodeList().add(code);//查询指定厂区 |
| | | } |
| | | List<TmsOutQtyAndVehicleQtyResponse> listSame= tmsService.getOutQtyAndVehicleQty(param);//去年同期 |
| | | if(listSame!=null ){ |
| | | for(TmsOutQtyAndVehicleQtyResponse model : listSame){ |
| | | data.setCrrentOutNum(data.getCrrentOutNum().add(Constants.formatBigdecimal(model.getTotalOutQty())));//今日出库量 |
| | | data.setCrrentOutCarNum(data.getCrrentOutCarNum()+(Constants.formatIntegerNum(model.getVehicleQty())));//今日出库车次 |
| | | } |
| | | } |
| | | return data; |
| | | |
| | | } |
| | | /** |
| | | * 出库能力李永利 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public TotalOutQtyNumVO totalOutQtyNum(int queryType){ |
| | | public TotalOutQtyNumVO totalOutQtyNum(int type,String code){ |
| | | TotalOutQtyNumVO data = new TotalOutQtyNumVO(); |
| | | data.setCurrentInNum(new BigDecimal(0)); |
| | | data.setLastInNum(new BigDecimal(0)); |
| | |
| | | data.setLastOutNum(new BigDecimal(0)); |
| | | data.setSameOutNum(new BigDecimal(0)); |
| | | |
| | | Date sameStart = DateUtil.getBeginDayOfMonth(-1); |
| | | Date sameEnd = DateUtil.getEndDayOfMonth(-1); |
| | | Date curStart = DateUtil.getBeginDayOfMonth(0); |
| | | Date curEnd = DateUtil.getEndDayOfMonth(0); |
| | | Date lastStart = DateUtil.getBeginDayOfLastMonth(); |
| | | Date lastEnd = DateUtil.getEndDayOfLastMonth(); |
| | | if(type ==1){ |
| | | //本周 |
| | | sameStart= DateUtil.getBeginDayOfWeek(-1); |
| | | sameEnd= DateUtil.getEndDayOfWeek(-1); |
| | | curStart= DateUtil.getBeginDayOfWeek(0); |
| | | curEnd= DateUtil.getEndDayOfWeek(0); |
| | | lastStart = DateUtil.getBeginDayOfLastWeek(); |
| | | lastEnd= DateUtil.getEndDayOfLastWeek(); |
| | | }else if(type == 2){ |
| | | curStart= DateUtil.getBeginDayOfYear(0); |
| | | curEnd= DateUtil.getEndDayOfYear(0); |
| | | lastStart= DateUtil.getBeginDayOfYear(-1); |
| | | lastEnd= DateUtil.getEndDayOfYear(-1); |
| | | sameStart = null; |
| | | sameEnd =null; |
| | | } |
| | | TmsOutQtyAndVehicleQtyRequest param = new TmsOutQtyAndVehicleQtyRequest(); |
| | | if(StringUtils.isNotBlank(code)){ |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.getFacrotyCodeList().add(code); |
| | | } |
| | | if(type !=2){ |
| | | //本年的不需要查去年同周期 |
| | | param.setDateEnd(DateUtil.getShortTime(sameEnd)); |
| | | param.setDateStart(DateUtil.getShortTime(sameStart)); |
| | | List<TmsOutQtyAndVehicleQtyResponse> listSame= tmsService.getOutQtyAndVehicleQty(param);//去年同期 |
| | | if(listSame!=null ){ |
| | | for(TmsOutQtyAndVehicleQtyResponse model : listSame){ |
| | | data.setSameOutNum(data.getSameOutNum().add(Constants.formatBigdecimal(model.getOutSideProvinceOutQty()))); |
| | | data.setSameInNum(data.getSameInNum().add(Constants.formatBigdecimal(model.getInSideProvinceOutQty()))); |
| | | } |
| | | } |
| | | } |
| | | param.setDateEnd(DateUtil.getShortTime(curEnd)); |
| | | param.setDateStart(DateUtil.getShortTime(curStart)); |
| | | List<TmsOutQtyAndVehicleQtyResponse> listCur = tmsService.getOutQtyAndVehicleQty(param);//本周期 |
| | | if(listCur!=null ){ |
| | | for(TmsOutQtyAndVehicleQtyResponse model : listCur){ |
| | | data.setCurrentOutNum(data.getCurrentOutNum().add(Constants.formatBigdecimal(model.getOutSideProvinceOutQty()))); |
| | | data.setCurrentInNum(data.getCurrentInNum().add(Constants.formatBigdecimal(model.getInSideProvinceOutQty()))); |
| | | data.setTotalCarNum(data.getTotalCarNum()+Constants.formatIntegerNum(model.getVehicleQty()));//累计车次 |
| | | } |
| | | } |
| | | param.setDateEnd(DateUtil.getShortTime(lastEnd)); |
| | | param.setDateStart(DateUtil.getShortTime(lastStart)); |
| | | List<TmsOutQtyAndVehicleQtyResponse> listLast = tmsService.getOutQtyAndVehicleQty(param);//上周期 |
| | | if(listCur!=null ){ |
| | | for(TmsOutQtyAndVehicleQtyResponse model : listLast){ |
| | | data.setLastOutNum(data.getLastOutNum().add(Constants.formatBigdecimal(model.getOutSideProvinceOutQty()))); |
| | | data.setLastInNum(data.getLastInNum().add(Constants.formatBigdecimal(model.getInSideProvinceOutQty()))); |
| | | } |
| | | } |
| | | if(type == 2){//本年的 |
| | | data.setSameOutNum(data.getLastOutNum()); |
| | | data.setSameInNum(data.getLastInNum()); |
| | | } |
| | | return data; |
| | | } |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<WholeProvinceMapVO> mapYearAndMonthOutList(){ |
| | | public List<WholeProvinceMapVO> mapYearAndMonthOutList(String code){ |
| | | List<WholeProvinceMapVO> result = new ArrayList<>(); |
| | | List<TmsFactoryParam> paramList =factoryList(); |
| | | if(paramList!=null && paramList.size()>0){ |
| | | List<String> codes = new ArrayList<>(); |
| | | for(TmsFactoryParam p : paramList){ |
| | | if(StringUtils.isBlank(p.getCode())){ |
| | | continue; |
| | | } |
| | | codes.add(p.getCode()); |
| | | } |
| | | if(codes.size()>0){ |
| | | TmsFacrotyCodeListRequest param = new TmsFacrotyCodeListRequest(); |
| | | param.setFacrotyCodeList(codes); |
| | | if(StringUtils.isNotBlank(code)){ |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.getFacrotyCodeList().add(code); |
| | | } |
| | | List<TmsDistributionOfDeliveryLocResponse> response = tmsService.getDistributionOfDeliveryLocations(param);//查询出库量 |
| | | if(response!=null &&response.size()>0){ |
| | | for(TmsDistributionOfDeliveryLocResponse model : response){ |
| | |
| | | result.add(tt); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | return result; |
| | | } |
| | |
| | | return paramList; |
| | | } |
| | | /** |
| | | * 获取未完成订单集合 |
| | | * @return TmsBaseResponse |
| | | */ |
| | | @Override |
| | | public TmsBasePageResponse<TmsOrderNoFinishListResponse> orderNoFinishList(TmsOrderNoFinishListRequest param){ |
| | | TmsBasePageResponse<TmsOrderNoFinishListResponse> infoList = tmsService.getNotFinishOrderList(param);//查询出库量 |
| | | if(infoList!=null && infoList.getRows()!=null){ |
| | | for(TmsOrderNoFinishListResponse model :infoList.getRows()){ |
| | | model.setStatusDesc(TMSContants.TopStatusLevel.getNameByKey(TMSContants.ChildStatusLevel.getParentIndexByStatus(model.getStatus()))); |
| | | |
| | | } |
| | | } |
| | | return infoList; |
| | | } |
| | | /** |
| | | * 近七日到货情况 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<LastSevenDaysOrderVo> arriveGoodsList(String code){ |
| | | List<LastSevenDaysOrderVo> list = new ArrayList<>(); |
| | | TmsSevenArrivalDetailsRequest param = new TmsSevenArrivalDetailsRequest(); |
| | | if(StringUtils.isNotBlank(code)){ |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.getFacrotyCodeList().add(code);//查询指定厂区 |
| | | } |
| | | Date date = new Date(); |
| | | Date startDate = DateUtil.addDaysToDate(date,-7); |
| | | param.setNcCreateDateFrom(DateUtil.getShortTime(startDate)); |
| | | param.setNcCreateDateThrough(DateUtil.getShortTime(date)); |
| | | List<TmsSevenArrivalStatusAndDetailsResponse> infoList = tmsService.getSevenArrivalStatusAndDetails(param);//查询出库量 |
| | | for (int i = 0; i < 7; i++) { |
| | | LastSevenDaysOrderVo model = new LastSevenDaysOrderVo(); |
| | | Date td = DateUtil.addDaysToDate(date,-i); |
| | | model.setDateStr(DateUtil.getShortTime(td)); |
| | | dealGoodsListFromResponse(model,infoList); |
| | | list.add(model); |
| | | } |
| | | return list; |
| | | } |
| | | private void dealGoodsListFromResponse( LastSevenDaysOrderVo model, List<TmsSevenArrivalStatusAndDetailsResponse> list) { |
| | | model.setIngList(new ArrayList<>()); |
| | | model.setWaitList(new ArrayList<>()); |
| | | model.setDoneList(new ArrayList<>()); |
| | | if(list ==null || list.size()==0){ |
| | | return; |
| | | } |
| | | for(TmsSevenArrivalStatusAndDetailsResponse temp : list){ |
| | | if(StringUtils.equals(temp.getNcCreateDate(),model.getDateStr())){ |
| | | if(Constants.equalsInteger(temp.getStatus(),Constants.ZERO)){ |
| | | model.getWaitList().add(temp); |
| | | }else if(Constants.equalsInteger(temp.getStatus(),Constants.ONE)){ |
| | | model.getIngList().add(temp); |
| | | }else if(Constants.equalsInteger(temp.getStatus(),Constants.TWO)){ |
| | | model.getDoneList().add(temp); |
| | | } |
| | | } |
| | | } |
| | | model.setDoneNum(model.getDoneList().size()); |
| | | model.setIngNum(model.getIngList().size()); |
| | | model.setWaitNum(model.getWaitList().size()); |
| | | } |
| | | |
| | | /** |
| | | * 出库能力李永利 |
| | | * @return |
| | | */ |