Commit f411c5d6 authored by liangyb's avatar liangyb

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

parent b522bb82
......@@ -349,7 +349,7 @@ public class ImportTenderProjectThread implements Runnable {
tenderProjectRuleEntity.setBidOpeningStage(TenderProjectEnum.BID_OPENING_ONE_STAGE);
return tenderProjectRuleEntity;
}
/**
* @Description: 解析评审指标
* @param tenderProjectEntity
......@@ -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,23 +436,28 @@ public class ImportTenderProjectThread implements Runnable {
String TAX = "bidPrice";
String NO_TAX = "noTaxBidPrice";
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
return evalFactorList = evalFactorList.stream().map(t -> {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
String tax;
if(TAX.equals(t.getBidPriceCode())) {
tax = "TAX_TOTAL_PRICE";
}else {
tax = "NO_TAX_TOTAL_PRICE";
if(null != bidPriceList && bidPriceList.size() > 0){
return evalFactorList = evalFactorList.stream().map(t -> {
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;
if(TAX.equals(t.getBidPriceCode())) {
tax = "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 tax.equals(s.getBidPriceCode());
});
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
return t;
}).collect(Collectors.toList());
return t;
}).collect(Collectors.toList());
}
return evalFactorList;
}
private void callBackMsg(String msg){
if(null != callBack){
......
......@@ -133,23 +133,27 @@ public class NewDownloadEvaluationFactorThread extends MyThread{
String TAX = "bidPrice";
String NO_TAX = "noTaxBidPrice";
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
evalFactorList = evalFactorList.stream().map(t -> {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
String tax;
if(TAX.equals(t.getBidPriceCode())) {
tax = "TAX_TOTAL_PRICE";
}else {
tax = "NO_TAX_TOTAL_PRICE";
if(null != bidPriceList && bidPriceList.size() > 0){
evalFactorList = evalFactorList.stream().map(t -> {
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;
if(TAX.equals(t.getBidPriceCode())) {
tax = "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 tax.equals(s.getBidPriceCode());
});
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
return t;
}).collect(Collectors.toList());
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,23 +118,27 @@ public class EvaluationFactorXmlResolverThread implements Runnable {
if(factorList.size() > 0){
BidPriceService bidPriceService = new BidPriceService();
List<BidPrice> bidPriceList = bidPriceService.getBidPriceFactorList(tenderProjectEntity.getId());
factorList = factorList.stream().map(t -> {
if(BidPrice.BID_PRICE_TOTAL_CODE.equals(t.getBidPriceCode()) && bidPriceList.size() == 1) {
t.setBidPriceCode(bidPriceList.get(0).getBidPriceCode());
}else if(TAX.equals(t.getBidPriceCode()) || NO_TAX.equals(t.getBidPriceCode())){
String tax;
if(TAX.equals(t.getBidPriceCode())) {
tax = "TAX_TOTAL_PRICE";
}else {
tax = "NO_TAX_TOTAL_PRICE";
if(null != bidPriceList && bidPriceList.size() > 0){
factorList = factorList.stream().map(t -> {
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;
if(TAX.equals(t.getBidPriceCode())) {
tax = "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 tax.equals(s.getBidPriceCode());
});
t.setBidPriceCode(bidPriceResult.getBidPriceCode());
}
return t;
}).collect(Collectors.toList());
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