1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
package com.gx.obe.struct.composite;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StackLayout;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import com.gx.obe.WebserviceConstants;
import com.gx.obe.bind.call.Call;
import com.gx.obe.bind.prop.Prop;
import com.gx.obe.business.entity.SupplierEvaluationFactor;
import com.gx.obe.common.widget.button.EvalLeftButton;
import com.gx.obe.components.core.Constants;
import com.gx.obe.components.core.enumeration.EvaluationStepEnum;
import com.gx.obe.config.ConfigConstants;
import com.gx.obe.config.utils.PropertiesUtils;
import com.gx.obe.http.HttpResponse;
import com.gx.obe.http.Status;
import com.gx.obe.http.json.JsonUtil;
import com.gx.obe.step.composite.EvaluationComposite;
import com.gx.obe.struct.Activator;
import com.gx.obe.struct.dialog.AuxevaluationFullScreenDialog;
import com.gx.obe.struct.enums.EvaluationFactorTypeEnum;
import com.gx.obe.util.utils.StringUtil;
import com.gx.obe.web.entity.evaluation.EvaluationFactor;
import com.gx.obe.web.entity.evaluation.EvaluationStep;
import com.gx.obe.web.entity.tender.TenderProjectEntity;
import com.gx.obe.web.utils.NetworkRequest;
import com.gx.obe.web.utils.ResultStatus;
import com.swtdesigner.ResourceManager;
import net.sf.json.JSONObject;
public class FactorClearBidEvaluationComposite extends EvaluationComposite {
private final Call clearBidRefresh = new Call();
private final Prop<FactorClearBidData> factorClearBidData = new Prop<>();
private final Prop<Boolean> showMainView = new Prop<>(true);
private final Prop<String> reviewContent = new Prop<>();
private SupplierEvaluationFactor supplierEvaluationFactor;
private class FactorClearBidData {
private EvaluationFactor evaluationFactor;
private SupplierEvaluationFactor supplierEvaluationFactor;
}
public FactorClearBidEvaluationComposite(Composite parent, TenderProjectEntity tenderProject, EvaluationStep evaluationStep) {
super(parent, tenderProject, evaluationStep);
EvalLeftButton button = new EvalLeftButton(getLeftToolComposite(), SWT.SELECTED);
button.addMouseListener(MouseListener.mouseUpAdapter(e -> showAuxevaluationFullScreen()));
button.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
button.setImage(ResourceManager.getPluginImage(Activator.PLUGIN_ID, "icons/auxevaluation.png"));
button.setToolTipText("辅助评标");
StackLayout stackLayout = new StackLayout();
Composite composite = new Composite(getEvaluatoinComposite(), SWT.NONE);
composite.setLayout(stackLayout);
FactorClearBidComposite composite_1 = new FactorClearBidComposite(composite, tenderProject, evaluationStep, curUser);
composite_1.addCellDoubleClickListeners(this::cellDoubleClicked);
composite_1.addGoBackListener(super::goBackAction);
clearBidRefresh.bindExe(composite_1::refresh);
reviewContent.bind(composite_1::refreshCell);
EvaluationFactorTypeEnum factorTypeEnum = EvaluationFactorTypeEnum.MAP.get(evaluationStep.getEvaluationParamByKey(EvaluationStepEnum.EVALUATION_FACTOR_TYPE));
ClearBidReviewEntryComposite composite_2 = new ClearBidReviewEntryComposite(composite, tenderProject.getId());
composite_2.addReturnListener(this::returnAction);
factorClearBidData.bind(t -> composite_2.refresh(t.evaluationFactor, t.supplierEvaluationFactor, factorTypeEnum));
showMainView.bindExe(t -> {
stackLayout.topControl = t ? composite_1 : composite_2;
composite.layout();
});
}
private void showAuxevaluationFullScreen() {
new Thread() {
public void run(){
Display.getDefault().syncExec(new Runnable(){
public void run(){
String stPlatformUrl = PropertiesUtils.getProperty(ConfigConstants.SERVER_URL, "");
if(!stPlatformUrl.endsWith("/")){
stPlatformUrl = stPlatformUrl + "/";
}
stPlatformUrl = stPlatformUrl + PropertiesUtils.getWebserviceProperty(WebserviceConstants.GET_TB_TOKEN, "tBBaseNoticeController.do?forDTbeTokenUser");
Map<String, Object> param = new HashMap<String, Object>();
param.put("userName", Constants.USER.getUserAccount());
String getWebserviceXml = NetworkRequest.get(stPlatformUrl, param);
boolean flag = false;
String obj = null;
try {
JSONObject root = JSONObject.fromObject(getWebserviceXml);
boolean result = (boolean) root.get("success");
if(result){
flag = true;
obj = (String)root.get("obj");
}
} catch (Exception e) {
}
if(flag && null != obj) {
new AuxevaluationFullScreenDialog(getShell(), tenderProject.getStageId(), obj).open();
}
}
});
}
}.start();
}
private void cellDoubleClicked(EvaluationFactor evaluationFactor, SupplierEvaluationFactor supplierEvaluationFactor) {
showMainView.set(false);
this.supplierEvaluationFactor = supplierEvaluationFactor;
FactorClearBidData factorClearBidData = new FactorClearBidData();
factorClearBidData.evaluationFactor = evaluationFactor;
factorClearBidData.supplierEvaluationFactor = supplierEvaluationFactor;
this.factorClearBidData.set(factorClearBidData);
}
private void returnAction() {
showMainView.set(true);
reviewContent.set(supplierEvaluationFactor.getOpinion());
}
@Override
protected void goBackAction() {
if (showMainView.get()) {
super.goBackAction();
} else {
returnAction();
}
}
@Override
protected void initButtonComposite() {}
@Override
protected void refreshEvaluationResult() {
clearBidRefresh.exe();
}
@Override
protected boolean saveEvaluationResult() {
return false;
}
@Override
protected String checkEvaluationResult() {
return null;
}
@Override
protected void createEvaluatoinComposite(Composite evaluatoinComposite) {
// TODO Auto-generated method stub
}
}