ludc
2023-12-05 25ef4e85586c27433c865b69c67ccf5a380b93a7
Source/UBCS/ubcs-service/ubcs-code/src/main/java/com/vci/ubcs/code/service/impl/MdmIOServiceImpl.java
@@ -199,9 +199,9 @@
   private SaveLogUtil saveLogUtil;
   /**
    * 导出的十万条
    * 客户现场excel为老版本,导出的总数限制为65535
    */
   public static final int EXPORT_LIMIT = 100000;
   public static final int EXPORT_LIMIT = 65535;
   /**
    * 批量申请:选取选中分类下的所有模板关键属性,相似属性,必填属性,写入execl中
@@ -382,7 +382,7 @@
      CodeClassifyVO codeClassifyVO = classifyService.getObjectByOid(codeClassifyOid);
      //获取码段宽度
      //String secWidth = getCodeSegmentWidth(codeClassifyVO.getOid());
      String secWidth = getCodeSegmentWidth(codeClassifyVO.getOid());
      if(isHistory){
         templateVOList= templateService.childTemplates(codeClassifyOid);
@@ -612,6 +612,7 @@
      ExcelUtil.writeDataToFile(excelName,eo);
      return excelName;
   }
   /**
    * 获取码段宽度
    * @param codeClassifyOid
@@ -1274,6 +1275,7 @@
         throw e;
      }
   }
   /**
    * 导入批量编辑数据
    *
@@ -1288,8 +1290,11 @@
      ReadExcelOption reo = new ReadExcelOption();
      reo.setReadAllSheet(true);
      List<SheetDataSet> sheetDataSetList = ExcelUtil.readDataObjectFromExcel(file,null,reo);
      if (sheetDataSetList.size() > LIMIT + 1) {
         throw new VciBaseException("为了保证系统的稳定性,请一次不要导入超过1万条的数据");
      if (sheetDataSetList.get(0).getRowData().size() > LIMIT + 1) {
         throw new ServiceException("为了保证系统的稳定性,请一次不要导入超过1万条的数据");
      }
      if (sheetDataSetList.get(0).getRowData().size() == 0) {
         throw new ServiceException("未读取到excle相关数据,请确认!!!");
      }
      boolean isExport=false;
      Map<String,List<WriteExcelData>> shetNameMap=new HashMap<>();
@@ -1371,13 +1376,9 @@
               codeAllCodeService.updateBatchById(codeAllCodes);
            } catch (Throwable e) {
               log.error("批量产生编码的时候出错了", e);
//            thisCbos.stream().forEach(cbo -> {
//               String rowIndex = cbo.getAttributeValue(IMPORT_ROW_INDEX);
               errorMap.put(sheetRowData.getRowIndex(), ";系统错误,存储数据的时候出错了:"+e.getMessage());
//            });
            }
         }
         if (errorMap.size() > 0) {
            isExport = true;
         }
@@ -1837,10 +1838,10 @@
         tableName = VciBaseUtil.getTableName(btmTypeId);
      }
      String countSql = "select count(*) from " + tableName +" where 1=1" +
      String countSql = "select count(*) from (select * FROM " + tableName +" where 1=1" +
         " and lastr = '1'" +
         " and lastv='1'" +
         " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%'";
         " and codeclsfpath like '%" + exportAttrDTO.getCodeClassifyOid() + "%' {}";
      //先查询总数
      int total = 0;
@@ -1854,8 +1855,7 @@
            thisPage.setSort(exportAttrDTO.getSort());
            thisPage.setOrder(exportAttrDTO.getOrder());
            thisPage.addDefaultDesc("createTime");
            total += commonsMapper.queryCountBySql(countSql);
            total += commonsMapper.queryCountBySql(StringUtil.format(countSql," limit " + exportAttrDTO.getLimit() +" offset "+ i +")subquery;"));
         }
      }else{
         total = commonsMapper.queryCountBySql(countSql);