src/main/java/com/nanometer/smartlab/controller/OpeUseFlowInfoController.java
@@ -7,7 +7,9 @@
import com.nanometer.smartlab.entity.SysUser;
import com.nanometer.smartlab.entity.dto.ApplyListDto;
import com.nanometer.smartlab.exception.BusinessException;
import com.nanometer.smartlab.service.SysUserService;
import com.nanometer.smartlab.util.FacesUtils;
import com.nanometer.smartlab.util.Utils;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
@@ -50,6 +52,8 @@
   private String containerCode;
   private String operatestate;
   public String getHouseName() {
      return houseName;
   }
@@ -72,6 +76,8 @@
   private List<SysReagent> reagentSelectList;
   private OpeUseFlow selectedOne;
   public List<SysReagent> getReagentSelectList() {
      if (this.reagentSelectList == null) {
@@ -101,11 +107,12 @@
                  Map<String, Object> filters) {
               List<OpeUseFlow> list = null;
               try {
                  int count = opeUseFlowService.getOpeUseFlowTotalCountByName(houseName,reagentId, reagentCode, containerCode,null, getUserId(),startDate,endDate);
                  int count = opeUseFlowService.getOpeUseFlowTotalCountByName(houseName,reagentId, reagentCode, containerCode,null, getUserId(),startDate,endDate,operatestate);
                  this.setRowCount(count);
                  if (count > 0) {
                     list = opeUseFlowService.getOpeUseFlowListByName(houseName,reagentId, reagentCode, containerCode,null, getUserId(),startDate,endDate, first, pageSize);
                     list = opeUseFlowService.getOpeUseFlowListByName(houseName,reagentId, reagentCode, containerCode,null, getUserId(),startDate,endDate, first, pageSize,operatestate);
                  }
                  selectedOne = null;
               } catch (Exception e) {
                  logger.error(e);
               }
@@ -114,26 +121,36 @@
            @Override
            public OpeUseFlow getRowData(String rowKey) {
               Iterator<OpeUseFlow> iterator = this.iterator();
               OpeUseFlow temp = null;
               if(iterator!= null)
               {
                  while(iterator.hasNext())
                  {
                     temp=iterator.next();
                     if(rowKey.equals(temp.getId()))
                     {
                        return temp;
                     }
                  }
               }
               return temp;
//               Iterator<OpeUseFlow> iterator = this.iterator();
//               OpeUseFlow temp = null;
//               if(iterator!= null)
//               {
//                  while(iterator.hasNext())
//                  {
//                     temp=iterator.next();
//                     if(rowKey.equals(temp.getId()))
//                     {
//                        return temp;
//                     }
//                  }
//               }
               return opeUseFlowService.selectById(rowKey);
            }
         };
      }
      return dataModel;
   }
   public void export2Excel() {
      List<Map> list = opeUseFlowService.selectAll(houseName,reagentId, reagentCode, containerCode,getUserId(),startDate,endDate);
      try{
         boolean isexport = opeUseFlowService.export2Excel(list);
      }catch (Exception e){
         e.printStackTrace();
         FacesUtils.warn("导出失败");
      }
   }
   public String getReagentId() {
@@ -211,6 +228,26 @@
      }
   }
   //报废试剂
   public void scrapReagent(){
      if (this.selectedOne == null) {
         FacesUtils.warn("请选择");
         return;
      }
      try {
         String reagentCode = this.selectedOne.getReagentCode();
         String reagentId = this.selectedOne.getReagent().getId();
         opeUseFlowService.scrapReagent(reagentId, reagentCode, getUserId());
         FacesUtils.warn("操作成功");
      } catch (BusinessException e) {
         FacesUtils.warn(e.getMessage());
      } catch (Exception e) {
         e.printStackTrace();
         FacesUtils.warn("操作失败");
      }
   }
   public void setStartDate(Date startDate) {
      this.startDate = startDate;
   }
@@ -243,4 +280,20 @@
   public void setContainerCode(String containerCode) {
      this.containerCode = containerCode;
   }
   public OpeUseFlow getSelectedOne() {
      return selectedOne;
   }
   public void setSelectedOne(OpeUseFlow selectedOne) {
      this.selectedOne = selectedOne;
   }
   public void setOperatestate(String operatestate) {
      this.operatestate = operatestate;
   }
   public String getOperatestate(){
      return operatestate;
   }
}