ludc
2023-07-14 7602a824e39e19260ae32bb45e799e6ce43300ac
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmEngineServiceImpl.java
@@ -1,13 +1,11 @@
package com.vci.ubcs.code.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.bo.CodeTemplateAttrSqlBO;
import com.vci.ubcs.code.constant.FrameWorkDefaultValueConstant;
@@ -57,7 +55,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.cache.utils.CacheUtil;
import com.vci.ubcs.core.log.exception.ServiceException;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.DateUtil;
@@ -365,10 +363,10 @@
        // 回收需要业务数据删除
        if (CodeDefaultLC.TASK_BACK.getValue().equals(baseModelDTO.getLcStatus())) {
            R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(baseModelDTO.getBtmname()));
         if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
         }
         commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), VciBaseUtil.toInSql(baseModelDTO.getOid()));
            if (!listR.isSuccess() || listR.getData().size() == 0) {
                throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
            }
            commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(), VciBaseUtil.toInSql(baseModelDTO.getOid()));
        } else {
            for (BaseModel baseModel : baseModels) {
                baseModel.setLcStatus(baseModelDTO.getLcStatus());
@@ -414,10 +412,15 @@
        switchDateAttrOnOrder(templateVO, orderDTO);
        //9.生成编码的信息
//      ClientBusinessObject cbo = boService.createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid());
        BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmtypeid());
        BaseModel cbo = createCBOByBtmName(classifyFullInfo.getTopClassifyVO().getBtmTypeId());
//      //默认的属性都不用从前端拷贝
//      //设置编码需要的默认属性的内容
        copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, false);
      cbo.setOid(VciBaseUtil.getPk());
      cbo.setCreateTime(new Date());
      cbo.setLastModifyTime(new Date());
      cbo.setCreator(AuthUtil.getUser().getUserName());
      cbo.setLastModifier(AuthUtil.getUser().getUserName());
//      //TODO:因为默认的属性都不拷贝,目前集团码叫name,并没有从DTO拷贝到cbo里。增加一个单独处理,以后再看要不要调整
        cbo.setName(orderDTO.getName() == null ? "" : orderDTO.getName());
//      //end -- modify by lihang @20220407
@@ -647,11 +650,11 @@
        if (!CollectionUtils.isEmpty(conditionMap)) {
//         final String[] sql = {"select count(*) from " + VciBaseUtil.getTableName(classifyFullInfo.getTopClassifyVO().getBtmtypeid()) + " t where 1 = 1 "};
            R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmtypeid()));
            R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getTopClassifyVO().getBtmTypeId()));
//            String referTable = VciBaseUtil.getTableName(referVO.getReferType());
         if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
         }
            if (!listR.isSuccess() || listR.getData().size() == 0) {
                throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
            }
            final String[] sql = {"select count(*) from " + listR.getData().get(0).getTableName() + " t where 1 = 1 "};
            conditionMap.forEach((key, value) -> {
                sql[0] += " and " + key + " = " + value;
@@ -801,35 +804,27 @@
//      BeanUtils.
//      BeanUtils.copyProperties(orderDTO.getData(),cbo);
//      cbo.setMaterialtype(Short.valueOf("1001"));
//      orderDTO.getData().forEach((key, value) -> {
//         if (!edit || (!checkUnAttrUnEdit(key) &&
//            !VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(key))) {
//            try {
//               cbo.setAttributeValue(key, value);
//            } catch (Exception e) {
//               logger.error("设置属性的值错误", e);
//            }
//         }
//      });
      orderDTO.getData().forEach((key, value) -> {
         if (!edit || (!checkUnAttrUnEdit(key) &&
            !VciQueryWrapperForDO.LC_STATUS_FIELD.equalsIgnoreCase(key))) {
            try {
               cbo.getData().put(cbo.getData().containsKey(key.toUpperCase())?key.toUpperCase():key, value);
            } catch (Exception e) {
               logger.error("设置属性的值错误", e);
            }
         }
      });
//      BeanMap beanMap = BeanMap.create(cbo);
//      beanMap.putAll(orderDTO.getData());
        try {
            BeanUtilForVCI.copyPropertiesIgnoreNull(BeanUtilForVCI.convertMap(BaseModel.class, orderDTO.getData()), cbo);
            Map<String, String> data = new HashMap<>();
            data.put(CODE_CLASSIFY_OID_FIELD, classifyFullInfo.getCurrentClassifyVO().getOid());
            data.put(CODE_TEMPLATE_OID_FIELD, templateVO.getOid());
            data.put(CODE_FULL_PATH_FILED, fullPath);
            cbo.setData(data);
            cbo.setOid(VciBaseUtil.getPk());
            cbo.setCreateTime(new Date());
         Map<String, String> data = new HashMap<>();
            data.put(cbo.getData().containsKey(CODE_CLASSIFY_OID_FIELD.toUpperCase())?CODE_CLASSIFY_OID_FIELD.toUpperCase():CODE_CLASSIFY_OID_FIELD, classifyFullInfo.getCurrentClassifyVO().getOid());
            data.put(cbo.getData().containsKey(CODE_TEMPLATE_OID_FIELD.toUpperCase())?CODE_TEMPLATE_OID_FIELD.toUpperCase():CODE_TEMPLATE_OID_FIELD, templateVO.getOid());
            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.setCreator(AuthUtil.getUser().getUserName());
            cbo.setLastModifier(AuthUtil.getUser().getUserName());
//         cbo.setCodeclsfid(classifyFullInfo.getCurrentClassifyVO().getOid());
//         cbo.setTemplateOid(templateVO.getOid());
//         cbo.setCodeclsfpath(fullPath);
            cbo.setTs(new Date());
            if (!edit && StringUtils.isBlank(orderDTO.getLcStatus())) {
                //TODO 先写固定,后面生命周期好了在编写
@@ -968,13 +963,16 @@
        CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(codeClassifyOid);
        List<UIFormItemVO> itemVOS = new ArrayList<>();
        Map<String, List<CodeClassifyTemplateAttrVO>> attrGroupMap = templateVO.getAttributes().stream().
                filter(s -> StringUtils.isNotBlank(s.getAttributeGroup())).collect(Collectors.groupingBy(s -> s.getAttributeGroup()));
        templateVO.getAttributes().forEach(attrVO -> {
            UIFormItemVO formItemVO = templateAttr2FormField(attrVO, templateVO.getBtmTypeId());
            itemVOS.add(formItemVO);
        });
      Map<String, List<CodeClassifyTemplateAttrVO>> attrGroupMap = new HashMap<>();
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         attrGroupMap = templateVO.getAttributes().stream().
            filter(s -> StringUtils.isNotBlank(s.getAttributeGroup())).collect(Collectors.groupingBy(s -> s.getAttributeGroup()));
         templateVO.getAttributes().forEach(attrVO -> {
            UIFormItemVO formItemVO = templateAttr2FormField(attrVO, templateVO.getBtmTypeId());
            itemVOS.add(formItemVO);
         });
      }
        //处理属性分组
        if (!CollectionUtils.isEmpty(attrGroupMap)) {
            //按照分组的属性排列,找到每一个分组的第一个属性
@@ -1280,7 +1278,7 @@
            conditionMap.putAll(andConditionMap);
            PageHelper pageHelper = new PageHelper(-1);
            pageHelper.addDefaultDesc("id");
            return queryGrid(fullInfoBO.getTopClassifyVO().getBtmtypeid(), templateVO, conditionMap, pageHelper);
            return queryGrid(fullInfoBO.getTopClassifyVO().getBtmTypeId(), templateVO, conditionMap, pageHelper);
        }
        return new DataGrid<>();
    }
@@ -1301,11 +1299,11 @@
            //说明已经存在
            return resembleRuleService.getObjectByOid(currentClassifyVO.getCodeResembleRuleOid());
        }
        if (StringUtils.isBlank(currentClassifyVO.getParentcodeclassifyoid())) {
        if (StringUtils.isBlank(currentClassifyVO.getParentCodeClassifyOid())) {
            return null;
        }
        Map<String, CodeClassifyVO> classifyVOMap = fullInfoBO.getParentClassifyVOs().stream().collect(Collectors.toMap(s -> s.getOid(), t -> t));
        return getUseResembleRule(fullInfoBO, classifyVOMap.getOrDefault(currentClassifyVO.getParentcodeclassifyoid(), null));
        return getUseResembleRule(fullInfoBO, classifyVOMap.getOrDefault(currentClassifyVO.getParentCodeClassifyOid(), null));
    }
    /**
@@ -1445,26 +1443,32 @@
        }
        //先转换一下时间格式
        List<String> finalOnlySelectAttrIdList = onlySelectAttrIdList.stream().collect(Collectors.toList());
        List<CodeClassifyTemplateAttrVO> dateFormatAttrVOs = templateVO.getAttributes().stream().filter(
                s -> StringUtils.isNotBlank(s.getCodeDateFormat()) &&
                        (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
        ).collect(Collectors.toList());
        //枚举的内容
        List<CodeClassifyTemplateAttrVO> enumAttrVOs = templateVO.getAttributes().stream().filter(
                s -> (StringUtils.isNotBlank(s.getEnumId()) || StringUtils.isNotBlank(s.getEnumString()))
                        &&
                        (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
        ).collect(Collectors.toList());
      List<CodeClassifyTemplateAttrVO> dateFormatAttrVOs = new ArrayList<>();
      List<CodeClassifyTemplateAttrVO> enumAttrVOs = new ArrayList<>();
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         dateFormatAttrVOs = templateVO.getAttributes().stream().filter(
            s -> StringUtils.isNotBlank(s.getCodeDateFormat()) &&
               (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
         ).collect(Collectors.toList());
         //枚举的内容
         enumAttrVOs = templateVO.getAttributes().stream().filter(
            s -> (StringUtils.isNotBlank(s.getEnumId()) || StringUtils.isNotBlank(s.getEnumString()))
               &&
               (finalOnlySelectAttrIdList.size() == 0 || finalOnlySelectAttrIdList.contains(s.getId().toLowerCase(Locale.ROOT)))
         ).collect(Collectors.toList());
      }
        List<String> userIds = new ArrayList<>();
        dataMap.stream().forEach(data -> {
      List<CodeClassifyTemplateAttrVO> finalDateFormatAttrVOs = dateFormatAttrVOs;
      List<CodeClassifyTemplateAttrVO> finalEnumAttrVOs = enumAttrVOs;
      dataMap.stream().forEach(data -> {
            //处理时间
            if (!form) {
                //表单的时候只能用统一的时间格式
                wrapperDateFormat(dateFormatAttrVOs, data);
                wrapperDateFormat(finalDateFormatAttrVOs, data);
            }
            //处理枚举
            wrapperEnum(enumAttrVOs, data);
            wrapperEnum(finalEnumAttrVOs, data);
            String lcstatus = data.get(VciQueryWrapperForDO.LC_STATUS_FIELD);
            String copyFromVersion = data.getOrDefault(COPY_FROM_VERSION, "");
            if ((CodeDefaultLC.EDITING.getValue().equalsIgnoreCase(lcstatus) || CodeDefaultLC.AUDITING.getValue().equalsIgnoreCase(lcstatus))
@@ -1579,17 +1583,25 @@
        //因为参照不一定是在平台的属性池里面设置,所以我们得需要自行处理
        //参考VciQueryWrapper来处理
        //1. 找到所有的字段,
        Map<String, CodeClassifyTemplateAttrVO> attrVOMap = templateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
        List<String> selectFieldList = attrVOMap.keySet().stream().collect(Collectors.toList());
      Map<String, CodeClassifyTemplateAttrVO> attrVOMap = new HashMap<>();
      List<String> selectFieldList = new ArrayList<>();
      if(Func.isNotEmpty(templateVO.getAttributes())){
         attrVOMap = templateVO.getAttributes().stream().collect(Collectors.toMap(s -> s.getId().toLowerCase(Locale.ROOT), t -> t));
         selectFieldList = attrVOMap.keySet().stream().collect(Collectors.toList());
      }
        //所有的参照的字段
        Map<String/**属性字段**/, String> joinTableList = new ConcurrentHashMap<>();
        List<CodeClassifyTemplateAttrVO> referAttrVOs = templateVO.getAttributes().stream().filter(
                s -> StringUtils.isNotBlank(s.getReferBtmId()) || StringUtils.isNotBlank(s.getReferConfig())
        ).collect(Collectors.toList());
      List<CodeClassifyTemplateAttrVO> referAttrVOs = null;
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         referAttrVOs = templateVO.getAttributes().stream().filter(
            s -> StringUtils.isNotBlank(s.getReferBtmId()) || StringUtils.isNotBlank(s.getReferConfig())
         ).collect(Collectors.toList());
      }
        Map<String/**参照的属性**/, String/**实际的字段**/> referFieldMap = new ConcurrentHashMap<>();
        if (!CollectionUtils.isEmpty(referAttrVOs)) {
            referAttrVOs.parallelStream().forEach(attrVO -> {
         List<String> finalSelectFieldList = selectFieldList;
         referAttrVOs.parallelStream().forEach(attrVO -> {
                UIFormReferVO referVO = null;
                if (StringUtils.isNotBlank(attrVO.getReferConfig())) {
                    referVO = JSONObject.parseObject(attrVO.getReferConfig(), UIFormReferVO.class);
@@ -1602,9 +1614,9 @@
                //使用传入的业务类型查询表
                R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referVO.getReferType()));
//            String referTable = VciBaseUtil.getTableName(referVO.getReferType());
            if (!listR.isSuccess() || listR.getData().size() == 0) {
               throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
            }
                if (!listR.isSuccess() || listR.getData().size() == 0) {
                    throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
                }
                String referTable = listR.getData().get(0).getTableName();
//            String referTable = "pl_code_classify";
                String referTableNick = attrVO.getId() + "0";
@@ -1619,7 +1631,7 @@
                    showFieldInSource = textFields.get(0);
                }
                referFieldMap.put(attrVO.getId(), referTableNick + "." + showFieldInSource);
                selectFieldList.add(referTableNick + "." + showFieldInSource + " as " + referShowField);
                finalSelectFieldList.add(referTableNick + "." + showFieldInSource + " as " + referShowField);
            });
        }
        R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getDefaultAttrByBtmId(btmType);
@@ -1663,11 +1675,12 @@
                }
            });
            andCondtionMap.forEach((k, v) -> {
                andSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, attrVOMap, btmType));
         Map<String, CodeClassifyTemplateAttrVO> finalAttrVOMap = attrVOMap;
         andCondtionMap.forEach((k, v) -> {
                andSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, finalAttrVOMap, btmType));
            });
            orConditionMap.forEach((k, v) -> {
                orSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, attrVOMap, btmType));
                orSql.add(getConditionSql(k.toLowerCase(), v, referFieldMap, finalAttrVOMap, btmType));
            });
        }
        //组合起来
@@ -1701,9 +1714,9 @@
        }
//      String tableName = VciBaseUtil.getTableName(btmType);
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
//            String referTable = VciBaseUtil.getTableName(referVO.getReferType());
        String tableName = listR.getData().get(0).getTableName();
        String sql = "select " + selectFieldList.stream().map(s -> (s.contains(".") ? s : ("t." + s))).collect(Collectors.joining(","))
@@ -1878,7 +1891,7 @@
//                    String selectKey = referFieldMap.get(key);
//                    return getSqlByValue(selectKey, value, null, btmType);
//                } else {
                    return getSqlByValue(key, value, attrVOMap, btmType);
                return getSqlByValue(key, value, attrVOMap, btmType);
//                }
            }
        }
@@ -1933,7 +1946,7 @@
            }
            if (field.contains(".") && attrVOMap != null && attrVOMap.containsKey(field.split("\\.")[0].toLowerCase(Locale.ROOT))) {
                //是参照
            return "'" + value + "'";
                return "'" + value + "'";
            } else {
                return value;
            }
@@ -1957,13 +1970,13 @@
                        || VciFieldTypeEnum.VTInteger.equals(fieldTypeEnum)) {
                    return value;
                } else {
               return "'" + value + "'";
                    return "'" + value + "'";
                }
            } else {
                if ((value.startsWith("(") && value.endsWith(")")) || (value.startsWith("'") && value.endsWith("'"))) {
                    return value;
                }
            return "'" + value + "'";
                return "'" + value + "'";
            }
        }
@@ -2105,22 +2118,15 @@
//      CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
        CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
        //找业务类型,然后使用主键去获取数据库里的数据
        List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), orderDTO.getOid());
        List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), orderDTO.getOid());
        if (CollectionUtils.isEmpty(cbos)) {
            throw new VciBaseException(DATA_OID_NOT_EXIST);
        }
//      QueryWrapper<CodeWupin> btmWrapper = new QueryWrapper<>();
//      btmWrapper.eq("OID",orderDTO.getOid());
//      CodeWupin cbo = codeWupinMapper.selectOne(btmWrapper);
        BaseModel cbo = cbos.get(0);
//      CodeClstemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid());
//      CodeRuleVO ruleVO = ruleService.getObjectHasSecByOid(orderDTO.getCodeRuleOid());
        if (cbo != null) {
        if (cbo == null) {
            throw new VciBaseException(DATA_OID_NOT_EXIST);
        }
//      ClientBusinessObject cbo = cbos.get(0);
        if (!cbo.getTs().toString().contains(VciDateUtil.date2Str(orderDTO.getTs(), VciDateUtil.DateTimeFormat))) {
            throw new VciBaseException("数据不是最新的,可能他人已经修改,请刷新后再试");
        }
@@ -2130,9 +2136,16 @@
        //注意模板不能使用数据存储的时候的模板,因为可能会变化
        //1. 判断必输项
      String codeClassifyOid=cbo.getData().get(CODE_CLASSIFY_OID_FIELD.toUpperCase());
      orderDTO.setCodeClassifyOid(codeClassifyOid);
//      CodeClassifyFullInfoBO classifyFullInfo = classifyService.getClassifyFullInfo(orderDTO.getCodeClassifyOid());
//      CodeClassifyTemplateVO templateVO= this.getUsedTemplateByClassifyOid(orderDTO.getCodeClassifyOid());
        CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(orderDTO.getTemplateOid());
        checkRequiredAttrOnOrder(templateVO, orderDTO);
      orderDTO.setTemplateOid(templateVO.getOid());
      //1. 判断必输项
      checkRequiredAttrOnOrder(templateVO, orderDTO);
        //2.先注入,再组合,最后校验
        switchClassifyLevelOnOrder(templateVO, classifyFullInfo, orderDTO);
        //3.处理组合规则。组合规则不能使用编码的属性,因为编码的生成可能是需要属性的
@@ -2149,46 +2162,18 @@
        copyValueToCBO(classifyFullInfo, cbo, orderDTO, templateVO, true);
        //企业码和集团码的不修改
        cbo.setDescription(orderDTO.getDescription());
        cbo.setName(orderDTO.getName());
//        cbo.setName(orderDTO.getName());
        try {
            cbo.setDescription(StringUtils.isBlank(orderDTO.getDescription()) ? "" : orderDTO.getDescription());
            cbo.setName(orderDTO.getName());
////         cbo.setAttributeValueWithNoCheck("description", orderDTO.getDescription());
//         cbo.setAttributeValue("name", orderDTO.getName());
        } catch (Exception e) {
            e.printStackTrace();
        }
//      cbo.getData().putAll(orderDTO.getData());
        cbo.setLastModifyTime(new Date());
        cbo.setLastModifier(String.valueOf(AuthUtil.getUser().getUserId()));
        updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), Collections.singletonList(cbo));
//      codeWupinMapper.updateById(cbo);
//
//      List<CodeWupinEntity> cboList = new ArrayList<>();
//
//      //备注
//      cbo.setDescription(orderDTO.getDescription());
//      cboList.add(cbo);
////
////      cboList.add(cbo);
//      List<String> codeList = productCodeService.productCodeAndSaveData(classifyFullInfo, templateVO, ruleVO, orderDTO.getSecDTOList(),cboList);
//
//
//      List<String> charList = new ArrayList<>();
//      for (CodeWupinEntity wupinEntity : cboList) {
//         charList.add(wupinEntity.getId());
//      }
//      batchSaveSelectChar(templateVO, charList);
//      return codeList.size() > 0 ? codeList.get(0) : "";
        //修改的时候,编码是不变的
//      BatchCBO batchCBO = new BatchCBO();
//      batchCBO.getUpdateCbos().add(cbo);
//      List<ClientBusinessObject> cboList = new ArrayList<>();
//      cboList.add(cbo);
//      boService.persistenceBatch(batchCBO);
        updateBatchByBaseModel(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), Collections.singletonList(cbo));
        batchSaveSelectChar(templateVO, Collections.singletonList(cbo));
//      batchSaveSelectChar(templateVO, Arrays.asList(cbo.getId()));
    }
    /**
@@ -2212,7 +2197,7 @@
        oidCollection.stream().forEach(oids -> {
            Map<String, String> conditionMap = new HashMap<>();
//         conditionMap.put("oid", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(oids.toArray(new String[0])) + ")");
            List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), oids);
            List<BaseModel> cbos = selectByTypeAndOid(classifyFullInfo.getTopClassifyVO().getBtmTypeId(), oids);
//            boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), conditionMap);
            cboList.addAll(cbos);
        });
@@ -2238,13 +2223,13 @@
//      batchCBO.getDeleteCbos().addAll(cboList);
//      WebUtil.setPersistence(false);
//      batchCBO.copyFromOther(
        productCodeService.recycleCode(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid(), deleteBatchDTO.getOidList());
        productCodeService.recycleCode(classifyFullInfo.getCurrentClassifyVO().getBtmTypeId(), deleteBatchDTO.getOidList());
//      baseMapper.deleteBatchIds(cboList);
        //使用传入的业务类型查询表
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmtypeid()));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(classifyFullInfo.getCurrentClassifyVO().getBtmTypeId()));
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        commonsMapper.deleteByTaleAndOid(listR.getData().get(0).getTableName(),
                "'" + (StringUtils.join(cboList.stream().map(BaseModel::getOid).collect(Collectors.toSet()), "','")) + "'");
        //      );
@@ -2308,10 +2293,10 @@
        //4. 查询的时候,直接使用codeclsfpath来查询
        CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(codeClassifyOid);
        CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(templateOid);
        if (topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmtypeid())) {
        if (topClassifyVO == null || StringUtils.isBlank(topClassifyVO.getBtmTypeId())) {
            throw new VciBaseException("当前主题库分类没有顶层分类,或者顶层分类没有设置业务类型");
        }
        String btmTypeId = topClassifyVO.getBtmtypeid();
        String btmTypeId = topClassifyVO.getBtmTypeId();
        if (StringUtils.isBlank(btmTypeId)) {
            return new DataGrid<>("这个分类所属顶层分类没有添加业务类型");
        }
@@ -2378,7 +2363,7 @@
            throw new VciBaseException(DATA_OID_NOT_EXIST);
        }
        List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0])));
        List<BaseModel> cboList = selectByTypeAndOid(topClassifyFullInfo.getTopClassifyVO().getBtmTypeId(), VciBaseUtil.array2String(orderDTOMap.keySet().toArray(new String[0])));
//      cboOidMap.put("oid",QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(orderDTOMap.keySet().toArray(new String[0])) + ")");
//      List<ClientBusinessObject> cboList = boService.queryCBO(classifyFullInfo.getTopClassifyVO().getBtmtypeid(), cboOidMap);
        if (CollectionUtils.isEmpty(cboList)) {
@@ -2434,7 +2419,7 @@
            batchSaveSelectChar(firstTemplateVO, cboList);
        });
//      boService.persistenceBatch(batchCBO);
        updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmtypeid(), updateList);
        updateBatchByBaseModel(topClassifyFullInfo.getTopClassifyVO().getBtmTypeId(), updateList);
        return R.success("操作成功!");
    }
@@ -2448,27 +2433,27 @@
     */
    @Override
    public R markDataPassing(String oid, String btmName, Boolean pass) {
      VciBaseUtil.alertNotNull(oid, "业务数据主键", btmName, "业务类型", pass, "标记类型");
      boolean flag = true;
      try {
         List<BaseModel> datas = selectByTypeAndOid(btmName, oid);
         if (datas.size() == 0) {
            return R.fail(DATA_OID_NOT_EXIST);
         }
         datas.stream().forEach(data->data.getData().put("PASSING",String.valueOf(pass)));
         R r = updateBatchByBaseModel(btmName, datas);
         if(!r.isSuccess()){
            flag = false;
         }
      } catch (Exception e) {
         flag = false;
         e.printStackTrace();
      }
      if (flag) {
         return R.success("标记成功!");
      } else {
         return R.fail("标记失败!");
      }
        VciBaseUtil.alertNotNull(oid, "业务数据主键", btmName, "业务类型", pass, "标记类型");
        boolean flag = true;
        try {
            List<BaseModel> datas = selectByTypeAndOid(btmName, oid);
            if (datas.size() == 0) {
                return R.fail(DATA_OID_NOT_EXIST);
            }
            datas.stream().forEach(data -> data.getData().put("PASSING", String.valueOf(pass)));
            R r = updateBatchByBaseModel(btmName, datas);
            if (!r.isSuccess()) {
                flag = false;
            }
        } catch (Exception e) {
            flag = false;
            e.printStackTrace();
        }
        if (flag) {
            return R.success("标记成功!");
        } else {
            return R.fail("标记失败!");
        }
    }
    /**
@@ -2610,7 +2595,7 @@
    public CodeRuleVO getCodeRuleByClassifyOid(String codeClassifyOid) {
        VciBaseUtil.alertNotNull(codeClassifyOid, "分类的主键");
        CodeClassifyVO classifyVO = classifyService.getObjectByOid(codeClassifyOid);
        String codeRuleOid = classifyVO.getCoderuleoid();
        String codeRuleOid = classifyVO.getCodeRuleOid();
        if (StringUtils.isBlank(codeRuleOid)) {
            //往上找
            CodeClassifyFullInfoBO fullInfo = classifyService.getClassifyFullInfo(codeClassifyOid);
@@ -2630,8 +2615,8 @@
    public CodeRuleVO getCodeRuleByClassifyFullInfo(CodeClassifyFullInfoBO fullInfoBO) {
        //往上找
        String codeRuleOid = "";
        if (StringUtils.isNotBlank(fullInfoBO.getCurrentClassifyVO().getCoderuleoid())) {
            codeRuleOid = fullInfoBO.getCurrentClassifyVO().getCoderuleoid();
        if (StringUtils.isNotBlank(fullInfoBO.getCurrentClassifyVO().getCodeRuleOid())) {
            codeRuleOid = fullInfoBO.getCurrentClassifyVO().getCodeRuleOid();
        } else {
            if (CollectionUtils.isEmpty(fullInfoBO.getParentClassifyVOs())) {
                //说明已经是最高层级,
@@ -2641,8 +2626,8 @@
            //从最高的level开始获取
            for (int i = 0; i < parentClassifyVOList.size(); i++) {
                CodeClassifyVO record = parentClassifyVOList.get(i);
                if (StringUtils.isNotBlank(record.getCoderuleoid())) {
                    codeRuleOid = record.getCoderuleoid();
                if (StringUtils.isNotBlank(record.getCodeRuleOid())) {
                    codeRuleOid = record.getCodeRuleOid();
                    break;
                }
            }
@@ -2665,7 +2650,7 @@
        CodeClassifyTemplateVO templateVO = templateService.getObjectHasAttrByOid(templateOid);
        //为了防止模板上的业务类型与分类上不对应
        CodeClassifyVO topClassifyVO = classifyService.getTopClassifyVO(templateVO.getCodeclassifyoid());
        String btmId = topClassifyVO.getBtmtypeid();
        String btmId = topClassifyVO.getBtmTypeId();
        //查询数据
        Map<String, String> conditionMap = new HashMap<>();
        conditionMap.put("t.oid", oid);
@@ -2780,18 +2765,18 @@
        }
        List<String> oidList = VciBaseUtil.str2List(conditionMap.get("oid"));
        List<BaseModel> cbos = selectByTypeAndOid(btmType,conditionMap.get("oid"));
        List<BaseModel> cbos = selectByTypeAndOid(btmType, conditionMap.get("oid"));
        if (CollectionUtils.isEmpty(cbos)) {
            throw new VciBaseException("未找到业务数据");
        }
      BaseModel cbo = cbos.get(0);
        BaseModel cbo = cbos.get(0);
        String templateOid = cbo.getData().get("CODETEMPLATEOID");
        QueryWrapper<CodeClassifyTemplate> codeClassifyTemplateWrapper = new QueryWrapper<>();
        codeClassifyTemplateWrapper.eq("oid", templateOid);
        List<CodeClassifyTemplate> templateDOList = templateService.list(codeClassifyTemplateWrapper);
      QueryWrapper<CodeClassifyTemplateAttr> codeClassifyTemplateAttrWrapper = new QueryWrapper<>();
        QueryWrapper<CodeClassifyTemplateAttr> codeClassifyTemplateAttrWrapper = new QueryWrapper<>();
        codeClassifyTemplateAttrWrapper.eq("CLASSIFYTEMPLATEOID", templateOid);
        List<CodeClassifyTemplateAttr> attrDOList = codeClassifyTemplateAttrService.list(codeClassifyTemplateAttrWrapper);
@@ -2891,38 +2876,43 @@
        List<UITableFieldVO> fieldVOList = new ArrayList<>();
        Map<String, String> comboxOrReferFieldMap = new HashMap<>();
        templateVO.getAttributes().forEach(attrVO -> {
            UITableFieldVO tableFieldVO = templateAttr2TableField(attrVO, forEdit);
            if ("combox".equalsIgnoreCase(tableFieldVO.getFieldType())) {
                comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if ("refer".equalsIgnoreCase(tableFieldVO.getFieldType())) {
                comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if (StringUtils.isNotBlank(tableFieldVO.getEdit())) {
                tableDefineVO.setHasEditor(true);
            }
            fieldVOList.add(tableFieldVO);
        });
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         templateVO.getAttributes().forEach(attrVO -> {
            UITableFieldVO tableFieldVO = templateAttr2TableField(attrVO, forEdit);
            if ("combox".equalsIgnoreCase(tableFieldVO.getFieldType())) {
               comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if ("refer".equalsIgnoreCase(tableFieldVO.getFieldType())) {
               comboxOrReferFieldMap.put(tableFieldVO.getSortField(), tableFieldVO.getField());
            }
            if (StringUtils.isNotBlank(tableFieldVO.getEdit())) {
               tableDefineVO.setHasEditor(true);
            }
            fieldVOList.add(tableFieldVO);
         });
      }
        List<List<UITableFieldVO>> cols = new ArrayList<>();
        cols.add(fieldVOList);
        tableDefineVO.setCols(cols);
        Map<String, UITableFieldVO> fieldVOMap = fieldVOList.stream().collect(Collectors.toMap(s -> s.getField().toLowerCase(Locale.ROOT), t -> t));
        //查询属性
        List<CodeClassifyTemplateAttrVO> queryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getQueryAttrFlag())).collect(Collectors.toList());
        if (!CollectionUtils.isEmpty(queryAttrVOs)) {
            List<UITableFieldVO> queryFieldVOs = new ArrayList<>();
            queryAttrVOs.stream().forEach(attrVO -> {
                String attrId = attrVO.getId().toLowerCase(Locale.ROOT);
                attrId = comboxOrReferFieldMap.getOrDefault(attrId, attrVO.getId()).toLowerCase(Locale.ROOT);
                if (fieldVOMap.containsKey(attrId)) {
                    queryFieldVOs.add(fieldVOMap.get(attrId));
                }
            });
            tableDefineVO.setQueryColumns(queryFieldVOs);
        }
        //高级属性
        List<CodeClassifyTemplateAttrVO> seniorQueryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getSeniorQueryAttrFlag())).collect(Collectors.toList());
      List<CodeClassifyTemplateAttrVO> seniorQueryAttrVOs = null;
      if (Func.isNotEmpty(templateVO.getAttributes())) {
         //查询属性
         List<CodeClassifyTemplateAttrVO> queryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getQueryAttrFlag())).collect(Collectors.toList());
         if (!CollectionUtils.isEmpty(queryAttrVOs)) {
            List<UITableFieldVO> queryFieldVOs = new ArrayList<>();
            queryAttrVOs.stream().forEach(attrVO -> {
               String attrId = attrVO.getId().toLowerCase(Locale.ROOT);
               attrId = comboxOrReferFieldMap.getOrDefault(attrId, attrVO.getId()).toLowerCase(Locale.ROOT);
               if (fieldVOMap.containsKey(attrId)) {
                  queryFieldVOs.add(fieldVOMap.get(attrId));
               }
            });
            tableDefineVO.setQueryColumns(queryFieldVOs);
         }
         //高级属性
         seniorQueryAttrVOs = templateVO.getAttributes().stream().filter(s -> BooleanEnum.TRUE.getValue().equalsIgnoreCase(s.getSeniorQueryAttrFlag())).collect(Collectors.toList());
      }
        if (!CollectionUtils.isEmpty(seniorQueryAttrVOs)) {
            List<UITableFieldVO> queryFieldVOs = new ArrayList<>();
            seniorQueryAttrVOs.stream().forEach(attrVO -> {
@@ -3107,12 +3097,12 @@
        uiInfoVO.setLeaf(classifyService.countChildrenByClassifyOid(codeClassifyOid) == 0);
        if (StringUtils.isNotBlank(functionId) && !"~".equalsIgnoreCase(functionId)) {
            List<Menu> buttonVOS = iSysClient.getMenuButtonByType(uiInfoVO.getTemplateVO().getBtmTypeId()).getData();
//         List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId);
//         if (operationVOS == null) {
//            operationVOS = new ArrayList<>();
//         }
//         //查询扩展按钮
//         List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid);
            //         List<SmOperationVO> operationVOS = operationService.listButtonByFunctionId(functionId);
            //         if (operationVOS == null) {
            //            operationVOS = new ArrayList<>();
            //         }
            //         //查询扩展按钮
            //         List<CodeButtonVO> buttonVOS = listButtonInToolbarByClassifyOid(codeClassifyOid);
            List<SmOperationVO> operationVOS = new ArrayList<>();
            if (!CollectionUtils.isEmpty(buttonVOS)) {
                for (int i = 0; i < buttonVOS.size(); i++) {
@@ -3179,9 +3169,9 @@
    public Integer insertBatchByType(String btmType, List<BaseModel> baseModels) {
        //使用传入的业务类型查询表
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        //将bean转为map,mybatis统一处理
        List<Map<String, String>> maps = new ArrayList<>();
        baseModels.stream().forEach(model -> {
@@ -3206,9 +3196,9 @@
        //使用传入的业务类型查询表
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        //查询数据
        List<Map> maps = commonsMapper.selectBySql("select * from " + listR.getData().get(0).getTableName() + " where oid in ("
                + VciBaseUtil.toInSql(oids.toString()) + ")");
@@ -3264,9 +3254,9 @@
     */
    public BaseModel createBaseModel(String boName) {
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(boName));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        String userName = String.valueOf(AuthUtil.getUser().getUserId());
        BaseModel bo = new BaseModel();
//      bo.setOid(VciBaseUtil.getPk());
@@ -3334,9 +3324,9 @@
    public R updateBatchByBaseModel(String btmType, List<BaseModel> baseModels) {
        //使用传入的业务类型查询表
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(btmType));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        //将bean转为map,mybatis统一处理
        List<Map<String, String>> maps = new ArrayList<>();
@@ -3364,10 +3354,16 @@
     * @return 列表数据
     */
    @Override
    public IPage<BaseModel> referDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject) throws VciBaseException{
      //checkReferConfig(referConfigVO);
    public IPage<BaseModel> referDataGrid(UIFormReferVO referConfigVO, BaseQueryObject baseQueryObject) throws VciBaseException {
        //checkReferConfig(referConfigVO);
        //使用业务类型查询
        R<BtmTypeVO> allAttributeByBtmId = btmTypeClient.getAllAttributeByBtmId(referConfigVO.getReferType());
        if (allAttributeByBtmId.getCode() != 200) {
            throw new ServiceException("业务类型feign接口调用错误!");
        }
        if (Func.isEmpty(allAttributeByBtmId.getData())) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        BtmTypeVO btmTypeVO = allAttributeByBtmId.getData();
        /**
         * 加上查询最新版次
@@ -3385,10 +3381,10 @@
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(referConfigVO.getReferType()));
        if (listR.getCode() != 200) {
            throw new ServiceException(Func.isNotBlank(listR.getMsg()) ? listR.getMsg():"业务类型feign接口调用错误!");
            throw new ServiceException(Func.isNotBlank(listR.getMsg()) ? listR.getMsg() : "业务类型feign接口调用错误!");
        }
        if (listR.getData().isEmpty()) {
            throw new VciBaseException(Func.isNotBlank(listR.getMsg()) ? listR.getMsg():"传入业务类型未查询到相应表单,请检查!");
            throw new VciBaseException(Func.isNotBlank(listR.getMsg()) ? listR.getMsg() : "传入业务类型未查询到相应表单,请检查!");
        }
        String namesql = "";
        if (StringUtils.isNotBlank(baseQueryObject.getConditionMap().get("name"))) {
@@ -3406,15 +3402,20 @@
        String lcstatusSql = "";
        if (StringUtils.isNotBlank(baseQueryObject.getConditionMap().get("lcstatus"))) {
            lcstatusSql = "lcstatus =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lcstatus"));
            lcstatusSql = "and lcstatus =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lcstatus"));
        }
//        String where = "";
//        if (StringUtils.isNotBlank(codesql) || StringUtils.isNotBlank(lcstatusSql) || StringUtils.isNotBlank(namesql)) {
//            where = "where ";
//        }
        String num1 = baseQueryObject.getPage() * baseQueryObject.getLimit() + "";
        String num2 = ((baseQueryObject.getPage()) - 1) * baseQueryObject.getLimit() + 1 + "";
        List<Map> maps = commonsMapper.selectBySql("select * from ( select rownum rn, t.* from (select * from " + listR.getData().get(0).getTableName() + SPACE
                + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
            + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and":" where") + SPACE
                + " and lastv =" + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 "
                + lcstatusSql + namesql + codesql + ") t where rownum <=" + num1 + ") where rn >=" + num2
        );
        List<BaseModel> baseModels = new ArrayList<>();
@@ -3458,12 +3459,12 @@
        }
        int total = commonsMapper.queryCountBySql("select count(*) from " + listR.getData().get(0).getTableName() + SPACE
                + (StringUtils.isNotBlank(listR.getData().get(0).getRevisionRuleId()) ? (" where lastr = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastr").toString())
                + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and":" where") + SPACE
                + "and lastv = " + VciBaseUtil.toInSql(baseQueryObject.getConditionMap().get("lastv").toString())) + " and" : "where") + SPACE + "1=1 "
                + lcstatusSql + namesql + codesql
        );
      IPage<BaseModel> objectDataGrid = new Page<>();
        IPage<BaseModel> objectDataGrid = new Page<>();
        objectDataGrid.setPages(baseQueryObject.getPage());
      objectDataGrid.setCurrent(baseQueryObject.getPage());
        objectDataGrid.setCurrent(baseQueryObject.getPage());
        objectDataGrid.setRecords(baseModels);
        objectDataGrid.setSize(baseQueryObject.getLimit());
        objectDataGrid.setTotal(total);
@@ -3595,10 +3596,10 @@
        toBo.setVersionRule(fromBo.getVersionRule());
//      RevisionValueObject rvObj = this.getNextRevision(fromBo.getBtmName(), fromBo.getNameoid(), item.revRuleName, item.revInput, revisionVal);
        R<List<BtmTypeVO>> listR = btmTypeClient.selectByIdCollection(Collections.singletonList(fromBo.getBtmname()));
      if (!listR.isSuccess() || listR.getData().size() == 0) {
         throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
      }
      Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid());
        if (!listR.isSuccess() || listR.getData().size() == 0) {
            throw new VciBaseException("传入业务类型未查询到相应表单,请检查!");
        }
        Map<String, Object> nextRevision = commonsMapper.getNextRevision(listR.getData().get(0).getTableName(), fromBo.getNameOid());
        toBo.setRevisionSeq(Integer.parseInt(nextRevision.get("REVISIONSEQ").toString()));
        toBo.setRevisionValue(nextRevision.get("REVISIONVAL").toString());
//      VersionValueObject versionObj = this.getVersionValue(item.verRuleName);