| | |
| | | @Resource |
| | | private ICodeFixedValueService codeFixedValueService; |
| | | |
| | | @Resource |
| | | private ICodeClassifyValueService codeClassifyValueService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param query |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) { |
| | | public IPage<CodeRuleVO> gridCodeRule(Query query, Map<String,Object> conidtionMap) throws VciBaseException { |
| | | //如果等于自己配置的管理组租户id和管理组超管账号,就不需要按照规则所有者来进行查询 |
| | | if(!(AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId()) |
| | | && AuthUtil.getUserId().toString().equals(nacosConfigCache.getAdminUserInfo().getUserId().toString())) |
| | |
| | | * @return 返回false表示未重复 |
| | | */ |
| | | @Override |
| | | public boolean checkCodeRuleRepeat(CodeRuleDTO codeRuleDTO){ |
| | | public boolean checkCodeRuleRepeat(CodeRuleDTO codeRuleDTO)throws VciBaseException { |
| | | LambdaQueryWrapper<CodeRule> wrapper = Wrappers.<CodeRule>query() |
| | | .lambda().eq(CodeRule::getId, codeRuleDTO.getId()); |
| | | if(AuthUtil.getTenantId().equals(nacosConfigCache.getAdminUserInfo().getTenantId())){ |
| | |
| | | * @return true表示已经使用,false表示未被使用 |
| | | */ |
| | | @Override |
| | | public boolean isAlreadyInUse(String oid) { |
| | | public boolean isAlreadyInUse(String oid) throws VciBaseException { |
| | | Collection<CodeClassifyVO> codeClassifyVOS = listUseRangeInCodeClassify(oid); |
| | | if (codeClassifyVOS.size() > 0) { |
| | | return true; |
| | |
| | | * @return 主题库分类使用到该编码规则的所有集合 |
| | | */ |
| | | @Override |
| | | public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) { |
| | | public Collection<CodeClassifyVO> listUseRangeInCodeClassify(String oid) throws VciBaseException { |
| | | List<CodeClassify> codeClassifies = codeClassifyServcie.selectByWrapper(Wrappers.<CodeClassify>query().lambda().eq(CodeClassify::getCodeRuleOid, oid)); |
| | | return CodeClassifyWrapper.build().listVO(codeClassifies); |
| | | } |
| | |
| | | * @param oidCollections 主键的集合 |
| | | * @return 数据对象列表 |
| | | */ |
| | | private List<CodeRule> listCodeRuleDOByOidCollections(Collection<String> oidCollections) { |
| | | private List<CodeRule> listCodeRuleDOByOidCollections(Collection<String> oidCollections) throws VciBaseException { |
| | | List<CodeRule> codeRuleDOList = new ArrayList<CodeRule>(); |
| | | if (!CollectionUtils.isEmpty(oidCollections)) { |
| | | Collection<Collection<String>> oidCollectionsList = VciBaseUtil.switchCollectionForOracleIn(oidCollections); |
| | |
| | | * @return 执行结果 |
| | | */ |
| | | @Override |
| | | public R updateStatus(String oid, String update) { |
| | | public R updateStatus(String oid, String update) throws VciBaseException { |
| | | int count = 0; |
| | | //先查询对象 |
| | | CodeRule codeRuleDO = selectByOid(oid); |
| | |
| | | * @return 规则的显示对象 |
| | | */ |
| | | @Override |
| | | public CodeRuleVO getObjectHasSecByOid(String oid) { |
| | | public CodeRuleVO getObjectHasSecByOid(String oid) throws VciBaseException { |
| | | CodeRule ruleDO = selectByOid(oid); |
| | | return codeRuleDO2VO(ruleDO, true); |
| | | } |