Commit 96c8753d authored by shyWang's avatar shyWang

PDM前端改造

PBOM签审PBOM数据同步
parent c2952291
package com.yonde.part.bean;
import com.yonde.common.IBAHelper;
import com.yonde.common.ObjectsUtil;
import com.yonde.common.PartUtil;
import com.yonde.part.vo.DxPartVO;
import org.apache.commons.collections.CollectionUtils;
import wt.fc.PersistenceHelper;
import wt.part.Quantity;
import wt.part.WTPart;
import wt.part.WTPartMaster;
import wt.part.WTPartUsageLink;
import wt.util.WTException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.rmi.RemoteException;
import java.util.List;
import java.util.Map;
public class PdmPartBean implements Serializable, Cloneable {
private String number;//编号
private String name;//名称
private String parentNumber;//父件编号
private Double amount;//数量
private String unit;//单位
private String subTypeName;//类别
private String endItem;//是否成品
private String contextName;//上下文
private String viewType;//视图
private String upperPart = "否";//是否管理部件
private Map<String, Object> dynamicAttrs;//动态属性
private String version;//大版本
private String iteration;//小版本
private DBPartSign dbPart = new DBPartSign();
public PdmPartBean() {
}
public PdmPartBean(WTPart wtPart) throws WTException, RemoteException, InvocationTargetException {
this.number = wtPart.getNumber();
this.name = wtPart.getName();
this.contextName = wtPart.getContainerName();
this.viewType = wtPart.getViewName();
this.subTypeName = "Assembly";//TODO 要映射
this.dynamicAttrs = IBAHelper.getAllIBAValues(wtPart);
}
public PdmPartBean(WTPartUsageLink usageLink) throws WTException, RemoteException, InvocationTargetException {
WTPart parent = (WTPart)usageLink.getUsedBy();
Quantity qt = usageLink.getQuantity();
this.setAmount(qt.getAmount());
this.setUnit(qt.getUnit().toString());
WTPartMaster uses = (WTPartMaster) usageLink.getUses();
WTPart child = PartUtil.getLatestPartByNoViewWithState(uses.getNumber(), parent.getViewName(), null, false);
if (ObjectsUtil.nonNull(child)) {
this.number = child.getNumber();
this.name = child.getName();
this.contextName = child.getContainerName();
this.viewType = child.getViewName();
List<WTPart> childByView = PartUtil.getChildByView(child, child.getViewName());
if (CollectionUtils.isNotEmpty(childByView)) {
this.subTypeName = "Assembly";//TODO 要映射
} else {
this.subTypeName = "Component";//TODO 要映射
}
this.dynamicAttrs = IBAHelper.getAllIBAValues(child);
}
}
public void setDBPartSign(Long masterId) {
this.dbPart.dbPart = true;
this.dbPart.masterId = masterId;
}
public class DBPartSign implements Serializable {
public Boolean dbPart = false;
public Long masterId;
public DBPartSign() {
}
}
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentNumber() {
return parentNumber;
}
public void setParentNumber(String parentNumber) {
this.parentNumber = parentNumber;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getSubTypeName() {
return subTypeName;
}
public void setSubTypeName(String subTypeName) {
this.subTypeName = subTypeName;
}
public String getEndItem() {
return endItem;
}
public void setEndItem(String endItem) {
this.endItem = endItem;
}
public String getContextName() {
return contextName;
}
public void setContextName(String contextName) {
this.contextName = contextName;
}
public String getViewType() {
return viewType;
}
public void setViewType(String viewType) {
this.viewType = viewType;
}
public String getUpperPart() {
return upperPart;
}
public void setUpperPart(String upperPart) {
this.upperPart = upperPart;
}
public Map<String, Object> getDynamicAttrs() {
return dynamicAttrs;
}
public void setDynamicAttrs(Map<String, Object> dynamicAttrs) {
this.dynamicAttrs = dynamicAttrs;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getIteration() {
return iteration;
}
public void setIteration(String iteration) {
this.iteration = iteration;
}
public DBPartSign getDbPart() {
return dbPart;
}
public void setDbPart(DBPartSign dbPart) {
this.dbPart = dbPart;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment