| | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysLaboratoryContainer> getSysLaboratoryContainerList(String laboratoryType, String laboratoryName, |
| | | String laboratoryId,String project,String controllerName, Integer first, Integer pageSize) { |
| | | Long laboratoryId,String project, Integer first, Integer pageSize) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(laboratoryType)) { |
| | |
| | | if (StringUtils.isNotBlank(laboratoryName)) { |
| | | params.put("laboratoryName", "%" + laboratoryName + "%"); |
| | | } |
| | | if (StringUtils.isNotBlank(laboratoryId)) { |
| | | if (laboratoryId!=null) { |
| | | params.put("laboratoryId", laboratoryId); |
| | | } |
| | | params.put("project", project); |
| | | params.put("controllerName", controllerName); |
| | | params.put("first", first); |
| | | params.put("pageSize", pageSize); |
| | | return this.sysLaboratoryContainerDao.getSysLaboratoryContainerList(params); |
| | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysLaboratoryContainer> getSysLaboratoryContainerList( |
| | | String laboratoryId) { |
| | | return getSysLaboratoryContainerList(null,null,laboratoryId,null,null,null,null); |
| | | Long laboratoryId) { |
| | | return getSysLaboratoryContainerList(null,null,laboratoryId,null,null,null); |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysLaboratoryContainerTotalCount(String laboratoryType, String laboratoryName, String laboratoryId,String project,String controllerName) { |
| | | public int getSysLaboratoryContainerTotalCount(String laboratoryType, String laboratoryName, Long laboratoryId,String project) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(laboratoryType)) { |
| | |
| | | if (StringUtils.isNotBlank(laboratoryName)) { |
| | | params.put("laboratoryName", "%" + laboratoryName + "%"); |
| | | } |
| | | if (StringUtils.isNotBlank(laboratoryId)) { |
| | | if (laboratoryId!=null) { |
| | | params.put("laboratoryId", laboratoryId); |
| | | } |
| | | params.put("project", project); |
| | | params.put("controllerName", controllerName); |
| | | return this.sysLaboratoryContainerDao.getSysLaboratoryContainerTotalCount(params); |
| | | } catch (DataAccessException e) { |
| | | logger.error(e.getMessage(), e); |
| | |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public SysLaboratoryContainer getSysLaboratoryContainer(String id) { |
| | | public SysLaboratoryContainer getSysLaboratoryContainer(Long id) { |
| | | try { |
| | | return this.sysLaboratoryContainerDao.getSysLaboratoryContainer(id); |
| | | } catch (DataAccessException e) { |
| | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public SysLaboratoryContainer insertSysLaboratoryContainer(SysLaboratoryContainer sysLaboratoryContainer) { |
| | | try { |
| | | if (sysLaboratoryContainer.getId() == null) { |
| | | sysLaboratoryContainer.setId(IDUtils.uuid()); |
| | | } |
| | | // if (sysLaboratoryContainer.getId() == null) { |
| | | // sysLaboratoryContainer.setId(IDUtils.uuid()); |
| | | // } |
| | | this.sysLaboratoryContainerDao.insertSysLaboratoryContainer(sysLaboratoryContainer); |
| | | this.sysLaboratoryContainerDao.updateSLContainerUser(sysLaboratoryContainer); |
| | | return sysLaboratoryContainer; |
| | |
| | | return false; |
| | | } |
| | | |
| | | List<String> ids = new ArrayList<String>(); |
| | | List<Long> ids = new ArrayList<Long>(); |
| | | for (SysLaboratoryContainer sysLaboratoryContainer : sysLaboratoryContainerList) { |
| | | ids.add(sysLaboratoryContainer.getId()); |
| | | this.sysLaboratoryContainerDao.updateSLContainerUser(sysLaboratoryContainer); |
| | |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public boolean isSysLaboratoryContainerExist(String containerCode, String editId) { |
| | | public boolean isSysLaboratoryContainerExist(String containerCode, Long editId) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("containerCode", containerCode); |
| | |
| | | container.setId(containermpl.getId()); |
| | | this.sysLaboratoryContainerDao.updateSysLaboratoryContainer(container); |
| | | }else{ |
| | | if (containermpl == null) { |
| | | container.setId(IDUtils.uuid()); |
| | | } |
| | | // if (containermpl == null) { |
| | | // container.setId(IDUtils.uuid()); |
| | | // } |
| | | this.sysLaboratoryContainerDao.insertSysLaboratoryContainer(container); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public void updateInfo(Float temp,Float humidity,Float voc1,String containerId,String flag) { |
| | | public void updateInfo(Float temp,Float humidity,Float voc1,Long containerId,String flag) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("temp", temp); |
| | |
| | | return false; |
| | | } |
| | | |
| | | List<String> ids = new ArrayList<String>(); |
| | | List<Long> ids = new ArrayList<Long>(); |
| | | for (SysLaboratory sysLaboratory : sysLaboratoryList) { |
| | | ids.add(sysLaboratory.getId()); |
| | | } |