| | |
| | | import com.nanometer.smartlab.service.SysLaboratoryService; |
| | | import com.nanometer.smartlab.util.FacesUtils; |
| | | import com.nanometer.smartlab.util.Utils; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.log4j.Logger; |
| | | import org.primefaces.context.RequestContext; |
| | | import org.primefaces.model.LazyDataModel; |
| | |
| | | * 数据源 |
| | | */ |
| | | private LazyDataModel<OpeReagentStatus> dataModel; |
| | | private String reagentId; |
| | | private Long reagentId; |
| | | private String reagentName; |
| | | private String reagentCode; |
| | | private String applyPerson; |
| | |
| | | //判断单子下的试剂是否全部 为 领用待入库-1,不是就不能取消领用 |
| | | List<PersonUseDetail> applyList = opeUseFlowService.getApplyInfo(selectOne.getReceiptNumber()); |
| | | boolean flag = applyList.stream().allMatch(pu -> |
| | | opeReagentStatusService.getOpeReagentStatusByReagentCode(pu.getReagentCode() ).getStatus()== ArrivalStatus.NOREGISTER); |
| | | opeReagentStatusService.getOpeReagentStatusByReagentCode(pu.getReagentCode() ).getStatus()== ArrivalStatus.NOREGISTER.getKey()); |
| | | if (!flag) { |
| | | FacesUtils.warn("试剂当前状态不可以取消领用"); |
| | | return; |
| | |
| | | printTable.put("department", selectOne.getDepartment()); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | printTable.put("date", dateFormat.format(selectOne.getCreateTime())); |
| | | printTable.put("phone", selectOne.getPhone()); |
| | | printTable.put("phone", StringUtils.isBlank(selectOne.getPhone())?"":selectOne.getPhone()); |
| | | printTable.put("receiptNumber", selectOne.getReceiptNumber()); |
| | | printTable.put("project", selectOne.getProject()); |
| | | SysLaboratory sysLaboratory = sysLaboratoryService.getSysLaboratory(selectOne.getHouseId()); |
| | | printTable.put("project", selectOne.getProjectName()); |
| | | |
| | | SysLaboratory sysLaboratory = sysLaboratoryService.getSysLaboratorySimpleInfo(selectOne.getHouseId()); |
| | | printTable.put("lab", sysLaboratory.getName()); |
| | | printTable.put("note",selectOne.getNote() == null?"":selectOne.getNote()); |
| | | //整理数据 |
| | | List<PersonUseDetail> applyInfo = opeUseFlowService.getApplyInfo(selectOne.getReceiptNumber()); |
| | | assert applyInfo.size() > 0; |
| | |
| | | } |
| | | |
| | | personUseDetail = opeUseFlowService.getApplyInfo(selectOne.getReceiptNumber()); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * @Description: 导出详情 |
| | | */ |
| | | public void exportDetail() throws Exception { |
| | | try { |
| | | if (startTime == null || endTime == null){ FacesUtils.warn("请选择日期范围");return;} |
| | | |
| | | List<Map> list = opeUseFlowService.selectExportDetail(reagentCode, getUserId(), startTime, endTime, receiptNumber, department, project, applyPerson, reagentName); |
| | | if (list == null || list.size() < 1) {FacesUtils.warn("没有数据导出");return;} |
| | | opeUseFlowService.export22Excel(list); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | FacesUtils.warn("导出失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | list = opeUseFlowService.getPersonalUseInfoList |
| | | (reagentCode, getUserId(),startTime,endTime ,receiptNumber,department,project,applyPerson,reagentName,first,pageSize); |
| | | } |
| | | selectOne = null; |
| | | } catch (Exception e) { |
| | | logger.error(e); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public OpeUseFlow getRowData(String rowKey) { |
| | | Iterator<OpeUseFlow> iterator = this.iterator(); |
| | | if (iterator != null) { |
| | | OpeUseFlow su = null; |
| | | while (iterator.hasNext()) { |
| | | su = iterator.next(); |
| | | if (rowKey.equals(su.getReceiptNumber())) { |
| | | return su; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | // Iterator<OpeUseFlow> iterator = this.iterator(); |
| | | // if (iterator != null) { |
| | | // OpeUseFlow su = null; |
| | | // while (iterator.hasNext()) { |
| | | // su = iterator.next(); |
| | | // if (rowKey.equals(su.getReceiptNumber())) { |
| | | // return su; |
| | | // } |
| | | // } |
| | | // } |
| | | return opeUseFlowService.selectByReceiptNumber(rowKey,getUserId()); |
| | | } |
| | | }; |
| | | } |
| | | return dataModel2; |
| | | } |
| | | |
| | | public String getReagentId() { |
| | | public Long getReagentId() { |
| | | return reagentId; |
| | | } |
| | | |
| | | public void setReagentId(String reagentId) { |
| | | public void setReagentId(Long reagentId) { |
| | | this.reagentId = reagentId; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | if (null == startTime){ |
| | | Date now = new Date(); |
| | | Calendar cal = Calendar.getInstance(); |
| | | cal.setTime(now); |
| | | cal.add(Calendar.DATE, -7); |
| | | return cal.getTime(); |
| | | }else { |
| | | return startTime; |
| | | } |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | if (null == endTime){ |
| | | return new Date(); |
| | | }else { |
| | | return endTime; |
| | | } |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |