public ActionForward myExecute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) throws Exception { JournalBySpecialistForm form = (JournalBySpecialistForm) aRequest.getSession().getAttribute("poly_journalBySpecForm"); String id = aRequest.getParameter("id"); IReportsService repService = Injection.find(aRequest).getService(IReportsService.class); String groupBy = ActionUtil.updateParameter("VisitPatientByPoliclinic", "typeGroup", "1", aRequest); String view; String whereDop = ""; if (id != null && !id.equals("") && form != null) { view = ActionUtil.setParameter("VisitPatientByPoliclinic", "typeView", "1", aRequest); String[] ids = id.split(":"); aRequest.setAttribute("beginDate", ids[0]); aRequest.setAttribute("finishDate", ids[1]); System.out.println(ids[3]); if (ids[3] != null && !ids[3].equals("")) { whereDop = ids[3]; if (ids[2] != null && !ids[2].equals("") && !ids[2].equals("0")) { if (whereDop.equals("wcd.calendarDate") || whereDop.equals("t.createDate")) { whereDop = whereDop + "=to_date('" + ids[2] + "','dd.mm.yyyy')"; } else { whereDop = whereDop + "='" + ids[2] + "'"; } } else { whereDop = whereDop + " is null"; } } if (ids[4] != null && !ids[4].equals("")) form.setSpecialist(Long.valueOf(ids[4])); if (ids[5] != null && !ids[5].equals("")) form.setWorkFunction(Long.valueOf(ids[5])); if (ids[6] != null && !ids[6].equals("")) form.setLpu(Long.valueOf(ids[6])); if (ids[7] != null && !ids[7].equals("")) form.setServiceStream(Long.valueOf(ids[7])); if (ids[8] != null && !ids[8].equals("")) form.setWorkPlaceType(Long.valueOf(ids[8])); if (ids[9] != null && !ids[9].equals("")) form.setOrderLpu(Long.valueOf(ids[9])); if (ids[10] != null && !ids[10].equals("")) form.setOrderWorkFunction(Long.valueOf(ids[10])); /*if (ids[13]!=null && !ids[13].equals("")) form.setSocialStatus(Long.valueOf(ids[13])) ; if (ids[12]!=null && !ids[12].equals("")) form.setDefect(Long.valueOf(ids[12])) ;*/ } else { view = ActionUtil.updateParameter("VisitPatientByPoliclinic", "typeView", "2", aRequest); // date =ActionUtil.updateParameter("VisitPatientByPoliclinic","typeDate","2", aRequest) ; aRequest.setAttribute("beginDate", ""); // form.getBeginDate()) ; aRequest.setAttribute("finishDate", ""); // form.getFinishDate()) ; } boolean isReestr = false; if (view.equals("1")) isReestr = true; // aRequest.setAttribute("specialist", form.getSpecialist()) ; aRequest.setAttribute( "queryTextBegin", getTextQueryBegin( groupBy, form.getBeginDate(), form.getFinishDate(), form.getSpecialist(), form.getWorkFunction(), form.getLpu(), form.getServiceStream(), form.getWorkPlaceType(), form.getOrderLpu(), form.getOrderWorkFunction(), form.getSocialStatus(), form.getDefect())); aRequest.setAttribute( "queryTextEnd", getTextQueryEnd( isReestr, whereDop, true, groupBy, form.getBeginDate(), form.getFinishDate(), form.getSpecialist(), form.getWorkFunction(), form.getLpu(), form.getServiceStream(), form.getWorkPlaceType(), form.getOrderLpu(), form.getOrderWorkFunction(), form.getSocialStatus(), form.getDefect())); aRequest.setAttribute( "filterInfo", repService.getFilterInfoByOrder( form.getSpecialist(), form.getWorkFunction(), form.getLpu(), form.getServiceStream(), form.getWorkPlaceType(), form.getOrderLpu(), form.getOrderWorkFunction())); aRequest.setAttribute("groupByTitle", getTitle(groupBy)); return aMapping.findForward("success"); }
@Override public ActionForward myExecute( ActionMapping aMapping, ActionForm aForm, HttpServletRequest aRequest, HttpServletResponse aResponse) throws Exception { String typeDate = ActionUtil.updateParameter("DocumentExport", "typeDate", "2", aRequest); String typeDocument = ActionUtil.updateParameter("DocumentExport", "typeDocument", "3", aRequest); String orderBy = ActionUtil.updateParameter("DocumentExport", "orderBy", "1", aRequest); DisabilitySearchForm form = (DisabilitySearchForm) aForm; if (form.validate(aMapping, aRequest).size() == 0) { if (form.getBeginDate() != null && !form.getBeginDate().equals("")) { String beginDate = DateFormat.formatToJDBC(form.getBeginDate()); aRequest.setAttribute("beginDate", beginDate); String endDate = beginDate; if (form.getEndDate() != null && !form.getEndDate().equals("")) { endDate = DateFormat.formatToJDBC(form.getEndDate()); } aRequest.setAttribute("endDate", endDate); } aRequest.setAttribute("valid", "1"); } else { aRequest.setAttribute("valid", "0"); } String dGroup = ""; if (typeDate != null && typeDate.equals("1")) { dGroup = "(select min(dr2.dateFrom) from disabilityrecord as dr2 where dr2.disabilitydocument_id=dd.id)"; aRequest.setAttribute("dateGroup", dGroup); aRequest.setAttribute("dateSearch", "max"); aRequest.setAttribute("infoSearch", " Поиск по дате закрытия"); } else if (typeDate != null && typeDate.equals("2")) { dGroup = "dd.issuedate"; aRequest.setAttribute("dateGroup", dGroup); aRequest.setAttribute("dateSearch", "min"); aRequest.setAttribute("infoSearch", " Поиск по дате выдачи"); } if (orderBy != null && orderBy.equals("1")) { aRequest.setAttribute("orderByInfo", "по номерам больничных"); aRequest.setAttribute("orderBystatus", " dd.number "); } else if (orderBy != null && orderBy.equals("2")) { aRequest.setAttribute("orderByInfo", "по дате выдачи"); aRequest.setAttribute("orderBystatus", " dd.issueDate, dd.number "); } else { aRequest.setAttribute("orderByInfo", "по ФИО"); aRequest.setAttribute("orderBystatus", "p.lastname,p.firstname,p.middlename,dd.number"); } if (typeDocument != null && typeDocument.equals("1")) { aRequest.setAttribute("typeDocumentInfo", "всем экспортированным"); aRequest.setAttribute("status", "(dd.exportdate is not null) and "); } else if (typeDocument != null && typeDocument.equals("2")) { aRequest.setAttribute("typeDocumentInfo", "успешно экспортированным"); aRequest.setAttribute("status", "(dd.exportdate is not null and dd.exportdefect='') and "); } else { aRequest.setAttribute("typeDocumentInfo", "дефекты"); aRequest.setAttribute( "status", "(dd.exportdate is not null and (dd.exportdefect is not null and dd.exportdefect!='')) and "); } return aMapping.findForward("success"); }