| | |
| | | public String addSaveCode(CodeOrderDTO orderDTO) throws Exception { |
| | | VciBaseUtil.alertNotNull(orderDTO, "编码申请相关的属性和码段的内容都为空", orderDTO.getCodeClassifyOid(), "主题库分类的主键", |
| | | orderDTO.getTemplateOid(), "模板的主键", orderDTO.getCodeRuleOid(), "编码规则的主键"); |
| | | VciSystemVarConstants.getSystemVarValueMap(); |
| | | CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid()); |
| | | CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid()); |
| | | CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid()); |
| | |
| | | |
| | | // baseModels.stream().forEach(model-> { |
| | | try { |
| | | map = VciBaseUtil.convertBean2Map(cbo); |
| | | map = VciBaseUtil.convertBean2Map(cbo,null); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.getMessage()); |
| | | } |
| | |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //将bean转为map,mybatis统一处理 |
| | | //获取当前业务类型所有字段用来做对比 |
| | | R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(btmType); |
| | | if (!allAttributeByBtmId.isSuccess() || allAttributeByBtmId.getData().getAttributes().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应字段信息,请检查!"); |
| | | } |
| | | Set<String> existFild = allAttributeByBtmId.getData().getAttributes().stream().map(btmTypeAttributeVO -> { |
| | | return btmTypeAttributeVO.getId(); |
| | | }).collect(Collectors.toSet()); |
| | | //将bean转为map,mybatis统一处理 |
| | | List<Map<String, String>> maps = new ArrayList<>(); |
| | | baseModels.stream().forEach(model -> { |
| | | try { |
| | | maps.add(VciBaseUtil.convertBean2Map(model)); |
| | | maps.add(VciBaseUtil.convertBean2Map(model,existFild)); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.toString()); |
| | | } |
| | |
| | | if (!listR.isSuccess() || listR.getData().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应表单,请检查!"); |
| | | } |
| | | //获取当前业务类型所有字段用来做对比 |
| | | R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(btmType); |
| | | if (!allAttributeByBtmId.isSuccess() || allAttributeByBtmId.getData().getAttributes().size() == 0) { |
| | | throw new VciBaseException("传入业务类型未查询到相应字段信息,请检查!"); |
| | | } |
| | | Set<String> existFild = allAttributeByBtmId.getData().getAttributes().stream().map(btmTypeAttributeVO -> { |
| | | return btmTypeAttributeVO.getId(); |
| | | }).collect(Collectors.toSet()); |
| | | //将bean转为map,mybatis统一处理 |
| | | List<Map<String, String>> maps = new ArrayList<>(); |
| | | |
| | | baseModels.stream().forEach(model -> { |
| | | try { |
| | | maps.add(VciBaseUtil.convertBean2Map(model)); |
| | | maps.add(VciBaseUtil.convertBean2Map(model,existFild)); |
| | | } catch (Exception e) { |
| | | throw new VciBaseException("类型转换错误:" + e.getMessage()); |
| | | } |