kongzy
2024-07-01 47a751cb301d05276ae5d75145d57b2d090fe4e1
src/main/java/com/nanometer/smartlab/controller/LaboratoryStockMngController.java
@@ -52,7 +52,7 @@
    */
   private LazyDataModel<OpeReagentStatus> reagentStoreDataModel;
   private String reagentId;
   private Long reagentId;
   private List<SysReagent> reagentSelectList;
   private List<OpeReagentStatus> selectedStoreList;
@@ -64,8 +64,8 @@
   /**
    * 数据模型
    */
   private String laboratoryId;
   private String laboratoryContainerId;
   private Long laboratoryId;
   private Long laboratoryContainerId;
   /**
    * SpringMenu中初始化
@@ -93,11 +93,11 @@
               List<OpeReagentStatus> list = null;
               System.out.println(reagentId);
               try {
                  int count = opeReagentStatusService.getOpeReagentStatusTotalCountForLab(reagentId, null,
                  int count = opeReagentStatusService.getOpeReagentStatusTotalCountForLab(reagentId,null, null,
                        ArrivalStatus.LABORATORY.getKey(), reagentCode, getUserId(),labName);
                  this.setRowCount(count);
                  if (count > 0) {
                     list = opeReagentStatusService.getOpeReagentStatusListForLab(reagentId, null,
                     list = opeReagentStatusService.getOpeReagentStatusListForLab(reagentId,null, null,
                           ArrivalStatus.LABORATORY.getKey(), reagentCode, getUserId(),labName, first, pageSize);
                  }
               } catch (Exception e) {
@@ -108,17 +108,17 @@
            @Override
            public OpeReagentStatus getRowData(String rowKey) {
               Iterator<OpeReagentStatus> iterator = this.iterator();
               if (iterator != null) {
                  OpeReagentStatus su = null;
                  while (iterator.hasNext()) {
                     su = iterator.next();
                     if (rowKey.equals(su.getId())) {
                        return su;
                     }
                  }
               }
               return null;
//               Iterator<OpeReagentStatus> iterator = this.iterator();
//               if (iterator != null) {
//                  OpeReagentStatus su = null;
//                  while (iterator.hasNext()) {
//                     su = iterator.next();
//                     if (rowKey.equals(su.getId())) {
//                        return su;
//                     }
//                  }
//               }
               return  null;
            }
         };
      }
@@ -144,22 +144,24 @@
               } catch (Exception e) {
                  logger.error(e);
               }
               selectedStoreList = null;
               return list;
            }
            @Override
            public OpeReagentStatus getRowData(String rowKey) {
               Iterator<OpeReagentStatus> iterator = this.iterator();
               if (iterator != null) {
                  OpeReagentStatus su = null;
                  while (iterator.hasNext()) {
                     su = iterator.next();
                     if (rowKey.equals(su.getId())) {
                        return su;
                     }
                  }
               }
               return null;
//               Iterator<OpeReagentStatus> iterator = this.iterator();
//               if (iterator != null) {
//                  OpeReagentStatus su = null;
//                  while (iterator.hasNext()) {
//                     su = iterator.next();
//                     if (rowKey.equals(su.getId())) {
//                        return su;
//                     }
//                  }
//               }
               Long id=Long.valueOf(rowKey);
               return opeReagentStatusService.getOpeReagentStatusById(id);
            }
         };
      }
@@ -169,7 +171,7 @@
   public void exportLabStock() {
      try {
         List<Map> list = opeReagentStatusService.selectExportList(reagentId, null,
         List<Map> list = opeReagentStatusService.selectExportList(null, null,
               ArrivalStatus.LABORATORY.getKey(), reagentCode, getUserId(),labName);
         opeReagentStatusService.exportLabStock2Excel(list);
         FacesUtils.info("导出成功");
@@ -194,11 +196,11 @@
      this.reagentSelectList = reagentSelectList;
   }
   public String getReagentId() {
   public Long getReagentId() {
      return reagentId;
   }
   public void setReagentId(String reagentId) {
   public void setReagentId(Long reagentId) {
      this.reagentId = reagentId;
   }
@@ -210,19 +212,19 @@
      this.reagentCode = reagentCode;
   }
   public String getLaboratoryId() {
   public Long getLaboratoryId() {
      return laboratoryId;
   }
   public void setLaboratoryId(String laboratoryId) {
   public void setLaboratoryId(Long laboratoryId) {
      this.laboratoryId = laboratoryId;
   }
   public String getLaboratoryContainerId() {
   public Long getLaboratoryContainerId() {
      return laboratoryContainerId;
   }
   public void setLaboratoryContainerId(String laboratoryContainerId) {
   public void setLaboratoryContainerId(Long laboratoryContainerId) {
      this.laboratoryContainerId = laboratoryContainerId;
   }
@@ -235,11 +237,11 @@
   // 是试剂柜入库,还是错误入库
   // 暂定是试剂柜入库
   public void onSaveBtnClick() {
      if (StringUtils.isBlank(laboratoryId)) {
      if (laboratoryId==null) {
         FacesUtils.warn("请选择实验室。");
         return;
      }
      if (StringUtils.isBlank(laboratoryContainerId)) {
      if (laboratoryContainerId==null) {
         FacesUtils.warn("请选择临时存储库。");
         return;
      }
@@ -249,7 +251,7 @@
      }
      for (OpeReagentStatus opeReagentStatus : selectedStoreList) {
         if (opeReagentStatus.getStatus().getKey() != ArrivalStatus.PERSONAL.getKey()) {
         if (opeReagentStatus.getStatus() != ArrivalStatus.PERSONAL.getKey()) {
            FacesUtils.warn("只能存放个人领用中的试剂。");
            return;
         }