| | |
| | | private boolean isSearch = false; |
| | | private boolean isAnalysSearch = false; |
| | | private LazyDataModel<HazardousWaste> analysisDataModel; |
| | | private HazardousWaste selectedOne; |
| | | |
| | | @Resource |
| | | private HazardousWasteService hazardousWasteService; |
| | |
| | | if (pageCount > 0) |
| | | list = hazardousWasteService.selectAll(startTime,endTime,status,applyPerson,getUser().getProject(),department,tid,first, pageSize); |
| | | } |
| | | }else { |
| | | this.setRowCount(0); |
| | | } |
| | | //查询更换模式 |
| | | if (isSearch) { |
| | | isSearch = false; |
| | | } |
| | | selectedOne = null; |
| | | } catch (Exception e) { |
| | | logger.error("error occured.", e); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public HazardousWaste getRowData(String rowKey) { |
| | | Iterator<HazardousWaste> iterator = this.iterator(); |
| | | HazardousWaste su = null; |
| | | while (iterator.hasNext()) { |
| | | su = iterator.next(); |
| | | if ( su.getId().equals(Long.parseLong(rowKey))) { |
| | | return su; |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<HazardousWaste> iterator = this.iterator(); |
| | | // HazardousWaste su = null; |
| | | // while (iterator.hasNext()) { |
| | | // su = iterator.next(); |
| | | // if ( su.getId().equals(Long.parseLong(rowKey))) { |
| | | // return su; |
| | | // } |
| | | // } |
| | | return hazardousWasteService.selectById(Long.parseLong(rowKey)); |
| | | } |
| | | }; |
| | | } |
| | |
| | | |
| | | List<HazardousWaste> list = null; |
| | | try { |
| | | int pageCount = hazardousWasteService.countStatistics(startTime,endTime,status,applyPerson,project,department); |
| | | |
| | | this.setRowCount(pageCount); |
| | | if (pageCount > 0) |
| | | list = hazardousWasteService.selectStatistics(startTime,endTime,status,applyPerson,project,department,first, pageSize); |
| | | if (getUser().getWaster() != null){ |
| | | if (getUser().getWaster().equals(Waster.MANAGE)){ |
| | | int pageCount = hazardousWasteService.countStatistics(startTime,endTime,status,applyPerson,project,department); |
| | | this.setRowCount(pageCount); |
| | | if (pageCount > 0) |
| | | list = hazardousWasteService.selectStatistics(startTime,endTime,status,applyPerson,project,department,first, pageSize); |
| | | }else if (StringUtils.isNotBlank(getUser().getProject())){ |
| | | int pageCount = hazardousWasteService.countStatistics(startTime,endTime,status,applyPerson,getUser().getProject(),department); |
| | | this.setRowCount(pageCount); |
| | | if (pageCount > 0) |
| | | list = hazardousWasteService.selectStatistics(startTime,endTime,status,applyPerson,getUser().getProject(),department,first, pageSize); |
| | | } |
| | | }else { |
| | | this.setRowCount(0); |
| | | } |
| | | |
| | | //查询更换模式 |
| | | if (isAnalysSearch) { |
| | |
| | | |
| | | @Override |
| | | public HazardousWaste getRowData(String rowKey) { |
| | | Iterator<HazardousWaste> iterator = this.iterator(); |
| | | HazardousWaste su = null; |
| | | while (iterator.hasNext()) { |
| | | su = iterator.next(); |
| | | if ( su.getId().equals(Long.parseLong(rowKey))) { |
| | | return su; |
| | | } |
| | | } |
| | | // Iterator<HazardousWaste> iterator = this.iterator(); |
| | | // HazardousWaste su = null; |
| | | // while (iterator.hasNext()) { |
| | | // su = iterator.next(); |
| | | // if ( su.getId().equals(Long.parseLong(rowKey))) { |
| | | // return su; |
| | | // } |
| | | // } |
| | | return null; |
| | | } |
| | | }; |
| | |
| | | statusList = new ArrayList<> (); |
| | | statusList.add("全部"); |
| | | statusList.add("待确认"); |
| | | statusList.add("已解决"); |
| | | statusList.add("已确认"); |
| | | statusList.add("已拒绝"); |
| | | statusList.add("已取消"); |
| | | return statusList; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public void exportStatistics2Excel(){ |
| | | List<Map> list = hazardousWasteService.exportStatisticsList(startTime,endTime,status,applyPerson,project,department); |
| | | List<Map> list = new ArrayList<>(); |
| | | if (getUser().getWaster() != null){ |
| | | if (getUser().getWaster().equals(Waster.MANAGE)){ |
| | | list = hazardousWasteService.exportStatisticsList(startTime,endTime,status,applyPerson,project,department); |
| | | }else if (StringUtils.isNotBlank(getUser().getProject())){ |
| | | list = hazardousWasteService.exportStatisticsList(startTime,endTime,status,applyPerson,getUser().getProject(),department); |
| | | } |
| | | } |
| | | try{ |
| | | hazardousWasteService.exportStatistics2Excel(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | FacesUtils.warn("导出失败"); |
| | | } |
| | | } |
| | | |
| | | public void cancelOne(){ |
| | | //待确认状态的才能取消 |
| | | if (this.selectedOne == null) { |
| | | FacesUtils.warn("请选择"); |
| | | return; |
| | | } |
| | | if (!"待确认".equals(this.selectedOne.getStatus())) { |
| | | FacesUtils.warn("非待确认不能取消"); |
| | | return; |
| | | } |
| | | try { |
| | | this.selectedOne.setStatus("已取消"); |
| | | hazardousWasteService.updateWaste(this.selectedOne); |
| | | FacesUtils.warn("操作成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | FacesUtils.warn("操作失败"); |
| | | } |
| | | } |
| | | |
| | | public void recoverOne(){ |
| | | if (this.selectedOne == null) { |
| | | FacesUtils.warn("请选择"); |
| | | return; |
| | | } |
| | | if (!"已取消".equals(this.selectedOne.getStatus())) { |
| | | FacesUtils.warn("非已取消不能恢复"); |
| | | return; |
| | | } |
| | | try { |
| | | this.selectedOne.setStatus("待确认"); |
| | | hazardousWasteService.updateWaste(this.selectedOne); |
| | | FacesUtils.warn("操作成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | FacesUtils.warn("操作失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | public void setTid(String tid) { |
| | | this.tid = tid; |
| | | } |
| | | |
| | | public HazardousWaste getSelectedOne() { |
| | | return selectedOne; |
| | | } |
| | | |
| | | public void setSelectedOne(HazardousWaste selectedOne) { |
| | | this.selectedOne = selectedOne; |
| | | } |
| | | } |