Пример #1
0
  @RequestMapping(value = "save.html", method = RequestMethod.POST)
  public String save(BehaviorCon b, HttpServletRequest request, ModelMap model) {
    String tcid = request.getParameter("tcid");
    String tcName = request.getParameter("tcName");
    String symbol = request.getParameter("symbol");
    String sid = request.getParameter("sId");
    this.setTp(b, request);
    UserInfoBo user = (UserInfoBo) request.getSession().getAttribute("user");
    b.setCreater_id(user.getUid());
    // LMSWD-2471 by LTC 20130510
    b.setTrainClassId(tcid);
    b.setCreate_date(DateTool.getNowShort());
    String status = request.getParameter("status"); // 不改变发布状态
    if (null != status && status != "") {
      int _status = Integer.parseInt(status);
      b.setStatus(_status);
    } else {
      b.setStatus(1); // 新建默认为未发布
    }
    /** **此培训班ID作为upId是区分是否是在培训内新建的评估|LMSWD-3469|by LuChao*** */
    b.setUpId(b.getUpId());

    SurveyCon survey = new SurveyCon();
    String nameJudge = b.getTopic();
    survey.setTopic(nameJudge);
    survey.setsId(sid);
    survey.setType(b.getType());
    Return repeat = sService.getVildateName(survey);
    if (repeat.getCode().equals("0")) {
      Return re = beService.newBehavior(b);
      if (re.getCode() != null && tcid != null) {
        SurveyAimCon cla = new SurveyAimCon();
        cla.setObjectId(tcid);
        if (null != tcName) {
          cla.setObjectName(tcName);
        }
        cla.setSurvey_id(re.getCode());
        aimService.saveLpi(cla);
      }
      return "redirect:setting.html?type="
          + b.getType()
          + "&sid="
          + re.getCode()
          + "&symbol="
          + symbol
          + "&upId="
          + b.getUpId();
    } else {
      return "redirect:errorforsurvey.html?type="
          + b.getType()
          + "&sid="
          + sid
          + "&symbol="
          + symbol;
    }
  }
Пример #2
0
 @RequestMapping(value = "delete.html", method = RequestMethod.POST)
 @ResponseBody
 public Return delete(HttpServletRequest request, ModelMap model) {
   String[] ids = request.getParameterValues("id");
   SurveyParam p = new SurveyParam();
   p.setId(StringTool.getString(ids, StringTool.SPLIT_COMMA));
   SurveyCon sc = new SurveyCon();
   sc.setsId(p.getId());
   srService.deleteCacheBySurveyId(sc);
   Return re = sService.removeSurveys(p);
   return re;
 }
Пример #3
0
 @RequestMapping("list.html")
 public String list(HttpServletRequest request, ModelMap model) {
   String type = request.getParameter("type");
   String topic = request.getParameter("topic");
   String orgid = request.getParameter("orgid");
   String start_date = request.getParameter("start_date");
   String end_date = request.getParameter("end_date");
   SurveyParam p = new SurveyParam();
   p.setOrgDepId(orgid);
   p.setType(type);
   p.setTopic(topic);
   p.setStartDt(start_date);
   p.setEndDt(end_date);
   p.setPage(PagerTool.getPageNo(request));
   p.setMax(PagerTool.getPageSize(request));
   Collection<SurveyBo> list = sService.getSurveys(p);
   model.put("list", list);
   model.put(PagerTool.PAGER_FN_NAME, PagerTool.getPageFunction(request));
   return "survey/behavior_list";
 }