| | |
| | | // 通过订单id查找所有样本id |
| | | List<Integer> sampleIds = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId)).stream().map(InsSample::getId).collect(Collectors.toList()); |
| | | // 通过检查每一个样本id查到属于检验项结论 is null的数量 |
| | | Long count = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, sampleIds).isNull(InsProduct::getInsResult).eq(InsProduct::getSonLaboratory, insProduct.getSonLaboratory())); |
| | | // is null的数量为0是将订单状态表的状态改为已检验 |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, sampleIds).isNull(InsProduct::getInsResult).eq(InsProduct::getSonLaboratory, insProduct.getSonLaboratory())); |
| | | Long count = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, sampleIds).isNull(InsProduct::getInsResult).eq(InsProduct::getSonLaboratory, insProduct.getSonLaboratory()).eq(InsProduct::getState, 1)); |
| | | if (count == 0) { |
| | | insOrderStateMapper.update(new InsOrderState(), Wrappers.<InsOrderState>lambdaUpdate() |
| | | .eq(InsOrderState::getInsOrderId, orderId) |
| | |
| | | table.put("tableSize", tables.size() + 1); |
| | | }); |
| | | List<Map<String, String>> deviceList = null; |
| | | if(deviceSet.size()!=0){ |
| | | if (deviceSet.size() != 0) { |
| | | deviceList = insOrderMapper.selectDeviceList(deviceSet); |
| | | } |
| | | Map<String, String> codeStr = new HashMap<>(); |
| | |
| | | FileInputStream stream = new FileInputStream(path); |
| | | XWPFDocument document = new XWPFDocument(stream); |
| | | List<XWPFTable> xwpfTables = document.getTables(); |
| | | for (int i = 1; i < xwpfTables.size() - (deviceList==null?1:2); i++) { |
| | | for (int i = 1; i < xwpfTables.size() - (deviceList == null ? 1 : 2); i++) { |
| | | Set<String> set1 = new HashSet<>(); |
| | | Map<String, Map<String, Integer>> maps = new HashMap<>(); |
| | | for (int j = 0; j < xwpfTables.get(i).getRows().size(); j++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | maps.forEach((k,v)->{ |
| | | maps.forEach((k, v) -> { |
| | | }); |
| | | List<String> list = new ArrayList<>(); |
| | | for (String s : maps.keySet()) { |
| | |
| | | for (int j = 0; j < v.get("er") - v.get("sr") + 1; j++) { |
| | | TableTools.mergeCellsHorizonal(xwpfTables.get(i), v.get("sr") + j, v.get("sc"), v.get("ec")); |
| | | } |
| | | if(v.get("er")>v.get("sr")){ |
| | | if (v.get("er") > v.get("sr")) { |
| | | TableTools.mergeCellsVertically(xwpfTables.get(i), v.get("sc"), v.get("sr"), v.get("er")); |
| | | } |
| | | } |
| | |
| | | if (insProducts.size() > 0) { |
| | | String str = ""; |
| | | for (InsProduct product : insProducts) { |
| | | str += product.getInspectionItem() + product.getInspectionItemSubclass() + ";"; |
| | | str += product.getInspectionItem() + " " + product.getInspectionItemSubclass() + ";"; |
| | | } |
| | | throw new ErrorException("以下是未检验的项目:" + str); |
| | | } |