| | |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public List<SysLaboratoryContainer> getSysLaboratoryContainerList(String laboratoryType, String laboratoryName, |
| | | String laboratoryId, Integer first, Integer pageSize) { |
| | | String laboratoryId,String project,String controllerName, Integer first, Integer pageSize) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(laboratoryType)) { |
| | |
| | | if (StringUtils.isNotBlank(laboratoryId)) { |
| | | 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); |
| | | return getSysLaboratoryContainerList(null,null,laboratoryId,null,null,null,null); |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysLaboratoryContainerTotalCount(String laboratoryType, String laboratoryName, String laboratoryId) { |
| | | public int getSysLaboratoryContainerTotalCount(String laboratoryType, String laboratoryName, String laboratoryId,String project,String controllerName) { |
| | | try { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | if (StringUtils.isNotBlank(laboratoryType)) { |
| | |
| | | if (StringUtils.isNotBlank(laboratoryId)) { |
| | | 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); |
| | |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("containerCode", containerCode); |
| | | params.put("editId", editId); |
| | | |
| | | int count = this.sysLaboratoryContainerDao.getSysLaboratoryContainerTotalCount(params); |
| | | int count = this.sysLaboratoryContainerDao.getSysLaboratoryContainerExist(params); |
| | | return count > 0; |
| | | } catch (DataAccessException e) { |
| | | logger.error(e.getMessage(), e); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> exportExcelList(String laboratoryType, String laboratoryName) { |
| | | public List<Map> exportExcelList(String laboratoryType, String laboratoryName,String project,String controllerName) { |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("type", laboratoryType); |
| | | params.put("name", laboratoryName); |
| | | params.put("project", project); |
| | | params.put("controllerName", controllerName); |
| | | return sysLaboratoryContainerDao.exportExcelList(params); |
| | | } |
| | | |
| | |
| | | map.put("infoCode", "临时存储库状态码"); |
| | | map.put("structure", "临时存储库结构"); |
| | | map.put("name", "临时存储库名称"); |
| | | map.put("project", "课题组"); |
| | | ExcelUtils.export2Excel(list,"实验室临时存储库管理",map); |
| | | |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public boolean delBySlcIds(List<SysLaboratory> sysLaboratoryList) { |
| | | try { |
| | | if (sysLaboratoryList == null || sysLaboratoryList.size() == 0) { |
| | | return false; |
| | | } |
| | | |
| | | List<String> ids = new ArrayList<String>(); |
| | | for (SysLaboratory sysLaboratory : sysLaboratoryList) { |
| | | ids.add(sysLaboratory.getId()); |
| | | } |
| | | |
| | | int row = this.sysLaboratoryContainerDao.delSlcIds(ids); |
| | | return row != 0; |
| | | } catch (DataIntegrityViolationException ex) { |
| | | logger.warn(ex.getMessage(), ex); |
| | | throw new AlarmException(AlarmCode.DATA_CONFICT, MessageUtil.getMessage(AlarmCode.DATA_CONFICT.getCode())); |
| | | } catch (DataAccessException ex) { |
| | | logger.error(ex.getMessage(), ex); |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, |
| | | MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), ex); |
| | | } |
| | | } |
| | | |
| | | } |