Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
|
061b9be739 | 6 months ago |
|
121a73b2e6 | 7 months ago |
|
84cbfec1ef | 7 months ago |
|
d0f3c58b6f | 9 months ago |
|
167f989baf | 10 months ago |
|
f4b5b5cb20 | 11 months ago |
|
96eac805ed | 11 months ago |
|
10e99ce87b | 1 year ago |
|
7d2c60af2c | 1 year ago |
|
f0138c2658 | 1 year ago |
@ -1,8 +0,0 @@
|
||||
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.release=enabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,134 @@
|
||||
package com.chint.plm.qms;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.event.Event;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.TableCell;
|
||||
import javafx.scene.control.TableColumn;
|
||||
import javafx.scene.control.TableColumn.CellEditEvent;
|
||||
import javafx.scene.control.TablePosition;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.util.converter.DefaultStringConverter;
|
||||
import javafx.util.converter.IntegerStringConverter;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
|
||||
public class EditingCell<T> extends TableCell<T, String> {
|
||||
private TextField textField;
|
||||
|
||||
public EditingCell() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startEdit() {
|
||||
if (!isEmpty()) {
|
||||
super.startEdit();
|
||||
createTextField();
|
||||
setText(null);
|
||||
setGraphic(textField);
|
||||
textField.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelEdit() {
|
||||
super.cancelEdit();
|
||||
|
||||
setText(getItem());
|
||||
setGraphic(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateItem(String item, boolean empty) {
|
||||
super.updateItem(item, empty);
|
||||
if (empty) {
|
||||
setText(null);
|
||||
setGraphic(null);
|
||||
} else {
|
||||
if (isEditing()) {
|
||||
if (textField != null) {
|
||||
textField.setText(getString());
|
||||
}
|
||||
setText(null);
|
||||
setGraphic(textField);
|
||||
} else {
|
||||
setText(getString());
|
||||
setGraphic(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commitEdit(String newValue) {
|
||||
if (!isEditing() && !Objects.equals(newValue, getItem())) {
|
||||
TableView<T> table = getTableView();
|
||||
if (table != null) {
|
||||
TableColumn<T, String> col = getTableColumn();
|
||||
CellEditEvent<T, String> event = new CellEditEvent<>(table, new TablePosition<>(table, getIndex(), col),
|
||||
TableColumn.editCommitEvent(), newValue);
|
||||
Event.fireEvent(col, event);
|
||||
System.out.println("开始利用反射将数据写入对象");
|
||||
T item = getTableView().getItems().get(getIndex());
|
||||
String property = col.getId();
|
||||
Class<?> type = getItemFieldType(item, property);
|
||||
Object convertedValue = convertValue(newValue, type);
|
||||
setItemProperty(item, property, convertedValue);
|
||||
}
|
||||
}
|
||||
|
||||
super.commitEdit(newValue);
|
||||
updateItem(newValue, false);
|
||||
}
|
||||
|
||||
private void setItemProperty(T item, String property, Object value) {
|
||||
try {
|
||||
Field field = item.getClass().getDeclaredField(property);
|
||||
field.setAccessible(true);
|
||||
field.set(item, value);
|
||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Object convertValue(String value, Class<?> type) {
|
||||
if (type == SimpleStringProperty.class) {
|
||||
return new SimpleStringProperty(value);
|
||||
} else if (type == String.class) {
|
||||
return value;
|
||||
} else if (type == Integer.class) {
|
||||
return new IntegerStringConverter().fromString(value);
|
||||
} else if (type == Double.class) {
|
||||
return new DefaultStringConverter().fromString(value);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private Class<?> getItemFieldType(T item, String property) {
|
||||
try {
|
||||
Field field = item.getClass().getDeclaredField(property);
|
||||
return field.getType();
|
||||
} catch (NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private void createTextField() {
|
||||
textField = new TextField(getString());
|
||||
System.out.println("可读写模式");
|
||||
textField.setAlignment(Pos.CENTER);
|
||||
textField.setMinWidth(getWidth() - getGraphicTextGap() * 2);
|
||||
textField.focusedProperty().addListener((ob, old, now) -> {
|
||||
if (!now) {
|
||||
commitEdit(textField.getText());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getString() {
|
||||
return getItem() == null ? "" : getItem();
|
||||
}
|
||||
}
|
@ -0,0 +1,320 @@
|
||||
package com.chint.plm.qms;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.TableRow;
|
||||
import javafx.scene.control.TableView;
|
||||
import javafx.scene.control.TextField;
|
||||
|
||||
public class QMSBean {
|
||||
|
||||
private Integer code;
|
||||
private SimpleStringProperty xh = new SimpleStringProperty();
|
||||
private SimpleStringProperty qmsinspectioncode = new SimpleStringProperty();
|
||||
private SimpleStringProperty qmsinspectionname = new SimpleStringProperty();
|
||||
private SimpleStringProperty qmssuperiorinspectionname = new SimpleStringProperty();
|
||||
private SimpleStringProperty qmsinspectionschemename = new SimpleStringProperty();
|
||||
private SimpleStringProperty qmspushuser = new SimpleStringProperty();
|
||||
private ComboBox<String> plmvaluetype = new ComboBox<String>();
|
||||
private SimpleStringProperty plminspectioncode = new SimpleStringProperty();
|
||||
private TextField plmdesignation = new TextField();
|
||||
private ComboBox<String> plmsequence = new ComboBox<String>();
|
||||
private SimpleStringProperty result = new SimpleStringProperty();
|
||||
private SimpleStringProperty status = new SimpleStringProperty();
|
||||
private SimpleStringProperty synctime = new SimpleStringProperty();
|
||||
private SimpleStringProperty plmchangeuser = new SimpleStringProperty();
|
||||
private boolean isEdit;
|
||||
private boolean red = false;
|
||||
private CheckBox checkBox = new CheckBox();
|
||||
private TableView<QMSBean> table = null;
|
||||
public QMSBean() {
|
||||
}
|
||||
|
||||
public QMSBean(boolean isEdit,Integer code, String xh, String qmsinspectioncode, String qmsinspectionname,
|
||||
String qmssuperiorinspectionname, String qmsinspectionschemename, String qmspushuser,
|
||||
String plmvaluetype, String plminspectioncode, String plmdesignation, String plmsequence,
|
||||
String result, String status, Date synctime, String plmchangeuser) {
|
||||
super();
|
||||
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-M-dd HH:mm:ss");
|
||||
this.code = code;
|
||||
checkBox.setSelected(false);
|
||||
checkBox.setDisable(!isEdit);
|
||||
this.xh.set(xh);
|
||||
this.qmsinspectioncode.set(qmsinspectioncode);
|
||||
|
||||
|
||||
this.qmsinspectionname.set(qmsinspectionname);
|
||||
|
||||
|
||||
this.qmssuperiorinspectionname.set(qmssuperiorinspectionname);
|
||||
|
||||
|
||||
this.qmsinspectionschemename.set(qmsinspectionschemename);
|
||||
|
||||
|
||||
this.qmspushuser.set(qmspushuser);
|
||||
|
||||
|
||||
|
||||
this.plmvaluetype.getItems().addAll("参数化","型号规格(3d模型)","物料描述规格(2d图纸)");
|
||||
this.plmvaluetype.setValue(plmvaluetype);
|
||||
this.plmvaluetype.setEditable(false);
|
||||
this.plmvaluetype.setDisable(!isEdit);
|
||||
|
||||
this.plminspectioncode.set(plminspectioncode);
|
||||
|
||||
|
||||
this.plmdesignation.setText(plmdesignation);
|
||||
this.plmdesignation.setEditable(isEdit);
|
||||
|
||||
|
||||
this.plmsequence.getItems().addAll("1","2","3","4","5","6","7","8","9");
|
||||
this.plmsequence.setValue(plmsequence);
|
||||
this.plmsequence.setEditable(false);
|
||||
this.plmsequence.setDisable(!isEdit);
|
||||
|
||||
|
||||
|
||||
this.result.set(result);
|
||||
|
||||
|
||||
this.status.set(status);
|
||||
|
||||
|
||||
this.synctime.set(synctime == null ? "" : sdf2.format(synctime));
|
||||
|
||||
|
||||
this.plmchangeuser.set(plmchangeuser);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public CheckBox getCheckBox() {
|
||||
return checkBox;
|
||||
}
|
||||
|
||||
public void setCheckBox(CheckBox checkBox) {
|
||||
this.checkBox = checkBox;
|
||||
}
|
||||
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getXh() {
|
||||
return xh.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setXh(SimpleStringProperty xh) {
|
||||
this.xh = xh;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getQmsinspectioncode() {
|
||||
return qmsinspectioncode.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setQmsinspectioncode(SimpleStringProperty qmsinspectioncode) {
|
||||
this.qmsinspectioncode = qmsinspectioncode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getQmsinspectionname() {
|
||||
return qmsinspectionname.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setQmsinspectionname(SimpleStringProperty qmsinspectionname) {
|
||||
this.qmsinspectionname = qmsinspectionname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getQmssuperiorinspectionname() {
|
||||
return qmssuperiorinspectionname.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setQmssuperiorinspectionname(SimpleStringProperty qmssuperiorinspectionname) {
|
||||
this.qmssuperiorinspectionname = qmssuperiorinspectionname;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getQmsinspectionschemename() {
|
||||
return qmsinspectionschemename.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setQmsinspectionschemename(SimpleStringProperty qmsinspectionschemename) {
|
||||
this.qmsinspectionschemename = qmsinspectionschemename;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getQmspushuser() {
|
||||
return qmspushuser.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setQmspushuser(SimpleStringProperty qmspushuser) {
|
||||
this.qmspushuser = qmspushuser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ComboBox<String> getPlmvaluetype() {
|
||||
return plmvaluetype;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPlmvaluetype(ComboBox<String> plmvaluetype) {
|
||||
this.plmvaluetype=plmvaluetype;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getPlminspectioncode() {
|
||||
return plminspectioncode.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPlminspectioncode(SimpleStringProperty plminspectioncode) {
|
||||
this.plminspectioncode = plminspectioncode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public TextField getPlmdesignation() {
|
||||
return plmdesignation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPlmdesignation(TextField plmdesignation) {
|
||||
this.plmdesignation = plmdesignation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ComboBox<String> getPlmsequence() {
|
||||
return plmsequence;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPlmsequence(ComboBox<String> plmsequence) {
|
||||
this.plmsequence = plmsequence;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getResult() {
|
||||
return result.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setResult(SimpleStringProperty result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getStatus() {
|
||||
return status.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setStatus(SimpleStringProperty status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getSynctime() {
|
||||
return synctime.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setSynctime(SimpleStringProperty synctime) {
|
||||
this.synctime = synctime;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getPlmchangeuser() {
|
||||
return plmchangeuser.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPlmchangeuser(SimpleStringProperty plmchangeuser) {
|
||||
this.plmchangeuser = plmchangeuser;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean isEdit() {
|
||||
return isEdit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setEdit(boolean isEdit) {
|
||||
this.isEdit = isEdit;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public boolean isRed() {
|
||||
return red;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setRed(boolean red) {
|
||||
this.red = red;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QMSBean [code=" + code + ", xh=" + xh + ", qmsinspectioncode=" + qmsinspectioncode
|
||||
+ ", qmsinspectionname=" + qmsinspectionname + ", qmssuperiorinspectionname="
|
||||
+ qmssuperiorinspectionname + ", qmsinspectionschemename=" + qmsinspectionschemename + ", qmspushuser="
|
||||
+ qmspushuser + ", plmvaluetype=" + plmvaluetype + ", plminspectioncode=" + plminspectioncode
|
||||
+ ", plmdesignation=" + plmdesignation + ", plmsequence=" + plmsequence + ", result=" + result
|
||||
+ ", status=" + status + ", synctime=" + synctime + ", plmchangeuser=" + plmchangeuser + ", isEdit="
|
||||
+ isEdit + ", red=" + red + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.chint.plm.qms;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
|
||||
import com.chint.plm.rdmCreate.KFrame;
|
||||
|
||||
import javafx.embed.swing.JFXPanel;
|
||||
|
||||
public class QMSFrame extends KFrame {
|
||||
|
||||
public QMSFrame() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initUI() throws Exception {
|
||||
this.setTitle("ÖÊÁ¿¼ìÑéÏîά»¤½çÃæ");
|
||||
this.setLayout(new BorderLayout());
|
||||
// this.setPreferredSize(new Dimension(1300, 900));
|
||||
JFXPanel panel = new JFXPanel();
|
||||
panel.setScene(new QMSPanel(this).getScene());
|
||||
this.add(BorderLayout.CENTER, panel);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,76 @@
|
||||
package com.chint.plm.qms;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.chainsaw.Main;
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
|
||||
|
||||
import com.connor.chint.sap2.util.SAPUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
/**
|
||||
* 成本单管理
|
||||
* @author admin
|
||||
* 2023/11/16
|
||||
*/
|
||||
public class QMSHandler extends AbstractHandler{
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
||||
TCSession session = (TCSession)app.getSession();
|
||||
try {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
// NewJFrame newJFrame = new NewJFrame(session);
|
||||
// int width2 = newJFrame.getWidth();
|
||||
// int height2 = newJFrame.getHeight();
|
||||
// Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
|
||||
// int screenWidth = screenSize.width; // 获取屏幕宽度
|
||||
// int screenHeight = screenSize.height; // 获取屏幕高度
|
||||
// int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
|
||||
// int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
|
||||
// newJFrame.setTitle("工装需求查询");
|
||||
// // this.getContentPane().setBackground(Color.red);
|
||||
// newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
|
||||
// newJFrame.setSize(1240, height2); // 设置Frame的大小
|
||||
// newJFrame.setLocation(x, y); // 设置Frame的位置
|
||||
// newJFrame.setResizable(false);
|
||||
// newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
|
||||
// newJFrame.setVisible(true);
|
||||
|
||||
// String groupID = "";
|
||||
// try {
|
||||
// groupID = SAPUtil.getGroupID(session);
|
||||
// } catch (TCException e) {
|
||||
// // TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// System.out.println("groupID==="+groupID);
|
||||
// //Project Administration
|
||||
// if(!groupID.equals("Project Administration")) {
|
||||
// MessageBox.post("请切换至项目管理组执行此功能。", "提示", MessageBox.INFORMATION);
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
new QMSFrame();
|
||||
}
|
||||
}.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.chint.plm.qms;
|
||||
|
||||
import java.awt.Window;
|
||||
|
||||
import com.chint.plm.rdmCreate.KFXPanel;
|
||||
|
||||
|
||||
|
||||
public class QMSPanel extends KFXPanel {
|
||||
|
||||
public QMSPanel(Window dialog) {
|
||||
super(dialog, "QMS.fxml");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import com.sun.javafx.util.Logging;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import java.awt.Window;
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.stage.Stage;
|
||||
//import sun.util.logging.PlatformLogger;
|
||||
|
||||
public abstract class KFXPanel extends Application {
|
||||
protected Scene scene;
|
||||
|
||||
protected KFXPanelController aifController;
|
||||
|
||||
protected Parent root;
|
||||
|
||||
protected String cssForm;
|
||||
|
||||
protected Window parentDialog;
|
||||
|
||||
static {
|
||||
Platform.setImplicitExit(false);
|
||||
// Logging.getCSSLogger().setLevel(Platform.class...STYLESHEET_CASPIAN....Level.OFF);
|
||||
}
|
||||
|
||||
public KFXPanel(Window dialog, String fxmlName) {
|
||||
setParentDialog(dialog);
|
||||
initUI(fxmlName);
|
||||
initData();
|
||||
}
|
||||
|
||||
public KFXPanel(Window dialog, Class<?> c, String css) {
|
||||
setParentDialog(dialog);
|
||||
this.cssForm = c.getResource(css).toExternalForm();
|
||||
initUI();
|
||||
initData();
|
||||
}
|
||||
|
||||
public void setParentDialog(Window dialog) {
|
||||
this.parentDialog = dialog;
|
||||
}
|
||||
|
||||
public Window getParentDialog() {
|
||||
return this.parentDialog;
|
||||
}
|
||||
|
||||
public Parent getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
public KFXPanelController getController() {
|
||||
return this.aifController;
|
||||
}
|
||||
|
||||
public Scene getScene() {
|
||||
if (this.scene == null) {
|
||||
this.scene = new Scene(this.root);
|
||||
this.scene.setFill(null);
|
||||
}
|
||||
return this.scene;
|
||||
}
|
||||
|
||||
public void initData() {
|
||||
try {
|
||||
this.aifController.initData(this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUI(String fxmlName) {
|
||||
try {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader();
|
||||
String resource = fxmlName;// "SearchSapResultPanel.fxml";
|
||||
fxmlLoader.setLocation(getClass().getResource(resource));
|
||||
this.root = (Parent) fxmlLoader.load();
|
||||
this.aifController = (KFXPanelController) fxmlLoader.getController();
|
||||
if (this.cssForm != null)
|
||||
this.root.getStylesheets().add(this.cssForm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUI() {
|
||||
try {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader();
|
||||
String resource = "SearchSapResultPanel.fxml";
|
||||
fxmlLoader.setLocation(getClass().getResource(resource));
|
||||
this.root = (Parent) fxmlLoader.load();
|
||||
this.aifController = (KFXPanelController) fxmlLoader.getController();
|
||||
if (this.cssForm != null)
|
||||
this.root.getStylesheets().add(this.cssForm);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
post(this.parentDialog, e.getMessage(), "", 1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void post(Window dialog, final String msg, final String title, int msgType) {
|
||||
if (dialog == null) {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
Alert alert = new Alert(Alert.AlertType.INFORMATION);
|
||||
alert.setTitle(title);
|
||||
alert.setHeaderText("");
|
||||
alert.setContentText(msg);
|
||||
alert.showAndWait();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
MessageBox.post(dialog, msg, title, msgType);
|
||||
}
|
||||
}
|
||||
|
||||
// protected Stage primaryStage;
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
initUI();
|
||||
initData();
|
||||
// this.primaryStage = primaryStage;
|
||||
primaryStage.setScene(getScene());
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
|
||||
public abstract class KFXPanelController {
|
||||
@FXML
|
||||
protected AnchorPane coverPane;
|
||||
|
||||
public abstract void initData(KFXPanel paramKFXPanel) throws Exception;
|
||||
|
||||
public void setCoverVisible(final boolean visible) {
|
||||
if (this.coverPane != null) {
|
||||
Platform.runLater(new Runnable() {
|
||||
public void run() {
|
||||
KFXPanelController.this.coverPane.setVisible(visible);
|
||||
}
|
||||
});
|
||||
try {
|
||||
Thread.sleep(10L);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import com.teamcenter.rac.util.UIUtilities;
|
||||
import javax.swing.JFrame;
|
||||
|
||||
public abstract class KFrame extends JFrame {
|
||||
// protected KDialogController controller;
|
||||
|
||||
public KFrame() {
|
||||
try {
|
||||
// if (!this.controller.init())
|
||||
// return;
|
||||
initUI();
|
||||
showFrame();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MessageBox.post(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
public void showFrame() {
|
||||
pack();
|
||||
UIUtilities.centerToScreen(this);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
protected abstract void initUI() throws Exception;
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import java.lang.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
|
||||
<Pane fx:id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="840.0" prefWidth="1270.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.chint.plm.rdmCreate.RdmCreateController">
|
||||
<children>
|
||||
<TitledPane fx:id="titlePane" animated="false" layoutY="-1.0" prefHeight="105.0" prefWidth="1272.0" text="创建研发项目">
|
||||
<content>
|
||||
<AnchorPane fx:id="anchorPane1" minHeight="0.0" minWidth="0.0" prefHeight="67.0" prefWidth="1270.0">
|
||||
<children>
|
||||
<GridPane fx:id="gridTop" layoutX="197.0" layoutY="18.0" prefHeight="49.0" prefWidth="839.0">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button fx:id="cjButton" mnemonicParsing="false" onAction="#cjbutton" prefHeight="41.0" prefWidth="136.0" text="创建" GridPane.halignment="CENTER" />
|
||||
<Button fx:id="gbxmButton" mnemonicParsing="false" onAction="#gbxmButton" prefHeight="43.0" prefWidth="135.0" text="关闭项目" GridPane.columnIndex="2" GridPane.halignment="CENTER" />
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</TitledPane>
|
||||
<Pane fx:id="pane1" layoutY="109.0" prefHeight="726.0" prefWidth="309.0">
|
||||
<children>
|
||||
<AnchorPane fx:id="anchorPane2" minHeight="0.0" minWidth="0.0" prefHeight="726.0" prefWidth="309.0">
|
||||
<children>
|
||||
<GridPane fx:id="grid" layoutX="20.0" layoutY="41.0" prefHeight="457.0" prefWidth="253.0">
|
||||
<children>
|
||||
<Label prefHeight="20.0" prefWidth="82.0" text="内部订单号" />
|
||||
<Label text="项目定义" GridPane.rowIndex="1" />
|
||||
<Label text="集团项目号" GridPane.rowIndex="2" />
|
||||
<Label text="项目名称" GridPane.rowIndex="3" />
|
||||
<Label text="项目经理" GridPane.rowIndex="4" />
|
||||
<Label text="工厂" GridPane.rowIndex="5" />
|
||||
<Label text="推送者" GridPane.rowIndex="6" />
|
||||
<Label text="推送时间早于" GridPane.rowIndex="7" />
|
||||
<Label text="推送时间晚于" GridPane.rowIndex="8" />
|
||||
<Label text="状态" GridPane.rowIndex="9" />
|
||||
<TextField fx:id="f0" GridPane.columnIndex="1" />
|
||||
<TextField fx:id="f1" GridPane.columnIndex="1" GridPane.rowIndex="1" />
|
||||
<TextField fx:id="f2" GridPane.columnIndex="1" GridPane.rowIndex="2" />
|
||||
<TextField fx:id="f3" GridPane.columnIndex="1" GridPane.rowIndex="3" />
|
||||
<TextField fx:id="f4" GridPane.columnIndex="1" GridPane.rowIndex="4" />
|
||||
<TextField fx:id="f6" GridPane.columnIndex="1" GridPane.rowIndex="6" />
|
||||
<DatePicker fx:id="f7" GridPane.columnIndex="1" GridPane.rowIndex="7" />
|
||||
<DatePicker fx:id="f8" GridPane.columnIndex="1" GridPane.rowIndex="8" />
|
||||
<ComboBox fx:id="f5" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="5" />
|
||||
<ComboBox fx:id="f9" prefWidth="150.0" GridPane.columnIndex="1" GridPane.rowIndex="9" />
|
||||
<Button fx:id="cxButton" mnemonicParsing="false" onAction="#cxButton" prefHeight="30.0" prefWidth="88.0" text="查询" GridPane.columnIndex="1" GridPane.rowIndex="11" />
|
||||
</children>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="122.0" minWidth="10.0" prefWidth="93.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="160.0" minWidth="10.0" prefWidth="160.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
</GridPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</Pane>
|
||||
<Pane fx:id="pane2" layoutX="318.0" layoutY="108.0" prefHeight="733.0" prefWidth="949.0">
|
||||
<children>
|
||||
<AnchorPane fx:id="anchorPane3" minHeight="0.0" minWidth="0.0" prefHeight="726.0" prefWidth="949.0">
|
||||
<children>
|
||||
<ScrollPane fx:id="scrollpane" prefHeight="726.0" prefWidth="941.0">
|
||||
<content>
|
||||
<AnchorPane fx:id="anchorPane4" minHeight="0.0" minWidth="0.0" prefHeight="707.0" prefWidth="922.0">
|
||||
<children>
|
||||
<TableView fx:id="table" prefHeight="711.0" prefWidth="927.0" />
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</ScrollPane>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</children>
|
||||
</Pane>
|
||||
</children>
|
||||
</Pane>
|
@ -0,0 +1,200 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import java.sql.Date;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.TextArea;
|
||||
|
||||
public class RdmCreateBean {
|
||||
|
||||
private TextArea ordernumber = new TextArea();
|
||||
private TextArea projectno = new TextArea();
|
||||
private TextArea rdmprojectno = new TextArea();
|
||||
private TextArea projectname = new TextArea();
|
||||
private TextArea projectleader = new TextArea();
|
||||
private TextArea factory = new TextArea();
|
||||
private TextArea pushuser = new TextArea();
|
||||
private TextArea pushdate = new TextArea();
|
||||
private TextArea status = new TextArea();
|
||||
private TextArea createdate = new TextArea();
|
||||
private TextArea projectleaderid = new TextArea();
|
||||
private TextArea pushuserid = new TextArea();
|
||||
private CheckBox checkBox = new CheckBox();
|
||||
|
||||
|
||||
|
||||
|
||||
public CheckBox getCheckBox() {
|
||||
return checkBox;
|
||||
}
|
||||
|
||||
public void setCheckBox(CheckBox checkBox) {
|
||||
this.checkBox = checkBox;
|
||||
}
|
||||
|
||||
public RdmCreateBean(String ordernumber, String projectno, String rdmprojectno, String projectname,
|
||||
String projectleader, String factory, String pushuser, Date pushdate, String status, Date createdate,
|
||||
String projectleaderid, String pushuserid) {
|
||||
super();
|
||||
|
||||
this.checkBox.setSelected(false);
|
||||
|
||||
this.ordernumber.setText(ordernumber);
|
||||
this.ordernumber.setEditable(false);
|
||||
this.ordernumber.setPrefSize(200, 40);
|
||||
|
||||
this.projectno.setText(projectno);
|
||||
this.projectno.setEditable(false);
|
||||
this.projectno.setPrefSize(200, 40);
|
||||
|
||||
this.rdmprojectno.setText(rdmprojectno);
|
||||
this.rdmprojectno.setEditable(false);
|
||||
this.rdmprojectno.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.projectname.setText(projectname);
|
||||
this.projectname.setEditable(false);
|
||||
this.projectname.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.projectleader.setText(projectleader);
|
||||
this.projectleader.setEditable(false);
|
||||
this.projectleader.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.factory.setText(factory);
|
||||
this.factory.setEditable(false);
|
||||
this.factory.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.pushuser.setText(pushuser);
|
||||
this.pushuser.setEditable(false);
|
||||
this.pushuser.setPrefSize(200, 40);
|
||||
|
||||
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-M-dd");
|
||||
|
||||
this.pushdate.setText(sdf2.format(pushdate));
|
||||
this.pushdate.setEditable(false);
|
||||
this.pushdate.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.status.setText(status);
|
||||
this.status.setEditable(false);
|
||||
this.status.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.createdate.setText(sdf2.format(createdate));
|
||||
this.createdate.setEditable(false);
|
||||
this.createdate.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.projectleaderid.setText(projectleaderid);
|
||||
this.projectleaderid.setEditable(false);
|
||||
this.projectleaderid.setPrefSize(200, 40);
|
||||
|
||||
|
||||
this.pushuserid.setText(pushuserid);
|
||||
this.pushuserid.setEditable(false);
|
||||
this.pushuserid.setPrefSize(200, 40);
|
||||
}
|
||||
|
||||
public void setOrdernumber(TextArea ordernumber) {
|
||||
this.ordernumber = ordernumber;
|
||||
}
|
||||
|
||||
public void setProjectno(TextArea projectno) {
|
||||
this.projectno = projectno;
|
||||
}
|
||||
|
||||
public void setRdmprojectno(TextArea rdmprojectno) {
|
||||
this.rdmprojectno = rdmprojectno;
|
||||
}
|
||||
|
||||
public void setProjectname(TextArea projectname) {
|
||||
this.projectname = projectname;
|
||||
}
|
||||
|
||||
public void setProjectleader(TextArea projectleader) {
|
||||
this.projectleader = projectleader;
|
||||
}
|
||||
|
||||
public void setFactory(TextArea factory) {
|
||||
this.factory = factory;
|
||||
}
|
||||
|
||||
public void setPushuser(TextArea pushuser) {
|
||||
this.pushuser = pushuser;
|
||||
}
|
||||
|
||||
public void setPushdate(TextArea pushdate) {
|
||||
this.pushdate = pushdate;
|
||||
}
|
||||
|
||||
public void setStatus(TextArea status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setCreatedate(TextArea createdate) {
|
||||
this.createdate = createdate;
|
||||
}
|
||||
|
||||
public void setProjectleaderid(TextArea projectleaderid) {
|
||||
this.projectleaderid = projectleaderid;
|
||||
}
|
||||
|
||||
public void setPushuserid(TextArea pushuserid) {
|
||||
this.pushuserid = pushuserid;
|
||||
}
|
||||
|
||||
public TextArea getOrdernumber() {
|
||||
return ordernumber;
|
||||
}
|
||||
|
||||
public TextArea getProjectno() {
|
||||
return projectno;
|
||||
}
|
||||
|
||||
public TextArea getRdmprojectno() {
|
||||
return rdmprojectno;
|
||||
}
|
||||
|
||||
public TextArea getProjectname() {
|
||||
return projectname;
|
||||
}
|
||||
|
||||
public TextArea getProjectleader() {
|
||||
return projectleader;
|
||||
}
|
||||
|
||||
public TextArea getFactory() {
|
||||
return factory;
|
||||
}
|
||||
|
||||
public TextArea getPushuser() {
|
||||
return pushuser;
|
||||
}
|
||||
|
||||
public TextArea getPushdate() {
|
||||
return pushdate;
|
||||
}
|
||||
|
||||
public TextArea getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public TextArea getCreatedate() {
|
||||
return createdate;
|
||||
}
|
||||
|
||||
public TextArea getProjectleaderid() {
|
||||
return projectleaderid;
|
||||
}
|
||||
|
||||
public TextArea getPushuserid() {
|
||||
return pushuserid;
|
||||
}
|
||||
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,103 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Toolkit;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.chainsaw.Main;
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
|
||||
|
||||
import com.connor.chint.sap2.util.SAPUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.aifrcp.AIFUtility;
|
||||
import com.teamcenter.rac.kernel.TCComponentFolder;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Alert.AlertType;
|
||||
|
||||
/**
|
||||
* 成本单管理
|
||||
* @author admin
|
||||
* 2023/11/16
|
||||
*/
|
||||
public class RdmCreateHandler extends AbstractHandler{
|
||||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) {
|
||||
// TODO Auto-generated method stub
|
||||
AbstractAIFApplication app = AIFUtility.getCurrentApplication();
|
||||
TCSession session = (TCSession)app.getSession();
|
||||
try {
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
// NewJFrame newJFrame = new NewJFrame(session);
|
||||
// int width2 = newJFrame.getWidth();
|
||||
// int height2 = newJFrame.getHeight();
|
||||
// Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); // 获取屏幕尺寸
|
||||
// int screenWidth = screenSize.width; // 获取屏幕宽度
|
||||
// int screenHeight = screenSize.height; // 获取屏幕高度
|
||||
// int x = (screenWidth - width2) / 2; // 计算Frame的左上角x坐标
|
||||
// int y = (screenHeight - height2) / 2; // 计算Frame的左上角y坐标
|
||||
// newJFrame.setTitle("工装需求查询");
|
||||
// // this.getContentPane().setBackground(Color.red);
|
||||
// newJFrame.getContentPane().setBackground(new java.awt.Color(255, 255, 255));
|
||||
// newJFrame.setSize(1240, height2); // 设置Frame的大小
|
||||
// newJFrame.setLocation(x, y); // 设置Frame的位置
|
||||
// newJFrame.setResizable(false);
|
||||
// newJFrame.setDefaultCloseOperation(2); // 设置窗口关闭时的默认操作
|
||||
// newJFrame.setVisible(true);
|
||||
|
||||
String groupID = "";
|
||||
try {
|
||||
groupID = SAPUtil.getGroupID(session);
|
||||
} catch (TCException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("groupID==="+groupID);
|
||||
//Project Administration
|
||||
if(!groupID.equals("Project Administration")) {
|
||||
MessageBox.post("请切换至项目管理组执行此功能。", "提示", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InterfaceAIFComponent targetComponent = app.getTargetComponent();
|
||||
|
||||
String type = "";
|
||||
if(targetComponent != null) {
|
||||
System.out.println("targetComponent=============="+targetComponent.getType());
|
||||
type = targetComponent.getType();
|
||||
}
|
||||
|
||||
if(type == null || type.isEmpty() || !type.equals("ZT2_ProjectFolder")) {
|
||||
MessageBox.post("请选择公共文件夹类型!", "提示", MessageBox.INFORMATION);
|
||||
|
||||
return;
|
||||
}else {
|
||||
new RdmCreateFrame();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}.start();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new RdmCreateFrame();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.chint.plm.rdmCreate;
|
||||
|
||||
import java.awt.Window;
|
||||
|
||||
|
||||
|
||||
public class RdmCreatePanel extends KFXPanel {
|
||||
|
||||
public RdmCreatePanel(Window dialog) {
|
||||
super(dialog, "RdmCreate.fxml");
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
}
|
@ -1,146 +1,153 @@
|
||||
package com.connor.chint.sap2.StandardBOM;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.connor.chint.sap2.util.KUtil;
|
||||
import com.connor.chint.sap2.util.ZYFactoryUtil;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMLine;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||
import com.teamcenter.rac.kernel.TCException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DYStandardBomBean {
|
||||
|
||||
private TCComponentItemRevision rev;
|
||||
private List<DYStandardBomBean> children = new ArrayList<>();
|
||||
private int index;
|
||||
|
||||
private List<TCComponent> factoryNos = new ArrayList<>();
|
||||
private List<String> factoryIDs = new ArrayList<>();
|
||||
|
||||
public String factoryID = "";
|
||||
private String status_BOM = "";
|
||||
private String isTCM = "";
|
||||
|
||||
public String getIsTCM() {
|
||||
return isTCM;
|
||||
}
|
||||
|
||||
public void setIsTCM(String isTCM) {
|
||||
this.isTCM = isTCM;
|
||||
}
|
||||
|
||||
public void changeBOMStatus() throws TCException {
|
||||
if (KUtil.isEmpty(status_BOM) || "Íê³É".equals(status_BOM)) {
|
||||
status_BOM = "δÍê³É";
|
||||
} else {
|
||||
status_BOM = "Íê³É";
|
||||
}
|
||||
|
||||
rev.setProperty("zt2_WebNo", status_BOM);
|
||||
|
||||
// System.out.println("status_BOM:"+status_BOM);
|
||||
}
|
||||
|
||||
public DYStandardBomBean(TCComponentItemRevision rev, TCComponentBOMLine line, int index) {
|
||||
this.rev = rev;
|
||||
this.index = index;
|
||||
// try {
|
||||
// status_BOM = rev.getProperty("zt2_WebNo");
|
||||
// } catch (TCException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public void getFactoryNo() {
|
||||
if (factoryIDs.size() > 0) {
|
||||
factoryID = ZYFactoryUtil.getFactory(factoryIDs, 4);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* public DYStandardBomBean getClone() { DYStandardBomBean bean = new
|
||||
* DYStandardBomBean(rev, line, index); bean.setChildren(children);
|
||||
* bean.setFactoryIDs(factoryIDs); bean.status_BOM = status_BOM; return bean; }
|
||||
*/
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
if ("Íê³É".equals(status_BOM)) {
|
||||
|
||||
String text = "";
|
||||
if (KUtil.isEmpty(factoryID)) {
|
||||
text = status_BOM + " " + rev.toString();
|
||||
} else {
|
||||
text = status_BOM + " " + rev.toString() + " (" + factoryID + ")";
|
||||
}
|
||||
return KUtil.getRedText(text);
|
||||
} else {
|
||||
if (KUtil.isEmpty(factoryID)) {
|
||||
return status_BOM + " " + rev.toString();
|
||||
} else {
|
||||
return status_BOM + " " + rev.toString() + " (" + factoryID + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<DYStandardBomBean> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<DYStandardBomBean> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public TCComponentItemRevision getRev() {
|
||||
return rev;
|
||||
}
|
||||
|
||||
public void setRev(TCComponentItemRevision rev) {
|
||||
this.rev = rev;
|
||||
}
|
||||
|
||||
public List<TCComponent> getFactoryNos() {
|
||||
return factoryNos;
|
||||
}
|
||||
|
||||
public void setFactoryNos(List<TCComponent> factoryNos) {
|
||||
this.factoryNos = factoryNos;
|
||||
}
|
||||
|
||||
public List<String> getFactoryIDs() {
|
||||
return factoryIDs;
|
||||
}
|
||||
|
||||
public void setFactoryIDs(List<String> factoryIDs) {
|
||||
this.factoryIDs = factoryIDs;
|
||||
}
|
||||
|
||||
public void addFactoryID(String factoryID) {
|
||||
if (!factoryIDs.contains(factoryID)) {
|
||||
factoryIDs.add(factoryID);
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatus_BOM() {
|
||||
return status_BOM;
|
||||
}
|
||||
|
||||
public void setStatus_BOM(String status_BOM) {
|
||||
this.status_BOM = status_BOM;
|
||||
}
|
||||
|
||||
|
||||
public class DYStandardBomBean
|
||||
{
|
||||
private TCComponentItemRevision rev;
|
||||
private TCComponentBOMLine line;
|
||||
private List<DYStandardBomBean> children = new ArrayList();
|
||||
private int index;
|
||||
private List<TCComponent> factoryNos = new ArrayList();
|
||||
private List<String> factoryIDs = new ArrayList();
|
||||
public String factoryID = "";
|
||||
private String status_BOM = "";
|
||||
private String isTCM = "";
|
||||
|
||||
public String getIsTCM()
|
||||
{
|
||||
return this.isTCM;
|
||||
}
|
||||
|
||||
public void setIsTCM(String isTCM)
|
||||
{
|
||||
this.isTCM = isTCM;
|
||||
}
|
||||
|
||||
public void changeBOMStatus()
|
||||
throws TCException
|
||||
{
|
||||
if ((KUtil.isEmpty(this.status_BOM)) || ("Íê³É".equals(this.status_BOM))) {
|
||||
this.status_BOM = "δÍê³É";
|
||||
} else {
|
||||
this.status_BOM = "Íê³É";
|
||||
}
|
||||
this.rev.setProperty("zt2_WebNo", this.status_BOM);
|
||||
}
|
||||
|
||||
public DYStandardBomBean(TCComponentItemRevision rev, TCComponentBOMLine line, int index)
|
||||
{
|
||||
this.rev = rev;
|
||||
this.line = line;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public void getFactoryNo()
|
||||
{
|
||||
if (this.factoryIDs.size() > 0) {
|
||||
this.factoryID = ZYFactoryUtil.getFactory(this.factoryIDs, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
if ("Íê³É".equals(this.status_BOM))
|
||||
{
|
||||
String text = "";
|
||||
if (KUtil.isEmpty(this.factoryID)) {
|
||||
text = this.status_BOM + " " + this.rev.toString();
|
||||
} else {
|
||||
text = this.status_BOM + " " + this.rev.toString() + " (" + this.factoryID + ")";
|
||||
}
|
||||
return KUtil.getRedText(text);
|
||||
}
|
||||
if (KUtil.isEmpty(this.factoryID)) {
|
||||
return this.status_BOM + " " + this.rev.toString();
|
||||
}
|
||||
return this.status_BOM + " " + this.rev.toString() + " (" + this.factoryID + ")";
|
||||
}
|
||||
|
||||
public List<DYStandardBomBean> getChildren()
|
||||
{
|
||||
return this.children;
|
||||
}
|
||||
|
||||
public void setChildren(List<DYStandardBomBean> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getIndex()
|
||||
{
|
||||
return this.index;
|
||||
}
|
||||
|
||||
public void setIndex(int index)
|
||||
{
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public TCComponentItemRevision getRev()
|
||||
{
|
||||
return this.rev;
|
||||
}
|
||||
|
||||
public void setRev(TCComponentItemRevision rev)
|
||||
{
|
||||
this.rev = rev;
|
||||
}
|
||||
|
||||
public List<TCComponent> getFactoryNos()
|
||||
{
|
||||
return this.factoryNos;
|
||||
}
|
||||
|
||||
public void setFactoryNos(List<TCComponent> factoryNos)
|
||||
{
|
||||
this.factoryNos = factoryNos;
|
||||
}
|
||||
|
||||
public List<String> getFactoryIDs()
|
||||
{
|
||||
return this.factoryIDs;
|
||||
}
|
||||
|
||||
public void setFactoryIDs(List<String> factoryIDs)
|
||||
{
|
||||
this.factoryIDs = factoryIDs;
|
||||
}
|
||||
|
||||
public void addFactoryID(String factoryID)
|
||||
{
|
||||
if (!this.factoryIDs.contains(factoryID)) {
|
||||
this.factoryIDs.add(factoryID);
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatus_BOM()
|
||||
{
|
||||
return this.status_BOM;
|
||||
}
|
||||
|
||||
public void setStatus_BOM(String status_BOM)
|
||||
{
|
||||
this.status_BOM = status_BOM;
|
||||
}
|
||||
|
||||
public TCComponentBOMLine getLine()
|
||||
{
|
||||
return this.line;
|
||||
}
|
||||
|
||||
public void setLine(TCComponentBOMLine line)
|
||||
{
|
||||
this.line = line;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import com.teamcenter.rac.kernel.TCComponentBOMLine;
|
||||
|
||||
public class BomBean {
|
||||
|
||||
String revName;
|
||||
TCComponentBOMLine bomLine;
|
||||
public BomBean(String revName, TCComponentBOMLine bomLine) {
|
||||
super();
|
||||
this.revName = revName;
|
||||
this.bomLine = bomLine;
|
||||
}
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(revName);
|
||||
}
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
BomBean other = (BomBean) obj;
|
||||
return other.revName.contains(revName);
|
||||
}
|
||||
public BomBean(String revName) {
|
||||
super();
|
||||
this.revName = revName;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BomBean [revName=" + revName + ", bomLine=" + bomLine + "]\n";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
public class CBean {
|
||||
|
||||
|
||||
String cId;
|
||||
String folderName;
|
||||
String piName;
|
||||
public String getcId() {
|
||||
return cId;
|
||||
}
|
||||
public void setcId(String cId) {
|
||||
this.cId = cId;
|
||||
}
|
||||
public String getFolderName() {
|
||||
return folderName;
|
||||
}
|
||||
public void setFolderName(String folderName) {
|
||||
this.folderName = folderName;
|
||||
}
|
||||
public String getPiName() {
|
||||
return piName;
|
||||
}
|
||||
public void setPiName(String piName) {
|
||||
this.piName = piName;
|
||||
}
|
||||
public CBean(String cId, String folderName, String piName) {
|
||||
super();
|
||||
this.cId = cId;
|
||||
this.folderName = folderName;
|
||||
this.piName = piName;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.connor.chint.sap2.KCommand;
|
||||
import com.connor.chint.sap2.util.ChintPreferenceUtil;
|
||||
import com.connor.chint.sap2.util.SAPUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class CreateKjBomCommand extends KCommand {
|
||||
|
||||
// private boolean top = true;
|
||||
// private TCComponentBOMLine line;
|
||||
public CreateKjBomCommand(AbstractAIFApplication app, String commandId, String actionInfo) {
|
||||
super(app, commandId, actionInfo);
|
||||
|
||||
|
||||
// InterfaceAIFComponent targetComponent = app.getTargetComponent();
|
||||
|
||||
try {
|
||||
|
||||
TCSession session = (TCSession)app.getSession();
|
||||
String groupID = SAPUtil.getGroupID(session);
|
||||
//变压器原首选项CHINT_kjbomTemp改为CHINT_kjbom_M005
|
||||
String[] prefs = ChintPreferenceUtil.getPreferences("CHINT_kjbom_M005", session);
|
||||
List<KjBean> kjList = new ArrayList<KjBean>();
|
||||
for(String pref : prefs) {
|
||||
// 1ZDB300000P-xxx|1ZDB300000P=2-组件布置图;1ZDB400000T=3-铁心图纸&H铁心
|
||||
if(!pref.startsWith(groupID))
|
||||
continue;
|
||||
String[] split = pref.substring(groupID.length() + 1).split("\\|");
|
||||
String kjBomId = split[0];
|
||||
KjBean bean = new KjBean(kjBomId);
|
||||
String[] split2 = split[1].split(";");
|
||||
for(String s : split2) {
|
||||
String[] split3 = s.split("=");
|
||||
if(split3[1].contains("&")) {
|
||||
String[] split4 = split3[1].split("&");
|
||||
CBean cb = new CBean(split3[0],split4[0],split4[1]);
|
||||
bean.cbeans.add(cb);
|
||||
}else {
|
||||
CBean cb = new CBean(split3[0],split3[1],"");
|
||||
bean.cbeans.add(cb);
|
||||
}
|
||||
}
|
||||
kjList.add(bean);
|
||||
}
|
||||
if(kjList.size() == 0) {
|
||||
MessageBox.post("首选项中未找到配置,请登陆正确组", "", MessageBox.WARNING);
|
||||
return;
|
||||
}
|
||||
this.setRunnable(new KjBomDialog(app, "", kjList));
|
||||
}catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KjBean {
|
||||
|
||||
public String kjBs;
|
||||
public String kjbomId;
|
||||
public List<CBean> cbeans = new ArrayList<CBean>();
|
||||
public String getKjbomId() {
|
||||
return kjbomId;
|
||||
}
|
||||
public void setKjbomId(String kjbomId) {
|
||||
this.kjbomId = kjbomId;
|
||||
}
|
||||
public KjBean(String kjbomId) {
|
||||
super();
|
||||
this.kjbomId = kjbomId;
|
||||
String[] split = kjbomId.split("-");
|
||||
kjBs = split[1];
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return kjbomId;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,172 @@
|
||||
package com.connor.chint.sap2.createKjBom;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JComboBox;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EtchedBorder;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import com.connor.chint.sap2.util.KUtil;
|
||||
import com.connor.chint.sap2.util.MyProgressBarCompent;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.AbstractAIFDialog;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
public class KjBomDialog extends AbstractAIFDialog {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private List<KjBean> kjList;
|
||||
// private AbstractAIFApplication app;
|
||||
private KjController controller;
|
||||
public KjBomDialog(AbstractAIFApplication app, String actionInfo,List<KjBean> beanList) {
|
||||
// Auto-generated constructor stub
|
||||
super(false);
|
||||
// KUtil.setByPass(true);
|
||||
// this.app = app;
|
||||
this.kjList = beanList;
|
||||
this.controller = new KjController(app);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Auto-generated method stub
|
||||
try {
|
||||
if (!controller.checkProject()) {
|
||||
MessageBox.post(this, "请选择项目文件夹对象", "", MessageBox.INFORMATION);
|
||||
return;
|
||||
}
|
||||
initUI();
|
||||
showDialog();
|
||||
/*
|
||||
* if(!controller.isAllHave) { MessageBox.post(this,
|
||||
* "项目中"+controller.name+"方案未同步WBS,请手动执行", "",MessageBox.INFORMATION); }else {
|
||||
* b_syn.setVisible(false); }
|
||||
*/
|
||||
} catch (Exception e) {
|
||||
|
||||
MessageBox.post(this, "申请方案编码时发生错误:" + e.getMessage(), "", MessageBox.ERROR);
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
private JButton okButton;
|
||||
private JButton celButton;
|
||||
private JComboBox<KjBean> kjCombox;
|
||||
public void initUI() {
|
||||
this.setTitle("创建框架BOM");
|
||||
this.setPreferredSize(new Dimension(400,150));
|
||||
JPanel p1 = new JPanel(new BorderLayout());
|
||||
p1.setBorder(new TitledBorder(new EtchedBorder(), "框架BOM模板"));
|
||||
|
||||
kjCombox = new JComboBox<KjBean>();
|
||||
for(KjBean bean:kjList) {
|
||||
kjCombox.addItem(bean);
|
||||
}
|
||||
p1.add(kjCombox);
|
||||
|
||||
JPanel rootPanel = new JPanel(new FlowLayout());
|
||||
this.okButton = new JButton("确认");
|
||||
this.celButton = new JButton("取消");
|
||||
|
||||
rootPanel.add(okButton);
|
||||
rootPanel.add(celButton);
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
this.add(p1, BorderLayout.NORTH);
|
||||
this.add(rootPanel, BorderLayout.CENTER);
|
||||
// dialog.add(tablePanel, BorderLayout.CENTER);
|
||||
this.add(rootPanel, BorderLayout.SOUTH);
|
||||
this.pack();
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setVisible(true);
|
||||
|
||||
addListeners();
|
||||
}
|
||||
|
||||
private void addListeners() {
|
||||
// Auto-generated method stub
|
||||
celButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// Auto-generated method stub
|
||||
dispose();
|
||||
}
|
||||
});
|
||||
okButton.addActionListener(new ActionListener() {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
// Auto-generated method stub
|
||||
//开始创建框架BOM
|
||||
//1.遍历原有框架BOM获取项目代号 、 检查项目结构文件夹、检查id是否唯一
|
||||
//2.根据项目找到组件布置图 拆分BOM
|
||||
//3.根据云派信息转换所有权
|
||||
new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
MyProgressBarCompent comp = null;
|
||||
KUtil.setByPass(true);
|
||||
try {
|
||||
|
||||
comp = new MyProgressBarCompent("", "正在创建框架BOM......");
|
||||
int selectedIndex = kjCombox.getSelectedIndex();
|
||||
KjBean kjBean = kjList.get(selectedIndex);
|
||||
StringBuilder build = new StringBuilder("");
|
||||
String tempId = kjBean.getKjbomId();
|
||||
boolean checkFolder = controller.checkFolder(tempId, kjBean, build);
|
||||
if(!checkFolder) {
|
||||
comp.setVisible(false);
|
||||
dispose();
|
||||
MessageBox.post(build.toString(), "",2);
|
||||
|
||||
return;
|
||||
}
|
||||
if(controller.byqCCPFromProject.size()>1) {
|
||||
Object[] options = {"是","否"};
|
||||
int response = JOptionPane.showOptionDialog(null, "项目产成品存在多台变压器,请确认是否为同一工程图号", "选择",JOptionPane.YES_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
|
||||
if(response == -1 || response==1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
// List<CBean> cbeans = kjBean.cbeans;
|
||||
boolean createKjBom = controller.createKjBom(kjBean,comp);
|
||||
comp.setVisible(false);
|
||||
if(!createKjBom) {
|
||||
dispose();
|
||||
return;
|
||||
}else {
|
||||
dispose();
|
||||
MessageBox.post("框架BOM创建完成。", "提示",2);
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
// Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}finally {
|
||||
KUtil.setByPass(false);
|
||||
}
|
||||
if(comp!=null) {
|
||||
comp.setVisible(false);
|
||||
}
|
||||
dispose();
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,347 @@
|
||||
package com.connor.chint.sap2.dy.createElectricalBOM;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.chint.plm.common.context.ApiContext;
|
||||
import com.chint.plm.common.util.ArrayUtils;
|
||||
import com.chint.plm.common.util.HttpUtils;
|
||||
import com.chint.plm.common.util.LoggerUtils;
|
||||
import com.chint.plm.common.util.StringUtils;
|
||||
import com.connor.chint.sap2.dy.createElectricalBOM.bean.CcemEb;
|
||||
import com.connor.chint.sap2.util.KUtil;
|
||||
import com.connor.chint.sap2.util.MyProgressBarCompent;
|
||||
import com.connor.chint.sap2.util.POIUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.AbstractAIFOperation;
|
||||
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentContextList;
|
||||
import com.teamcenter.rac.kernel.TCComponentFolder;
|
||||
import com.teamcenter.rac.kernel.TCComponentItem;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemType;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
import com.teamcenter.services.rac.cad.StructureManagementService;
|
||||
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.AttributesInfo;
|
||||
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.CreateOrUpdateRelativeStructureInfo;
|
||||
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.CreateOrUpdateRelativeStructurePref;
|
||||
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.CreateOrUpdateRelativeStructureResponse;
|
||||
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.RelOccInfo;
|
||||
import com.teamcenter.services.rac.cad._2007_01.StructureManagement.RelativeStructureChildInfo;
|
||||
|
||||
/**
|
||||
* 提取深化电气BOM
|
||||
*
|
||||
*/
|
||||
public class DYSHCreateElectricalBOMOperationV2 extends AbstractAIFOperation {
|
||||
|
||||
private AbstractAIFApplication app;
|
||||
|
||||
public DYSHCreateElectricalBOMOperationV2(AbstractAIFApplication app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeOperation() throws Exception {
|
||||
MyProgressBarCompent my = null;
|
||||
try {
|
||||
TCComponent project = null;
|
||||
TCComponent folder = null;
|
||||
TCSession session = (TCSession) app.getSession();
|
||||
InterfaceAIFComponent target = app.getTargetComponent();
|
||||
if (target == null || !(target instanceof TCComponent)) {
|
||||
return;
|
||||
}
|
||||
String type = target.getType();
|
||||
if (type.equals("ZT2_ProjectItem")) {
|
||||
project = (TCComponent) target;
|
||||
String zt2_WBSNo = project.getProperty("zt2_WBSNo");
|
||||
}
|
||||
if (project == null) {
|
||||
MessageBox.post("请选择项目对象", "", 2);
|
||||
return;
|
||||
}
|
||||
TCComponentFolder xxzx_folder = KUtil.getXMZXFolderFromProject(project);
|
||||
if (xxzx_folder == null) {
|
||||
MessageBox.post("未找到项目执行文件夹,请检查项目数据 ", "", 2);
|
||||
return;
|
||||
}
|
||||
AIFComponentContext[] childs = xxzx_folder.getChildren();
|
||||
for (int i = 0, len = childs.length; i < len; i++) {
|
||||
folder = (TCComponent) childs[i].getComponent();
|
||||
if (folder.getProperty("object_name").contains("电气设计") && folder instanceof TCComponentFolder) {
|
||||
break;
|
||||
}
|
||||
folder = null;
|
||||
}
|
||||
if (folder == null) {
|
||||
MessageBox.post("未找到电气设计文件夹,请检查项目数据 ", "", 2);
|
||||
return;
|
||||
}
|
||||
my = new MyProgressBarCompent("", "正在提取项目BOM信息......");
|
||||
String projectId = project.getProperty("item_id");
|
||||
String zt2_WBSNo = project.getProperty("zt2_WBSNo");
|
||||
// 发起提取BOM请求
|
||||
String cadUrl = ApiContext.getApiUrl(session, "CHINT_EX_CADTOOL_URL");
|
||||
String urlString = cadUrl + "/api/PLM/PullProject";
|
||||
Map<String, Object> paramMap = new HashMap<String, Object>();
|
||||
paramMap.put("plmId", projectId);
|
||||
String resp = HttpUtils.get(urlString, paramMap);
|
||||
try {
|
||||
JSONObject respObject = JSONObject.parseObject(resp);
|
||||
if (respObject.containsKey("isOK") && respObject.getBoolean("isOK")) {
|
||||
JSONObject dataObject = respObject.getJSONObject("data");
|
||||
JSONArray products = dataObject.getJSONArray("products");
|
||||
if (products != null && products.size() > 0) {
|
||||
TCComponentItemType itemType = (TCComponentItemType) session.getTypeComponent("Part");
|
||||
for (int i = 0; i < products.size(); i++) {
|
||||
JSONObject product = products.getJSONObject(i);
|
||||
String factoryId = product.getString("factoryId");
|
||||
// String flowNo = product.getString("flowNo");
|
||||
JSONArray items = product.getJSONArray("items");
|
||||
if (items != null && items.size() > 0) {
|
||||
// 在 项目执行/电气设计 下,创建固定单元
|
||||
String objectName = "固定单元";
|
||||
int index = getTypeNumber(session, "9900000135", zt2_WBSNo);
|
||||
// 出厂编号
|
||||
List<TCComponent> factoryNoComps = new ArrayList<>();
|
||||
List<String> factoryNos = getFactoryNos(factoryId);
|
||||
for (String factoryNo : factoryNos) {
|
||||
Map<String, String> queryCondition = new HashMap<>();
|
||||
queryCondition.put("fid", factoryNo);
|
||||
// 查询出厂编号
|
||||
TCComponentContextList contextList = KUtil.query(session, "chint_query_FactoryNo", queryCondition);
|
||||
if (contextList.getListCount() > 0) {
|
||||
TCComponent comp = (TCComponent) contextList.get(0).getComponent();
|
||||
if (comp instanceof TCComponentItem) {
|
||||
TCComponentItem item = (TCComponentItem) comp;
|
||||
factoryNoComps.add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
// BOM
|
||||
CcemEb parent = new CcemEb();
|
||||
List<CcemEb> bomChilds = new ArrayList<CcemEb>();
|
||||
Map<String, TCComponentItemRevision> partItemRevMaps = new LinkedHashMap<String, TCComponentItemRevision>();
|
||||
for (int j = 0; j < items.size(); j++) {
|
||||
JSONObject item = items.getJSONObject(j);
|
||||
String code = item.getString("code");
|
||||
BigDecimal quantity = item.getBigDecimal("quantity").setScale(2, RoundingMode.HALF_UP);
|
||||
Map<String, String> queryCondition = new HashMap<>();
|
||||
queryCondition.put("ID", code);
|
||||
// 查询零件
|
||||
TCComponentContextList contextList = KUtil.query(session, "chint_query_item", queryCondition);
|
||||
if (contextList.getListCount() > 0) {
|
||||
TCComponent comp = (TCComponent) contextList.get(0).getComponent();
|
||||
if (comp instanceof TCComponentItemRevision) {
|
||||
TCComponentItemRevision partItemRev = (TCComponentItemRevision) comp;
|
||||
System.out.print(partItemRev);
|
||||
partItemRevMaps.put(code, partItemRev);
|
||||
}
|
||||
}
|
||||
CcemEb ccemEb = new CcemEb();
|
||||
ccemEb.setZt2_MaterialNo(code);
|
||||
ccemEb.setEbQty(quantity.toString());
|
||||
ccemEb.setBl_sequence_no("");
|
||||
ccemEb.setBl_ref_designator("");
|
||||
bomChilds.add(ccemEb);
|
||||
}
|
||||
parent.setChilds(bomChilds);
|
||||
// 创建固定单元
|
||||
String zt2_MaterialNo = "9900000135-";
|
||||
// 物料分类码
|
||||
String pmpcCode = "990101002";
|
||||
TCComponentItemRevision partItmeRevision = createPart(session, folder, factoryNoComps, itemType,
|
||||
objectName, zt2_WBSNo, zt2_MaterialNo + String.format("%05d", index), pmpcCode);
|
||||
// 创建固定单元下的视图BOM
|
||||
int p_size = 1;
|
||||
createBOM(session, parent, partItmeRevision, partItemRevMaps, p_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
my.setVisible(false);
|
||||
MessageBox.post("(深化)电气提取BOM成功", "", 2);
|
||||
} else {
|
||||
my.setVisible(false);
|
||||
MessageBox.post("调用接口响应:" + respObject.getString("message"), "", 2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
my.setVisible(false);
|
||||
MessageBox.post("处理异常:" + e.getMessage() + "接口响应:" + resp, "", 2);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
KUtil.closeMyProgressBar(my);
|
||||
e.printStackTrace();
|
||||
MessageBox.post("异常:" + e.getMessage(), "", 2);
|
||||
}
|
||||
}
|
||||
|
||||
public TCComponentItemRevision createPart(TCSession session, TCComponent folder, List<TCComponent> factoryNos, TCComponentItemType itemType,
|
||||
String object_name, String zt2_WBSNo, String zt2_MaterialNo, String pmpcCode) throws Exception {
|
||||
// 创建零件
|
||||
String item_id = itemType.getNewID();
|
||||
TCComponentItem item = itemType.create(item_id, "A", "Part", object_name, null, null);
|
||||
item.setProperty("zt2_unit", "TAI");
|
||||
// 添加内容
|
||||
folder.add("contents", item);
|
||||
// 物料编码
|
||||
item.getLatestItemRevision().setProperty("zt2_MaterialNo", zt2_MaterialNo);
|
||||
// WBS号
|
||||
item.getLatestItemRevision().setProperty("zt2_WBSNo", zt2_WBSNo);
|
||||
// 基本数量
|
||||
item.getLatestItemRevision().setProperty("zt2_Quantity", "1");
|
||||
// item.getLatestItemRevision().setProperty("zt2_unit", "TAI");
|
||||
// 物料分类码
|
||||
item.getLatestItemRevision().setProperty("zt2_ClassificationCode", pmpcCode);
|
||||
TCComponentItemRevision rev = item.getLatestItemRevision();
|
||||
// 添加出厂编码
|
||||
if (factoryNos.size() > 0) {
|
||||
rev.add("ZT2_FactoryNumber", factoryNos);
|
||||
}
|
||||
return rev;
|
||||
}
|
||||
|
||||
private void createBOM(TCSession session, CcemEb parent, TCComponentItemRevision rev, Map<String, TCComponentItemRevision> partItemRevMaps, int p_size) {
|
||||
List<CcemEb> childs = parent.getChilds();
|
||||
if (childs.size() == 0)
|
||||
return;
|
||||
// 排序
|
||||
Collections.sort(childs, new Comparator<CcemEb>() {
|
||||
@Override
|
||||
public int compare(CcemEb o1, CcemEb o2) {
|
||||
return POIUtil.getIntValue(o1.getBl_sequence_no()) - POIUtil.getIntValue(o2.getBl_sequence_no());
|
||||
}
|
||||
});
|
||||
// 创建结构子集
|
||||
List<RelativeStructureChildInfo> childInfos = new ArrayList<>();
|
||||
AttributesInfo attr, attr1, attr2;
|
||||
for (int i = 0, len = childs.size(); i < len; i++) {
|
||||
// 子集信息
|
||||
RelativeStructureChildInfo childInfo = new RelativeStructureChildInfo();
|
||||
RelOccInfo occInfo = new RelOccInfo();
|
||||
// 数量
|
||||
attr = new AttributesInfo();
|
||||
attr.name = "bl_quantity";
|
||||
attr.value = POIUtil.getIntValue(childs.get(i).getEbQty()) * p_size + "";
|
||||
// 查找编号
|
||||
attr1 = new AttributesInfo();
|
||||
attr1.name = "bl_sequence_no";
|
||||
attr1.value = (i + 1) * 10 + "";
|
||||
// 代号
|
||||
attr2 = new AttributesInfo();
|
||||
attr2.name = "bl_ref_designator";
|
||||
attr2.value = childs.get(i).getBl_ref_designator();
|
||||
occInfo.attrsToSet = new AttributesInfo[] { attr, attr1, attr2 };
|
||||
childInfo.child = partItemRevMaps.get(childs.get(i).getZt2_MaterialNo());
|
||||
childInfo.occInfo = occInfo;
|
||||
childInfos.add(childInfo);
|
||||
}
|
||||
// 保存相关的结构
|
||||
saveRelativeStructure(session, rev, childInfos);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void saveRelativeStructure(TCSession session, TCComponentItemRevision parent, List<RelativeStructureChildInfo> childInfos) {
|
||||
StructureManagementService service = StructureManagementService.getService(session);
|
||||
// 创建或修改相关的结构
|
||||
CreateOrUpdateRelativeStructurePref structurePref = new CreateOrUpdateRelativeStructurePref();
|
||||
CreateOrUpdateRelativeStructureInfo structureInfo = new CreateOrUpdateRelativeStructureInfo();
|
||||
structureInfo.childInfo = childInfos.toArray(new RelativeStructureChildInfo[] {});
|
||||
structureInfo.parent = parent;
|
||||
structureInfo.precise = false;
|
||||
CreateOrUpdateRelativeStructureResponse resp;
|
||||
try {
|
||||
resp = service.createOrUpdateRelativeStructure(new CreateOrUpdateRelativeStructureInfo[] { structureInfo }, "view", true, structurePref);
|
||||
KUtil.throwServiceDataError(resp.serviceData);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
LoggerUtils.debug(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private static int getTypeNumber(TCSession session, String type, String zt2_WBSNo) throws Exception {
|
||||
Map<String, String> fields = new HashMap<>();
|
||||
fields.put("WBS号", zt2_WBSNo);
|
||||
fields.put("物料编码", type + "-*");
|
||||
TCComponentContextList querys = KUtil.query(session, "查询物料", fields);
|
||||
List<InterfaceAIFComponent> list = querys.toComponentVector();
|
||||
int size = list.size();
|
||||
Collections.sort(list, new Comparator<InterfaceAIFComponent>() {
|
||||
@Override
|
||||
public int compare(InterfaceAIFComponent o1, InterfaceAIFComponent o2) {
|
||||
try {
|
||||
return o2.getProperty("zt2_MaterialNo").compareTo(o1.getProperty("zt2_MaterialNo"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
if (size > 0) {
|
||||
String zt2_MaterialNo = list.get(0).getProperty("zt2_MaterialNo");
|
||||
int index = zt2_MaterialNo.indexOf("-");
|
||||
if (index != -1) {
|
||||
int value = POIUtil.getIntValue(zt2_MaterialNo.substring(index + 1));
|
||||
return value == 0 ? 1 : value + 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static List<String> getFactoryNos(String factoryId) {
|
||||
List<String> factoryNos = new ArrayList<>(64);
|
||||
if (StringUtils.isNotBlank(factoryId)) {
|
||||
String[] noStrs = factoryId.split(",");
|
||||
if (ArrayUtils.isNotEmpty(noStrs)) {
|
||||
for (String str : noStrs) {
|
||||
String[] nos = str.split("~");
|
||||
if (ArrayUtils.isNotEmpty(nos)) {
|
||||
if (nos.length == 1) {
|
||||
factoryNos.add(nos[0]);
|
||||
} else if (nos.length == 2) {
|
||||
String one = nos[0];
|
||||
String two = nos[1];
|
||||
String prefix = one.substring(0, one.length() - 8);
|
||||
String serial = one.substring(one.length() - 8, one.length());
|
||||
int serialNum = Integer.parseInt(serial);
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
String next = prefix + (serialNum + i);
|
||||
factoryNos.add(next);
|
||||
if (next.equals(two)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("出厂编号格式不催:" + factoryId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return factoryNos;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
List<String> nos = getFactoryNos("DX323041400");
|
||||
System.out.println(nos.size());
|
||||
nos = getFactoryNos("DX323041400~DX323041432");
|
||||
System.out.println(nos.size());
|
||||
nos = getFactoryNos("DX323041400~DX323041432,DX323041388~DX323041399");
|
||||
System.out.println(nos.size());
|
||||
}
|
||||
}
|
@ -0,0 +1,171 @@
|
||||
package com.connor.chint.sap2.electrical_task;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.chint.plm.common.context.ApiContext;
|
||||
import com.chint.plm.common.util.HttpUtils;
|
||||
import com.connor.chint.sap2.util.KUtil;
|
||||
import com.connor.chint.sap2.util.MyProgressBarCompent;
|
||||
import com.connor.chint.sap2.util.ZYFactoryUtil;
|
||||
import com.teamcenter.rac.aif.AbstractAIFApplication;
|
||||
import com.teamcenter.rac.aif.AbstractAIFOperation;
|
||||
import com.teamcenter.rac.aif.kernel.AIFComponentContext;
|
||||
import com.teamcenter.rac.aif.kernel.InterfaceAIFComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponent;
|
||||
import com.teamcenter.rac.kernel.TCComponentFolder;
|
||||
import com.teamcenter.rac.kernel.TCComponentItem;
|
||||
import com.teamcenter.rac.kernel.TCComponentItemRevision;
|
||||
import com.teamcenter.rac.kernel.TCSession;
|
||||
import com.teamcenter.rac.util.MessageBox;
|
||||
|
||||
/**
|
||||
* 深化 电气任务下发
|
||||
* @since 2024-05-10
|
||||
*/
|
||||
public class DYSHElectricalTasksOperationV2 extends AbstractAIFOperation {
|
||||
|
||||
private AbstractAIFApplication app;
|
||||
|
||||
public DYSHElectricalTasksOperationV2(AbstractAIFApplication app) {
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeOperation() throws Exception {
|
||||
MyProgressBarCompent my = null;
|
||||
try {
|
||||
TCSession session = (TCSession) app.getSession();
|
||||
InterfaceAIFComponent target = app.getTargetComponent();
|
||||
if (target == null || !target.getType().equals("ZT2_ProjectItem")) {
|
||||
MessageBox.post("请选择项目对象", "", 2);
|
||||
return;
|
||||
}
|
||||
my = new MyProgressBarCompent("任务下发", "(深化)电气任务传递中......");
|
||||
// 项目对象
|
||||
TCComponent project = (TCComponent) target;
|
||||
// 产成品文件夹
|
||||
TCComponentFolder ccpFolder = KUtil.getCCPFolderFromProject(project);
|
||||
if (ccpFolder == null) {
|
||||
MessageBox.post("未找到产成品信息,请检查项目数据", "", 2);
|
||||
return;
|
||||
}
|
||||
// 项目基本信息
|
||||
String itemId = project.getProperty("item_id");
|
||||
String projectCode = project.getProperty("zt2_ProjectNo");
|
||||
String projectName = project.getProperty("object_name");
|
||||
// 同一前缀产成品
|
||||
Map<String, String> ccp_types = new HashMap<>(16);
|
||||
// 产成品和出厂编号关系
|
||||
Map<String, List<String>> ccp_factoryNos = new HashMap<>(16);
|
||||
// 产成品名称
|
||||
Map<String, String> ccp_names = new HashMap<>(16);
|
||||
// 出厂编号:物料编码
|
||||
Map<String, String> map_factory_ccp = new HashMap<>(32);
|
||||
// 产成品文件夹子集
|
||||
AIFComponentContext[] ccpChilds = ccpFolder.getChildren();
|
||||
for (int i = 0, len = ccpChilds.length; i < len; i++) {
|
||||
if (ccpChilds[i].getComponent().getType().equals("Part")) {
|
||||
// 版本对象
|
||||
TCComponentItemRevision rev = ((TCComponentItem) ccpChilds[i].getComponent()).getLatestItemRevision();
|
||||
String zt2_MaterialNo = rev.getProperty("zt2_MaterialNo");
|
||||
int index = zt2_MaterialNo.indexOf("-");
|
||||
// 主物料编码 直接取子物料编码
|
||||
String type = zt2_MaterialNo; //index > -1 ? zt2_MaterialNo.substring(0, index) : zt2_MaterialNo;
|
||||
// 出厂编码
|
||||
TCComponent[] meops = rev.getRelatedComponents("ZT2_FactoryNumber");
|
||||
// 产成品名称
|
||||
String object_name = rev.getProperty("object_name");
|
||||
ccp_names.put(zt2_MaterialNo, object_name);
|
||||
if (ccp_types.containsKey(type)) {
|
||||
String value = ccp_types.get(type);
|
||||
if (zt2_MaterialNo.compareTo(value) < 0) {
|
||||
ccp_types.put(type, zt2_MaterialNo);
|
||||
}
|
||||
List<String> factoryNos = ccp_factoryNos.get(type);
|
||||
for (int j = 0; j < meops.length; j++) {
|
||||
String factoryID = meops[j].getProperty("item_id");
|
||||
map_factory_ccp.put(factoryID, zt2_MaterialNo);
|
||||
if (!factoryNos.contains(factoryID)) {
|
||||
factoryNos.add(factoryID);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ccp_types.put(type, zt2_MaterialNo);
|
||||
List<String> factoryNos = new ArrayList<>();
|
||||
for (int j = 0; j < meops.length; j++) {
|
||||
String factoryID = meops[j].getProperty("item_id");
|
||||
factoryNos.add(factoryID);
|
||||
map_factory_ccp.put(factoryID, zt2_MaterialNo);
|
||||
}
|
||||
ccp_factoryNos.put(type, factoryNos);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 按物料排序
|
||||
List<String> keys = new java.util.ArrayList<>(ccp_types.keySet());
|
||||
Collections.sort(keys);
|
||||
if (ccp_types.size() > 0) {
|
||||
// 组织请求参数
|
||||
JSONObject param = new JSONObject();
|
||||
JSONArray products = new JSONArray();
|
||||
param.put("PLMId", itemId);
|
||||
param.put("Code", projectCode);
|
||||
param.put("Name", projectName);
|
||||
for (String key : keys) {
|
||||
String materialCode = key;
|
||||
String materialCodePart = ccp_types.get(key);
|
||||
List<String> factoryNos = ccp_factoryNos.get(materialCode);
|
||||
String factoryId = "";
|
||||
if (factoryNos.size() > 0) {
|
||||
Collections.sort(factoryNos);
|
||||
if (factoryNos.size() == 1) {
|
||||
factoryId = factoryNos.get(0);
|
||||
} else {
|
||||
factoryId = ZYFactoryUtil.getFactory2(factoryNos, 4, "~");
|
||||
}
|
||||
}
|
||||
JSONObject product = new JSONObject();
|
||||
product.put("PartId", materialCode);
|
||||
product.put("PartName", ccp_names.get(materialCodePart));
|
||||
product.put("FactoryId", factoryId);
|
||||
product.put("Status", "0");
|
||||
product.put("FlowNo", "-00001");
|
||||
products.add(product);
|
||||
}
|
||||
param.put("Products", products);
|
||||
// 发起任务下发请求
|
||||
String cadUrl = ApiContext.getApiUrl(session, "CHINT_EX_CADTOOL_URL");
|
||||
String urlString = cadUrl + "/api/PLM/ReceiveProject";
|
||||
String resp = HttpUtils.post(urlString, param.toString());
|
||||
try {
|
||||
JSONObject respObject = JSONObject.parseObject(resp);
|
||||
if (respObject.containsKey("isOK") && respObject.getBoolean("isOK")) {
|
||||
my.setVisible(false);
|
||||
MessageBox.post("(深化)电气任务下发成功", "", 2);
|
||||
} else {
|
||||
my.setVisible(false);
|
||||
MessageBox.post("调用接口响应:" + respObject.getString("message"), "", 2);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
my.setVisible(false);
|
||||
MessageBox.post("调用接口响应:" + resp, "", 2);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
my.setVisible(false);
|
||||
MessageBox.post("未找到产成品信息,请检查项目数据", "", 2);
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
KUtil.closeMyProgressBar(my);
|
||||
e.printStackTrace();
|
||||
MessageBox.post("异常:" + e.getMessage(), "", 2);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue