Commit 573130d6 authored by hanson.yao's avatar hanson.yao

test cadpro client

parent 4adeaf5a
...@@ -18,4 +18,4 @@ ftp.port=21 ...@@ -18,4 +18,4 @@ ftp.port=21
ftp.username=ftpuser ftp.username=ftpuser
ftp.password=Aa12345678! ftp.password=Aa12345678!
ftp.remotePath=/ ftp.remotePath=/
ftp.rootPath=E:/FTPHome ftp.rootPath=D:/Inetpub/ftproot
package com.yonde.basedata.controller; package com.yonde.basedata.controller;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.yonde.basedata.entity.api.ApiResult;
import com.yonde.cadpro.bean.CADProUser;
import com.yonde.cadpro.service.CADProService;
import com.yonde.common.LdapUtil; import com.yonde.common.LdapUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import wt.method.RemoteAccess;
import wt.util.WTException; import wt.util.WTException;
@RestController @RestController
@RequestMapping({"/login"}) @RequestMapping({"/login"})
public class LoginController { public class LoginController implements RemoteAccess {
private static final Log log = LogFactory.getLog(LoginController.class);
/** /**
* 用户认证 * 用户认证
*
* @param userName * @param userName
* @return * @return
* @throws JsonProcessingException * @throws JsonProcessingException
...@@ -26,4 +36,19 @@ public class LoginController { ...@@ -26,4 +36,19 @@ public class LoginController {
} }
return result; return result;
} }
/**
* CAD用户认证
*
* @param userName
* @return
*/
@SuppressWarnings("unchecked")
@RequestMapping(method = RequestMethod.POST)
@ResponseBody
public ApiResult<CADProUser> cadLoginAuth(@RequestParam String userName,
@RequestParam(required = false) String clientVersion) throws Exception {
System.out.print("cadLoginAuth info [userName]:" + userName + " [clientVersion]" + clientVersion);
return CADProService.cadProLogin(userName, clientVersion);
}
} }
...@@ -6,7 +6,9 @@ import com.yonde.basedata.exception.DxErrorCodeData; ...@@ -6,7 +6,9 @@ import com.yonde.basedata.exception.DxErrorCodeData;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.core.NestedExceptionUtils; import org.springframework.core.NestedExceptionUtils;
public class ApiResult<T> { import java.io.Serializable;
public class ApiResult<T> implements Serializable {
public static final String SUCCESS = "0"; public static final String SUCCESS = "0";
private String code; private String code;
......
...@@ -25,7 +25,7 @@ public enum DxErrorCodeData implements DxEnumData { ...@@ -25,7 +25,7 @@ public enum DxErrorCodeData implements DxEnumData {
PROP_MAPPING_ERROR(19, "目标类[%s]属性映射错误[%s]"), PROP_MAPPING_ERROR(19, "目标类[%s]属性映射错误[%s]"),
CURRENT_NOT_SUPPORT_CUSTOM_TYPE(20, "当前系统不支持自定义类型(json转对象)"), CURRENT_NOT_SUPPORT_CUSTOM_TYPE(20, "当前系统不支持自定义类型(json转对象)"),
CAN_NOT_FOUND_DX_TYPE(21, "没有找见对应的dxType类型[%s]"), CAN_NOT_FOUND_DX_TYPE(21, "没有找见对应的dxType类型[%s]"),
Service_Error(2100,"服务异常"); Service_Error(2100,"CADPro登录异常");
public static final String PREFIX = "BASEDATA_"; public static final String PREFIX = "BASEDATA_";
final String code; final String code;
final String value; final String value;
......
...@@ -13,7 +13,9 @@ import java.io.File; ...@@ -13,7 +13,9 @@ import java.io.File;
public class CADProConstants { public class CADProConstants {
public static String PART_DEFAULT_TYPE = "wt.part.WTPart";
public static final String AUTHORIZATION = "authorization";
public static final String BASIC = "Basic ";
public static String COMMA = ","; public static String COMMA = ",";
public static String COMMA_ZH = ","; public static String COMMA_ZH = ",";
public static String SEMICOLON = ";"; public static String SEMICOLON = ";";
......
package com.yonde.cadpro; package com.yonde.cadpro;
public class DBConstant { public class DBConstant {
public static class ObjectSearchCondition{ public static class ObjectSearchCondition{
public static String VIEW_ID = "view.key.id"; public static String VIEW_ID = "view.key.id";
public static String ROLE_A_ID = "roleAObjectRef.key.id"; public static String ROLE_A_ID = "roleAObjectRef.key.id";
public static String ROLE_B_ID = "roleBObjectRef.key.id"; public static String ROLE_B_ID = "roleBObjectRef.key.id";
public static String THE_INFO_ID = "thePersistInfo.theObjectIdentifier.id"; public static String THE_INFO_ID = "thePersistInfo.theObjectIdentifier.id";
public static String ROLE_A_CLASSNAME = "roleAObjectRef.key.classname"; public static String ROLE_A_CLASSNAME = "roleAObjectRef.key.classname";
public static String ROLE_B_CLASSNAME = "roleBObjectRef.key.classname"; public static String ROLE_B_CLASSNAME = "roleBObjectRef.key.classname";
public static String MASTER_ID = "masterReference.key.id"; public static String MASTER_ID = "masterReference.key.id";
public static String BRANCH_ID = "iterationInfo.branchId"; public static String BRANCH_ID = "iterationInfo.branchId";
public static String STATE = "state.state"; public static String STATE = "state.state";
public static String CREATOR = "creator.key.id"; public static String CREATOR = "creator.key.id";
public static String ITERATION_CREATOR = "iterationInfo.creator.key.id"; public static String ITERATION_CREATOR = "iterationInfo.creator.key.id";
public static String MODIFIER = "modifier.key.id"; public static String MODIFIER = "modifier.key.id";
public static String ITERATION_MODIFIER = "iterationInfo.modifier.key.id"; public static String ITERATION_MODIFIER = "iterationInfo.modifier.key.id";
public static String INTEROPINFO_IOPSTATE = "interopInfo.iopState"; public static String INTEROPINFO_IOPSTATE = "interopInfo.iopState";
public static String LATEST = "iterationInfo.latest"; public static String LATEST = "iterationInfo.latest";
public static String TYPE_BRANCHID = "typeDefinitionReference.key.branchId"; public static String TYPE_BRANCHID = "typeDefinitionReference.key.branchId";
public static String IDENTIFIER_ID = "iterationInfo.identifier.iterationId";//iterationIdA2iterationInfo public static String IDENTIFIER_ID = "iterationInfo.identifier.iterationId";//iterationIdA2iterationInfo
} }
} }
...@@ -5,7 +5,9 @@ import org.apache.commons.lang.StringUtils; ...@@ -5,7 +5,9 @@ import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle; import org.apache.commons.lang.builder.ToStringStyle;
public class BatchResult { import java.io.Serializable;
public class BatchResult implements Serializable {
public BatchResult() { public BatchResult() {
} }
......
...@@ -30,7 +30,7 @@ public class DxBaseAttr { ...@@ -30,7 +30,7 @@ public class DxBaseAttr {
* 属性单位 * 属性单位
*/ */
private String unit; private String unit;
public String getName() { public String getName() {
return name; return name;
} }
......
...@@ -12,16 +12,17 @@ import wt.content.ContentRoleType; ...@@ -12,16 +12,17 @@ import wt.content.ContentRoleType;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.epm.EPMDocumentType; import wt.epm.EPMDocumentType;
import java.io.Serializable;
import java.util.List; import java.util.List;
/** /**
* @description:描述模型文件基本信息 * @description:描述模型文件基本信息
* *
* @author: Mr.Kent * @author: Mr.Kent
* @create: 2020-11-24 * @create: 2020-11-24
**/ **/
public class DxModelFile { public class DxModelFile implements Serializable {
public static String PATH_SPLIT_BACK = "/"; public static String PATH_SPLIT_BACK = "/";
public static String PATH_SPLIT = "\\"; public static String PATH_SPLIT = "\\";
...@@ -206,7 +207,7 @@ public class DxModelFile { ...@@ -206,7 +207,7 @@ public class DxModelFile {
} }
return visFile; return visFile;
} }
public static DxModelFile newPmiFile(EPMDocument epm) throws Exception { public static DxModelFile newPmiFile(EPMDocument epm) throws Exception {
DxModelFile visFile = null; DxModelFile visFile = null;
if (epm == null) { if (epm == null) {
...@@ -256,13 +257,13 @@ public class DxModelFile { ...@@ -256,13 +257,13 @@ public class DxModelFile {
String modelFileUri = ""; String modelFileUri = "";
long modelFileSize = 0L; long modelFileSize = 0L;
long modelFileCheckSum = 0L; long modelFileCheckSum = 0L;
modelFileUri = ContentHelper.getDownloadURL(epm, primaryAppData, false, modelFileName) modelFileUri = ContentHelper.getDownloadURL(epm, primaryAppData, false, modelFileName)
.toExternalForm(); .toExternalForm();
modelFileSize = primaryAppData.getFileSize(); modelFileSize = primaryAppData.getFileSize();
modelFileCheckSum = primaryAppData.getChecksum(); modelFileCheckSum = primaryAppData.getChecksum();
modelFile = new DxModelFile(); modelFile = new DxModelFile();
modelFile.setFileId(primaryAppData.getPersistInfo().getObjectIdentifier().getId()); modelFile.setFileId(primaryAppData.getPersistInfo().getObjectIdentifier().getId());
modelFile.setFileName(modelFileName); modelFile.setFileName(modelFileName);
...@@ -270,12 +271,12 @@ public class DxModelFile { ...@@ -270,12 +271,12 @@ public class DxModelFile {
modelFile.setFileUri(modelFileUri); modelFile.setFileUri(modelFileUri);
modelFile.setFileCheckSum(String.valueOf(modelFileCheckSum)); modelFile.setFileCheckSum(String.valueOf(modelFileCheckSum));
modelFile.setFileType(FilenameUtils.getExtension(modelFileName)); modelFile.setFileType(FilenameUtils.getExtension(modelFileName));
//获取模型路径 //获取模型路径
String modelRelativePath = LWCUtil.getStringValue(epm, String modelRelativePath = LWCUtil.getStringValue(epm,
GACEConstants.IBA_MODELRELATIVEPATH); GACEConstants.IBA_MODELRELATIVEPATH);
modelFile.setRelativePath(modelRelativePath); modelFile.setRelativePath(modelRelativePath);
modelFile.setSelectedNode(selectedNode); modelFile.setSelectedNode(selectedNode);
} }
return modelFile; return modelFile;
......
...@@ -51,7 +51,7 @@ public class DxParameter { ...@@ -51,7 +51,7 @@ public class DxParameter {
public void setChildren(List<DxParameter> children) { public void setChildren(List<DxParameter> children) {
this.children = children; this.children = children;
} }
@Override @Override
public String toString() { public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
......
...@@ -49,7 +49,7 @@ public class DxParameterAttr { ...@@ -49,7 +49,7 @@ public class DxParameterAttr {
public void setLock(boolean isLock) { public void setLock(boolean isLock) {
this.isLock = isLock; this.isLock = isLock;
} }
@Override @Override
public String toString() { public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE); return ToStringBuilder.reflectionToString(this, ToStringStyle.DEFAULT_STYLE);
......
...@@ -4,8 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat; ...@@ -4,8 +4,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import com.yonde.common.CommonUtil; import com.yonde.common.CommonUtil;
import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle; import org.apache.commons.lang.builder.ToStringStyle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.org.WTPrincipal; import wt.org.WTPrincipal;
import wt.org.WTUser; import wt.org.WTUser;
...@@ -15,6 +13,7 @@ import wt.util.WTException; ...@@ -15,6 +13,7 @@ import wt.util.WTException;
import wt.vc.wip.CheckoutInfo; import wt.vc.wip.CheckoutInfo;
import wt.vc.wip.WorkInProgressHelper; import wt.vc.wip.WorkInProgressHelper;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
...@@ -24,11 +23,10 @@ import java.util.Map; ...@@ -24,11 +23,10 @@ import java.util.Map;
* 部件模型实体类 * 部件模型实体类
* *
* @description: * @description:
* *
**/ **/
public class DxPartModelBomVo { public class DxPartModelBomVo implements Serializable {
private static Logger log = LoggerFactory.getLogger(DxPartModelBomVo.class);
private String partId; private String partId;
...@@ -327,7 +325,7 @@ public class DxPartModelBomVo { ...@@ -327,7 +325,7 @@ public class DxPartModelBomVo {
String oid = CommonUtil.getPersistableOid(wtPart); String oid = CommonUtil.getPersistableOid(wtPart);
String number = wtPart.getNumber(); String number = wtPart.getNumber();
String name = wtPart.getName(); String name = wtPart.getName();
String version = CommonUtil.getVersionDisplayWithOneOff(wtPart); //String version = CommonUtil.getVersionDisplayWithOneOff(wtPart);
Boolean isCheckedOut = WorkInProgressHelper.isCheckedOut(wtPart); Boolean isCheckedOut = WorkInProgressHelper.isCheckedOut(wtPart);
//Add for 检出状态、检出者 //Add for 检出状态、检出者
CheckoutInfo checkInfo = wtPart.getCheckoutInfo(); CheckoutInfo checkInfo = wtPart.getCheckoutInfo();
...@@ -345,7 +343,7 @@ public class DxPartModelBomVo { ...@@ -345,7 +343,7 @@ public class DxPartModelBomVo {
dxPartModelBomVo.setPartId(oid); dxPartModelBomVo.setPartId(oid);
dxPartModelBomVo.setName(name); dxPartModelBomVo.setName(name);
dxPartModelBomVo.setNumber(number); dxPartModelBomVo.setNumber(number);
dxPartModelBomVo.setDisplayVersion(version); //dxPartModelBomVo.setDisplayVersion(version);
dxPartModelBomVo.setState(state); dxPartModelBomVo.setState(state);
dxPartModelBomVo.setPartType(partTypeDisplay); dxPartModelBomVo.setPartType(partTypeDisplay);
dxPartModelBomVo.setCheckOuted(isCheckedOut); dxPartModelBomVo.setCheckOuted(isCheckedOut);
...@@ -367,7 +365,7 @@ public class DxPartModelBomVo { ...@@ -367,7 +365,7 @@ public class DxPartModelBomVo {
String oid = CommonUtil.getPersistableOid(epm); String oid = CommonUtil.getPersistableOid(epm);
String number = epm.getNumber(); String number = epm.getNumber();
String name = epm.getName(); String name = epm.getName();
String version = CommonUtil.getVersionDisplayWithOneOff(epm); //String version = CommonUtil.getVersionDisplayWithOneOff(epm);
Boolean isCheckedOut = WorkInProgressHelper.isCheckedOut(epm); Boolean isCheckedOut = WorkInProgressHelper.isCheckedOut(epm);
//Add for 检出状态、检出者 //Add for 检出状态、检出者
CheckoutInfo checkInfo = epm.getCheckoutInfo(); CheckoutInfo checkInfo = epm.getCheckoutInfo();
...@@ -387,14 +385,15 @@ public class DxPartModelBomVo { ...@@ -387,14 +385,15 @@ public class DxPartModelBomVo {
DxModelFile modelFile = DxModelFile.newModelFile(epm); DxModelFile modelFile = DxModelFile.newModelFile(epm);
dxPartModelBomVo.setModelFile(modelFile); dxPartModelBomVo.setModelFile(modelFile);
} catch (Exception e) { } catch (Exception e) {
log.error("获取模型信息失败", e); e.printStackTrace();
System.out.println("获取模型信息失败");
} }
} }
dxPartModelBomVo.setPartId(oid); dxPartModelBomVo.setPartId(oid);
dxPartModelBomVo.setName(name); dxPartModelBomVo.setName(name);
dxPartModelBomVo.setNumber(number); dxPartModelBomVo.setNumber(number);
dxPartModelBomVo.setDisplayVersion(version); //dxPartModelBomVo.setDisplayVersion(version);
dxPartModelBomVo.setState(state); dxPartModelBomVo.setState(state);
dxPartModelBomVo.setPartType(partTypeDisplay); dxPartModelBomVo.setPartType(partTypeDisplay);
dxPartModelBomVo.setCheckOuted(isCheckedOut); dxPartModelBomVo.setCheckOuted(isCheckedOut);
......
...@@ -3,6 +3,7 @@ package com.yonde.cadpro.bean; ...@@ -3,6 +3,7 @@ package com.yonde.cadpro.bean;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -11,13 +12,13 @@ import java.util.List; ...@@ -11,13 +12,13 @@ import java.util.List;
* @author wyue * @author wyue
* *
*/ */
public class MBDAttribute { public class MBDAttribute implements Serializable {
/** /**
* 属性名称 * 属性名称
*/ */
private String key = ""; private String key = "";
/** /**
* 属性值 * 属性值
*/ */
......
...@@ -3,6 +3,7 @@ package com.yonde.cadpro.bean; ...@@ -3,6 +3,7 @@ package com.yonde.cadpro.bean;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -10,7 +11,7 @@ import java.util.List; ...@@ -10,7 +11,7 @@ import java.util.List;
* @author wyue * @author wyue
* *
*/ */
public class MBDAttributes { public class MBDAttributes implements Serializable {
@JacksonXmlElementWrapper(useWrapping = false) @JacksonXmlElementWrapper(useWrapping = false)
@JacksonXmlProperty(localName = "MBDAttribute") @JacksonXmlProperty(localName = "MBDAttribute")
......
package com.yonde.cadpro.bean; package com.yonde.cadpro.bean;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* 用于结构化数模的基本信息 * 用于结构化数模的基本信息
* @author wyue
* *
* @author wyue
*/ */
public class ModelBaseInfo { public class ModelBaseInfo implements Serializable {
/** /**
* 模型OID * 模型OID
...@@ -110,9 +111,42 @@ public class ModelBaseInfo { ...@@ -110,9 +111,42 @@ public class ModelBaseInfo {
*/ */
private String modelRelativePath = ""; private String modelRelativePath = "";
/**
* 产品代号(用于当前cad数据寻找容器)
*/
private String productCode;
public ModelBaseInfo() { 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,
List<ModelBaseInfo> children, List<MBDAttribute> mbdDatas, String transform, Boolean isDrawing,
String modelThumbnailUri, String modelRelativePath, String productCode) {
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;
this.children = children;
this.mbdDatas = mbdDatas;
this.transform = transform;
this.isDrawing = isDrawing;
this.modelThumbnailUri = modelThumbnailUri;
this.modelRelativePath = modelRelativePath;
this.productCode = productCode;
}
public ModelBaseInfo(String oid, String number, String name, String version, public ModelBaseInfo(String oid, String number, String name, String version,
Boolean isCheckedOut, String checkoutInfoState, String checkoutUser, Boolean isCheckedOut, String checkoutInfoState, String checkoutUser,
String partTypeDisplay, String state, String owner, String modelFileName, String partTypeDisplay, String state, String owner, String modelFileName,
...@@ -312,6 +346,14 @@ public class ModelBaseInfo { ...@@ -312,6 +346,14 @@ public class ModelBaseInfo {
this.modelRelativePath = modelRelativePath; this.modelRelativePath = modelRelativePath;
} }
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
@Override @Override
public String toString() { public String toString() {
return "ModelBaseInfo [oid=" + oid + ", number=" + number + ", name=" + name + ", version=" return "ModelBaseInfo [oid=" + oid + ", number=" + number + ", name=" + name + ", version="
...@@ -321,7 +363,8 @@ public class ModelBaseInfo { ...@@ -321,7 +363,8 @@ public class ModelBaseInfo {
+ modelFileName + ", modelFileUri=" + modelFileUri + ", modelFileSize=" + modelFileName + ", modelFileUri=" + modelFileUri + ", modelFileSize="
+ modelFileSize + ", modelFileCheckSum=" + modelFileCheckSum + ", children=" + modelFileSize + ", modelFileCheckSum=" + modelFileCheckSum + ", children="
+ children + ", mbdDatas=" + mbdDatas + ", transform=" + transform + ", isDrawing=" + isDrawing + ", modelThumbnailUri=" + children + ", mbdDatas=" + mbdDatas + ", transform=" + transform + ", isDrawing=" + isDrawing + ", modelThumbnailUri="
+ modelThumbnailUri + ", modelRelativePath=" + modelRelativePath + "]"; + modelThumbnailUri + ", modelRelativePath=" + modelRelativePath
+ ", productCode=" + productCode + "]";
} }
} }
...@@ -10,8 +10,8 @@ import java.util.List; ...@@ -10,8 +10,8 @@ import java.util.List;
/** /**
* CADPro 打开模型Vo * CADPro 打开模型Vo
* *
* *
*/ */
public class OpenModelFilesCondition implements Serializable { public class OpenModelFilesCondition implements Serializable {
......
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;
}
}
...@@ -20,12 +20,13 @@ public abstract class AbstractCADProChecker implements CADProChecker { ...@@ -20,12 +20,13 @@ public abstract class AbstractCADProChecker implements CADProChecker {
* 1. Size > 0 * 1. Size > 0
* 2. id转对象 * 2. id转对象
* 3. 对象必须是WTPart或者EPMDocument * 3. 对象必须是WTPart或者EPMDocument
* *
* @param ids * @param ids
* @return * @return
* @throws Exception * @throws Exception
*/ */
protected List<WTObject> selectedCheck(List<String> ids) throws Exception { protected List<WTObject> selectedCheck(List<String> ids) throws Exception {
System.out.println(">>>selectedCheck begin......ids:"+ids);
List<WTObject> selectedNodes = new ArrayList<WTObject>(); List<WTObject> selectedNodes = new ArrayList<WTObject>();
if (ids == null || ids.size() == 0) { if (ids == null || ids.size() == 0) {
throw new WTException("获取选中节点为空,请确认!"); throw new WTException("获取选中节点为空,请确认!");
...@@ -34,23 +35,30 @@ public abstract class AbstractCADProChecker implements CADProChecker { ...@@ -34,23 +35,30 @@ public abstract class AbstractCADProChecker implements CADProChecker {
List<String> invalidIds = new ArrayList<String>(); List<String> invalidIds = new ArrayList<String>();
List<String> invalidTypeIds = new ArrayList<String>(); List<String> invalidTypeIds = new ArrayList<String>();
for (String id : ids) { for (String id : ids) {
System.out.println(">>>selectedCheck begin......id:"+id);
if (StringUtils.isBlank(id)) { if (StringUtils.isBlank(id)) {
throw new WTException("选中节点id为空,请确认!"); throw new WTException("选中节点id为空,请确认!");
} }
Persistable per = null; Persistable per = null;
try { try {
per = CommonUtil.getPersistableByOid(id); per = CommonUtil.getPersistableByOid(id);
System.out.println(">>>selectedCheck begin......per:"+per);
} catch (Exception e) { } catch (Exception e) {
log.error("selectedCheck Get Per error...", e); log.error("selectedCheck Get Per error...", e);
} }
if (per == null) { if (per == null) {
System.out.println(">>>selectedCheck begin......per is null");
invalidIds.add(id); invalidIds.add(id);
continue; continue;
} }
if (per instanceof WTPart || per instanceof EPMDocument) { if (per instanceof WTPart || per instanceof EPMDocument) {
System.out.println(">>>selectedCheck begin......per ["+id+"] is WTPart or EPMDocument");
selectedNodes.add((WTObject) per); selectedNodes.add((WTObject) per);
} else { } else {
System.out.println(">>>selectedCheck begin......per ["+id+"] not is WTPart or EPMDocument");
invalidTypeIds.add(id); invalidTypeIds.add(id);
} }
} }
......
...@@ -6,5 +6,5 @@ import com.yonde.cadpro.checker.CADProChecker; ...@@ -6,5 +6,5 @@ import com.yonde.cadpro.checker.CADProChecker;
public interface CADProCheckerFactory { public interface CADProCheckerFactory {
public CADProChecker getChecker(); public CADProChecker getChecker();
} }
package com.yonde.cadpro.checker.impl; package com.yonde.cadpro.checker.impl;
import com.yonde.cadpro.CADProConstants;
import com.yonde.cadpro.checker.AbstractCADProChecker; import com.yonde.cadpro.checker.AbstractCADProChecker;
import com.yonde.cadpro.config.CADProConfigPropertiesUtil; import com.yonde.cadpro.config.CADProConfigPropertiesUtil;
import com.yonde.cadpro.util.CADProUtil; import com.yonde.cadpro.util.CADProUtil;
import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger;
import wt.fc.WTObject; import wt.fc.WTObject;
import wt.util.WTException; import wt.log4j.LogR;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.log4j.Logger;
import wt.log4j.LogR;
public class DICOpenChecker extends AbstractCADProChecker { public class DICOpenChecker extends AbstractCADProChecker {
...@@ -33,11 +30,11 @@ public class DICOpenChecker extends AbstractCADProChecker { ...@@ -33,11 +30,11 @@ public class DICOpenChecker extends AbstractCADProChecker {
} }
} }
if (invalidTypeObjs.size() > 0) { //if (invalidTypeObjs.size() > 0) {
throw new WTException( // throw new WTException(
"选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:" // "选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:"
+ StringUtils.join(invalidTypeObjs, CADProConstants.COMMA)); // + StringUtils.join(invalidTypeObjs, CADProConstants.COMMA));
} //}
return selectedNodes; 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;
}
}
...@@ -52,11 +52,11 @@ public class NewOpenChecker extends AbstractCADProChecker { ...@@ -52,11 +52,11 @@ public class NewOpenChecker extends AbstractCADProChecker {
} }
} }
if (invalidTypeObjs.size() > 0) { //if (invalidTypeObjs.size() > 0) {
throw new WTException( // throw new WTException(
"选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:" // "选中节点类型非法,仅支持[" + StringUtils.join(allowTypes, CADProConstants.COMMA) + "]:"
+ StringUtils.join(invalidTypeObjs, CADProConstants.COMMA)); // + StringUtils.join(invalidTypeObjs, CADProConstants.COMMA));
} //}
if (noModelObjs.size() > 0) { if (noModelObjs.size() > 0) {
throw new WTException( throw new WTException(
"选中节点未关联CAD模型:" + StringUtils.join(noModelObjs, CADProConstants.COMMA)); "选中节点未关联CAD模型:" + StringUtils.join(noModelObjs, CADProConstants.COMMA));
......
...@@ -17,7 +17,7 @@ public class CADProConfigPropertiesUtil implements RemoteAccess { ...@@ -17,7 +17,7 @@ public class CADProConfigPropertiesUtil implements RemoteAccess {
private static final Logger log = LogR.getLogger(CADProConfigPropertiesUtil.class.getName()); private static final Logger log = LogR.getLogger(CADProConfigPropertiesUtil.class.getName());
private static String CATIAINTE_CONFIG_URL = File.separator + "codebase" + File.separator private static String CATIAINTE_CONFIG_URL = File.separator + "codebase" + File.separator
+ "ext" + File.separator + "gace" + File.separator + "config" + File.separator + "com" + File.separator + "yonde" + File.separator + "config" + File.separator
+ "cadpro" + File.separator + "CADProConfig.properties"; + "cadpro" + File.separator + "CADProConfig.properties";
private static String CONFIG_OPEN_NEW_TYPES = "Open.NEW.Types"; private static String CONFIG_OPEN_NEW_TYPES = "Open.NEW.Types";
...@@ -129,6 +129,7 @@ public class CADProConfigPropertiesUtil implements RemoteAccess { ...@@ -129,6 +129,7 @@ public class CADProConfigPropertiesUtil implements RemoteAccess {
public static List<String> getDownloadStorageAsDsNumberTypes() throws Exception { public static List<String> getDownloadStorageAsDsNumberTypes() throws Exception {
List<String> tempTypes = new ArrayList<String>(); List<String> tempTypes = new ArrayList<String>();
//EBOM顶层结构,安装视图顶层件,主视图顶层件,DCI,FCI,LO,DS
String configValue = getValue(CONFIG_DOWNLOAD_STORAGE_DSNUMBER_TYPES); String configValue = getValue(CONFIG_DOWNLOAD_STORAGE_DSNUMBER_TYPES);
if (StringUtils.isNotBlank(configValue)) { if (StringUtils.isNotBlank(configValue)) {
configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA); configValue = configValue.replace(CADProConstants.COMMA_ZH, CADProConstants.COMMA);
......
...@@ -4,7 +4,7 @@ public enum CADProSettingTypeEnum { ...@@ -4,7 +4,7 @@ public enum CADProSettingTypeEnum {
Server(0), Server(0),
DesignTool(1); DesignTool(1);
private CADProSettingTypeEnum(int key) { private CADProSettingTypeEnum(int key) {
this.key = key; this.key = key;
} }
...@@ -18,5 +18,5 @@ public enum CADProSettingTypeEnum { ...@@ -18,5 +18,5 @@ public enum CADProSettingTypeEnum {
public void setKey(int key) { public void setKey(int key) {
this.key = key; this.key = key;
} }
} }
package com.yonde.cadpro.config;
/**
* Created on 2023/5/5 0005
* <p>
* * #For FTP Config
*
* @author
*/
public class CadFTPConfig {
public static final String HOST = "192.168.1.240";
public static final Integer PORT = 21;
public static final String USERNAME = "ftpuser";
public static final String PASSWORD = "Aa12345678!";
public static final String REMOTEPATH = "/";
public static final String ROOTPATH = "D:/Inetpub/ftproot";
}
...@@ -15,7 +15,7 @@ public class CatiaInteConfigPropertiesUtil implements RemoteAccess { ...@@ -15,7 +15,7 @@ public class CatiaInteConfigPropertiesUtil implements RemoteAccess {
private static final Logger LOGGER = LogR.getLogger(CLASSNAME); private static final Logger LOGGER = LogR.getLogger(CLASSNAME);
private static String CATIAINTE_CONFIG_URL = File.separator + "codebase" + File.separator private static String CATIAINTE_CONFIG_URL = File.separator + "codebase" + File.separator
+ "config" + File.separator + "yonde" + File.separator + "CatiaIntegration.properties"; + "com" + File.separator + "yonde" + File.separator + "config" + File.separator + "CatiaIntegration.properties";
private static String getValue(String key) throws Exception { private static String getValue(String key) throws Exception {
return StringUtils return StringUtils
......
...@@ -21,5 +21,5 @@ public class CatiaIntegrationAttrMapping { ...@@ -21,5 +21,5 @@ public class CatiaIntegrationAttrMapping {
} }
return mappingIBA; return mappingIBA;
} }
} }
...@@ -124,7 +124,7 @@ public class DxCADProSetting implements Comparable<DxCADProSetting> { ...@@ -124,7 +124,7 @@ public class DxCADProSetting implements Comparable<DxCADProSetting> {
public void setFtpSetting(DxCADProFTPSetting ftpSetting) { public void setFtpSetting(DxCADProFTPSetting ftpSetting) {
this.ftpSetting = ftpSetting; this.ftpSetting = ftpSetting;
} }
public String getCode() { public String getCode() {
return code; return code;
} }
......
...@@ -2,17 +2,18 @@ package com.yonde.cadpro.converter; ...@@ -2,17 +2,18 @@ package com.yonde.cadpro.converter;
import com.ptc.core.meta.common.TypeIdentifier; import com.ptc.core.meta.common.TypeIdentifier;
import com.ptc.core.meta.common.impl.TypeIdentifierUtilityHelper; import com.ptc.core.meta.common.impl.TypeIdentifierUtilityHelper;
import com.yonde.cadpro.CADProConstants;
import com.yonde.cadpro.bean.DxPartModelBomVo; import com.yonde.cadpro.bean.DxPartModelBomVo;
import com.yonde.cadpro.util.CadPartUtil;
import com.yonde.cadpro.util.DxPartModelBomVoCompator; import com.yonde.cadpro.util.DxPartModelBomVoCompator;
import com.yonde.cadpro.util.EPMUtil; import com.yonde.cadpro.util.EPMUtil;
import com.yonde.cadpro.util.PartUtil;
import com.yonde.common.util.TypeAttrUtil; import com.yonde.common.util.TypeAttrUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.apache.log4j.Logger;
import org.slf4j.LoggerFactory;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.fc.Persistable; import wt.fc.Persistable;
import wt.fc.collections.WTArrayList; import wt.fc.collections.WTArrayList;
import wt.log4j.LogR;
import wt.part.*; import wt.part.*;
import wt.util.WTException; import wt.util.WTException;
import wt.vc.config.ConfigSpec; import wt.vc.config.ConfigSpec;
...@@ -24,7 +25,7 @@ import java.util.ListIterator; ...@@ -24,7 +25,7 @@ import java.util.ListIterator;
import java.util.Set; import java.util.Set;
public class DxPartModelBomVoConverter { public class DxPartModelBomVoConverter {
private static Logger log = LoggerFactory.getLogger(DxPartModelBomVoConverter.class); private static final Logger log = LogR.getLogger(DxPartModelBomVoConverter.class.getName());
//private static String DEFALUT_POSITION_INFO = "1;0;0;0;0;1;0;0;0;0;1;0;0;0;0;1"; //private static String DEFALUT_POSITION_INFO = "1;0;0;0;0;1;0;0;0;0;1;0;0;0;0;1";
private DxPartModelBomVo dxPartModelBomVo = null; private DxPartModelBomVo dxPartModelBomVo = null;
...@@ -71,12 +72,13 @@ public class DxPartModelBomVoConverter { ...@@ -71,12 +72,13 @@ public class DxPartModelBomVoConverter {
* @throws WTException * @throws WTException
*/ */
private void inintialConfigSpec() throws WTException { private void inintialConfigSpec() throws WTException {
System.out.println(">>>>inintialConfigSpec start......");
if (partConfigSpec == null) { if (partConfigSpec == null) {
WTPartStandardConfigSpec partStandardConfigSpec = WTPartStandardConfigSpec WTPartStandardConfigSpec partStandardConfigSpec = WTPartStandardConfigSpec
.newWTPartStandardConfigSpec(); .newWTPartStandardConfigSpec();
try { try {
partStandardConfigSpec partStandardConfigSpec
.setView(ViewHelper.service.getView("Design")); .setView(ViewHelper.service.getView(CADProConstants.VIEW_DESIGN));
partConfigSpec = partStandardConfigSpec; partConfigSpec = partStandardConfigSpec;
} catch (Exception e) { } catch (Exception e) {
log.error("Set View error for WTPartStandardConfigSpec... ", e); log.error("Set View error for WTPartStandardConfigSpec... ", e);
...@@ -86,6 +88,8 @@ public class DxPartModelBomVoConverter { ...@@ -86,6 +88,8 @@ public class DxPartModelBomVoConverter {
} }
private void initialDxPartModelBomVo() throws Exception { private void initialDxPartModelBomVo() throws Exception {
System.out.println(">>>>initialDxPartModelBomVo start......");
if (wtPart == null && epm == null) { if (wtPart == null && epm == null) {
throw new WTException("零部件和数模不能同时为空"); throw new WTException("零部件和数模不能同时为空");
} }
...@@ -110,7 +114,7 @@ public class DxPartModelBomVoConverter { ...@@ -110,7 +114,7 @@ public class DxPartModelBomVoConverter {
if (StringUtils.isBlank(bomPath)) { if (StringUtils.isBlank(bomPath)) {
bomPath = partNumber; bomPath = partNumber;
} }
bomPath = PartUtil.appendPathSuffixPrefix(bomPath); bomPath = CadPartUtil.appendPathSuffixPrefix(bomPath);
String partTypeDisplay = ""; String partTypeDisplay = "";
try { try {
...@@ -213,24 +217,24 @@ public class DxPartModelBomVoConverter { ...@@ -213,24 +217,24 @@ public class DxPartModelBomVoConverter {
// } // }
// } // }
//if (goFlag) {//继续遍历 //if (goFlag) {//继续遍历
DxPartModelBomVoConverter mbiConverter = new DxPartModelBomVoConverter( DxPartModelBomVoConverter mbiConverter = new DxPartModelBomVoConverter(
childPart, partConfigSpec, needChildren, needModelFileUrl, childPart, partConfigSpec, needChildren, needModelFileUrl,
totalLevel, nextLevel, endRecursionTypes, needEffFilter, totalLevel, nextLevel, endRecursionTypes, needEffFilter,
childBOMPath, toLOBOMPaths, singleEffTopBaselineConfig); childBOMPath, toLOBOMPaths, singleEffTopBaselineConfig);
DxPartModelBomVo childMbi = mbiConverter.getDxPartModelBomVo(); DxPartModelBomVo childMbi = mbiConverter.getDxPartModelBomVo();
if (childMbi != null) { if (childMbi != null) {
children.add(childMbi); children.add(childMbi);
} }
// } // }
} else { } else {
log.error(" per{} is not WTPart, ignore... ", per); log.error(" per"+per+" is not WTPart, ignore... ");
} }
} }
} }
} }
private boolean hasChildren(WTPart wtPart) throws Exception { private boolean hasChildren(WTPart wtPart) throws Exception {
log.debug("hasChildren by {}", wtPart.getDisplayIdentifier()); log.debug("hasChildren by "+ wtPart.getDisplayIdentifier());
boolean hasChildren = false; boolean hasChildren = false;
ConfigSpec cs = partConfigSpec; ConfigSpec cs = partConfigSpec;
boolean bomPathFiler = false; boolean bomPathFiler = false;
...@@ -284,11 +288,11 @@ public class DxPartModelBomVoConverter { ...@@ -284,11 +288,11 @@ public class DxPartModelBomVoConverter {
// hasChildren = true; // hasChildren = true;
// } // }
// } else { // } else {
hasChildren = true; hasChildren = true;
// } // }
} }
} else { } else {
log.error(" per{} is not WTPart, ignore... ", per); log.error(" per{"+per+"} is not WTPart, ignore... ");
} }
if (hasChildren) { if (hasChildren) {
break; break;
...@@ -320,7 +324,7 @@ public class DxPartModelBomVoConverter { ...@@ -320,7 +324,7 @@ public class DxPartModelBomVoConverter {
WTPartMaster partMaster = (WTPartMaster) usageLink.getUses(); WTPartMaster partMaster = (WTPartMaster) usageLink.getUses();
log.debug(" partMaster : " + partMaster); log.debug(" partMaster : " + partMaster);
if (partMaster != null) { if (partMaster != null) {
WTPart childPart = PartUtil.getLatestPart(partMaster.getNumber(), WTPart childPart = CadPartUtil.getLatestPart(partMaster.getNumber(),
"Design"); "Design");
if (childPart != null) { if (childPart != null) {
hasChildren = true; hasChildren = true;
......
...@@ -8,26 +8,28 @@ import com.yonde.cadpro.download.impl.ClientModelPathAsDSRule; ...@@ -8,26 +8,28 @@ import com.yonde.cadpro.download.impl.ClientModelPathAsDSRule;
import com.yonde.cadpro.download.impl.ClientModelPathAsParentRule; import com.yonde.cadpro.download.impl.ClientModelPathAsParentRule;
import com.yonde.common.util.TypeAttrUtil; import com.yonde.common.util.TypeAttrUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger; import org.apache.log4j.Logger;
import org.slf4j.LoggerFactory;
import wt.fc.WTObject; import wt.fc.WTObject;
import wt.log4j.LogR;
import wt.part.WTPart; import wt.part.WTPart;
import java.util.List; import java.util.List;
public class ClientModelPathRuleFactory { public class ClientModelPathRuleFactory {
private static final Logger log = LoggerFactory.getLogger(ClientModelPathRuleFactory.class); private static final Logger log = LogR.getLogger(ClientModelPathRuleFactory.class.getName());
public static ClientModelPathRule getRule(OpenModelFilesCondition.OpenModelType openModelType, WTPart part, public static ClientModelPathRule getRule(OpenModelFilesCondition.OpenModelType openModelType, WTPart part,
String parentPath) throws Exception { String parentPath) throws Exception {
log.debug("getRule param {},{},{}", openModelType, part, parentPath); log.debug("getRule param"+ openModelType+","+ part+","+ parentPath);
if (OpenModelFilesCondition.OpenModelType.INSERT.equals(openModelType)) {//插入 if (OpenModelFilesCondition.OpenModelType.INSERT.equals(openModelType)) {//插入
log.debug("IS INSERT "); log.debug("IS INSERT ");
parentPath = StringUtils.trimToEmpty(parentPath); parentPath = StringUtils.trimToEmpty(parentPath);
return new ClientModelPathAsParentRule(parentPath); return new ClientModelPathAsParentRule(parentPath);
} else { } else {
//EBOM顶层结构,安装视图顶层件,主视图顶层件,DCI,FCI,LO,DS
List<String> numberTypes = CADProConfigPropertiesUtil List<String> numberTypes = CADProConfigPropertiesUtil
.getDownloadStorageAsDsNumberTypes(); .getDownloadStorageAsDsNumberTypes();
//自制件,标准件,机载设备
List<String> tempTypes = CADProConfigPropertiesUtil.getDownloadStorageTempTypes(); List<String> tempTypes = CADProConfigPropertiesUtil.getDownloadStorageTempTypes();
log.debug("numberTypes : " + numberTypes); log.debug("numberTypes : " + numberTypes);
log.debug("tempTypes : " + tempTypes); log.debug("tempTypes : " + tempTypes);
......
...@@ -15,8 +15,8 @@ public class ClientModelPathAsDSRule implements ClientModelPathRule { ...@@ -15,8 +15,8 @@ public class ClientModelPathAsDSRule implements ClientModelPathRule {
public ClientModelPathAsDSRule(WTPart wtPart) throws WTException { public ClientModelPathAsDSRule(WTPart wtPart) throws WTException {
//if (PartUtil.isDS(wtPart)) { //if (PartUtil.isDS(wtPart)) {
this.dsPart = wtPart; this.dsPart = wtPart;
// } // }
} }
@Override @Override
......
...@@ -8,10 +8,8 @@ import com.yonde.cadpro.checker.factory.DICOpenCheckerFactory; ...@@ -8,10 +8,8 @@ import com.yonde.cadpro.checker.factory.DICOpenCheckerFactory;
import com.yonde.cadpro.download.CADProDownloader; import com.yonde.cadpro.download.CADProDownloader;
import com.yonde.cadpro.download.ClientModelPathRule; import com.yonde.cadpro.download.ClientModelPathRule;
import com.yonde.cadpro.download.factroy.ClientModelPathRuleFactory; import com.yonde.cadpro.download.factroy.ClientModelPathRuleFactory;
import com.yonde.cadpro.util.CadPartUtil;
import com.yonde.cadpro.util.EPMUtil; import com.yonde.cadpro.util.EPMUtil;
import com.yonde.cadpro.util.PartUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.fc.QueryResult; import wt.fc.QueryResult;
import wt.fc.WTObject; import wt.fc.WTObject;
...@@ -23,7 +21,6 @@ import java.util.List; ...@@ -23,7 +21,6 @@ import java.util.List;
public class DICDownloader implements CADProDownloader { public class DICDownloader implements CADProDownloader {
private static final Logger log = LoggerFactory.getLogger(DICDownloader.class);
@Override @Override
public List<WTObject> check(List<String> ids) throws Exception { public List<WTObject> check(List<String> ids) throws Exception {
...@@ -34,7 +31,7 @@ public class DICDownloader implements CADProDownloader { ...@@ -34,7 +31,7 @@ public class DICDownloader implements CADProDownloader {
@Override @Override
public List<DxModelFile> download(List<WTObject> selectedNodes, public List<DxModelFile> download(List<WTObject> selectedNodes,
String parentPath) throws Exception { String parentPath) throws Exception {
log.debug("DICDownloader download param {},{}", selectedNodes); System.out.println("DICDownloader download param "+selectedNodes );
ArrayList<DxModelFile> modelFiles = new ArrayList<DxModelFile>(); ArrayList<DxModelFile> modelFiles = new ArrayList<DxModelFile>();
ArrayList<String> processedObjs = new ArrayList<String>(); ArrayList<String> processedObjs = new ArrayList<String>();
...@@ -69,19 +66,19 @@ public class DICDownloader implements CADProDownloader { ...@@ -69,19 +66,19 @@ public class DICDownloader implements CADProDownloader {
if (part == null) { if (part == null) {
throw new WTException("零部件不能为空"); throw new WTException("零部件不能为空");
} }
log.debug("process part[" + part.getDisplayIdentity() + "]..."); System.out.println("process part[" + part.getDisplayIdentity() + "]...");
//if (pathRule == null) {
// throw new WTException("此操作场景暂不支持");
//}
if (pathRule == null) {
throw new WTException("此操作场景暂不支持");
}
String relativePath = pathRule.getPath(); String relativePath = pathRule.getPath();
log.debug("relativePath : " + relativePath); System.out.println("relativePath : " + relativePath);
String processedKey = part.getPersistInfo().getObjectIdentifier().getId() + "___" String processedKey = part.getPersistInfo().getObjectIdentifier().getId() + "___"
+ relativePath; + relativePath;
if (processedObjs.contains(processedKey)) { if (processedObjs.contains(processedKey)) {
log.debug("partId[" + part.getDisplayIdentity() + "] has been processed..."); System.out.println("partId[" + part.getDisplayIdentity() + "] has been processed...");
return; return;
} }
processedObjs.add(processedKey); processedObjs.add(processedKey);
...@@ -93,7 +90,7 @@ public class DICDownloader implements CADProDownloader { ...@@ -93,7 +90,7 @@ public class DICDownloader implements CADProDownloader {
modelFiles.add(modelFile); modelFiles.add(modelFile);
} }
QueryResult qr = PartUtil.getSubParts(part, QueryResult qr = CadPartUtil.getSubParts(part,
CADProConstants.designViewConfig,false); CADProConstants.designViewConfig,false);
while (qr.hasMoreElements()) { while (qr.hasMoreElements()) {
WTPart childPart = (WTPart) qr.nextElement(); WTPart childPart = (WTPart) qr.nextElement();
......
package com.yonde.cadpro.download.impl;
import com.yonde.cadpro.checker.CADProChecker;
import com.yonde.cadpro.checker.factory.DICOpenCheckerFactory;
import com.yonde.cadpro.util.EPMUtil;
import com.yonde.cadpro.util.PartUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wt.epm.EPMDocument;
import wt.fc.QueryResult;
import wt.fc.WTObject;
import wt.part.WTPart;
import wt.part.WTPartConfigSpec;
import wt.part.WTPartStandardConfigSpec;
import wt.util.WTException;
import wt.vc.views.ViewHelper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class InDICDSLOFinder {
private static final Logger log = LoggerFactory.getLogger(InDICDSLOFinder.class);
public List<WTObject> check(List<String> ids) throws Exception {
CADProChecker cadProChecker = new DICOpenCheckerFactory().getChecker();
return cadProChecker.check(ids);
}
public Map<String, String> find(List<WTObject> selectedNodes )
throws Exception {
log.debug("InDICParentFinder find param {},{}", selectedNodes);
Map<String, String> dsLOMap = new HashMap<String, String>();
List<WTPart> processedObjs = new ArrayList<WTPart>();
for (WTObject wtObject : selectedNodes) {
WTPart rootPart = null;
if (wtObject instanceof WTPart) {
rootPart = (WTPart) wtObject;
} else if (wtObject instanceof EPMDocument) {
EPMDocument epm = (EPMDocument) wtObject;
rootPart = EPMUtil.getLatestBuidTarget(epm);
}
collectDSLORelation(null, rootPart, dsLOMap, processedObjs);
}
return dsLOMap;
}
public void collectDSLORelation(WTPart parentPart, WTPart part,
Map<String, String> dsLOMap, List<WTPart> processedObjs) throws Exception {
if (part == null) {
throw new WTException("零部件不能为空");
}
log.debug("process part[" + part.getDisplayIdentity() + "]...");
if (processedObjs.contains(part)) {
log.debug("part[" + part.getDisplayIdentity() + "] has been processed...");
return;
}
processedObjs.add(part);
// if (PartUtil.isDS(part)) {
// WTPart lo = null;
// if (parentPart == null) {
// lo = CollectionUtil.getFirst(PartUtil.getParentPart(part));
// } else {
// lo = parentPart;
// }
// EPMDocument epmDoc = EPMUtil.getAssociatedEPM(part);
// if (epmDoc != null) {
// String dsModelNumber = epmDoc.getCADName();
// if (lo != null) {
// dsLOMap.put(dsModelNumber, CADProConstants.DIC_PREFIX + lo.getNumber());
// } else {
// dsLOMap.put(dsModelNumber, "");
// }
// }
// } else {
//WTPartConfigSpec.newWTPartConfigSpec(WTPartStandardConfigSpec.newWTPartStandardConfigSpec(designView, null));
QueryResult qr = PartUtil.getSubParts(part,
WTPartConfigSpec.newWTPartConfigSpec(WTPartStandardConfigSpec.newWTPartStandardConfigSpec(ViewHelper.service.getView("Design"), null)),false);
while (qr.hasMoreElements()) {
WTPart childPart = (WTPart) qr.nextElement();
collectDSLORelation(part, childPart, dsLOMap, processedObjs);
}
}
}
...@@ -8,10 +8,8 @@ import com.yonde.cadpro.checker.factory.NewOpenCheckerFactory; ...@@ -8,10 +8,8 @@ import com.yonde.cadpro.checker.factory.NewOpenCheckerFactory;
import com.yonde.cadpro.download.CADProDownloader; import com.yonde.cadpro.download.CADProDownloader;
import com.yonde.cadpro.download.ClientModelPathRule; import com.yonde.cadpro.download.ClientModelPathRule;
import com.yonde.cadpro.download.factroy.ClientModelPathRuleFactory; import com.yonde.cadpro.download.factroy.ClientModelPathRuleFactory;
import com.yonde.cadpro.util.CadPartUtil;
import com.yonde.cadpro.util.EPMUtil; import com.yonde.cadpro.util.EPMUtil;
import com.yonde.cadpro.util.PartUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.fc.QueryResult; import wt.fc.QueryResult;
import wt.fc.WTObject; import wt.fc.WTObject;
...@@ -22,9 +20,7 @@ import java.util.ArrayList; ...@@ -22,9 +20,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class InsertDownloader implements CADProDownloader { public class InsertDownloader implements CADProDownloader {
private static final Logger log = LoggerFactory.getLogger(InsertDownloader.class);
@Override @Override
public List<WTObject> check(List<String> ids) throws Exception { public List<WTObject> check(List<String> ids) throws Exception {
CADProChecker cadProChecker = new NewOpenCheckerFactory().getChecker(); CADProChecker cadProChecker = new NewOpenCheckerFactory().getChecker();
...@@ -36,15 +32,14 @@ public class InsertDownloader implements CADProDownloader { ...@@ -36,15 +32,14 @@ public class InsertDownloader implements CADProDownloader {
* 1. 以选中根节点遍历收集所有模型文件 * 1. 以选中根节点遍历收集所有模型文件
* 2. 模型客户端存储路径基于入参 * 2. 模型客户端存储路径基于入参
* 3. 忽略有效性参数 * 3. 忽略有效性参数
* *
*/ */
@Override @Override
public List<DxModelFile> download(List<WTObject> selectedNodes, public List<DxModelFile> download(List<WTObject> selectedNodes,
String parentPath) throws Exception { String parentPath) throws Exception {
log.debug("InsertDownloader download param {},{}", selectedNodes); System.out.println("InsertDownloader download param "+selectedNodes );
ClientModelPathRule pathRule = ClientModelPathRuleFactory.getRule(OpenModelFilesCondition.OpenModelType.INSERT, ClientModelPathRule pathRule = ClientModelPathRuleFactory.getRule(OpenModelFilesCondition.OpenModelType.INSERT, null, parentPath);
null, parentPath);
ArrayList<DxModelFile> modelFiles = new ArrayList<DxModelFile>(); ArrayList<DxModelFile> modelFiles = new ArrayList<DxModelFile>();
ArrayList<String> processedObjs = new ArrayList<String>(); ArrayList<String> processedObjs = new ArrayList<String>();
for (WTObject wtObject : selectedNodes) { for (WTObject wtObject : selectedNodes) {
...@@ -58,7 +53,7 @@ public class InsertDownloader implements CADProDownloader { ...@@ -58,7 +53,7 @@ public class InsertDownloader implements CADProDownloader {
collectModelFilesByPartBOM(rootPart, pathRule, true, modelFiles, collectModelFilesByPartBOM(rootPart, pathRule, true, modelFiles,
processedObjs); processedObjs);
} }
//log.debug("modelFiles:" + modelFiles); //System.out.println("modelFiles:" + modelFiles);
return modelFiles; return modelFiles;
} }
...@@ -69,19 +64,19 @@ public class InsertDownloader implements CADProDownloader { ...@@ -69,19 +64,19 @@ public class InsertDownloader implements CADProDownloader {
if (part == null) { if (part == null) {
throw new WTException("零部件不能为空"); throw new WTException("零部件不能为空");
} }
log.debug("process part[" + part.getDisplayIdentity() + "]..."); System.out.println("process part[" + part.getDisplayIdentity() + "]...");
if (pathRule == null) { //if (pathRule == null) {
throw new WTException("此操作场景暂不支持,请确认"); // throw new WTException("此操作场景暂不支持,请确认");
} //}
String relativePath = pathRule.getPath(); String relativePath = pathRule.getPath();
log.debug("relativePath : " + relativePath); System.out.println("relativePath : " + relativePath);
String processedKey = part.getPersistInfo().getObjectIdentifier().getId() + "___" String processedKey = part.getPersistInfo().getObjectIdentifier().getId() + "___"
+ relativePath; + relativePath;
if (processedObjs.contains(processedKey)) { if (processedObjs.contains(processedKey)) {
log.debug("partId[" + part.getDisplayIdentity() + "] has been processed..."); System.out.println("partId[" + part.getDisplayIdentity() + "] has been processed...");
return; return;
} }
processedObjs.add(processedKey); processedObjs.add(processedKey);
...@@ -93,7 +88,7 @@ public class InsertDownloader implements CADProDownloader { ...@@ -93,7 +88,7 @@ public class InsertDownloader implements CADProDownloader {
modelFiles.add(modelFile); modelFiles.add(modelFile);
} }
QueryResult qr = PartUtil.getSubParts(part, CADProConstants.designViewConfig,false); QueryResult qr = CadPartUtil.getSubParts(part, CADProConstants.designViewConfig,false);
while (qr.hasMoreElements()) { while (qr.hasMoreElements()) {
WTPart childPart = (WTPart) qr.nextElement(); WTPart childPart = (WTPart) qr.nextElement();
// if (ext.gace.service.ebom.util.PartUtil.isLO(childPart)) {//LO校验有效性 // if (ext.gace.service.ebom.util.PartUtil.isLO(childPart)) {//LO校验有效性
...@@ -103,7 +98,7 @@ public class InsertDownloader implements CADProDownloader { ...@@ -103,7 +98,7 @@ public class InsertDownloader implements CADProDownloader {
// collectModelFilesByPartBOM(childPart, effFilter, pathRule, false, // collectModelFilesByPartBOM(childPart, effFilter, pathRule, false,
// modelFiles, processedObjs); // modelFiles, processedObjs);
// } else { // } else {
// log.debug("LO{}-Eff{} is invalid by {}", childPart.getDisplayIdentity(), // System.out.println("LO{}-Eff{} is invalid by {}", childPart.getDisplayIdentity(),
// effValue, effFilter); // effValue, effFilter);
// } // }
// } else {//目标有效性为空 // } else {//目标有效性为空
...@@ -111,10 +106,10 @@ public class InsertDownloader implements CADProDownloader { ...@@ -111,10 +106,10 @@ public class InsertDownloader implements CADProDownloader {
// processedObjs); // processedObjs);
// } // }
// } // }
// else { // else {
collectModelFilesByPartBOM(childPart, pathRule, false, modelFiles, collectModelFilesByPartBOM(childPart, pathRule, false, modelFiles,
processedObjs); processedObjs);
// } // }
} }
} }
......
...@@ -8,10 +8,8 @@ import com.yonde.cadpro.checker.factory.NewOpenCheckerFactory; ...@@ -8,10 +8,8 @@ import com.yonde.cadpro.checker.factory.NewOpenCheckerFactory;
import com.yonde.cadpro.download.CADProDownloader; import com.yonde.cadpro.download.CADProDownloader;
import com.yonde.cadpro.download.ClientModelPathRule; import com.yonde.cadpro.download.ClientModelPathRule;
import com.yonde.cadpro.download.factroy.ClientModelPathRuleFactory; import com.yonde.cadpro.download.factroy.ClientModelPathRuleFactory;
import com.yonde.cadpro.util.CadPartUtil;
import com.yonde.cadpro.util.EPMUtil; import com.yonde.cadpro.util.EPMUtil;
import com.yonde.cadpro.util.PartUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import wt.epm.EPMDocument; import wt.epm.EPMDocument;
import wt.fc.QueryResult; import wt.fc.QueryResult;
import wt.fc.WTObject; import wt.fc.WTObject;
...@@ -22,9 +20,7 @@ import java.util.ArrayList; ...@@ -22,9 +20,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class NewDownloader implements CADProDownloader { public class NewDownloader implements CADProDownloader {
private static final Logger log = LoggerFactory.getLogger(NewDownloader.class);
@Override @Override
public List<WTObject> check(List<String> ids) throws Exception { public List<WTObject> check(List<String> ids) throws Exception {
CADProChecker cadProChecker = new NewOpenCheckerFactory().getChecker(); CADProChecker cadProChecker = new NewOpenCheckerFactory().getChecker();
...@@ -33,16 +29,16 @@ public class NewDownloader implements CADProDownloader { ...@@ -33,16 +29,16 @@ public class NewDownloader implements CADProDownloader {
/** /**
* 新窗口下载 * 新窗口下载
* *
* 1. 以选中根节点遍历收集所有模型文件 * 1. 以选中根节点遍历收集所有模型文件
* 2. 模型客户端存储路径基于配置文件获取 * 2. 模型客户端存储路径基于配置文件获取
* 3. 忽略有效性参数 * 3. 忽略有效性参数
* *
*/ */
@Override @Override
public List<DxModelFile> download(List<WTObject> selectedNodes, public List<DxModelFile> download(List<WTObject> selectedNodes,
String parentPath) throws Exception { String parentPath) throws Exception {
log.debug("NewDownloader download param {},{}", selectedNodes); System.out.println("NewDownloader download param "+selectedNodes);
WTObject wtObject = selectedNodes.get(0);//新窗口打开仅一个根节点 WTObject wtObject = selectedNodes.get(0);//新窗口打开仅一个根节点
WTPart rootPart = null; WTPart rootPart = null;
...@@ -57,7 +53,7 @@ public class NewDownloader implements CADProDownloader { ...@@ -57,7 +53,7 @@ public class NewDownloader implements CADProDownloader {
ArrayList<DxModelFile> modelFiles = new ArrayList<DxModelFile>(); ArrayList<DxModelFile> modelFiles = new ArrayList<DxModelFile>();
ArrayList<String> processedObjs = new ArrayList<String>(); ArrayList<String> processedObjs = new ArrayList<String>();
collectModelFilesByPartBOM(rootPart, pathRule, true, modelFiles, processedObjs); collectModelFilesByPartBOM(rootPart, pathRule, true, modelFiles, processedObjs);
//log.debug("modelFiles:" + modelFiles); //System.out.println("modelFiles:" + modelFiles);
return modelFiles; return modelFiles;
} }
...@@ -68,18 +64,18 @@ public class NewDownloader implements CADProDownloader { ...@@ -68,18 +64,18 @@ public class NewDownloader implements CADProDownloader {
if (part == null) { if (part == null) {
throw new WTException("零部件不能为空"); throw new WTException("零部件不能为空");
} }
log.debug("process part[" + part.getDisplayIdentity() + "]..."); System.out.println("process part[" + part.getDisplayIdentity() + "]...");
if (pathRule == null) { //if (pathRule == null) {
throw new WTException("此操作场景暂不支持"); // throw new WTException("此操作场景暂不支持");
} //}
String relativePath = pathRule.getPath(); String relativePath = pathRule.getPath();
log.debug("relativePath : " + relativePath); System.out.println("relativePath : " + relativePath);
String processedKey = part.getPersistInfo().getObjectIdentifier().getId() + "___" String processedKey = part.getPersistInfo().getObjectIdentifier().getId() + "___"
+ relativePath; + relativePath;
if (processedObjs.contains(processedKey)) { if (processedObjs.contains(processedKey)) {
log.debug("partId[" + part.getDisplayIdentity() + "] has been processed..."); System.out.println("partId[" + part.getDisplayIdentity() + "] has been processed...");
return; return;
} }
processedObjs.add(processedKey); processedObjs.add(processedKey);
...@@ -91,7 +87,7 @@ public class NewDownloader implements CADProDownloader { ...@@ -91,7 +87,7 @@ public class NewDownloader implements CADProDownloader {
modelFiles.add(modelFile); modelFiles.add(modelFile);
} }
QueryResult qr = PartUtil.getSubParts(part, CADProConstants.designViewConfig,false); QueryResult qr = CadPartUtil.getSubParts(part, CADProConstants.designViewConfig,false);
while (qr.hasMoreElements()) { while (qr.hasMoreElements()) {
WTPart childPart = (WTPart) qr.nextElement(); WTPart childPart = (WTPart) qr.nextElement();
// if (ext.gace.service.ebom.util.PartUtil.isLO(childPart)) {//LO校验有效性 // if (ext.gace.service.ebom.util.PartUtil.isLO(childPart)) {//LO校验有效性
...@@ -101,7 +97,7 @@ public class NewDownloader implements CADProDownloader { ...@@ -101,7 +97,7 @@ public class NewDownloader implements CADProDownloader {
// collectModelFilesByPartBOM(childPart, effFilter, pathRule, false, // collectModelFilesByPartBOM(childPart, effFilter, pathRule, false,
// modelFiles, processedObjs); // modelFiles, processedObjs);
// } else { // } else {
// log.debug("LO{}-Eff{} is invalid by {}", childPart.getDisplayIdentity(), // System.out.println("LO{}-Eff{} is invalid by {}", childPart.getDisplayIdentity(),
// effValue, effFilter); // effValue, effFilter);
// } // }
// } // }
...@@ -110,10 +106,10 @@ public class NewDownloader implements CADProDownloader { ...@@ -110,10 +106,10 @@ public class NewDownloader implements CADProDownloader {
// processedObjs); // processedObjs);
// } // }
// } // }
// else { // else {
collectModelFilesByPartBOM(childPart, pathRule, false, modelFiles, collectModelFilesByPartBOM(childPart, pathRule, false, modelFiles,
processedObjs); processedObjs);
// } // }
} }
} }
......
This diff is collapsed.
...@@ -82,7 +82,7 @@ public class ArithUtil { ...@@ -82,7 +82,7 @@ public class ArithUtil {
* 提供(相对)精确的除非运算,当发生除不尽的情况时,由scale参数指定精度,以后的数字四舍五入 * 提供(相对)精确的除非运算,当发生除不尽的情况时,由scale参数指定精度,以后的数字四舍五入
* @param v1 * @param v1
* @param v2 * @param v2
* @return * @return
*/ */
public static double div(double v1, double v2) { public static double div(double v1, double v2) {
return div(v1, v2, DEF_SCALE); return div(v1, v2, DEF_SCALE);
...@@ -142,7 +142,7 @@ public class ArithUtil { ...@@ -142,7 +142,7 @@ public class ArithUtil {
} }
return transferDouble; return transferDouble;
} }
public static String doubleToString(double inputDouble) { public static String doubleToString(double inputDouble) {
String out = "0"; String out = "0";
try { try {
......
package com.yonde.cadpro.util;
import com.yonde.cadpro.CADProConstants;
import sun.misc.BASE64Decoder;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* Created on 2023/5/8 0008
*
* @author
*/
public class Base64Util {
/**
* jdk1.6解密basic`认证
*
* @param basic
* @return
*/
public static String decode(String basic) throws IOException {
byte[] decodeResult = new BASE64Decoder().decodeBuffer(basic);
System.out.println(new String(decodeResult));
return new String(decodeResult);
}
/**
* jdk1.6解密basic`认证
*
* @param request
* @return
*/
public static String decode(HttpServletRequest request) throws IOException {
String auth = request.getHeader(CADProConstants.AUTHORIZATION);
System.out.println(">>>auth:" + auth);
auth = auth.replace(CADProConstants.BASIC, "");
return decode(auth);
}
/**
* 拆分basic明文信息 获取用户名称
*/
public static String decodeForUserName(HttpServletRequest request) throws IOException {
String[] split =decode(request).split(":");
return split[0];
}
}
...@@ -6,6 +6,7 @@ import com.ptc.core.meta.type.mgmt.server.impl.TypeDomainHelper; ...@@ -6,6 +6,7 @@ import com.ptc.core.meta.type.mgmt.server.impl.TypeDomainHelper;
import com.yonde.cadpro.CADProConstants; import com.yonde.cadpro.CADProConstants;
import com.yonde.common.CommonUtil; import com.yonde.common.CommonUtil;
import com.yonde.common.IBAUtil; import com.yonde.common.IBAUtil;
import com.yonde.common.PartUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import wt.doc.WTDocument; import wt.doc.WTDocument;
...@@ -250,7 +251,7 @@ public class CADDocumentUtil { ...@@ -250,7 +251,7 @@ public class CADDocumentUtil {
objMBAs.put("Name", name); objMBAs.put("Name", name);
// ContainerProvider containerProvider = new ContainerProviderImpl(); // ContainerProvider containerProvider = new ContainerProviderImpl();
WTContainer wtContainer=null; WTContainer wtContainer=null;
WTPart part = PartUtil.getLatestPart(number, CADProConstants.VIEW_DESIGN);//containerProvider.getAssignedContainer(subTypeName, EPMDocument.class, attsValueMap, (String[])null); WTPart part = CadPartUtil.getLatestPart(number, CADProConstants.VIEW_DESIGN);//containerProvider.getAssignedContainer(subTypeName, EPMDocument.class, attsValueMap, (String[])null);
if(part!=null){ if(part!=null){
wtContainer = part.getContainer(); wtContainer = part.getContainer();
...@@ -266,7 +267,7 @@ public class CADDocumentUtil { ...@@ -266,7 +267,7 @@ public class CADDocumentUtil {
wtContainer = (WTContainer)PersistenceHelper.manager.refresh(wtContainer); wtContainer = (WTContainer)PersistenceHelper.manager.refresh(wtContainer);
WTContainerRef wtContainerRef = WTContainerRef.newWTContainerRef(wtContainer); WTContainerRef wtContainerRef = WTContainerRef.newWTContainerRef(wtContainer);
String folder = part.getFolderPath(); String folder = part.getFolderPath();
// FolderPathProviderImpl fpProvider; // FolderPathProviderImpl fpProvider;
// if (StringUtils.isBlank(epmtFolder)) { // if (StringUtils.isBlank(epmtFolder)) {
// fpProvider = new FolderPathProviderImpl(); // fpProvider = new FolderPathProviderImpl();
// folder = fpProvider.getAssignedFolderPath(subTypeName, EPMDocument.class, objMBAs, attsValueMap, (String[])null); // folder = fpProvider.getAssignedFolderPath(subTypeName, EPMDocument.class, objMBAs, attsValueMap, (String[])null);
...@@ -760,7 +761,7 @@ public class CADDocumentUtil { ...@@ -760,7 +761,7 @@ public class CADDocumentUtil {
} }
String cadStructureKey = cadStructureBuilder.toString(); String cadStructureKey = cadStructureBuilder.toString();
// AssembleTransformSnapshot snapshot = getAssembleTransformSnapshotByStructure(cadStructureKey, parentEPM); // AssembleTransformSnapshot snapshot = getAssembleTransformSnapshotByStructure(cadStructureKey, parentEPM);
// if (snapshot == null) { // if (snapshot == null) {
// log.error("parentEPM[" + parentEPM + "] with[" + configspec + "] can't find AssembleTransformSnapshot....."); // log.error("parentEPM[" + parentEPM + "] with[" + configspec + "] can't find AssembleTransformSnapshot.....");
// } else { // } else {
......
...@@ -44,7 +44,7 @@ public class CADProUtil { ...@@ -44,7 +44,7 @@ public class CADProUtil {
/** /**
* 自动处理图号适配件号 * 自动处理图号适配件号
* *
* @param numbers * @param numbers
*/ */
public static List<String> mergePartNumsByModelNums(List<String> numbers) { public static List<String> mergePartNumsByModelNums(List<String> numbers) {
...@@ -89,7 +89,7 @@ public class CADProUtil { ...@@ -89,7 +89,7 @@ public class CADProUtil {
/** /**
* 遍历BOM,下载CAD内容 * 遍历BOM,下载CAD内容
* *
* @param part * @param part
* @param epm * @param epm
* @param tmpPath * @param tmpPath
...@@ -209,7 +209,7 @@ public class CADProUtil { ...@@ -209,7 +209,7 @@ public class CADProUtil {
} }
modelMap.put(partId, modelFile); modelMap.put(partId, modelFile);
if (level < needlevel || needlevel == -1) { if (level < needlevel || needlevel == -1) {
List<WTPart> children = PartUtil.getChildPart(part,true); List<WTPart> children = CadPartUtil.getChildPart(part,true);
/* /*
QueryResult qr = WTPartHelper.service.getUsesWTParts(part, QueryResult qr = WTPartHelper.service.getUsesWTParts(part,
WTPartStandardConfigSpec.newWTPartStandardConfigSpec( WTPartStandardConfigSpec.newWTPartStandardConfigSpec(
...@@ -262,7 +262,7 @@ public class CADProUtil { ...@@ -262,7 +262,7 @@ public class CADProUtil {
while (linklist.hasMoreElements()) { while (linklist.hasMoreElements()) {
EPMMemberLink link = (EPMMemberLink) linklist.nextElement(); EPMMemberLink link = (EPMMemberLink) linklist.nextElement();
EPMDocumentMaster master = (EPMDocumentMaster) link.getUses(); EPMDocumentMaster master = (EPMDocumentMaster) link.getUses();
EPMDocument childEPM = EPMUtil.getEPM(master.getNumber(), "", ""); EPMDocument childEPM = EPMUtil.getEPM(master.getNumber(), "", "");
Map<String, DxModelFile> childModelMap = getModelFileByEPMBom(childEPM, level++, Map<String, DxModelFile> childModelMap = getModelFileByEPMBom(childEPM, level++,
needlevel); needlevel);
...@@ -304,7 +304,7 @@ public class CADProUtil { ...@@ -304,7 +304,7 @@ public class CADProUtil {
/** /**
* 获取Part逻辑标识符最后一段 * 获取Part逻辑标识符最后一段
* *
* @param per * @param per
* @return * @return
* @throws Exception * @throws Exception
...@@ -341,7 +341,7 @@ public class CADProUtil { ...@@ -341,7 +341,7 @@ public class CADProUtil {
/** /**
* 获取Part类型显示名称 * 获取Part类型显示名称
* *
* @param per * @param per
* @return * @return
* @throws Exception * @throws Exception
......
package com.yonde.cadpro.util;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.ser.FilterProvider;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import wt.log4j.LogR;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
* @author LiBanggui
* @description
* @date 2019/6/12
*/
public class CadJsonUtils {
private static Logger log = LogR.getLogger(CadJsonUtils.class.getName());
private static ObjectMapper objectMapper = null;
private static XmlMapper xmlMapper = null;
static {
objectMapper = initObjectMapper();
xmlMapper = initXmlMapper();
}
private static ObjectMapper initObjectMapper() {
ObjectMapper newObjectMapper = new ObjectMapper();
// 设置默认日期格式
// newObjectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
newObjectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
newObjectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
newObjectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
newObjectMapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
return newObjectMapper;
}
private static XmlMapper initXmlMapper() {
XmlMapper newXmlMapper = new XmlMapper();
//newXmlMapper.findAndRegisterModules();
//newXmlMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
newXmlMapper.enable(SerializationFeature.INDENT_OUTPUT);
newXmlMapper.disable(DeserializationFeature.FAIL_ON_IGNORED_PROPERTIES);
newXmlMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
//newXmlMapper.setDefaultUseWrapper(false);
newXmlMapper.configure(ToXmlGenerator.Feature.WRITE_XML_DECLARATION, true);
return newXmlMapper;
}
/**
* 将对象转换成json字符串格式(默认将转换所有的属性)
*
* @param value
* @return
*/
public static String toJsonStr(Object value) {
try {
return objectMapper.writeValueAsString(value);
} catch (JsonProcessingException e) {
log.error("Json转换失败", e);
throw new RuntimeException(e);
}
}
/**
* 将对象转换成json字符串格式(默认将转换所有的属性)
*
* @param value
* @return
*/
public static byte[] toJsonBytes(Object value) {
try {
return objectMapper.writeValueAsBytes(value);
} catch (JsonProcessingException e) {
log.error("Json转换失败", e);
throw new RuntimeException(e);
}
}
/**
* 将对象转换成json字符串格式
*
* @param value
* 需要转换的对象
* @param properties
* 需要转换的属性
*/
public static String toJsonStr(Object value, String[] properties) {
try {
SimpleBeanPropertyFilter sbp = SimpleBeanPropertyFilter.filterOutAllExcept(properties);
FilterProvider filterProvider = new SimpleFilterProvider()
.addFilter("propertyFilterMixIn", sbp);
return objectMapper.writer(filterProvider).writeValueAsString(value);
} catch (Exception e) {
log.error("Json转换失败", e);
throw new RuntimeException(e);
}
}
/**
* 将对象转换成json字符串格式
*
* @param value
* 需要转换的对象
* @param properties2Exclude
* 需要排除的属性
*/
public static String toJsonStrWithExcludeProperties(Object value, String[] properties2Exclude) {
try {
SimpleBeanPropertyFilter sbp = SimpleBeanPropertyFilter
.serializeAllExcept(properties2Exclude);
FilterProvider filterProvider = new SimpleFilterProvider()
.addFilter("propertyFilterMixIn", sbp);
return objectMapper.writer(filterProvider).writeValueAsString(value);
} catch (Exception e) {
log.error("Json转换失败", e);
throw new RuntimeException(e);
}
}
/**
* 将对象json格式直接写出到流对象中(默认将转换所有的属性)
*
* @param out
* @return
*/
public static void writeJsonStr(OutputStream out, Object value) {
try {
objectMapper.writeValue(out, value);
} catch (Exception e) {
log.error("Json转换失败", e);
throw new RuntimeException(e);
}
}
/**
* 反序列化POJO或简单Collection如List<String>.
*
* 如果JSON字符串为Null或"null"字符串, 返回Null. 如果JSON字符串为"[]", 返回空集合.
*
* 如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String, JavaType)
*/
public static <T> T fromJson(String jsonString, Class<T> clazz) {
if (StringUtils.isEmpty(jsonString)) {
return null;
}
try {
return objectMapper.readValue(jsonString, clazz);
} catch (IOException e) {
log.error("parse json string error:" + jsonString, e);
return null;
}
}
/**
* 反序列化POJO或简单Collection如List<String>.
*
* 如果JSON字符串为Null或"null"字符串, 返回Null. 如果JSON字符串为"[]", 返回空集合.
*
* 如需反序列化复杂Collection如List<MyBean>, 请使用fromJson(String, JavaType)
*/
public static <T> T fromJson(String jsonString, Class<T> clazz, Class<?>... elementClasses) {
if (StringUtils.isEmpty(jsonString)) {
return null;
}
try {
if (elementClasses.length == 0) {
return objectMapper.readValue(jsonString, clazz);
} else {
return objectMapper.readValue(jsonString, getGenericsType(clazz, elementClasses));
}
} catch (IOException e) {
log.error("parse json string error:" + jsonString, e);
return null;
}
}
/**
* 获取泛型的Collection Type
*
* @param collectionClass
* 泛型的Collection
* @param elementClasses
* 元素类
* @return JavaType Java类型
* @since 1.0
*/
public static JavaType getGenericsType(Class<?> collectionClass, Class<?>... elementClasses) {
return objectMapper.getTypeFactory().constructParametricType(collectionClass,
elementClasses);
}
/**
* 对象转为XML字符串
* @param value
* @return
* @throws JsonProcessingException
*/
public static String toXMLStr(Object value) throws JsonProcessingException {
return xmlMapper.writeValueAsString(value);
}
/**
* 对象转xml写入流
* @param value
* @return
* @throws IOException
*/
public static void writeXmlStr(OutputStream os, Object value) throws IOException {
xmlMapper.writeValue(os, value);
}
/**
* xml字符串转为对象
* @param <T>
* @param xmlString
* @param clazz
* @return
*/
public static <T> T fromXml(String xmlString, Class<T> clazz) {
if (StringUtils.isBlank(xmlString)) {
return null;
}
try {
return xmlMapper.readValue(xmlString, clazz);
} catch (IOException e) {
log.error("parse xml string error:" + xmlString, e);
return null;
}
}
public static <T> T fromXml(InputStream xmlInput, Class<T> clazz) {
if (xmlInput == null) {
return null;
}
try {
return xmlMapper.readValue(xmlInput, clazz);
} catch (IOException e) {
log.error("parse xml input error", e);
return null;
}
}
}
...@@ -356,7 +356,7 @@ public class ContentUtil { ...@@ -356,7 +356,7 @@ public class ContentUtil {
*/ */
public static ContentHolder addSecondaryFile(ContentHolder holder, File file, public static ContentHolder addSecondaryFile(ContentHolder holder, File file,
String newFileName, String desc) throws WTException, WTPropertyVetoException, String newFileName, String desc) throws WTException, WTPropertyVetoException,
java.beans.PropertyVetoException, IOException { java.beans.PropertyVetoException, IOException {
ApplicationData applicationdata = ApplicationData.newApplicationData(holder); ApplicationData applicationdata = ApplicationData.newApplicationData(holder);
applicationdata.setRole(ContentRoleType.SECONDARY); applicationdata.setRole(ContentRoleType.SECONDARY);
applicationdata.setUploadedFromPath(file.getParent()); applicationdata.setUploadedFromPath(file.getParent());
...@@ -371,18 +371,18 @@ public class ContentUtil { ...@@ -371,18 +371,18 @@ public class ContentUtil {
PersistenceServerHelper.manager.update(applicationdata); PersistenceServerHelper.manager.update(applicationdata);
return holder; return holder;
} }
public static ContentHolder replaceSecondaryFile(ContentHolder holder, File file, public static ContentHolder replaceSecondaryFile(ContentHolder holder, File file,
String newFileName) throws WTException, PropertyVetoException, IOException { String newFileName) throws WTException, PropertyVetoException, IOException {
holder = deleteSecondaryFile(holder ,newFileName ); holder = deleteSecondaryFile(holder ,newFileName );
return addSecondaryFile(holder,file,newFileName); return addSecondaryFile(holder,file,newFileName);
} }
public static ContentHolder replaceSecondaryFile(ContentHolder holder, File file, public static ContentHolder replaceSecondaryFile(ContentHolder holder, File file,
String newFileName, String desc) throws WTException, PropertyVetoException, IOException { String newFileName, String desc) throws WTException, PropertyVetoException, IOException {
holder = deleteSecondaryFile(holder ,newFileName ); holder = deleteSecondaryFile(holder ,newFileName );
return addSecondaryFile(holder,file,newFileName,desc); return addSecondaryFile(holder,file,newFileName,desc);
} }
public static ContentHolder copySecondarys(ContentHolder source, ContentHolder target) throws WTException, PropertyVetoException, IOException { public static ContentHolder copySecondarys(ContentHolder source, ContentHolder target) throws WTException, PropertyVetoException, IOException {
List<ApplicationData> sourceApps = getSecondarys(source); List<ApplicationData> sourceApps = getSecondarys(source);
for(ApplicationData sourceApp: sourceApps){ for(ApplicationData sourceApp: sourceApps){
...@@ -570,7 +570,7 @@ public class ContentUtil { ...@@ -570,7 +570,7 @@ public class ContentUtil {
* @param holder * @param holder
* @param contentRoleTypes * @param contentRoleTypes
* @param fileName * @param fileName
* @return * @return
* @throws WTException * @throws WTException
* @throws PropertyVetoException * @throws PropertyVetoException
*/ */
......
...@@ -16,7 +16,7 @@ public class DSNumberValidator { ...@@ -16,7 +16,7 @@ public class DSNumberValidator {
//-000 ~ -999 后四位为-xxx结尾,xxx为3为数字 //-000 ~ -999 后四位为-xxx结尾,xxx为3为数字
//public static String regEx = "^M-[A-Z]{1}[0-9]{4}[A-Z]{1}[0-9]{5}-[0-9]{3}$"; //public static String regEx = "^M-[A-Z]{1}[0-9]{4}[A-Z]{1}[0-9]{5}-[0-9]{3}$";
//-051 ~ -099 后四位为-0xx结尾,xx为51 - 99 //-051 ~ -099 后四位为-0xx结尾,xx为51 - 99
public static String regEx1 = "^M-[A-Z]{1}[0-9]{4}[A-Z]{1}[0-9]{5}-0[5-9]{1}[1-9]{1}$"; public static String regEx1 = "^M-[A-Z]{1}[0-9]{4}[A-Z]{1}[0-9]{5}-0[5-9]{1}[1-9]{1}$";
//骨架模型DS GJ_D5380K00000-051 //骨架模型DS GJ_D5380K00000-051
...@@ -50,7 +50,7 @@ public class DSNumberValidator { ...@@ -50,7 +50,7 @@ public class DSNumberValidator {
} }
Matcher matcher = pattern.matcher(input); Matcher matcher = pattern.matcher(input);
matchFlag = matcher.matches(); matchFlag = matcher.matches();
//骨架模型DS //骨架模型DS
if (!matchFlag) { if (!matchFlag) {
if (caseInsensitive) { if (caseInsensitive) {
...@@ -61,7 +61,7 @@ public class DSNumberValidator { ...@@ -61,7 +61,7 @@ public class DSNumberValidator {
matcher = pattern.matcher(input); matcher = pattern.matcher(input);
matchFlag = matcher.matches(); matchFlag = matcher.matches();
} }
//边界模型DS //边界模型DS
//边界模型DS //边界模型DS
if (!matchFlag) { if (!matchFlag) {
...@@ -73,7 +73,7 @@ public class DSNumberValidator { ...@@ -73,7 +73,7 @@ public class DSNumberValidator {
matcher = pattern.matcher(input); matcher = pattern.matcher(input);
matchFlag = matcher.matches(); matchFlag = matcher.matches();
} }
return matchFlag; return matchFlag;
} }
...@@ -82,7 +82,7 @@ public class DSNumberValidator { ...@@ -82,7 +82,7 @@ public class DSNumberValidator {
System.out.println(dsNumberValidator.execute()); System.out.println(dsNumberValidator.execute());
dsNumberValidator = new DSNumberValidator("M-D5380K00000-051"); dsNumberValidator = new DSNumberValidator("M-D5380K00000-051");
System.out.println(dsNumberValidator.execute()); System.out.println(dsNumberValidator.execute());
dsNumberValidator = new DSNumberValidator("BJ_D5380K00000-051"); dsNumberValidator = new DSNumberValidator("BJ_D5380K00000-051");
System.out.println(dsNumberValidator.execute()); System.out.println(dsNumberValidator.execute());
} }
......
package com.yonde.cadpro.util;
import wt.method.RemoteAccess;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.SimpleTimeZone;
import java.util.TimeZone;
public class DateUtil implements RemoteAccess {
public static String DATE_TIME_FORMART = "yyyy-MM-dd HH:mm:ss";
public static String DATE_FORMART = "yyyy-MM-dd";
public static String formatTimestamp(String format, Timestamp timestamp){
SimpleDateFormat dateFormat = new SimpleDateFormat(format);
TimeZone zone = new SimpleTimeZone(28800000,"Asia/Shanghai");
dateFormat.setTimeZone(zone);
String time = dateFormat.format(timestamp);
return time;
}
public static Timestamp timestampVal(String val){
if(val == null || val.trim().isEmpty()){
return null;
}else{
return Timestamp.valueOf(val.trim());
}
}
}
This diff is collapsed.
...@@ -7,7 +7,7 @@ import wt.util.WTException; ...@@ -7,7 +7,7 @@ import wt.util.WTException;
import wt.util.WTPropertyVetoException; import wt.util.WTPropertyVetoException;
public class ExceptionUtil { public class ExceptionUtil {
public static String getErrorMessage(Throwable th) { public static String getErrorMessage(Throwable th) {
String errMsg = ""; String errMsg = "";
Throwable rootCause = ExceptionUtils.getRootCause(th); Throwable rootCause = ExceptionUtils.getRootCause(th);
...@@ -29,7 +29,7 @@ public class ExceptionUtil { ...@@ -29,7 +29,7 @@ public class ExceptionUtil {
public static ApiResult constructErrorAPIResult(Exception exception) { public static ApiResult constructErrorAPIResult(Exception exception) {
return ApiResult.error(getErrorMessage(exception)); return ApiResult.error(getErrorMessage(exception));
} }
public static ApiResult constructErrorAPIResult(String errorMsgPrefix, Exception exception) { public static ApiResult constructErrorAPIResult(String errorMsgPrefix, Exception exception) {
return ApiResult.error(errorMsgPrefix + getErrorMessage(exception)); return ApiResult.error(errorMsgPrefix + getErrorMessage(exception));
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -7,6 +7,7 @@ import com.yonde.cadpro.bean.ModelBaseInfo; ...@@ -7,6 +7,7 @@ import com.yonde.cadpro.bean.ModelBaseInfo;
import com.yonde.cadpro.config.CatiaInteConfigPropertiesUtil; import com.yonde.cadpro.config.CatiaInteConfigPropertiesUtil;
import com.yonde.common.CommonUtil; import com.yonde.common.CommonUtil;
import com.yonde.common.IBAUtil; import com.yonde.common.IBAUtil;
import com.yonde.common.PartUtil;
import com.yonde.common.util.TypeAttrUtil; import com.yonde.common.util.TypeAttrUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
...@@ -550,7 +551,7 @@ public class ModelBaseInfoConverter { ...@@ -550,7 +551,7 @@ public class ModelBaseInfoConverter {
} }
if (partMaster != null) { if (partMaster != null) {
//WTPart childPart = PartUtil.getLatestPartByModifyTime(partMaster.getNumber(), GACEConstants.VIEW_DESIGN, true); //WTPart childPart = PartUtil.getLatestPartByModifyTime(partMaster.getNumber(), GACEConstants.VIEW_DESIGN, true);
WTPart childPart = PartUtil.getLatestPart(partMaster.getNumber(), WTPart childPart = CadPartUtil.getLatestPart(partMaster.getNumber(),
CADProConstants.VIEW_DESIGN); CADProConstants.VIEW_DESIGN);
if (childPart != null) { if (childPart != null) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
...@@ -591,12 +592,12 @@ public class ModelBaseInfoConverter { ...@@ -591,12 +592,12 @@ public class ModelBaseInfoConverter {
// } // }
// } // }
//else { //else {
ModelBaseInfoConverter mbiConverter = new ModelBaseInfoConverter( ModelBaseInfoConverter mbiConverter = new ModelBaseInfoConverter(
childPart, partConfigSpec, needChildren, needModelFileUrl, childPart, partConfigSpec, needChildren, needModelFileUrl,
totalLevel, nextLevel, endRecursionTypes); totalLevel, nextLevel, endRecursionTypes);
ModelBaseInfo childMbi = mbiConverter.getModelBaseInfo(); ModelBaseInfo childMbi = mbiConverter.getModelBaseInfo();
children.add(childMbi); children.add(childMbi);
// } // }
} }
} else { } else {
log.error(" partMaster is null..."); log.error(" partMaster is null...");
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -32,7 +32,7 @@ public class JsonUtils { ...@@ -32,7 +32,7 @@ public class JsonUtils {
public JsonUtils() { public JsonUtils() {
} }
static { static {
//xmlMapper = initXmlMapper(); xmlMapper = initXmlMapper();
} }
......
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