xieb
2023-12-11 cbe5c665174e41fb5f0f9660c8914c26848746fb
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/vo/TbWordVO.java
@@ -162,7 +162,14 @@
               List<AttResManagePerson> attResManagePeople) {
      //取设计流量大的进行描述
      List<TbAttResWaterDelivery> sortList = tbAttResWaterDeliveryList.stream().sorted((a, b) -> b.getDesignFlow().compareTo(a.getDesignFlow())).collect(Collectors.toList());
      List<TbAttResWaterDelivery> sortList =
         tbAttResWaterDeliveryList.stream()
            .sorted((a, b) -> {
               Optional<Double> flowA = Optional.ofNullable(a.getDesignFlow());
               Optional<Double> flowB = Optional.ofNullable(b.getDesignFlow());
               return flowA.isPresent() && flowB.isPresent() ? flowA.get().compareTo(flowB.get()) : (flowA.isPresent() ? 1 : (flowB.isPresent() ? -1 : 0));
            })
            .collect(Collectors.toList());
      formatTbAttResBase(tbAttResBase);
      formatTbAttResStagChar(tbAttResStagChar);
@@ -331,11 +338,11 @@
       */
      //需要对其他类型进行判断;
      String type = tbAttResRsbSpillway.getSpillwayType();
      String holeNum = tbAttResRsbSpillway.getSectionNum() == 1 ? "单" : String.valueOf(tbAttResRsbSpillway.getSectionNum());
      String coveLength = isNull(tbAttResRsbSpillway.getCoveLength());
      String thresholdElevation = isNull(tbAttResRsbSpillway.getThresholdElevation());
      String chec = isNull(tbAttResRsbSpillway.getCheckFlDisCharge());
      String type = tbAttResRsbSpillway==null?"":tbAttResRsbSpillway.getSpillwayType();
      String holeNum = tbAttResRsbSpillway.getSectionNum()==null?"":tbAttResRsbSpillway.getSectionNum() == 1 ? "单" : String.valueOf(tbAttResRsbSpillway.getSectionNum());
      String coveLength = tbAttResRsbSpillway==null?"":isNull(tbAttResRsbSpillway.getCoveLength());
      String thresholdElevation = tbAttResRsbSpillway==null?"":isNull(tbAttResRsbSpillway.getThresholdElevation());
      String chec = tbAttResRsbSpillway==null?"":isNull(tbAttResRsbSpillway.getCheckFlDisCharge());
      String text = StringUtil.format("泄洪洞为{},{}孔,洞长{}m,进口底槛高程{}m,最大泄量(最大泄洪流量){}m³/s。",
         type, holeNum, coveLength, thresholdElevation, chec);
@@ -410,9 +417,24 @@
      //行政区划 市、县、镇
      if (StringUtil.isNotBlank(tbAttResBase.getBuildAddress())) {
         List<String> regionList = Arrays.asList(tbAttResBase.getBuildAddress().split("-"));
         this.cityName = regionList.get(1);
         this.countyName = regionList.get(2);
         this.townName = regionList.get(3);
         if (regionList.size() == 4) {
            this.cityName = regionList.get(1);
            this.countyName = regionList.get(2);
            this.townName = regionList.get(3);
         }else if (regionList.size() == 3) {
            this.cityName = regionList.get(1);
            this.countyName = regionList.get(2);
            this.townName = "";
         } else if (regionList.size() == 2){
            this.cityName = regionList.get(1);
            this.countyName = "";
            this.townName = "";
         } else {
            this.cityName = "";
            this.countyName = "";
            this.townName = "";
         }
      }
      //水库功能
@@ -583,12 +605,12 @@
         if (StringUtils.isNotBlank(this.economicBenefit)) {
            this.economicBenefit = this.economicBenefit +
               StringUtil.format("此外,水库为{}{}万人提供生活用水,年均供水量{}万m³。",
                  tbAttResEngBene.getSupplyObject(),String.format("%.2f", Double.parseDouble(tbAttResEngBene.getSupplyPopulation())), tbAttResEngBene.getMoyearSupplyAvg());
                  tbAttResEngBene.getSupplyObject(),StringUtil.isBlank(tbAttResEngBene.getSupplyPopulation())?"":String.format("%.2f", Double.parseDouble(tbAttResEngBene.getSupplyPopulation())), tbAttResEngBene.getMoyearSupplyAvg());
         } else {
            //无灌溉有供水直接介绍供水
            this.economicBenefit =
               StringUtil.format("水库为{}{}万人提供生活用水,年均供水量{}万m³。",
                  tbAttResEngBene.getSupplyObject(),String.format("%.2f", Double.parseDouble(tbAttResEngBene.getSupplyPopulation())/ 10000), tbAttResEngBene.getMoyearSupplyAvg());
                  tbAttResEngBene.getSupplyObject(),String.format("%.2f", StringUtil.isBlank(tbAttResEngBene.getSupplyPopulation())?"":Double.parseDouble(tbAttResEngBene.getSupplyPopulation())/ 10000), tbAttResEngBene.getMoyearSupplyAvg());
         }
      }
@@ -638,19 +660,22 @@
      }
      //key值表示其他
      if (typeKey.equals("9") || typeKey.equals("其他") || Integer.parseInt(typeKey) == 9 ) {
         text = explain;
      }else{
         switch (enumName) {
            case "AqueductTypeEnum":
               text = AqueductTypeEnum.find(typeKey).getLabel();
               break;
            case "SpillwayHoleType":
               text = typeKey;
               break;
      if (StringUtil.isNotBlank(typeKey)) {
         if (typeKey.equals("9") || typeKey.equals("其他") || Integer.parseInt(typeKey) == 9 ) {
            text = explain;
         }else{
            switch (enumName) {
               case "AqueductTypeEnum":
                  text = AqueductTypeEnum.find(typeKey).getLabel();
                  break;
               case "SpillwayHoleType":
                  text = typeKey;
                  break;
            }
         }
      }
      return text;
   }