Merge remote-tracking branch 'origin/master'
| | |
| | | package com.vci.ubcs.omd.constant; |
| | | |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | 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; |
| | |
| | | { |
| | | 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", "版本值"); |
| | |
| | | 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() { |
| | |
| | | pattern = "yyyy-MM-dd HH:mm:ss.SSS" |
| | | ) |
| | | private Date ts; |
| | | |
| | | /** |
| | | * 是否默认属性 |
| | | */ |
| | | private Boolean iseDfaultAttr; |
| | | } |
| | |
| | | && NacosConfigCache.getAdminUserInfo().getUserName().equals(AuthUtil.getUserName()); |
| | | } |
| | | |
| | | /** |
| | | * 从map中获取值,并且可以忽略大小写 |
| | | * @param map |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public static Object getMapValueIgnoreCase(Map<String, Object> map,String key){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | if (entry.getKey().equalsIgnoreCase(key)) { |
| | | return entry.getValue(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String getPk() { |
| | | return String.valueOf(getPKLong(1,1)); |
| | | } |
| | |
| | | #服务器端口 |
| | | server: |
| | | port: 8108 |
| | | port: 8114 |
| | | |
| | | #数据源配置 |
| | | spring: |
| | |
| | | if(!CollectionUtils.isEmpty(dataList)){ |
| | | for(Map data:dataList){ |
| | | CodeClassify codeClassifyDO = new CodeClassify(); |
| | | codeClassifyDO.setOid(VciBaseUtil.getStringValueFromObject(data.get("OID"))); |
| | | codeClassifyDO.setId(VciBaseUtil.getStringValueFromObject(data.get("ID"))); |
| | | codeClassifyDO.setName(VciBaseUtil.getStringValueFromObject(data.get("NAME"))); |
| | | codeClassifyDO.setBtmTypeId(VciBaseUtil.getStringValueFromObject(data.get("BTMTYPEID"))); |
| | | codeClassifyDO.setBtmTypeName(VciBaseUtil.getStringValueFromObject(data.get("BTMTYPENAME"))); |
| | | codeClassifyDO.setOid(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getMapValueIgnoreCase(data,"OID"))); |
| | | codeClassifyDO.setId(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getMapValueIgnoreCase(data,"ID"))); |
| | | codeClassifyDO.setName(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getMapValueIgnoreCase(data,"NAME"))); |
| | | codeClassifyDO.setBtmTypeId(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getMapValueIgnoreCase(data,"BTMTYPEID"))); |
| | | codeClassifyDO.setBtmTypeName(VciBaseUtil.getStringValueFromObject(VciBaseUtil.getMapValueIgnoreCase(data,"BTMTYPENAME"))); |
| | | oidList.add(codeClassifyDO); |
| | | } |
| | | } |
| | |
| | | import com.vci.ubcs.starter.revision.model.TreeQueryObject; |
| | | import com.vci.ubcs.starter.revision.model.TreeWrapperOptions; |
| | | import com.vci.ubcs.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid; |
| | | import com.vci.ubcs.starter.web.pagemodel.PageHelper; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | |
| | | } |
| | | |
| | | //设置btmtypeid和name |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeClassifyTemplateDO, MdmBtmTypeConstant.CODE_CLASSIFY_TEMPLATE); |
| | | CodeClassify codeClassifyDO = codeClassifyDOList.stream().filter(s -> StringUtils.isNotBlank(s.getBtmTypeId())).findFirst().get(); |
| | | codeClassifyTemplateDO.setBtmTypeId(codeClassifyDO.getBtmTypeId()); |
| | | codeClassifyTemplateDO.setNameOid(VciBaseUtil.getPk()); |
| | | codeClassifyTemplateDO.setBtmTypeName(codeClassifyDO.getBtmTypeName()); |
| | | codeClassifyTemplateDO.setLcStatus(FRAMEWORK_RELEASE_EDITING); |
| | | codeClassifyTemplateDO.setTs(new Date()); |
| | | codeClassifyTemplateDO.setOwner(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | codeClassifyTemplateDO.setLctid("codeClsTempLc"); |
| | | codeClassifyTemplateDO.setVersionValue("1"); |
| | | codeClassifyTemplateDO.setVersionSeq(1); |
| | | codeClassifyTemplateDO.setRevisionValue("1"); |
| | | codeClassifyTemplateDO.setRevisionSeq(1); |
| | | codeClassifyTemplateDO.setVersionRule("0"); |
| | | codeClassifyTemplateDO.setRevisionRule("numberversionrule"); |
| | | codeClassifyTemplateDO.setLastModifyTime(new Date()); |
| | | // codeClassifyTemplateDO.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | codeClassifyTemplateDO.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | // codeClassifyTemplateDO.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | codeClassifyTemplateDO.setCreator(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | codeClassifyTemplateDO.setCreateTime(new Date()); |
| | | codeClassifyTemplateDO.setLastV("1"); |
| | | codeClassifyTemplateDO.setLastR("1"); |
| | | codeClassifyTemplateDO.setFirstV("1"); |
| | | codeClassifyTemplateDO.setFirstR("1"); |
| | | codeClassifyTemplateDO.setBtmname("codeclstemplate"); |
| | | |
| | | baseMapper.insert(codeClassifyTemplateDO); |
| | | //默认添加模板属性 |
| | |
| | | conditionMap.put("t.lastr", "1"); |
| | | conditionMap.put("t.lastv", "1"); |
| | | DataGrid<Map<String, String>> mapDataGrid = queryGrid(btmTypeId, templateVO, conditionMap, pageHelper); |
| | | if(templateVO.getAttributes().isEmpty()){ |
| | | throw new ServiceException(String.format("主键为:{}的模板下,模板属性配置为空!",templateVO.getOid())); |
| | | } |
| | | //处理返回数据与模板数据配置的字段不一样问题 |
| | | templateVO.getAttributes().stream().forEach(e -> { |
| | | for (Map<String, String> datum : mapDataGrid.getData()) { |
| | |
| | | dataList.add(cbo); |
| | | wrapperData(dataList, templateVO, sqlBO.getSelectFieldList(), true); |
| | | R<List<Map<String, String>>> result = R.data(Collections.singletonList(cbo)); |
| | | if(templateVO.getAttributes().isEmpty()){ |
| | | throw new ServiceException(String.format("主键为:{}的模板下,模板属性配置为空!",templateVO.getOid())); |
| | | } |
| | | //处理返回数据与模板数据配置的字段不一样问题 |
| | | templateVO.getAttributes().stream().forEach(e -> { |
| | | for (Map<String, String> datum : result.getData()) { |
| | |
| | | MdmUIInfoVO uiInfoVO = getTableDefineByTemplateVO(getUsedTemplateByClassifyOid(codeClassifyOid)); |
| | | uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0); |
| | | if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) { |
| | | List<Menu> buttonVOS = iSysClient.getMenuButtonByType(codeClassifyOid, uiInfoVO.getTemplateVO().getBtmTypeId(), "data_auth").getData(); |
| | | // List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId); |
| | | // if (operationVOS == null) { |
| | | // operationVOS = new ArrayList<>(); |
| | | // } |
| | | // //查询扩展按钮 |
| | | // List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid); |
| | | // TODO:2024-1-25 18:42模板上的btmtypeid有时候会存在大小写的问题,按理来说这儿直接用functionId就能满足查询菜单按钮了uiInfoVO.getTemplateVO().getBtmTypeId() |
| | | List<Menu> buttonVOS = iSysClient.getMenuButtonByType(codeClassifyOid, functionId, "data_auth").getData(); |
| | | |
| | | List<SmOperationVO> operationVOS = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(buttonVOS)) { |
| | | for (int i = 0; i < buttonVOS.size(); i++) { |
| | |
| | | * 模板的服务 |
| | | */ |
| | | @Resource |
| | | private CodeClstemplateServiceImpl templateService; |
| | | private ICodeClstemplateService templateService; |
| | | |
| | | /** |
| | | * 主数据引擎的服务 |
| | |
| | | import com.vci.ubcs.ddl.bo.DdlTableInDataBaseBO; |
| | | import com.vci.ubcs.ddl.enums.BusinessTypeEnum; |
| | | import com.vci.ubcs.ddl.enums.ModifyTableTaskEnum; |
| | | import com.vci.ubcs.ddl.processor.ddl.DdlMapperProcessStrategy; |
| | | import com.vci.ubcs.ddl.processor.ddl.DdlMapperProcessor; |
| | | import com.vci.ubcs.ddl.processor.dll.DllMapperProcessor; |
| | | import com.vci.ubcs.ddl.processor.dll.DllMapperProcessorStrategy; |
| | | import com.vci.ubcs.ddl.properties.DdlPropertise; |
| | | import com.vci.ubcs.ddl.service.IDdlService; |
| | | import com.vci.ubcs.omd.cache.BtmTypeCache; |
| | |
| | | } |
| | | 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)); |
| | | } |
| | | |
| | | } |
| | |
| | | */ |
| | | List<BtmTypeAttributeVO> getAttributeByBtmTypeOid(String btmTypeOid); |
| | | |
| | | |
| | | /** |
| | | * 根据业务类型主键获取关联的所有属性对象 |
| | | * |
| | |
| | | */ |
| | | Map<String,List<BtmTypeAttributeVO>> batchListHasAttributesByIdCollection(Collection<String> idCollection) throws ServiceException; |
| | | |
| | | |
| | | /** |
| | | * 获取使用业务类型的链接类型 |
| | | * @param pkBtmType 业务类型主键 |
| | |
| | | * @return 个数 |
| | | */ |
| | | Integer countByLifeIds(Collection<String> lifeIds); |
| | | |
| | | /** |
| | | * 获取默认属性 |
| | | * @param defaultAttrType |
| | | * @return |
| | | */ |
| | | List<BtmTypeAttributeVO> getDefaultAttr(String defaultAttrType); |
| | | |
| | | } |
| | |
| | | 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(); |
| | |
| | | }); |
| | | 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; |
| | | } |
| | | |
| | | } |