Commit f411c5d6 authored by liangyb's avatar liangyb

#328-4 结构化非结构化适配

parent b522bb82
...@@ -349,7 +349,7 @@ public class ImportTenderProjectThread implements Runnable { ...@@ -349,7 +349,7 @@ public class ImportTenderProjectThread implements Runnable {
tenderProjectRuleEntity.setBidOpeningStage(TenderProjectEnum.BID_OPENING_ONE_STAGE); tenderProjectRuleEntity.setBidOpeningStage(TenderProjectEnum.BID_OPENING_ONE_STAGE);
return tenderProjectRuleEntity; return tenderProjectRuleEntity;
} }
/** /**
* @Description: 解析评审指标 * @Description: 解析评审指标
* @param tenderProjectEntity * @param tenderProjectEntity
...@@ -396,7 +396,7 @@ public class ImportTenderProjectThread implements Runnable { ...@@ -396,7 +396,7 @@ public class ImportTenderProjectThread implements Runnable {
try { try {
List<EvaluationFactor> evaluationFactorList = ParsingXmlUtils.analyELementXMl(element, childProject); List<EvaluationFactor> evaluationFactorList = ParsingXmlUtils.analyELementXMl(element, childProject);
if (null != evaluationFactorList && evaluationFactorList.size() > 0) { if (null != evaluationFactorList && evaluationFactorList.size() > 0) {
changeFactorList(evaluationFactorList, tenderProjectEntity); evaluationFactorList = changeFactorList(evaluationFactorList, tenderProjectEntity);
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evaluationFactorList) > 0){ if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evaluationFactorList) > 0){
callBackMsg(true, evaluationFactorList.size() +"个评审指标导入成功!"); callBackMsg(true, evaluationFactorList.size() +"个评审指标导入成功!");
} else { } else {
...@@ -415,7 +415,7 @@ public class ImportTenderProjectThread implements Runnable { ...@@ -415,7 +415,7 @@ public class ImportTenderProjectThread implements Runnable {
try { try {
List<EvaluationFactor> evaluationFactorList = ParsingXmlUtils.analyELementXMl((Element)packEvalFactorList.get(0), tenderProjectEntity); List<EvaluationFactor> evaluationFactorList = ParsingXmlUtils.analyELementXMl((Element)packEvalFactorList.get(0), tenderProjectEntity);
if (null != evaluationFactorList && evaluationFactorList.size() > 0) { if (null != evaluationFactorList && evaluationFactorList.size() > 0) {
changeFactorList(evaluationFactorList, tenderProjectEntity); evaluationFactorList = changeFactorList(evaluationFactorList, tenderProjectEntity);
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evaluationFactorList) > 0){ if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evaluationFactorList) > 0){
callBackMsg(true, evaluationFactorList.size() +"个评审指标导入成功!"); callBackMsg(true, evaluationFactorList.size() +"个评审指标导入成功!");
} else { } else {
...@@ -436,23 +436,28 @@ public class ImportTenderProjectThread implements Runnable { ...@@ -436,23 +436,28 @@ public class ImportTenderProjectThread implements Runnable {
String TAX = "bidPrice"; String TAX = "bidPrice";
String NO_TAX = "noTaxBidPrice"; String NO_TAX = "noTaxBidPrice";
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId()); List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
return evalFactorList = evalFactorList.stream().map(t -> { if(null != bidPriceList && bidPriceList.size() > 0){
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) { return evalFactorList = evalFactorList.stream().map(t -> {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode()); if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode())) {
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){ t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
String tax; }else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
if(TAX.equals(t.getBidPriceCode())) { String tax;
tax = "TAX_TOTAL_PRICE"; if(TAX.equals(t.getBidPriceCode())) {
}else { tax = "TAX_TOTAL_PRICE";
tax = "NO_TAX_TOTAL_PRICE"; }else {
tax = "NO_TAX_TOTAL_PRICE";
}
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> {
return tax.equals(s.getBidPriceCode());
});
if(bidPriceResult != null){
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
} }
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> { return t;
return tax.equals(s.getBidPriceCode()); }).collect(Collectors.toList());
}); }
t.setBidPriceCode(bidPriceResult.getBidPriceCode()); return evalFactorList;
}
return t;
}).collect(Collectors.toList());
} }
private void callBackMsg(String msg){ private void callBackMsg(String msg){
if(null != callBack){ if(null != callBack){
......
...@@ -133,23 +133,27 @@ public class NewDownloadEvaluationFactorThread extends MyThread{ ...@@ -133,23 +133,27 @@ public class NewDownloadEvaluationFactorThread extends MyThread{
String TAX = "bidPrice"; String TAX = "bidPrice";
String NO_TAX = "noTaxBidPrice"; String NO_TAX = "noTaxBidPrice";
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId()); List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
evalFactorList = evalFactorList.stream().map(t -> { if(null != bidPriceList && bidPriceList.size() > 0){
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) { evalFactorList = evalFactorList.stream().map(t -> {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode()); if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode())) {
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){ t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
String tax; }else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
if(TAX.equals(t.getBidPriceCode())) { String tax;
tax = "TAX_TOTAL_PRICE"; if(TAX.equals(t.getBidPriceCode())) {
}else { tax = "TAX_TOTAL_PRICE";
tax = "NO_TAX_TOTAL_PRICE"; }else {
tax = "NO_TAX_TOTAL_PRICE";
}
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> {
return tax.equals(s.getBidPriceCode());
});
if(bidPriceResult != null){
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
} }
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> { return t;
return tax.equals(s.getBidPriceCode()); }).collect(Collectors.toList());
}); }
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
return t;
}).collect(Collectors.toList());
// 批量保存 // 批量保存
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evalFactorList) > 0){ if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evalFactorList) > 0){
callBackMsg(true, "[" + tenderProjectEntity.getTenderName() +"] " + evalFactorList.size() +"个评审指标下载成功!"); callBackMsg(true, "[" + tenderProjectEntity.getTenderName() +"] " + evalFactorList.size() +"个评审指标下载成功!");
......
...@@ -4,7 +4,6 @@ import java.math.BigDecimal; ...@@ -4,7 +4,6 @@ import java.math.BigDecimal;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -61,7 +60,6 @@ import com.gx.obe.message.Messages; ...@@ -61,7 +60,6 @@ import com.gx.obe.message.Messages;
import com.gx.obe.util.utils.BigDecimalUtils; import com.gx.obe.util.utils.BigDecimalUtils;
import com.gx.obe.util.utils.LogUtils; import com.gx.obe.util.utils.LogUtils;
import com.gx.obe.util.utils.ObjectUtils; import com.gx.obe.util.utils.ObjectUtils;
import com.gx.obe.util.utils.SerializeUtils;
import com.gx.obe.util.utils.StringUtils; import com.gx.obe.util.utils.StringUtils;
import com.gx.obe.web.entity.auth.Menu; import com.gx.obe.web.entity.auth.Menu;
import com.gx.obe.web.entity.evaluation.EvaluationFactor; import com.gx.obe.web.entity.evaluation.EvaluationFactor;
...@@ -1060,6 +1058,15 @@ public class PriceFactorsManagerComposite extends Composite { ...@@ -1060,6 +1058,15 @@ public class PriceFactorsManagerComposite extends Composite {
} }
bidPriceResultService.updateBidPriceAndFinalPrice(supplierMap); bidPriceResultService.updateBidPriceAndFinalPrice(supplierMap);
} }
//结构化投标报价保险写入
if(StringUtils.isEmpty(bid_price_text.getText())) {
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProject.getId());
if(bidPriceList != null && bidPriceList.size() == 1) {
bid_price_text.setText(bidPriceList.get(0).getBidPriceName());
curFactor.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
evaluationFactorService.updateAssignProperty(curFactor, new String[]{"id","bidPriceCode"});
}
}
//del_bid_price.setVisible(true); //del_bid_price.setVisible(true);
}else { }else {
curFactor.setBidPriceCode(null); curFactor.setBidPriceCode(null);
......
...@@ -118,23 +118,27 @@ public class EvaluationFactorXmlResolverThread implements Runnable { ...@@ -118,23 +118,27 @@ public class EvaluationFactorXmlResolverThread implements Runnable {
if(factorList.size() > 0){ if(factorList.size() > 0){
BidPriceService bidPriceService = new BidPriceService(); BidPriceService bidPriceService = new BidPriceService();
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId()); List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
factorList = factorList.stream().map(t -> { if(null != bidPriceList && bidPriceList.size() > 0){
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) { factorList = factorList.stream().map(t -> {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode()); if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode())) {
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){ t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
String tax; }else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
if(TAX.equals(t.getBidPriceCode())) { String tax;
tax = "TAX_TOTAL_PRICE"; if(TAX.equals(t.getBidPriceCode())) {
}else { tax = "TAX_TOTAL_PRICE";
tax = "NO_TAX_TOTAL_PRICE"; }else {
tax = "NO_TAX_TOTAL_PRICE";
}
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> {
return tax.equals(s.getBidPriceCode());
});
if(bidPriceResult != null){
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
} }
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> { return t;
return tax.equals(s.getBidPriceCode()); }).collect(Collectors.toList());
}); }
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
return t;
}).collect(Collectors.toList());
// 批量保存 // 批量保存
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), factorList) > 0){ if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), factorList) > 0){
isImport = true; isImport = true;
......
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