Commit c34f51ac authored by 黄重's avatar 黄重

结构化代码提交

parent dad6c22a
...@@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.ui, ...@@ -24,7 +24,8 @@ Require-Bundle: org.eclipse.ui,
com.gx.obe.answer, com.gx.obe.answer,
com.gx.obe.sameness, com.gx.obe.sameness,
com.gx.obe.credit, com.gx.obe.credit,
org.eclipse.swt org.eclipse.swt,
com.gx.obe.struct;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: BID-EVALUATION-STEP Automatic-Module-Name: BID-EVALUATION-STEP
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
......
...@@ -73,6 +73,7 @@ import com.gx.obe.components.core.enumeration.CommonEnum; ...@@ -73,6 +73,7 @@ import com.gx.obe.components.core.enumeration.CommonEnum;
import com.gx.obe.components.core.enumeration.EvaluationFactorEnum; import com.gx.obe.components.core.enumeration.EvaluationFactorEnum;
import com.gx.obe.components.core.enumeration.EvaluationStepEnum; import com.gx.obe.components.core.enumeration.EvaluationStepEnum;
import com.gx.obe.components.core.enumeration.ExpertEnum; import com.gx.obe.components.core.enumeration.ExpertEnum;
import com.gx.obe.components.core.enumeration.ShowType;
import com.gx.obe.config.ConfigConstants; import com.gx.obe.config.ConfigConstants;
import com.gx.obe.config.utils.PropertiesUtils; import com.gx.obe.config.utils.PropertiesUtils;
import com.gx.obe.evaluation.step.composite.struct.EvaluationView; import com.gx.obe.evaluation.step.composite.struct.EvaluationView;
...@@ -94,6 +95,7 @@ import com.gx.obe.evaluation.step.widgets.EvalLeftGroupButton; ...@@ -94,6 +95,7 @@ import com.gx.obe.evaluation.step.widgets.EvalLeftGroupButton;
import com.gx.obe.evaluation.step.widgets.LeftMenuEnum; import com.gx.obe.evaluation.step.widgets.LeftMenuEnum;
import com.gx.obe.evaluation.step.widgets.LeftMenuMouseAdapter; import com.gx.obe.evaluation.step.widgets.LeftMenuMouseAdapter;
import com.gx.obe.message.Messages; import com.gx.obe.message.Messages;
import com.gx.obe.struct.composite.TemplateTableListComposite;
import com.gx.obe.util.utils.CollectionUtils; import com.gx.obe.util.utils.CollectionUtils;
import com.gx.obe.util.utils.FileUtils; import com.gx.obe.util.utils.FileUtils;
import com.gx.obe.util.utils.LogUtils; import com.gx.obe.util.utils.LogUtils;
...@@ -131,7 +133,7 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -131,7 +133,7 @@ public class FactorEvaluationComposite extends EvaluationView {
private Composite viewContentComposite; private Composite viewContentComposite;
private Composite evaluation_panel_composite; private Composite evaluation_panel_composite;
private Text supplier_name; private Text supplier_name;
private ImageButton curShowButton;
// private EvalLeftButton file_panel_both_ver; // private EvalLeftButton file_panel_both_ver;
// private EvalLeftButton file_panel_both_hor; // private EvalLeftButton file_panel_both_hor;
// private EvalLeftButton show_file_only; // private EvalLeftButton show_file_only;
...@@ -166,7 +168,7 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -166,7 +168,7 @@ public class FactorEvaluationComposite extends EvaluationView {
private EvalLeftGroupButton opinionGroupButton; private EvalLeftGroupButton opinionGroupButton;
private EvalLeftGroupButton creditGroupButton; private EvalLeftGroupButton creditGroupButton;
private EvalLeftGroupButton radioGroupButton; private EvalLeftGroupButton radioGroupButton;
private ShowType showType;
// private EvalLeftButton evaluationPanelBtn; // private EvalLeftButton evaluationPanelBtn;
// private EvalLeftGroupButton bid_file_only; // private EvalLeftGroupButton bid_file_only;
// private EvalLeftButton bidding_file_only; // private EvalLeftButton bidding_file_only;
...@@ -234,6 +236,8 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -234,6 +236,8 @@ public class FactorEvaluationComposite extends EvaluationView {
private List<SupplierDTO> supplierDTOList; private List<SupplierDTO> supplierDTOList;
private OpenFileTipsShell openFileTipsShell; private OpenFileTipsShell openFileTipsShell;
private Map<String,String> supplierNameMap = new HashMap<String,String>(); private Map<String,String> supplierNameMap = new HashMap<String,String>();
private Composite buttonComposite;
private TemplateTableListComposite templateTableListComposite;
{ {
LogUtils.logClass(FactorEvaluationComposite.class); LogUtils.logClass(FactorEvaluationComposite.class);
...@@ -393,7 +397,7 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -393,7 +397,7 @@ public class FactorEvaluationComposite extends EvaluationView {
right_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); right_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
Composite supplier_composite = new Composite(right_composite, SWT.NONE); Composite supplier_composite = new Composite(right_composite, SWT.NONE);
GridLayout gl_supplier_composite = new GridLayout(6, false); GridLayout gl_supplier_composite = new GridLayout(10, false);
supplier_composite.setLayout(gl_supplier_composite); supplier_composite.setLayout(gl_supplier_composite);
supplier_composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); supplier_composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
supplier_composite.setBackgroundImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/title_bg.png")); supplier_composite.setBackgroundImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/title_bg.png"));
...@@ -410,6 +414,19 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -410,6 +414,19 @@ public class FactorEvaluationComposite extends EvaluationView {
supplier_name.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE)); supplier_name.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE));
supplier_name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); supplier_name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
ESepator verAfter = new ESepator(supplier_composite, SWT.VERTICAL);
verAfter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
buttonComposite = new Composite(supplier_composite, SWT.NONE);
RowLayout rl_composite = new RowLayout(SWT.HORIZONTAL);
rl_composite.marginBottom = 0;
rl_composite.marginTop = 0;
buttonComposite.setLayout(rl_composite);
ESepator verFront = new ESepator(supplier_composite, SWT.VERTICAL);
verFront.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
viewCredit_link = new ELink(supplier_composite, SWT.NONE); viewCredit_link = new ELink(supplier_composite, SWT.NONE);
viewCredit_link.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/view.png")); viewCredit_link.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/view.png"));
viewCredit_link.setText("查看征信"); viewCredit_link.setText("查看征信");
...@@ -691,6 +708,8 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -691,6 +708,8 @@ public class FactorEvaluationComposite extends EvaluationView {
gl_evaluation_panel_composite.marginWidth = 0; gl_evaluation_panel_composite.marginWidth = 0;
evaluation_panel_composite.setLayout(gl_evaluation_panel_composite); evaluation_panel_composite.setLayout(gl_evaluation_panel_composite);
templateTableListComposite = new TemplateTableListComposite(opinionComposite, SWT.NONE);
evaluation_talbe_composite = new Composite(evaluation_panel_composite, SWT.NONE); evaluation_talbe_composite = new Composite(evaluation_panel_composite, SWT.NONE);
evaluation_talbe_composite.setLayout(new FillLayout(SWT.HORIZONTAL)); evaluation_talbe_composite.setLayout(new FillLayout(SWT.HORIZONTAL));
evaluation_talbe_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); evaluation_talbe_composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
...@@ -790,7 +809,63 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -790,7 +809,63 @@ public class FactorEvaluationComposite extends EvaluationView {
}); });
return imageButton; return imageButton;
} }
private void initShowButton() {
showType = ShowType.getByKey(PropertiesUtils.getProperty(ConfigConstants.SHOW_TYPE, ShowType.FILE.getKey()));
ImageButton fileButton = createShowButton(ShowType.FILE);
ImageButton opinionButton = createShowButton(ShowType.OPINION);
ImageButton comparisonTableButton = createShowButton(ShowType.COMPARISON_TABLE);
// ImageButton structButton = createShowButton(ShowType.STRUCT);
switch (showType) {
case FILE:
curShowButton = fileButton;
break;
case OPINION:
curShowButton = opinionButton;
break;
case COMPARISON_TABLE:
curShowButton = comparisonTableButton;
break;
// case STRUCT:
// curShowButton = structButton;
// break;
}
curShowButton.setSelection(true);
}
/**
* @Description: 获得查看按钮
* @author chenxw
* @param type
* @param buttonName
* @return
*/
private ImageButton createShowButton(ShowType type) {
ImageButton button = new ImageButton(buttonComposite, SWT.NONE);
button.setRightMargin(10);
button.setLeftMargin(10);
button.setTopMargin(5);
button.setBottomMargin(5);
button.setRightMargin(10);
// button.setFont(SWTResourceManager.getFont("微软雅黑", 11, SWT.NORMAL));
button.setForeground(ColorConstants.FONT_BLACK_COLOR);
button.setActiveForeground(SWTResourceManager.getColor(255, 153, 0));
button.setSelectionForeground(ColorConstants.FONT_BLUE_COLOR);
button.setData(type.getKey());
button.setText(type.getName());
button.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) {
curShowButton.setSelection(false);
curShowButton = button;
curShowButton.setSelection(true);
showType = type;
PropertiesUtils.saveProperty(ConfigConstants.SHOW_TYPE, type.getKey());
refreshShowComposite();
}
});
return button;
}
/** /**
* @Description: 显示投标文件或 招标文件 * @Description: 显示投标文件或 招标文件
* @author guoyr * @author guoyr
...@@ -893,7 +968,7 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -893,7 +968,7 @@ public class FactorEvaluationComposite extends EvaluationView {
*/ */
private void init() { private void init() {
menuFunctionUtils.initFunctionAuthority(menu); menuFunctionUtils.initFunctionAuthority(menu);
initShowButton();
initLayoutPanelGroup(); initLayoutPanelGroup();
initFilePanelGroup(); initFilePanelGroup();
initOpinionGroup(); initOpinionGroup();
...@@ -1383,6 +1458,29 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -1383,6 +1458,29 @@ public class FactorEvaluationComposite extends EvaluationView {
opinionComposite.layout(); opinionComposite.layout();
} }
private void refreshShowComposite() {
// supplier_name.setText(curSupplier.getSupplierName());
switch (showType) {
case FILE:
opinionStackLayout.topControl = viewContentComposite;
showBidFileAction();
break;
// case OPINION:
// opinionStackLayout.topControl = factorOpinionComposite;
// showFactorOpenionAction();
// break;
case COMPARISON_TABLE:
opinionStackLayout.topControl = templateTableListComposite;
templateTableListComposite.refresh(curTender.getId(), curEvaluationFactor.getFactorCode(), supplierList);
break;
// case STRUCT:
// showStackLayout.topControl = structComposite;
// showStructTableAction();
// break;
}
opinionComposite.layout();
}
/** /**
* @Description: 选中投标人或指标 * @Description: 选中投标人或指标
* @author guoyr * @author guoyr
...@@ -1392,6 +1490,7 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -1392,6 +1490,7 @@ public class FactorEvaluationComposite extends EvaluationView {
private void selectSupplierAndFactorAction(Supplier supplier, EvaluationFactor evaluationFactor, ExpertEvaluationResult expertEvaluationResult) { private void selectSupplierAndFactorAction(Supplier supplier, EvaluationFactor evaluationFactor, ExpertEvaluationResult expertEvaluationResult) {
curEvaluationFactor = evaluationFactor; curEvaluationFactor = evaluationFactor;
// 如果不是在比选界面 // 如果不是在比选界面
refreshShowComposite();
if (null != supplier) { if (null != supplier) {
if (null == curSupplier || (null != curSupplier && !curSupplier.getId().equals(supplier.getId()))) { if (null == curSupplier || (null != curSupplier && !curSupplier.getId().equals(supplier.getId()))) {
// 显示供应商的投标文件 // 显示供应商的投标文件
...@@ -1452,6 +1551,38 @@ public class FactorEvaluationComposite extends EvaluationView { ...@@ -1452,6 +1551,38 @@ public class FactorEvaluationComposite extends EvaluationView {
} }
} }
private void showBidFileAction() {
listSupplierBidFiles(curSupplier);
fileStackLayout.topControl = bidFileComposite;
fileComposite.layout();
// 在只显示评标面板时不加载文件
if (evaluationPanelOnly) return;
// fileAndPanelbothAction(evalPanlGoientation);
// 显示当前指标的评审点
listFactorEvaluationPoints(curSupplier, curEvaluationFactor);
// 如果未能通过评审点定位文件,则直接定位供应商的文件
if (!locationBidFileByFactorPointAction()) {
loacationBidFileByDocumtntAction();
}
if (bidFileGrid.getSelectionCount() > 0) {
// 如果显示所有评审点的界面,则刷新所有评审点
if (null != showEvalPointShell && !showEvalPointShell.isDisposed()) {
// 根据投标人加载投标分册和评审点
if (!ObjectUtils.getObjString(showEvalPointShell.getData("supplierId")).equals(curSupplier.getId())) {
showEvalPointShell.refreshEvalPointGrid(curTender.getId(), curSupplier.getId());
showEvalPointShell.setData("supplierId", curSupplier.getId());
}
}
}
}
/** /**
* @Description: 列出当前指标的评审点 * @Description: 列出当前指标的评审点
* @author guoyr * @author guoyr
......
...@@ -619,6 +619,12 @@ public class BidOpeningHallComposite extends Composite { ...@@ -619,6 +619,12 @@ public class BidOpeningHallComposite extends Composite {
}); });
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}; };
new NewUpdateTenderProjectInfoThread(tenderProjectEntity, listener).start(); new NewUpdateTenderProjectInfoThread(tenderProjectEntity, listener).start();
......
...@@ -280,7 +280,13 @@ public class SubTenderProjectEnterMenuComposite extends Composite implements Act ...@@ -280,7 +280,13 @@ public class SubTenderProjectEnterMenuComposite extends Composite implements Act
new AutoVerifyUserRemotePasswordThread(tenderProject,Constants.USER.getEncodePassWord()).start(); new AutoVerifyUserRemotePasswordThread(tenderProject,Constants.USER.getEncodePassWord()).start();
// 如果未获取最新投标信息,则自动获取 // 如果未获取最新投标信息,则自动获取
if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){ if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){
new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){}).start(); new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}}).start();
} }
tenderNoLabel.addMouseListener(new ChangeTextListener()); tenderNoLabel.addMouseListener(new ChangeTextListener());
} }
......
...@@ -250,7 +250,13 @@ public class TenderProjectEnterMenuComposite extends Composite implements Action ...@@ -250,7 +250,13 @@ public class TenderProjectEnterMenuComposite extends Composite implements Action
// 如果未获取最新投标信息,则自动获取 // 如果未获取最新投标信息,则自动获取
if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){ if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){
new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){}).start(); new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}}).start();
} }
tenderNoLabel.addMouseListener(new ChangeTextListener()); tenderNoLabel.addMouseListener(new ChangeTextListener());
tenderNameLabel.addMouseListener(new ChangeTextListener()); tenderNameLabel.addMouseListener(new ChangeTextListener());
......
...@@ -86,6 +86,12 @@ public class MultyProjectFocusDecryptBidFilThread implements Runnable{ ...@@ -86,6 +86,12 @@ public class MultyProjectFocusDecryptBidFilThread implements Runnable{
} }
showMessage(flag, tenderProjectEntity); showMessage(flag, tenderProjectEntity);
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
batchFocusDecryptBidFilThread.start(); batchFocusDecryptBidFilThread.start();
myRunnableList.add(batchFocusDecryptBidFilThread); myRunnableList.add(batchFocusDecryptBidFilThread);
...@@ -98,6 +104,12 @@ public class MultyProjectFocusDecryptBidFilThread implements Runnable{ ...@@ -98,6 +104,12 @@ public class MultyProjectFocusDecryptBidFilThread implements Runnable{
startRemoteBidOpeningListener.startRemoteBidOpening(flag, tenderProjectService.getTenderPackOpeningInfo(tenderProjectEntity.getId(), bidopeningStage), ""); startRemoteBidOpeningListener.startRemoteBidOpening(flag, tenderProjectService.getTenderPackOpeningInfo(tenderProjectEntity.getId(), bidopeningStage), "");
showMessage(flag, tenderProjectEntity); showMessage(flag, tenderProjectEntity);
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}, synchronizedInfoOnly); }, synchronizedInfoOnly);
startRemoteDecryptBidFilThread.start(); startRemoteDecryptBidFilThread.start();
myRunnableList.add(startRemoteDecryptBidFilThread); myRunnableList.add(startRemoteDecryptBidFilThread);
......
...@@ -82,6 +82,12 @@ public class MultyProjectRemoteDecryptBidFilThread implements Runnable{ ...@@ -82,6 +82,12 @@ public class MultyProjectRemoteDecryptBidFilThread implements Runnable{
} }
showMessage(flag, tenderProjectEntity); showMessage(flag, tenderProjectEntity);
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
batchRemoteDecryptBidFilThread.start(); batchRemoteDecryptBidFilThread.start();
myRunnableList.add(batchRemoteDecryptBidFilThread); myRunnableList.add(batchRemoteDecryptBidFilThread);
...@@ -94,6 +100,12 @@ public class MultyProjectRemoteDecryptBidFilThread implements Runnable{ ...@@ -94,6 +100,12 @@ public class MultyProjectRemoteDecryptBidFilThread implements Runnable{
startRemoteBidOpeningListener.startRemoteBidOpening(flag, tenderProjectService.getTenderPackOpeningInfo(tenderProjectEntity.getId(), bidopeningStage), ""); startRemoteBidOpeningListener.startRemoteBidOpening(flag, tenderProjectService.getTenderPackOpeningInfo(tenderProjectEntity.getId(), bidopeningStage), "");
showMessage(flag, tenderProjectEntity); showMessage(flag, tenderProjectEntity);
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}, synchronizedInfoOnly); }, synchronizedInfoOnly);
startRemoteDecryptBidFilThread.start(); startRemoteDecryptBidFilThread.start();
myRunnableList.add(startRemoteDecryptBidFilThread); myRunnableList.add(startRemoteDecryptBidFilThread);
......
...@@ -76,6 +76,12 @@ public class MultyProjectRemoteStartBidopeningHallThread implements Runnable{ ...@@ -76,6 +76,12 @@ public class MultyProjectRemoteStartBidopeningHallThread implements Runnable{
callBack.message(MessageFormat.format(Messages.Tips_startProjectOpeningHallFail, tenderProjectEntity.getTenderName()), -1); callBack.message(MessageFormat.format(Messages.Tips_startProjectOpeningHallFail, tenderProjectEntity.getTenderName()), -1);
} }
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
// new OpenRemoteHallListener(){ // new OpenRemoteHallListener(){
// public void openRemoteHall(final boolean openRemoteHall, TenderProjectEntity tenderProjectEntity, String msg){ // public void openRemoteHall(final boolean openRemoteHall, TenderProjectEntity tenderProjectEntity, String msg){
...@@ -101,6 +107,12 @@ public class MultyProjectRemoteStartBidopeningHallThread implements Runnable{ ...@@ -101,6 +107,12 @@ public class MultyProjectRemoteStartBidopeningHallThread implements Runnable{
callBack.message(MessageFormat.format(Messages.Tips_startProjectOpeningHallFail, tenderProjectEntity.getTenderName()), -1); callBack.message(MessageFormat.format(Messages.Tips_startProjectOpeningHallFail, tenderProjectEntity.getTenderName()), -1);
} }
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
// new OpenRemoteHallListener(){ // new OpenRemoteHallListener(){
// public void openRemoteHall(final boolean openRemoteHall, TenderProjectEntity tenderProjectEntity, String msg){ // public void openRemoteHall(final boolean openRemoteHall, TenderProjectEntity tenderProjectEntity, String msg){
......
...@@ -138,6 +138,12 @@ public class MultyProjectUploadBidOpeningResultThread implements Runnable{ ...@@ -138,6 +138,12 @@ public class MultyProjectUploadBidOpeningResultThread implements Runnable{
listener.showMessage(-1, "["+projectOpeningInfo.getTenderProject().getTenderNo() + projectOpeningInfo.getTenderProject().getTenderName() +"]完成开标并上传结果失败!"); listener.showMessage(-1, "["+projectOpeningInfo.getTenderProject().getTenderNo() + projectOpeningInfo.getTenderProject().getTenderName() +"]完成开标并上传结果失败!");
} }
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
uploadBidOpeningResultThread.start(); uploadBidOpeningResultThread.start();
listener.showMessage(0, "[" + projectOpeningInfo.getTenderProject().getTenderName() + "]正在完成并上传结果..."); listener.showMessage(0, "[" + projectOpeningInfo.getTenderProject().getTenderName() + "]正在完成并上传结果...");
......
...@@ -10,7 +10,9 @@ Require-Bundle: org.eclipse.ui, ...@@ -10,7 +10,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.swt.core, org.eclipse.swt.core,
com.gx.obe.common.icons, com.gx.obe.common.icons,
com.gx.obe.components.messages;bundle-version="1.0.0", com.gx.obe.components.messages;bundle-version="1.0.0",
com.gx.obe.business com.gx.obe.business,
com.gx.obe.component,
com.gx.obe.bind;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: OBE-ACTION Automatic-Module-Name: OBE-ACTION
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
......
package com.gx.obe.action.bean;
import org.eclipse.swt.widgets.Composite;
import com.gx.obe.action.listener.ActionListener;
import com.gx.obe.component.rx.RxSwt;
public abstract class FAction<T> extends Action {
@Override
public void run() {
ActionListener listener = this.getListener();
listener.onLoad(this);
RxSwt.run(this::supply).checkWidget(listener.getParentComposite()).exe(this::loadComposite);
}
private void loadComposite(T t) {
ActionListener listener = this.getListener();
listener.loadComposite(this, consume(listener.getParentComposite(), t));
}
protected abstract T supply();
protected abstract Composite consume(Composite parent, T t);
}
...@@ -7,13 +7,16 @@ import java.util.Map; ...@@ -7,13 +7,16 @@ import java.util.Map;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.gx.obe.business.entity.Result;
import com.gx.obe.business.entity.SupplierEvaluationFactor; import com.gx.obe.business.entity.SupplierEvaluationFactor;
import com.gx.obe.components.core.Constants; import com.gx.obe.components.core.Constants;
import com.gx.obe.web.utils.NetworkRequest; import com.gx.obe.web.utils.NetworkRequest;
import com.gx.obe.web.utils.ObeHttpUtils;
import com.gx.obe.http.json.JsonUtil; import com.gx.obe.http.json.JsonUtil;
import com.gx.obe.http.util.WebReflecUtill; import com.gx.obe.http.util.WebReflecUtill;
import com.gx.obe.web.utils.ResultStatus; import com.gx.obe.web.utils.ResultStatus;
import com.gx.obe.web.vo.BatchSaveOrUpdateVo; import com.gx.obe.web.vo.BatchSaveOrUpdateVo;
import com.gx.obe.web.vo.FactorClearBidContent;
import com.gx.obe.web.vo.UpdateAssignPropertyVo; import com.gx.obe.web.vo.UpdateAssignPropertyVo;
/** /**
...@@ -206,4 +209,36 @@ public class SupplierEvaluationFactorService { ...@@ -206,4 +209,36 @@ public class SupplierEvaluationFactorService {
return 0; return 0;
} }
} }
/**
* @Description: 计算指标清标意见
* @author chenxw
* @param stepId
* @return
*/
public Result<Void> calculateFactorClearBidOpinion(String stepId) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("stepId", stepId);
return ObeHttpUtils.getResult(URL + "/calculateFactorClearBidOpinion", param, Void.class);
}
/**
* @Description: 获取指标清标内容
* @author chenxw
* @param stepId
* @return
*/
public FactorClearBidContent getFactorClearBidContent(String stepId) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("stepId", stepId);
return ObeHttpUtils.getOne(URL + "/getFactorClearBidContent", param, FactorClearBidContent.class);
}
/**
* @Description: 获取打分指标清标内容
* @param tenderId
* @return
*/
public FactorClearBidContent getScoreFactorClearBidContent(String tenderId) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("tenderId", tenderId);
return ObeHttpUtils.getOne(URL + "/getScoreFactorClearBidContent", param, FactorClearBidContent.class);
}
} }
...@@ -6,8 +6,10 @@ import java.util.Map; ...@@ -6,8 +6,10 @@ import java.util.Map;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.gx.obe.business.entity.Result;
import com.gx.obe.components.core.Constants; import com.gx.obe.components.core.Constants;
import com.gx.obe.http.json.JsonUtil; import com.gx.obe.http.json.JsonUtil;
import com.gx.obe.http.jsons.JSONNull;
import com.gx.obe.web.utils.NetworkRequest; import com.gx.obe.web.utils.NetworkRequest;
import com.gx.obe.web.utils.ResultStatus; import com.gx.obe.web.utils.ResultStatus;
...@@ -50,5 +52,34 @@ public class ObeHttpUtils { ...@@ -50,5 +52,34 @@ public class ObeHttpUtils {
} }
return new ArrayList<>(); return new ArrayList<>();
} }
public static boolean getBoolean(String path, Map<String, Object> param) {
String strWebServerUrl = Constants.getServiceUrl(path);
try {
return ResultStatus.getReultStatusBoolean(NetworkRequest.get(strWebServerUrl, param));
} catch (Exception e) {
logger.error(e.getMessage(), e);
return false;
}
}
public static <T> Result<T> getResult(String path, Map<String, Object> param, Class<T> tclass) {
String strWebServerUrl = Constants.getServiceUrl(path);
try {
String result = NetworkRequest.get(strWebServerUrl, param);
if (ResultStatus.getReultStatusOK(result)) {
@SuppressWarnings("unchecked")
Result<T> jsonToBean = JsonUtil.jsonToBean(result, Result.class);
if (jsonToBean != null) {
T data = jsonToBean.getData();
if (data != null && data != JSONNull.NULL) {
jsonToBean.setData(JsonUtil.jsonToBean(data, tclass));
}
return jsonToBean;
}
}
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return null;
}
} }
package com.gx.obe.web.vo;
import java.util.List;
import com.gx.obe.business.entity.SupplierEvaluationFactor;
import com.gx.obe.web.entity.Supplier;
import com.gx.obe.web.entity.evaluation.EvaluationFactor;
public class FactorClearBidContent {
private List<Supplier> supplierList;
private List<EvaluationFactor> factorList;
private List<SupplierEvaluationFactor> supplierEvaluationFactorList;
public List<Supplier> getSupplierList() {
return supplierList;
}
public void setSupplierList(List<Supplier> supplierList) {
this.supplierList = supplierList;
}
public List<EvaluationFactor> getFactorList() {
return factorList;
}
public void setFactorList(List<EvaluationFactor> factorList) {
this.factorList = factorList;
}
public List<SupplierEvaluationFactor> getSupplierEvaluationFactorList() {
return supplierEvaluationFactorList;
}
public void setSupplierEvaluationFactorList(List<SupplierEvaluationFactor> supplierEvaluationFactorList) {
this.supplierEvaluationFactorList = supplierEvaluationFactorList;
}
}
\ No newline at end of file
package com.gx.utils;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.apache.log4j.Logger;
import com.gx.obe.message.Messages;
import com.gx.obe.web.service.ConnectionService;
/**
* @Description: 获取当前时间
* @author guoyr
*/
public class BusinessNowTimeUtils {
private static long NOW_TIME = 0l;
private static Calendar GET_DATETIME_START_CALLENDAR;// 记录获取当前时间的时间点
private static final String weak[] = {Messages.Weak_sun, Messages.Weak_mon, Messages.Weak_tues, Messages.Weak_wed, Messages.Weak_thur, Messages.Weak_fri, Messages.Weak_sat};
private static final String weakDay[] = {Messages.Weak_sunday, Messages.Weak_monday, Messages.Weak_tuesday, Messages.Weak_wednesday, Messages.Weak_thursday, Messages.Weak_friday, Messages.Weak_saturday};
// private static final String weakEn[] = {"Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat"};
// private static final String weakEnDay[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
private static Logger LOG = Logger.getLogger(BusinessNowTimeUtils.class);
public static String NOW_DATE_SOURCE = "本机时间";
private static boolean setTime = false;
private static ConnectionService connectionService = new ConnectionService();
/**
* @Description: 设置当前时间
* @author guoyr
* @param nowDate
*/
public static void setNowTime(Date nowDate){
Calendar cal = Calendar.getInstance();
cal.setTime(nowDate);
NOW_TIME = cal.getTimeInMillis();
GET_DATETIME_START_CALLENDAR = Calendar.getInstance();
// 标记为已设置当前时间
setTime = true;
LOG.info("license设置当前时间为:" + nowDate);
}
/**
* @Description: 获取数据库或时间服务器中的当前时间
* @author guoyr
* @return
*/
private static long getNowTime() {
// 如果还未设置当前时间
if(!setTime){
return new Date().getTime() ;
}
return NOW_TIME + (Calendar.getInstance().getTimeInMillis()-GET_DATETIME_START_CALLENDAR.getTimeInMillis());
}
/**
* @Description: 获得当前时间
* @author guoyr
* @return
*/
public static Date getNowDate(){
// 如果还未设置当前时间
if(!setTime){
return new Date();
}
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(getNowTime());
return calendar.getTime();
}
/**
* @Description: 获得当前年份
* @author guoyr
* @return
*/
public static int getYear() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(getNowDate());
return calendar.get(Calendar.YEAR);
}
/**
* @Description: 获得当前星期
* @author guoyr
* @return
*/
public static String getWeak(){
Calendar calendar = Calendar.getInstance();
calendar.setTime(getNowDate());
int dayOfWeak = calendar.get(Calendar.DAY_OF_WEEK)-1;
return weak[dayOfWeak];
}
/**
* @Description: 获得当前星期
* @author guoyr
* @return
*/
public static String getWeakDay(){
Calendar calendar = Calendar.getInstance();
calendar.setTime(getNowDate());
int dayOfWeak = calendar.get(Calendar.DAY_OF_WEEK)-1;
return weakDay[dayOfWeak];
}
/**
* @Description: 获得当前日期
* @author guoyr
* @return
*/
public static String getDate(){
return new SimpleDateFormat("yyyy-MM-dd").format(getNowDate());
}
/**
* @Description: 获得当前时间
* @author guoyr
* @return
*/
public static String getTime(){
return new SimpleDateFormat("HH:mm:ss").format(getNowDate());
}
/**
* @Description: 获得当前日期和时间
* @author guoyr
* @return
*/
public static String getDateTime(){
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(getNowDate());
}
/**
* @Description: 服务器的当前时间
* @author guoyr
* @return
*/
private static Date getServiceNowTime(){
Date nowDate = null;
long startTime = System.currentTimeMillis(); //获取开始时间
nowDate = connectionService.getServiceDate();
long endTime = System.currentTimeMillis(); //获取结束时间
if(null != nowDate){
long ms = endTime - startTime;
if(ms > 1000){
int second= (int) (ms / 1000);
Calendar calendar = Calendar.getInstance();
calendar.setTime(nowDate);
calendar.add(Calendar.SECOND, second);
nowDate = calendar.getTime();
}
}
return nowDate;
}
/**
* @Description: 获取时间服务器时间
* @author guoyr
* @return
*/
// private static Date getNowDateFormDateServer(){
// Date nowDate = null;
// try {
// String xmlStr = WebServiceUtil.invokeWebservice(PropertiesUtils.getWebserviceProperty(WebserviceConstants.WEBSERVICE_ADDRESS,"") + PropertiesUtils.getWebserviceProperty(WebserviceConstants.NOW_TIME_URL,""), PropertiesUtils.getWebserviceProperty(WebserviceConstants.NOW_TIME_METHOD,""), new Object[]{}, null);
// if(!"".equals(xmlStr)){
// Document document = DocumentHelper.parseText(xmlStr);
// Element root = document.getRootElement();
// String operTag = root.element("header").elementTextTrim("operTag");
// if(null != operTag && "Y".equals(operTag)){
// String timeStr = root.element("body").elementTextTrim("time");
// nowDate = DateUtils.toDate(timeStr);
// LOG.debug("获取时间服务器时间为" + nowDate);
// }else {
// LOG.error(root.element("header").elementTextTrim("operDesc"));
// LOG.error(root.element("header").elementTextTrim("operException"));
// }
// }else {
// LOG.error("获取时间服务器时间出错!");
// }
// } catch (Exception e) {
// LOG.error("", e);
// nowDate = null;
// }
// return nowDate;
// }
}
eclipse.preferences.version=1
encoding/<project>=UTF-8
...@@ -82,6 +82,11 @@ public class AutoDownloadProjectThread extends MyThread{ ...@@ -82,6 +82,11 @@ public class AutoDownloadProjectThread extends MyThread{
getNeedDownloadProjectList(); getNeedDownloadProjectList();
} }
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
thread.start(); thread.start();
...@@ -190,6 +195,12 @@ public class AutoDownloadProjectThread extends MyThread{ ...@@ -190,6 +195,12 @@ public class AutoDownloadProjectThread extends MyThread{
}else { }else {
tenderfailureSum ++; tenderfailureSum ++;
} }
}
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}; };
}); });
thread.start(); thread.start();
...@@ -212,6 +223,11 @@ public class AutoDownloadProjectThread extends MyThread{ ...@@ -212,6 +223,11 @@ public class AutoDownloadProjectThread extends MyThread{
}else { }else {
tenderfailureSum ++; tenderfailureSum ++;
} }
}
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}; };
}); });
downloadProjectInfoThread.start(); downloadProjectInfoThread.start();
......
...@@ -336,6 +336,12 @@ public class NewDownloadProjectInfoThread extends MyThread{ ...@@ -336,6 +336,12 @@ public class NewDownloadProjectInfoThread extends MyThread{
callBack.message(msg, flag); callBack.message(msg, flag);
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}; };
//下载投标人 //下载投标人
// NewDownloadSupplierThread downloadSupplierListThread = new NewDownloadSupplierThread(tenderProjectEntity, otherInfoLoadingListener); // NewDownloadSupplierThread downloadSupplierListThread = new NewDownloadSupplierThread(tenderProjectEntity, otherInfoLoadingListener);
......
...@@ -97,6 +97,12 @@ public class NewReDownloadProjectInfoThread extends MyThread{ ...@@ -97,6 +97,12 @@ public class NewReDownloadProjectInfoThread extends MyThread{
public void message(String msg, int flag) { public void message(String msg, int flag) {
callBack.message(msg, flag); callBack.message(msg, flag);
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}; };
} }
......
...@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.ui, ...@@ -9,7 +9,8 @@ Require-Bundle: org.eclipse.ui,
com.gx.obe.config, com.gx.obe.config,
com.gx.obe.utils, com.gx.obe.utils,
com.gx.obe.lib, com.gx.obe.lib,
com.gx.obe.components.messages;bundle-version="1.0.0" com.gx.obe.components.messages;bundle-version="1.0.0",
com.gx.obe.bind;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: com.gx.obe.components.core Automatic-Module-Name: com.gx.obe.components.core
Export-Package: com.fasterxml.jackson.annotation, Export-Package: com.fasterxml.jackson.annotation,
...@@ -47,6 +48,8 @@ Export-Package: com.fasterxml.jackson.annotation, ...@@ -47,6 +48,8 @@ Export-Package: com.fasterxml.jackson.annotation,
com.gx.obe.business.entity, com.gx.obe.business.entity,
com.gx.obe.components.core, com.gx.obe.components.core,
com.gx.obe.components.core.enumeration, com.gx.obe.components.core.enumeration,
com.gx.obe.components.core.global,
com.gx.obe.components.core.inter,
com.gx.obe.components.core.util, com.gx.obe.components.core.util,
com.gx.obe.components.core.vo, com.gx.obe.components.core.vo,
com.gx.obe.enttiytdo, com.gx.obe.enttiytdo,
......
...@@ -2,8 +2,12 @@ package com.gx.obe.business.entity; ...@@ -2,8 +2,12 @@ package com.gx.obe.business.entity;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import com.gx.obe.util.utils.SerializeUtils;
import com.gx.obe.util.utils.XmlAnnotation; import com.gx.obe.util.utils.XmlAnnotation;
/** /**
...@@ -86,6 +90,23 @@ public class SupplierEvaluationFactor { ...@@ -86,6 +90,23 @@ public class SupplierEvaluationFactor {
private int childCount = 0; private int childCount = 0;
private int level = 1; private int level = 1;
@XmlAnnotation(element = "paramValues")
private String paramValues;
/**
* 修改评议原因
*/
private String modifyReason;
/**
* 修改评议时间
*/
private Date modifyTime;
/**
* 修改评议人
*/
private String modifyUserName;
@XmlAnnotation(element = "remark") @XmlAnnotation(element = "remark")
private String opinion; private String opinion;
...@@ -94,8 +115,26 @@ public class SupplierEvaluationFactor { ...@@ -94,8 +115,26 @@ public class SupplierEvaluationFactor {
private String scoreStatus; private String scoreStatus;
private Map<String, Object> paramsMap = null;
private List<EvaluationFactorItem> evaluationFactorItemList = new ArrayList<EvaluationFactorItem>(); private List<EvaluationFactorItem> evaluationFactorItemList = new ArrayList<EvaluationFactorItem>();
/**
*
*/
private String respItemList;
@XmlAnnotation(element = "finance")
private String finance;
@XmlAnnotation(element = "performance")
private String performance;
@XmlAnnotation(element = "creditGrade")
private String creditGrade;
public void addChild(EvaluationFactorItem factor) { public void addChild(EvaluationFactorItem factor) {
evaluationFactorItemList.add(factor); evaluationFactorItemList.add(factor);
} }
...@@ -368,5 +407,118 @@ public class SupplierEvaluationFactor { ...@@ -368,5 +407,118 @@ public class SupplierEvaluationFactor {
public void setScoreStatus(String scoreStatus) { public void setScoreStatus(String scoreStatus) {
this.scoreStatus = scoreStatus; this.scoreStatus = scoreStatus;
} }
public String getModifyReason() {
return modifyReason;
}
public void setModifyReason(String modifyReason) {
this.modifyReason = modifyReason;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getModifyUserName() {
return modifyUserName;
}
public void setModifyUserName(String modifyUserName) {
this.modifyUserName = modifyUserName;
}
/**
* @Description: 为评标步骤设置参数
* @author guoyr
* @param paramKey
* @param featureList
*/
public void setParam(String paramKey, Object paramValue) {
if (null != computerParams) {
if (null == paramsMap) {
paramsMap = SerializeUtils.deserializeObject(getComputerParams());
}
}
if (null == paramsMap) {
paramsMap = new HashMap<String, Object>();
}
if (null != paramValue) {
paramsMap.put(paramKey, paramValue);
} else {
paramsMap.remove(paramKey);
}
if (paramsMap.isEmpty()) {
computerParams = null;
paramsMap = null;
} else {
computerParams = SerializeUtils.serializeObject(paramsMap);
}
}
/**
* @Description: 获得评标步骤的参数
* @author guoyr
* @param paramKey
* @return
*/
@SuppressWarnings("unchecked")
public <T> T getParamByKey(String paramKey) {
if (null != computerParams) {
if (null == paramsMap) {
paramsMap = SerializeUtils.deserializeObject(getComputerParams());
}
if (null != paramsMap) {
return (T) paramsMap.get(paramKey);
}
}
return null;
}
public String getParamValues() {
return paramValues;
}
public void setParamValues(String paramValues) {
this.paramValues = paramValues;
}
public String getPageNumber() {
return null == getParamByKey("pageNumber") ? "" : getParamByKey("pageNumber").toString();
}
public String getRespItemList() {
return respItemList;
}
public void setRespItemList(String respItemList) {
this.respItemList = respItemList;
}
public String getFinance() {
return finance;
}
public void setFinance(String finance) {
this.finance = finance;
}
public String getPerformance() {
return performance;
}
public void setPerformance(String performance) {
this.performance = performance;
}
public String getCreditGrade() {
return creditGrade;
}
public void setCreditGrade(String creditGrade) {
this.creditGrade = creditGrade;
}
} }
package com.gx.obe.components.core; package com.gx.obe.components.core;
import java.io.File;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import com.gx.obe.config.utils.ProjectUtils;
import com.gx.obe.config.utils.PropertiesUtils; import com.gx.obe.config.utils.PropertiesUtils;
import com.gx.obe.web.entity.auth.AuthUser; import com.gx.obe.web.entity.auth.AuthUser;
...@@ -7,6 +12,32 @@ public class Constants { ...@@ -7,6 +12,32 @@ public class Constants {
public static final String PRODUCE_EN_NAME = "OBE"; public static final String PRODUCE_EN_NAME = "OBE";
public static final String PRODUCE_VERSION = "V7.0"; public static final String PRODUCE_VERSION = "V7.0";
/**
* 招标文件目录
**/
public static String BIDDING_FILE_FOLDER = "biddingFile";
/**
* 投标文件目录
**/
public static String BID_FILE_FOLDER = "bidFile";
/**
* 系统的当前路径
**/
public static String PRODUCT_ROOT = getPluginPath(CoreActivator.getDefault());
public static String getPluginPath(AbstractUIPlugin plugin){
String root = ProjectUtils.toFullPath(plugin, "/");
// 如果前面有/,读取文件时找不到
if(root.charAt(0)=='/'){
root = root.substring(1);
}
return root;
// if(null == PRODUCT_ROOT || "".equals(PRODUCT_ROOT)){
//
// PRODUCT_ROOT = root;
// }
// return PRODUCT_ROOT;
}
/** /**
* 当前登录的用户 * 当前登录的用户
**/ **/
...@@ -194,5 +225,68 @@ public class Constants { ...@@ -194,5 +225,68 @@ public class Constants {
public static final String TIANYAN_CHECK_NOTE = "TIANYAN_CHECK_NOTE.pdf"; public static final String TIANYAN_CHECK_NOTE = "TIANYAN_CHECK_NOTE.pdf";
/**
* 标书文件路径
**/
public static String BID_FILE_PATH = PropertiesUtils.getProperty(com.gx.obe.config.ConfigConstants.BID_FILE_PATH, PRODUCT_ROOT).concat(File.separator);
/**
* @Description: 获得项目的投标文件路径
* @author guoyr
* @param tenderId
*/
public static String getBidFilePath(String tenderId){
return BID_FILE_PATH.concat(tenderId).concat(File.separator).concat(BID_FILE_FOLDER).concat(File.separator);
}
/**
* @Description: 获得投标人的投标文件路径
* @author guoyr
* @param tenderId
* @param supplierId
* @return
*/
public static String getBidFilePath(String tenderId, String supplierId){
return BID_FILE_PATH.concat(tenderId).concat(File.separator).concat(BID_FILE_FOLDER).concat(File.separator).concat(supplierId).concat(File.separator);
}
/**
* 投标信封 signType
*/
public static String SIGNTYPE = "DianJu";
public static String ETB = ".etb";// 电子投标文件
public static String EZG = ".etb";//".ezg";// 电子资格投标文件
public static String EZB = ".ezb";// 电子招标文件
public static String ECN = ".enc";
public static String ENC = ".enc";
public static String XLS = ".xls";
public static String PDF = ".pdf";
public static String DOC = ".doc";
public static String DOCX = ".docx";
public static String XML = ".xml";
public static String LOG = ".log";
public static String XLSX = ".xlsx";
public static String ZIP = ".zip";
/**
* @Description: 招标文件路径
* @author guoyr
*
* @param tenderId
* @return
*/
public static String getBiddingFilePath(String tenderId){
return BID_FILE_PATH.concat(tenderId).concat(File.separator).concat(BIDDING_FILE_FOLDER).concat(File.separator);
}
/**
* 招标ID
*/
public static final String BIDDING_ID = "biddingId";
public static String getAuxiliaryPlatformUrl(String str){
String strWebServerUrl = PropertiesUtils.getProperty(com.gx.obe.config.ConfigConstants.AUXILIARY_SERVICE_URL, "");
if(!strWebServerUrl.endsWith("/")){
strWebServerUrl = strWebServerUrl + "/";
}
return strWebServerUrl + str;
}
} }
...@@ -28,11 +28,14 @@ public class EvaluationStepEnum { ...@@ -28,11 +28,14 @@ public class EvaluationStepEnum {
public static final String BUSINESS_VETO = "18"; public static final String BUSINESS_VETO = "18";
public static final String FIXED_FACTOR = "21";// 定档 public static final String FIXED_FACTOR = "21";// 定档
public static final String ASSOCIATION_QUERY = "22";// 关联查询评审步骤 public static final String ASSOCIATION_QUERY = "22";// 关联查询评审步骤
public static final String FACTOR_CLEAR_BID = "23";
public static final String BILL_ZBT = "bill_zbt"; public static final String BILL_ZBT = "bill_zbt";
public static final String BILL_YT = "bill_yt"; public static final String BILL_YT = "bill_yt";
public static final String BILL_BZ = "bill_bz"; public static final String BILL_BZ = "bill_bz";
/**
* 参数:清标内容完成计算
*/
public static final String COMPLETE_CALCULATION = "COMPLETE_CALCULATION";
/** /**
* 是否对投标人进行筛选[00:不筛选;01:筛选] * 是否对投标人进行筛选[00:不筛选;01:筛选]
*/ */
...@@ -386,5 +389,6 @@ public class EvaluationStepEnum { ...@@ -386,5 +389,6 @@ public class EvaluationStepEnum {
* 打分评审强制录入意见 * 打分评审强制录入意见
*/ */
public static final String NEED_OPINION = "NEED_OPINION"; public static final String NEED_OPINION = "NEED_OPINION";
public static final String EVALUATION_FACTOR_TYPE = "EVALUATION_FACTOR_TYPE";
} }
package com.gx.obe.components.core.enumeration;
import java.util.Arrays;
import com.gx.obe.message.Messages;
public enum ShowType {
FILE("file", Messages.Button_veiwBidFile),
OPINION("opinion", "查看评议意见"),
COMPARISON_TABLE("comparisonTable", "查看对比表");
// STRUCT("struct", "查看结构化数据");
private String key;
private String name;
private ShowType(String key, String name) {
this.key = key;
this.name = name;
}
public String getKey() {
return key;
}
public String getName() {
return name;
}
public static ShowType getByKey(String key) {
return Arrays.stream(values()).filter(t -> t.getKey().equals(key)).findAny().get();
}
}
\ No newline at end of file
package com.gx.obe.components.core.global;
import org.eclipse.swt.widgets.Composite;
import com.gx.obe.components.core.inter.ExcelReport;
import com.gx.obe.components.core.inter.LoadPdfFileView;
import com.gx.obe.components.core.inter.PdfFileView;
public class Global {
/**
* @Description: Excel报表
*/
public static ExcelReport EXCEL_REPORT;
/**
* @Description: pdf文件显示器
*/
public static LoadPdfFileView PDF_FILE_VIEW = (Composite parent, int style) -> new PdfFileView() {
public void setFileNotExistMessage(String fileNotExistMessage) {}
public void setCacheNumber(int cacheNumber) {}
public void releaseFile(String filePath) {}
public void openFile(String filePath, int page) {}
public void openFile(String filePath) {}
};
}
package com.gx.obe.components.core.inter;
import java.util.Map;
import com.gx.obe.bind.promise.Promise;
import com.gx.obe.web.entity.tender.TenderProjectEntity;
public interface ExcelReport {
Promise<String> generate(TenderProjectEntity tenderProject, String templatePath, String reportOutPath, Map<String, Object> dateMap);
}
package com.gx.obe.components.core.inter;
import org.eclipse.swt.widgets.Composite;
public interface LoadPdfFileView {
PdfFileView load(Composite parent, int style);
}
package com.gx.obe.components.core.inter;
public interface PdfFileView {
void setFileNotExistMessage(String fileNotExistMessage);
void setCacheNumber(int cacheNumber);
void openFile(String filePath);
void openFile(String filePath, int page);
void releaseFile(String filePath);
}
...@@ -16,6 +16,21 @@ public class TableXML { ...@@ -16,6 +16,21 @@ public class TableXML {
private List<Tr> headList = new ArrayList<TableXML.Tr>(); private List<Tr> headList = new ArrayList<TableXML.Tr>();
private List<Tr> bodyList = new ArrayList<TableXML.Tr>(); private List<Tr> bodyList = new ArrayList<TableXML.Tr>();
public List<Tr> getHeadList() {
return headList;
}
public void setHeadList(List<Tr> headList) {
this.headList = headList;
}
public List<Tr> getBodyList() {
return bodyList;
}
public void setBodyList(List<Tr> bodyList) {
this.bodyList = bodyList;
}
/** /**
* @Description: 初始化 * @Description: 初始化
* @author chenxw * @author chenxw
...@@ -150,16 +165,10 @@ public class TableXML { ...@@ -150,16 +165,10 @@ public class TableXML {
this.headList.add(tr); this.headList.add(tr);
} }
public List<Tr> getHeadList() {
return headList;
}
public void addBody(Tr tr) { public void addBody(Tr tr) {
this.bodyList.add(tr); this.bodyList.add(tr);
} }
public List<Tr> getBodyList() {
return bodyList;
}
} }
package com.gx.obe.components.core.vo;
public class Td {
private String colType;
private String content;
private int width;
private boolean needFill;
public String getColType() {
return colType;
}
public String getContent() {
return content;
}
public int getWidth() {
return width;
}
public void setColType(String colType) {
this.colType = colType;
}
public void setContent(String content) {
this.content = content;
}
public void setWidth(int width) {
this.width = width;
}
public boolean isNeedFill() {
return needFill;
}
public void setNeedFill(boolean needFill) {
this.needFill = needFill;
}
}
\ No newline at end of file
package com.gx.obe.components.core.vo;
public class Tr {
private Td[] tds;
private boolean isTitle;
private boolean isCount;
private String subjectTableID;
public void setTds(Td[] tds) {
this.tds = tds;
}
public Td[] getTds() {
return tds;
}
public void setTitle(boolean isTitle) {
this.isTitle = isTitle;
}
public boolean isTitle() {
return isTitle;
}
public void setSubjectTableID(String subjectTableID) {
this.subjectTableID = subjectTableID;
}
public String getSubjectTableID() {
return subjectTableID;
}
public void setCount(boolean isCount) {
this.isCount = isCount;
}
public boolean isCount() {
return isCount;
}
}
\ No newline at end of file
package com.gx.obe.web.entity.evaluation;
/**
* @Description: 评审内容
* @author chenxw
*/
public class EvaluationContent {
private String id;
private String tenderId;
private String factorCode;
private String relChapterType;
private String dataCategory;
private String dataCode;
private String evalRule;
private String tenderStructName;
private String evalPointName;
private Integer sortNo;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTenderId() {
return tenderId;
}
public void setTenderId(String tenderId) {
this.tenderId = tenderId;
}
public String getFactorCode() {
return factorCode;
}
public void setFactorCode(String factorCode) {
this.factorCode = factorCode;
}
public String getRelChapterType() {
return relChapterType;
}
public void setRelChapterType(String relChapterType) {
this.relChapterType = relChapterType;
}
public String getDataCategory() {
return dataCategory;
}
public void setDataCategory(String dataCategory) {
this.dataCategory = dataCategory;
}
public String getDataCode() {
return dataCode;
}
public void setDataCode(String dataCode) {
this.dataCode = dataCode;
}
public String getEvalRule() {
return evalRule;
}
public void setEvalRule(String evalRule) {
this.evalRule = evalRule;
}
public String getTenderStructName() {
return tenderStructName;
}
public void setTenderStructName(String tenderStructName) {
this.tenderStructName = tenderStructName;
}
public String getEvalPointName() {
return evalPointName;
}
public void setEvalPointName(String evalPointName) {
this.evalPointName = evalPointName;
}
public Integer getSortNo() {
return sortNo;
}
public void setSortNo(Integer sortNo) {
this.sortNo = sortNo;
}
}
\ No newline at end of file
...@@ -111,6 +111,15 @@ public class EvaluationFactor { ...@@ -111,6 +111,15 @@ public class EvaluationFactor {
private Integer childCount = 0; private Integer childCount = 0;
private Integer level = 1; private Integer level = 1;
/** 2022-10-26
* 智能评审规则存储属性(以json形式存储字符串)
*/
private String intelligentEval;
/**
* 智能评审规则
*/
private String remarks;
/** /**
* 添加子节点 * 添加子节点
...@@ -118,6 +127,15 @@ public class EvaluationFactor { ...@@ -118,6 +127,15 @@ public class EvaluationFactor {
* @param libraryNode * @param libraryNode
* 子节点 * 子节点
*/ */
private List<EvaluationContent> evaluationContentList;
public List<EvaluationContent> getEvaluationContentList() {
return evaluationContentList;
}
public void setEvaluationContentList(List<EvaluationContent> evaluationContentList) {
this.evaluationContentList = evaluationContentList;
}
public void addChild(EvaluationFactor factor) { public void addChild(EvaluationFactor factor) {
childFactorList.add(factor); childFactorList.add(factor);
} }
...@@ -397,5 +415,22 @@ public class EvaluationFactor { ...@@ -397,5 +415,22 @@ public class EvaluationFactor {
public AIDataParams getAIDataParams() { public AIDataParams getAIDataParams() {
return SerializeUtils.deserializeObject(dataParams); return SerializeUtils.deserializeObject(dataParams);
}
public String getIntelligentEval() {
return intelligentEval;
}
public void setIntelligentEval(String intelligentEval) {
this.intelligentEval = intelligentEval;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
} }
} }
...@@ -483,7 +483,10 @@ public class BidOpeningResultLoadComposite extends Composite { ...@@ -483,7 +483,10 @@ public class BidOpeningResultLoadComposite extends Composite {
public void run() { public void run() {
// 如果没有获取过最新投标信息,则自动下载供应商 // 如果没有获取过最新投标信息,则自动下载供应商
if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){ if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){
RefreshProjectSupplierTenderInfoThread thread = new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){}); RefreshProjectSupplierTenderInfoThread thread = new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){
public int getErrorMessagesSize() {
return 0;
}});
thread.start(); thread.start();
thread.join(); thread.join();
} }
......
...@@ -705,6 +705,11 @@ public class DownloadProjectDialog extends EDialog { ...@@ -705,6 +705,11 @@ public class DownloadProjectDialog extends EDialog {
public void finish(boolean flag) { public void finish(boolean flag) {
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}; };
List<Future<?>> allDownloadFutureList = new ArrayList<Future<?>>(); List<Future<?>> allDownloadFutureList = new ArrayList<Future<?>>();
......
...@@ -433,6 +433,12 @@ public class ServerAuthenticationDialog extends EDialog { ...@@ -433,6 +433,12 @@ public class ServerAuthenticationDialog extends EDialog {
} }
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
}); });
thread.start(); thread.start();
} }
......
#update #update
#Tue Oct 10 09:20:36 CST 2023 #Sat Nov 11 14:15:13 CST 2023
allowImportBidFile= allowImportBidFile=
decryptType=11 decryptType=11
controlBidOpening=01 controlBidOpening=01
...@@ -43,7 +43,7 @@ defaultStepProgress=02 ...@@ -43,7 +43,7 @@ defaultStepProgress=02
passwordPattern=^(?\![0-9]+$)(?\![a-zA-Z]+$)[0-9A-Za-z\!@\#$%^&*?]{6,10}$ passwordPattern=^(?\![0-9]+$)(?\![a-zA-Z]+$)[0-9A-Za-z\!@\#$%^&*?]{6,10}$
rebackEvaluation=01 rebackEvaluation=01
monitoringCenterAddress=http\://1.202.77.139\:9587/ monitoringCenterAddress=http\://1.202.77.139\:9587/
properties_path=/D\:/Developer/EclipseTool/eclipse-rcp-photon-R-win32/../../../GitHub/\u4EAC\u80FD/jingneng/OBE-CONFIG/config.properties properties_path=/E\:/gitWorkSpace/v7/jingneng/OBE-CONFIG/config.properties
templateUpdateTime=2023-09-14 13\:11\:12 templateUpdateTime=2023-09-14 13\:11\:12
appServiceIsParallel=true appServiceIsParallel=true
serverName=\u4EAC\u80FD\u96C6\u56E2\u7535\u5B50\u5546\u52A1\u5E73\u53F0(\u6D4B\u8BD5) serverName=\u4EAC\u80FD\u96C6\u56E2\u7535\u5B50\u5546\u52A1\u5E73\u53F0(\u6D4B\u8BD5)
...@@ -100,6 +100,7 @@ appServiceSignMode=RSA ...@@ -100,6 +100,7 @@ appServiceSignMode=RSA
evalFullScreen=01 evalFullScreen=01
netService=JNJTService netService=JNJTService
ifShowVideoCloseButton=1 ifShowVideoCloseButton=1
showType=comparisonTable
batchFileSignature=01 batchFileSignature=01
bidOpeningFullscreen=00 bidOpeningFullscreen=00
caSignaturePdf= caSignaturePdf=
...@@ -142,28 +143,28 @@ lastDownloadProjectTime=1696900836876 ...@@ -142,28 +143,28 @@ lastDownloadProjectTime=1696900836876
defaultRecommonedCount= defaultRecommonedCount=
passwordPatternTips=\u5BC6\u7801\u5FC5\u987B\u5305\u542B\u5B57\u6BCD\u548C\u6570\u5B57\uFF0C\u4E14\u57286~10\u4F4D\u4E4B\u95F4\uFF01 passwordPatternTips=\u5BC6\u7801\u5FC5\u987B\u5305\u542B\u5B57\u6BCD\u548C\u6570\u5B57\uFF0C\u4E14\u57286~10\u4F4D\u4E4B\u95F4\uFF01
lockStep= lockStep=
saomaSignaturePdf=
evalBidRoomId=aadd606ff7c1445184b9ad780c5feb60 evalBidRoomId=aadd606ff7c1445184b9ad780c5feb60
saomaSignaturePdf=
oldCharsetName= oldCharsetName=
newCharsetName= newCharsetName=
isAIEvaluation=00 isAIEvaluation=00
excelRowStart=2 excelRowStart=2
volume=100
groupByEvalBidRoom=00 groupByEvalBidRoom=00
obeLicenseServerUrl=http\://127.0.0.1\:8080/ volume=100
verifyEvalMachineExpert=00 verifyEvalMachineExpert=00
obeLicenseServerUrl=http\://127.0.0.1\:8080/
checkNewVersion=01 checkNewVersion=01
gfaServiceAddress=http\://60.209.80.97\:28443/soa/WSMServlet gfaServiceAddress=http\://60.209.80.97\:28443/soa/WSMServlet
videoMeetingUrl=114.116.148.159\:8181 videoMeetingUrl=114.116.148.159\:8181
versionUpdateType=OBE_Service versionUpdateType=OBE_Service
creditChinaDetialURL=https\://test.powerbeijing-ec.com/jndzzb/creditChinaController.do?getZhixingDetail&creditNo\= creditChinaDetialURL=https\://test.powerbeijing-ec.com/jndzzb/creditChinaController.do?getZhixingDetail&creditNo\=
qrCodeServcerAddress=http\://39.96.40.58\:8811/gxapp/scanning/
zipEncoding=GBK zipEncoding=GBK
viewEvaluationResult=01 qrCodeServcerAddress=http\://39.96.40.58\:8811/gxapp/scanning/
bidOpeningSupplierSytle=01 bidOpeningSupplierSytle=01
viewEvaluationResult=01
isUseAutomaticDownload=01 isUseAutomaticDownload=01
faceCompare=http\://1.202.77.139\:8001/api/face/compare
torrentServer= torrentServer=
faceCompare=http\://1.202.77.139\:8001/api/face/compare
bidFilePath=c\:\\bidFile bidFilePath=c\:\\bidFile
lessThanThreeFilter= lessThanThreeFilter=
ftpBuffersize=1024 ftpBuffersize=1024
...@@ -171,5 +172,5 @@ expertLimit= ...@@ -171,5 +172,5 @@ expertLimit=
useSpecialPdf=01 useSpecialPdf=01
speed=0 speed=0
bidFileCacheCount=5 bidFileCacheCount=5
obeWebServerUrl=http\://127.0.0.1\:9863/
OPENOFFICE_SERVER_port=8100 OPENOFFICE_SERVER_port=8100
obeWebServerUrl=http\://47.95.161.231\:6850/
...@@ -669,5 +669,13 @@ public class ConfigConstants { ...@@ -669,5 +669,13 @@ public class ConfigConstants {
} }
return false; return false;
} }
//web服务端地址
public static final String AUXILIARY_SERVICE_URL = "auxiliaryServiceUrl";
/**
* 评标界面标书区域是否默认显示清标意见
*/
// public static final String IS_SHOW_FACTOR_OPINION = "isShowFactorOpinion";
public static final String SHOW_TYPE = "showType";
} }
...@@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.ui, ...@@ -33,7 +33,8 @@ Require-Bundle: org.eclipse.ui,
com.gx.obe.software;bundle-version="1.0.0", com.gx.obe.software;bundle-version="1.0.0",
com.gx.obe.meeting;bundle-version="1.0.0", com.gx.obe.meeting;bundle-version="1.0.0",
com.gx.obe.step, com.gx.obe.step,
com.gx.obe.template;bundle-version="1.0.0" com.gx.obe.template;bundle-version="1.0.0",
com.gx.obe.struct;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: com.gx.obe.management Automatic-Module-Name: com.gx.obe.management
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
......
...@@ -9,8 +9,10 @@ import java.util.List; ...@@ -9,8 +9,10 @@ import java.util.List;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.core.CallBack; import org.eclipse.swt.core.CallBack;
import org.eclipse.swt.core.MessageDialog; import org.eclipse.swt.core.MessageDialog;
import org.eclipse.swt.core.listener.LoadingAdatper;
import org.eclipse.swt.core.utils.FileDialogUtils; import org.eclipse.swt.core.utils.FileDialogUtils;
import org.eclipse.swt.core.utils.WidgetUtils; import org.eclipse.swt.core.utils.WidgetUtils;
import org.eclipse.swt.core.widgets.ConfirmDialog;
import org.eclipse.swt.core.widgets.ELink; import org.eclipse.swt.core.widgets.ELink;
import org.eclipse.swt.core.widgets.ESepator; import org.eclipse.swt.core.widgets.ESepator;
import org.eclipse.swt.core.widgets.ImageButton; import org.eclipse.swt.core.widgets.ImageButton;
...@@ -35,6 +37,7 @@ import com.gx.obe.common.dialog.BidRegulationsConfigDialog; ...@@ -35,6 +37,7 @@ import com.gx.obe.common.dialog.BidRegulationsConfigDialog;
import com.gx.obe.common.file.enumeration.FileConstants; import com.gx.obe.common.file.enumeration.FileConstants;
import com.gx.obe.common.icons.IconsActivator; import com.gx.obe.common.icons.IconsActivator;
import com.gx.obe.common.widget.dialog.MessageViewDialog; import com.gx.obe.common.widget.dialog.MessageViewDialog;
import com.gx.obe.common.widget.shell.ProgressMessageDialog;
import com.gx.obe.common.widget.thread.MyRunnable; import com.gx.obe.common.widget.thread.MyRunnable;
import com.gx.obe.common.widget.thread.SyncThread; import com.gx.obe.common.widget.thread.SyncThread;
import com.gx.obe.common.widget.utils.MenuFunctionUtils; import com.gx.obe.common.widget.utils.MenuFunctionUtils;
...@@ -53,6 +56,7 @@ import com.gx.obe.management.thread.ImportBillOfQuantitiesThread; ...@@ -53,6 +56,7 @@ import com.gx.obe.management.thread.ImportBillOfQuantitiesThread;
import com.gx.obe.management.thread.NewExportEvaluationFactorThread; import com.gx.obe.management.thread.NewExportEvaluationFactorThread;
import com.gx.obe.management.thread.SupplierEvaluationFactorXmlResolverThread; import com.gx.obe.management.thread.SupplierEvaluationFactorXmlResolverThread;
import com.gx.obe.message.Messages; import com.gx.obe.message.Messages;
import com.gx.obe.struct.thread.ParsingStructThread;
import com.gx.obe.thread.SyncThreadSet; import com.gx.obe.thread.SyncThreadSet;
import com.gx.obe.util.utils.CollectionUtils; import com.gx.obe.util.utils.CollectionUtils;
import com.gx.obe.util.utils.LogUtils; import com.gx.obe.util.utils.LogUtils;
...@@ -100,6 +104,7 @@ public class EvaluationFactorsManagerComposite extends Composite { ...@@ -100,6 +104,7 @@ public class EvaluationFactorsManagerComposite extends Composite {
private boolean isInProgress = false; private boolean isInProgress = false;
private boolean returnFlag = false; private boolean returnFlag = false;
private MenuFunctionUtils menuFunctionUtils = new MenuFunctionUtils(); private MenuFunctionUtils menuFunctionUtils = new MenuFunctionUtils();
private ELink importStructInfoLink;
{ {
LogUtils.logClass(EvaluationFactorsManagerComposite.class); LogUtils.logClass(EvaluationFactorsManagerComposite.class);
...@@ -230,6 +235,17 @@ public class EvaluationFactorsManagerComposite extends Composite { ...@@ -230,6 +235,17 @@ public class EvaluationFactorsManagerComposite extends Composite {
importsupplierFactorResponse.setText(Messages.Button_analysisResponse); importsupplierFactorResponse.setText(Messages.Button_analysisResponse);
menuFunctionUtils.addFunction(importsupplierFactorResponse, "ANALYSIS_RESPONSE"); menuFunctionUtils.addFunction(importsupplierFactorResponse, "ANALYSIS_RESPONSE");
importStructInfoLink = new ELink(eval_method_composite, SWT.WRAP);
importStructInfoLink.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) {
importStructInfoAction();
}
});
importStructInfoLink.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, "icons/btn/blue/import.png"));
importStructInfoLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
importStructInfoLink.setText("一键解析结构化数据");
importBillOfQuantities = new ELink(eval_method_composite, SWT.WRAP); importBillOfQuantities = new ELink(eval_method_composite, SWT.WRAP);
importBillOfQuantities.addMouseListener(new MouseAdapter() { importBillOfQuantities.addMouseListener(new MouseAdapter() {
public void mouseUp(MouseEvent e) { public void mouseUp(MouseEvent e) {
...@@ -1024,7 +1040,34 @@ public class EvaluationFactorsManagerComposite extends Composite { ...@@ -1024,7 +1040,34 @@ public class EvaluationFactorsManagerComposite extends Composite {
thread.start(); thread.start();
} }
} }
/**
* @Description: 解析结构化数据
* @author huangzhong
*/
private void importStructInfoAction() {
// MessageViewDialog dialog = new MessageViewDialog(getShell(), -1);
// dialog.setTitle("解析结构化数据");
// new Thread(new ParsingStructThread(tenderProjectEntity.getId(), dialog.getCallBack())).start();
// dialog.open();
ConfirmDialog confirmDialog = new ConfirmDialog(getShell(), null, "确认已下载标书文件并解析结构化数据吗? ", null);
confirmDialog.addButton("一键解析", "01", null);
confirmDialog.addCancel(Messages.Button_close, null);
confirmDialog.open();
if(!confirmDialog.getClickStatus().equals("01")){
return;
}
ProgressMessageDialog messageProgress = new ProgressMessageDialog(getShell(), false, -1, new LoadingAdatper() {
public void finish(boolean flag) {
}
});
messageProgress.setTitle("一键解析结构化数据");
messageProgress.setOperateVisible(true);
messageProgress.setCountDownTime(2);
new Thread(new ParsingStructThread(tenderProjectEntity, messageProgress)).start();
messageProgress.open();
}
/** /**
* @Description: 验证是否已经进入评分环节 * @Description: 验证是否已经进入评分环节
* @author guoyr * @author guoyr
......
...@@ -409,7 +409,13 @@ public class SubPackageMenuEnterComposite extends Composite implements ActionLis ...@@ -409,7 +409,13 @@ public class SubPackageMenuEnterComposite extends Composite implements ActionLis
public void run() { public void run() {
// 如果未获取最新投标信息,则自动获取 // 如果未获取最新投标信息,则自动获取
if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){ if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){
new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){}).start(); new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}}).start();
}else if(!CommonEnum.YES.equals(tenderProject.getIsPack())) { }else if(!CommonEnum.YES.equals(tenderProject.getIsPack())) {
//京能不要自动下载专家 //京能不要自动下载专家
if(!MenuFunction.HIDE.equals(menuFunctionUtils.getAuthority(MenuFunctionEnum.AUTO_DOWN_EXPERT))){ if(!MenuFunction.HIDE.equals(menuFunctionUtils.getAuthority(MenuFunctionEnum.AUTO_DOWN_EXPERT))){
......
...@@ -285,7 +285,13 @@ public class TenderProjectEnterMenuComposite extends Composite implements Action ...@@ -285,7 +285,13 @@ public class TenderProjectEnterMenuComposite extends Composite implements Action
public void run() { public void run() {
// 如果未获取最新投标信息,则自动获取 // 如果未获取最新投标信息,则自动获取
if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){ if(!tenderProjectService.isGetLatestBidinfo(tenderProject.getId())){
new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){}).start(); new RefreshProjectSupplierTenderInfoThread(tenderProject, new ProgressMessageAdapter(){
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}}).start();
}else if(!CommonEnum.YES.equals(tenderProject.getIsPack())) { }else if(!CommonEnum.YES.equals(tenderProject.getIsPack())) {
//京能不要自动下载 //京能不要自动下载
if(!MenuFunction.HIDE.equals(menuFunctionUtils.getAuthority(MenuFunctionEnum.AUTO_DOWN_EXPERT))){ if(!MenuFunction.HIDE.equals(menuFunctionUtils.getAuthority(MenuFunctionEnum.AUTO_DOWN_EXPERT))){
......
...@@ -18,6 +18,7 @@ Bundle-ClassPath: ., ...@@ -18,6 +18,7 @@ Bundle-ClassPath: .,
lib/aspectjweaver-1.9.1.jar, lib/aspectjweaver-1.9.1.jar,
lib/aspose-words-14.9.0-jdk16.jar lib/aspose-words-14.9.0-jdk16.jar
Export-Package: com.gx.obe.util, Export-Package: com.gx.obe.util,
com.gx.obe.util.element,
com.gx.obe.util.entity, com.gx.obe.util.entity,
com.gx.obe.util.pdf, com.gx.obe.util.pdf,
com.gx.obe.util.thread, com.gx.obe.util.thread,
......
package com.gx.obe.util.element;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
public class ElementClass<T> {
private Class<T> tClass;
private List<FieldInfo> fieldInfoList;
public static <T> ElementClass<T> of(Class<T> tClass) {
return new ElementClass<>(tClass);
}
public ElementClass(Class<T> tClass) {
this.tClass = tClass;
this.fieldInfoList = Arrays.stream(tClass.getDeclaredFields()).map(this::createFieldInfo).filter(t -> t != null).collect(Collectors.toList());;
}
private FieldInfo createFieldInfo(Field field) {
PropertyDescriptor descriptor = null;
try {
descriptor = new PropertyDescriptor(field.getName(), tClass);
} catch (IntrospectionException e) {
return null;
}
return new FieldInfo(field, descriptor.getWriteMethod());
}
public T create(Element element) {
T t;
try {
t = tClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
return null;
}
fieldInfoList.forEach(fieldInfo -> fieldInfo.mapValue(t, element));
return t;
}
public List<T> createList(Element element) {
List<?> elements = element.elements();
return elements.stream().map(t -> create((Element) t)).collect(Collectors.toList());
}
public T create(String xml) {
try {
return create(DocumentHelper.parseText(xml).getRootElement());
} catch (DocumentException e) {
throw new RuntimeException(e);
}
}
public List<T> createList(String xml) {
try {
return createList(DocumentHelper.parseText(xml).getRootElement());
} catch (DocumentException e) {
throw new RuntimeException(e);
}
}
}
package com.gx.obe.util.element;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.util.List;
import java.util.stream.Collectors;
import org.dom4j.Element;
import com.gx.obe.util.utils.ElementUtils;
public class FieldInfo {
private String name;
private Method writeMethod;
private FieldType type;
private Class<?> fClass;
public FieldInfo(Field field, Method writeMethod) {
this.name = field.getName();
this.writeMethod = writeMethod;
this.fClass = field.getType();
if (fClass == String.class) this.type = FieldType.STRING;
else if (fClass == List.class) {
ParameterizedType parameterizedType = (ParameterizedType) field.getGenericType();
this.fClass = (Class<?>) parameterizedType.getActualTypeArguments()[0];
this.type = fClass == String.class ? FieldType.LIST_STRING : FieldType.LIST_OBJECT;
} else this.type = FieldType.OBJECT;
}
public void mapValue(Object obj, Element element) {
Object value = getValue(element);
if (value == null) return;
try {
writeMethod.invoke(obj, value);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {}
}
private Object getValue(Element element) {
Element fieldElement = element.element(name);
if (fieldElement == null) return null;
List<?> elements = fieldElement.elements();
switch (type) {
case STRING:
return fieldElement.getTextTrim();
case OBJECT:
return ElementClass.of(fClass).create(fieldElement);
case LIST_STRING:
return elements.stream().map(ElementUtils::as).map(Element::getTextTrim).collect(Collectors.toList());
case LIST_OBJECT:
return elements.stream().map(ElementUtils::as).map(ElementClass.of(fClass)::create).collect(Collectors.toList());
default:
return null;
}
}
public enum FieldType {
STRING, OBJECT, LIST_STRING, LIST_OBJECT;
}
}
package com.gx.obe.util.utils;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Stream;
import org.dom4j.Element;
public class ElementUtils {
public static Function<Element, Stream<Element>> toStreamFun(String listName, String itemName) {
return e -> {
List<?> elements = Optional.ofNullable(e).map(t -> t.element(listName)).map(t -> t.elements(itemName)).orElse(null);
if (elements == null) return null;
return elements.stream().map(t -> (Element) t);
};
}
public static <T> Element as(T t) {
return (Element) t;
}
}
...@@ -15,6 +15,10 @@ public class Keys { ...@@ -15,6 +15,10 @@ public class Keys {
this.keys = keys; this.keys = keys;
} }
public static Keys of(Object... ks) {
return new Keys(ks);
}
@SafeVarargs @SafeVarargs
public static <T> Function<T, Keys> fun(Function<T, Object>... functionKeys) { public static <T> Function<T, Keys> fun(Function<T, Object>... functionKeys) {
return t -> new Keys(Arrays.stream(functionKeys).map(f -> f.apply(t)).toArray()); return t -> new Keys(Arrays.stream(functionKeys).map(f -> f.apply(t)).toArray());
......
package com.gx.obe.util.utils;
import java.util.function.Function;
import java.util.function.Predicate;
public class PredicateUtil {
public static <T, R> Predicate<T> get(Function<T, R> function, Predicate<R> predicate) {
return t -> predicate.test(function.apply(t));
}
}
...@@ -29,4 +29,24 @@ public class PredicateUtils { ...@@ -29,4 +29,24 @@ public class PredicateUtils {
return t -> predicate.test(function.apply(t)); return t -> predicate.test(function.apply(t));
} }
/**
* @Description: 大于
* @author chenxw
* @param higher
* @return
*/
public static Predicate<Integer> higher(int higher) {
return t -> t > higher;
}
/**
* @Description: 小于
* @author chenxw
* @param lower
* @return
*/
public static Predicate<Integer> lower(int lower) {
return t -> t < lower;
}
} }
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.gx.obe.bind</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding/<project>=UTF-8
separateDerivedEncodings=true
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Bind
Bundle-SymbolicName: com.gx.obe.bind
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.gx.obe.bind.Activator
Bundle-Vendor: GX
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: com.gx.obe.bind
Bundle-ActivationPolicy: lazy
Export-Package: com.gx.obe.bind,
com.gx.obe.bind.base,
com.gx.obe.bind.call,
com.gx.obe.bind.exception,
com.gx.obe.bind.fun,
com.gx.obe.bind.promise,
com.gx.obe.bind.prop,
com.gx.obe.bind.recursion,
com.gx.obe.bind.rx,
com.gx.obe.bind.stream,
com.gx.obe.bind.utils,
com.gx.obe.bind.view
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
javacDefaultEncoding.. = UTF-8
\ No newline at end of file
package com.gx.obe.bind;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.gx.obe.bind"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}
package com.gx.obe.bind.base;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import java.util.function.BiConsumer;
import java.util.function.BiPredicate;
import java.util.function.Supplier;
import com.gx.obe.bind.view.ChangeListener;
import com.gx.obe.bind.view.RView;
import com.gx.obe.bind.view.Write;
public class P<T> implements RView<T> {
private boolean log;
private T value;
private Map<String, BiConsumer<T, T>> writeMap = new HashMap<>();
private List<ChangeListener> changeListenerList = new ArrayList<>();
private String name;
private BiPredicate<T, T> predicate = (o, n) -> true;
private T defaultValue;
private Supplier<T> other = () -> defaultValue;
public P<T> as(String name) {
this.name = Objects.requireNonNull(name);
this.log = true;
return this;
}
public P<T> orElseGet(Supplier<T> other) {
this.other = Objects.requireNonNull(other);
this.value = other.get();
return this;
}
public P<T> orElse(T defaultValue) {
this.defaultValue = defaultValue;
this.value = defaultValue;
return this;
}
public P<T> limit(BiPredicate<T, T> predicate) {
this.predicate = Objects.requireNonNull(predicate);
return this;
}
public T get() {
return value;
}
public void bind(Write<T> write) {
bind(UUID.randomUUID().toString(), write);
}
public void bind(String key, Write<T> write) {
Objects.requireNonNull(write);
this.writeMap.put(key, (o, n) -> write.set(n));
}
public void watch(BiConsumer<T, T> biConsumer) {
watch(UUID.randomUUID().toString(), biConsumer);
}
public void watch(String key, BiConsumer<T, T> biConsumer) {
Objects.requireNonNull(biConsumer);
this.writeMap.put(key, biConsumer);
}
public void bindExe(Write<T> write) {
bindExe(UUID.randomUUID().toString(), write);
}
public void bindExe(String key, Write<T> write) {
Objects.requireNonNull(write);
write.set(value);
this.writeMap.put(key, (o, n) -> write.set(n));
}
public void clearBind() {
this.writeMap.clear();
this.value = other.get();
}
public void clearListener() {
this.changeListenerList.clear();
}
private void _change(T value) {
if (log) System.out.println(name + " --source:" + this.value + " --change:" + value);
this.value = Optional.ofNullable(value).orElseGet(other);
this.changeListenerList.forEach(ChangeListener::change);
}
protected void change(T value) {
T old = this.value;
if (!predicate.test(old, value)) return;
_change(value);
this.writeMap.values().stream().forEach(c -> c.accept(old, get()));
}
protected void change(T value, String key) {
T old = this.value;
if (!predicate.test(old, value)) return;
_change(value);
this.writeMap.entrySet().stream().filter(e -> !e.getKey().equals(key)).map(e -> e.getValue()).forEach(c -> c.accept(old, get()));
}
public boolean isBind() {
return !writeMap.isEmpty();
}
@Override
public void addChangeListener(ChangeListener changeListener) {
this.changeListenerList.add(Objects.requireNonNull(changeListener));
}
@Override
public String toString() {
return "P:" + Objects.toString(value);
}
}
package com.gx.obe.bind.call;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Supplier;
import com.gx.obe.bind.view.Read;
import com.gx.obe.bind.view.Write;
public class Call {
private final List<Callback> callbackList = new ArrayList<>();
public static Call of(Callback callback) {
return new Call().bind(callback);
}
public boolean isBind() {
return !callbackList.isEmpty();
}
public Call bind(Callback callback) {
callbackList.add(callback);
return this;
}
public Call bindExe(Callback callback) {
callback.call();
return bind(callback);
}
public void exe() {
callbackList.stream().forEach(Callback::call);
}
public <T> Consumer<T> toSet() {
return t -> exe();
}
public <T> Supplier<T> toGet() {
return () -> {
exe();
return null;
};
}
public <T> Write<T> toWrite() {
return t -> exe();
}
public <T> Read<T> toRead() {
return () -> {
exe();
return null;
};
}
}
package com.gx.obe.bind.call;
public interface Callback {
void call();
}
package com.gx.obe.bind.exception;
public interface ExFunction<T, R> {
R apply(T t) throws Exception;
}
package com.gx.obe.bind.exception;
import java.math.BigDecimal;
import java.util.function.Function;
public class ExceptionFun<T, R> implements Function<T, R> {
private ExFunction<T, R> function;
public static <T, R> ExceptionFun<T, R> of(ExFunction<T, R> function) {
return new ExceptionFun<>(function);
}
public ExceptionFun(ExFunction<T, R> function) {
this.function = function;
}
public R get(T t) {
return getOrDefault(t, null);
}
public R getOrDefault(T t, R defaultValue) {
try {
return function.apply(t);
} catch (Exception e) {
return defaultValue;
}
}
public R getOrThrow(T t) {
try {
return function.apply(t);
} catch (Exception e) {
throw new NullPointerException(e.getMessage());
}
}
public static final ExceptionFun<String, BigDecimal> toBigDecimal = of(BigDecimal::new);
public static final ExceptionFun<String, Integer> toInteger = of(Integer::valueOf);
@Override
public R apply(T t) {
return get(t);
}
}
package com.gx.obe.bind.fun;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import com.gx.obe.bind.view.Read;
import com.gx.obe.bind.view.Write;
public class Fun<T, R> {
private Function<T, R> function;
private Fun(Function<T, R> function) {
this.function = function;
}
public <V> Fun<T, V> andThen(Function<R, V> after) {
return Fun.of(function.andThen(after));
}
public <V> Fun<V, R> compose(Function<V, T> before) {
return Fun.of(function.compose(before));
}
public Function<T, R> toFun() {
return function;
}
public Supplier<R> toGet(T t) {
return () -> function.apply(t);
}
public Supplier<R> toGet(Supplier<T> supplier) {
return () -> function.apply(supplier.get());
}
public Read<R> toRead(T t) {
return () -> function.apply(t);
}
public Read<R> toRead(Read<T> read) {
return () -> function.apply(read.get());
}
public Consumer<T> toSet(Consumer<R> consumer) {
return t -> consumer.accept(function.apply(t));
}
public Write<T> toWrite(Consumer<R> consumer) {
return t -> consumer.accept(function.apply(t));
}
public Predicate<T> toTest(Predicate<R> predicate) {
return t -> predicate.test(function.apply(t));
}
public static <T, R> Fun<T, R> of(Function<T, R> function) {
return new Fun<>(function);
}
}
package com.gx.obe.bind.promise;
import java.util.function.Consumer;
import java.util.function.Function;
public class Promise<T> {
private STATUS status = STATUS.PENDING;
private T value;
private Exception error;
private Consumer<T> onFullFilled = t -> {};
private Consumer<Exception> onRejected = e -> {};
enum STATUS {
PENDING, RESOLVE, REJECT;
}
public Promise(Fun<T> fun) {
Consumer<T> resolve = t -> {
this.status = STATUS.RESOLVE;
this.value = t;
this.onFullFilled.accept(t);
synchronized (this) {
this.notify();
}
};
Consumer<Exception> reject = e -> {
this.status = STATUS.REJECT;
this.error = e;
this.onRejected.accept(e);
synchronized (this) {
this.notify();
}
};
try {
fun.call(resolve, reject);
} catch (Exception e) {
reject.accept(e);
}
}
public static <T> Promise<T> thread(Fun<T> fun) {
return new Promise<>((resolve, reject) -> {
new Thread(() -> {
try {
fun.call(resolve, reject);
} catch (Exception e) {
e.printStackTrace();
reject.accept(e);
}
}).start();
});
}
public static <T> Promise<T> empty() {
return new Promise<>((resolve, reject) -> {});
}
public static <T> Promise<T> resolve(T value) {
return new Promise<>((resolve, reject) -> resolve.accept(value));
}
public static <T> Promise<T> reject() {
return reject(new RuntimeException("Promise reject error"));
}
public static <T> Promise<T> reject(Exception err) {
return new Promise<>((resolve, reject) -> reject.accept(err));
}
public static <T, R> Function<T, Promise<R>> resolveFun(Function<T, R> function) {
return t -> new Promise<R>((resolve, reject) -> resolve.accept(function.apply(t)));
}
public <R> Promise<R> then(Function<T, Promise<R>> onFullFilled) {
switch (this.status) {
case RESOLVE:
return onFullFilled.apply(this.value);
case REJECT:
return new Promise<R>((resolve, reject) -> reject.accept(this.error));
default:
return new Promise<R>((resolve, reject) -> {
this.onFullFilled = t -> onFullFilled.apply(t).then(resolve, reject);
this.onRejected = reject;
});
}
}
public void then(Consumer<T> onFullFilled, Consumer<Exception> onRejected) {
switch (status) {
case RESOLVE:
if (onFullFilled != null) onFullFilled.accept(value);
break;
case REJECT:
if (onRejected != null) onRejected.accept(error);
break;
default:
if (onFullFilled != null) this.onFullFilled = onFullFilled;
if (onRejected != null) this.onRejected = onRejected;
break;
}
}
public void thenThrow(Consumer<T> onFullFilled) {
then(onFullFilled, e -> {
throw new RuntimeException(e.getMessage());
});
}
public T waitOrGet() throws Exception {
return waitOrGet(0);
}
public T waitOrGet(long timeout) throws Exception {
switch (status) {
case RESOLVE:
return value;
case REJECT:
throw error;
default:
synchronized (this) {
this.wait(timeout);
}
if (STATUS.PENDING.equals(status)) {
throw new RuntimeException();
}
return waitOrGet(timeout);
}
}
public interface Fun<T> {
void call(Consumer<T> resolve, Consumer<Exception> reject);
}
}
package com.gx.obe.bind.prop;
import java.util.Arrays;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;
import com.gx.obe.bind.view.View;
import com.gx.obe.bind.view.Write;
public class Comp<T> extends Prop<T> {
public Comp(Supplier<T> supplier, String name, View... properties) {
super(Objects.requireNonNull(supplier).get());
Arrays.stream(Objects.requireNonNull(properties)).forEach(p -> p.addChangeListener(() -> set(supplier.get())));
}
@Override
public Comp<T> as(String name) {
super.as(name);
return this;
}
@Override
public void bind(Write<T> write) {
super.bind(write);
}
public Comp<T> addSet(Consumer<T> consumer) {
super.addChangeListener(() -> consumer.accept(get()));
return this;
}
}
package com.gx.obe.bind.prop;
import java.util.Objects;
import java.util.UUID;
import java.util.function.BiPredicate;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Supplier;
import com.gx.obe.bind.base.P;
import com.gx.obe.bind.view.ChangeListener;
import com.gx.obe.bind.view.MView;
import com.gx.obe.bind.view.Read;
import com.gx.obe.bind.view.View;
import com.gx.obe.bind.view.Write;
public class Prop<T> extends P<T> implements MView<T> {
private Lock lock = new Lock();
public Prop() {}
public Prop(T value) {
set(value);
}
public Prop<T> orElseGet(Supplier<T> other) {
super.orElseGet(other);
return this;
}
public Prop<T> orElse(T defaultValue) {
super.orElse(defaultValue);
return this;
}
@Override
public Prop<T> as(String name) {
super.as(name);
return this;
}
@Override
public Prop<T> limit(BiPredicate<T, T> predicate) {
super.limit(predicate);
return this;
}
public boolean isLock() {
return lock.isLock();
}
public void replace(Function<T, T> function) {
set(Objects.requireNonNull(function).apply(get()));
}
public void changer(Consumer<T> consumer) {
Objects.requireNonNull(consumer).accept(get());
set(get());
}
public void bindBidirectional(MView<T> mView) {
Objects.requireNonNull(mView);
String key = UUID.randomUUID().toString();
bind(key, mView);
mView.addChangeListener(() -> set(mView.get(), key));
}
public void bindBidirectional(Write<T> write, Read<T> read, View model) {
Objects.requireNonNull(write);
Objects.requireNonNull(read);
Objects.requireNonNull(model);
String key = UUID.randomUUID().toString();
bind(key, write);
model.addChangeListener(() -> set(read.get(), key));
}
@Override
public void set(T value) {
lock.sync(() -> change(value));
}
private void set(T value, String key) {
lock.sync(() -> change(value, key));
}
}
class Lock {
private boolean lock = false;
public boolean isLock() {
return lock;
}
public void sync(ChangeListener changeListener) {
if (lock) return;
lock = true;
changeListener.change();
lock = false;
}
}
package com.gx.obe.bind.prop;
import java.util.Objects;
import java.util.function.BiPredicate;
import com.gx.obe.bind.base.P;
import com.gx.obe.bind.view.RView;
import com.gx.obe.bind.view.Read;
import com.gx.obe.bind.view.View;
public class RProp<T> extends P<T> {
public void reader(Read<? extends T> read, View model) {
Objects.requireNonNull(read);
Objects.requireNonNull(model);
model.addChangeListener(() -> change(read.get()));
}
public void reader(RView<? extends T> rView) {
reader(rView, rView);
}
public RProp<T> as(String name) {
super.as(name);
return this;
}
public RProp<T> limit(BiPredicate<T, T> predicate) {
super.limit(predicate);
return this;
}
}
package com.gx.obe.bind.recursion;
import java.util.List;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Predicate;
public interface RStream<T> {
void forEach(Consumer<T> action);
void forEach(TreeForEach<T> treeForEach);
void forEach(BiConsumer<List<Integer>, T> indexConsumer);
Optional<T> findAny(Predicate<T> predicate);
List<T> filter(Predicate<T> predicate);
}
package com.gx.obe.bind.recursion;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Stream;
public class Recursions<T> {
private Function<T, Stream<T>> toStreamFun;
public static <T> Recursions<T> array(Function<T, T[]> toArrayFun) {
return new Recursions<>(toArrayFun.andThen(t -> Optional.ofNullable(t).map(Stream::of).orElse(null)));
}
public static <T> Recursions<T> list(Function<T, List<T>> toListFun) {
return new Recursions<>(toListFun.andThen(t -> Optional.ofNullable(t).map(List::stream).orElse(null)));
}
public static <T> Recursions<T> stream(Function<T, Stream<T>> toStreamFun) {
return new Recursions<>(toStreamFun);
}
public Recursions(Function<T, Stream<T>> toStreamFun) {
this.toStreamFun = toStreamFun;
}
public RStream<T> toStream(T obj) {
return toStream(Stream.of(obj));
}
public RStream<T> toStream(T[] array) {
return toStream(Stream.of(array));
}
public RStream<T> toStream(List<T> stream) {
return toStream(stream.stream());
}
public RStream<T> toStream(Stream<T> stream) {
return new RStream<T>() {
public void forEach(Consumer<T> action) {
new ForEachRecursion(action).exe(stream);
}
public void forEach(TreeForEach<T> treeForEach) {
new TreeForEachRecursion(treeForEach).exe(stream);
}
public void forEach(BiConsumer<List<Integer>, T> indexConsumer) {
new IndexForEachRecursion(indexConsumer).exe(stream);
}
public Optional<T> findAny(Predicate<T> predicate) {
Data data = new Data();
new AnyMatchRecursion(t -> {
boolean test = predicate.test(t);
if (test) data.t = t;
return test;
}).exe(stream);
return Optional.ofNullable(data.t);
}
public List<T> filter(Predicate<T> predicate) {
List<T> list = new ArrayList<>();
new ForEachRecursion(t -> {
if (predicate.test(t)) list.add(t);
}).exe(stream);
return list;
}
};
}
private class AnyMatchRecursion {
private Predicate<T> predicate;
public AnyMatchRecursion(Predicate<T> predicate) {
this.predicate = predicate;
}
private boolean exe(Stream<T> stream) {
return stream.anyMatch(t -> {
if (predicate.test(t)) return true;
return Optional.ofNullable(t).map(toStreamFun).map(this::exe).orElse(false);
});
}
}
private class ForEachRecursion {
private Consumer<T> consumer;
public ForEachRecursion(Consumer<T> consumer) {
this.consumer = consumer;
}
private void exe(Stream<T> stream) {
stream.forEach(t -> {
consumer.accept(t);
Optional.ofNullable(t).map(toStreamFun).ifPresent(this::exe);
});
}
}
private class TreeForEachRecursion {
private TreeForEach<T> treeForEach;
public TreeForEachRecursion(TreeForEach<T> treeForEach) {
this.treeForEach = treeForEach;
}
private void exe(Stream<T> stream) {
recursion(stream.iterator(), true);
}
private void recursion(Iterator<T> iterator, boolean root) {
iterator.forEachRemaining(t -> {
Iterator<T> citerator = Optional.of(t).map(toStreamFun).map(Stream::iterator).orElse(null);
boolean leaf = citerator == null || !citerator.hasNext();
treeForEach.action(root, leaf, t);
if (!leaf) recursion(citerator, false);
});
}
}
private class IndexForEachRecursion {
private BiConsumer<List<Integer>, T> indexConsumer;
public IndexForEachRecursion(BiConsumer<List<Integer>, T> indexConsumer) {
this.indexConsumer = indexConsumer;
}
private void exe(Stream<T> stream) {
recursion(stream, new ArrayList<>());
}
private void recursion(Stream<T> stream, List<Integer> pIndex) {
AtomicInteger i = new AtomicInteger(1);
stream.forEach(t -> {
List<Integer> index = new ArrayList<>(pIndex);
index.add(i.getAndIncrement());
indexConsumer.accept(index, t);
Optional.ofNullable(t).map(toStreamFun).ifPresent(s -> recursion(s, index));
});
}
}
private class Data {
private T t;
}
}
package com.gx.obe.bind.recursion;
public interface TreeForEach<T> {
void action(boolean root, boolean leaf, T t);
}
package com.gx.obe.bind.rx;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Supplier;
public class RxBind<T> {
private Supplier<T> supplier = () -> null;
private Consumer<Runnable> supplierSync = Runnable::run;
private Consumer<Runnable> consumerSync = Runnable::run;
private Supplier<Boolean> check = () -> true;
private Supplier<T> other = () -> null;
private Tangent tangent = Tangent.TEMP;
public RxBind(Supplier<T> supplier) {
this.supplier = supplier;
}
public static <T> RxBind<T> run(Supplier<T> supplier) {
return new RxBind<T>(supplier);
}
public RxBind<T> tangent(Tangent tangent) {
this.tangent = tangent;
return this;
}
public RxBind<T> supplierSync(Consumer<Runnable> supplierSync) {
this.supplierSync = supplierSync;
return this;
}
public RxBind<T> consumerSync(Consumer<Runnable> consumerSync) {
this.consumerSync = consumerSync;
return this;
}
public RxBind<T> check(Supplier<Boolean> check) {
this.check = check;
return this;
}
public RxBind<T> other(Supplier<T> other) {
this.other = other;
return this;
}
public void exe(Consumer<T> consumer) {
supplierSync.accept(() -> {
Status<T> supplyStatus = supplyStatus();
consumerSync.accept(() -> {
if (check.get()) return;
if (supplyStatus.isErrer()) {
tangent.error(supplyStatus.getException());
} else {
tangent.after();
try {
consumer.accept(Optional.ofNullable(supplyStatus.getT()).orElseGet(other));
} catch (Exception e) {
e.printStackTrace();
}
}
});
});
tangent.before();
}
public Status<T> supplyStatus() {
Status<T> status = new Status<>();
try {
status.setT(supplier.get());
} catch (Exception e) {
status.setErrer(true);
status.setException(e);
}
return status;
}
}
package com.gx.obe.bind.rx;
public class Status<T> {
private Exception exception;
private T t;
private boolean errer;
public Exception getException() {
return exception;
}
public void setException(Exception exception) {
this.exception = exception;
}
public T getT() {
return t;
}
public void setT(T t) {
this.t = t;
}
public boolean isErrer() {
return errer;
}
public void setErrer(boolean errer) {
this.errer = errer;
}
}
package com.gx.obe.bind.rx;
public interface Tangent {
static Tangent TEMP = new Tangent() {
public void error(Exception e) {
e.printStackTrace();
}
public void before() {}
public void after() {}
};
void before();
void after();
void error(Exception e);
}
package com.gx.obe.bind.stream;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Stream;
public class MapStream<K, V> {
private Map<K, V> map;
public MapStream(Map<K, V> map) {
this.map = map;
}
public static <K, V> MapStream<K, V> of(Map<K, V> map) {
return new MapStream<>(map);
}
public <T> MapStream<K, T> valueMap(Function<V, T> function) {
Map<K, T> map = new HashMap<>();
this.map.forEach((k, v) -> map.put(k, function.apply(v)));
return MapStream.of(map);
}
public <T> void valueMap(Function<V, T> function, Map<K, T> map) {
this.map.forEach((k, v) -> map.put(k, function.apply(v)));
}
public MapStream<K, V> removeValueIsNull() {
Map<K, V> map = new HashMap<>();
this.map.forEach((k, v) -> {
if (v != null) map.put(k, v);
});
return MapStream.of(map);
}
public MapStream<K, V> removeValue(Predicate<V> predicate) {
Map<K, V> map = new HashMap<>();
this.map.forEach((k, v) -> {
if (!predicate.test(v)) map.put(k, v);
});
return MapStream.of(map);
}
public Stream<K> keyStream(Predicate<V> vPredicate) {
return map.entrySet().stream().filter(e -> vPredicate.test(e.getValue())).map(e -> e.getKey());
}
public Map<K, V> toMap() {
return map;
}
public void forEach(BiConsumer<K, V> action) {
map.forEach(action);
}
}
package com.gx.obe.bind.utils;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collector;
import java.util.stream.Collectors;
public class CollectorUtils {
public static <T, K1, K2> Collector<T, ?, Map<K1, Map<K2, T>>> groupingToMap(Function<? super T, ? extends K1> classifier, Function<? super T, ? extends K2> keyMapper) {
return Collectors.groupingBy(classifier, Collectors.toMap(keyMapper, Function.identity()));
}
}
package com.gx.obe.bind.utils;
import java.util.function.Function;
import com.gx.obe.bind.prop.Prop;
public class PropUtils {
public static <T, R> void bindBidirectional(Prop<T> tProp, Prop<R> rProp, Function<T, R> trFunction, Function<R, T> rtFunction) {
tProp.addChangeListener(() -> {
if (rProp.isLock()) return;
rProp.set(trFunction.apply(tProp.get()));
});
rProp.addChangeListener(() -> {
if (tProp.isLock()) return;
tProp.set(rtFunction.apply(rProp.get()));
});
}
}
package com.gx.obe.bind.view;
public interface ChangeListener {
void change();
default ChangeListener andThen(ChangeListener changeListener) {
return () -> {
this.change();
changeListener.change();
};
}
static ChangeListener EMPTY = () -> {};
}
package com.gx.obe.bind.view;
public interface MView<T> extends RView<T>, Write<T> {}
package com.gx.obe.bind.view;
public interface RView<T> extends View, Read<T> {}
package com.gx.obe.bind.view;
@FunctionalInterface
public interface Read<T> {
T get();
}
package com.gx.obe.bind.view;
@FunctionalInterface
public interface View {
void addChangeListener(ChangeListener changeListener);
}
package com.gx.obe.bind.view;
@FunctionalInterface
public interface Write<T> {
void set(T t);
}
eclipse.preferences.version=1
encoding/<project>=UTF-8
...@@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.ui, ...@@ -16,7 +16,8 @@ Require-Bundle: org.eclipse.ui,
com.gx.obe.utils, com.gx.obe.utils,
com.gx.obe.common.icons, com.gx.obe.common.icons,
com.gx.obe.common.widget, com.gx.obe.common.widget,
com.gx.obe.action;bundle-version="1.0.0" com.gx.obe.action;bundle-version="1.0.0",
com.gx.obe.bind;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: com.gx.obe.common.file Automatic-Module-Name: com.gx.obe.common.file
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
...@@ -34,4 +35,5 @@ Export-Package: com.gx.obe.common.file.adapter, ...@@ -34,4 +35,5 @@ Export-Package: com.gx.obe.common.file.adapter,
com.gx.obe.common.file.thread, com.gx.obe.common.file.thread,
com.gx.obe.common.file.upload, com.gx.obe.common.file.upload,
com.gx.obe.common.file.upload.infer, com.gx.obe.common.file.upload.infer,
com.gx.obe.common.file.utils com.gx.obe.common.file.utils,
com.gx.obe.common.file.widget
package com.gx.obe.common.file.utils;
import java.util.Optional;
import com.gx.obe.components.core.Constants;
import com.gx.obe.util.utils.StringUtils;
public class BidFileUtils {
/**
* @Description: 获得投标文件文件名
* @author chenxw
* @param fileItem
* @param isEnc
* @return
*/
public static Optional<String> getBidFileName(String fileId, String fileName) {
Optional<String> suffix = Optional.ofNullable(fileId).map(FileUtils::removeFileNameENC).map(FileUtils::getFileNameBack).filter(t -> {
return !Constants.ZIP.equals(t);
});
return Optional.ofNullable(fileName).map(FileUtils::getFileNameFront).map(t -> t.concat(suffix.orElse(""))).filter(StringUtils::isNotEmpty);
}
}
...@@ -18,10 +18,14 @@ import java.text.DecimalFormat; ...@@ -18,10 +18,14 @@ import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.function.Function;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import com.gx.obe.components.core.Constants;
import com.gx.obe.util.utils.StringUtils;
public class FileUtils { public class FileUtils {
public FileUtils() { public FileUtils() {
...@@ -981,4 +985,60 @@ public class FileUtils { ...@@ -981,4 +985,60 @@ public class FileUtils {
public static String filterFileName(String fileName){ public static String filterFileName(String fileName){
return fileName==null?null:FilePattern.matcher(fileName.trim()).replaceAll(""); return fileName==null?null:FilePattern.matcher(fileName.trim()).replaceAll("");
} }
public static Function<String, String> funGetSuffix = fileName -> {
if (fileName == null) return "";
int indexOf = fileName.lastIndexOf(".");
if (indexOf == -1) return "";
return fileName.substring(indexOf + 1);
};
/**
* @Description: 去除文件名.enc后缀
* @author chenxw
* @param fileName
* @return
*/
public static String removeFileNameENC(String fileName) {
if (StringUtils.isEmpty(fileName)) {
return fileName;
}
if (fileName.endsWith(Constants.ENC)) {
return fileName.substring(0, fileName.lastIndexOf(Constants.ENC));
}
return fileName;
}
/**
* @Description: 获取文件名后部
* @author chenxw
* @param fileName
* @return
*/
public static String getFileNameBack(String fileName) {
if (StringUtils.isEmpty(fileName)) {
return fileName;
}
int lastIndex = fileName.lastIndexOf(".");
if (lastIndex == -1) {
return "";
}
return fileName.substring(lastIndex);
}
/**
* @Description: 获取文件名前部
* @author chenxw
* @param fileName
* @return
*/
public static String getFileNameFront(String fileName) {
if (StringUtils.isEmpty(fileName)) {
return fileName;
}
int lastIndex = fileName.lastIndexOf(".");
if (lastIndex == -1) {
return fileName;
}
return fileName.substring(0, lastIndex);
}
} }
...@@ -4,6 +4,9 @@ import java.io.File; ...@@ -4,6 +4,9 @@ import java.io.File;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.Element; import org.dom4j.Element;
...@@ -40,6 +43,7 @@ import com.gx.obe.util.utils.UuidUtils; ...@@ -40,6 +43,7 @@ import com.gx.obe.util.utils.UuidUtils;
import com.gx.obe.util.utils.XmlUtils; import com.gx.obe.util.utils.XmlUtils;
import com.gx.obe.web.entity.AttachmentFile; import com.gx.obe.web.entity.AttachmentFile;
import com.gx.obe.web.entity.Struct; import com.gx.obe.web.entity.Struct;
import com.gx.obe.web.entity.evaluation.EvaluationContent;
import com.gx.obe.web.entity.evaluation.EvaluationFactor; import com.gx.obe.web.entity.evaluation.EvaluationFactor;
import com.gx.obe.web.entity.evaluation.EvaluationStep; import com.gx.obe.web.entity.evaluation.EvaluationStep;
import com.gx.obe.web.entity.price.BidPrice; import com.gx.obe.web.entity.price.BidPrice;
...@@ -663,10 +667,59 @@ public class ParsingXmlUtils { ...@@ -663,10 +667,59 @@ public class ParsingXmlUtils {
} }
} }
} }
resolverEvaluationContent(evaluationFactor, element);
return evaluationFactor; return evaluationFactor;
} }
/**
* @Description: 解析评审内容
* @author chenxw
* @param evaluationFactor
* @param element
*/
private static void resolverEvaluationContent(EvaluationFactor evaluationFactor, Element element) {
resolverEvaluationContent(evaluationFactor.getTenderId(), evaluationFactor.getFactorCode(), element.element("evaluationContentList"))
.ifPresent(evaluationFactor::setEvaluationContentList);
}
/**
* @Description: 解析评审内容
* @author chenxw
* @param tenderId
* @param factorCode
* @param evaluationContentListElement
* @return
*/
public static Optional<List<EvaluationContent>> resolverEvaluationContent(String tenderId, String factorCode, Element evaluationContentListElement) {
return Optional.ofNullable(evaluationContentListElement).map(t -> t.elements("evaluationContent")).map(l -> {
return streamElement(l).map(ParsingXmlUtils::initEvaluationContent).peek(t -> {
t.setTenderId(tenderId);
t.setFactorCode(factorCode);
}).collect(Collectors.toList());
});
}
private static Stream<Element> streamElement(List<?> list) {
return list.stream().map(t -> (Element) t);
}
/**
* @Description: 初始化评审内容
* @author chenxw
* @param evaluationContentElement
* @return
*/
private static EvaluationContent initEvaluationContent(Element evaluationContentElement) {
EvaluationContent evaluationContent = new EvaluationContent();
evaluationContent.setId(UuidUtils.getUUID());
evaluationContent.setRelChapterType(evaluationContentElement.elementTextTrim("relChapterType"));
evaluationContent.setDataCategory(evaluationContentElement.elementTextTrim("dataCategory"));
evaluationContent.setDataCode(evaluationContentElement.elementTextTrim("dataCode"));
evaluationContent.setEvalRule(evaluationContentElement.elementTextTrim("evalRule"));
evaluationContent.setTenderStructName(evaluationContentElement.elementTextTrim("tenderStructName"));
evaluationContent.setEvalPointName(evaluationContentElement.elementTextTrim("evalPointName"));
try {
evaluationContent.setSortNo(Integer.valueOf(evaluationContentElement.elementTextTrim("Order")));
} catch (Exception e) {}
return evaluationContent;
}
/** /**
* @Description: 解析结构化数据 * @Description: 解析结构化数据
* @author chenxw * @author chenxw
......
package com.gx.obe.common.file.widget;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import org.eclipse.swt.SWT;
import org.eclipse.swt.core.MessageDialog;
import org.eclipse.swt.core.widgets.EMenu;
import org.eclipse.swt.core.widgets.EMenu.ClickListener;
import org.eclipse.swt.core.widgets.ImageButton;
import org.eclipse.swt.events.MenuDetectEvent;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import com.gx.obe.bind.call.Callback;
import com.gx.obe.common.file.utils.FileUtils;
import com.gx.obe.common.icons.IconsActivator;
import com.gx.obe.util.utils.RuntimeUtils;
import com.swtdesigner.ResourceManager;
import com.swtdesigner.SWTResourceManager;
public class FileButton extends Composite {
protected File file;
protected ImageButton imageButton;
private List<ItemParam> itemParamList = new ArrayList<>();
public FileButton(Composite parent, File file) {
this(parent, file, Optional.of(file).map(File::getName).get());
}
/**
* @wbp.parser.constructor
*/
public FileButton(Composite parent, File file, String fileName) {
super(parent, SWT.NONE);
this.file = file;
GridLayout gridLayout = new GridLayout(1, false);
gridLayout.marginHeight = 0;
gridLayout.marginWidth = 0;
setLayout(gridLayout);
imageButton = new ImageButton(this, SWT.BOTTOM | SWT.CENTER | SWT.WRAP);
GridData gd_imageButton = new GridData(SWT.CENTER, SWT.FILL, false, true, 1, 1);
gd_imageButton.widthHint = 100;
imageButton.setLayoutData(gd_imageButton);
imageButton.setForeground(SWTResourceManager.getColor(100, 100, 100));
imageButton.setFont(SWTResourceManager.getFont("微软雅黑", 9, SWT.NORMAL));
imageButton.setActiveBorderColor(SWTResourceManager.getColor(77, 163, 19));
imageButton.setActiveForeground(SWTResourceManager.getColor(100, 100, 100));
imageButton.setActiveBgColor(SWTResourceManager.getColor(205, 225, 205));
imageButton.setGAP(0);
imageButton.setAlpha(120);
imageButton.setArcWidth(6);
imageButton.setText(fileName);
imageButton.setImage(ResourceManager.getPluginImage(IconsActivator.PLUGIN_ID, getFileImagePath(fileName)));
imageButton.addMouseListener(MouseListener.mouseDoubleClickAdapter(this::openFile));
imageButton.addMenuDetectListener(this::menuDetect);
}
/**
* @Description: 添加菜单项
* @author guoyr
* @param menuItemText
* @param menuItemImage
* @param enabled
* @param callBack
*/
public void addMenuItem(String menuItemText, Image menuItemImage, boolean enabled, Callback clickListener) {
itemParamList.add(new ItemParam(menuItemText, menuItemImage, enabled, clickListener));
}
private void menuDetect(MenuDetectEvent e) {
EMenu menu = new EMenu(getShell());
menu.addMenuItem("打开", null, true, new ClickListener() {
public void click() {
openFile(null);
}
});
for (ItemParam itemParam : itemParamList) {
menu.addMenuItem(itemParam.menuItemText, itemParam.menuItemImage, itemParam.enabled, new ClickListener() {
public void click() {
itemParam.clickListener.call();
}
});
}
menu.open();
}
protected void openFile(MouseEvent e) {
if (!file.exists()) {
MessageDialog.openShortMessage("文件不存在!");
return;
}
RuntimeUtils.openFIle(file);
}
/**
* @Description:
* @author mazc
* @param fileName
* @return
*/
private String getFileImagePath(String fileName) {
switch (FileUtils.funGetSuffix.apply(fileName)) {
case "pdf": return "icons/pdf_64.png";
case "xml": return "icons/xml_64.png";
case "doc": case "docx": return "icons/word_64.png";
case "xls": case "xlsx": return "icons/excel_64.png";
case "png": case "bmp": case "gif": case "psd": case "jpg": case "jpeg": return "icons/image_64.png";
default: return "icons/unknown_64.png";
}
}
public File getFile() {
return file;
}
static class ItemParam {
String menuItemText;
Image menuItemImage;
boolean enabled;
Callback clickListener;
public ItemParam(String menuItemText, Image menuItemImage, boolean enabled, Callback clickListener) {
this.menuItemText = menuItemText;
this.menuItemImage = menuItemImage;
this.enabled = enabled;
this.clickListener = clickListener;
}
}
}
eclipse.preferences.version=1
encoding/<project>=UTF-8
...@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui, ...@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.ui,
com.gx.obe.common.icons;bundle-version="1.0.0", com.gx.obe.common.icons;bundle-version="1.0.0",
com.gx.obe.business, com.gx.obe.business,
com.gx.obe.lib;bundle-version="1.0.0", com.gx.obe.lib;bundle-version="1.0.0",
com.gx.obe.utils;bundle-version="1.0.0" com.gx.obe.utils;bundle-version="1.0.0",
com.gx.obe.component;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: com.gx.obe.common.widget Automatic-Module-Name: com.gx.obe.common.widget
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
...@@ -24,5 +25,6 @@ Export-Package: com.gx.obe.common.widget, ...@@ -24,5 +25,6 @@ Export-Package: com.gx.obe.common.widget,
com.gx.obe.common.widget.inter, com.gx.obe.common.widget.inter,
com.gx.obe.common.widget.listener, com.gx.obe.common.widget.listener,
com.gx.obe.common.widget.shell, com.gx.obe.common.widget.shell,
com.gx.obe.common.widget.text,
com.gx.obe.common.widget.thread, com.gx.obe.common.widget.thread,
com.gx.obe.common.widget.utils com.gx.obe.common.widget.utils
package com.gx.obe.common.widget.button;
import org.eclipse.swt.SWT;
import org.eclipse.swt.core.widgets.ImageButton;
import org.eclipse.swt.widgets.Composite;
import com.gx.obe.ColorConstants;
import com.gx.obe.component.handler.ISelection;
import com.swtdesigner.SWTResourceManager;
public class RectangleRadioButton extends ImageButton implements ISelection {
public RectangleRadioButton(Composite parent, int style) {
super(parent, style | SWT.CENTER);
this.setRightMargin(10);
this.setLeftMargin(10);
this.setTopMargin(5);
this.setBottomMargin(5);
this.setRightMargin(10);
this.setFont(SWTResourceManager.getFont("微软雅黑", 10, SWT.NORMAL));
this.setForeground(ColorConstants.NOTE_TIPS_COLOR);
this.setBackgroundColor(SWTResourceManager.getColor(245, 245, 245));
this.setForeground(ColorConstants.NOTE_TIPS_COLOR);
this.setBackgroundColor(SWTResourceManager.getColor(245, 245, 245));
this.setActiveForeground(ColorConstants.SKIN_ACTIVE_FOREGROUND);
this.setActiveBackgroundColor(ColorConstants.SKIN_ACTIVE_BG);// 橙色
this.setSelectionForeground(ColorConstants.SKIN_SELECTOIN_FOREGROUND);
this.setSelectionBgColor(ColorConstants.SKIN_BG);// 蓝色
// this.setArcWidth(90);
// this.setImage(ResourceManager.getPluginImage(SWTCoreActivator.PLUGIN_ID, "icons/evaluaton_step/default.png"), 16, 16);
}
}
package com.gx.obe.common.widget.dialog;
import org.eclipse.swt.widgets.Shell;
import com.gx.obe.common.widget.rt.Tangent;
import com.gx.obe.common.widget.shell.ProgressMessageDialog;
public class ProgressMessageTangent implements Tangent {
private ProgressMessageDialog dialog;
public ProgressMessageTangent(Shell parentShell, String title) {
this.dialog = new ProgressMessageDialog(parentShell, false, -1, null);
this.dialog.setTitle(title);
}
@Override
public void before() {
dialog.open();
}
@Override
public void after() {
dialog.finish(dialog.getErrorMessagesSize() == 0);
}
@Override
public void error(Exception e) {
dialog.message(e.getMessage(), -1);
dialog.finish(false);
}
}
...@@ -9,5 +9,11 @@ public class ProgressMessageAdapter implements ProgressMessageListener { ...@@ -9,5 +9,11 @@ public class ProgressMessageAdapter implements ProgressMessageListener {
public void setMaximumProgress(int maximumProgress) {} public void setMaximumProgress(int maximumProgress) {}
public void finish(boolean flag) {} public void finish(boolean flag) {}
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
} }
\ No newline at end of file
...@@ -7,6 +7,9 @@ public interface ProgressMessageListener { ...@@ -7,6 +7,9 @@ public interface ProgressMessageListener {
public void message(String message, int flag) {} public void message(String message, int flag) {}
public void finish(boolean flag) {} public void finish(boolean flag) {}
public void addProgress(int addProgress) {} public void addProgress(int addProgress) {}
public int getErrorMessagesSize() {
return 0;
}
}; };
public void message(String message, int flag); public void message(String message, int flag);
...@@ -32,4 +35,10 @@ public interface ProgressMessageListener { ...@@ -32,4 +35,10 @@ public interface ProgressMessageListener {
* @param failCount * @param failCount
*/ */
public void finish(boolean flag); public void finish(boolean flag);
/**
* 获取错误信息
* @return
*/
public abstract int getErrorMessagesSize();
} }
\ No newline at end of file
package com.gx.obe.common.widget.rt;
public interface Tangent {
static Tangent TEMP = new Tangent() {
public void error(Exception e) {
e.printStackTrace();
}
public void before() {}
public void after() {}
};
void before();
void after();
void error(Exception e);
}
...@@ -537,6 +537,12 @@ public class ProgressMessageDialog extends Shell implements ProgressMessageListe ...@@ -537,6 +537,12 @@ public class ProgressMessageDialog extends Shell implements ProgressMessageListe
return finishFlag; return finishFlag;
} }
@Override
public int getErrorMessagesSize() {
// TODO Auto-generated method stub
return 0;
}
} }
package com.gx.obe.common.widget.text;
import java.text.NumberFormat;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import com.gx.obe.component.text.FStyledText;
import com.gx.obe.components.core.enumeration.EvaluationFactorEnum;
import com.gx.obe.message.Messages;
import com.gx.obe.util.utils.StringUtils;
import com.gx.obe.web.entity.evaluation.EvaluationFactor;
import com.swtdesigner.SWTResourceManager;
public class EvalFactorText extends FStyledText {
protected EvaluationFactor curFactor;
public EvalFactorText(Composite parent) {
super(parent);
}
public void refresh(EvaluationFactor curFactor) {
this.curFactor = curFactor;
clear();
if (curFactor != null) initItem();
refresh();
}
protected void initItem() {
addEvalFactor();
addScoreRange();
addEvalExplain();
}
protected void addEvalFactor() {
add(Messages.EvalFactor + ":", curFactor.getFactorName(), SWTResourceManager.getColor(20, 20, 20), SWT.NORMAL);
}
protected void addScoreRange() {
if (EvaluationFactorEnum.AUDIT_COMPLIANCE.equals(curFactor.getAuditType())) return;
String factorMinScore = NumberFormat.getInstance().format(curFactor.getFactorMinScore());
String factorMaxScore = NumberFormat.getInstance().format(curFactor.getFactorMaxScore());
add(Messages.ScoreRange + ":", "[" + factorMinScore + "-" + factorMaxScore + Messages.Points + "]", SWTResourceManager.getColor(77, 163, 19), SWT.BOLD);
}
protected void addEvalExplain() {
if (StringUtils.isEmpty(curFactor.getMemo())) return;
addWrap(Messages.EvalExplain + ":", curFactor.getMemo(), SWTResourceManager.getColor(100, 100, 100), SWT.NORMAL);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="/org.eclipse.swt.core/lib/de.kupzog.KTable.jar"/>
<classpathentry kind="lib" path="/org.eclipse.swt.core/lib/org.eclipse.nebula.widgets.grid.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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