| | |
| | | import com.vci.ubcs.starter.revision.model.TreeWrapperOptions; |
| | | import com.vci.ubcs.starter.revision.service.RevisionModelUtil; |
| | | import com.vci.ubcs.starter.util.BladeTreeQueryObject; |
| | | import com.vci.ubcs.starter.util.DefaultAttrAssimtUtil; |
| | | import com.vci.ubcs.starter.util.LocalFileUtil; |
| | | import com.vci.ubcs.starter.util.MdmBtmTypeConstant; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.DataGrid; |
| | | import com.vci.ubcs.starter.web.pagemodel.Tree; |
| | |
| | | return page.setRecords(codeClassifyMapper.selectPlCodeClassifyPage(page, plCodeClassify)); |
| | | } |
| | | |
| | | /** |
| | | * 主题库定义表 新增 |
| | | * @param |
| | | */ |
| | | @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()); |
| | |
| | | codeClassifyEntity.setBtmTypeId(codeClassify.getBtmTypeId()); |
| | | codeClassifyEntity.setBtmTypeName(codeClassify.getBtmTypeName()); |
| | | } |
| | | codeClassifyEntity.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | codeClassifyEntity.setCreateTime(new Date()); |
| | | codeClassifyEntity.setTs(new Date()); |
| | | codeClassifyEntity.setOwner(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | codeClassifyEntity.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | codeClassifyEntity.setLastModifyTime(new Date()); |
| | | codeClassifyEntity.setRevisionSeq(1); |
| | | codeClassifyEntity.setVersionSeq(1); |
| | | DefaultAttrAssimtUtil.addDefaultAttrAssimt(codeClassifyEntity, MdmBtmTypeConstant.CODE_CLASSIFY); |
| | | codeClassifyEntity.setLcStatus(FRAMEWORK_DATA_ENABLED); |
| | | int insertNumber = codeClassifyMapper.insert(codeClassifyEntity); |
| | | return R.status(SqlHelper.retBool(insertNumber)); |
| | | } |
| | |
| | | // .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())); |
| | | } |
| | |
| | | @Override |
| | | public R updateLcStatus(String oid, String lcStatus){ |
| | | |
| | | //查询修改前ts |
| | | CodeClassify codeClassify = codeClassifyMapper.selectById(oid);//主要是为了查询ts |
| | | codeClassify.setLcStatus(lcStatus); |
| | | codeClassify.setTs(new Date()); |
| | | codeClassify.setLastModifyTime(new Date()); |
| | | codeClassify.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | List<CodeClassify> classifyList = codeClassifyMapper.selectStartWithCurrentOid(oid); |
| | | Date now = new Date(); |
| | | String userId = String.valueOf(AuthUtil.getUserId()); |
| | | classifyList = classifyList.stream().map(s -> { |
| | | s.setLcStatus(lcStatus); |
| | | s.setTs(now); |
| | | s.setLastModifier(userId); |
| | | s.setLastModifyTime(now); |
| | | return s; |
| | | }).collect(Collectors.toList()); |
| | | // //查询修改前ts |
| | | // CodeClassify codeClassify = codeClassifyMapper.selectById(oid);//主要是为了查询ts |
| | | // codeClassify.setLcStatus(lcStatus); |
| | | // codeClassify.setTs(new Date()); |
| | | // codeClassify.setLastModifyTime(new Date()); |
| | | // codeClassify.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | //启用、停用 |
| | | // int u = codeClassifyMapper.updateLcStatus(oid,lcStatus); |
| | | int count = codeClassifyMapper.updateById(codeClassify); |
| | | // int count = codeClassifyMapper.updateById(codeClassify); |
| | | codeClassifyMapper.batchUpdateLcStatus(classifyList); |
| | | // //处理数据集成逻辑,成功后执行集成第一步,分类数据特殊处理。 |
| | | // if(u!=0) { |
| | | // codeDuckingServiceI.insertCache1(lcStatus,lcStatus,DOCKING_DEFAULT_CLASSIFY, DOCKING_DEFAULT_CLASSIFYOID, oid, codeClassifyDO_old.getTs()); |
| | | // } |
| | | return R.data(SqlHelper.retBool(count)); |
| | | // return R.data(SqlHelper.retBool(count)); |
| | | return R.success(""); |
| | | } |
| | | |
| | | /** |
| | |
| | | Map<String, CodeRuleVO> ruleVOMap = new HashMap<>(); |
| | | if(!CollectionUtils.isEmpty(codeRuleOids)){ |
| | | VciBaseUtil.switchCollectionForOracleIn(codeRuleOids).stream().forEach(ruleOids->{ |
| | | // Collection<CodeRuleVO> ruleVOS = codeRuleService.listCodeRuleByOids(ruleOids); |
| | | Collection<CodeRuleVO> ruleVOS = null; |
| | | Collection<CodeRuleVO> ruleVOS = codeRuleService.listCodeRuleByOids(ruleOids); |
| | | // Collection<CodeRuleVO> ruleVOS = null; |
| | | ruleVOMap.putAll( Optional.ofNullable(ruleVOS).orElseGet(()->new ArrayList<>()).stream().collect(Collectors.toMap(s->s.getOid(),t->t))); |
| | | }); |
| | | } |
| | |
| | | excelDataList.add(new WriteExcelData(0,9,"状态")); |
| | | excelDataList.add(new WriteExcelData(0,10,"分类层级")); |
| | | excelDataList.add(new WriteExcelData(0,11,"描述")); |
| | | codeClassifyVOS = codeClassifyVOS.stream().sorted(Comparator.comparing(CodeClassifyVO::getDataLevel)).collect(Collectors.toList()); |
| | | for (int i = 0; i < codeClassifyVOS.size(); i++) { |
| | | CodeClassifyVO vo = codeClassifyVOS.get(i); |
| | | excelDataList.add(new WriteExcelData(i+1,0,vo.getId())); |
| | |
| | | Map<String,CodeKeyAttrRepeatRuleVO> keyRuleVOMap =Optional.ofNullable(keyOids.size()==0 ? null: iCodeKeyattrrepeatService.listCodeKeyAttrRepeatRuleByOids(keyOids) |
| | | ).orElse(new ArrayList<>()).stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t,(o1,o2)->o2)); |
| | | |
| | | List<String> btmOids = poList.stream().filter(s -> StringUtils.isNotBlank(s.getKeyRepeatRuleId())) |
| | | List<String> btmOids = poList.stream().filter(s -> StringUtils.isNotBlank(s.getBtmTypeId())) |
| | | .map(CodeClassifyPO::getBtmTypeId).collect(Collectors.toList()); |
| | | Map<String, BtmTypeVO> btmVOMap = Optional |
| | | .ofNullable(btmOids.size()==0 ? null: btmTypeClient.selectByIdCollection(btmOids).getData()) |