Commit 980abb0b authored by liangyb's avatar liangyb

#20240816 评标管理-生成报表-评标报告适配非结构化模板

parent 6893c115
...@@ -24,6 +24,8 @@ public class PlatformUtils { ...@@ -24,6 +24,8 @@ public class PlatformUtils {
LOG.error(classPath, e); LOG.error(classPath, e);
} catch (ClassNotFoundException e) { } catch (ClassNotFoundException e) {
LOG.error(classPath, e); LOG.error(classPath, e);
} catch (NullPointerException e) {
LOG.error(classPath, e);
} }
} }
return object; return object;
......
#\u7cfb\u7edf\u7248\u672c #\u7cfb\u7edf\u7248\u672c
version=OBEV7.7.9.20240801 version=OBEV7.7.9.20240816
keyCharacter= keyCharacter=
#\u6b63\u5f0f\u7248\u672c\u68c0\u67e5\u5347\u7ea7\u7f16\u7801 #\u6b63\u5f0f\u7248\u672c\u68c0\u67e5\u5347\u7ea7\u7f16\u7801
versionUpdateType=OBE_FinalService versionUpdateType=OBE_FinalService
......
#\u7cfb\u7edf\u7248\u672c #\u7cfb\u7edf\u7248\u672c
version=OBEV7.7.9.20240801 version=OBEV7.7.9.20240816
keyCharacter=g keyCharacter=g
versionUpdateType=OBE_Service versionUpdateType=OBE_Service
#\u6d4b\u8bd5\u7ad9\u4e13\u5bb6\u7b7e\u670d\u52a1 #\u6d4b\u8bd5\u7ad9\u4e13\u5bb6\u7b7e\u670d\u52a1
......
...@@ -26,6 +26,7 @@ import com.gx.obe.formula.PriceParam; ...@@ -26,6 +26,7 @@ import com.gx.obe.formula.PriceParam;
import com.gx.obe.message.Messages; import com.gx.obe.message.Messages;
import com.gx.obe.report.utils.Bean2MapUtils; import com.gx.obe.report.utils.Bean2MapUtils;
import com.gx.obe.util.utils.BigDecimalUtils; import com.gx.obe.util.utils.BigDecimalUtils;
import com.gx.obe.util.utils.CollectionUtils;
import com.gx.obe.util.utils.ListSortUtils; import com.gx.obe.util.utils.ListSortUtils;
import com.gx.obe.util.utils.StringUtils; import com.gx.obe.util.utils.StringUtils;
import com.gx.obe.util.utils.UuidUtils; import com.gx.obe.util.utils.UuidUtils;
...@@ -667,7 +668,6 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet { ...@@ -667,7 +668,6 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet {
Map<String, Object> crossData = new HashMap<String, Object>(); Map<String, Object> crossData = new HashMap<String, Object>();
List<Supplier> openSucessSupplierList = getOpenBidSuccessSupplierList(); List<Supplier> openSucessSupplierList = getOpenBidSuccessSupplierList();
List<SupplierOpeningResult> supplierBidPriceResultList = supplierOpeningResultService.getSupplierOpeningResultList(tenderProject.getId()); List<SupplierOpeningResult> supplierBidPriceResultList = supplierOpeningResultService.getSupplierOpeningResultList(tenderProject.getId());
List<BidPrice> bidPriceList = bidPriceService.getTenderBidPriceTableList(tenderProject.getId()); List<BidPrice> bidPriceList = bidPriceService.getTenderBidPriceTableList(tenderProject.getId());
if (null == bidPriceList || bidPriceList.size() < 1) { if (null == bidPriceList || bidPriceList.size() < 1) {
return; return;
...@@ -684,15 +684,25 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet { ...@@ -684,15 +684,25 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet {
for (Supplier supplier : openSucessSupplierList) { for (Supplier supplier : openSucessSupplierList) {
for (SupplierOpeningResult supplierOpeningResult : supplierBidPriceResultList) { for (SupplierOpeningResult supplierOpeningResult : supplierBidPriceResultList) {
if (StringUtils.equals(supplier.getId(), supplierOpeningResult.getSupplierId())) { if (StringUtils.equals(supplier.getId(), supplierOpeningResult.getSupplierId())) {
List<BidPriceResult> bidPriceItemResultList = bidPriceResultService.getSupplierBidPriceResultList(tenderProject.getId(), supplier.getId());
Map<String, Object> supplierMap = Bean2MapUtils.createMap(supplier); Map<String, Object> supplierMap = Bean2MapUtils.createMap(supplier);
supplierMap.put("sort", sort++ + ""); supplierMap.put("sort", sort++ + "");
supplierMap.put("supplierName", supplier.getSupplierName()); supplierMap.put("supplierName", supplier.getSupplierName());
supplierMap.put("id", supplier.getId()); supplierMap.put("id", supplier.getId());
if(parserStructProject()) {
//适配结构化改造后开标价格固定为含税标准
BidPriceResult bidPriceResult1 = CollectionUtils.getT(bidPriceItemResultList, t -> t.getBidPrice());
if(bidPriceResult1 != null) {
supplierMap.put("bidPrice", bidPriceResult1.getBidPriceByUnit(tenderProjectRuleEntity.getPriceUnit()));
supplierMap.put("evaluationPrice", bidPriceResult1.getEvaluationPrice());
}
}else {
supplierMap.put("bidPrice", supplierOpeningResult.getBidPriceByUnit(tenderProjectRuleEntity.getPriceUnit())); supplierMap.put("bidPrice", supplierOpeningResult.getBidPriceByUnit(tenderProjectRuleEntity.getPriceUnit()));
supplierMap.put("evaluationPrice", supplierOpeningResult.getEvaluationPrice()); supplierMap.put("evaluationPrice", supplierOpeningResult.getEvaluationPrice());
}
supplierWithItemMapList.add(supplierMap); supplierWithItemMapList.add(supplierMap);
List<BidPriceResult> bidPriceItemResultList = bidPriceResultService.getSupplierBidPriceResultList(tenderProject.getId(), supplier.getId());
for (BidPriceResult bidPriceResult : bidPriceItemResultList) { for (BidPriceResult bidPriceResult : bidPriceItemResultList) {
crossData.put(supplier.getId().concat(bidPriceResult.getBidPriceId()), bidPriceResult.getPriceContent()); crossData.put(supplier.getId().concat(bidPriceResult.getBidPriceId()), bidPriceResult.getPriceContent());
} }
...@@ -790,8 +800,8 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet { ...@@ -790,8 +800,8 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet {
formula = priceParam.getFormula(); formula = priceParam.getFormula();
evalStructMessage = priceParam.getEvalStructMessage(); evalStructMessage = priceParam.getEvalStructMessage();
} }
if (!StringUtils.isEmpty(formula)) {
boolean isStruct = parserStructProject(); boolean isStruct = parserStructProject();
if (!StringUtils.isEmpty(formula)) {
if (isStruct) { if (isStruct) {
formula = Messages.EvalExplainPrice + ":" + evalStructMessage + "\n\n" + Messages.BidExplainPrice + ":"+ evaluationFactor.getMemo(); formula = Messages.EvalExplainPrice + ":" + evalStructMessage + "\n\n" + Messages.BidExplainPrice + ":"+ evaluationFactor.getMemo();
} }
......
...@@ -24,7 +24,7 @@ public class WordAddBreakUtils { ...@@ -24,7 +24,7 @@ public class WordAddBreakUtils {
private static Logger logger = Logger.getLogger(WordAddBreakUtils.class); private static Logger logger = Logger.getLogger(WordAddBreakUtils.class);
private final static String BOOK_MARK = "formula_param"; private final static String BOOK_MARK = "formula_param";
private final static String BOOK_STRUCT_MARK = "jingnengStruct_param"; // private final static String BOOK_STRUCT_MARK = "jingnengStruct_param";
private final static String TABLE_TITLES = "§"; private final static String TABLE_TITLES = "§";
private final static String TABLE_TITLE = "∮"; private final static String TABLE_TITLE = "∮";
private final static String BREAK = "\\n"; private final static String BREAK = "\\n";
...@@ -61,31 +61,31 @@ public class WordAddBreakUtils { ...@@ -61,31 +61,31 @@ public class WordAddBreakUtils {
} }
} }
} }
if (ctBookmark.getName().equals(BOOK_STRUCT_MARK)) { // if (ctBookmark.getName().equals(BOOK_STRUCT_MARK)) {
List<XWPFRun> runs = p.getRuns(); // List<XWPFRun> runs = p.getRuns();
if (runs != null) { // if (runs != null) {
for (XWPFRun r : runs) { // for (XWPFRun r : runs) {
// 需要替换的文本 // // 需要替换的文本
String text = r.getText(0); // String text = r.getText(0);
if("1".equals(text)) { // if("1".equals(text)) {
// 标记从此书签开始删除后续内容 // // 标记从此书签开始删除后续内容
removeContent = false; // removeContent = false;
break; // break;
} // }
} // }
} // }
} // }
}
}
try {
if (removeContent) {
deleteAfterMarker(doc,TABLE_TITLES);
}else {
//updateTables(doc);
} }
}catch (Exception e) {
Log.error(e.getMessage());
} }
// try {
// if (removeContent) {
// deleteAfterMarker(doc,TABLE_TITLES);
// }else {
// //updateTables(doc);
// }
// }catch (Exception e) {
// Log.error(e.getMessage());
// }
doc.write(new FileOutputStream(outSrc)); doc.write(new FileOutputStream(outSrc));
logger.error("评标报告替换完成"); logger.error("评标报告替换完成");
} catch (IOException e) { } catch (IOException e) {
......
package com.gx.obe.util.utils; package com.gx.obe.util.utils;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
...@@ -7,6 +8,8 @@ import java.util.Iterator; ...@@ -7,6 +8,8 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.function.Function;
import java.util.function.Predicate;
/** /**
* @Description: * @Description:
...@@ -28,6 +31,25 @@ public class CollectionUtils { ...@@ -28,6 +31,25 @@ public class CollectionUtils {
return null; return null;
} }
/**
* @Description: 比较并返回
* @author lyb
* @param <T>
* @param collection
* @param filter
* @return
*/
public static <T> T getT(Collection<? extends T> collection, Function<T, BigDecimal> filter) {
BigDecimal target = new BigDecimal(0);
T tl = null;
if (null != collection) for (T t : collection)
if(target.compareTo(filter.apply(t)) <= 0) {
target = filter.apply(t);
tl = t;
}
return tl;
}
/** /**
* @Description: 根据过滤条件获取集合的条数 * @Description: 根据过滤条件获取集合的条数
* @author chenxw * @author chenxw
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment