public ActionForward myExecute(
     ActionMapping aMapping,
     ActionForm aForm,
     HttpServletRequest aRequest,
     HttpServletResponse aResponse)
     throws Exception {
   long id = getLongId(aRequest, "Формат");
   IFormatService service = Injection.find(aRequest).getService(IFormatService.class);
   service.removeFieldsWithEmptyProperty(id);
   return ForwardUtil.createIdRedirectForward(aMapping.findForward("success"), id);
 }
  public void doTag() throws JspException, IOException {
    PageContext ctx = (PageContext) getJspContext();
    HttpServletRequest request = (HttpServletRequest) ctx.getRequest();

    Object aObj = request.getAttribute("entity");
    try {
      JspWriter out = ctx.getOut();
      if (aObj == null) {
        out.println("Нет атрибута entity");
        return;
      }

      ICheckMessageService service = Injection.find(request).getService(ICheckMessageService.class);
      long messageId = Long.parseLong(request.getParameter("id"));
      Collection<String> badProperties = service.getBadProperties(messageId);
      // System.out.println("badProperties="+badProperties) ;
      if (badProperties == null) return;
      ImportDataViewHelper.printTableHeader(out);
      for (String prop : badProperties) {
        // System.out.println("prop="+prop) ;
        if (StringUtil.isNullOrEmpty(prop)) {
          out.print(
              "<tr><td colspan='3'>Свойство равно null. <a href='entityParentView-exp_check.do?id=");
          out.print(service.getCheckByMessage(messageId));
          out.println("'>Изменить проверку</a></td></tr>");
        } else {
          // String methodName = PropertyUtil.getGetterMethodNameForProperty(prop) ;
          Method method =
              PropertyUtil.getGetterMethod(
                  aObj.getClass(), prop); // aObj.getClass().getMethod(methodName);
          ImportDataViewHelper.print(aObj, out, method);
        }
      }
      out.println("</table>");

    } catch (Exception e) {
      e.printStackTrace();
      throw new IllegalStateException(e);
    }
  }
  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");
  }