parent
d185c0f806
commit
f0138c2658
@ -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 {
|
||||
|
||||
public class DYStandardBomBean
|
||||
{
|
||||
private TCComponentItemRevision rev;
|
||||
private List<DYStandardBomBean> children = new ArrayList<>();
|
||||
private TCComponentBOMLine line;
|
||||
private List<DYStandardBomBean> children = new ArrayList();
|
||||
private int index;
|
||||
|
||||
private List<TCComponent> factoryNos = new ArrayList<>();
|
||||
private List<String> factoryIDs = new ArrayList<>();
|
||||
|
||||
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 String getIsTCM()
|
||||
{
|
||||
return this.isTCM;
|
||||
}
|
||||
|
||||
public void setIsTCM(String isTCM) {
|
||||
public void setIsTCM(String isTCM)
|
||||
{
|
||||
this.isTCM = isTCM;
|
||||
}
|
||||
|
||||
public void changeBOMStatus() throws TCException {
|
||||
if (KUtil.isEmpty(status_BOM) || "Íê³É".equals(status_BOM)) {
|
||||
status_BOM = "δÍê³É";
|
||||
public void changeBOMStatus()
|
||||
throws TCException
|
||||
{
|
||||
if ((KUtil.isEmpty(this.status_BOM)) || ("Íê³É".equals(this.status_BOM))) {
|
||||
this.status_BOM = "δÍê³É";
|
||||
} else {
|
||||
status_BOM = "Íê³É";
|
||||
this.status_BOM = "Íê³É";
|
||||
}
|
||||
|
||||
rev.setProperty("zt2_WebNo", status_BOM);
|
||||
|
||||
// System.out.println("status_BOM:"+status_BOM);
|
||||
this.rev.setProperty("zt2_WebNo", this.status_BOM);
|
||||
}
|
||||
|
||||
public DYStandardBomBean(TCComponentItemRevision rev, TCComponentBOMLine line, int index) {
|
||||
public DYStandardBomBean(TCComponentItemRevision rev, TCComponentBOMLine line, int index)
|
||||
{
|
||||
this.rev = rev;
|
||||
this.line = line;
|
||||
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 void getFactoryNo()
|
||||
{
|
||||
if (this.factoryIDs.size() > 0) {
|
||||
this.factoryID = ZYFactoryUtil.getFactory(this.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)) {
|
||||
|
||||
public String toString()
|
||||
{
|
||||
if ("Íê³É".equals(this.status_BOM))
|
||||
{
|
||||
String text = "";
|
||||
if (KUtil.isEmpty(factoryID)) {
|
||||
text = status_BOM + " " + rev.toString();
|
||||
if (KUtil.isEmpty(this.factoryID)) {
|
||||
text = this.status_BOM + " " + this.rev.toString();
|
||||
} else {
|
||||
text = status_BOM + " " + rev.toString() + " (" + factoryID + ")";
|
||||
text = this.status_BOM + " " + this.rev.toString() + " (" + this.factoryID + ")";
|
||||
}
|
||||
return KUtil.getRedText(text);
|
||||
} else {
|
||||
if (KUtil.isEmpty(factoryID)) {
|
||||
return status_BOM + " " + rev.toString();
|
||||
} else {
|
||||
return status_BOM + " " + rev.toString() + " (" + factoryID + ")";
|
||||
}
|
||||
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 children;
|
||||
public List<DYStandardBomBean> getChildren()
|
||||
{
|
||||
return this.children;
|
||||
}
|
||||
|
||||
public void setChildren(List<DYStandardBomBean> children) {
|
||||
public void setChildren(List<DYStandardBomBean> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
public int getIndex()
|
||||
{
|
||||
return this.index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
public void setIndex(int index)
|
||||
{
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public TCComponentItemRevision getRev() {
|
||||
return rev;
|
||||
public TCComponentItemRevision getRev()
|
||||
{
|
||||
return this.rev;
|
||||
}
|
||||
|
||||
public void setRev(TCComponentItemRevision rev) {
|
||||
public void setRev(TCComponentItemRevision rev)
|
||||
{
|
||||
this.rev = rev;
|
||||
}
|
||||
|
||||
public List<TCComponent> getFactoryNos() {
|
||||
return factoryNos;
|
||||
public List<TCComponent> getFactoryNos()
|
||||
{
|
||||
return this.factoryNos;
|
||||
}
|
||||
|
||||
public void setFactoryNos(List<TCComponent> factoryNos) {
|
||||
public void setFactoryNos(List<TCComponent> factoryNos)
|
||||
{
|
||||
this.factoryNos = factoryNos;
|
||||
}
|
||||
|
||||
public List<String> getFactoryIDs() {
|
||||
return factoryIDs;
|
||||
public List<String> getFactoryIDs()
|
||||
{
|
||||
return this.factoryIDs;
|
||||
}
|
||||
|
||||
public void setFactoryIDs(List<String> factoryIDs) {
|
||||
public void setFactoryIDs(List<String> factoryIDs)
|
||||
{
|
||||
this.factoryIDs = factoryIDs;
|
||||
}
|
||||
|
||||
public void addFactoryID(String factoryID) {
|
||||
if (!factoryIDs.contains(factoryID)) {
|
||||
factoryIDs.add(factoryID);
|
||||
public void addFactoryID(String factoryID)
|
||||
{
|
||||
if (!this.factoryIDs.contains(factoryID)) {
|
||||
this.factoryIDs.add(factoryID);
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatus_BOM() {
|
||||
return status_BOM;
|
||||
public String getStatus_BOM()
|
||||
{
|
||||
return this.status_BOM;
|
||||
}
|
||||
|
||||
public void setStatus_BOM(String 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue