From 66b6ca1dbf671cc05df3ab764e1a3e66dcd3390a Mon Sep 17 00:00:00 2001
From: liangyb <liangwryytdzq@163.com>
Date: Wed, 12 Jun 2024 09:49:54 +0800
Subject: [PATCH] =?UTF-8?q?#272=20=E5=88=87=E6=8D=A2=E5=90=AB=E7=A8=8E?=
 =?UTF-8?q?=E4=B8=8D=E5=90=AB=E7=A8=8E=E5=AF=BC=E8=87=B4=E7=95=8C=E9=9D=A2?=
 =?UTF-8?q?=E6=8A=A5=E5=91=8A=E6=9C=89=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 OBE-CONFIG/config_final.properties            |  2 +-
 .../obe/report/dataset/word/BaseDateSet.java  |  8 +---
 .../word/JingNengEvaluationReportDataSet.java | 40 ++++++++++++++++++-
 .../common/file/utils/ParsingXmlUtils.java    |  4 +-
 4 files changed, 44 insertions(+), 10 deletions(-)

diff --git a/OBE-CONFIG/config_final.properties b/OBE-CONFIG/config_final.properties
index e615f072..84184b66 100644
--- a/OBE-CONFIG/config_final.properties
+++ b/OBE-CONFIG/config_final.properties
@@ -1,5 +1,5 @@
 #\u7cfb\u7edf\u7248\u672c
-version=OBEV7.7.9.
+version=OBEV7.7.9.20240611
 keyCharacter=
 #\u6b63\u5f0f\u7248\u672c\u68c0\u67e5\u5347\u7ea7\u7f16\u7801
 versionUpdateType=OBE_FinalService
diff --git a/OBE-REPORT/src/com/gx/obe/report/dataset/word/BaseDateSet.java b/OBE-REPORT/src/com/gx/obe/report/dataset/word/BaseDateSet.java
index 982a0d1b..8d179bb0 100644
--- a/OBE-REPORT/src/com/gx/obe/report/dataset/word/BaseDateSet.java
+++ b/OBE-REPORT/src/com/gx/obe/report/dataset/word/BaseDateSet.java
@@ -285,8 +285,6 @@ public abstract class BaseDateSet implements IWordDataSet{
 				if(wordTable.isCross()){
 					if(null != wordTable.getRowList()){
 						assembleListDataSet(wordTable.getRowList(), wordTable.getParams());
-					}else if(null != wordTable.getColList()){
-						assembleListDataSet(wordTable.getRowList(), wordTable.getParams());
 					}
 				}else{
 					if(null != wordTable.getRowList()){
@@ -824,7 +822,6 @@ public abstract class BaseDateSet implements IWordDataSet{
   		String[] fields;
   		if(isStruct) {
   			fields = new String[] {
-  		            "投标人名称 &&supplierName0",
   		            "开标价格 --(含税)&&bidPrice0",
   		            "开标价格 --(不含税)&&bidPrice1",
   		            "修正后投标报价(含税)&&evaluationPrice0",
@@ -836,7 +833,6 @@ public abstract class BaseDateSet implements IWordDataSet{
   		        };
   		}else {
   			fields = new String[] {
-  		            "投标人名称&&supplierName0",
   		            "开标价格 --&&bidPrice0",
   		            "修正后投标报价&&evaluationPrice0",
   		            "修正原因&&modifyReason0",
@@ -891,7 +887,7 @@ public abstract class BaseDateSet implements IWordDataSet{
 						supplierMap.put("priceFinalScore", BigDecimalUtils.round(ObjectUtils.getObjBigDecimal(supplierMap.get("priceFinalScore")), 2));
 						evaluationPriceSupplierList.add(supplierMap);
 					}
-					String unit = supplierMapList.size() > 0 ? (String)((Map<String, Object>) supplierMapList.get(0).get("supplierOpeningResult")).get("priceUnit") : null;
+					String unit =  supplierMapList.size() > 0 && supplierMapList.get(0).get("supplierOpeningResult") != null ? (String)((Map<String, Object>) supplierMapList.get(0).get("supplierOpeningResult")).get("priceUnit") : null;
 					tableColList = getTableColNameList(fields, unit);
 					getStructCrossData(tableColList, supplierMapList);
 					reportDataSet.put("tableColList", tableColList);
@@ -910,7 +906,7 @@ public abstract class BaseDateSet implements IWordDataSet{
         List<Map<String, Object>> factorList = new ArrayList<Map<String, Object>>();
         int index = 1;
         for(String field : fields){
-        	if(field.contains("--")) {
+        	if(field.contains("--") && unit != null) {
         		field = field.replaceAll("--", unit);
         	}
             Map<String, Object> colMap = new HashMap<String, Object>();
diff --git a/OBE-REPORT/src/com/gx/obe/report/dataset/word/JingNengEvaluationReportDataSet.java b/OBE-REPORT/src/com/gx/obe/report/dataset/word/JingNengEvaluationReportDataSet.java
index eaf17f57..0378ad9e 100644
--- a/OBE-REPORT/src/com/gx/obe/report/dataset/word/JingNengEvaluationReportDataSet.java
+++ b/OBE-REPORT/src/com/gx/obe/report/dataset/word/JingNengEvaluationReportDataSet.java
@@ -11,6 +11,9 @@ import java.util.Random;
 import java.util.UUID;
 import java.util.stream.Collectors;
 
+import org.dom4j.Document;
+import com.gx.obe.common.file.enumeration.FileConstants;
+import com.gx.obe.common.file.utils.ParsingXmlUtils;
 import com.gx.obe.business.entity.SupplierEvaluationStep;
 import com.gx.obe.business.entity.Worker;
 import com.gx.obe.business.enumeration.ExpertEnum;
@@ -20,6 +23,7 @@ import com.gx.obe.components.core.enumeration.EvaluationStepEnum;
 import com.gx.obe.components.core.enumeration.TenderProjectEnum;
 import com.gx.obe.components.core.util.MoneyUtils;
 import com.gx.obe.formula.PriceParam;
+import com.gx.obe.message.Messages;
 import com.gx.obe.report.utils.Bean2MapUtils;
 import com.gx.obe.util.utils.BigDecimalUtils;
 import com.gx.obe.util.utils.ListSortUtils;
@@ -37,6 +41,7 @@ import com.gx.obe.web.entity.price.BidPrice;
 import com.gx.obe.web.entity.price.BidPriceResult;
 import com.gx.obe.web.entity.tender.TenderProjectEntity;
 import com.report.word.WordTemplate;
+import com.gx.obe.util.utils.XmlUtils;
 
 public class JingNengEvaluationReportDataSet extends BaseDateSet {
 	
@@ -774,15 +779,25 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet {
 	private void getFactorMessage() {
 		EvaluationFactor evaluationFactor =evaluationFactorService.getPriceEvaluationFactor(tenderProject.getId());
 		String formula = null;
+		String evalStructMessage = null;
 		PriceParam priceParam =null;
 		if(evaluationFactor != null) {
 		priceParam = PriceParam.deserializePriceParam(evaluationFactor.getComputerParams());
+		
 		}
 		if (priceParam != null) {
 			String separator=System.getProperty("line.separator");
 			formula = priceParam.getFormula();
+			evalStructMessage = priceParam.getEvalStructMessage();
 		}
 		if (!StringUtils.isEmpty(formula)) {
+			boolean isStruct = parserStructProject();
+			if (!StringUtils.isEmpty(evalStructMessage) && isStruct) {
+				formula = formula + "\n\n" + Messages.EvalExplainPrice + ":" + evalStructMessage + "\n\n" + Messages.BidExplainPrice + ":"+  evaluationFactor.getMemo();
+			}
+			if(!StringUtils.isEmpty(evaluationFactor.getMemo()) && !isStruct) {
+				formula = formula + "\n\n" + Messages.EvalExplain + ":" + evaluationFactor.getMemo();
+			}
 			reportDataSet.putParam("formula", formula);
 		} 
 		//获取商务技术打分权重
@@ -804,5 +819,28 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet {
 				reportDataSet.putParam("priWeight", step.getScore());
 				}
 			}
-}
+	}
+	
+	public boolean parserStructProject() {
+		// 获得招标文件的指标Document
+		Document factorDoc = XmlUtils.getXmlDocument(FileConstants.getBiddingFilePath(tenderProject.getId()) + FileConstants.PST_XML);
+		// 未找到招标文件的指标,则获得投标文件的指标。
+		if(null == factorDoc){
+			// 获得投标人集合
+			List<Supplier> supplierList = supplierService.getSupplierOpenBidList(tenderProject.getId());
+			if(null != supplierList && supplierList.size() > 0){
+				// 遍历投标人信息
+				for(Supplier supplier : supplierList){
+					if(null != factorDoc){
+						break;
+					}
+					// 获得投标人投标文件下的指标路径
+					String supplierFactorXmlPath = FileConstants.getBidFilePath(tenderProject.getId(), supplier.getId()) + FileConstants.PST_XML;
+					// 获得投标文件的指标Document
+					factorDoc = XmlUtils.getXmlDocument(supplierFactorXmlPath);
+				}
+			}
+		}
+		 return factorDoc == null ? false:ParsingXmlUtils.parsingDocStructXML(factorDoc);	 
+	}
 }
diff --git a/com.gx.obe.common.file/src/com/gx/obe/common/file/utils/ParsingXmlUtils.java b/com.gx.obe.common.file/src/com/gx/obe/common/file/utils/ParsingXmlUtils.java
index f8eedfe7..114714fe 100644
--- a/com.gx.obe.common.file/src/com/gx/obe/common/file/utils/ParsingXmlUtils.java
+++ b/com.gx.obe.common.file/src/com/gx/obe/common/file/utils/ParsingXmlUtils.java
@@ -486,9 +486,9 @@ public class ParsingXmlUtils {
         Element rootElement = factorDoc.getRootElement();
         
      // 查找 isTemplate 元素
-        Element isTemplateElement = rootElement.element("isTemplate");
+        Element isTemplateElement = rootElement.element("isNewVersionFile");
         if (isTemplateElement != null) {
-            return Boolean.parseBoolean(isTemplateElement.getText());
+            return isTemplateElement.getText().equals("01");
         }
         return false;
 	}
-- 
2.24.1