| | |
| | | @Resource |
| | | private InsOrderFileMapper insOrderFileMapper; |
| | | |
| | | @Resource |
| | | FuSheUtils fuSheUtils; |
| | | |
| | | @Override |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | map.put("head", PrintChina.printChina(InsOrderFile.class)); |
| | | Integer insOrderId = insOrderFile.getInsOrderId(); |
| | | insOrderFile.setInsOrderId(null); |
| | | IPage<InsOrderFile> insOrderFileIPage = insOrderFileMapper.getFileList(page, QueryWrappers.queryWrappers(insOrderFile), insOrderId); |
| | | String sonLaboratory = null; |
| | | if (ObjectUtils.isNotEmpty(insOrderFile.getSonLaboratory())) { |
| | | sonLaboratory = insOrderFile.getSonLaboratory(); |
| | | insOrderFile.setSonLaboratory(null); |
| | | } |
| | | IPage<InsOrderFile> insOrderFileIPage = insOrderFileMapper.getFileList(page, QueryWrappers.queryWrappers(insOrderFile), insOrderId, sonLaboratory); |
| | | map.put("body", insOrderFileIPage); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public int uploadFile(Integer orderId, MultipartFile file) { |
| | | public int uploadFile(Integer orderId, MultipartFile file, String sonLaboratory) { |
| | | String urlString; |
| | | String pathName; |
| | | String path; |
| | |
| | | if (!realpath.exists()) { |
| | | realpath.mkdirs(); |
| | | } |
| | | pathName = UUID.randomUUID() + "_" + file.getOriginalFilename(); |
| | | pathName = file.getOriginalFilename(); |
| | | urlString = realpath + "/" + pathName; |
| | | file.transferTo(new File(urlString)); |
| | | insOrderFile.setFileUrl(pathName); |
| | | return insOrderFileMapper.insert(insOrderFile); |
| | | if (ObjectUtils.isNotEmpty(sonLaboratory)) { |
| | | insOrderFile.setSonLaboratory(sonLaboratory); |
| | | //删除重复的数据 |
| | | insOrderFileMapper.delete(Wrappers.<InsOrderFile>lambdaQuery() |
| | | .eq(InsOrderFile::getInsOrderId, orderId) |
| | | .eq(InsOrderFile::getType, insOrderFile.getType()) |
| | | .eq(InsOrderFile::getFileName, insOrderFile.getFileName()) |
| | | .eq(InsOrderFile::getSonLaboratory, insOrderFile.getSonLaboratory()) |
| | | .eq(InsOrderFile::getFileUrl, insOrderFile.getFileUrl())); |
| | | } else { |
| | | //删除重复的数据 |
| | | insOrderFileMapper.delete(Wrappers.<InsOrderFile>lambdaQuery() |
| | | .eq(InsOrderFile::getInsOrderId, orderId) |
| | | .eq(InsOrderFile::getType, insOrderFile.getType()) |
| | | .eq(InsOrderFile::getFileName, insOrderFile.getFileName()) |
| | | .isNull(InsOrderFile::getSonLaboratory) |
| | | .eq(InsOrderFile::getFileUrl, insOrderFile.getFileUrl())); |
| | | } |
| | | insOrderFileMapper.insert(insOrderFile); |
| | | //如果是辐射试验(近场/远程上传的csv文件) |
| | | String[] split = filename.split("\\."); |
| | | if (ObjectUtils.isNotEmpty(sonLaboratory) && (sonLaboratory.equals("近场") || sonLaboratory.equals("远场")) && |
| | | split[split.length - 1].equals("csv")) { |
| | | fuSheUtils.getFuSheWord(sonLaboratory, insOrderFile); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | System.err.println("附件上传错误"); |
| | | return 0; |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | |
| | | throw new ErrorException("该样品的检验任务还没有结束试验或继续试验,暂时无法出库!"); |
| | | } |
| | | } |
| | | warehouseService.outWarehouse(sampleCode); |
| | | boolean a = true; |
| | | warehouseService.outWarehouse(sampleCode, a); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | if (insOrder.getFormType().equals("原理样机")) { |
| | | for (InsSample sample : samples) { |
| | | //出库 |
| | | try{ |
| | | outInsOrderState(laboratory,sample.getSampleCode()); |
| | | }catch (Exception e){ |
| | | try { |
| | | outInsOrderState(laboratory, sample.getSampleCode()); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |