| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
| | | import com.vci.ubcs.code.bo.CodeClassifyFullInfoBO; |
| | | import com.vci.ubcs.code.entity.CodeClassify; |
| | | import com.vci.ubcs.code.entity.CodeClstemplateEntity; |
| | | import com.vci.ubcs.code.entity.CodeOsbtmtypeEntity; |
| | |
| | | private CodeOsbtmtypeMapper codeOsbtmtypeMapper; |
| | | @Resource |
| | | CodeOsbtmtypeattributeMapper codeOsbtmtypeattributeMapper; |
| | | @Resource |
| | | ICodeRuleService ICodeRuleService; |
| | | |
| | | /** |
| | | * 日志 |
| | |
| | | if(StringUtils.isBlank(oid)){ |
| | | throw new ServiceException("oid不能为空!"); |
| | | } |
| | | return codeClassifyMapper.checkHasChild(oid.trim()); |
| | | return !codeClassifyMapper.checkHasChild(oid.trim()); |
| | | } |
| | | |
| | | |
| | |
| | | //2、查询要删除的子类数据 |
| | | List<CodeClassify> codeClassifyDOList = codeClassifyMapper.selectBatchIds(s); |
| | | deletes.addAll(codeClassifyDOList); |
| | | codeClassifyMapper.deleteBatchIds(s); |
| | | // codeClassifyMapper.deleteBatchIds(s); |
| | | baseMapper.deleteBatchIds(s); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 主键获取主题库分类 |
| | | * @param oid 主键 |
| | | * @return 主题库分类显示对象 |
| | | * @throws VciBaseException 参数为空,数据不存在时会抛出异常 |
| | | */ |
| | | @Override |
| | | public CodeClassifyVO getObjectByOid(String oid) throws VciBaseException{ |
| | | return codeClassifyDO2VO(selectByOid(oid)); |
| | | } |
| | | |
| | | /** |
| | | * 使用编号的路径获取对象 |
| | | * |
| | | * @param idPath 编号的路径,一定要从最顶层节点开始,格式为xxx/yyy/zz 这样 |
| | |
| | | } |
| | | return oidList; |
| | | } |
| | | |
| | | /** |
| | | * 使用分类主键获取分类相关的所有信息 |
| | | * |
| | | * @param codeClassifyOid 分类的主键 |
| | | * @return 分类上级,下级的信息 |
| | | */ |
| | | @Override |
| | | public CodeClassifyFullInfoBO getClassifyFullInfo(String codeClassifyOid) { |
| | | VciBaseUtil.alertNotNull(codeClassifyOid,"分类的主键"); |
| | | CodeClassifyFullInfoBO fullInfo = new CodeClassifyFullInfoBO(); |
| | | CodeClassify classifyDO = selectByOid(codeClassifyOid); |
| | | //查询上级 |
| | | fullInfo.setCurrentClassifyVO(codeClassifyDO2VO(classifyDO)); |
| | | List<Map<String, Object>> maps = codeClassifyMapper.selectAllLevelParentByOid(codeClassifyOid); |
| | | List<CodeClassify> codeClassifyList = new ArrayList<>(); |
| | | for (Map<String, Object> map : maps) { |
| | | CodeClassify codeClassify = new CodeClassify(); |
| | | codeClassify.setOid(String.valueOf(map.get("OID"))); |
| | | codeClassify.setOid(String.valueOf(map.get("LEVEL"))); |
| | | codeClassifyList.add(codeClassify); |
| | | } |
| | | fullInfo.setParentClassifyVOs(codeClassifyDO2VOs(codeClassifyList)); |
| | | if(!CollectionUtils.isEmpty(fullInfo.getParentClassifyVOs())){ |
| | | fullInfo.setTopClassifyVO(fullInfo.getParentClassifyVOs().stream().filter(s->StringUtils.isBlank(s.getParentcodeclassifyoid())).findFirst().orElseGet(()->null)); |
| | | } |
| | | return fullInfo; |
| | | } |
| | | } |