Source/UBCS/ubcs-service-api/ubcs-omd-api/src/main/java/com/vci/ubcs/omd/vo/BtmTypeAttributeVO.java
@@ -14,9 +14,9 @@ * @date 2019/10/11 5:33 PM */ @Data @EqualsAndHashCode(callSuper = true) //@EqualsAndHashCode(callSuper = true) @ApiModel(value = "业务类型包含的属性对象", description = "业务类型包含的属性对象") public class BtmTypeAttributeVO extends BtmTypeAttribute { public class BtmTypeAttributeVO { /** * 禁止修改这个值 @@ -71,7 +71,7 @@ /** * 是否可以为空 */ private boolean nullableFlag; private boolean nullableFlag = true; /** * 默认值 Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/processor/dll/DllMapperProcessor.java
@@ -16,6 +16,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Locale; /** * Description:DLL的处理接口 @@ -143,7 +144,7 @@ } mappingBO.setNullable(attributeVO.isNullableFlag()); mappingBO.setDefaultValue(attributeVO.getDefaultValue()); return mappingBO.toString() + (StringUtil.equals(attributeVO.getId(),"OID") ? StringPool.SPACE + "primary key" + StringPool.SPACE : ""); return mappingBO.toString() + (StringUtil.equals(attributeVO.getId().toLowerCase(Locale.ROOT),"OID".toLowerCase(Locale.ROOT)) ? StringPool.SPACE + "primary key" + StringPool.SPACE : ""); } Source/UBCS/ubcs-service/ubcs-ddl/src/main/java/com/vci/ubcs/ddl/service/impl/DdlServiceImpl.java
@@ -976,26 +976,39 @@ */ @Override public R<List<ModifyAttributeInfo>> submit(BtmAndLinkTypeDdlDTO ddlDTO) { //try { try { List<ModifyAttributeInfo> changedList = new ArrayList<>(); if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) { List<BtmTypeVO> btmTypeList = ddlDTO.getBtmTypeList(); //putBtm(btmTypeList.toArray(new BtmTypeVO[0])); putBtm(btmTypeList.toArray(new BtmTypeVO[0])); changedList.addAll(checkDifferent(btmTypeList, null)); //removeBtm(btmTypeList.toArray(new BtmTypeVO[0])); removeBtm(btmTypeList.toArray(new BtmTypeVO[0])); } if (!CollectionUtils.isEmpty(ddlDTO.getLinkTypeList())) { List<LinkTypeVO> linkTypeList = ddlDTO.getLinkTypeList(); //putLink(linkTypeList.toArray(new LinkTypeVO[0])); putLink(linkTypeList.toArray(new LinkTypeVO[0])); changedList.addAll(checkDifferent(null,linkTypeList)); //removeLink(linkTypeList.toArray(new LinkTypeVO[0])); removeLink(linkTypeList.toArray(new LinkTypeVO[0])); } R<List<ModifyAttributeInfo>> result = R.success("数据库操作成功"); result.setData(changedList); return result; //} catch (ServiceException e) { //throw new RuntimeException(e.getMessage()); // } } catch (VciBaseException e) { try { // 建表失败有异常,捕获后返回,并释放线程中的内容 if (!CollectionUtils.isEmpty(ddlDTO.getBtmTypeList())) { removeBtm(ddlDTO.getBtmTypeList().toArray(new BtmTypeVO[0])); } if (!CollectionUtils.isEmpty(ddlDTO.getLinkTypeList())) { removeLink(ddlDTO.getLinkTypeList().toArray(new LinkTypeVO[0])); } return R.fail(e.getMessage()); }catch (ServiceException e2){ throw new RuntimeException(e2.getMessage()); } } catch (ServiceException e) { throw new RuntimeException(e.getMessage()); } } /** @@ -1056,7 +1069,7 @@ BtmTypeAttributeVO attributeVO = new BtmTypeAttributeVO(); attributeVO.setId(col.getId().toLowerCase()); attributeVO.setName(col.getName()); attributeVO.setNullableFlag(col.getNullableFlag()); attributeVO.setNullableFlag(StringUtils.equals(col.getNullableFlag(), BooleanEnum.TRUE.getValue())); attributeVO.setAttributeLength(col.getAttributeLength()); attributeVO.setPrecisionLength(col.getPrecisionLength()); attributeVO.setScaleLength(col.getScaleLength()); Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/service/impl/BtmAttributeServiceImpl.java
@@ -177,7 +177,7 @@ /** * 获取默认字段 * * 默认字段均不可为空 * @param btmType 业务类型 * @return 执行结果 */ @@ -186,15 +186,12 @@ List<BtmTypeAttributeVO> list = new ArrayList<>(); // 业务类型的基本字段 BtmTypeFieldConstant.BASIC_FIELD_MAP.forEach((id,name) -> { id = id.toLowerCase(Locale.ROOT); BtmTypeAttributeVO vo = new BtmTypeAttributeVO(); vo.setId(id); vo.setName(name); vo.setPkBtmType(btmType.getOid()); if (StringUtils.equals(id,"oid")){ vo.setNullableFlag(false); }else { vo.setNullableFlag(true); } vo.setNullableFlag(false); if (Arrays.asList("createtime","lastmodifytime","owner").contains(id)){ vo.setAttrDataType(VciFieldTypeEnum.VTDateTime.name()); vo.setAttributeLength(6); @@ -213,6 +210,8 @@ vo.setName(name); vo.setPkBtmType(btmType.getOid()); vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); // 版本规则字段不能为空 vo.setNullableFlag(false); vo.setAttributeLength(150); if (Arrays.asList("lastr","firstr","lastv","firstv","revisionseq","versionseq","revisionvalue","versionvalue").contains(id)){ vo.setAttributeLength(5); @@ -233,6 +232,7 @@ vo.setId(id); vo.setName(name); vo.setPkBtmType(btmType.getOid()); vo.setNullableFlag(false); vo.setAttributeLength(50); vo.setAttrDataType(VciFieldTypeEnum.VTString.name()); list.add(vo); @@ -246,6 +246,7 @@ vo.setId(id); vo.setName(name); vo.setPkBtmType(btmType.getOid()); vo.setNullableFlag(false); vo.setAttributeLength(5); vo.setAttrDataType(VciFieldTypeEnum.VTInteger.name()); list.add(vo);