Commit 31f511ec authored by 杜科's avatar 杜科

update

parent 09bc7ce6
#新窗口打开允许类型
Open.NEW.Types=DS,自制件,标准件,机载设备
#插入允许类型
Open.INSERT.Types=自制件,标准件,机载设备
#上下文打开、上下文插入允许类型
Open.DIC.Types=EBOM顶层结构,安装视图顶层件,主视图顶层件,DCI,FCI,LO,DS
#下载DS编号存储
Download.storage.dsNumber.Types=EBOM顶层结构,安装视图顶层件,主视图顶层件,DCI,FCI,LO,DS
#下载临时存储根节点类型
Download.storage.temp.Types=自制件,标准件,机载设备
#下载临时存储客户端目录
Download.storage.temp.ClientFolderPath=/storage
#BOM查询视图配置
Search.BOMView=Master:主视图:true,SSCI:安装视图:false
[
{
"comment": "GACE UAT Server",
"serverAddress": "http://192.168.1.240/Windchill/extRest/",
"workspace": "D:\\CADProTestWorkspace",
"type": 0,
"sort": 1,
"code": "77d6cf9e-6527-4f38-ae8e-87bd744e405d",
"ftpHost": "192.168.1.240",
"ftpSetting": {
"host": "192.168.1.240",
"port": 21,
"userName": "ftpuser",
"password": "Aa12345678!"
}
},
{
"comment": "GACE Prod Server",
"serverAddress": "http://192.168.1.240/Windchill/extRest/",
"workspace": "D:\\CADProWorkspace",
"type": 0,
"sort": 2,
"code": "1111a947-b018-4c24-9f32-24c9fab5d37e",
"ftpHost": "192.168.1.240",
"ftpSetting": {
"host": "192.168.1.240",
"port": 21,
"userName": "ftpuser",
"password": "Aa12345678!"
}
},
{
"code": "e176dc0d-6dc2-49f7-8e16-13841fad1f02",
"toolName": "CATIA",
"comment": "X86 结构设计",
"setupPath": "D:\\GACE\\DS\\B18\\intel_a\\code\\bin",
"type": 1,
"envType": "X86 结构设计"
},
{
"code": "e176dc0d-6dc2-49f7-8e16-13841fad1f03",
"toolName": "CATIA",
"comment": "X64 结构设计",
"setupPath": "D:\\GACE\\DS\\B18\\win_b64\\code\\bin",
"type": 1,
"envType": "X64 结构设计"
},
{
"code": "e176dc0d-6dc2-49f7-8e16-13841fad1f04",
"toolName": "CATIA",
"comment": "X86 管路设计",
"setupPath": "D:\\GACE\\DS\\B18\\intel_a\\code\\bin",
"type": 1,
"envType": "X86 管路设计"
},
{
"code": "e176dc0d-6dc2-49f7-8e16-13841fad1f05",
"toolName": "CATIA",
"comment": "X86 紧固件设计",
"setupPath": "D:\\GACE\\DS\\B18\\intel_a\\code\\bin",
"type": 1,
"envType": "X86 紧固件设计"
},
{
"code": "e176dc0d-6dc2-49f7-8e16-13841fad1f06",
"toolName": "CATIA",
"comment": "X64 管路设计",
"setupPath": "D:\\GACE\\DS\\B27\\win_b64\\code\\bin",
"type": 1,
"envType": "X64 管路设计"
},
{
"code": "e176dc0d-6dc2-49f7-8e16-13841fad1f07",
"toolName": "CATIA",
"comment": "X64 样机审查",
"setupPath": "D:\\GACE\\DS\\B27\\win_b64\\code\\bin",
"type": 1,
"envType": "X64 样机审查"
}
]
\ No newline at end of file
package com.yonde.cadpro;
import com.yonde.common.CommonUtil;
import wt.httpgw.URLFactory;
import wt.method.MethodContext;
import wt.part.WTPartConfigSpec;
import wt.part.WTPartStandardConfigSpec;
import wt.util.WTProperties;
import wt.vc.views.View;
import wt.vc.views.ViewHelper;
import java.io.File;
public class CADProConstants {
public static String COMMA = ",";
public static String COMMA_ZH = ",";
public static String SEMICOLON = ";";
public static String SEMICOLON_ZH = ";";
public static String DOT = ".";
public static String COLON = ":";
public static String COLON_ZH = ":";
public static String DIC_PREFIX = "DIC_";
public static String MODEL_PREFIX = "M-";
//设计视图
public static String VIEW_DESIGN = "Design";
public static View designView = null;
public static WTPartConfigSpec designViewConfig = null;
public static String wthome = "";
public static String codebase = "";
public static String codebase_temp = "";
public static String wttemp = "";
public static String IBA_POSITIONINFO = "positionInfo";//位置信息
//系统web根路径
public static String webBaseURL = "";
public static String domain = "";
public static String codebase_tempDownload = "";
public static String IBA_MODELRELATIVEPATH = "modelRelativePath";//模型路径
public static String TEMP_DOWNLOAD = "tempDownload";
public static String CODE_REPLACE_DOMAIN = "{domain}";
static{
try{
MethodContext mc = MethodContext.getContext(Thread.currentThread());
if (mc == null){
mc = new MethodContext(null, null);
}
designView = ViewHelper.service.getView("Design");
designViewConfig= WTPartConfigSpec.newWTPartConfigSpec(WTPartStandardConfigSpec.newWTPartStandardConfigSpec(designView, null));
WTProperties properties = WTProperties.getLocalProperties();
wthome = properties.getProperty("wt.home");
codebase = properties.getProperty("wt.codebase.location");
codebase_temp = codebase + File.separator + "temp";
wttemp = properties.getProperty("wt.temp");
domain = CommonUtil.getDomainValue();
codebase_tempDownload = codebase + File.separator + TEMP_DOWNLOAD;
File temoDownload = new File(codebase_tempDownload);
if(!temoDownload.exists()) {
temoDownload.mkdirs();
}
webBaseURL = new URLFactory().getBaseURL().toString();
}catch(Exception e){
e.printStackTrace();
}
}
public static String TYPE_STANDARDPART = "wt.part.WTPart" + "|" + domain + ".StandardPart";
public static class FormFieldName {
public static String NUMBER = "number";//编号
public static String NUMBERS = "numbers";//编号
public static String NAME = "name";//名称
public static String EFF = "eff";//架次
public static String EFF_REALTIME = "effRealTime";//有效性过滤是否实时
public static String BOM_VIEW = "BOMView";//BOM视图
public static String LEVEL = "level";//BOM层级
public static String BASELINEID = "baselineId";//基线Id
public static String PARTCADID = "partCADId";//PartCADId
}
public static class BOMView {
public static String MASTER = "Master";//主视图
public static String SSCI = "SSCI";//安装视图
public static String SYSTEM = "System";//系统
public static String EXPERIMENT = "Experiment";//铁鸟
}
}
This diff is collapsed.
package com.yonde.cadpro;
public class DBConstant {
public static class ObjectSearchCondition{
public static String VIEW_ID = "view.key.id";
public static String ROLE_A_ID = "roleAObjectRef.key.id";
public static String ROLE_B_ID = "roleBObjectRef.key.id";
public static String THE_INFO_ID = "thePersistInfo.theObjectIdentifier.id";
public static String ROLE_A_CLASSNAME = "roleAObjectRef.key.classname";
public static String ROLE_B_CLASSNAME = "roleBObjectRef.key.classname";
public static String MASTER_ID = "masterReference.key.id";
public static String BRANCH_ID = "iterationInfo.branchId";
public static String STATE = "state.state";
public static String CREATOR = "creator.key.id";
public static String ITERATION_CREATOR = "iterationInfo.creator.key.id";
public static String MODIFIER = "modifier.key.id";
public static String ITERATION_MODIFIER = "iterationInfo.modifier.key.id";
public static String INTEROPINFO_IOPSTATE = "interopInfo.iopState";
public static String LATEST = "iterationInfo.latest";
public static String TYPE_BRANCHID = "typeDefinitionReference.key.branchId";
public static String IDENTIFIER_ID = "iterationInfo.identifier.iterationId";//iterationIdA2iterationInfo
}
}
This diff is collapsed.
package com.yonde.cadpro.bean;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
public class BatchResult {
public BatchResult() {
}
public BatchResult(DxPartModelBomVo bom, String error) {
this.bom = bom;
this.error = error;
}
public static BatchResult errorBatchResult(String errorInfo) {
if (StringUtils.isNotBlank(errorInfo)) {
BatchResult result = new BatchResult();
result.setError(errorInfo);
return result;
}
return null;
}
public static BatchResult successBatchResult(DxPartModelBomVo bom) {
if (bom != null) {
BatchResult result = new BatchResult();
result.setBom(bom);
return result;
}
return null;
}
public DxPartModelBomVo bom = null;
public String error = "";
public DxPartModelBomVo getBom() {
return bom;
}
public void setBom(DxPartModelBomVo bom) {
this.bom = bom;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
package com.yonde.cadpro.bean;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import wt.org.WTUser;
import java.io.Serializable;
/**
* @description: 用户的基本信息
* @author: 任嘉豪
* @version: V1.0
* @date: 2020/9/4 11:22
**/
public class CADProUser implements Serializable {
/**
* 用户id
*/
private String userId;
/**
* 用户名称
*/
private String userName;
/**
* 账号
*/
private String userAccount;
public CADProUser(String userId, String userName, String userAccount) {
this.userId = userId;
this.userName = userName;
this.userAccount = userAccount;
}
public CADProUser() {
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserAccount() {
return userAccount;
}
public void setUserAccount(String userAccount) {
this.userAccount = userAccount;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
public static CADProUser toCADProUser(WTUser user) {
CADProUser cadProUser = null;
if (user != null) {
cadProUser = new CADProUser();
//TODO 暂不设置
cadProUser.setUserId("");
cadProUser.setUserName(user.getFullName());
cadProUser.setUserAccount(user.getName());
}
return cadProUser;
}
}
package com.yonde.cadpro.bean;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
* @description:
* @author: Mr.Kent
* @create: 2020-12-16
**/
public class DxBaseAttr {
/**
* 属性名
*/
private String name;
/**
* 属性类型
*/
private String type;
/**
* 属性值
*/
private String value;
/**
* 属性单位
*/
private String unit;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
This diff is collapsed.
package com.yonde.cadpro.bean;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.util.List;
/**
* @description:
* @author: Mr.Kent
* @create: 2020-12-16
**/
public class DxParameter {
/**
* 名称
*/
private String name;
/**
* 属性集合
*/
private List<DxParameterAttr> paramAttrs;
/**
* 子参数
*/
private List<DxParameter> children;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<DxParameterAttr> getParamAttrs() {
return paramAttrs;
}
public void setParamAttrs(List<DxParameterAttr> paramAttrs) {
this.paramAttrs = paramAttrs;
}
public List<DxParameter> getChildren() {
return children;
}
public void setChildren(List<DxParameter> children) {
this.children = children;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
package com.yonde.cadpro.bean;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
* @description:
* @author: Mr.Kent
* @create: 2020-12-16
**/
public class DxParameterAttr {
/**
* 属性名
*/
private String key;
/**
* 属性值
*/
private String value;
/**
* 是否锁定
*/
private boolean isLock;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public boolean isLock() {
return isLock;
}
public void setLock(boolean isLock) {
this.isLock = isLock;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
This diff is collapsed.
package com.yonde.cadpro.bean;
import wt.part.WTPart;
import wt.part.WTPartUsageLink;
/*
*作者:huangqibiao
*日期:2020年7月16日
*/
public class LinkAndPart {
private WTPart part;
private WTPartUsageLink link;
public static LinkAndPart newLinkAndPart(WTPartUsageLink link, WTPart part){
LinkAndPart self = new LinkAndPart();
self.link = link;
self.part = part;
return self;
}
private LinkAndPart() {
super();
}
public WTPart getPart() {
return part;
}
public WTPartUsageLink getLink() {
return link;
}
}
package com.yonde.cadpro.bean;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.ArrayList;
import java.util.List;
/**
* 用于结构化模型上的注释信息,完全重现CATIA模型上的注释树状结构
* @author wyue
*
*/
public class MBDAttribute {
/**
* 属性名称
*/
private String key = "";
/**
* 属性值
*/
private String value = "";
/**
* 子属性列表
*/
@JacksonXmlElementWrapper(localName = "children")
@JacksonXmlProperty(localName = "MBDAttribute")
private List<MBDAttribute> children = new ArrayList<MBDAttribute>();
public MBDAttribute() {
}
public MBDAttribute(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public List<MBDAttribute> getChildren() {
return children;
}
@Override
public String toString() {
return "MBDAttribute [key=" + key + ", value=" + value + ", children=" + children + "]";
}
}
package com.yonde.cadpro.bean;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.util.ArrayList;
import java.util.List;
/**
* @author wyue
*
*/
public class MBDAttributes {
@JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "MBDAttribute")
private List<MBDAttribute> mbdAttributes = new ArrayList<MBDAttribute>();
public List<MBDAttribute> getMbdAttributes() {
return mbdAttributes;
}
}
package com.yonde.cadpro.bean;
/**
* 用于结构化R模型定义组合属性
* @author wyue
*
*/
public class MaterialUsedRDefinitionBean {
private String definitionType = "";
private String definitionName = "";
private String attr1 = "";
private String attr2 = "";
private String attr3 = "";
private String attr4 = "";
private String attr5 = "";
private String attr6 = "";
private String attr7 = "";
private String attr8 = "";
private String attr9 = "";
private String attr10 = "";
public String getDefinitionType() {
return definitionType;
}
public void setDefinitionType(String definitionType) {
this.definitionType = definitionType;
}
public String getDefinitionName() {
return definitionName;
}
public void setDefinitionName(String definitionName) {
this.definitionName = definitionName;
}
public String getAttr1() {
return attr1;
}
public void setAttr1(String attr1) {
this.attr1 = attr1;
}
public String getAttr2() {
return attr2;
}
public void setAttr2(String attr2) {
this.attr2 = attr2;
}
public String getAttr3() {
return attr3;
}
public void setAttr3(String attr3) {
this.attr3 = attr3;
}
public String getAttr4() {
return attr4;
}
public void setAttr4(String attr4) {
this.attr4 = attr4;
}
public String getAttr5() {
return attr5;
}
public void setAttr5(String attr5) {
this.attr5 = attr5;
}
public String getAttr6() {
return attr6;
}
public void setAttr6(String attr6) {
this.attr6 = attr6;
}
public String getAttr7() {
return attr7;
}
public void setAttr7(String attr7) {
this.attr7 = attr7;
}
public String getAttr8() {
return attr8;
}
public void setAttr8(String attr8) {
this.attr8 = attr8;
}
public String getAttr9() {
return attr9;
}
public void setAttr9(String attr9) {
this.attr9 = attr9;
}
public String getAttr10() {
return attr10;
}
public void setAttr10(String attr10) {
this.attr10 = attr10;
}
@Override
public String toString() {
return "MaterialUsedDefinition [definitionType=" + definitionType + ", definitionName="
+ definitionName + ", attr1=" + attr1 + ", attr2=" + attr2 + ", attr3=" + attr3
+ ", attr4=" + attr4 + ", attr5=" + attr5 + ", attr6=" + attr6 + ", attr7=" + attr7
+ ", attr8=" + attr8 + ", attr9=" + attr9 + ", attr10=" + attr10 + "]";
}
}
package com.yonde.cadpro.bean;
import java.util.ArrayList;
import java.util.List;
/**
* 用于结构化数模的基本信息
* @author wyue
*
*/
public class ModelBaseInfo {
/**
* 模型OID
*/
private String oid = "";
/**
* 编号
*/
private String number = "";
/**
* 名称
*/
private String name = "";
/**
* 版本,如A.1
*/
private String version = "";
/**
* 是否检出
*/
private Boolean isCheckedOut = false;
/**
* Add for 检出状态、检出者
*/
private String checkoutInfoState;
private String checkoutUser;
/**
* Add for 零部件类型
*/
private String partTypeDisplay;
/**
* 生命周期状态
*/
private String state = "";
/**
* 责任人
*/
private String owner = "";
/**
* 模型主文件名称
*/
private String modelFileName = "";
/**
* 模型文件引用的URI,在模型检入时使用存储文件名,检出时为下载链接
*/
private String modelFileUri = "";
/**
* 模型主文件大小
*/
private Long modelFileSize = 0L;
/**
* 模型主文件校验码
*/
private Long modelFileCheckSum = 0L;
/**
* 子模型列表
*/
private List<ModelBaseInfo> children = new ArrayList<ModelBaseInfo>();
/**
* 所有的MBD属性,用于检入提交
*/
private List<MBDAttribute> mbdDatas = new ArrayList<MBDAttribute>();
// /**
// * 所有技术注释信息,用于检入提交
// */
// private List<TechAnnotation> techAnnotations = new ArrayList<TechAnnotation>();
// /**
// * 所有材料注释信息,用于检入提交
// */
// private List<MaterialAnnotation> materialAnnotations = new ArrayList<MaterialAnnotation>();
// /**
// * 紧固件列表
// */
// private List<Fastener> fasteners = new ArrayList<Fastener>();
/**
* 模型文件基于装配的坐标信息
*/
private String transform = "";
/**
* 是否是二维图
*/
private Boolean isDrawing = false;
/**
* 模型文件的缩略图
*/
private String modelThumbnailUri = "";
/**
* 模型文件的相对地址
*/
private String modelRelativePath = "";
public ModelBaseInfo() {
}
public ModelBaseInfo(String oid, String number, String name, String version,
Boolean isCheckedOut, String checkoutInfoState, String checkoutUser,
String partTypeDisplay, String state, String owner, String modelFileName,
String modelFileUri, Long modelFileSize, Long modelFileCheckSum) {
this.oid = oid;
this.number = number;
this.name = name;
this.version = version;
this.isCheckedOut = isCheckedOut;
this.checkoutInfoState = checkoutInfoState;
this.checkoutUser = checkoutUser;
this.partTypeDisplay = partTypeDisplay;
this.state = state;
this.owner = owner;
this.modelFileName = modelFileName;
this.modelFileUri = modelFileUri;
this.modelFileSize = modelFileSize;
this.modelFileCheckSum = modelFileCheckSum;
}
public ModelBaseInfo(String oid, String number, String name, String version, String state,
String owner, String modelFileName, String modelFileUri, Long modelFileSize,
Long modelFileCheckSum) {
this.oid = oid;
this.number = number;
this.name = name;
this.version = version;
this.state = state;
this.owner = owner;
this.modelFileName = modelFileName;
this.modelFileUri = modelFileUri;
this.modelFileSize = modelFileSize;
this.modelFileCheckSum = modelFileCheckSum;
}
public String getOid() {
return oid;
}
public void setOid(String oid) {
this.oid = oid;
}
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 getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public Boolean getIsCheckedOut() {
return isCheckedOut;
}
public void setIsCheckedOut(Boolean isCheckedOut) {
this.isCheckedOut = isCheckedOut;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public String getModelFileName() {
return modelFileName;
}
public void setModelFileName(String modelFileName) {
this.modelFileName = modelFileName;
}
public String getModelFileUri() {
return modelFileUri;
}
public void setModelFileUri(String modelFileUri) {
this.modelFileUri = modelFileUri;
}
public Long getModelFileSize() {
return modelFileSize;
}
public void setModelFileSize(Long modelFileSize) {
this.modelFileSize = modelFileSize;
}
public Long getModelFileCheckSum() {
return modelFileCheckSum;
}
public void setModelFileCheckSum(Long modelFileCheckSum) {
this.modelFileCheckSum = modelFileCheckSum;
}
public List<ModelBaseInfo> getChildren() {
return children;
}
public List<MBDAttribute> getMbdDatas() {
return mbdDatas;
}
// public List<TechAnnotation> getTechAnnotations() {
// return techAnnotations;
// }
//
// public List<MaterialAnnotation> getMaterialAnnotations() {
// return materialAnnotations;
// }
//
// public List<Fastener> getFasteners() {
// return fasteners;
// }
public String getTransform() {
return transform;
}
public void setTransform(String transform) {
this.transform = transform;
}
public Boolean getIsDrawing() {
return isDrawing;
}
public void setIsDrawing(Boolean isDrawing) {
this.isDrawing = isDrawing;
}
public String getModelThumbnailUri() {
return modelThumbnailUri;
}
public void setModelThumbnailUri(String modelThumbnailUri) {
this.modelThumbnailUri = modelThumbnailUri;
}
public String getCheckoutInfoState() {
return checkoutInfoState;
}
public void setCheckoutInfoState(String checkoutInfoState) {
this.checkoutInfoState = checkoutInfoState;
}
public String getCheckoutUser() {
return checkoutUser;
}
public void setCheckoutUser(String checkoutUser) {
this.checkoutUser = checkoutUser;
}
public String getPartTypeDisplay() {
return partTypeDisplay;
}
public void setPartTypeDisplay(String partTypeDisplay) {
this.partTypeDisplay = partTypeDisplay;
}
public String getModelRelativePath() {
return modelRelativePath;
}
public void setModelRelativePath(String modelRelativePath) {
this.modelRelativePath = modelRelativePath;
}
@Override
public String toString() {
return "ModelBaseInfo [oid=" + oid + ", number=" + number + ", name=" + name + ", version="
+ version + ", isCheckedOut=" + isCheckedOut + ", checkoutInfoState="
+ checkoutInfoState + ", checkoutUser=" + checkoutUser + ", partTypeDisplay="
+ partTypeDisplay + ", state=" + state + ", owner=" + owner + ", modelFileName="
+ modelFileName + ", modelFileUri=" + modelFileUri + ", modelFileSize="
+ modelFileSize + ", modelFileCheckSum=" + modelFileCheckSum + ", children="
+ children + ", mbdDatas=" + mbdDatas + ", transform=" + transform + ", isDrawing=" + isDrawing + ", modelThumbnailUri="
+ modelThumbnailUri + ", modelRelativePath=" + modelRelativePath + "]";
}
}
package com.yonde.cadpro.bean;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* CADPro 打开模型Vo
*
*
*/
public class OpenModelFilesCondition implements Serializable {
public enum OpenModelType {
NEW("新窗口打开"), DIC("上下文打开"), INSERT("插入"), DIC_INSERT("上下文插入");
private String value;
private OpenModelType(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
//选中的模型ID
private List<String> ids = new ArrayList<String>();
//打开方式
private OpenModelType openModelType;
private String eff = "";
//父件相对路径
private String parentPath = "";
public List<String> getIds() {
return ids;
}
public void setIds(List<String> ids) {
this.ids = ids;
}
public OpenModelType getOpenModelType() {
return openModelType;
}
public void setOpenModelType(OpenModelType openModelType) {
this.openModelType = openModelType;
}
public String getEff() {
return eff;
}
public void setEff(String eff) {
this.eff = eff;
}
public String getParentPath() {
return parentPath;
}
public void setParentPath(String parentPath) {
this.parentPath = parentPath;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
package com.yonde.cadpro.bean;
import com.yonde.cadpro.CADProConstants;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@XmlType(propOrder = { "number", "inDicNumber", "children" })
public class TopBOMNode {
private String number;
private String inDicNumber;
private List<TopBOMNode> children;
@XmlAttribute
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
setInDicNumber(CADProConstants.DIC_PREFIX + number);
}
@XmlAttribute
public String getInDicNumber() {
return inDicNumber;
}
public void setInDicNumber(String inDicNumber) {
this.inDicNumber = inDicNumber;
}
@XmlElementWrapper(name="children")
@XmlElement(name = "TopBOMNode")
public List<TopBOMNode> getChildren() {
return children;
}
public void setChildren(List<TopBOMNode> children) {
this.children = children;
}
public static TopBOMNode newTopBOMNode(String partNumber) {
TopBOMNode topBOMNode = new TopBOMNode();
topBOMNode.setNumber(partNumber);
return topBOMNode;
}
public void addChild(TopBOMNode child) {
if (children == null) {
children = new ArrayList<TopBOMNode>();
}
children.add(child);
}
}
package com.yonde.cadpro.bean;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
*/
@XmlRootElement(name = "TopStructure")
@XmlType(propOrder = { "date", "type", "requester", "topBOMNode" })
public class TopStructure {
private String date;
private String type;
private String requester;
private TopBOMNode topBOMNode;
@XmlAttribute(name = "date")
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
@XmlAttribute(name = "type")
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@XmlAttribute(name = "requester")
public String getRequester() {
return requester;
}
public void setRequester(String requester) {
this.requester = requester;
}
@XmlElement(name = "TopBOMNode")
public TopBOMNode getTopBOMNode() {
return topBOMNode;
}
public void setTopBOMNode(TopBOMNode topBOMNode) {
this.topBOMNode = topBOMNode;
}
}
package com.yonde.cadpro.checker;
import com.yonde.cadpro.CADProConstants;
import com.yonde.common.CommonUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import wt.epm.EPMDocument;
import wt.fc.Persistable;
import wt.fc.WTObject;
import wt.log4j.LogR;
import wt.part.WTPart;
import wt.util.WTException;
import java.util.ArrayList;
import java.util.List;
public abstract class AbstractCADProChecker implements CADProChecker {
private static final Logger log = LogR.getLogger(AbstractCADProChecker.class.getName());
/**
* 1. Size > 0
* 2. id转对象
* 3. 对象必须是WTPart或者EPMDocument
*
* @param ids
* @return
* @throws Exception
*/
protected List<WTObject> selectedCheck(List<String> ids) throws Exception {
List<WTObject> selectedNodes = new ArrayList<WTObject>();
if (ids == null || ids.size() == 0) {
throw new WTException("获取选中节点为空,请确认!");
}
List<String> invalidIds = new ArrayList<String>();
List<String> invalidTypeIds = new ArrayList<String>();
for (String id : ids) {
if (StringUtils.isBlank(id)) {
throw new WTException("选中节点id为空,请确认!");
}
Persistable per = null;
try {
per = CommonUtil.getPersistableByOid(id);
} catch (Exception e) {
log.error("selectedCheck Get Per error...", e);
}
if (per == null) {
invalidIds.add(id);
continue;
}
if (per instanceof WTPart || per instanceof EPMDocument) {
selectedNodes.add((WTObject) per);
} else {
invalidTypeIds.add(id);
}
}
if (invalidIds.size() > 0) {
throw new WTException("选中节点获取对象异常,请确认:"
+ StringUtils.join(invalidIds, CADProConstants.COMMA));
}
if (invalidTypeIds.size() > 0) {
throw new WTException("选中节点对象类型非法,请确认:"
+ StringUtils.join(invalidTypeIds, CADProConstants.COMMA));
}
if (selectedNodes.size() == 0) {
throw new WTException("获取选中节点异常,请确认!");
}
return selectedNodes;
}
}
package com.yonde.cadpro.checker;
import wt.fc.WTObject;
import java.util.List;
public interface CADProChecker {
public List<WTObject> check(List<String> ids) throws Exception;
}
package com.yonde.cadpro.checker.factory;
import com.yonde.cadpro.checker.CADProChecker;
public interface CADProCheckerFactory {
public CADProChecker getChecker();
}
package com.yonde.cadpro.checker.factory;
import com.yonde.cadpro.checker.CADProChecker;
import com.yonde.cadpro.checker.impl.DICOpenChecker;
public class DICOpenCheckerFactory implements CADProCheckerFactory {
@Override
public CADProChecker getChecker() {
return new DICOpenChecker();
}
}
package com.yonde.cadpro.checker.factory;
import com.yonde.cadpro.checker.CADProChecker;
import com.yonde.cadpro.checker.impl.NewOpenChecker;
public class NewOpenCheckerFactory implements CADProCheckerFactory {
@Override
public CADProChecker getChecker() {
return new NewOpenChecker();
}
}
package com.yonde.cadpro.checker.impl;
import com.yonde.cadpro.CADProConstants;
import com.yonde.cadpro.checker.AbstractCADProChecker;
import com.yonde.cadpro.config.CADProConfigPropertiesUtil;
import com.yonde.cadpro.util.CADProUtil;
import org.apache.commons.lang.StringUtils;
import wt.fc.WTObject;
import wt.util.WTException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import wt.log4j.LogR;
public class DICOpenChecker extends AbstractCADProChecker {
private static final Logger log = LogR.getLogger(DICOpenChecker.class.getName());
@Override
public List<WTObject> check(List<String> ids) throws Exception {
//必选校验
List<WTObject> selectedNodes = selectedCheck(ids);
List<String> invalidTypeObjs = new ArrayList<String>();
//类型校验
List<String> allowTypes = CADProConfigPropertiesUtil.getOpenDICTypes();
for (WTObject wto : selectedNodes) {
//类型校验
String typeDisplay = CADProUtil.getPartDisplayType(wto);
if (!allowTypes.contains(typeDisplay)) {
invalidTypeObjs.add(wto.getDisplayIdentity().toString());
}
}
if (invalidTypeObjs.size() > 0) {
throw new WTException(
"选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:"
+ StringUtils.join(invalidTypeObjs, CADProConstants.COMMA));
}
return selectedNodes;
}
}
package com.yonde.cadpro.checker.impl;
import com.yonde.cadpro.CADProConstants;
import com.yonde.cadpro.checker.AbstractCADProChecker;
import com.yonde.cadpro.config.CADProConfigPropertiesUtil;
import com.yonde.cadpro.util.CADProUtil;
import com.yonde.cadpro.util.EPMUtil;
import org.apache.commons.lang.StringUtils;
import wt.epm.EPMDocument;
import wt.fc.WTObject;
import wt.part.WTPart;
import wt.util.WTException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import wt.log4j.LogR;
public class InsertChecker extends AbstractCADProChecker {
private static final Logger log = LogR.getLogger(InsertChecker.class.getName());
@Override
public List<WTObject> check(List<String> ids) throws Exception {
//必选校验
List<WTObject> selectedNodes = selectedCheck(ids);
if (selectedNodes.size() != 1) {
throw new WTException("插入仅支持一个根节点");
}
List<String> invalidTypeObjs = new ArrayList<String>();
List<String> noModelObjs = new ArrayList<String>();
//类型校验
List<String> allowTypes = CADProConfigPropertiesUtil.getOpenInsertTypes();
for (WTObject wto : selectedNodes) {
EPMDocument epm = null;
//必须关联CAD文档
if (wto instanceof EPMDocument) {
epm = (EPMDocument) wto;
} else if (wto instanceof WTPart) {
WTPart temp = (WTPart) wto;
epm = EPMUtil.getAssociatedEPM(temp);
}
if (epm == null) {
noModelObjs.add(wto.getDisplayIdentity().toString());
}
//类型校验
String typeDisplay = CADProUtil.getPartDisplayType(wto);
if (!allowTypes.contains(typeDisplay)) {
invalidTypeObjs.add(wto.getDisplayIdentity().toString());
}
}
if (invalidTypeObjs.size() > 0) {
throw new WTException(
"选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:"
+ StringUtils.join(invalidTypeObjs, CADProConstants.COMMA));
}
if (noModelObjs.size() > 0) {
throw new WTException(
"选中节点未关联CAD模型:" + StringUtils.join(noModelObjs, CADProConstants.COMMA));
}
return selectedNodes;
}
}
package com.yonde.cadpro.checker.impl;
import com.yonde.cadpro.CADProConstants;
import com.yonde.cadpro.checker.AbstractCADProChecker;
import com.yonde.cadpro.config.CADProConfigPropertiesUtil;
import com.yonde.cadpro.util.CADProUtil;
import com.yonde.cadpro.util.EPMUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import wt.epm.EPMDocument;
import wt.fc.WTObject;
import wt.log4j.LogR;
import wt.part.WTPart;
import wt.util.WTException;
import java.util.ArrayList;
import java.util.List;
public class NewOpenChecker extends AbstractCADProChecker {
private static final Logger log = LogR.getLogger(NewOpenChecker.class.getName());
@Override
public List<WTObject> check(List<String> ids) throws Exception {
//必选校验
List<WTObject> selectedNodes = selectedCheck(ids);
if (selectedNodes.size() != 1) {
throw new WTException("新窗口打开仅支持一个根节点");
}
List<String> invalidTypeObjs = new ArrayList<String>();
List<String> noModelObjs = new ArrayList<String>();
//类型校验
List<String> allowTypes = CADProConfigPropertiesUtil.getOpenNewTypes();
for (WTObject wto : selectedNodes) {
EPMDocument epm = null;
//必须关联CAD文档
if (wto instanceof EPMDocument) {
epm = (EPMDocument) wto;
} else if (wto instanceof WTPart) {
WTPart temp = (WTPart) wto;
epm = EPMUtil.getAssociatedEPM(temp);
}
if (epm == null) {
noModelObjs.add(wto.getDisplayIdentity().toString());
}
//类型校验
String typeDisplay = CADProUtil.getPartDisplayType(wto);
if (!allowTypes.contains(typeDisplay)) {
invalidTypeObjs.add(wto.getDisplayIdentity().toString());
}
}
if (invalidTypeObjs.size() > 0) {
throw new WTException(
"选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:"
+ StringUtils.join(invalidTypeObjs, CADProConstants.COMMA));
}
if (noModelObjs.size() > 0) {
throw new WTException(
"选中节点未关联CAD模型:" + StringUtils.join(noModelObjs, CADProConstants.COMMA));
}
return selectedNodes;
}
}
package com.yonde.cadpro.config;
import com.yonde.cadpro.CADProConstants;
import com.yonde.cadpro.bean.DxModelFile;
import com.yonde.cadpro.util.PropertiesAndXmlHotReader;
import com.yonde.context.vo.SelectOption;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import wt.log4j.LogR;
import wt.method.RemoteAccess;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class CADProConfigPropertiesUtil implements RemoteAccess {
private static final Logger log = LogR.getLogger(CADProConfigPropertiesUtil.class.getName());
private static String CATIAINTE_CONFIG_URL = File.separator + "codebase" + File.separator
+ "ext" + File.separator + "gace" + File.separator + "config" + File.separator
+ "cadpro" + File.separator + "CADProConfig.properties";
private static String CONFIG_OPEN_NEW_TYPES = "Open.NEW.Types";
private static String CONFIG_OPEN_INSERT_TYPES = "Open.INSERT.Types";
private static String CONFIG_OPEN_DIC_TYPES = "Open.DIC.Types";
private static String CONFIG_DOWNLOAD_STORAGE_DSNUMBER_TYPES = "Download.storage.dsNumber.Types";
private static String CONFIG_DOWNLOAD_STORAGE_TEMP_TYPES = "Download.storage.temp.Types";
private static String CONFIG_DOWNLOAD_STORAGE_TEMP_CLIENTFOLDERPATH = "Download.storage.temp.ClientFolderPath";
private static String CONFIG_SEARCH_BOMVIEW = "Search.BOMView";
private static String getValue(String key) throws Exception {
return StringUtils
.defaultString(PropertiesAndXmlHotReader.getProMap(CATIAINTE_CONFIG_URL).get(key));
}
/**
* 新窗口打开允许类型
*
* @return
* @throws Exception
*/
public static List<String> getOpenNewTypes() throws Exception {
List<String> openNewTypes = new ArrayList<String>();
String configValue = getValue(CONFIG_OPEN_NEW_TYPES);
if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON_ZH, CADProConstants.COMMA);
String[] arrs = StringUtils.split(configValue, CADProConstants.COMMA);
for (String config : arrs) {
if (StringUtils.isNotBlank(config)) {
if (!openNewTypes.contains(config)) {
openNewTypes.add(config);
}
}
}
}
return openNewTypes;
}
/**
* 上下文打开、插入允许类型
*
* @return
* @throws Exception
*/
public static List<String> getOpenDICTypes() throws Exception {
List<String> openNewTypes = new ArrayList<String>();
String configValue = getValue(CONFIG_OPEN_DIC_TYPES);
if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON_ZH, CADProConstants.COMMA);
String[] arrs = StringUtils.split(configValue, CADProConstants.COMMA);
for (String config : arrs) {
if (StringUtils.isNotBlank(config)) {
if (!openNewTypes.contains(config)) {
openNewTypes.add(config);
}
}
}
}
return openNewTypes;
}
/**
* 插入允许类型
*
* @return
* @throws Exception
*/
public static List<String> getOpenInsertTypes() throws Exception {
List<String> openNewTypes = new ArrayList<String>();
String configValue = getValue(CONFIG_OPEN_INSERT_TYPES);
if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON_ZH, CADProConstants.COMMA);
String[] arrs = StringUtils.split(configValue, CADProConstants.COMMA);
for (String config : arrs) {
if (StringUtils.isNotBlank(config)) {
if (!openNewTypes.contains(config)) {
openNewTypes.add(config);
}
}
}
}
return openNewTypes;
}
public static List<String> getDownloadStorageTempTypes() throws Exception {
List<String> tempTypes = new ArrayList<String>();
String configValue = getValue(CONFIG_DOWNLOAD_STORAGE_TEMP_TYPES);
if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON_ZH, CADProConstants.COMMA);
String[] arrs = StringUtils.split(configValue, CADProConstants.COMMA);
for (String config : arrs) {
if (StringUtils.isNotBlank(config)) {
if (!tempTypes.contains(config)) {
tempTypes.add(config);
}
}
}
}
return tempTypes;
}
public static List<String> getDownloadStorageAsDsNumberTypes() throws Exception {
List<String> tempTypes = new ArrayList<String>();
String configValue = getValue(CONFIG_DOWNLOAD_STORAGE_DSNUMBER_TYPES);
if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON_ZH, CADProConstants.COMMA);
String[] arrs = StringUtils.split(configValue, CADProConstants.COMMA);
for (String config : arrs) {
if (StringUtils.isNotBlank(config)) {
if (!tempTypes.contains(config)) {
tempTypes.add(config);
}
}
}
}
return tempTypes;
}
public static String getDownloadStorageAsTempClientFoderPath() throws Exception {
return StringUtils.defaultIfEmpty(getValue(CONFIG_DOWNLOAD_STORAGE_TEMP_CLIENTFOLDERPATH),
DxModelFile.PATH_SPLIT_BACK);
}
/**
* 获取BOM查询视图配置
* @return
* @throws Exception
*/
public static <T> List<T> getBOMViews(Class<T> clazz) throws Exception {
List<T> selectOptions = new ArrayList<T>();
String configValue = getValue(CONFIG_SEARCH_BOMVIEW);
log.debug("Ori configValue : {} "+configValue);
if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.SEMICOLON_ZH, CADProConstants.COMMA);
configValue = configValue.replace(CADProConstants.COLON_ZH, CADProConstants.COLON);
String[] arrs = StringUtils.split(configValue, CADProConstants.COMMA);
for (String config : arrs) {
if (StringUtils.isNotBlank(config)) {
String[] configArrs = StringUtils.split(config, CADProConstants.COLON);
if (configArrs != null && configArrs.length == 3) {
if (String.class.isAssignableFrom(clazz)) {
selectOptions.add((T) configArrs[0]);
} else if (SelectOption.class.isAssignableFrom(clazz)) {
selectOptions.add((T) SelectOption.newSelectOption(configArrs[0],
configArrs[1], Boolean.parseBoolean(configArrs[2])));
} else {
log.error("clazz{} is invald"+ clazz);
}
} else {
log.error("config{} format is invald"+ config);
}
}
}
}
return selectOptions;
}
}
package com.yonde.cadpro.config;
public enum CADProSettingTypeEnum {
Server(0),
DesignTool(1);
private CADProSettingTypeEnum(int key) {
this.key = key;
}
private int key;
public int getKey() {
return key;
}
public void setKey(int key) {
this.key = key;
}
}
This diff is collapsed.
package com.yonde.cadpro.config;
import com.yonde.cadpro.util.PropertiesAndXmlHotReader;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import wt.log4j.LogR;
import wt.method.RemoteAccess;
import java.io.File;
import java.util.Arrays;
import java.util.List;
public class CatiaInteConfigPropertiesUtil implements RemoteAccess {
private static final String CLASSNAME = CatiaInteConfigPropertiesUtil.class.getName();
private static final Logger LOGGER = LogR.getLogger(CLASSNAME);
private static String CATIAINTE_CONFIG_URL = File.separator + "codebase" + File.separator
+ "ext" + File.separator + "gace" + File.separator + "config" + File.separator
+ "CatiaIntegration.properties";
private static String getValue(String key) throws Exception {
return StringUtils
.defaultString(PropertiesAndXmlHotReader.getProMap(CATIAINTE_CONFIG_URL).get(key));
}
public static List<String> getAbsolutePositionType() throws Exception {
String[] types = getValue("Absolute.Position.Type").split(",");
return Arrays.asList(types);
}
public static String getAbsolutePositionDefault() throws Exception {
return getValue("Absolute.Position.Default");
}
public static String getMCADProClientVersion() throws Exception {
return getValue("MCADProClient.version");
}
public static List<String> getBOMAllowTypes() throws Exception {
String[] types = getValue("BOM.AllowPartType").split(",");
return Arrays.asList(types);
}
}
package com.yonde.cadpro.config;
import java.util.Map;
public class CatiaIntegrationAttrMapping {
private Map<String, String> attrToIBAMaping;
public Map<String, String> getAttrToIBAMaping() {
return attrToIBAMaping;
}
public void setAttrToIBAMaping(Map<String, String> attrToIBAMaping) {
this.attrToIBAMaping = attrToIBAMaping;
}
public String getMappingIba(String cadAttr) {
String mappingIBA = "";
if(attrToIBAMaping != null) {
mappingIBA = attrToIBAMaping.get(cadAttr);
}
return mappingIBA;
}
}
package com.yonde.cadpro.config;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
public class DxCADProFTPSetting {
private String host;
private int port;
private String userName;
private String password;
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
}
}
This diff is collapsed.
This diff is collapsed.
package com.yonde.cadpro.download;
import com.yonde.cadpro.bean.DxModelFile;
import wt.fc.WTObject;
import wt.part.WTPart;
import java.util.List;
public interface CADProDownloader {
public List<WTObject> check(List<String> ids) throws Exception;
public List<DxModelFile> download(List<WTObject> selectedNodes ,
String parentPath) throws Exception;
public void collectModelFilesByPartBOM(WTPart part,
ClientModelPathRule pathRule, boolean isSelectedNode, List<DxModelFile> modelFiles,
List<String> processedObjs) throws Exception;
}
package com.yonde.cadpro.download;
public interface ClientModelPathRule {
public String getPath() throws Exception;
public boolean applyChild();
}
package com.yonde.cadpro.download.factroy;
import com.yonde.cadpro.download.CADProDownloader;
public interface CADProDownloaderFactory {
public CADProDownloader getDownloader();
}
package com.yonde.cadpro.download.factroy;
import com.yonde.cadpro.bean.OpenModelFilesCondition;
import com.yonde.cadpro.config.CADProConfigPropertiesUtil;
import com.yonde.cadpro.download.ClientModelPathRule;
import com.yonde.cadpro.download.impl.ClientModelPathAsConfigRule;
import com.yonde.cadpro.download.impl.ClientModelPathAsDSRule;
import com.yonde.cadpro.download.impl.ClientModelPathAsParentRule;
import com.yonde.common.util.TypeAttrUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wt.fc.WTObject;
import wt.part.WTPart;
import java.util.List;
public class ClientModelPathRuleFactory {
private static final Logger log = LoggerFactory.getLogger(ClientModelPathRuleFactory.class);
public static ClientModelPathRule getRule(OpenModelFilesCondition.OpenModelType openModelType, WTPart part,
String parentPath) throws Exception {
log.debug("getRule param {},{},{}", openModelType, part, parentPath);
if (OpenModelFilesCondition.OpenModelType.INSERT.equals(openModelType)) {//插入
log.debug("IS INSERT ");
parentPath = StringUtils.trimToEmpty(parentPath);
return new ClientModelPathAsParentRule(parentPath);
} else {
List<String> numberTypes = CADProConfigPropertiesUtil
.getDownloadStorageAsDsNumberTypes();
List<String> tempTypes = CADProConfigPropertiesUtil.getDownloadStorageTempTypes();
log.debug("numberTypes : " + numberTypes);
log.debug("tempTypes : " + tempTypes);
String typeDisplay = TypeAttrUtil.getAttributeDisplayName((WTObject) part);
log.debug("typeDisplay : " + typeDisplay);
if (tempTypes.contains(typeDisplay)) {
return new ClientModelPathAsConfigRule();
} else if (numberTypes.contains(typeDisplay)) {
return new ClientModelPathAsDSRule(part);
} else {
//throw new WTException("此操作场景暂不支持");
return null;
}
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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