Commit f411c5d6 authored by liangyb's avatar liangyb

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

parent b522bb82
......@@ -396,7 +396,7 @@ public class ImportTenderProjectThread implements Runnable {
try {
List<EvaluationFactor> evaluationFactorList = ParsingXmlUtils.analyELementXMl(element, childProject);
if (null != evaluationFactorList && evaluationFactorList.size() > 0) {
changeFactorList(evaluationFactorList, tenderProjectEntity);
evaluationFactorList = changeFactorList(evaluationFactorList, tenderProjectEntity);
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evaluationFactorList) > 0){
callBackMsg(true, evaluationFactorList.size() +"个评审指标导入成功!");
} else {
......@@ -415,7 +415,7 @@ public class ImportTenderProjectThread implements Runnable {
try {
List<EvaluationFactor> evaluationFactorList = ParsingXmlUtils.analyELementXMl((Element)packEvalFactorList.get(0), tenderProjectEntity);
if (null != evaluationFactorList && evaluationFactorList.size() > 0) {
changeFactorList(evaluationFactorList, tenderProjectEntity);
evaluationFactorList = changeFactorList(evaluationFactorList, tenderProjectEntity);
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evaluationFactorList) > 0){
callBackMsg(true, evaluationFactorList.size() +"个评审指标导入成功!");
} else {
......@@ -436,8 +436,9 @@ public class ImportTenderProjectThread implements Runnable {
String TAX = "bidPrice";
String NO_TAX = "noTaxBidPrice";
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
if(null != bidPriceList && bidPriceList.size() > 0){
return evalFactorList = evalFactorList.stream().map(t -> {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode())) {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
String tax;
......@@ -449,11 +450,15 @@ public class ImportTenderProjectThread implements Runnable {
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> {
return tax.equals(s.getBidPriceCode());
});
if(bidPriceResult != null){
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
}
return t;
}).collect(Collectors.toList());
}
return evalFactorList;
}
private void callBackMsg(String msg){
if(null != callBack){
callBack.callBackString(" "+ msg);
......
......@@ -133,8 +133,9 @@ public class NewDownloadEvaluationFactorThread extends MyThread{
String TAX = "bidPrice";
String NO_TAX = "noTaxBidPrice";
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
if(null != bidPriceList && bidPriceList.size() > 0){
evalFactorList = evalFactorList.stream().map(t -> {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode())) {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
String tax;
......@@ -146,10 +147,13 @@ public class NewDownloadEvaluationFactorThread extends MyThread{
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> {
return tax.equals(s.getBidPriceCode());
});
if(bidPriceResult != null){
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
}
return t;
}).collect(Collectors.toList());
}
// 批量保存
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), evalFactorList) > 0){
callBackMsg(true, "[" + tenderProjectEntity.getTenderName() +"] " + evalFactorList.size() +"个评审指标下载成功!");
......
......@@ -4,7 +4,6 @@ import java.math.BigDecimal;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -61,7 +60,6 @@ import com.gx.obe.message.Messages;
import com.gx.obe.util.utils.BigDecimalUtils;
import com.gx.obe.util.utils.LogUtils;
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.web.entity.auth.Menu;
import com.gx.obe.web.entity.evaluation.EvaluationFactor;
......@@ -1060,6 +1058,15 @@ public class PriceFactorsManagerComposite extends Composite {
}
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);
}else {
curFactor.setBidPriceCode(null);
......
......@@ -118,8 +118,9 @@ public class EvaluationFactorXmlResolverThread implements Runnable {
if(factorList.size() > 0){
BidPriceService bidPriceService = new BidPriceService();
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
if(null != bidPriceList && bidPriceList.size() > 0){
factorList = factorList.stream().map(t -> {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode())) {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
String tax;
......@@ -131,10 +132,13 @@ public class EvaluationFactorXmlResolverThread implements Runnable {
BidPrice bidPriceResult = CollectionUtils.get(bidPriceList, s -> {
return tax.equals(s.getBidPriceCode());
});
if(bidPriceResult != null){
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
}
return t;
}).collect(Collectors.toList());
}
// 批量保存
if(evaluationFactorService.saveDownloadEvaluationFactor(tenderProjectEntity.getId(), factorList) > 0){
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