| | |
| | | |
| | | import com.google.common.collect.ImmutableMap; |
| | | import com.nanometer.smartlab.dao.SysUserDao; |
| | | import com.nanometer.smartlab.entity.SysLaboratoryContainer; |
| | | import com.nanometer.smartlab.entity.SysReagent; |
| | | import com.nanometer.smartlab.entity.SysUser; |
| | | import com.nanometer.smartlab.entity.dto.HazardousWasteUser; |
| | |
| | | import com.nanometer.smartlab.exception.AlarmException; |
| | | import com.nanometer.smartlab.exception.BusinessException; |
| | | import com.nanometer.smartlab.exception.ExceptionEnumCode; |
| | | import com.nanometer.smartlab.model.CommonPage; |
| | | import com.nanometer.smartlab.util.ExcelUtils; |
| | | import com.nanometer.smartlab.util.FacesUtils; |
| | | import com.nanometer.smartlab.util.IDUtils; |
| | |
| | | throw new BusinessException(ExceptionEnumCode.DB_ERR, MessageUtil.getMessageByCode(ExceptionEnumCode.DB_ERR.getCode()), e); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public CommonPage<SysUser> getSysUserList(Integer pageNum, Integer pageSize, String name) { |
| | | if(pageNum==null||pageNum<1){ |
| | | pageNum=1; |
| | | } |
| | | if(pageSize==null||pageSize<1){ |
| | | pageSize=10; |
| | | } |
| | | if(pageSize>50){ |
| | | pageSize=50; |
| | | } |
| | | Map<String, Object> params = new HashMap<>(); |
| | | if (StringUtils.isNotBlank(name)) { |
| | | params.put("name","%" + name+ "%"); |
| | | } |
| | | params.put("first", (pageNum-1)*pageSize); |
| | | params.put("pageSize", pageSize); |
| | | CommonPage commonPage=new CommonPage(); |
| | | commonPage.setPageNum(pageNum); |
| | | commonPage.setPageSize(pageSize); |
| | | Long total=new Long(sysUserDao.getSysUserTotalCount(params)); |
| | | commonPage.setTotal(total); |
| | | commonPage.setTotalPage(CommonPage.getTotalPage(total,pageSize)); |
| | | List<SysUser> sysReagents=sysUserDao.getSysUserSimpleInfoList(params); |
| | | commonPage.setList(sysReagents); |
| | | return commonPage; |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysUserTotalCount(String arp, String name,String departmentName,String project,String company) { |
| | | try { |