jiangping
2025-05-09 4248fbfb4f6a43cbb4884523f599d7719d1ba1c6
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -668,7 +668,7 @@
        String pressure = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_PRESSURE_LEVEL).getCode();
        String liquid = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.WMS_LIQUID_LEVEL).getCode();
        String pressureUnit = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.PRESSURE_LEVEL_UNIT).getCode();
        String liquidUnit = systemDictDataBiz.queryByCode(Constants.WMS_PARAM,Constants.LIQUID_LEVEL_UNIT).getCode();
        String liquidUnit = systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LIQUID_LEVEL_UNIT).getCode();
        if(response != null && StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)
                && response.getData()!=null ) {
            List<MonitorDataSearchResponse> r = response.getData().getList();
@@ -676,8 +676,9 @@
                for(MonitorDataSearchResponse model : r){
                    MonitorDataVO m = new MonitorDataVO();
                    m.setName(model.getName());
                    m.setType(model.getType());
//                    m.setLevel(Constants.equalsInteger(model.getType(),60)?liquid:pressure);
                    m.setLevel(getLevelDataByDeviceName(model.getName(),Constants.equalsInteger(model.getType(),60)?liquidUnit:pressureUnit));
                    m.setLevel(getLevelDataByDeviceName(m,model.getName(),Constants.equalsInteger(model.getType(),60)?liquidUnit:pressureUnit));
                    m.setDataList(new ArrayList<>());
                    if(model.getValues()!=null){
                        List<MonitorDataInfoVO> dataList = new ArrayList<>();
@@ -715,7 +716,7 @@
        return  list;
    }
    private String getLevelDataByDeviceName(String name,String unit) {
    private String getLevelDataByDeviceName(MonitorDataVO m,String name,String unit) {
        /**
         *   {
@@ -747,7 +748,9 @@
                && response.getData()!=null ) {
            String min  = response.getData().getList().get(0).getFireproChannelMinValue();
            String max  = response.getData().getList().get(0).getFireproChannelMaxvalue();
            r  =StringUtils.defaultString(min,"-")+"~"+StringUtils.defaultString(max,"-") +unit;
            m.setMax(max);
            m.setMin(min);
            r  =StringUtils.defaultString(min,"-")+"~"+StringUtils.defaultString(max,"-") +unit;
        }
        return  r;
@@ -1023,10 +1026,11 @@
        Date lastYear = DateUtil.addYearToDate(year,-1);//去年
        List<PlatformJob>  monthNum = platformJobMapper.selectJoinList(PlatformJob.class,
                    new MPJLambdaWrapper<PlatformJob>()
                        .selectAs(PlatformJob::getId,PlatformJob::getId)
                        .select(PlatformJob::getType,PlatformJob::getType)
                        .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                        .select(PlatformJob::getStatus,PlatformJob::getStatus)
                            .selectAs(PlatformJob::getId,PlatformJob::getId)
                            .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum)
                            .selectAs(PlatformJob::getDoneDate,PlatformJob::getDoneDate)
                            .select(PlatformJob::getStatus,PlatformJob::getStatus)
                            .select(PlatformJob::getType,PlatformJob::getType)
                        .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                        .in(PlatformJob::getType,Constants.ONE,Constants.THREE)
                        .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(),
@@ -1222,15 +1226,19 @@
        }
        if(CollectionUtils.isNotEmpty(jobList)){
            //获取任务数据
            List<String> jobDataList = list.stream().filter(i->Objects.nonNull(i.getDoneDate())).map(i->DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd")).collect(Collectors.toList());
            for (String jobDate:jobDataList) {
                //过滤当天的数据
                List<PlatformJob> platformJobList = list.stream().
                        filter(i->jobDate.equals(DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd"))).collect(Collectors.toList());
                if(CollectionUtils.isNotEmpty(platformJobList)){
                    //获取今天的
                    r = r.add(this.getDayTotalRata(getSumTotalByList(platformJobList,type,null),jobDate));
            List<String> jobDataList = jobList.stream().filter(i->Objects.nonNull(i.getDoneDate()))
                    .map(i->DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd")).collect(Collectors.toList());
            if(CollectionUtils.isNotEmpty(jobDataList)){
                for (String jobDate:jobDataList) {
                    //过滤当天的数据
                    List<PlatformJob> platformJobList = list.stream().
                            filter(i->jobDate.equals(DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd"))).collect(Collectors.toList());
                    if(CollectionUtils.isNotEmpty(platformJobList)){
                        //获取今天的
                        r = r.add(this.getDayTotalRata(getSumTotalByList(platformJobList,type,null),jobDate));
                    }
                }
                r = r.divide(new BigDecimal(Integer.toString(jobList.size())),2,BigDecimal.ROUND_HALF_UP);
            }
        }
        return r;
@@ -1242,7 +1250,7 @@
        //查询今日最早/最晚的作业数据
        List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>()
                .lambda()
                .apply(" ( to_days(param1) =  '"+today+"' or to_days(param2) =  '"+today+"' ) ")
                .apply(" (  DATE_FORMAT( param1 ,'%Y-%m-%d' ) =  '"+today+"' or DATE_FORMAT( param2 ,'%Y-%m-%d' )  =  '"+today+"' ) ")
        );
        if(totalAmount.compareTo(BigDecimal.ZERO)==0||CollectionUtils.isEmpty(platformLogList)){
            return BigDecimal.ZERO;
@@ -2776,17 +2784,18 @@
                    t =new WholeProvinceMapVO();
                    t.setMonthNum( Constants.formatBigdecimal0Float(model.getMonthOutboundQuantity()));
                    t.setYearNum( Constants.formatBigdecimal0Float(model.getYearOutboundQuantity()));
                    if(Constants.UNIT_TYPE == 1) {
                        //处理单位成“箱”,一箱=5万支
                        t.setMonthNum(Constants.formatBigdecimal(t.getMonthNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
                        t.setYearNum(Constants.formatBigdecimal(t.getYearNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
                    }
                    t.setProvinceCode(model.getToProvinceCode());
                    t.setProvinceName(model.getToProvinceName());
                    result.add(t);
                }
            }
            if(Constants.UNIT_TYPE == 1) {
             for(WholeProvinceMapVO t : result){
                    //处理单位成“箱”,一箱=5万支
                    t.setMonthNum(Constants.formatBigdecimal(t.getMonthNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
                    t.setYearNum(Constants.formatBigdecimal(t.getYearNum()).divide(new BigDecimal(5), 2, BigDecimal.ROUND_HALF_UP));
                }
            }
        }
        return result;
    }