| | |
| | | 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); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<String> selectProjectsByContainerCode(String containerCode) { |
| | | String projects = sysLaboratoryContainerDao.selectProjectsByContainerCode(containerCode); |
| | | if (projects != null){ |
| | | return Arrays.asList(projects.split(",")); |
| | | List<String> projects = sysLaboratoryContainerDao.selectProjectsByContainerCode(containerCode); |
| | | if (projects.size() > 0){ |
| | | List<String> projectList = new ArrayList<>(); |
| | | for (String project : projects){ |
| | | if (StringUtils.isNotBlank(project)){ |
| | | projectList.addAll(Arrays.asList(project.split(","))); |
| | | } |
| | | } |
| | | return projectList; |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | |
| | | } |