| | |
| | | import com.vci.ubcs.starter.web.util.BeanUtilForVCI; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import com.vci.ubcs.starter.web.util.VciBaseUtil; |
| | | import com.vci.ubcs.system.cache.NacosConfigCache; |
| | | import org.apache.poi.hssf.util.HSSFColor; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | @Resource |
| | | private IBtmTypeClient btmTypeClient; |
| | | |
| | | @Value("${user-info.tenant-id}") |
| | | private String tenantId; |
| | | @Resource |
| | | private NacosConfigCache nacosConfigCache; |
| | | |
| | | /** |
| | | * 日志 |
| | |
| | | |
| | | @Override |
| | | public IPage<CodeClassifyVO> selectPlCodeClassifyPage(IPage<CodeClassifyVO> page, CodeClassifyVO plCodeClassify) { |
| | | return page.setRecords(codeClassifyMapper.selectPlCodeClassifyPage(page, plCodeClassify)); |
| | | return page.setRecords(codeClassifyMapper.selectPlCodeClassifyPage(page, plCodeClassify,AuthUtil.getTenantId() |
| | | .equals( |
| | | nacosConfigCache |
| | | .getAdminUserInfo() |
| | | .getTenantId() |
| | | ) ? null:AuthUtil.getTenantId())); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public R addSave(CodeClassify codeClassifyEntity) { |
| | | try { |
| | | VciBaseUtil.alertNotNull(codeClassifyEntity.getId(),"主题库编号不能为空!",codeClassifyEntity.getName(),"主题库名称不能为空!"); |
| | | }catch (VciBaseException e){ |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | if(StringUtils.isNotBlank(codeClassifyEntity.getParentCodeClassifyOid()) && StringUtils.isNotBlank(codeClassifyEntity.getBtmTypeId())){ |
| | | return R.fail("只有在顶层的主题库分类才能设置业务类型"); |
| | | } |
| | | if(StringUtils.isEmpty(codeClassifyEntity.getParentCodeClassifyOid()) && StringUtils.isBlank(codeClassifyEntity.getBtmTypeId())){ |
| | | return R.fail("主题库关联的业务类型不能为空!"); |
| | | } |
| | | QueryWrapper<CodeClassify> classifyQueryWrapper = new QueryWrapper<>(); |
| | | classifyQueryWrapper.eq("parentCodeClassifyOid",codeClassifyEntity.getParentCodeClassifyOid()); |
| | |
| | | // .selectOne(Condition.getQueryWrapper(condition,CodeClassify.class)); |
| | | if(detail == null){//不是最新的不让改 |
| | | throw new ServiceException("当前数据不是最新,请刷新后再修改!"); |
| | | // return R.fail("当前数据不是最新,请刷新后再修改!"); |
| | | } |
| | | //校验下级是否有引用 |
| | | if(checkChildIsLinked(detail.getOid())){ |
| | | return R.fail("dataCascadeLinkedNotDelete"); |
| | | } |
| | | if(checkHasChild(detail.getOid())){ |
| | | return R.fail("此数据有下级,无法进行删除!"); |
| | | } |
| | | return R.status(!checkHasChild(detail.getOid())); |
| | | } |
| | |
| | | } |
| | | if(StringUtils.isNotBlank(id) || StringUtils.isNotBlank(lcStatus) ){ |
| | | doList = codeClassifyMapper |
| | | .selectCodeClassifyDOByTree(treeQueryObject.getConditionMap().get("id"),treeQueryObject.getConditionMap().get("lcStatus"),treeQueryObject.getParentOid(), AuthUtil.getTenantId().equals(this.tenantId) ? "":AuthUtil.getTenantId()); |
| | | .selectCodeClassifyDOByTree(treeQueryObject.getConditionMap().get("id"),treeQueryObject.getConditionMap().get("lcStatus"),treeQueryObject.getParentOid(), AuthUtil.getTenantId() |
| | | .equals( |
| | | nacosConfigCache |
| | | .getAdminUserInfo() |
| | | .getTenantId() |
| | | ) ? null:AuthUtil.getTenantId()); |
| | | }else{ |
| | | doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid(), AuthUtil.getTenantId().equals(this.tenantId) ? "":AuthUtil.getTenantId()); |
| | | doList =codeClassifyMapper.selectCodeClassifyVOByTree(treeQueryObject.getParentOid(), AuthUtil.getTenantId() |
| | | .equals( |
| | | nacosConfigCache |
| | | .getAdminUserInfo() |
| | | .getTenantId() |
| | | ) ? null:AuthUtil.getTenantId()); |
| | | } |
| | | List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList); |
| | | TreeWrapperOptions treeWrapperOptions = new TreeWrapperOptions(PARENT_FIELD_NAME); |
| | |
| | | if(StringUtils.isNotBlank(libName)){ |
| | | libNameList=VciBaseUtil.str2List(libName); |
| | | } |
| | | List<CodeClassify> doList =codeClassifyMapper.getRMLibByName(libNameList,"Enabled",AuthUtil.getTenantId()); |
| | | List<CodeClassify> doList =codeClassifyMapper.getRMLibByName(libNameList,"Enabled",AuthUtil.getTenantId() |
| | | .equals( |
| | | nacosConfigCache |
| | | .getAdminUserInfo() |
| | | .getTenantId() |
| | | ) ? null:AuthUtil.getTenantId()); |
| | | List<CodeClassifyVO> voList = codeClassifyDO2VOs(doList); |
| | | return voList; |
| | | } |