ke
2024-07-19 08a962d2925baa255207fdf979e6fee794f1773b
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/vo/TbWordVO.java
@@ -2,6 +2,7 @@
import cn.gistack.sm.sjztmd.entity.*;
import cn.gistack.sm.sjztmd.word.enums.*;
import cn.gistack.sm.sjztmd.word.util.WordUtil;
import com.alibaba.nacos.common.utils.StringUtils;
import lombok.Data;
import org.checkerframework.checker.formatter.qual.UnknownFormat;
@@ -299,6 +300,12 @@
       */
      String typeName = SpillwayTypeEnum.find(norspi.getSpillwayType()).getLabel();
      if (StringUtil.isBlank(typeName) && norspi.getSpillwayType().indexOf(",") > -1) {
         String [] tmpSt = norspi.getSpillwayType().split(",");
         if (tmpSt[0].equals("9")) {
            typeName = tmpSt[1];
         }
      }
      String gateText = "";
      String holeText = "";
@@ -319,7 +326,7 @@
      String disCharge = isNull(norspi.getCheckingFloodDischarge());
      String text = StringUtil.format("溢洪道为{},{},堰顶高程{}m,堰顶净宽{}m{},最大泄洪量{}m³/s。",
         typeName, gateText, weirTopElevation, weirTopWidth, holeText, disCharge);
         typeName, gateText, StringUtil.format("设计洪水位{}m", String.format("%.2f",norspi.getWeirTopElevation())), weirTopWidth, holeText, disCharge);
      return text;
   }
@@ -375,7 +382,7 @@
      String info = StringUtil.format("{}为{},坝顶高程{}m,最大坝高{}m,坝长{}m,坝顶宽{}m。",
         name, mainDamType, mainDamTopElevation, mainDamHeight, mainDamTopLength, mainDamWidth);
         name, mainDamType, Double.parseDouble(String.format("%.2f",tbAttResWaterBlock.getDamTopElevation())), mainDamHeight, mainDamTopLength, mainDamWidth);
      return info;
   }
@@ -393,7 +400,7 @@
            this.administrativeUnit = attResManagePerson.getUserUnit();
         }
         if (attResManagePerson.getType().equals("2")) {
         if (attResManagePerson.getType().equals("3")) {
            //主管
            this.competentDepartmentInfo = StringUtil.format("{}({},{})",
               attResManagePerson.getUserName(), attResManagePerson.getPosition(), attResManagePerson.getUserPhone());
@@ -453,7 +460,7 @@
         String resFuncText = String.join("、", resFucTextList);
         if (resFucList.size() >= 3) {
            resFuncText = resFuncText + "等综合";
            resFuncText = resFuncText + "等";
         }
         this.resFuncText = resFuncText;
@@ -492,35 +499,37 @@
      this.desFlSta = DesFlStaEnum.find(tbAttResStagChar.getDesFlSta()).getLabel();
      this.checFlSta = ChecFlStaEnum.find(tbAttResStagChar.getDesFlSta()).getLabel();
      this.checFlSta = ChecFlStaEnum.find(tbAttResStagChar.getChecFlSta()).getLabel();
      this.totalCap = isNull(tbAttResStagChar.getTotalCap());
      //水文特征
      List<String> hydrologicalCharacteristicsList = new ArrayList<>();
      List<String> hydrologicalCharacteristicsList2 = new ArrayList<>();
      if (tbAttResStagChar.getAdjustStorCap() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("兴利库容{}万m³", tbAttResStagChar.getAdjustStorCap().toString()));
         hydrologicalCharacteristicsList.add(StringUtil.format("兴利库容{}万m³", WordUtil.removeTrailingZero(tbAttResStagChar.getAdjustStorCap().toString())));
      }
      if (tbAttResStagChar.getFlprCap() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("调洪库容{}万m³", tbAttResStagChar.getFlprCap().toString()));
         hydrologicalCharacteristicsList.add(StringUtil.format("调洪库容{}万m³", WordUtil.removeTrailingZero(tbAttResStagChar.getFlprCap().toString())));
      }
      if (tbAttResStagChar.getDeadCap() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("死库容{}万m³", tbAttResStagChar.getDeadCap().toString()));
         hydrologicalCharacteristicsList.add(StringUtil.format("死库容{}万m³", WordUtil.removeTrailingZero(tbAttResStagChar.getDeadCap().toString())));
      }
      if (tbAttResStagChar.getChecFlStag() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("校核洪水位{}m", tbAttResStagChar.getChecFlStag().toString()));
         hydrologicalCharacteristicsList2.add(StringUtil.format(this.resName + "校核洪水位{}m", String.format("%.2f",tbAttResStagChar.getChecFlStag())));
      }
      if (tbAttResStagChar.getDesFlStag() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("设计洪水位{}m", tbAttResStagChar.getDesFlStag().toString()));
         hydrologicalCharacteristicsList2.add(StringUtil.format("设计洪水位{}m", String.format("%.2f",tbAttResStagChar.getDesFlStag())));
      }
      if (tbAttResStagChar.getCorNormStag() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("正常蓄水位{}m", tbAttResStagChar.getCorNormStag().toString()));
         hydrologicalCharacteristicsList2.add(StringUtil.format("正常蓄水位{}m", String.format("%.2f",tbAttResStagChar.getCorNormStag())));
      }
      if (tbAttResStagChar.getDeadStag() != null) {
         hydrologicalCharacteristicsList.add(StringUtil.format("死水位{}m", tbAttResStagChar.getDeadStag().toString()));
         hydrologicalCharacteristicsList2.add(StringUtil.format("死水位{}m", String.format("%.2f",tbAttResStagChar.getDeadStag())));
      }
      this.hydrologicalCharacteristics = String.join(",", hydrologicalCharacteristicsList);
      this.hydrologicalCharacteristics = String.join(",", hydrologicalCharacteristicsList) + ";" + String.join(",", hydrologicalCharacteristicsList2);
   }
   private void formatTbAttResWaterDelivery(List<TbAttResWaterDelivery> tbAttResWaterDeliveryList) {
@@ -531,9 +540,9 @@
      TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(0);
      if (tbAttResWaterDeliveryList.size() > 1) {
         this.aqueductType = "主要采用";
         this.aqueductType = "水库主要采用";
      } else {
         this.aqueductType = "采用";
         this.aqueductType = "水库采用";
      }
@@ -553,10 +562,24 @@
         return;
      }
      this.protectCity = tbAttResEngBene.getCity().equals("无")?"":tbAttResEngBene.getCity();
      this.protectCity = tbAttResEngBene.getCity().equals("无")?tbAttResEngBene.getTown():tbAttResEngBene.getCity();
      if (StringUtil.isBlank(this.protectCity)) {
         this.protectCity = tbAttResEngBene.getTown().equals("无")?"":tbAttResEngBene.getTown();
      }
      double person = tbAttResEngBene.getFlControlPerson() / 10000.0;
      if (person > 0) {
         this.protectPersonLand = String.format("%.2f",person) + "万人口";
      }
      if (tbAttResEngBene.getFlControlLand() > 0) {
         if (StringUtil.isBlank(this.protectPersonLand)) {
            this.protectPersonLand = String.format("%.2f", tbAttResEngBene.getFlControlLand()) + "万亩耕地";
         } else {
            this.protectPersonLand = this.protectPersonLand + "、" + String.format("%.2f", tbAttResEngBene.getFlControlLand()) + "万亩耕地";
         }
      }
      this.protectPersonLand =
         StringUtil.format("{}万人口、{}万亩耕地", String.format("%.2f",person) , String.format("%.2f", tbAttResEngBene.getFlControlLand() / 1000));
@@ -628,7 +651,7 @@
      String type = SafetyAppraisalTypeEnum.find(tbAttResSafetyMonitor.getSafetyAppraisalResult()).getLabel();
      String surveyProblem = tbAttResSafetyMonitor.getSurveyProblem();
      //(若一类坝,不介绍问题,二、三类坝介绍)
      if (tbAttResSafetyMonitor.equals("1")) {
      if (tbAttResSafetyMonitor.getSafetyAppraisalResult().equals("1")) {
         this.safetyMonitorText = StringUtil.format("{},水库进行安全鉴定,鉴定结果为\"{}\"。",
            time, type);
      } else {
@@ -644,7 +667,7 @@
      }
      this.mUnitName = tbAttResMgrSysB.getMUnitName();
      this.mUnitNature = tbAttResMgrSysB.getMUnitNature().replace("公益类","");
      this.mUnitNature = tbAttResMgrSysB.getMUnitNature();
      this.mUnitPersonNumber = tbAttResMgrSysB.getMUnitPersonNumber().toString();
   }