| | |
| | | } |
| | | codeAllCodeService.updateBatchById(codeCbos); |
| | | } |
| | | |
| | | /** |
| | | * 申请单一编码 |
| | | * |
| | |
| | | */ |
| | | @Override |
| | | public String addSaveCode(CodeOrderDTO orderDTO) throws Exception { |
| | | return addSaveCode(orderDTO,true); |
| | | return addSaveCode(orderDTO,true); |
| | | } |
| | | |
| | | /*** |
| | |
| | | public String addSaveCodeNotauthUser(CodeOrderDTO orderDTO, boolean authUser) throws Exception { |
| | | return addSaveCode(orderDTO,authUser); |
| | | } |
| | | |
| | | /** |
| | | * 申请单一编码 |
| | | * |
| | |
| | | //9.生成编码的信息 |
| | | // ClientBusinessObject cbo = boService.createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()); |
| | | BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmTypeId()); |
| | | // //默认的属性都不用从前端拷贝 |
| | | // //设置编码需要的默认属性的内容 |
| | | //默认的属性都不用从前端拷贝 |
| | | //设置编码需要的默认属性的内容 |
| | | copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false); |
| | | cbo.setOid(VciBaseUtil.getPk()); |
| | | cbo.setRevisionOid(VciBaseUtil.getPk()); |
| | |
| | | if(StringUtils.isNotBlank(orderDTO.getLcStatus())||StringUtils.isNotBlank(orderDTO.getData().get("lcStatus"))){ |
| | | cbo.setLcStatus(StringUtils.isNotBlank(orderDTO.getLcStatus())?orderDTO.getLcStatus():orderDTO.getData().get("lcStatus")); |
| | | } |
| | | // //TODO:因为默认的属性都不拷贝,目前集团码叫name,并没有从DTO拷贝到cbo里。增加一个单独处理,以后再看要不要调整 |
| | | //TODO:因为默认的属性都不拷贝,目前集团码叫name,并没有从DTO拷贝到cbo里。增加一个单独处理,以后再看要不要调整 |
| | | cbo.setName(orderDTO.getName() == null ? "" : orderDTO.getName()); |
| | | // //end -- modify by lihang @20220407 |
| | | //end -- modify by lihang @20220407 |
| | | List<BaseModel> cboList = new ArrayList<>(); |
| | | |
| | | //备注 |
| | |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断编码的码段是否输入或者选择了码值 |
| | |
| | | data.put(cbo.getData().containsKey(CODE_FULL_PATH_FILED.toUpperCase())?CODE_FULL_PATH_FILED.toUpperCase():CODE_FULL_PATH_FILED, fullPath); |
| | | cbo.getData().putAll(data); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | //cbo.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | cbo.setLastModifier(AuthUtil.getUser().getAccount()); |
| | | cbo.setTs(new Date()); |
| | | if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) { |
| | | //TODO 先写固定,后面生命周期好了在编写 |
| | |
| | | List<CodeClassifyTemplateAttrVO> selectAttrVOs = templateVO.getAttributes().stream().filter(s -> StringUtils.isNotBlank(s.getLibraryIdentification())).collect(Collectors.toList()); |
| | | |
| | | if (!CollectionUtils.isEmpty(selectAttrVOs)) { |
| | | // SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | //SessionInfo sessionInfo = VciBaseUtil.getCurrentUserSessionInfo(); |
| | | selectAttrVOs.parallelStream().forEach(attrVO -> { |
| | | List<String> valuesList = new ArrayList<>(); |
| | | cboList.parallelStream().forEach(cbo -> { |
| | | // String value = cbo.get.getAttributeValue(attrVO.getId()); |
| | | //String value = cbo.get.getAttributeValue(attrVO.getId()); |
| | | |
| | | //将bean转为map,mybatis统一处理 |
| | | Map<String, String> map = null; |
| | | |
| | | // baseModels.stream().forEach(model-> { |
| | | //baseModels.stream().forEach(model-> { |
| | | try { |
| | | map = VciBaseUtil.convertBean2Map(cbo,null); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.getMessage()); |
| | | } |
| | | // }); |
| | | //}); |
| | | |
| | | String value = map.get(attrVO.getId()); |
| | | if (StringUtils.isNotBlank(value)) { |
| | |
| | | } |
| | | // cbo.getData().putAll(orderDTO.getData()); |
| | | cbo.setLastModifyTime(new Date()); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | R r = updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo)); |
| | | if(!r.isSuccess()){ |
| | | throw new ServiceException(r.getMsg()); |
| | |
| | | cbo.setLastModifyTime(cbo.getLastModifyTime()); |
| | | cbo.setTenantId(AuthUtil.getTenantId()); |
| | | oldCbo.setLastV("0"); |
| | | oldCbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | oldCbo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | oldCbo.setLastModifyTime(new Date()); |
| | | try { |
| | | updateBatchByBaseModel(oldCbo.getBtmname(), Collections.singletonList(oldCbo)); |
| | |
| | | } |
| | | List<CodeClassifyVO> parentClassifyVOList = fullInfoBO.getParentClassifyVOs().stream().sorted((o1, o2) -> o1.getDataLevel().compareTo(o2.getDataLevel())).collect(Collectors.toList()); |
| | | //从最高的level开始获取 |
| | | for (int i = 0; i < parentClassifyVOList.size(); i++) { |
| | | for (int i = parentClassifyVOList.size()-1; i >= 0; i--) { |
| | | CodeClassifyVO record = parentClassifyVOList.get(i); |
| | | if (StringUtils.isNotBlank(record.getCodeRuleOid())) { |
| | | codeRuleOid = record.getCodeRuleOid(); |
| | |
| | | if(cboMap.containsKey(oid)){ |
| | | CodeAllCode codeAllCode= cboMap.get(oid); |
| | | codeAllCode.setId(baseModel.getId()); |
| | | codeAllCode.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | // codeAllCode.setLastModifier(AuthUtil.getUser().getUserName()); |
| | | codeAllCode.setLastModifier(AuthUtil.getUser().getAccount()); |
| | | codeAllCode.setLastModifyTime(new Date()); |
| | | codeAllCode.setLcStatus(baseModel.getLcStatus()); |
| | | newCodeAllCodeList.add(codeAllCode); |
| | |
| | | toBo.setFirstR(String.valueOf(0)); |
| | | toBo.setFirstV(String.valueOf(1)); |
| | | toBo.setLastV(String.valueOf(1)); |
| | | toBo.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | // 数据升版不需要重新设置创建人,只对最后修改人做更新就可以了 |
| | | //toBo.setCreator(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | toBo.setCreateTime(new Date()); |
| | | toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | // toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId())); |
| | | toBo.setLastModifier(String.valueOf(AuthUtil.getUser().getAccount())); |
| | | toBo.setLastModifyTime(new Date()); |
| | | toBo.setRevisionRule(fromBo.getRevisionRule()); |
| | | toBo.setVersionRule(fromBo.getVersionRule());R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname())); |
| | |
| | | toBo.getData().putAll(fromBo.getData()); |
| | | toBo.getData().put("CHECKINBY", String.valueOf(AuthUtil.getUser().getUserId())); |
| | | return toBo; |
| | | |
| | | } |
| | | |
| | | /** |