| | |
| | | SysWarehouseService sysWarehouseService; |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysWarehouseContainer> getSysWarehouseContainerList(String warehouseType, String warehouseName, String warehouseId, Integer first, Integer pageSize) { |
| | | public List<SysWarehouseContainer> getSysWarehouseContainerList(String warehouseType, String warehouseName, Long warehouseId, Integer first, Integer pageSize) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(warehouseType)) { |
| | |
| | | if (StringUtils.isNotBlank(warehouseName)) { |
| | | params.put("warehouseName", "%" + warehouseName + "%"); |
| | | } |
| | | if (StringUtils.isNotBlank(warehouseId)) { |
| | | if (warehouseId!=null) { |
| | | params.put("warehouseId", warehouseId); |
| | | } |
| | | params.put("first", first); |
| | |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysWarehouseContainer> getSysWarehouseContainerList(String warehouseId){ |
| | | public List<SysWarehouseContainer> getSysWarehouseContainerList(Long warehouseId){ |
| | | return getSysWarehouseContainerList(null,null,warehouseId,null,null); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public SysWarehouseContainer getSysWarehouseContainer(String id) { |
| | | public SysWarehouseContainer getSysWarehouseContainer(Long id) { |
| | | try { |
| | | return this.sysWarehouseContainerDao.getSysWarehouseContainer(id); |
| | | } catch (DataAccessException e) { |
| | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public SysWarehouseContainer insertSysWarehouseContainer(SysWarehouseContainer sysWarehouseContainer) { |
| | | try { |
| | | if (sysWarehouseContainer.getId() == null) { |
| | | sysWarehouseContainer.setId(IDUtils.uuid()); |
| | | } |
| | | // if (sysWarehouseContainer.getId() == null) { |
| | | // sysWarehouseContainer.setId(IDUtils.uuid()); |
| | | // } |
| | | this.sysWarehouseContainerDao.insertSysWarehouseContainer(sysWarehouseContainer); |
| | | return sysWarehouseContainer; |
| | | } catch (DuplicateKeyException ex) { |
| | |
| | | return false; |
| | | } |
| | | |
| | | List<String> ids = new ArrayList<String>(); |
| | | List<Long> ids = new ArrayList<Long>(); |
| | | for (SysWarehouseContainer sysWarehouseContainer : sysWarehouseContainerList) { |
| | | ids.add(sysWarehouseContainer.getId()); |
| | | } |
| | |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public boolean isSysWarehouseContainerExist(String containerCode, String editId) { |
| | | public boolean isSysWarehouseContainerExist(String containerCode, Long editId) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("containerCode", containerCode); |
| | |
| | | //1.新建实验室 |
| | | SysLaboratory sl = new SysLaboratory(); |
| | | |
| | | sl.setId(IDUtils.uuid()); |
| | | //sl.setId(IDUtils.uuid()); |
| | | sl.setType(baseMetaService.getBaseMetaList(Constants.BASE_META_GROUP_LABORATORY_TYPE).get(0).getId()); |
| | | //判断是否已经存在该名称实验室 |
| | | SysLaboratory sysLaboratory = sysLaboratoryDao.getSysLaboratoryByName(sysWarehouse.getName()); |
| | |
| | | //判断是否已经存在该条码柜子 |
| | | if (count < 1) { |
| | | SysLaboratoryContainer slc = new SysLaboratoryContainer(); |
| | | slc.setId(IDUtils.uuid()); |
| | | // slc.setId(IDUtils.uuid()); |
| | | // (#{id}, #{laboratoryId}, #{type}, #{containerCode}, #{infoCode}, #{structure}, |
| | | // #{name}, 1, #{characterLeft}, #{characterRight}, now(), now(), #{controllerCode},#{project}) |
| | | slc.setLaboratoryId(sl.getId()); |
| | |
| | | public void deleteSysWarehouseContainer2(List<SysWarehouseContainer> selectedList) { |
| | | //1.删除自己 |
| | | this.deleteSysWarehouseContainer(selectedList); |
| | | List<String> ids = new ArrayList<>(); |
| | | List<Long> ids = new ArrayList<>(); |
| | | for (SysWarehouseContainer swc : selectedList) { |
| | | SysLaboratoryContainer slc = sysLaboratoryContainerDao.getSysLaboratoryContainerByContainerCode(swc.getContainerCode()); |
| | | if (slc != null) { |
| | |
| | | } |
| | | } |
| | | //2.删除实验室临时存储柜 |
| | | sysLaboratoryContainerDao.deleteSysLaboratoryContainers(ids); |
| | | if (ids.size() > 0){ |
| | | sysLaboratoryContainerDao.deleteSysLaboratoryContainers(ids); |
| | | } |
| | | } |
| | | |
| | | |