xiejun
2023-06-20 eb3000389c4b9bdc5d836dc356932d551ff7c073
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -759,7 +759,7 @@
    * @return 有错误信息的excel
    */
   @Override
   public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) {
   public CodeImProtRusultVO batchImportHistoryData(String codeClassifyOid, String classifyAttr,File file) throws  Throwable{
      VciBaseUtil.alertNotNull(codeClassifyOid,"分类的主键");
      ReadExcelOption reo = new ReadExcelOption();
      reo.setReadAllSheet(true);
@@ -2978,21 +2978,35 @@
    * @param cboList 数据的列表
    * @param errorMap 错误的信息
    */
   private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap){
   private void batchCheckIdExistOnOrder(CodeClassifyTemplateVO templateVO,List<ClientBusinessObject> cboList,Map<String ,String> errorMap) throws Throwable{
      List<String> existIds = new ArrayList<>();
      String tableName ="";
      try {
         R<BtmTypeVO> r = btmTypeClient.getAllAttributeByBtmId(templateVO.getBtmTypeId());
         if(r.getCode()!=200) {
            throw new Throwable(r.getMsg());
         }
         BtmTypeVO btmTypeVO = r.getData();
         if (btmTypeVO == null) {
            throw new Throwable("根据业务类型未查询到业务类型对象!");
         }
         tableName = btmTypeVO.getTableName();
         if (StringUtils.isBlank(tableName)) {
            throw new Throwable("根据业务类型未查询到业务类型相关联的表");
         }
      }catch (Throwable e){
         throw e;
      }
      String finalTableName = tableName;
      VciBaseUtil.switchCollectionForOracleIn(cboList).stream().forEach(cbos -> {
         Map<String, String> conditionMap = new HashMap<>();
         conditionMap.put("id", QueryOptionConstant.IN + "(" + VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])) + ")");
         R<BtmTypeVO>  r= btmTypeClient.getDetail(templateVO.getBtmTypeId());
         BtmTypeVO btmTypeVO =r.getData();
         String tableName=btmTypeVO.getTableName();
         StringBuffer sb=new StringBuffer();
         sb.append(" select id from ");
         sb.append(tableName);
         sb.append(finalTableName);
         sb.append(" where 1=1 ");
         sb.append(" id in (");
         sb.append(" and id in (");
         sb.append(VciBaseUtil.toInSql(cbos.stream().map(s -> s.getId()).collect(Collectors.toSet()).toArray(new String[0])));
         sb.append(")");
         List<String> idList= commonsMapper.selectById(sb.toString());