Source/UBCS/ubcs-codeApply/src/main/java/com/vci/rmip/code/client/codeapply/Apply410/object/ubcscode/config/CodeRule.java
@@ -97,5 +97,4 @@ this.basicSecTypes = basicSecTypes; } } Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/dto/CodeClassifyDTO.java
@@ -70,9 +70,9 @@ private String codeResembleRuleOidName; /** * 是否参与校验,0:参与;1:不参与 * 是否参与校验,0:不参与;1:参与 */ private String isParticipateCheck; private Integer isParticipateCheck; public boolean getAblechildren() { return ablechildren; @@ -212,6 +212,14 @@ this.codeResembleRuleOidName = codeResembleRuleOidName; } public Integer getIsParticipateCheck() { return isParticipateCheck; } public void setIsParticipateCheck(Integer isParticipateCheck) { this.isParticipateCheck = isParticipateCheck; } @Override public String toString() { return "CodeClassifyDTO{" + Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeClassify.java
@@ -89,9 +89,9 @@ private String codeResembleRuleOid; /** * 是否参与校验,0:参与;1:不参与 * 是否参与校验,0:不参与;1:参与 */ private String isParticipateCheck; private Integer isParticipateCheck; /** * 相似项查询规则名称 Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/entity/CodeRule.java
@@ -16,7 +16,6 @@ */ package com.vci.ubcs.code.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.vci.ubcs.starter.constant.CodeTableNameConstant; import com.vci.ubcs.starter.revision.model.BaseModel; Source/UBCS/ubcs-service-api/ubcs-code-api/src/main/java/com/vci/ubcs/code/vo/pagemodel/CodeClassifyVO.java
@@ -63,9 +63,9 @@ private Integer dataLevel; /** * 是否参与校验,0:参与;1:不参与 * 是否参与校验,0:不参与;1:参与 */ private String isParticipateCheck; private Integer isParticipateCheck; /** * 层级的路径 Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/revision/service/RevisionModelUtil.java
@@ -58,7 +58,9 @@ }); tree.setOid((String)oidValues.stream().collect(Collectors.joining(wrapperOptions.getOidValueSep()))); tree.setName((String) VciBaseUtil.getValueFromField("name", doObject)); // TODO:业务数据总数统计暂时没完善 String total = (String) VciBaseUtil.getValueFromField("total", doObject); Integer isParticipateCheck = (Integer) VciBaseUtil.getValueFromField("isParticipateCheck", doObject); if(Func.isNotEmpty(total)){ tree.setCount("【"+total+"】"); } Source/UBCS/ubcs-service-api/ubcs-util-api/src/main/java/com/vci/ubcs/starter/web/pagemodel/Tree.java
@@ -30,6 +30,8 @@ private String index; private Map<String, String> attributes = new HashMap(); public Tree() { } @@ -243,6 +245,7 @@ } } @Override public String toString() { return "Tree{oid='" + this.oid + '\'' + ", text='" + this.text + '\'' + ", leaf=" + this.leaf + ", showCheckbox=" + this.showCheckbox + ", checked=" + this.checked + ", children=" + this.children + ", icon='" + this.icon + '\'' + ", iconCls='" + this.iconCls + '\'' + ", parentId='" + this.parentId + '\'' + ", parentName='" + this.parentName + '\'' + ", parentBtmName='" + this.parentBtmName + '\'' + ", expanded=" + this.expanded + ", href='" + this.href + '\'' + ", index='" + this.index + '\'' + ", attributes=" + this.attributes + '}'; Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/mapper/CodeClassifyMapper.java
@@ -174,4 +174,13 @@ * @return */ List<CodeClassify> selectAllClassifyByOid(@Param("oid") String oid,@Param("fieldInPath")String fieldInPath,@Param("tenantId") String tenantId); /** * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid * @param topOid * @param currentOid * @return */ List<CodeClassify> selectLeafByParentClassifyOid(@Param("topOid") String topOid,@Param("currentOid")String currentOid); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/ICodeClassifyService.java
@@ -11,6 +11,7 @@ import com.vci.ubcs.starter.revision.model.TreeQueryObject; import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; import com.vci.ubcs.starter.web.pagemodel.DataGrid;import com.vci.ubcs.starter.web.pagemodel.Tree; import org.apache.ibatis.annotations.Param; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.tool.api.R; import java.io.File; @@ -296,4 +297,12 @@ */ List<CodeClassifyVO> selectAllClassifyByOid(String oid, String fieldInPath); /** * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid * @param topOid * @param currentOid * @return */ String selectLeafByParentClassifyOid(String topOid, String currentOid); } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeClassifyServiceImpl.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -61,6 +62,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; @@ -179,6 +181,7 @@ * @return 执行结果 */ @Override @Transactional(rollbackFor = Exception.class) public R editSave(CodeClassify codeClassifyEntity) { if(codeClassifyEntity == null || codeClassifyEntity.getOid() == null){ return R.fail("传入数据不能为空!"); @@ -196,15 +199,28 @@ codeClassifyEntity.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); codeClassifyEntity.setLastModifyTime(new Date()); codeClassifyEntity.setTs(new Date()); int insertNumber = codeClassifyMapper.updateById(codeClassifyEntity); int updateEntity = codeClassifyMapper.updateById(codeClassifyEntity); // 如果不是叶子结点,则需要修改其下所有的子分类,是否参与关键属性校验的值 String oid = codeClassifyEntity.getOid(); List<CodeClassify> codeClassifies = codeClassifyMapper.selectStartWithCurrentOid(oid); int updateAttr = 0; // 不为空就需要该当前分类下所有子分类的isParticipateCheck if(!codeClassifies.isEmpty()){ List<String> oids = codeClassifies.stream().map(CodeClassify::getOid).collect(Collectors.toList()); updateAttr = codeClassifyMapper.update( null, Wrappers.<CodeClassify>update() .lambda().in(CodeClassify::getOid, oids) .set(CodeClassify::getIsParticipateCheck, codeClassifyEntity.getIsParticipateCheck()) ); } // //处理数据集成逻辑,成功后执行集成第一步,分类数据特殊处理。只有启用状态的分类才推送 // if(FRAMEWORK_DATA_ENABLED.equals(codeClassifyDO.getLcStatus())); // { // codeDuckingServiceI.insertCache1(CACHE_TYPE_CLASSIFY_EDIT,FRAMEWORK_DATA_ENABLED,DOCKING_DEFAULT_CLASSIFY, DOCKING_DEFAULT_CLASSIFYOID, codeClassifyDO.getOid(), codeClassifyDTO.getTs()); // } return R.status(SqlHelper.retBool(insertNumber)); // return BaseResult.success(codeClassifyDO2VO(codeClassifyDO)); return R.status(SqlHelper.retBool(updateAttr) & SqlHelper.retBool(updateEntity)); } /** @@ -644,6 +660,22 @@ List<CodeClassifyVO> voList = codeClassifyDO2VOs(codeClassifyList); return voList; } /** * 根据顶层节点oid查询所有除当前节点以外所有不参与校验的分类oid * @param topOid * @param currentOid * @return */ @Override public String selectLeafByParentClassifyOid(String topOid, String currentOid) { List<CodeClassify> codeClassifies = codeClassifyMapper.selectLeafByParentClassifyOid(topOid, currentOid); if(codeClassifies.isEmpty()){ return ""; } String oids = codeClassifies.stream().map(CodeClassify::getOid).collect(Collectors.joining(",")); return oids; } /*** @@ -1357,4 +1389,6 @@ return codeClassifyMapper.selectCount(wrapper).intValue(); } } Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -856,7 +856,7 @@ String idFieldName = attrVOS.stream().filter(s -> VciQueryWrapperForDO.ID_FIELD.equalsIgnoreCase(s.getId())).findFirst().orElseGet(() -> new CodeClassifyTemplateAttrVO()).getName(); getFieldIndexMap(titleRowData, attrNameIdMap, fieldIndexMap); //先不用管属性是否都存在,先转换一下数据 List<ClientBusinessObject> cboList = new ArrayList<>(); List<ClientBusinessObject> cboList = new CopyOnWriteArrayList<>(); String fullPath = getFullPath(classifyFullInfo); //我们需要获取到所有的下级分类的oid的路径,因为后面需要 Map<String/**主键**/, String/**路径**/> childOidPathMap = getChildClassifyPathMap(classifyFullInfo, fullPath); @@ -3729,6 +3729,7 @@ } } } /** * 处理分类注入 * @param attrVOS 模板属性 @@ -3818,7 +3819,9 @@ //2.判断关键属性在系统里是否重复 //因为数据量很大,所以得想办法并行 //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); Map<String,List<BaseModel>> indexTODataMap=new HashMap<>(); Map<String,List<BaseModel>> indexTODataMap=new ConcurrentHashMap<>(); // 查询不需要参与关键属性校验的除自己以外的所有分类oid String isParticipateCheckOids = classifyService.selectLeafByParentClassifyOid(classifyFullInfo.getTopClassifyVO().getOid(), classifyFullInfo.getCurrentClassifyVO().getOid()); List<ClientBusinessObject> repeatDataMap = cboList.parallelStream().filter(cbo -> { //每行都得查询.如果其中出现了错误,我们就直接抛出异常,其余的显示 //VciBaseUtil.setCurrentUserSessionInfo(sessionInfo); @@ -3832,6 +3835,10 @@ engineService.wrapperKeyAttrConditionMap(value, keyRuleVO, attrId, trim, ignoreCase, ignoreWidth, trimAll, conditionMap); }); if (!CollectionUtils.isEmpty(ketAttrMap)) { // 添加不参与关键属性校验的分类oid判断 if(Func.isNotBlank(isParticipateCheckOids)){ conditionMap.put("t.codeclsfid",QueryOptionConstant.NOTIN+isParticipateCheckOids); } CodeTemplateAttrSqlBO sqlBO = engineService.getSqlByTemplateVO(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, null); boolean isKeyCheck= commonsMapper.queryCountBySql(sqlBO.getSqlCount()) > 0; if(isKeyCheck){ Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeBasicSecMapper.xml
@@ -69,6 +69,8 @@ <result property="referBtmName" column="REFERBTMNAME" jdbcType="VARCHAR"/> <result property="referBtmId" column="REFERBTMID" jdbcType="VARCHAR"/> <result property="referCodeClassifyOidName" column="c__name" jdbcType="VARCHAR"/> <result property="prefixCode" column="PREFIXCODE" jdbcType="VARCHAR"/> <result property="suffixCode" column="SUFFIXCODE" jdbcType="VARCHAR"/> </resultMap> <select id="selectCodeBasicSecPage" resultMap="CodeBasicsecMap"> @@ -135,6 +137,8 @@ PL_CODE_BASICSEC.serialdependorder, PL_CODE_BASICSEC.nullableflag, PL_CODE_BASICSEC.codefilllimit, PL_CODE_BASICSEC.prefixcode, PL_CODE_BASICSEC.suffixcode, btm_codebasicsec_1.name as b__name, platformbtm_codeclassify.name as c__name, COUNT(*) OVER () "##VCI_COUNT_VCI##" Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CodeCLassifyMapper.xml
@@ -37,6 +37,7 @@ <result column="CODERULEOID" property="codeRuleOid"/> <result column="CODEKEYATTRREPEATOID" property="codeKeyAttrRepeatOid"/> <result column="CODERESEMBLERULEOID" property="codeResembleRuleOid"/> <result column="ISPARTICIPATECHECK" property="isParticipateCheck"/> <result column="TENANT_ID" property="tenantId"/> <result column="TOTAL" property="total"/> </resultMap> @@ -88,7 +89,8 @@ codeclassify0.TENANT_ID as tenantId , coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName coderesembleruleoid.name as codeResembleRuleOidName, codeclassify0.ISPARTICIPATECHECK as isParticipateCheck from pl_code_classify codeclassify0 left join pl_code_rule coderuleoid on codeclassify0.codeRuleOid = coderuleoid.oid @@ -111,7 +113,6 @@ order by lastmodifytime asc </select> <!--codeclassify0.parentCodeClassifyOid = '${oid}'--> <select id="selectAllLevelChildHasPath" resultMap="plCodeClassifyResultMap"> select codeclassify0.OWNER as owner, codeclassify0.BTMTYPEID as btmtypeid, @@ -132,6 +133,7 @@ codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid, codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName, @@ -214,7 +216,8 @@ codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.namePath as namepath, codeclassify0.idPath as idpath codeclassify0.idPath as idpath, codeclassify0.ISPARTICIPATECHECK as isParticipateCheck from (select plcodeclassify.*, SYS_CONNECT_BY_PATH(name, '#') as namePath, SYS_CONNECT_BY_PATH(id, '#') as idPath @@ -243,7 +246,8 @@ codeclassify0.CODERESEMBLERULEOID as coderesembleruleoid, codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.paths as paths codeclassify0.paths as paths, codeclassify0.ISPARTICIPATECHECK as isParticipateCheck from (select plcodeclassify.*, <choose> <when test='fieldName=="name"'> @@ -297,6 +301,7 @@ codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.TENANT_ID as tenantId , codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName @@ -359,7 +364,8 @@ codeclassify0.TENANT_ID as tenantId , coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName coderesembleruleoid.name as codeResembleRuleOidName, codeclassify0.ISPARTICIPATECHECK as isParticipateCheck from pl_code_classify codeclassify0 left join pl_code_rule coderuleoid on codeclassify0.codeRuleOid = coderuleoid.oid @@ -401,6 +407,7 @@ codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.TENANT_ID as tenantId , codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName @@ -446,6 +453,7 @@ codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.TENANT_ID as tenantId , codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName @@ -488,6 +496,7 @@ codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.TENANT_ID as tenantId , codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName @@ -532,6 +541,7 @@ codeclassify0.LCSTATUS as lcstatus, codeclassify0.TS as ts, codeclassify0.TENANT_ID as tenantId , codeclassify0.ISPARTICIPATECHECK as isParticipateCheck, coderuleoid.name as codeRuleOidName, codekeyattrrepeatoid.name as codeKeyAttrRepeatOidName, coderesembleruleoid.name as codeResembleRuleOidName @@ -574,4 +584,28 @@ connect by p.oid = prior p.PARENTCODECLASSIFYOID </select> <select id="selectLeafByParentClassifyOid" resultType="com.vci.ubcs.code.entity.CodeClassify"> select * from ( select oid, name, id, level lvl, isparticipatecheck, nvl((select 'N' from PL_CODE_CLASSIFY pcc1 where pcc.oid = pcc1.PARENTCODECLASSIFYOID and rownum < 2),'Y') is_leaf from PL_CODE_CLASSIFY pcc start with pcc.PARENTCODECLASSIFYOID = #{topOid} connect by pcc.PARENTCODECLASSIFYOID = prior oid ) plcls where is_leaf = 'Y' and isparticipatecheck = 0 and oid != #{currentOid} </select> </mapper> Source/UBCS/ubcs-service/ubcs-system/src/main/java/com/vci/ubcs/system/service/impl/MenuServiceImpl.java
@@ -74,7 +74,7 @@ @Override public List<MenuVO> lazyList(Long parentId, Map<String, Object> param) { int i = 1 / 0; //int i = 1 / 0; if (Func.isEmpty(Func.toStr(param.get(PARENT_ID)))) { parentId = null; }