Commit 68a92b5e authored by liangyb's avatar liangyb

#251-0 2024705 ai生成文档修改,结构化非结构化报表添加修改,评审说明修改

parent 361e4d19
...@@ -2,6 +2,7 @@ package com.gx.obe.evaluation.step.composite; ...@@ -2,6 +2,7 @@ package com.gx.obe.evaluation.step.composite;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.core.CallBack; import org.eclipse.swt.core.CallBack;
...@@ -41,6 +42,7 @@ public class AiEvalLeftButton extends ImageButton{ ...@@ -41,6 +42,7 @@ public class AiEvalLeftButton extends ImageButton{
// private ShowAiProcessShell menuTipShell; // private ShowAiProcessShell menuTipShell;
private MouseListener listener; private MouseListener listener;
private ShowAiProcessShell showAiProcessShell; private ShowAiProcessShell showAiProcessShell;
private File downLoadPath;
public static Color BG = ColorConstants.SKIN_BG; public static Color BG = ColorConstants.SKIN_BG;
public AiEvalLeftButton(Composite parent, int style,TenderProjectEntity curTender) { public AiEvalLeftButton(Composite parent, int style,TenderProjectEntity curTender) {
super(parent, SWT.CENTER|SWT.NONE); super(parent, SWT.CENTER|SWT.NONE);
...@@ -79,6 +81,10 @@ public class AiEvalLeftButton extends ImageButton{ ...@@ -79,6 +81,10 @@ public class AiEvalLeftButton extends ImageButton{
public void mouseEnter(MouseEvent e) { public void mouseEnter(MouseEvent e) {
HttpUrl httpUrl = HttpUtils.getProjectHttpUrl(curTender, PropertiesUtils.getWebserviceProperty(WebserviceConstants.GET_AI_RESULT_METHOD, "bidOpeningHS.do?downloadOpenBidSupplierAiResult")); HttpUrl httpUrl = HttpUtils.getProjectHttpUrl(curTender, PropertiesUtils.getWebserviceProperty(WebserviceConstants.GET_AI_RESULT_METHOD, "bidOpeningHS.do?downloadOpenBidSupplierAiResult"));
HttpResponse httpResponse = HttpUtils.doPost(httpUrl); HttpResponse httpResponse = HttpUtils.doPost(httpUrl);
downLoadPath = new File(FileConstants.getBiddingFilePath(curTender.getId()) + "ai.pdf");
if(StringUtils.isNotEmpty(downLoadPath.getAbsolutePath()) && downLoadPath.exists()) {
return;
}
downloadBiddingFile(httpResponse); downloadBiddingFile(httpResponse);
// showAiProcessShell = new ShowAiProcessShell(getShell(), EvalLeftButton1.this, 0, ""); // showAiProcessShell = new ShowAiProcessShell(getShell(), EvalLeftButton1.this, 0, "");
// if(null != showAiProcessShell && !showAiProcessShell.isDisposed()){ // if(null != showAiProcessShell && !showAiProcessShell.isDisposed()){
...@@ -98,7 +104,6 @@ public class AiEvalLeftButton extends ImageButton{ ...@@ -98,7 +104,6 @@ public class AiEvalLeftButton extends ImageButton{
}); });
} }
private void downloadBiddingFile(HttpResponse httpResponse){ private void downloadBiddingFile(HttpResponse httpResponse){
String downUrl = ""; String downUrl = "";
if(null == httpResponse.getContent() || "".equals(httpResponse.getContent())){ if(null == httpResponse.getContent() || "".equals(httpResponse.getContent())){
// LOG.debug("服务器返回数据为空!"); // LOG.debug("服务器返回数据为空!");
...@@ -111,13 +116,9 @@ public class AiEvalLeftButton extends ImageButton{ ...@@ -111,13 +116,9 @@ public class AiEvalLeftButton extends ImageButton{
if(StringUtils.isNotEmpty(packageAiType) && packageAiType.equals(CommonEnum.YES) && StringUtils.isNotEmpty(downUrl) ){ if(StringUtils.isNotEmpty(packageAiType) && packageAiType.equals(CommonEnum.YES) && StringUtils.isNotEmpty(downUrl) ){
// LOG.debug("下载地址获取成功"+downUrl); // LOG.debug("下载地址获取成功"+downUrl);
// callBackMsg(true, "下载地址获取成功,开始解析下载地址..."); // callBackMsg(true, "下载地址获取成功,开始解析下载地址...");
String downLoadPaths = downLoadPath.getAbsolutePath();
downLoadFile(downUrl, downLoadPaths);
String downLoadPath = new File(FileConstants.getBiddingFilePath(curTender.getId()) + "ai.pdf").getAbsolutePath();
downLoadFile(downUrl, downLoadPath);
}else { }else {
String progress = httpResponse.getDataParam("progress"); String progress = httpResponse.getDataParam("progress");
String waitTime = httpResponse.getDataParam("waitTime"); String waitTime = httpResponse.getDataParam("waitTime");
showAiProcessShell = new ShowAiProcessShell(getShell(), AiEvalLeftButton.this, ObjectUtils.getIntValue(progress, 0), waitTime); showAiProcessShell = new ShowAiProcessShell(getShell(), AiEvalLeftButton.this, ObjectUtils.getIntValue(progress, 0), waitTime);
...@@ -128,12 +129,17 @@ public class AiEvalLeftButton extends ImageButton{ ...@@ -128,12 +129,17 @@ public class AiEvalLeftButton extends ImageButton{
} }
} }
private void downLoadFile(String downLoadUrl, String savePath){ private void downLoadFile(String downLoadUrl, String downLoadPaths){
// callBackMsg("开始下载招标文件..."); // callBackMsg("开始下载招标文件...");
HttpURLDown httpURLDown = new HttpURLDown(downLoadUrl, savePath, new CallBack() { HttpURLDown httpURLDown = new HttpURLDown(downLoadUrl, downLoadPaths, new CallBack() {
}); });
try { try {
showAiProcessShell = new ShowAiProcessShell(getShell(), AiEvalLeftButton.this, ObjectUtils.getIntValue("0", 0), "10s");
showAiProcessShell.open();
boolean downFlag = httpURLDown.downLoad("标书比对相似度分析"); boolean downFlag = httpURLDown.downLoad("标书比对相似度分析");
showAiProcessShell.close();
showAiProcessShell = new ShowAiProcessShell(getShell(), AiEvalLeftButton.this, ObjectUtils.getIntValue("100", 0), "0s");
showAiProcessShell.open();
// callBackMsg("招标文件下载结束!"); // callBackMsg("招标文件下载结束!");
// 下载成功并且是.zip文件才进行解压操作 // 下载成功并且是.zip文件才进行解压操作
if(downFlag){ if(downFlag){
...@@ -143,7 +149,7 @@ public class AiEvalLeftButton extends ImageButton{ ...@@ -143,7 +149,7 @@ public class AiEvalLeftButton extends ImageButton{
listener = new MouseAdapter() { listener = new MouseAdapter() {
public void mouseUp(MouseEvent e) { public void mouseUp(MouseEvent e) {
if(!groupButton.getEnabled()) return; if(!groupButton.getEnabled()) return;
RuntimeUtils.openFIle(new File(savePath)); RuntimeUtils.openFIle(new File(downLoadPaths));
} }
}; };
groupButton.addMouseListener(listener); groupButton.addMouseListener(listener);
......
...@@ -820,6 +820,7 @@ public abstract class BaseDateSet implements IWordDataSet{ ...@@ -820,6 +820,7 @@ public abstract class BaseDateSet implements IWordDataSet{
priceScoreDate.init(tenderProject); priceScoreDate.init(tenderProject);
List<Map<String, Object>> tableColList; List<Map<String, Object>> tableColList;
String[] fields; String[] fields;
reportDataSet.put("jingnengStruct", isStruct ? "1" : "0");
if(isStruct) { if(isStruct) {
fields = new String[] { fields = new String[] {
"开标价格 --(含税)&&bidPrice0", "开标价格 --(含税)&&bidPrice0",
...@@ -833,8 +834,8 @@ public abstract class BaseDateSet implements IWordDataSet{ ...@@ -833,8 +834,8 @@ public abstract class BaseDateSet implements IWordDataSet{
}; };
}else { }else {
fields = new String[] { fields = new String[] {
"开标价格 --&&bidPrice0", "开标价格 (--)&&bidPrice0",
"修正后投标报价&&evaluationPrice0", "修正后投标报价 (--)&&evaluationPrice0",
"修正原因&&modifyReason0", "修正原因&&modifyReason0",
"基准价&&basePrice", "基准价&&basePrice",
"价格得分&&priceFinalScore" "价格得分&&priceFinalScore"
...@@ -906,8 +907,14 @@ public abstract class BaseDateSet implements IWordDataSet{ ...@@ -906,8 +907,14 @@ public abstract class BaseDateSet implements IWordDataSet{
List<Map<String, Object>> factorList = new ArrayList<Map<String, Object>>(); List<Map<String, Object>> factorList = new ArrayList<Map<String, Object>>();
int index = 1; int index = 1;
for(String field : fields){ for(String field : fields){
if(field.contains("--") && unit != null) { if(field.contains("--")) {
field = field.replaceAll("--", unit); if(unit != null) {
field = field.replaceAll("--", unit);
}else {
//给默认值
field = field.replaceAll("--", "元");
}
} }
Map<String, Object> colMap = new HashMap<String, Object>(); Map<String, Object> colMap = new HashMap<String, Object>();
String[] f = field.split("&&"); String[] f = field.split("&&");
......
...@@ -779,25 +779,25 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet { ...@@ -779,25 +779,25 @@ public class JingNengEvaluationReportDataSet extends BaseDateSet {
private void getFactorMessage() { private void getFactorMessage() {
EvaluationFactor evaluationFactor =evaluationFactorService.getPriceEvaluationFactor(tenderProject.getId()); EvaluationFactor evaluationFactor =evaluationFactorService.getPriceEvaluationFactor(tenderProject.getId());
String formula = null; String formula = null;
String evalStructMessage = null; String evalStructMessage = "";
PriceParam priceParam =null; PriceParam priceParam =null;
if(evaluationFactor != null) { if(evaluationFactor != null) {
priceParam = PriceParam.deserializePriceParam(evaluationFactor.getComputerParams()); priceParam = PriceParam.deserializePriceParam(evaluationFactor.getComputerParams());
} }
if (priceParam != null) { if (priceParam != null) {
String separator=System.getProperty("line.separator"); //String separator=System.getProperty("line.separator");
formula = priceParam.getFormula(); formula = priceParam.getFormula();
evalStructMessage = priceParam.getEvalStructMessage(); evalStructMessage = priceParam.getEvalStructMessage();
} }
if (!StringUtils.isEmpty(formula)) { if (!StringUtils.isEmpty(formula)) {
boolean isStruct = parserStructProject(); boolean isStruct = parserStructProject();
if (!StringUtils.isEmpty(evalStructMessage) && isStruct) { if (isStruct) {
formula = Messages.EvalExplainPrice + ":" + evalStructMessage + "\n\n" + Messages.BidExplainPrice + ":"+ evaluationFactor.getMemo(); formula = Messages.EvalExplainPrice + ":" + evalStructMessage + "\n\n" + Messages.BidExplainPrice + ":"+ evaluationFactor.getMemo();
} }
// if(!StringUtils.isEmpty(evaluationFactor.getMemo()) && !isStruct) { if(!StringUtils.isEmpty(evaluationFactor.getMemo()) && !isStruct) {
// formula = formula + "\n\n" + Messages.EvalExplain + ":" + evaluationFactor.getMemo(); formula = Messages.EvalExplain + ":" + evaluationFactor.getMemo();
// } }
reportDataSet.putParam("formula", formula); reportDataSet.putParam("formula", formula);
} }
//获取商务技术打分权重 //获取商务技术打分权重
......
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