| | |
| | | import com.nanometer.smartlab.entity.SysReagent; |
| | | import com.nanometer.smartlab.entity.SysUser; |
| | | import com.nanometer.smartlab.entity.enumtype.ApplyStatus; |
| | | import com.nanometer.smartlab.exception.BusinessException; |
| | | import com.nanometer.smartlab.service.*; |
| | | import com.nanometer.smartlab.util.Constants; |
| | | import com.nanometer.smartlab.util.FacesUtils; |
| | |
| | | import org.apache.poi.hssf.usermodel.HSSFSheet; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.primefaces.context.RequestContext; |
| | | import org.primefaces.event.FileUploadEvent; |
| | | import org.primefaces.event.SelectEvent; |
| | | import org.primefaces.event.TabChangeEvent; |
| | | import org.primefaces.model.LazyDataModel; |
| | |
| | | if(selectedList!=null&&selectedList.size()>0){ |
| | | realDataList=selectedList; |
| | | }else { |
| | | realDataList=opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS, null, null,null,applyUserName); |
| | | realDataList=opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS, null, null,null,applyUserName,(byte)1); |
| | | |
| | | } |
| | | List<String> headerList = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public void uploadApply(FileUploadEvent event){ |
| | | try { |
| | | opeApplyService.importApply(event, getUser()); |
| | | FacesUtils.info("导入成功"); |
| | | } catch (BusinessException e) { |
| | | FacesUtils.warn(e.getMessage()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | FacesUtils.warn("导入失败,请联系管理员"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | public HSSFWorkbook exportExcelNew(List<String> headerList, List<OpeApply> dataList) { |
| | | HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); |
| | | |
| | |
| | | public List<OpeApply> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String, Object> filters) { |
| | | List<OpeApply> list = null; |
| | | try { |
| | | int count = opeApplyService.getOpeApplyTotalCount(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS,null,applyUserName); |
| | | int count = opeApplyService.getOpeApplyTotalCount(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS,null,applyUserName,(byte)1); |
| | | this.setRowCount(count); |
| | | if (count > 0) { |
| | | list = opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS, first, pageSize,null,applyUserName); |
| | | list = opeApplyService.getOpeApplyList(reagentName, startDeadline, endDeadline, status, getUserId(), null, queryCAS, first, pageSize,null,applyUserName,(byte)1); |
| | | for(int i=0;i<list.size();i++){ |
| | | if(list.get(i).getBeforeApproveUserId()!=null&&!list.get(i).getBeforeApproveUserId().equals("")){ |
| | | String name=list.get(i).getApproveUserName(); |
| | |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | | } |
| | | selectedList = null; |
| | | return list; |
| | | } |
| | | |
| | | @Override |
| | | public OpeApply getRowData(String rowKey) { |
| | | Iterator<OpeApply> iterator = this.iterator(); |
| | | if (iterator != null) { |
| | | OpeApply oa = null; |
| | | while (iterator.hasNext()) { |
| | | oa = iterator.next(); |
| | | if (rowKey.equals(oa.getId())) { |
| | | return oa; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<OpeApply> iterator = this.iterator(); |
| | | // if (iterator != null) { |
| | | // OpeApply oa = null; |
| | | // while (iterator.hasNext()) { |
| | | // oa = iterator.next(); |
| | | // if (rowKey.equals(oa.getId())) { |
| | | // return oa; |
| | | // } |
| | | // } |
| | | // } |
| | | return opeApplyService.getOpeApply(rowKey); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public SysReagent getRowData(String rowKey) { |
| | | Iterator<SysReagent> iterator = this.iterator(); |
| | | if (iterator != null) { |
| | | SysReagent sr = null; |
| | | while (iterator.hasNext()) { |
| | | sr = iterator.next(); |
| | | if (rowKey.equals(sr.getId())) { |
| | | return sr; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<SysReagent> iterator = this.iterator(); |
| | | // if (iterator != null) { |
| | | // SysReagent sr = null; |
| | | // while (iterator.hasNext()) { |
| | | // sr = iterator.next(); |
| | | // if (rowKey.equals(sr.getId())) { |
| | | // return sr; |
| | | // } |
| | | // } |
| | | // } |
| | | return sysReagentService.getRowData(rowKey); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | @Override |
| | | public SysReagent getRowData(String rowKey) { |
| | | Iterator<SysReagent> iterator = this.iterator(); |
| | | if (iterator != null) { |
| | | SysReagent sr = null; |
| | | while (iterator.hasNext()) { |
| | | sr = iterator.next(); |
| | | if (rowKey.equals(sr.getId())) { |
| | | return sr; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<SysReagent> iterator = this.iterator(); |
| | | // if (iterator != null) { |
| | | // SysReagent sr = null; |
| | | // while (iterator.hasNext()) { |
| | | // sr = iterator.next(); |
| | | // if (rowKey.equals(sr.getId())) { |
| | | // return sr; |
| | | // } |
| | | // } |
| | | // } |
| | | return sysReagentService.getRowData(rowKey); |
| | | } |
| | | }; |
| | | } |
| | |
| | | String applyUserId = getUserId(); |
| | | int count = 0; |
| | | if (StringUtils.isNotBlank(applyUserId)) { |
| | | count = opeApplyService.getOpeApplyTotalCount(null, null, null, null, applyUserId, null, null,applyCode,null); |
| | | count = opeApplyService.getOpeApplyTotalCount(null, null, null, null, applyUserId, null, null,applyCode,null,(byte)0); |
| | | } |
| | | this.setRowCount(count); |
| | | if (count > 0) { |
| | | list = opeApplyService.getOpeApplyList(null, null, null, null, applyUserId, null, null, first, pageSize,applyCode,null); |
| | | list = opeApplyService.getOpeApplyList(null, null, null, null, applyUserId, null, null, first, pageSize,applyCode,null,(byte)0); |
| | | } |
| | | selectedList = null; |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public OpeApply getRowData(String rowKey) { |
| | | Iterator<OpeApply> iterator = this.iterator(); |
| | | if (iterator != null) { |
| | | OpeApply oa = null; |
| | | while (iterator.hasNext()) { |
| | | oa = iterator.next(); |
| | | if (rowKey.equals(oa.getId())) { |
| | | return oa; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<OpeApply> iterator = this.iterator(); |
| | | // if (iterator != null) { |
| | | // OpeApply oa = null; |
| | | // while (iterator.hasNext()) { |
| | | // oa = iterator.next(); |
| | | // if (rowKey.equals(oa.getId())) { |
| | | // return oa; |
| | | // } |
| | | // } |
| | | // } |
| | | return opeApplyService.getOpeApply(rowKey); |
| | | } |
| | | }; |
| | | } |