| | |
| | | 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.dao.business.join.PlatformWarnEventJoinMapper; |
| | | import com.doumee.dao.business.join.VisitsJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.web.reqeust.CarsJobAndContractDTO; |
| | | import com.doumee.dao.web.response.platformReport.*; |
| | | import com.doumee.service.business.impl.PlatformJobServiceImpl; |
| | |
| | | //如果是在线或者休眠,查询在途还是空闲ty |
| | | codes.add(model.getPlateNum()); |
| | | model.setJobStatus(Constants.ZERO); |
| | | }else |
| | | }else{ |
| | | model.setJobStatus(Constants.TWO); |
| | | data.setOfflineNum(data.getOfflineNum()+1); |
| | | } |
| | | } |
| | | if(codes.size()>0){ |
| | | //状态 0待确认 1待签到 2等待叫号 3入园等待 4已叫号 5作业中 6作业完成 7转移中 8异常挂起 9已授权离园 10已离园 11 已过号 12取消(WMS) |
| | | List<PlatformJob> busyNum = platformJobMapper.selectList(new QueryWrapper<PlatformJob>() .lambda() |
| | |
| | | BaseResponse<FireStatisticResponse> response1 = HKService.fireStatisticMonth(param); |
| | | if(response1 != null && StringUtils.equals(response1.getCode(), HKConstants.RESPONSE_SUCCEE) |
| | | && response1.getData()!=null ) { |
| | | data.setMonthAddNum(Constants.formatIntegerNum(response1.getData().getMaintenanceNum())); |
| | | data.setMonthAddNum(Constants.formatIntegerNum(response1.getData().getMaintenanceNumMonth())); |
| | | data.setMonthTotalNum(Constants.formatIntegerNum(response1.getData().getDeviceTotalNum())); |
| | | } |
| | | return data; |
| | | return data; |
| | | |
| | | } |
| | | |
| | |
| | | temperatureHumidityDataResponseList.stream().filter(i->i.getIndexCode().indexOf(code)>=Constants.ZERO).collect(Collectors.toList()); |
| | | TemperatureHumidityDataVO temperatureHumidityDataVO = new TemperatureHumidityDataVO(); |
| | | for (TemperatureHumidityDataResponse data:dateList) { |
| | | if(data.getSensorType().equals("temp")){ |
| | | if(StringUtils.isNotBlank(data.getName())){ |
| | | Integer index = data.getName().indexOf("-"); |
| | | if(index>=0){ |
| | | data.setName(data.getName().substring(0,index)); |
| | | } |
| | | } |
| | | if(data.getSensorType().equals("currTemperature")){ |
| | | temperatureHumidityDataVO.setTemperatureData(data); |
| | | }else{ |
| | | temperatureHumidityDataVO.setHumidityData(data); |
| | |
| | | .select("( select pl.CREATE_DATE from platform_log pl where t.id = pl.obj_id and pl.OBJ_TYPE = "+Constants.PlatformJobLogType.WORKING.getKey()+" order by pl.CREATE_DATE desc limit 1 ) as newStartDate") |
| | | //.select(" ( select sum(ifnull(pl.IO_QTY , 0 )) from platform_wms_detail pl where pl.job_id = t.id and pl.isdeleted=0 )",PlatformJob::getWorkNum) |
| | | .select(" ( case when t.total_num is null then ( select sum(pwd.IO_QTY) from platform_wms_detail pwd where pwd.JOB_ID = t.id ) else t.total_num end )",PlatformJob::getWorkNum) |
| | | .apply("to_days(t.create_date) = to_days(now())") |
| | | // .apply("to_days(t.create_date) = to_days(now())") |
| | | .eq(Platform::getIsdeleted, Constants.ZERO) |
| | | .in(PlatformJob ::getStatus,new Integer[]{Constants.PlatformJobStatus.WORKING.getKey(),Constants.PlatformJobStatus.CALLED.getKey() }) |
| | | // .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | .orderByDesc(PlatformJob::getStatus )); |
| | | .orderByDesc(PlatformJob::getStatus ) |
| | | .orderByAsc(PlatformJob::getId ) |
| | | ); |
| | | //月台状态:0=作业中;1=空闲中;2=作业超时;3=叫号 |
| | | for(Platform model : platformList){ |
| | | PlatformWorkDataVO platformDurationVO = new PlatformWorkDataVO(); |
| | |
| | | WholeProvinceBoardVO data = new WholeProvinceBoardVO(); |
| | | data.setMaxAbility(new BigDecimal(0)); |
| | | data.setHoursAbility(new BigDecimal(0)); |
| | | data.setCurrentPlanNum(new BigDecimal(0)); |
| | | data.setCurrentOrderNum(new BigDecimal(0)); |
| | | data.setCrrentRestNum(new BigDecimal(0)); |
| | | data.setCrrentOutNum(new BigDecimal(0)); |
| | | List<TmsFactoryParam> paramList = factoryList(); |
| | | String code = null; |
| | | if(paramList!=null){ |
| | |
| | | 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()))); |
| | | data.setHoursAbility(Constants.formatBigdecimal(param.getParam3())); |
| | | data.setMaxAbility(Constants.formatBigdecimal(param.getNum2())); |
| | | code = param.getCode(); |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | 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(); |
| | | /* Date date = new Date(); |
| | | TmsOutQtyAndVehicleQtyRequest param = new TmsOutQtyAndVehicleQtyRequest(); |
| | | param.setDateEnd(DateUtil.getShortTime(date)); |
| | | param.setDateStart(DateUtil.getShortTime(date)); |
| | |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.getFacrotyCodeList().add(code);//查询指定厂区 |
| | | } |
| | | List<TmsOutQtyAndVehicleQtyResponse> listSame= tmsService.getOutQtyAndVehicleQty(param);//去年同期 |
| | | 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())));//今日出库车次 |
| | | } |
| | | } |
| | | }*/ |
| | | initOutboundCapability(data,factoryCode); |
| | | return data; |
| | | |
| | | } |
| | | private void initOutboundCapability(WholeProvinceBoardVO data, String code) { |
| | | TmsFacrotyCodeListRequest param = new TmsFacrotyCodeListRequest(); |
| | | if(StringUtils.isNotBlank(code)){ |
| | | param.setFacrotyCodeList(new ArrayList<>()); |
| | | param.getFacrotyCodeList().add(code); |
| | | } |
| | | TmsOutboundCapabilityResponse result= tmsService.getOutboundCapability(param); |
| | | if(result !=null){ |
| | | List<String> planCodes = new ArrayList<>(); |
| | | List<String> todayCodes = new ArrayList<>(); |
| | | String todayDate = DateUtil.getShortTime(new Date()); |
| | | if(result.getCurrentDayOrderList()!=null && result.getCurrentDayOrderList().size()>0){ |
| | | for(TmsOutboundCapabilityInfoResponse model :result.getCurrentDayOrderList()){ |
| | | data.setCurrentOrderNum(data.getCurrentOrderNum().add(Constants.formatBigdecimal(model.getNcTotality())));//今日订单量 |
| | | /** |
| | | * DISPATCH_TYPE in(1,2) 且 TRANSPORT_CODE不为空,sum(NC_TOTALITY) + DISPATCH_TYPE not in(1,2) sum(NC_TOTALITY) |
| | | * 今日出库下达的计划任务总量 |
| | | */ |
| | | if(StringUtils.isNotBlank(model.getTransportCode()) |
| | | && (StringUtils.equals("1",model.getDispatchType()) || StringUtils.equals("2",model.getDispatchType()))){ |
| | | data.setCurrentPlanNum(data.getCurrentPlanNum().add(Constants.formatBigdecimal(model.getNcTotality())));//今日订单量 |
| | | } |
| | | if(!(StringUtils.equals("1",model.getDispatchType()) || StringUtils.equals("2",model.getDispatchType()))){ |
| | | data.setCurrentPlanNum(data.getCurrentPlanNum().add(Constants.formatBigdecimal(model.getNcTotality())));//今日计划量 |
| | | } |
| | | |
| | | /** |
| | | * 今日下达出库的计划任务对应的运输车次数 |
| | | * TRANSPORT_CODE不为空count(transport_code ) |
| | | */ |
| | | if(StringUtils.isNotBlank(model.getTransportCode()) && notInList(model.getTransportCode(),planCodes)){ |
| | | planCodes.add(model.getTransportCode()); |
| | | } |
| | | /** |
| | | * 今日下达出库的计划任务对应的运输车次数 |
| | | * TRANSPORT_CODE不为空count(transport_code ) |
| | | */ |
| | | if(StringUtils.isNotBlank(model.getTransportCode()) && notInList(model.getTransportCode(),planCodes)){ |
| | | planCodes.add(model.getTransportCode()); |
| | | } |
| | | /** |
| | | * out_date为当日,sum(NC_TOTALITY) 今日完成的出库作业任务总量 |
| | | * TRANSPORT_CODE不为空 且out_date为当日 count(transport_code) 今日完成的出库作业任务的运输车次数 |
| | | */ |
| | | if(StringUtils.isNotBlank(model.getOutDate()) && model.getOutDate().length()> 10){ |
| | | String tDate = model.getOutDate().substring(0,10); |
| | | if(tDate.equals(todayDate)){ |
| | | //如果是当日 |
| | | data.setCrrentOutNum(data.getCrrentOutNum().add(Constants.formatBigdecimal(model.getNcTotality())));//今日订单量 |
| | | } |
| | | if(StringUtils.isNotBlank(model.getTransportCode()) && notInList(model.getTransportCode(),todayCodes)){ |
| | | todayCodes.add(model.getTransportCode()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(result.getCurrentDayAgoOrderList()!=null && result.getCurrentDayAgoOrderList().size()>0){ |
| | | for(TmsOutboundCapabilityInfoResponse model :result.getCurrentDayAgoOrderList()){ |
| | | /** |
| | | * out_date为空,sum(NC_TOTALITY) 昨天未完成出库计划任务 |
| | | * out_date为空 且TRANSPORT_CODE不为空 * count(transport_code ) 昨天未完成出库计划任务车次 |
| | | */ |
| | | if(StringUtils.isBlank(model.getOutDate())){ |
| | | data.setCurrentPlanNum(data.getCurrentPlanNum().add(Constants.formatBigdecimal(model.getNcTotality())));//今日计划量 |
| | | if(StringUtils.isNotBlank(model.getTransportCode()) && notInList(model.getTransportCode(),planCodes)){ |
| | | planCodes.add(model.getTransportCode()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | data.setCurrentPlanCarNum(planCodes.size());//今日计划车次 |
| | | data.setCrrentOutCarNum(todayCodes.size());//今日出库车次 |
| | | } |
| | | data.setCrrentRestNum(data.getCurrentPlanNum().subtract(data.getCrrentOutNum())); |
| | | data.setCrrentRestCarNum(data.getCurrentPlanCarNum() -data.getCrrentOutCarNum()); |
| | | if(data.getCrrentRestNum().compareTo(new BigDecimal(0)) <=0){ |
| | | data.setCrrentRestNum(new BigDecimal(0)); |
| | | } |
| | | if(data.getCrrentRestCarNum()<=0){ |
| | | data.setCrrentRestCarNum(0); |
| | | } |
| | | } |
| | | |
| | | private boolean notInList(String transportCode, List<String> planCodes) { |
| | | for(String s :planCodes){ |
| | | if(StringUtils.equals(transportCode,s)){ |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 出库能力李永利 |
| | | * @return |
| | |
| | | tt =new WholeProvinceMapVO(); |
| | | tt.setMonthNum( Constants.formatBigdecimal0Float(model.getMonthOutboundQuantity())); |
| | | tt.setYearNum( Constants.formatBigdecimal0Float(model.getYearOutboundQuantity())); |
| | | tt.setProvinceCode(model.getFromProvinceCode()); |
| | | tt.setProvinceName(model.getFromProvinceName()); |
| | | tt.setProvinceCode(model.getToProvinceCode()); |
| | | tt.setProvinceName(model.getToProvinceName()); |
| | | result.add(tt); |
| | | } |
| | | } |
| | |
| | | |
| | | private WholeProvinceMapVO getFromProvinceResultList(TmsDistributionOfDeliveryLocResponse model, List<WholeProvinceMapVO> result) { |
| | | for(WholeProvinceMapVO t : result){ |
| | | if(StringUtils.equals(t.getProvinceCode(), model.getFromProvinceCode())){ |
| | | if(StringUtils.equals(t.getProvinceCode(), model.getToProvinceCode())){ |
| | | t.setMonthNum(Constants.formatBigdecimal(t.getMonthNum()).add(Constants.formatBigdecimal0Float(model.getMonthOutboundQuantity()))); |
| | | t.setYearNum(Constants.formatBigdecimal(t.getYearNum()).add(Constants.formatBigdecimal0Float(model.getYearOutboundQuantity()))); |
| | | return t; |
| | |
| | | @Override |
| | | public TmsBasePageResponse<TmsOrderNoFinishListResponse> orderNoFinishList(TmsOrderNoFinishListRequest param){ |
| | | TmsBasePageResponse<TmsOrderNoFinishListResponse> infoList = tmsService.getNotFinishOrderList(param);//查询出库量 |
| | | if(infoList!=null && infoList.getRows()!=null){ |
| | | /* if(infoList!=null && infoList.getRows()!=null){ |
| | | for(TmsOrderNoFinishListResponse model :infoList.getRows()){ |
| | | model.setStatusDesc(TMSContants.TopStatusLevel.getNameByKey(TMSContants.ChildStatusLevel.getParentIndexByStatus(model.getStatus()))); |
| | | |
| | | } |
| | | } |
| | | }*/ |
| | | return infoList; |
| | | } |
| | | /** |
| | |
| | | } |
| | | Date date = new Date(); |
| | | Date startDate = DateUtil.addDaysToDate(date,-7); |
| | | //看板大屏近7日到货情况日期 0表示当天当前推7天,-1表示本月初1号-7号 |
| | | String flag = systemDictDataBiz.queryByCode(Constants.TSM_PARAM,Constants.SCREEN_SEVENT_ARRIVAL_STARTDATE).getCode(); |
| | | if(StringUtils.equals(flag,"-1")){ |
| | | startDate =DateUtil.getBeginDayOfMonth(0); |
| | | date = DateUtil.addDaysToDate(startDate,7); |
| | | } |
| | | param.setNcCreateDateFrom(DateUtil.getShortTime(startDate)); |
| | | param.setNcCreateDateThrough(DateUtil.getShortTime(date)); |
| | | List<TmsSevenArrivalStatusAndDetailsResponse> infoList = tmsService.getSevenArrivalStatusAndDetails(param);//查询出库量 |