Commit d36c0aeb authored by hanson.yao's avatar hanson.yao

merge master branch code

parent 573130d6
......@@ -6,8 +6,6 @@ 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 org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.web.bind.annotation.*;
import wt.method.RemoteAccess;
import wt.util.WTException;
......@@ -16,8 +14,6 @@ import wt.util.WTException;
@RequestMapping({"/login"})
public class LoginController implements RemoteAccess {
private static final Log log = LogFactory.getLog(LoginController.class);
/**
* 用户认证
*
......@@ -48,7 +44,6 @@ public class LoginController implements RemoteAccess {
@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);
}
}
......@@ -25,7 +25,7 @@ public enum DxErrorCodeData implements DxEnumData {
PROP_MAPPING_ERROR(19, "目标类[%s]属性映射错误[%s]"),
CURRENT_NOT_SUPPORT_CUSTOM_TYPE(20, "当前系统不支持自定义类型(json转对象)"),
CAN_NOT_FOUND_DX_TYPE(21, "没有找见对应的dxType类型[%s]"),
Service_Error(2100,"CADPro登录异常");
Service_Error(2100,"CADPro登录异常");;
public static final String PREFIX = "BASEDATA_";
final String code;
final String value;
......
......@@ -46,6 +46,8 @@ public class SearchOperatorEnumUtil {
public static final String DX_FOLDER_ID = "folderId";
public static final String DX_DOC_FOLDER_ID = "dxDocumentFolderId";
public static final String DX_SUBTYPE_NAME = "subTypeName";
public static final String DX_ID = "id";
......
......@@ -2,13 +2,11 @@ package com.yonde.basedata.service;
import com.yonde.basedata.data.DxPageImpl;
import com.yonde.basedata.entity.api.ApiResult;
import com.yonde.basedata.entity.users.DxUserVO;
import com.yonde.basedata.search.SearchOperatorEnumUtil;
import com.yonde.basedata.search.SearchQueryCondition;
import com.yonde.basedata.vo.IdVO;
import com.yonde.basedata.vo.ObjFileLinkVO;
import com.yonde.baseline.vo.DxBaselineVO;
import com.yonde.change.service.DXChangeOrderService;
import com.yonde.change.vo.ecn.DxChangeNoticeVo;
import com.yonde.change.vo.ecr.DxChangeRequestVo;
import com.yonde.change.vo.pr.DxProblemReportVo;
......@@ -45,7 +43,6 @@ import wt.session.SessionServerHelper;
import wt.util.WTException;
import wt.util.WTProperties;
import wt.vc.baseline.ManagedBaseline;
import wt.vc.wip.WorkInProgressHelper;
import java.io.File;
import java.util.ArrayList;
......@@ -363,7 +360,9 @@ public class BaseSearchService <V extends IdVO> implements RemoteAccess {
if (CollectionUtils.isNotEmpty(subFolders)) {
List<DXFolder> subList = new ArrayList<DXFolder>();
for (SubFolder subFolder : subFolders) {
subList.add(new DXFolder(subFolder));
DXFolder dxFolderSub = new DXFolder(subFolder);
dxFolderSub.setParentId(dxFolder.getId());
subList.add(dxFolderSub);
}
dxFolder.setChildren(subList);
} else {
......
......@@ -325,7 +325,7 @@ public class DxPartModelBomVo implements Serializable {
String oid = CommonUtil.getPersistableOid(wtPart);
String number = wtPart.getNumber();
String name = wtPart.getName();
//String version = CommonUtil.getVersionDisplayWithOneOff(wtPart);
String version = CommonUtil.getVersionDisplayWithOneOff(wtPart);
Boolean isCheckedOut = WorkInProgressHelper.isCheckedOut(wtPart);
//Add for 检出状态、检出者
CheckoutInfo checkInfo = wtPart.getCheckoutInfo();
......@@ -343,7 +343,7 @@ public class DxPartModelBomVo implements Serializable {
dxPartModelBomVo.setPartId(oid);
dxPartModelBomVo.setName(name);
dxPartModelBomVo.setNumber(number);
//dxPartModelBomVo.setDisplayVersion(version);
dxPartModelBomVo.setDisplayVersion(version);
dxPartModelBomVo.setState(state);
dxPartModelBomVo.setPartType(partTypeDisplay);
dxPartModelBomVo.setCheckOuted(isCheckedOut);
......@@ -365,7 +365,7 @@ public class DxPartModelBomVo implements Serializable {
String oid = CommonUtil.getPersistableOid(epm);
String number = epm.getNumber();
String name = epm.getName();
//String version = CommonUtil.getVersionDisplayWithOneOff(epm);
String version = CommonUtil.getVersionDisplayWithOneOff(epm);
Boolean isCheckedOut = WorkInProgressHelper.isCheckedOut(epm);
//Add for 检出状态、检出者
CheckoutInfo checkInfo = epm.getCheckoutInfo();
......@@ -393,7 +393,7 @@ public class DxPartModelBomVo implements Serializable {
dxPartModelBomVo.setPartId(oid);
dxPartModelBomVo.setName(name);
dxPartModelBomVo.setNumber(number);
//dxPartModelBomVo.setDisplayVersion(version);
dxPartModelBomVo.setDisplayVersion(version);
dxPartModelBomVo.setState(state);
dxPartModelBomVo.setPartType(partTypeDisplay);
dxPartModelBomVo.setCheckOuted(isCheckedOut);
......
......@@ -111,42 +111,9 @@ public class ModelBaseInfo implements Serializable {
*/
private String modelRelativePath = "";
/**
* 产品代号(用于当前cad数据寻找容器)
*/
private String productCode;
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,
Boolean isCheckedOut, String checkoutInfoState, String checkoutUser,
String partTypeDisplay, String state, String owner, String modelFileName,
......@@ -346,14 +313,6 @@ public class ModelBaseInfo implements Serializable {
this.modelRelativePath = modelRelativePath;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
@Override
public String toString() {
return "ModelBaseInfo [oid=" + oid + ", number=" + number + ", name=" + name + ", version="
......@@ -363,8 +322,7 @@ public class ModelBaseInfo implements Serializable {
+ modelFileName + ", modelFileUri=" + modelFileUri + ", modelFileSize="
+ modelFileSize + ", modelFileCheckSum=" + modelFileCheckSum + ", children="
+ children + ", mbdDatas=" + mbdDatas + ", transform=" + transform + ", isDrawing=" + isDrawing + ", modelThumbnailUri="
+ modelThumbnailUri + ", modelRelativePath=" + modelRelativePath
+ ", productCode=" + productCode + "]";
+ modelThumbnailUri + ", modelRelativePath=" + modelRelativePath + "]";
}
}
......@@ -26,7 +26,6 @@ public abstract class AbstractCADProChecker implements CADProChecker {
* @throws Exception
*/
protected List<WTObject> selectedCheck(List<String> ids) throws Exception {
System.out.println(">>>selectedCheck begin......ids:"+ids);
List<WTObject> selectedNodes = new ArrayList<WTObject>();
if (ids == null || ids.size() == 0) {
throw new WTException("获取选中节点为空,请确认!");
......@@ -35,30 +34,23 @@ public abstract class AbstractCADProChecker implements CADProChecker {
List<String> invalidIds = new ArrayList<String>();
List<String> invalidTypeIds = new ArrayList<String>();
for (String id : ids) {
System.out.println(">>>selectedCheck begin......id:"+id);
if (StringUtils.isBlank(id)) {
throw new WTException("选中节点id为空,请确认!");
}
Persistable per = null;
try {
per = CommonUtil.getPersistableByOid(id);
System.out.println(">>>selectedCheck begin......per:"+per);
} catch (Exception e) {
log.error("selectedCheck Get Per error...", e);
}
if (per == null) {
System.out.println(">>>selectedCheck begin......per is null");
invalidIds.add(id);
continue;
}
if (per instanceof WTPart || per instanceof EPMDocument) {
System.out.println(">>>selectedCheck begin......per ["+id+"] is WTPart or EPMDocument");
selectedNodes.add((WTObject) per);
} else {
System.out.println(">>>selectedCheck begin......per ["+id+"] not is WTPart or EPMDocument");
invalidTypeIds.add(id);
}
}
......
......@@ -88,8 +88,6 @@ public class DxPartModelBomVoConverter {
}
private void initialDxPartModelBomVo() throws Exception {
System.out.println(">>>>initialDxPartModelBomVo start......");
if (wtPart == null && epm == null) {
throw new WTException("零部件和数模不能同时为空");
}
......
......@@ -21,7 +21,6 @@ import wt.change2.WTChangeRequest2;
import wt.doc.WTDocument;
import wt.fc.*;
import wt.folder.Folder;
import wt.folder.Foldered;
import wt.inf.container.WTContained;
import wt.inf.container.WTContainer;
import wt.log4j.LogR;
......@@ -256,11 +255,12 @@ public class DxSearchUtil implements RemoteAccess, Serializable {
continue;
}
//TODO 文件夹
if (fieldName.equals(SearchOperatorEnumUtil.DX_FOLDER_ID)) {
if (fieldName.equals(SearchOperatorEnumUtil.DX_DOC_FOLDER_ID)) {
Folder folderByOid = (Folder) RfUtil.getWTObjectByOid("OR:wt.folder.SubFolder:" + item.value);
if (ObjectsUtil.nonNull(folderByOid)) {
addQuerySpecOp(querySpec, operator);
SearchCondition sc = new SearchCondition(clazz, Foldered.FOLDERING_INFO + "." + WTAttributeNameIfc.REF_OBJECT_ID,
addQuerySpecOp(querySpec, operator);//Foldered.FOLDERING_INFO + "." + WTAttributeNameIfc.REF_OBJECT_ID
SearchCondition sc = new SearchCondition(clazz, WTDocument.PARENT_FOLDER + "." + WTAttributeNameIfc.REF_OBJECT_ID,
SearchCondition.EQUAL, PersistenceHelper.getObjectIdentifier(folderByOid).getId());
querySpec.appendWhere(sc, new int[]{0});
}
......
......@@ -32,7 +32,7 @@ public class JsonUtils {
public JsonUtils() {
}
static {
xmlMapper = initXmlMapper();
//xmlMapper = initXmlMapper();
}
......
package com.yonde.common.entity;
import com.yonde.basedata.vo.IdVO;
import com.yonde.common.RfUtil;
import wt.fc.PersistenceHelper;
import wt.folder.Folder;
......@@ -10,7 +9,7 @@ import java.util.List;
public class DXFolder extends IdVO {
private Long parentId;
//文件夹名称
private String name = "";
//文件夹全路径
......@@ -24,6 +23,8 @@ public class DXFolder extends IdVO {
//容器oid
private String containerOid = "";
private Long dxContextId;
private Boolean isLeaf = false;
//子文件夹
private List<DXFolder> children = new ArrayList<DXFolder>();
......@@ -33,10 +34,28 @@ public class DXFolder extends IdVO {
public DXFolder(Folder folder) {
this.id = PersistenceHelper.getObjectIdentifier(folder).getId();
this.dxContextId = PersistenceHelper.getObjectIdentifier(folder.getContainer()).getId();
this.name = folder.getName();
this.containerName = folder.getContainerName();
this.fullPath = folder.getFolderPath();
}
public Long getDxContextId() {
return dxContextId;
}
public void setDxContextId(Long dxContextId) {
this.dxContextId = dxContextId;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
......
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