From c3510da29a7974c6af7ff3de1ade3db429d6f848 Mon Sep 17 00:00:00 2001 From: 李宇 <986321569@qq.com> Date: 星期三, 18 八月 2021 14:27:59 +0800 Subject: [PATCH] 申购管理申请履历显示所有历史单据,提交时如有无效试剂耗材报错 --- src/main/java/com/nanometer/smartlab/service/OpeWarehouseReserveServiceImpl.java | 37 +++++++++++++++++++++---------------- 1 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/nanometer/smartlab/service/OpeWarehouseReserveServiceImpl.java b/src/main/java/com/nanometer/smartlab/service/OpeWarehouseReserveServiceImpl.java index f761fc8..a37acb1 100644 --- a/src/main/java/com/nanometer/smartlab/service/OpeWarehouseReserveServiceImpl.java +++ b/src/main/java/com/nanometer/smartlab/service/OpeWarehouseReserveServiceImpl.java @@ -205,7 +205,7 @@ } } - @Transactional(propagation = Propagation.REQUIRED) + @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED) public boolean updateOpeWarehouseReserve(OpeWarehouseReserve opeWarehouseReserve) { try { int row = this.opeWarehouseReserveDao.updateOpeWarehouseReserve(opeWarehouseReserve); @@ -225,26 +225,14 @@ } } - @Transactional(propagation = Propagation.REQUIRED) + @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED) public void claimForPerson(List<OpeApplyReserve> selectedListForPerson,String userId,String projectNum,String laboratoryId,String laboratoryContainerId){ try{ for(OpeApplyReserve app:selectedListForPerson){ List<String> reagentCodes = app.getReagentCode(); if (reagentCodes != null && reagentCodes.size() > 0) { - List<OpeReagentStatus> ss=new ArrayList<>(); - for (String opeReagentStatusId : reagentCodes) { - OpeReagentStatus opeReagentStatus = this.opeReagentStatusService.getOpeReagentStatus(opeReagentStatusId); - opeReagentStatus.setUserId(userId); - opeReagentStatus.setProjectNum(projectNum); - //boolean flag = this.opeReagentStatusService.updateReagentStatus(opeReagentStatus); - this.opeReagentStatusService.updateReagentStatus3(opeReagentStatus); - ss.add(opeReagentStatus); - //更新试剂状态和 - opeReagentStatus.setHouseId(laboratoryId); - opeReagentStatus.setContainerId(laboratoryContainerId); - this.opeReagentStatusDao.updateOpeReagentStatusDao(opeReagentStatus); + this.opeReagentStatusService.updateReagentStatus3(reagentCodes,userId,projectNum,laboratoryId,laboratoryContainerId); - } //更新是现实库存 OpeLaboratoryReserve lr=new OpeLaboratoryReserve(); lr.setReagentId(app.getReagent().getId()); @@ -295,6 +283,9 @@ logger.error(ex.getMessage(), ex); throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), ex); + }catch(Exception e){ + e.printStackTrace(); + throw new RuntimeException(e); } } @@ -677,7 +668,21 @@ opeWarehouseReserveDao.updateBtReserve(id, useNum); } - @Override + @Override + public int countByReagentId(String id) { + int num = 0; + if (opeWarehouseReserveDao.countByReagentId(id) != null) { + num = opeWarehouseReserveDao.countByReagentId(id); + } + return num; + } + + @Override + public OpeWarehouseReserve getRowData(String rowKey) { + return opeWarehouseReserveDao.getRowData(rowKey); + } + + @Override public void btWarehouseReserveReduce(List<OpeApplyReserve> opeList) { if (opeList.size() < 1) { return; -- Gitblit v1.9.2