From 39081183f7cc171aefc435f33b077d3ce41fd2ea Mon Sep 17 00:00:00 2001
From: aix <vip_xiaobin810@163.com>
Date: Sat, 17 Aug 2024 13:11:01 +0800
Subject: [PATCH] 资料整编

---
 skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/service/impl/SjztmdServiceImpl.java |  568 +++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 393 insertions(+), 175 deletions(-)

diff --git a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/service/impl/SjztmdServiceImpl.java b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/service/impl/SjztmdServiceImpl.java
index 6b7fa8e..270652e 100644
--- a/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/service/impl/SjztmdServiceImpl.java
+++ b/skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/word/service/impl/SjztmdServiceImpl.java
@@ -2,6 +2,7 @@
 
 import cn.gistack.common.utils.SpringContextUtil;
 import cn.gistack.sm.sjztmd.entity.*;
+import cn.gistack.sm.sjztmd.vo.AttResWithRainfall;
 import cn.gistack.sm.sjztmd.vo.StationExport;
 import cn.gistack.sm.sjztmd.vo.ZtResultInfo;
 import cn.gistack.sm.sjztmd.vo.StationParams;
@@ -9,15 +10,19 @@
 import cn.gistack.sm.sjztmd.service.*;
 import cn.gistack.sm.sjztmd.word.enums.*;
 import cn.gistack.sm.sjztmd.word.service.ISjztmdService;
+import cn.gistack.sm.sjztmd.word.util.WordUtil;
 import cn.gistack.sm.sjztmd.word.vo.*;
 import cn.gistack.sm.sjztods.constant.ZtApiUrlConstant;
 import cn.gistack.sm.sjztods.constant.ZtConfigConstant;
+import com.alibaba.excel.util.StringUtils;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.parser.Feature;
 import com.baomidou.dynamic.datasource.annotation.DS;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,14 +42,16 @@
 @Service
 @AllArgsConstructor
 @DS("zt")
+@Slf4j
 public class SjztmdServiceImpl implements ISjztmdService {
 
 	//总计
-	private final String RIBAO_SHEET1_TOTAL_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao_sheet1/api?small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2";
+	private final String RIBAO_SHEET1_TOTAL_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao_sheet1/api?small_start_stag=0&mid_start_stag=0&big_start_stag=0";
+	private final String RIBAO_SHEET1_OVER_NORM_POOL_STAG = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet1_over_norm_pool_stag/api?";
 	//中大型水库
-	private final String RIBAO_SHEET2_ZDX_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet2_zdx/api?mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2";
+	private final String RIBAO_SHEET2_ZDX_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet2_zdx/api?mid_start_stag=0&big_start_stag=0";
 	//超汛明细
-	private final String RIBAO_SHEET3_OVER_STAG_LIST_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet3_over_stag_list/api?small_start_stag=0&small_end_stag=2&mid_start_stag=0&mid_end_stag=2&big_start_stag=0&big_end_stag=2";
+	private final String RIBAO_SHEET3_OVER_STAG_LIST_URL = "/services/1234567890ABCDEFGHIJKLMN/ribao/sheet3_over_stag_list/api?small_start_stag=0&mid_start_stag=0&big_start_stag=0";
 	//省直管
 	private final String SZ_INFO = "/services/1234567890ABCDEFGHIJKLMN/ribao/shengzh_new_rz/api";
 
@@ -61,7 +68,7 @@
 	@Autowired
 	private RestTemplate restTemplate;
 	private final SjztMdMapper mapper;
-
+	private final IAttResBaseService attResBase;
 	private final ITbAttResBaseService attResBaseService;
 	private final ITbAttResStagCharService attResStagCharService;
 	private final ITbAttResWaterDeliveryService attResWaterDeliveryService;
@@ -72,7 +79,7 @@
 	private final ITbAttResWaterBlockService attResWaterBlockService;
 	private final ITbAttResRsbNorspiService attResRsbNorspiService;
 	private final ITbAttResPowerStationService attResPowerStationService;
-
+	private final IStResRainfallService stResRainfallService;
 	private final ITbAttResProjectUtilizeService attResProjectUtilizeService;
 	private final ITbAttResInformationProjectService attResInformationProjectService;
 
@@ -150,19 +157,19 @@
 		tableMap.put("engGrad", tbAttResBase.getEngGrad());
 		tableMap.put("longitude", tbAttResBase.getLgtd());
 		tableMap.put("latitude", tbAttResBase.getLttd());
-		tableMap.put("elevationSystem", tbAttResBase.getElevationSystem());
+		tableMap.put("elevationSystem",tbAttResBase.getElevationSystem()==null?"": tbAttResBase.getElevationSystem().replace(",","").replace("其它",""));
 		tableMap.put("region", tbAttResBase.getBuildAddress());
 		tableMap.put("basName", BasCodeEnum.find(tbAttResBase.getBasCode()).getLabel());
 		tableMap.put("locRvName", tbAttResBase.getLocRvName());
 
-		String st = tbAttResBase.getStartTime() != null ? new SimpleDateFormat("M月dd日").format(tbAttResBase.getStartTime()) : "";
-		String wst = tbAttResBase.getWaterStorageTm() != null ? new SimpleDateFormat("M月dd日").format(tbAttResBase.getWaterStorageTm()) : "";
+		String st = tbAttResBase.getStartTime() != null ? new SimpleDateFormat("YYYY年M月dd日").format(tbAttResBase.getStartTime()) : "";
+		String wst = tbAttResBase.getWaterStorageTm() != null ? new SimpleDateFormat("YYYY年M月dd日").format(tbAttResBase.getWaterStorageTm()) : "";
 		tableMap.put("startTime", st);
 		tableMap.put("waterStorageTm", wst);
 
 
-		tableMap.put("reinforceTm", tbAttResSafetyMonitor.getReinforceTm());
-		tableMap.put("completionTime", tbAttResSafetyMonitor.getCompletionTime());
+		tableMap.put("reinforceTm", tbAttResSafetyMonitor == null ? "":tbAttResSafetyMonitor.getReinforceTm() != null? new SimpleDateFormat("YYYY年M月dd日").format(tbAttResSafetyMonitor.getReinforceTm()) : "");
+		tableMap.put("completionTime", tbAttResSafetyMonitor == null ? "":tbAttResSafetyMonitor.getCompletionTime() != null? new SimpleDateFormat("YYYY年M月dd日").format(tbAttResSafetyMonitor.getCompletionTime()) : "");
 
 		String resFunc = tbAttResBase.getResFunc();
 		if (StringUtil.isNotBlank(resFunc)) {
@@ -173,55 +180,64 @@
 				ResFucEnum resFucEnum = ResFucEnum.find(key);
 				resFucTextList.add(resFucEnum.getLabel());
 			}
-			resFunc = String.join(",", resFucTextList);
+			resFunc = String.join("、", resFucTextList);
 		}
 		tableMap.put("resFunc", resFunc);
 		//水文特征
-		tableMap.put("conArea", tbAttResStagChar.getConArea());
-		tableMap.put("moyearRainAvg", tbAttResStagChar.getMoyearRainAvg());
-		tableMap.put("moyearFlAvg", tbAttResStagChar.getMoyearFlAvg());
-		tableMap.put("downWacoSafeDisc", tbAttResStagChar.getDownWacoSafeDisc());
-		tableMap.put("desFlSta", tbAttResStagChar.getDesFlSta());
-		tableMap.put("desFlFlow", tbAttResStagChar.getDesFlFlow());
-		tableMap.put("desFl1dayCap", tbAttResStagChar.getDesFl1dayCap());
-		tableMap.put("desFl3dayCap", tbAttResStagChar.getDesFl3dayCap());
-		tableMap.put("checFlSta", tbAttResStagChar.getChecFlSta());
-		tableMap.put("checFlFlow", tbAttResStagChar.getChecFlFlow());
-		tableMap.put("checFl1dayCap", tbAttResStagChar.getChecFl1dayCap());
-		tableMap.put("checFl3dayCap", tbAttResStagChar.getChecFl3dayCap());
+		tableMap.put("conArea", tbAttResStagChar==null || tbAttResStagChar.getConArea()==null?"": WordUtil.removeTrailingZero(tbAttResStagChar.getConArea().toString()));
+		tableMap.put("moyearRainAvg", tbAttResStagChar==null || tbAttResStagChar.getMoyearRainAvg()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getMoyearRainAvg().toString()));
+		tableMap.put("moyearFlAvg", tbAttResStagChar==null || tbAttResStagChar.getMoyearFlAvg()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getMoyearFlAvg().toString()));
+		tableMap.put("downWacoSafeDisc", tbAttResStagChar==null || tbAttResStagChar.getDownWacoSafeDisc()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDownWacoSafeDisc().toString()));
+		tableMap.put("desFlSta", tbAttResStagChar==null || tbAttResStagChar.getDesFlSta()==null?"":tbAttResStagChar.getDesFlSta());
+		tableMap.put("desFlFlow", tbAttResStagChar==null || tbAttResStagChar.getDesFlFlow()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFlFlow().toString()));
+		tableMap.put("desFl1dayCap", tbAttResStagChar==null || tbAttResStagChar.getDesFl1dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFl1dayCap().toString()));
+		tableMap.put("desFl3dayCap", tbAttResStagChar==null || tbAttResStagChar.getDesFl3dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFl3dayCap().toString()));
+		tableMap.put("checFlSta", tbAttResStagChar==null || tbAttResStagChar.getChecFlSta()==null?"":tbAttResStagChar.getChecFlSta());
+		tableMap.put("checFlFlow", tbAttResStagChar==null || tbAttResStagChar.getChecFlFlow()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFlFlow().toString()));
+		tableMap.put("checFl1dayCap", tbAttResStagChar==null || tbAttResStagChar.getChecFl1dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFl1dayCap().toString()));
+		tableMap.put("checFl3dayCap", tbAttResStagChar==null || tbAttResStagChar.getChecFl3dayCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFl3dayCap().toString()));
 
 		//水库特征
-		tableMap.put("adjustProp", AdjustPropEnum.find(tbAttResStagChar.getAdjustProp()).getLabel());
-		tableMap.put("checFlStag", tbAttResStagChar.getChecFlStag());
-		tableMap.put("totalCap", tbAttResStagChar.getTotalCap());
-		tableMap.put("desFlStag", tbAttResStagChar.getDesFlStag());
-		tableMap.put("flprCap", tbAttResStagChar.getFlprCap());
-		tableMap.put("flConTopStag", tbAttResStagChar.getFlConTopStag());
-		tableMap.put("flSortCap", tbAttResStagChar.getFlStorCap());
-		tableMap.put("corNormStag", tbAttResStagChar.getCorNormStag());
-		tableMap.put("adjustStorCap", tbAttResStagChar.getAdjustStorCap());
-		tableMap.put("deadStag", tbAttResStagChar.getDeadStag());
-		tableMap.put("deadCap", tbAttResStagChar.getDeadCap());
-		tableMap.put("beforeFloodStag", tbAttResStagChar.getBeforeFloodStag());
-		tableMap.put("midFloodStag", tbAttResStagChar.getMidFloodStag());
-		tableMap.put("afterFloodStag", tbAttResStagChar.getAfterFloodStag());
+		tableMap.put("adjustProp", tbAttResStagChar==null || tbAttResStagChar.getAdjustProp()==null?"":AdjustPropEnum.find(tbAttResStagChar.getAdjustProp()).getLabel());
+		tableMap.put("checFlStag", tbAttResStagChar==null || tbAttResStagChar.getChecFlStag()==null?"":tbAttResStagChar.getChecFlStag());
+		tableMap.put("totalCap", tbAttResStagChar==null || tbAttResStagChar.getTotalCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getTotalCap().toString()));
+		tableMap.put("desFlStag", tbAttResStagChar==null || tbAttResStagChar.getDesFlStag()==null?"":tbAttResStagChar.getDesFlStag());
+		tableMap.put("flprCap", tbAttResStagChar==null || tbAttResStagChar.getFlprCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getFlprCap().toString()));
+		tableMap.put("flConTopStag", tbAttResStagChar==null || tbAttResStagChar.getFlConTopStag()==null?"":String.format("%.2f",tbAttResStagChar.getFlConTopStag()));
+		tableMap.put("flSortCap", tbAttResStagChar==null || tbAttResStagChar.getFlStorCap()==null?"":tbAttResStagChar.getFlStorCap());
+		tableMap.put("corNormStag", tbAttResStagChar==null || tbAttResStagChar.getCorNormStag()==null?"":String.format("%.2f",tbAttResStagChar.getCorNormStag()));
+		tableMap.put("adjustStorCap", tbAttResStagChar==null || tbAttResStagChar.getAdjustStorCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getAdjustStorCap().toString()));
+		tableMap.put("deadStag", tbAttResStagChar==null || tbAttResStagChar.getDeadStag()==null?"":String.format("%.2f",tbAttResStagChar.getDeadStag()));
+		tableMap.put("deadCap", tbAttResStagChar==null || tbAttResStagChar.getDeadCap()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDeadCap().toString()));
+		tableMap.put("beforeFloodStag", tbAttResStagChar==null || tbAttResStagChar.getBeforeFloodStag()==null?"":String.format("%.2f",tbAttResStagChar.getBeforeFloodStag()));
+		tableMap.put("midFloodStag", tbAttResStagChar==null || tbAttResStagChar.getMidFloodStag()==null?"":String.format("%.2f",tbAttResStagChar.getMidFloodStag()));
+		tableMap.put("afterFloodStag", tbAttResStagChar==null || tbAttResStagChar.getAfterFloodStag()==null?"":String.format("%.2f",tbAttResStagChar.getAfterFloodStag()));
 
 		//new SimpleDateFormat("yyyy年MM月").format(tbAttResBase.getStartTime());
 
-		String bfs = tbAttResStagChar.getBeforeFloodStart() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getBeforeFloodStart()) : "";
-		String bfe = tbAttResStagChar.getBeforeFloodEnd() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getBeforeFloodEnd()) : "";
-		String mfs = tbAttResStagChar.getMidFloodStart() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getMidFloodStart()) : "";
-		String mfe = tbAttResStagChar.getMidFloodEnd() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getMidFloodEnd()) : "";
-		String afs = tbAttResStagChar.getAfterFloodStart() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getAfterFloodStart()) : "";
-		String afe = tbAttResStagChar.getAfterFloodEnd() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getAfterFloodEnd()) : "";
+		String bfs = tbAttResStagChar==null?"":tbAttResStagChar.getBeforeFloodStart() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getBeforeFloodStart()) : "";
+		String bfe = tbAttResStagChar==null?"":tbAttResStagChar.getBeforeFloodEnd() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getBeforeFloodEnd()) : "";
+		String mfs = tbAttResStagChar==null?"":tbAttResStagChar.getMidFloodStart() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getMidFloodStart()) : "";
+		String mfe = tbAttResStagChar==null?"":tbAttResStagChar.getMidFloodEnd() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getMidFloodEnd()) : "";
+		String afs = tbAttResStagChar==null?"":tbAttResStagChar.getAfterFloodStart() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getAfterFloodStart()) : "";
+		String afe = tbAttResStagChar==null?"":tbAttResStagChar.getAfterFloodEnd() != null ? new SimpleDateFormat("M月dd日").format(tbAttResStagChar.getAfterFloodEnd()) : "";
 		tableMap.put("beforeFloodStart", bfs);
 		tableMap.put("beforeFloodEnd", bfe);
+		if (!StringUtils.isEmpty(bfs) && !StringUtils.isEmpty(bfe)) {
+			tableMap.put("beforeFloodDataInfo", bfs + "-" + bfe);
+		}
 		tableMap.put("midFloodStart", mfs);
 		tableMap.put("midFloodEnd", mfe);
+		if (!StringUtils.isEmpty(mfs) && !StringUtils.isEmpty(mfe)) {
+			tableMap.put("midFloodDataInfo", mfs + "-" + mfe);
+		}
 		tableMap.put("afterFloodStart", afs);
 		tableMap.put("afterFloodEnd", afe);
-		tableMap.put("desFloodFlow", tbAttResStagChar.getDesFloodFlowMax());
-		tableMap.put("checFloodFlowMax", tbAttResStagChar.getChecFloodFlowMax());
+		if (!StringUtils.isEmpty(afs) && !StringUtils.isEmpty(afe)) {
+			tableMap.put("afterFloodDataInfo", afs + "-" + afe);
+		}
+		tableMap.put("desFloodFlowMax", tbAttResStagChar==null || tbAttResStagChar.getDesFloodFlowMax()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getDesFloodFlowMax().toString()));
+		tableMap.put("checFloodFlowMax", tbAttResStagChar==null || tbAttResStagChar.getChecFloodFlowMax()==null?"":WordUtil.removeTrailingZero(tbAttResStagChar.getChecFloodFlowMax().toString()));;
 
 		String mainDamType = "";
 		String mainDamMainFoundation = "";
@@ -249,18 +265,18 @@
 
 			mainDamType = DamTypeEnum.find(tbAttResWaterBlock.getDamType()).getLabel();
 			mainDamMainFoundation = tbAttResWaterBlock.getDamMainFoundation();
-			mainDamTopElevation = isNullObject(tbAttResWaterBlock.getDamTopElevation());
+			mainDamTopElevation = StringUtil.isBlank(isNullObject(tbAttResWaterBlock.getDamTopElevation()))?"":String.format("%.2f",tbAttResWaterBlock.getDamTopElevation());
 			mainDamHeight = isNullObject(tbAttResWaterBlock.getDamHeight());
 			mainDamTopLength = isNullObject(tbAttResWaterBlock.getDamTopLength());
 			mainDamWidth = isNullObject(tbAttResWaterBlock.getDamWidth());
 			mainIsTraffic = tbAttResWaterBlock.getIsTraffic();
-			mainWaveWallTopElevation = isNullObject(tbAttResWaterBlock.getWaveWallTopElevation());
+			mainWaveWallTopElevation = StringUtil.isBlank(isNullObject(tbAttResWaterBlock.getWaveWallTopElevation()))?"":String.format("%.2f",tbAttResWaterBlock.getWaveWallTopElevation());
 			mainUpDamProtectType = convertType(tbAttResWaterBlock.getUpDamProtectType(), "Explain");
 			mainDownDamProtectType = convertType(tbAttResWaterBlock.getDownDamProtectType(), "Explain");
 			damMainBodyType = convertType(tbAttResWaterBlock.getDamMainBodyType(), "Explain");
 			damMainBodyTopElevation = isNullObject(tbAttResWaterBlock.getDamTopElevation());
 			damMainDrainType = convertType(tbAttResWaterBlock.getDamMainDrainType(), "Explain");
-			mainDamBodyType = convertType(isNullObject(tbAttResWaterBlock.getDamBodyType()), "Explain");
+			mainDamBodyType = DamBodyTypeEnum.find(convertType(isNullObject(tbAttResWaterBlock.getDamBodyType()), "Explain")).getLabel();
 
 			//副坝
 			subDamNum = isNullObject(tbAttResWaterBlock.getSubDamNum());
@@ -282,13 +298,34 @@
 		tableMap.put("mainUpDamProtectType", mainUpDamProtectType);
 		tableMap.put("mainDownDamProtectType", mainDownDamProtectType);
 		tableMap.put("damMainBodyType", damMainBodyType);
-		tableMap.put("damMainBodyTopElevation", damMainBodyTopElevation);
+		tableMap.put("damMainBodyTopElevation", StringUtil.isNotBlank(damMainBodyTopElevation)?String.format("%.2f",Double.parseDouble(damMainBodyTopElevation)):"");
 		tableMap.put("damMainDrainType", damMainDrainType);
 		tableMap.put("mainDamBodyType", mainDamBodyType);
-		tableMap.put("subDamNum", subDamNum);
-		tableMap.put("subDamTotLength", subDamTotLength);
-		tableMap.put("subDamMaxHeight", subDamMaxHeight);
-		tableMap.put("subDamTopWidth", subDamTopWidth);
+		int subDamNumNew = tbAttResWaterBlockList.size() - 1;
+		tableMap.put("subDamNum", subDamNumNew);
+		if (subDamNumNew > 0) {
+			double damHeight = 0.0;
+			int index = 0;
+			double damTopLength = 0.0;
+			for (int i = 1; i < tbAttResWaterBlockList.size(); i++) {
+				TbAttResWaterBlock waterBlock = tbAttResWaterBlockList.get(i);
+				if (waterBlock.getDamHeight() > damHeight) {
+					damHeight = waterBlock.getDamHeight();
+					index = i;
+				}
+				damTopLength += waterBlock.getDamTopLength();
+			}
+			tableMap.put("subDamMaxHeight", damHeight);//副坝最大坝高
+			tableMap.put("subDamTopWidth", tbAttResWaterBlockList.get(index).getDamWidth());//坝顶宽引用最高那座的坝顶宽
+			tableMap.put("subDamTotLength", damTopLength);//坝长算所有副坝的总长度
+		} else {
+			tableMap.put("subDamMaxHeight", "");//副坝最大坝高
+			tableMap.put("subDamTopWidth", "");//坝顶宽引用最高那座的坝顶宽
+			tableMap.put("subDamTotLength", "");
+		}
+
+
+
 
 		//正常溢洪道
 		List<TbAttResRsbNorspi> tbAttResRsbNorspiList = (List<TbAttResRsbNorspi>) resRsbNorsipiVerspiMionitorDetailByGuid.get("tbAttResRsbNorspiList");
@@ -302,37 +339,69 @@
 		String disEnergyType = "";
 		String norOc = "";
 
-		if (tbAttResRsbNorspiList != null && tbAttResRsbNorspiList.size() > 0 && tbAttResRsbNorspiList.get(0).getNum() > 0) {
+		if (tbAttResRsbNorspiList != null && tbAttResRsbNorspiList.size() > 0 && tbAttResRsbNorspiList.get(0).getNum() != null && tbAttResRsbNorspiList.get(0).getNum() > 0) {
 			TbAttResRsbNorspi tbAttResRsbNorspi = tbAttResRsbNorspiList.get(0);
 
-			norSpillwayType = SpillwayTypeEnum.find(tbAttResRsbNorspi.getSpillwayType()).getLabel();
+			if (tbAttResRsbNorspi.getSpillwayType().indexOf("9") > -1) {
+				String [] spillwayTypeStrs = tbAttResRsbNorspi.getSpillwayType().split(",");
+				if (spillwayTypeStrs.length > 1) {
+					norSpillwayType = spillwayTypeStrs[1];
+				} else {
+					norSpillwayType = SpillwayTypeEnum.find(tbAttResRsbNorspi.getSpillwayType()).getLabel();
+				}
+
+			} else {
+				norSpillwayType = SpillwayTypeEnum.find(tbAttResRsbNorspi.getSpillwayType()).getLabel();
+			}
 
 			isLocDamBody = tbAttResRsbNorspi.getIsLocDamBody();
 			norWeirTopElevation = isNullObject(tbAttResRsbNorspi.getWeirTopElevation());
 			norWeirTopWidth = isNullObject(tbAttResRsbNorspi.getWeirTopWidth());
 
-			if (tbAttResRsbNorspi.getIsGate() == "否") {
+			if (null != tbAttResRsbNorspi.getIsGate() && tbAttResRsbNorspi.getIsGate().equals("否")) {
 				norWorkingGateType = "无闸控制";
-			} else if (tbAttResRsbNorspi.getIsGate() == "是") {
+			} else if (null != tbAttResRsbNorspi.getIsGate() && tbAttResRsbNorspi.getIsGate().equals("是")) {
 				// 平板闸门,3X3
 				String typeName = RsbWorkingGateEnum.find(tbAttResRsbNorspi.getWorkingGateType().toString()).getLabel();
-				norWorkingGateType = StringUtil.format("{},{}X{}", typeName, tbAttResRsbNorspi.getGateWide(), tbAttResRsbNorspi.getGateLength());
+				String norwgtStr = "";
+				if (StringUtil.isNotBlank(typeName)) {
+					norwgtStr = typeName;
+				}
+				if (null != tbAttResRsbNorspi.getGateWide()) {
+					if (StringUtil.isNotBlank(typeName)) {
+						norwgtStr += "," + tbAttResRsbNorspi.getGateNum() + "-" + tbAttResRsbNorspi.getGateWide() + "×" + tbAttResRsbNorspi.getGateLength();
+					} else {
+						norwgtStr += tbAttResRsbNorspi.getGateNum() + "-" +  tbAttResRsbNorspi.getGateWide() + "×" + tbAttResRsbNorspi.getGateLength();
+					}
+				}
+//				norWorkingGateType = StringUtil.format("{},{}X{}", typeName, tbAttResRsbNorspi.getGateWide(), tbAttResRsbNorspi.getGateLength());
+				norWorkingGateType = norwgtStr;
 			}
 
 			norCheckingFloodDischarge = isNullObject(tbAttResRsbNorspi.getCheckingFloodDischarge());
-			disEnergyType = isNullObject(tbAttResRsbNorspi.getDisEnergyType());
+			disEnergyType = isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("1")?"挑流消能":
+				isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("2")?"底流消能":
+					isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("3")?"面流消能":
+					isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("4")?"戽流消能":
+					isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("5")?"跌流消能":
+					isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("6")?"孔板消能":
+					isNullObject(tbAttResRsbNorspi.getDisEnergyType()).equals("9")?"其他":"";
 			List<String> list = new ArrayList<>();
 
 
 			String ocType = OcTypeEnum.find(isNullObject(tbAttResRsbNorspi.getOcType())).getLabel();
-			list.add(ocType);
-			list.add(tbAttResRsbNorspi.getOcPower());
-			norOc = String.join(",", list);
+			if (StringUtil.isNotBlank(ocType)) {
+				list.add(ocType);
+			}
+			if (StringUtil.isNotBlank(tbAttResRsbNorspi.getOcPower())) {
+				list.add(tbAttResRsbNorspi.getOcPower());
+			}
+			norOc = String.join(",", list);
 		}
 
 		tableMap.put("norSpillwayType", norSpillwayType);
 		tableMap.put("isLocDamBody", isLocDamBody);
-		tableMap.put("norWeirTopElevation", norWeirTopElevation);
+		tableMap.put("norWeirTopElevation", StringUtils.isEmpty(norWeirTopElevation)?norWeirTopElevation:String.format("%.2f", Double.parseDouble(norWeirTopElevation)));
 		tableMap.put("norWeirTopWidth", norWeirTopWidth);
 		tableMap.put("norWorkingGateType", norWorkingGateType);
 		tableMap.put("norCheckingFloodDischarge", norCheckingFloodDischarge);
@@ -348,7 +417,7 @@
 		String enableStandar = "";
 		String checkingFloodDischarge = "";
 
-		if (tbAttResRsbVerspiList != null && tbAttResRsbVerspiList.size() > 0 && tbAttResRsbVerspiList.get(0).getNum() > 0) {
+		if (tbAttResRsbVerspiList != null && tbAttResRsbVerspiList.size() > 0 && tbAttResRsbVerspiList.get(0).getNum() !=null && tbAttResRsbVerspiList.get(0).getNum() > 0) {
 			TbAttResRsbVerspi tbAttResRsbVerspi = tbAttResRsbVerspiList.get(0);
 
 			verSpillwayType = VerSpillwayTypeEnum.find(tbAttResRsbVerspi.getSpillwayType()).getLabel();
@@ -373,7 +442,7 @@
 		String rsbWorkingGateType = "";
 		String rsbOc = "";
 
-		if (tbAttResRsbSpillwayList != null && tbAttResRsbSpillwayList.size() > 0 && tbAttResRsbSpillwayList.get(0).getNum() > 0) {
+		if (tbAttResRsbSpillwayList != null && tbAttResRsbSpillwayList.size() > 0) {
 			TbAttResRsbSpillway tbAttResRsbSpillway = tbAttResRsbSpillwayList.get(0);
 
 			//类型为其他,有补充说明
@@ -383,21 +452,26 @@
 			coveLength = isNullObject(tbAttResRsbSpillway.getCoveLength());
 			rsbThresholdElevation = isNullObject(tbAttResRsbSpillway.getThresholdElevation());
 			rsbExportElevation = isNullObject(tbAttResRsbSpillway.getExportElevation());
-			rsbSection = StringUtil.format("{}X{}", tbAttResRsbSpillway.getSectionWide(), tbAttResRsbSpillway.getSectionLength());
-			;
+			if (null != tbAttResRsbSpillway.getSectionWide() && null != tbAttResRsbSpillway.getSectionLength())
+				rsbSection = StringUtil.format("{}×{}", tbAttResRsbSpillway.getSectionWide(), tbAttResRsbSpillway.getSectionLength());
+
 			checkFlDisCharge = isNullObject(tbAttResRsbSpillway.getCheckFlDisCharge());
 
 
 			List<String> list = new ArrayList<>();
 			list.add(convertType(tbAttResRsbSpillway.getOcType(), "OcTypeEnum"));
 			list.add(tbAttResRsbSpillway.getOcPower());
-			rsbOc = String.join(",", list);
+			if (StringUtil.isNotBlank(convertType(tbAttResRsbSpillway.getOcType(), "OcTypeEnum")) &&
+			StringUtil.isNotBlank(tbAttResRsbSpillway.getOcPower())) {
+				rsbOc = String.join(",", list);
+			}
+
 		}
 
 
 		tableMap.put("rsbSpillwayType", rsbSpillwayType);
 		tableMap.put("coveLength", coveLength);
-		tableMap.put("rsbThresholdElevation", rsbThresholdElevation);
+		tableMap.put("rsbThresholdElevation", StringUtils.isEmpty(rsbThresholdElevation)?rsbThresholdElevation:String.format("%.2f",Double.parseDouble(rsbThresholdElevation)));
 		tableMap.put("rsbExportElevation", rsbExportElevation);
 		tableMap.put("rsbSection", rsbSection);
 		tableMap.put("checkFlDisCharge", checkFlDisCharge);
@@ -414,77 +488,160 @@
 		String workingGateType = "";
 		String deliverOc = "";
 
-		if (tbAttResWaterDeliveryList != null && tbAttResWaterDeliveryList.size() > 0 && tbAttResWaterDeliveryList.get(0).getNum() > 0) {
-			//取设计流量大的进行描述
-			List<TbAttResWaterDelivery> sortList = tbAttResWaterDeliveryList.stream().sorted((a, b) -> b.getDesignFlow().compareTo(a.getDesignFlow())).collect(Collectors.toList());
-			TbAttResWaterDelivery tbAttResWaterDelivery = sortList.get(0);
+
+		tableMap.put("输水建筑物名称1", "输水建筑物");
+		tableMap.put("输水建筑物名称2", "输水建筑物");
+		tableMap.put("输水建筑物名称3", "输水建筑物");
+
+		for (int i = 0; i < tbAttResWaterDeliveryList.size(); i++) {
+			TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(i);
 
 			aqueductType = convertType(tbAttResWaterDelivery.getAqueductType(), "AqueductTypeEnum");
 			aqueductLength = isNullObject(tbAttResWaterDelivery.getAqueductLength());
 			thresholdElevation = isNullObject(tbAttResWaterDelivery.getThresholdElevation());
 			exportElevation = isNullObject(tbAttResWaterDelivery.getExportElevation());
-			deliverSection = StringUtil.format("{}X{}", tbAttResWaterDelivery.getSectionWide(), tbAttResWaterDelivery.getSectionHigh());
+			if (null != tbAttResWaterDelivery.getSectionHigh())
+				deliverSection = StringUtil.format("{}×{}", tbAttResWaterDelivery.getSectionWide(), tbAttResWaterDelivery.getSectionHigh());
+			else
+				deliverSection = StringUtil.format("φ{}", tbAttResWaterDelivery.getSectionWide());
 			designFlow = isNullObject(tbAttResWaterDelivery.getDesignFlow());
-			workingGateType = tbAttResWaterDelivery.getWorkingGateType();
+			workingGateType = convertType(tbAttResWaterDelivery.getWorkingGateType(), "RsbWorkingGateEnum");
 			List<String> list = new ArrayList<>();
-			list.add(tbAttResWaterDelivery.getOcType());
-			list.add(tbAttResWaterDelivery.getOcPower());
-			deliverOc = String.join(",", list);
-		}
-		tableMap.put("aqueductType", aqueductType);
-		tableMap.put("aqueductLength", aqueductLength);
-		tableMap.put("thresholdElevation", thresholdElevation);
-		tableMap.put("exportElevation", exportElevation);
-		tableMap.put("deliverSection", deliverSection);
-		tableMap.put("designFlow", designFlow);
-		tableMap.put("workingGateType", workingGateType);
-		tableMap.put("deliverOc", deliverOc);
+			list.add(convertType(tbAttResWaterDelivery.getOcType(), "SpillwayHoleType"));
+			list.add(convertType(tbAttResWaterDelivery.getOcPower(), "SpillwayHoleType"));
+			deliverOc = String.join(",", list);
 
+			if (i == 0) {
+				tableMap.put("输水建筑物名称1", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName());
+				tableMap.put("aqueductType1", aqueductType);
+				tableMap.put("aqueductLength1", aqueductLength);
+				tableMap.put("thresholdElevation1",  StringUtils.isEmpty(thresholdElevation)?thresholdElevation:String.format("%.2f",Double.parseDouble(thresholdElevation)));
+				tableMap.put("exportElevation1", exportElevation);
+				tableMap.put("deliverSection1", deliverSection);
+				tableMap.put("designFlow1", designFlow);
+				tableMap.put("workingGateType1", workingGateType);
+				tableMap.put("deliverOc1", deliverOc);
+			}
+			else if (i == 1) {
+				tableMap.put("输水建筑物名称2", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName());
+				tableMap.put("aqueductType2", aqueductType);
+				tableMap.put("aqueductLength2", aqueductLength);
+				tableMap.put("thresholdElevation2",  StringUtils.isEmpty(thresholdElevation)?thresholdElevation:String.format("%.2f",Double.parseDouble(thresholdElevation)));
+				tableMap.put("exportElevation2", exportElevation);
+				tableMap.put("deliverSection2", deliverSection);
+				tableMap.put("designFlow2", designFlow);
+				tableMap.put("workingGateType2", workingGateType);
+				tableMap.put("deliverOc2", deliverOc);
+			}
+			else if (i == 3) {
+				tableMap.put("输水建筑物名称3", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName());
+				tableMap.put("aqueductType3", aqueductType);
+				tableMap.put("aqueductLength3", aqueductLength);
+				tableMap.put("thresholdElevation3",  StringUtils.isEmpty(thresholdElevation)?thresholdElevation:String.format("%.2f",Double.parseDouble(thresholdElevation)));
+				tableMap.put("exportElevation3", exportElevation);
+				tableMap.put("deliverSection3", deliverSection);
+				tableMap.put("designFlow3", designFlow);
+				tableMap.put("workingGateType3", workingGateType);
+				tableMap.put("deliverOc3", deliverOc);
+			}
+		}
+
+//		if (tbAttResWaterDeliveryList != null && tbAttResWaterDeliveryList.size() > 0 && tbAttResWaterDeliveryList.get(0).getNum() > 0) {
+//			//取设计流量大的进行描述   2024-07-18取消,修改为展示3个列表 ,没有空着
+////			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());
+//
+//			TbAttResWaterDelivery tbAttResWaterDelivery = tbAttResWaterDeliveryList.get(0);
+//
+//			aqueductType = convertType(tbAttResWaterDelivery.getAqueductType(), "AqueductTypeEnum");
+//			aqueductLength = isNullObject(tbAttResWaterDelivery.getAqueductLength());
+//			thresholdElevation = isNullObject(tbAttResWaterDelivery.getThresholdElevation());
+//			exportElevation = isNullObject(tbAttResWaterDelivery.getExportElevation());
+//			deliverSection = StringUtil.format("{}×{}", tbAttResWaterDelivery.getSectionWide(), tbAttResWaterDelivery.getSectionHigh());
+//			designFlow = isNullObject(tbAttResWaterDelivery.getDesignFlow());
+//			workingGateType = tbAttResWaterDelivery.getWorkingGateType();
+//			List<String> list = new ArrayList<>();
+//			list.add(tbAttResWaterDelivery.getOcType());
+//			list.add(tbAttResWaterDelivery.getOcPower());
+//			deliverOc = String.join(",", list);
+//
+//			tableMap.put("输水建筑物名称1", StringUtil.isBlank(tbAttResWaterDelivery.getName())?"输水建筑物":tbAttResWaterDelivery.getName());
+//
+//		}
 
 		//水电站
 		String plantLayoutType = "";
 		String installedCapacity = "";
 		String yearAvgHour = "";
-		//当电站列表不为空 且 电站列表数量大于0 且num大于0
-		if (tbAttResPowerStationList != null && tbAttResPowerStationList.size() > 0 && tbAttResPowerStationList.get(0).getNum() > 0) {
-			TbAttResPowerStation tbAttResPowerStation = tbAttResPowerStationList.get(0);
+		//当电站列表不为空 且 电站列表数量大于0 且num大于0  -- 2024-07-18修改,展示多个
+//		if (tbAttResPowerStationList != null && tbAttResPowerStationList.size() > 0 && tbAttResPowerStationList.get(0).getNum()!=null && tbAttResPowerStationList.get(0).getNum() > 0) {
+//			TbAttResPowerStation tbAttResPowerStation = tbAttResPowerStationList.get(0);
+//
+//			//取第一个电站
+//			plantLayoutType = PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel();
+//			installedCapacity = isNullObject(tbAttResPowerStation.getInstalledCapacity());
+//			yearAvgHour = isNullObject(tbAttResPowerStation.getYearAvgHour());
+//		}
 
-			//取第一个电站
-			plantLayoutType = PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel();
-			installedCapacity = isNullObject(tbAttResPowerStation.getInstalledCapacity());
-			yearAvgHour = isNullObject(tbAttResPowerStation.getYearAvgHour());
+		for (int i=0;i < tbAttResPowerStationList.size(); i++) {
+			TbAttResPowerStation tbAttResPowerStation = tbAttResPowerStationList.get(i);
+			if (StringUtil.isBlank(plantLayoutType)) {
+				plantLayoutType = PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel();
+			} else {
+				plantLayoutType = plantLayoutType + "、" + PlantLayoutTypeEnum.find(tbAttResPowerStation.getPlantLayoutType()).getLabel();
+			}
+
+			if (StringUtil.isBlank(installedCapacity)) {
+				installedCapacity = WordUtil.removeTrailingZero(isNullObject(tbAttResPowerStation.getInstalledCapacity()));
+			} else {
+				installedCapacity = installedCapacity + "+" + WordUtil.removeTrailingZero(isNullObject(tbAttResPowerStation.getInstalledCapacity()));
+			}
+
+			if (StringUtil.isBlank(yearAvgHour)) {
+				yearAvgHour = WordUtil.removeTrailingZero(isNullObject(tbAttResPowerStation.getYearAvgHour()));
+			} else {
+				yearAvgHour = yearAvgHour + "、" + WordUtil.removeTrailingZero(isNullObject(tbAttResPowerStation.getYearAvgHour()));
+			}
 		}
+
 		tableMap.put("plantLayoutType", plantLayoutType);
-		tableMap.put("installedCapacity", installedCapacity);
-		tableMap.put("yearAvgHour", yearAvgHour);
+		tableMap.put("installedCapacity", !installedCapacity.equals("0")?installedCapacity:"");
+		tableMap.put("yearAvgHour", !yearAvgHour.equals("0")?yearAvgHour:"");
 
 		//水库效益
 		List<String> protectList = new ArrayList<>();
 
-		if (!tbAttResEngBene.getCity().equals("无") ) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getCity().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getCity())) {
 			protectList.add(tbAttResEngBene.getCity());
 
 		}
-		if (!tbAttResEngBene.getTown().equals("无")) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getTown().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getTown())) {
 			protectList.add(tbAttResEngBene.getTown());
 		}
-		if (!tbAttResEngBene.getRailway().equals("无")) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getRailway().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getRailway())) {
 			protectList.add(tbAttResEngBene.getRailway());
 		}
 
-		if (!tbAttResEngBene.getHighway().equals("无")) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getHighway().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getHighway())) {
 			protectList.add(tbAttResEngBene.getHighway());
 		}
 
-		if (!tbAttResEngBene.getImportCommunication().equals("无")) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getImportCommunication().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getImportCommunication())) {
 			protectList.add(tbAttResEngBene.getImportCommunication());
 		}
 
-		if (!tbAttResEngBene.getImportFactory().equals("无")) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getImportFactory().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getImportFactory())) {
 			protectList.add(tbAttResEngBene.getImportFactory());
 		}
 
-		if (!tbAttResEngBene.getImportOtherFac().equals("无")) {
+		if (tbAttResEngBene!=null &&!tbAttResEngBene.getImportOtherFac().equals("无") && StringUtil.isNotBlank(tbAttResEngBene.getImportOtherFac())) {
 			protectList.add(tbAttResEngBene.getImportOtherFac());
 		}
 		//只留前四个
@@ -496,50 +653,56 @@
 			tableMap.put("protect", String.join("、", protectList));
 		}
 		double person = 0;
-		if (tbAttResEngBene.getFlControlPerson() != null) {
+		if (tbAttResEngBene !=null && tbAttResEngBene.getFlControlPerson() != null && tbAttResEngBene.getFlControlPerson() > 0 ) {
 			person = tbAttResEngBene.getFlControlPerson() / 10000.0;
+			tableMap.put("flControlPerson", WordUtil.removeTrailingZero(String.format("%.2f", person)));
+		} else {
+			tableMap.put("flControlPerson", "");
 		}
+		tableMap.put("flControlLand", tbAttResEngBene==null?"":tbAttResEngBene.getFlControlLand()==null || tbAttResEngBene.getFlControlLand() <= 0?"":
+			WordUtil.removeTrailingZero(String.format("%.2f", tbAttResEngBene.getFlControlLand() / 10000)));
+		tableMap.put("irrObject", tbAttResEngBene==null?"":tbAttResEngBene.getIrrObject()==null?"":tbAttResEngBene.getIrrObject());
+		tableMap.put("moyearIrrAvg", tbAttResEngBene==null?"":tbAttResEngBene.getMoyearIrrAvg() == null?"":
+			WordUtil.removeTrailingZero(tbAttResEngBene.getMoyearIrrAvg().toString()));
+		tableMap.put("desIrrArea", tbAttResEngBene==null?"":tbAttResEngBene.getDesIrrArea() == null ?"":
+			WordUtil.removeTrailingZero(String.format("%.2f", tbAttResEngBene.getDesIrrArea() / 10000)));
+		tableMap.put("checIrrArea", tbAttResEngBene==null?"":tbAttResEngBene.getChecIrrArea()==null?"":
+			WordUtil.removeTrailingZero(String.format("%.2f", tbAttResEngBene.getChecIrrArea() / 10000)));
+		tableMap.put("supplyObject", tbAttResEngBene==null?"":tbAttResEngBene.getSupplyObject()==null?"":
+			tbAttResEngBene.getSupplyObject());
 
-		tableMap.put("flControlPerson", String.format("%.2f", person));
-		tableMap.put("flControlLand", tbAttResEngBene.getFlControlLand());
-		tableMap.put("irrObject", tbAttResEngBene.getIrrObject());
-		tableMap.put("moyearIrrAvg", tbAttResEngBene.getMoyearIrrAvg());
-		tableMap.put("desIrrArea", tbAttResEngBene.getDesIrrArea());
-		tableMap.put("checIrrArea", tbAttResEngBene.getChecIrrArea());
-		tableMap.put("supplyObject", tbAttResEngBene.getSupplyObject());
-
-		Double sup = 0.0;
-		String supS = "";
-		if (StringUtil.isNotBlank(tbAttResEngBene.getSupplyPopulation())) {
-			sup = Double.parseDouble(tbAttResEngBene.getSupplyPopulation()) / 10000;
-			supS = String.format("%.2f", sup);
-		}
+//		Double sup = 0.0;
+//		String supS = "";
+//		if (tbAttResEngBene!=null && StringUtil.isNotBlank(tbAttResEngBene.getSupplyPopulation())) {
+//			sup = Double.parseDouble(tbAttResEngBene.getSupplyPopulation());
+//			supS = String.format("%.2f", sup);
+//		}
 
 
-		tableMap.put("supplyPopulation", supS);
-		tableMap.put("moyearSupplyAvg", tbAttResEngBene.getMoyearSupplyAvg());
-		tableMap.put("moyearPowerAvg", tbAttResEngBene.getMoyearPowerAvg());
-		tableMap.put("ecologicalFlow", tbAttResEngBene.getEcologicalFlow());
+		tableMap.put("supplyPopulation", tbAttResEngBene==null?"":tbAttResEngBene.getSupplyPopulation()==null?"":tbAttResEngBene.getSupplyPopulation());
+		tableMap.put("moyearSupplyAvg", tbAttResEngBene==null?"":tbAttResEngBene.getMoyearSupplyAvg()==null?"":tbAttResEngBene.getMoyearSupplyAvg());
+		tableMap.put("moyearPowerAvg", tbAttResEngBene==null?"":tbAttResEngBene.getMoyearPowerAvg()==null?"":tbAttResEngBene.getMoyearPowerAvg());
+		tableMap.put("ecologicalFlow", tbAttResEngBene==null?"":tbAttResEngBene.getEcologicalFlow()==null?"":tbAttResEngBene.getEcologicalFlow());
 
 		//工程管理
-		tableMap.put("munitName", tbAttResMgrSysB.getMUnitName());
-		tableMap.put("cunitName", tbAttResMgrSysB.getCUnitName());
-		tableMap.put("mUnitNature", tbAttResMgrSysB.getMUnitNature());
-		tableMap.put("mUnitPersonNumber", tbAttResMgrSysB.getMUnitPersonNumber());
-		tableMap.put("personEconomicSource", tbAttResMgrSysB.getPersonEconomicSource());
-		tableMap.put("maintenanceEconomicSource", tbAttResMgrSysB.getMaintenanceEconomicSource());
+		tableMap.put("munitName", tbAttResMgrSysB==null?"":tbAttResMgrSysB.getMUnitName()==null?"":tbAttResMgrSysB.getMUnitName());
+		tableMap.put("cunitName", tbAttResMgrSysB==null?"":tbAttResMgrSysB.getCUnitName()==null?"":tbAttResMgrSysB.getCUnitName());
+		tableMap.put("mUnitNature", tbAttResMgrSysB==null?"":tbAttResMgrSysB.getMUnitNature()==null?"":tbAttResMgrSysB.getMUnitNature());
+		tableMap.put("mUnitPersonNumber", tbAttResMgrSysB==null?"":tbAttResMgrSysB.getMUnitPersonNumber()==null?"":tbAttResMgrSysB.getMUnitPersonNumber());
+		tableMap.put("personEconomicSource", tbAttResMgrSysB==null?"":tbAttResMgrSysB.getPersonEconomicSource()==null?"":tbAttResMgrSysB.getPersonEconomicSource());
+		tableMap.put("maintenanceEconomicSource", tbAttResMgrSysB==null?"":tbAttResMgrSysB.getMaintenanceEconomicSource()==null?"":tbAttResMgrSysB.getMaintenanceEconomicSource());
 
 		//工程运用
-		tableMap.put("resMaxStag", tbAttResProjectUtilize.getResMaxStag());
-		tableMap.put("resMinStag", tbAttResProjectUtilize.getResMinStag());
-		tableMap.put("resMaxInFlow", tbAttResProjectUtilize.getResMaxInFlow());
-		tableMap.put("resMaxOutFlow", tbAttResProjectUtilize.getResMaxOutFlow());
+		tableMap.put("resMaxStag", tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMaxStag());
+		tableMap.put("resMinStag", tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMinStag());
+		tableMap.put("resMaxInFlow", tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMaxInFlow());
+		tableMap.put("resMaxOutFlow", tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMaxOutFlow());
 		//new SimpleDateFormat("yyyy-MM-dd").format(tbAttResProjectUtilize.getResMaxStagDate())
 
-		String resMaxStagDate = tbAttResProjectUtilize.getResMaxStagDate() != null ? new SimpleDateFormat("yyyy-MM-dd").format(tbAttResProjectUtilize.getResMaxStagDate()) : "";
-		String resMinStagDate = tbAttResProjectUtilize.getResMinStagDate() != null ? new SimpleDateFormat("yyyy-MM-dd").format(tbAttResProjectUtilize.getResMinStagDate()) : "";
-		String resMaxInFlowDate = tbAttResProjectUtilize.getResMaxInFlowDate() != null ? new SimpleDateFormat("yyyy-MM-dd").format(tbAttResProjectUtilize.getResMaxInFlowDate()) : "";
-		String resMaxOutFlowDate = tbAttResProjectUtilize.getResMaxOutFlowDate() != null ? new SimpleDateFormat("yyyy-MM-dd").format(tbAttResProjectUtilize.getResMaxOutFlowDate()) : "";
+		String resMaxStagDate = tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMaxStagDate() != null ? new SimpleDateFormat("yyyy年MM月dd日").format(tbAttResProjectUtilize.getResMaxStagDate()) : "";
+		String resMinStagDate = tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMinStagDate() != null ? new SimpleDateFormat("yyyy年MM月dd日").format(tbAttResProjectUtilize.getResMinStagDate()) : "";
+		String resMaxInFlowDate = tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMaxInFlowDate() != null ? new SimpleDateFormat("yyyy年MM月dd日").format(tbAttResProjectUtilize.getResMaxInFlowDate()) : "";
+		String resMaxOutFlowDate = tbAttResProjectUtilize == null? "" :tbAttResProjectUtilize.getResMaxOutFlowDate() != null ? new SimpleDateFormat("yyyy年MM月dd日").format(tbAttResProjectUtilize.getResMaxOutFlowDate()) : "";
 		tableMap.put("resMaxStagDate", resMaxStagDate);
 		tableMap.put("resMinStagDate", resMinStagDate);
 		tableMap.put("resMaxInFlowDate", resMaxInFlowDate);
@@ -554,9 +717,10 @@
 		tableMap.put("isWmst", InfoBuildingEnum.find(tbAttResInformationProject.getIsWmst()).getLabel());
 		tableMap.put("isTermites", InfoBuildingEnum.find(tbAttResInformationProject.getIsTermites()).getLabel());
 		//
-		String tm = tbAttResSafetyMonitor.getSafetyAppraisalTime() != null ? new SimpleDateFormat("yyyy-MM-dd").format(tbAttResSafetyMonitor.getSafetyAppraisalTime()) : "";
+		String tm = tbAttResSafetyMonitor==null?"":tbAttResSafetyMonitor.getSafetyAppraisalTime() != null ? new SimpleDateFormat("yyyy年MM月dd日").format(tbAttResSafetyMonitor.getSafetyAppraisalTime()) : "";
 		tableMap.put("safetyAppraisalTime", tm);
-		tableMap.put("safetyAppraisalResult", tbAttResSafetyMonitor.getSafetyAppraisalResult());
+		tableMap.put("safetyAppraisalResult", tbAttResSafetyMonitor==null?"":tbAttResSafetyMonitor.getSafetyAppraisalResult()==null?"":tbAttResSafetyMonitor.getSafetyAppraisalResult()
+			.replace("1","一类坝").replace("2","二类坝").replace("3","三类坝"));
 
 
 		return tableMap;
@@ -564,32 +728,76 @@
 
 
 	@Override
-	public List<TotalInfo> getTotalInfo() {
-		JSONObject ztData = this.getZtData(null, RIBAO_SHEET1_TOTAL_URL);
+	public List<TotalInfo> getTotalInfo(String isShow) {
+		JSONObject ztData = this.getZtData("&is_show="+isShow, RIBAO_SHEET1_TOTAL_URL);
 		JSONArray data = ztData.getJSONArray("data");
 		List<TotalInfo> list = data.toJavaList(TotalInfo.class);
 		return list;
 	}
 
 	@Override
-	public List<DzkInfo> getDzkInfo() {
-		JSONObject ztData = this.getZtData(null, RIBAO_SHEET2_ZDX_URL);
+	public List<TotalInfo> getTotalOverInfo(String isShow, HashMap<String, String> map) {
+
+		String params = "&is_show=" + isShow;
+		if (map != null){
+			for (Map.Entry<String, String> entry : map.entrySet()){
+				String key=entry.getKey();
+				String vlaue = entry.getValue();
+
+				String p = StringUtil.format("&{}={}",key,vlaue);
+				params +=p;
+			}
+		}
+
+		JSONObject ztData = this.getZtData(params, RIBAO_SHEET1_OVER_NORM_POOL_STAG);
+		JSONArray data = ztData.getJSONArray("data");
+		List<TotalInfo> list = data.toJavaList(TotalInfo.class);
+		return list;
+
+	}
+
+	@Override
+	public void getReservoirRainfallForecast(List<String> dayIndexList) {
+		List<StResRainfall> stResRainfalls = new ArrayList<>();
+		for (String dayIndex : dayIndexList) {
+			List<AttResWithRainfall> attResByRainfall = attResBase.getAttResByRainfall(null, null, dayIndex);
+			for (AttResWithRainfall attResWithRainfall : attResByRainfall) {
+				StResRainfall stResRainfall = new StResRainfall();
+				stResRainfall.setId(UUID.randomUUID().toString().replaceAll("-", ""));
+				stResRainfall.setResCd(attResWithRainfall.getCode());
+				stResRainfall.setDrp(attResWithRainfall.getRainfall());
+				stResRainfall.setFileName(attResWithRainfall.getFileName());
+				stResRainfall.setDayIndex(dayIndex);
+				stResRainfall.setCreateTime(new Date());
+				stResRainfalls.add(stResRainfall);
+			}
+		}
+		if (!stResRainfalls.isEmpty()) {
+			stResRainfallService.remove(Wrappers.<StResRainfall>query().lambda());
+			stResRainfallService.saveBatch(stResRainfalls);
+		}
+	}
+
+
+	@Override
+	public List<DzkInfo> getDzkInfo(String isShow) {
+		JSONObject ztData = this.getZtData("&is_show="+isShow, RIBAO_SHEET2_ZDX_URL);
 		JSONArray data = ztData.getJSONArray("data");
 		List<DzkInfo> list = data.toJavaList(DzkInfo.class);
 		return list;
 	}
 
 	@Override
-	public List<OverDetail> getOverDetailInfo() {
-		JSONObject ztData = this.getZtData(null, RIBAO_SHEET3_OVER_STAG_LIST_URL);
+	public List<OverDetail> getOverDetailInfo(String isShow) {
+		JSONObject ztData = this.getZtData("&is_show="+isShow, RIBAO_SHEET3_OVER_STAG_LIST_URL);
 		JSONArray data = ztData.getJSONArray("data");
 		List<OverDetail> list = data.toJavaList(OverDetail.class);
 		return list;
 	}
 
 	@Override
-	public List<SzInfo> getSzInfo() {
-		JSONObject ztData = this.getZtData(null, SZ_INFO);
+	public List<SzInfo> getSzInfo(String isShow) {
+		JSONObject ztData = this.getZtData("?is_show="+isShow, SZ_INFO);
 		JSONArray data = ztData.getJSONArray("data");
 		List<SzInfo> list = data.toJavaList(SzInfo.class);
 		return list;
@@ -1051,37 +1259,45 @@
 
 
 	private String convertType(String type, String enumName) {
+		if (StringUtil.isBlank(type)) {
+			return "";
+		}
+
 		String text = "";
 
 		List<String> typeList = Arrays.asList(type.split(","));
-		String typeKey = typeList.get(0);
-		String explain = "";
-		if (typeList.size() > 1) {
-			explain = typeList.get(1);
-		}
-
-		//key值表示其他
-		if (typeKey.equals("9") || typeKey.equals("其他")) {
-			text = explain;
-		} else {
-			switch (enumName) {
-				case "AqueductTypeEnum":
-					text = AqueductTypeEnum.find(typeKey).getLabel();
-					break;
-				case "RsbWorkingGateEnum":
-					text = RsbWorkingGateEnum.find(typeKey).getLabel();
-					break;
-				case "OcTypeEnum":
-					text = OcTypeEnum.find(typeKey).getLabel();
-					break;
-				case "SpillwayHoleType":
-					text = typeKey;
-					break;
-				case "Explain":
-					text = typeKey;
-					break;
+		if (typeList.size() >0) {
+			String typeKey = typeList.get(0);
+			String explain = "";
+			if (typeList.size() > 1) {
+				explain = typeList.get(1);
+			}
+			//key值表示其他
+			if (typeKey.equals("9") || typeKey.equals("其他")) {
+				text = explain;
+			} else {
+				switch (enumName) {
+					case "AqueductTypeEnum":
+						text = AqueductTypeEnum.find(typeKey).getLabel();
+						break;
+					case "RsbWorkingGateEnum":
+						text = RsbWorkingGateEnum.find(typeKey).getLabel();
+						break;
+					case "OcTypeEnum":
+						text = OcTypeEnum.find(typeKey).getLabel();
+						break;
+					case "SpillwayHoleType":
+						text = typeKey;
+						break;
+					case "Explain":
+						text = typeKey;
+						break;
+				}
 			}
 		}
+
+
+
 
 		return text;
 	}
@@ -1094,14 +1310,16 @@
 		// 获取环境
 		String activeProfile = SpringContextUtil.getActiveProfile();
 		if (activeProfile.equals("dev")) {
-			url = ZtApiUrlConstant.url_prefix_dev + url;
+			url = ZtApiUrlConstant.url_prefix_dev + url + params;
 		}
 		if (activeProfile.equals("prod")) {
-			url = ZtApiUrlConstant.url_prefix_prod + url;
+			url = ZtApiUrlConstant.url_prefix_prod + url + params;
 		}
 		if (activeProfile.equals("test")) {
-			url = ZtApiUrlConstant.url_prefix_test + url;
+			url = ZtApiUrlConstant.url_prefix_test + url + params;
 		}
+
+		log.info("请求url地址:{}", url);
 		//设置请求头
 		HttpHeaders headers = new HttpHeaders();
 		headers.add(ZtConfigConstant.header_key, ZtConfigConstant.header_value);

--
Gitblit v1.9.3