gdg
2021-02-01 1cbac7aa20a183a9a893651bf0cef24b1909eb5c
src/main/java/com/nanometer/smartlab/controller/LaboratoryContainerMngController.java
@@ -12,6 +12,7 @@
import com.nanometer.smartlab.entity.BaseMeta;
import com.nanometer.smartlab.entity.SysLaboratory;
import com.nanometer.smartlab.service.SysLaboratoryService;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
@@ -71,6 +72,8 @@
   private String laboratoryType;
   private String laboratoryName;
   private String project;
   private String controllerName;
   private int action;
@@ -136,6 +139,7 @@
   public void onSaveBtnClick() {
      try {
         // 新建
         if (this.action == Constants.ACTION_ADD) {
            if (this.sysLaboratoryContainer == null) {
@@ -170,6 +174,7 @@
               return;
            }
            System.out.println(sysLaboratoryContainer.getContainerCode());
            this.sysLaboratoryContainerService.insertSysLaboratoryContainer(sysLaboratoryContainer);
            FacesUtils.info("新建成功。");
@@ -208,6 +213,9 @@
               return;
            }
            sysLaboratoryContainer.setProject(null);
            sysLaboratoryContainer.getProject();
            this.sysLaboratoryContainerService.updateSysLaboratoryContainer(sysLaboratoryContainer);
            FacesUtils.info("修改成功。");
@@ -216,6 +224,17 @@
      } catch (Exception e) {
         logger.error("操作失败。", e);
         FacesUtils.warn("操作失败。");
      }
   }
   public void export2Excel(){
      try {
         List<Map> list = sysLaboratoryContainerService.exportExcelList(laboratoryType, laboratoryName);
         sysLaboratoryContainerService.export2Excel(list);
      }catch (Exception e){
         e.printStackTrace();
         FacesUtils.warn("导出失败");
      }
   }
@@ -367,11 +386,11 @@
               List<SysLaboratoryContainer> list = null;
               try {
                  int count = sysLaboratoryContainerService.getSysLaboratoryContainerTotalCount(laboratoryType,
                        laboratoryName,null);
                        laboratoryName,null,project,controllerName);
                  this.setRowCount(count);
                  if (count > 0) {
                     list = sysLaboratoryContainerService.getSysLaboratoryContainerList(laboratoryType,
                           laboratoryName,null, first, pageSize);
                           laboratoryName,null,project,controllerName, first, pageSize);
                  }
               } catch (Exception e) {
                  logger.error(e);
@@ -454,4 +473,19 @@
      this.controllers = controllers;
   }
   public String getProject() {
      return project;
   }
   public void setProject(String project) {
      this.project = project;
   }
   public String getControllerName() {
      return controllerName;
   }
   public void setControllerName(String controllerName) {
      this.controllerName = controllerName;
   }
}