Crunchy
2024-07-13 d17bfc830729d53d0ca3ccdb9160e0145479cdcf
cnas-server/src/main/java/com/yuanchu/mom/controller/CapacityScopeController.java
@@ -175,11 +175,11 @@
        InputStream inputStream = file.getInputStream();
        List<StructureItemParameter> lists = new ArrayList<>();
        AtomicReference<String> sample = new AtomicReference<>();
        ExcelUtil.readBySax(inputStream, 0, (i, l, list1) -> {
            if (i == 0 && l == 1) {
        ExcelUtil.readBySax(inputStream, -1, (i, l, list1) -> {
            if (l == 1) {
                sample.set(list1.get(1) + "");
            }
            if (i == 0 && l >= 1) {
            if (l >= 1) {
                StructureItemParameter str = new StructureItemParameter();
                if (list1.get(1) == null) {
                    str.setSample(null);
@@ -340,14 +340,18 @@
                    str.setTemplateId(null);
                }
                try {
                    if (list1.get(22) != null) {
                    if (list1.get(22) != null && list1.get(22) != "") {
                        str.setInspectionItemClass(list1.get(22) + "");
                    } else {
                        str.setInspectionItemClass(null);
                    }
                } catch (Exception e) {
                }
                try {
                    if (list1.get(23) != null) {
                    if (list1.get(23) != null && list1.get(23) != "") {
                        str.setInspectionItemClassEn(list1.get(23) + "");
                    } else {
                        str.setInspectionItemClassEn(null);
                    }
                } catch (Exception e) {
                }
@@ -363,7 +367,7 @@
        structureItemParameterService.removeNoSample(sample.get());
        // 如果数据库里面的数据存在那么就执行更新拷贝操作
        try {
            structureItemParameterService.saveBatch(lists);
            structureItemParameterService.saveOrUpdateBatch(lists);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException("服务端报错啦!!!");