需求细节变更:

1.链接位置变更
2.提示信息变更
3.测试计划查重逻辑变更
部分功能修复
main
zouxk 5 years ago
parent 2832140236
commit 2156c4f8ff

@ -325,9 +325,6 @@
<menu id="JDProject.menus.JD2_GTSBYJ" label="手版样机" mnemonic="M">
<command commandId="JD2_GTSBYJPSD" id="JDProject.menus.JD2_GTSBYJPSD" mnemonic="S"></command>
</menu>
<menu id="JDProject.menus.JD2_GTDVSBYJ" label="DV手版样机" mnemonic="M">
<command commandId="JD2_GTXPCSXQD" id="JDProject.menus.JD2_GTXPCSXQD" mnemonic="S"></command>
</menu>
<menu id="JDProject.menus.JD2_GTKFYJ" label="开发样机" mnemonic="M">
<command commandId="JD2_GTTZPSD" id="JDProject.menus.JD2_GTTZPSD" mnemonic="S"></command>
<command commandId="JD2_GTZZJKMQD" id="JDProject.menus.JD2_GTZZJKMQD" mnemonic="S"></command>
@ -349,6 +346,7 @@
<command commandId="JD2_GTCPRZQRB" id="JDProject.menus.JD2_GTCPRZQRB" mnemonic="S"></command>
<command commandId="JD2_GTYPQRD" id="JDProject.menus.JD2_GTYPQRD" mnemonic="S"></command>
<command commandId="JD2_GTKFYJPSD" id="JDProject.menus.JD2_GTKFYJPSD" mnemonic="S"></command>
<command commandId="JD2_GTXPCSXQD" id="JDProject.menus.JD2_GTXPCSXQD" mnemonic="S"></command>
</menu>
<menu id="JDProject.menus.JD2_GTGYYJ" label="工艺样机" mnemonic="M">
<command commandId="JD2_GTRZZL" id="JDProject.menus.JD2_GTRZZL" mnemonic="S"></command>

@ -9,6 +9,8 @@ import java.awt.Font;
import java.awt.ScrollPane;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
@ -221,6 +223,34 @@ public class GTCSJHForm extends AbstractRendering {
table.setRowHeight(25);
table.setAutoscrolls(true);
table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
table.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (table.getSelectedColumn() == 15) {
if (e.getClickCount() == 2) {
System.out.println("双击了");
int selectedRow = table.getSelectedRow(); // 获得选中行索引
String value = (String) model.getValueAt(selectedRow, 15);
if (value == null)
value = "";
if (!value.equals("")) {
try {
TCComponent[] result = session.search("零组件 ID", new String[] { "零组件 ID" },
new String[] { value });
TCComponentItem item = (TCComponentItem) result[0];
TCComponent[] tccitem = item.getLatestItemRevision().getTCProperty("IMAN_specification")
.getReferenceValueArray();
TCComponentDataset dataset = (TCComponentDataset) tccitem[0];
dataset.open();
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
}
}
});
JScrollPane jsp = new JScrollPane(table);
jsp.setAutoscrolls(true);
innerCenter.add(jsp, BorderLayout.CENTER);
@ -273,9 +303,7 @@ public class GTCSJHForm extends AbstractRendering {
for (int i = 0; i < labellTexts.length; i++) {
if (parentProp.containsKey(labellTexts[i])) {
String str = parentProp.get(labellTexts[i]);
if ("".equals(str)) {
infoValue[i].setText(str);
}
} else {
System.out.println("ÊôÐÔ\"" + labellTexts[i] + "\"²»´æÔÚ");
}
@ -357,7 +385,7 @@ public class GTCSJHForm extends AbstractRendering {
System.out.println(filePath);
System.out.println(fileName);
int row = table.getSelectedRow();
String value = model.getValueAt(row, 14) == null ? "" : model.getValueAt(row, 14).toString();
String value = model.getValueAt(row, 15) == null ? "" : model.getValueAt(row, 15).toString();
if (value.equals("")) {
try {
TCComponentItemType itemtype = (TCComponentItemType) session.getTypeComponent("JD2_GTCSBG");
@ -583,7 +611,7 @@ public class GTCSJHForm extends AbstractRendering {
private void addResult(String realNo, int row, int times, String result) {
if (resultMap.containsKey(realNo)) {
if (times >= resultMap.get(realNo).getTimes()) {
if (times > resultMap.get(realNo).getTimes()) {
disableRows.add(resultMap.get(realNo).getRow());
resultMap.put(realNo, new JG(row, times, result));
}

@ -107,7 +107,7 @@ public class NewProductTestForm extends AbstractRendering {
int[][] propLocation1 = { { 0, 1 }, { 0, 3 }, { 1, 1 }, { 1, 3 }, { 2, 1 }, { 2, 3 }, { 3, 1 }, { 3, 3 },
{ 4, 1 }, { 4, 3 }, { 5, 1 }, { 5, 3 } };
for (int i = 0; i < propArr.length; i++) {
modelList1.add(new ModelValue(propArr[i], true, propLocation1[0][1], propLocation1[0][1], true));
modelList1.add(new ModelValue(propArr[i], true, propLocation1[i][0], propLocation1[i][1], true));
}
initModel(model1, modelList1);
@ -325,6 +325,7 @@ public class NewProductTestForm extends AbstractRendering {
objStr = "0";
}
int num = Integer.parseInt(objStr);
System.out.println("值:" + num);
if (num < 0) {
System.out.println("计算区域只能输入自然数或\"/\"");
MessageBox.post("计算区域只能输入自然数或\"/\"", "错误", MessageBox.ERROR);
@ -352,21 +353,22 @@ public class NewProductTestForm extends AbstractRendering {
}
table.setValueAt(sum, table.getRowCount() - 1, col);
double sum1 = Double
.parseDouble((sumObj = table.getValueAt(table.getRowCount() - 1, 4)) == null ? "0"
: sumObj.toString().trim());
.parseDouble(((sumObj = table.getValueAt(table.getRowCount() - 1, 4)) == null
|| "".equals(sumObj.toString().trim())) ? "0" : sumObj.toString().trim());
double sum2 = Double
.parseDouble((sumObj = table.getValueAt(table.getRowCount() - 1, 5)) == null ? "0"
: sumObj.toString().trim());
.parseDouble(((sumObj = table.getValueAt(table.getRowCount() - 1, 5)) == null
|| "".equals(sumObj.toString().trim())) ? "0" : sumObj.toString().trim());
double sum3 = Double
.parseDouble((sumObj = table.getValueAt(table.getRowCount() - 1, 6)) == null ? "0"
: sumObj.toString().trim());
.parseDouble(((sumObj = table.getValueAt(table.getRowCount() - 1, 6)) == null
|| "".equals(sumObj.toString().trim())) ? "0" : sumObj.toString().trim());
double sum4 = Double
.parseDouble((sumObj = table.getValueAt(table.getRowCount() - 1, 7)) == null ? "0"
: sumObj.toString().trim());
.parseDouble(((sumObj = table.getValueAt(table.getRowCount() - 1, 7)) == null
|| "".equals(sumObj.toString().trim())) ? "0" : sumObj.toString().trim());
table.setValueAt(sum1 + sum2 + sum3 + sum4, table.getRowCount() - 1, 3);
table2.revalidate();
table2.repaint();
} catch (NumberFormatException e1) {
e1.printStackTrace();
System.out.println("计算区域只能输入自然数或\"/\"");
MessageBox.post("计算区域只能输入自然数或\"/\"", "错误", MessageBox.ERROR);
obj = "/";
@ -518,7 +520,7 @@ public class NewProductTestForm extends AbstractRendering {
try {
AIFComponentContext[] comps = form.whereReferenced();
StringBuilder msg = new StringBuilder();
A1: for (AIFComponentContext aif : comps) {
for (AIFComponentContext aif : comps) {
System.out.println("ref type:" + aif.getComponent().getType());
if ("JD2_GTXPCSXQDRevision".equals(aif.getComponent().getType())) {
TCComponentItemRevision rev = (TCComponentItemRevision) aif.getComponent();
@ -531,9 +533,9 @@ public class NewProductTestForm extends AbstractRendering {
String ownner = form.getTCProperty("owning_user").getUIFValue();
for (int i = 0; i < 4; i++) {
if (exist.contains(jieduan[i])) {
System.out.println("已存在阶段\"" + jieduan[i] + "\"测试计划,请检查!");
MessageBox.post("已存在阶段\"" + jieduan[i] + "\"测试计划,请检查!", "错误", MessageBox.ERROR);
break A1;
System.out.println("\"" + jieduan[i] + "阶段\"测试计划已创建");
msg.append("\"" + jieduan[i] + "阶段\"测试计划已创建\n");
continue;
}
Object obj;
Object temp;
@ -569,7 +571,7 @@ public class NewProductTestForm extends AbstractRendering {
System.out.println(Arrays.deepToString(dataArr));
TCTableUtil.setTableRows(form1, "jd2_csjhtable", "JD2_CSJHTABLE", colNames2,
dataArr);
msg.append(jieduan[i] + "阶段测试计划创建成功\n");
msg.append("\"" + jieduan[i] + "阶段\"测试计划创建成功\n");
}
colData.clear();
}

Loading…
Cancel
Save