检验项目的导入添加支持多个sheet与三级检测项目添加
| | |
| | | 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); |
| | |
| | | structureItemParameterService.removeNoSample(sample.get()); |
| | | // 如果数据库里面的数据存在那么就执行更新拷贝操作 |
| | | try { |
| | | structureItemParameterService.saveBatch(lists); |
| | | structureItemParameterService.saveOrUpdateBatch(lists); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("服务端报错啦!!!"); |
| | |
| | | @RestController |
| | | @RequestMapping("/insFiber") |
| | | public class InsFiberController { |
| | | |
| | | } |
| | |
| | | select ip.id ip_id, |
| | | inspection_item, |
| | | inspection_item_en, |
| | | inspection_item_class, |
| | | inspection_item_class_en, |
| | | inspection_item_subclass, |
| | | inspection_item_subclass_en, |
| | | ip.factory ip_factory, |