管道基础大数据平台系统开发-【后端】-Server
13693261870
2023-06-12 4ca77edbe07508f1bd4a878c7c00d7b7fbf0abb5
src/main/java/com/lf/server/service/data/UploadService.java
@@ -235,6 +235,7 @@
        if (null == list || list.isEmpty()) {
            return;
        }
        mf.setRecords(list.size());
        setCreateInfo(list, mf);
        int rows = batchInserts(basicMapper, list);
@@ -250,9 +251,8 @@
     */
    private <T>  int batchInserts(BasicMapper basicMapper, List<T> list) {
        int rows = 0;
        int count = (int) Math.ceil(list.size() / StaticData.D100);
        List<List<T>> subLists = Lists.partition(list, count);
        //int count = (int) Math.ceil(list.size() / StaticData.D100)
        List<List<T>> subLists = Lists.partition(list, StaticData.I50);
        for (List<T> sub : subLists) {
            try {
                rows += basicMapper.insertBatch(sub);
@@ -491,8 +491,8 @@
            MetaEntity me = createMeta(mf, metaId);
            metaService.insert(me);
            mf.setMsg(me.getId() > 0 ? "成功" : "失败");
            String err = mf.getRows() < mf.getRecords() ? "(" + (mf.getRecords() - mf.getRows()) + " 条失败)" : "";
            mf.setMsg(me.getId() > 0 ? String.format("成功%s", err) : "失败");
        }
    }