| | |
| | | |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.log4j.Logger; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.dao.DataAccessException; |
| | | import org.springframework.dao.DataIntegrityViolationException; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | |
| | | @Resource |
| | | private OpeReagentStatusService opeReagentStatusService; |
| | | |
| | | @Lazy |
| | | @Resource |
| | | private OpeUseFlowService opeUseFlowService; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | @Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED) |
| | | public boolean updateOpeWarehouseReserve(OpeWarehouseReserve opeWarehouseReserve) { |
| | | try { |
| | | int row = this.opeWarehouseReserveDao.updateOpeWarehouseReserve(opeWarehouseReserve); |
| | |
| | | } |
| | | } |
| | | |
| | | @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()); |
| | |
| | | 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); |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |