| | |
| | | package com.nanometer.smartlab.controller; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | @Controller |
| | | @Scope("session") |
| | | public class SysWarningsController extends BaseController { |
| | | |
| | | |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 8009757365735077055L; |
| | | |
| | | private static Logger logger = Logger.getLogger(SysWarningsController.class); |
| | | |
| | | |
| | | @Resource |
| | | private SysWarningService sysWarningService; |
| | | @Resource |
| | |
| | | private String containerCode; |
| | | private Timestamp startTime; |
| | | private Timestamp endTime; |
| | | |
| | | |
| | | |
| | | |
| | | public LazyDataModel<SysWarning> getDataModel() { |
| | | if (this.dataModel == null) { |
| | | this.dataModel = new LazyDataModel<SysWarning>() { |
| | | /** |
| | | * |
| | | * |
| | | */ |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | |
| | | if (count > 0) { |
| | | list = sysWarningService.getSysWarningList(containerCode, startTime, endTime, first, pageSize); |
| | | } |
| | | selectedList = new ArrayList<>(); |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public SysWarning getRowData(String rowKey) { |
| | | Iterator<SysWarning> iterator = this.iterator(); |
| | | if (iterator != null) { |
| | | SysWarning oa = null; |
| | | while (iterator.hasNext()) { |
| | | oa = iterator.next(); |
| | | if (rowKey.equals(oa.getId())) { |
| | | return oa; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<SysWarning> iterator = this.iterator(); |
| | | // if (iterator != null) { |
| | | // SysWarning oa = null; |
| | | // while (iterator.hasNext()) { |
| | | // oa = iterator.next(); |
| | | // if (rowKey.equals(oa.getId())) { |
| | | // return oa; |
| | | // } |
| | | // } |
| | | // } |
| | | Long id=Long.valueOf(rowKey); |
| | | return sysWarningService.getSysWarning(id); |
| | | } |
| | | }; |
| | | } |