Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/constant/BtmTypeFieldConstant.java
@@ -1,5 +1,7 @@ package com.vci.ubcs.omd.constant; import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; import java.util.HashMap; import java.util.Map; @@ -27,6 +29,8 @@ public static final Map<String, String> LIFECYCLE_MANAGE_FIELD_MAP; public static final Map<String, String> MASTERDATA_FIELD_MAP; public static final Map<String, String> SECRET_MANAGE_FIELD_MAP; public static final Map<String, String> LINK_TYPE_FIELD_MAP; @@ -40,10 +44,10 @@ { this.put("nameoid", "对象主键"); this.put("revisionoid", "版本主键"); this.put("lastr", "是否最新版本"); this.put("firstr", "是否最老版本"); this.put("lastv", "是否最新版次"); this.put("firstv", "是否最老版次"); // this.put("lastr", "是否最新版本"); // this.put("firstr", "是否最老版本"); // this.put("lastv", "是否最新版次"); // this.put("firstv", "是否最老版次"); this.put("revisionrule", "版本规则"); this.put("revisionseq", "版本排序号"); this.put("revisionvalue", "版本值"); @@ -71,14 +75,26 @@ this.put("ts", "时间戳"); this.put("owner", "拥有者"); this.put("tenant_id","租户"); // TODO:因为主数据查询代码中默认就把这些字段给带上了,所以也得加在默认属性里面 this.put("lastr", "是否最新版本"); this.put("firstr", "是否最老版本"); this.put("lastv", "是否最新版次"); this.put("firstv", "是否最老版次"); } }; BASE_MODEL_COMPATIBILITY_MAP = new HashMap() { { this.put("lastr", "lastr"); this.put("firstr", "firstr"); this.put("lastv", "lastv"); this.put("firstv", "firstv"); this.put("lastr", "是否最新版本"); this.put("firstr", "是否最老版本"); this.put("lastv", "是否最新版次"); this.put("firstv", "是否最老版次"); } }; MASTERDATA_FIELD_MAP = new HashMap() { { this.put("codeclsfid","分类的主键字段"); this.put("codeclsfpath", "分类全路径的字段"); this.put("codetemplateoid", "模板的主键字段"); } }; LIFECYCLE_MANAGE_FIELD_MAP = new HashMap() { Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeAttributeVO.java
@@ -167,4 +167,9 @@ pattern = "yyyy-MM-dd HH:mm:ss.SSS" ) private Date ts; /** * 是否默认属性 */ private Boolean iseDfaultAttr; } Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/controller/BtmTypeController.java
@@ -211,4 +211,17 @@ } return R.data(btmTypeService.saveFromTable(btmTypeDTOList,domain)); } /** * 获取默认属性 * @param defaultAttrType * @return */ @GetMapping("/getDefaultAttr") @ApiOperation(value = "获取默认属性",notes = "获取默认属性") @ApiOperationSupport(order = 10) public R getDefaultAttr(String defaultAttrType){ return R.data(this.btmTypeService.getDefaultAttr(defaultAttrType)); } } Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/IBtmTypeAttributeService.java
@@ -34,7 +34,6 @@ */ List<BtmTypeAttributeVO> getAttributeByBtmTypeOid(String btmTypeOid); /** * 根据业务类型主键获取关联的所有属性对象 * Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/IBtmTypeService.java
@@ -143,7 +143,6 @@ */ Map<String,List<BtmTypeAttributeVO>> batchListHasAttributesByIdCollection(Collection<String> idCollection) throws ServiceException; /** * 获取使用业务类型的链接类型 * @param pkBtmType 业务类型主键 @@ -279,4 +278,12 @@ * @return 个数 */ Integer countByLifeIds(Collection<String> lifeIds); /** * 获取默认属性 * @param defaultAttrType * @return */ List<BtmTypeAttributeVO> getDefaultAttr(String defaultAttrType); } Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
@@ -969,4 +969,85 @@ }); return total[0]; } /** * 获取默认属性 * @param defaultAttrType * @return */ @Override public List<BtmTypeAttributeVO> getDefaultAttr(String defaultAttrType) { List<BtmTypeAttributeVO> list = new ArrayList<>(); // 业务类型的默认基本字段 if(defaultAttrType.equals("defaultAttr")){ BtmTypeFieldConstant.BASIC_FIELD_MAP.forEach((id,name) -> { id = id.toLowerCase(Locale.ROOT); BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); vo.setId(id); vo.setName(name); vo.setIseDfaultAttr(true); if ("oid".equals(id)){ vo.setNullableFlag(false); } if (Arrays.asList("createtime","lastmodifytime","ts").contains(id)){ vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name()); vo.setAttributeLength(6); }else { vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); vo.setAttributeLength(150); } list.add(vo); }); BtmTypeFieldConstant.MASTERDATA_FIELD_MAP.forEach((id,name) -> { id = id.toLowerCase(Locale.ROOT); BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); vo.setId(id); vo.setName(name); vo.setIseDfaultAttr(false); vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); vo.setAttributeLength(150); list.add(vo); }); } // 版本规则字段 if (defaultAttrType.equals("reVersionRule")){ BtmTypeFieldConstant.REVISION_MANAGE_FIELD_MAP.forEach((id,name) -> { BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); vo.setId(id); vo.setName(name); vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); // 版本规则字段不能为空 // vo.setNullableFlag(false); vo.setAttributeLength(150); vo.setIseDfaultAttr(true); if (Arrays.asList("revisionseq","versionseq").contains(id)){ vo.setAttributeLength(5); vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name()); } if (Arrays.asList("checkintime","checkouttime").contains(id)){ vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name()); vo.setAttributeLength(6); } list.add(vo); }); } // 生命周期字段 if (defaultAttrType.equals("lifeCycle")){ BtmTypeFieldConstant.LIFECYCLE_MANAGE_FIELD_MAP.forEach((id,name) -> { BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); vo.setId(id); vo.setName(name); // vo.setNullableFlag(false); vo.setIseDfaultAttr(true); vo.setAttributeLength(50); vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); list.add(vo); }); } return list; } }