From 7deb6f3a8151b7338ac402e05e462938f8e26ca0 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期日, 28 一月 2024 15:18:46 +0800
Subject: [PATCH] 近义词管理,界面和接口完善
---
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java | 100 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 96 insertions(+), 4 deletions(-)
diff --git a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
index f248f5a..cc1ae87 100644
--- a/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
+++ b/Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmTypeServiceImpl.java
@@ -469,7 +469,7 @@
* @throws ServiceException 鍙傛暟涓虹┖鐨勬椂鍊欎細鎶涘嚭寮傚父
*/
@Override
- public String getTableName(String id,String domain) throws ServiceException {
+ public String getTableName(String id,String domain) throws VciBaseException {
VciBaseUtil.alertNotNull(id,"涓氬姟绫诲瀷鑻辨枃鍚嶇О",domain,"棰嗗煙鍚嶇О");
if (domain.contains("ubcs-")){
domain = domain.split("ubcs-")[1];
@@ -497,7 +497,7 @@
transaction = dataSourceTransactionManager.getTransaction(def);
// 鑾峰緱浜嬪姟鐘舵��
}*/
- checkBtmTypeBeforeSave(btmTypeDTO);
+ //checkBtmTypeBeforeSave(btmTypeDTO);
BtmType btmTypeDO = Optional.ofNullable(BeanUtil.copy(btmTypeDTO, BtmType.class)).orElseGet(BtmType::new);
btmTypeDO.setBizDomain(btmTypeDTO.getBizDomain());
List<BtmTypeLinkAttributesDTO> attributes = btmTypeDTO.getAttributes();
@@ -516,6 +516,7 @@
List<BtmTypeAttributeVO> beforeAttributes = btmTypeByOid.getAttributes();
// 澶勭悊灞炴�э紝澶氫綑鐨勫垹闄わ紝涓嶅瓨鍦ㄧ殑娣诲姞
afterAttributes = updateAttributeForBtm(btmTypeByOid.getOid(),beforeAttributes, attributes);
+ baseMapper.updateByPrimaryKey(btmTypeDO);
}
BtmTypeVO btmTypeVO = BtmTypeWrapper.build().entityVO(btmTypeDO);
//鍦ㄥ垱寤鸿〃鐨勬椂鍊欒繕闇�瑕佹妸榛樿鐨勫瓧娈靛甫涓娿��
@@ -577,8 +578,12 @@
List<BtmTypeAttributeVO> voListAdd = btmTypeAttributeService.checkAndInsert(oid, addList, AuthUtil.getUserAccount(), new Date());
List<BtmTypeAttributeVO> voListUpdate = btmTypeAttributeService.checkAndUpdate(oid, modifyList, AuthUtil.getUserAccount(), new Date());
List<BtmTypeAttributeVO> returnList = new ArrayList<>();
- returnList.addAll(Objects.requireNonNull(voListAdd));
- returnList.addAll(Objects.requireNonNull(voListUpdate));
+ if(!CollectionUtils.isEmpty(voListAdd)) {
+ returnList.addAll(Objects.requireNonNull(voListAdd));
+ }
+ if(!CollectionUtils.isEmpty(voListUpdate)) {
+ returnList.addAll(Objects.requireNonNull(voListUpdate));
+ }
return returnList;
}
@@ -964,4 +969,91 @@
});
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);
+ if (Arrays.asList("codeclsfpath").contains(id)){
+ vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+ vo.setAttributeLength(500);
+ }else {
+ vo.setAttrDataType(VciFieldTypeEnum.VTString.name());
+ vo.setAttributeLength(255);
+ }
+ 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;
+ }
+
}
--
Gitblit v1.9.3