From 779aaf2c58b4c0c94cbadae29298a37d5534de41 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 28 八月 2024 17:53:04 +0800
Subject: [PATCH] 编写表单定义模块 首页布局 表单布局
---
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java | 45 ++++++++++++++++++++++++---------------------
1 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
index aace24a..080e08e 100644
--- a/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
+++ b/Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/web/service/impl/OsBtmServiceImpl.java
@@ -202,7 +202,7 @@
//vo.setCreateTime(VciDateUtil.str2Date(String.valueOf(btmItem.createTime),VciDateUtil.DateTimeFormat));
vo.setCreateTime(Func.parse(btmItem.createTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat)));
vo.setLastModifyTime( Func.parse(btmItem.modifyTime, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat)));
- vo.setTs(Func.parse(btmItem.ts, ConcurrentDateFormat.of(VciDateUtil.DateTimeFormat)));
+ vo.setTs(Func.parse(btmItem.ts, ConcurrentDateFormat.of(VciDateUtil.DateTimeMillFormat)));
} catch (Exception e) {
e.printStackTrace();
}
@@ -219,11 +219,11 @@
vo.setInputRevisionFlag(btmItem.revInput);
vo.setDelimiter(btmItem.delimiter);
vo.setfName(btmItem.fName);
- if(StringUtils.isNotBlank(vo.getRevisionRuleId()) || vo.isInputRevisionFlag()){
+ vo.setVersionRule(String.valueOf(btmItem.verRuleName));
+ if(StringUtils.isNotBlank(vo.getRevisionRuleName()) || vo.isInputRevisionFlag()){
vo.setRevisionFlag(true);
}
- vo.setVersionRule(String.valueOf(btmItem.verRuleName));
- vo.setSubLifeCycleId(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(",")));
+ vo.setLifeCycleIds(Arrays.stream(btmItem.lifeCycles).collect(Collectors.joining(",")));
vo.setApNameArray(btmItem.apNameArray);
List<OsAttributeVO> attributeVOS = attributeService.listAttrByIds(Arrays.stream(btmItem.apNameArray).collect(Collectors.toList()));
List<OsBtmTypeAttributeVO> btmTypeAttributeVOS = new ArrayList<>();
@@ -232,7 +232,7 @@
BeanUtil.convert(attributeVO,btmTypeAttributeVO);
btmTypeAttributeVO.setPkBtmType(vo.getOid());
btmTypeAttributeVO.setBtmTypeId(vo.getId());
- btmTypeAttributeVO.setAttrDataType(attributeVO.getAttributeDataType());
+ btmTypeAttributeVO.setAttributeDataType(attributeVO.getAttributeDataType());
btmTypeAttributeVO.setAttributeLength(attributeVO.getAttrLength());
btmTypeAttributeVO.setDefaultValue(attributeVO.getDefaultValue());
if("secretgrade".equalsIgnoreCase(attributeVO.getId())){
@@ -385,7 +385,7 @@
attributeService.getDefaultAttributeVOs().stream().forEach(attr->{
OsBtmTypeAttributeVO attributeVO = new OsBtmTypeAttributeVO();
BeanUtil.convert(attr, attributeVO);
- attributeVO.setAttrDataType(attr.getAttributeDataType());
+ attributeVO.setAttributeDataType(attr.getAttributeDataType());
attributeVO.setAttributeLength(attr.getAttrLength());
attributeVO.setReferBtmTypeId(attr.getBtmTypeId());
attributeVO.setReferBtmTypeName(attr.getBtmTypeName());
@@ -648,7 +648,7 @@
AttributeDef sysAttributeDef = collect.get(attrName.toLowerCase());
OsBtmTypeAttributeVO vo = new OsBtmTypeAttributeVO();
vo.setOid(sysAttributeDef.oid);
- vo.setAttrDataType(sysAttributeDef.vtDataType);
+ vo.setAttributeDataType(sysAttributeDef.vtDataType);
vo.setPkBtmType(btmName);
vo.setCreateTime(new Date(sysAttributeDef.createTime));
vo.setCreator(sysAttributeDef.creator);
@@ -667,7 +667,7 @@
for (AttributeDef attribute : attributeDefs) {
OsBtmTypeAttributeVO vo = new OsBtmTypeAttributeVO();
vo.setOid(attribute.oid);
- vo.setAttrDataType(attribute.vtDataType);
+ vo.setAttributeDataType(attribute.vtDataType);
vo.setPkBtmType(btmName);
vo.setCreateTime(new Date(attribute.createTime));
vo.setCreator(attribute.creator);
@@ -695,6 +695,7 @@
*/
private BizType dto2BizType(OsBtmTypeDTO dto){
BizType bizType = new BizType();
+ bizType.oid = dto.getOid();
bizType.name =dto.getId();
bizType.isAbstract = dto.isAbstractFlag();
bizType.label = dto.getName();
@@ -710,24 +711,24 @@
}
bizType.description = dto.getDescription();
bizType.revLevel = dto.getRevLevel();
-
- bizType.revRuleName = dto.getRevisionRuleName();
+ bizType.revRuleName = dto.getRevisionRuleId();
bizType.revInput = dto.isInputRevisionFlag();
bizType.delimiter = (dto.getDelimiter() == null ? "" : dto.getDelimiter());
- bizType.verRuleName = Short.parseShort(dto.getRevisionRuleName());
+ bizType.verRuleName = Func.isBlank(dto.getVersionRule()) ? 0:Short.parseShort(dto.getVersionRule());
//bizType.imageName = dto.get;
//List<String> attrIdList = dto.getAttributesDTOList().stream().map(OsBtmTypeLinkAttributesDTO::getId).collect(Collectors.toList());
- bizType.apNameArray = dto.getApNameArray();//attrIdList.toArray(new String[attrIdList.size()]);
+ bizType.apNameArray = dto.getApNameArray().split(",");//attrIdList.toArray(new String[attrIdList.size()]);
String userId = WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId();
long timeMillis = System.currentTimeMillis();
bizType.creator = Func.isBlank(dto.getCreator()) ? userId:dto.getCreator();
bizType.createTime = Func.isEmpty(dto.getCreateTime()) ? timeMillis:dto.getCreateTime().getTime();
bizType.modifier = userId;
bizType.modifyTime = timeMillis;
+ bizType.ts = Func.isEmpty(dto.getTs())? timeMillis:dto.getTs().getTime();
return bizType;
}
@@ -811,9 +812,11 @@
* @return
*/
private void checkVersionInfo(OsBtmTypeDTO dto) throws PLException {
- //闇�瑕佹墜鍔ㄨ緭鍏ョ増鏈椂revisionRuleName涓嶈兘涓虹┖
- if (dto.isInputRevisionFlag() && Func.isBlank(dto.getRevisionRuleName())) {
- throw new PLException("500",new String[]{"鐗堟湰鍙疯鍒欎笉鑳戒负绌�"});
+ //闇�瑕佹墜鍔ㄨ緭鍏ョ増鏈椂revisionRuleId涓嶈兘涓虹┖
+ if (dto.getRevLevel() == 1 || dto.getRevLevel() == 2) {
+ if (Func.isBlank(dto.getRevisionRuleId()) && !dto.isInputRevisionFlag()) {
+ throw new PLException("500",new String[]{"鐗堟湰鍙疯鍒欎笉鑳戒负绌�"});
+ }
}
}
@@ -854,14 +857,14 @@
checkRevLevel(dbBizType,btmTypeDTO);
checkVersionInfo(btmTypeDTO);
//澶勭悊涓氬姟绫诲瀷涓嬬殑灞炴��
- List<String> lastAttrList = new ArrayList<>(Arrays.asList(btmTypeDTO.getApNameArray()));
+ List<String> lastAttrList = new ArrayList<>(Arrays.asList(btmTypeDTO.getApNameArray().split(",")));
//涓嶈兘绉婚櫎鐨勫睘鎬�
String[] unRemovableFields = null;
List<String> unRemovableFields_ = null;
//闇�瑕佺Щ闄ょ殑灞炴��
List<String> removableFields = null;
//淇敼鍓嶄笟鍔$被鍨嬪湪鏁版嵁搴撲腑宸插瓨鍦ㄧ殑鎵�鏈夊睘鎬�
- String[] apNameArray = btmTypeDTO.getApNameArray();
+ String[] apNameArray = btmTypeDTO.getApNameArray().split(",");
Set<String> dbApNameArray = Arrays.stream(dbBizType.apNameArray)
.collect(Collectors.toSet());
//杩囨护鍑洪渶瑕佺Щ闄ょ殑灞炴��
@@ -1261,7 +1264,7 @@
/**
* 瀵煎嚭涓氬姟绫诲瀷
- * name 涓氬姟绫诲瀷鍚嶇О
+ * oid 涓氬姟绫诲瀷鍚嶇О
* @return 鍒涘缓缁撴灉
*/
@Override
@@ -1308,8 +1311,8 @@
String attrPath = attributeService.exportAttributes("btmattr",
attributes.stream().collect(Collectors.joining(",")),true);
//绉诲姩灞炴�у埌閾炬帴绫诲瀷鏂囦欢澶归噷闈㈠幓
- cn.hutool.core.io.FileUtil.move(new File(attrPath), new File(defaultTempFolder),true);
- cn.hutool.core.io.FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\")));
+ FileUtil.move(new File(attrPath), new File(defaultTempFolder),true);
+ FileUtil.del(attrPath.substring(0,attrPath.lastIndexOf("\\")));
}catch (IOException e) {
throw new RuntimeException(e);
}
@@ -1479,7 +1482,7 @@
if(StringUtils.isBlank(bizType.getfName())){
continue;
}
- if(bizType.getfName().equals(parentBIzType.getName())){
+ if(bizType.getfName().equals(parentBIzType.getId())){
Tree tree = new Tree();
tree.setOid(bizType.getOid());
tree.setParentName(parentBIzType.getfName());
--
Gitblit v1.9.3