xiejun
2023-10-17 b727fefd8bfb38400aec054df1f45f1174001cb9
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/CodeRuleServiceImpl.java
@@ -114,13 +114,7 @@
   private RevisionModelUtil revisionModelUtil;
   @Resource
   private NacosConfigCache nacosConfigCache;
   @Resource
   private ICodeFixedValueService codeFixedValueService;
   @Resource
   private ICodeClassifyValueService codeClassifyValueService;
   /**
    * 分页查询
@@ -129,13 +123,13 @@
    * @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()))
      if(!(AuthUtil.getTenantId().equals(NacosConfigCache.getAdminUserInfo().getTenantId())
         && AuthUtil.getUserId().toString().equals(NacosConfigCache.getAdminUserInfo().getUserId().toString()))
      ){
         // 按照规则所有者来查询
         conidtionMap.put("owner",AuthUtil.getUserId());
         conidtionMap.put("owner",AuthUtil.getUserId().toString());
      }
      IPage<CodeRule> codeRuleIPage = this.codeRuleMapper.selectPage(Condition.getPage(query), UBCSCondition.getQueryWrapper(conidtionMap, CodeRule.class));
      //do转vo同时setLcStatusText生命周期值,并包装成分页对象返回
@@ -170,11 +164,11 @@
    * @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())){
         wrapper.eq(CodeRule::getTenantId,codeRuleDTO.getTenantId());
      if(AuthUtil.getTenantId().equals(NacosConfigCache.getAdminUserInfo().getTenantId())){
         wrapper.eq(CodeRule::getTenantId,AuthUtil.getTenantId());
      }
      // 根据规则id查询编号
      List<CodeRule> codeRulesList = this.codeRuleMapper.selectList(wrapper);
@@ -331,7 +325,7 @@
    * @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;
@@ -347,7 +341,7 @@
    * @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);
   }
@@ -400,7 +394,7 @@
    * @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);
@@ -434,7 +428,7 @@
    * @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);
@@ -545,7 +539,7 @@
    * @return 规则的显示对象
    */
   @Override
   public CodeRuleVO getObjectHasSecByOid(String oid) {
   public CodeRuleVO getObjectHasSecByOid(String oid) throws VciBaseException {
      CodeRule ruleDO = selectByOid(oid);
      return codeRuleDO2VO(ruleDO, true);
   }