| | |
| | | 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.IDUtils; |
| | | import com.nanometer.smartlab.util.MessageUtil; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.log4j.Logger; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.dao.DataAccessException; |
| | | import org.springframework.dao.DataIntegrityViolationException; |
| | | import org.springframework.dao.DuplicateKeyException; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.faces.context.FacesContext; |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public CommonPage<SysLaboratory> getSysLaboratoryList(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(sysLaboratoryDao.getSysLaboratoryTotalCount(params)); |
| | | commonPage.setTotal(total); |
| | | commonPage.setTotalPage(CommonPage.getTotalPage(total,pageSize)); |
| | | List<SysLaboratory> sysReagents=sysLaboratoryDao.getSysLaboratorySimpleInfoList(params); |
| | | commonPage.setList(sysReagents); |
| | | return commonPage; |
| | | } |
| | | |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public int getSysLaboratoryTotalCount(String type, String name,String project) { |
| | | try { |