xiejun
2023-07-19 ded6e8d2312e139e8ce770c7f1d5830bf2db4af6
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -400,7 +400,6 @@
    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());
@@ -918,7 +917,7 @@
//                  baseModels.stream().forEach(model-> {
                        try {
                            map = VciBaseUtil.convertBean2Map(cbo);
                            map = VciBaseUtil.convertBean2Map(cbo,null);
                        } catch (Exception e) {
                            throw new VciBaseException("类型转换错误:" + e.getMessage());
                        }
@@ -3254,11 +3253,19 @@
        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());
            }
@@ -3409,12 +3416,20 @@
        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());
            }