예제 #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;
    }
  }
  /** 保存会议内容 */
  @RequestMapping(value = "saveMeeting.html", method = RequestMethod.POST)
  public ModelAndView saveMeeting(HttpServletRequest req, ModelMap model) {
    UserInfoBo user = (UserInfoBo) req.getSession().getAttribute("user");
    MeetingCon mc = new MeetingCon();
    String name = req.getParameter("name");
    String start_date = req.getParameter("start_date");
    String end_date = req.getParameter("end_date");
    String start_hour = req.getParameter("start_hour");
    String start_minute = req.getParameter("start_minute");
    String start_second = req.getParameter("start_second");
    String end_hour = req.getParameter("end_hour");
    String end_minute = req.getParameter("end_minute");
    String end_second = req.getParameter("end_second");
    String master_name = req.getParameter("master_name");
    String teacher_name = req.getParameter("teacher_name");
    String remarks = req.getParameter("remarks");
    String _maxAttend = req.getParameter("maxAttend");
    if (_maxAttend == "" || _maxAttend == null) {
      int maxAttend = 0;
      mc.setMaxAttend(maxAttend);
    }
    if (_maxAttend != "" && _maxAttend != null) {
      int maxAttend = Integer.parseInt(_maxAttend);
      mc.setMaxAttend(maxAttend);
    }

    mc.setName(name);
    mc.setStart_date(start_date);
    mc.setEnd_date(end_date);
    mc.setStart_hour(start_hour);
    mc.setStart_minute(start_minute);
    mc.setStart_second(start_second);
    mc.setEnd_hour(end_hour);
    mc.setEnd_minute(end_minute);
    mc.setEnd_second(end_second);
    mc.setMaster_id(master_name);
    mc.setTeacher_id(teacher_name);
    mc.setRemarks(remarks);
    mc.setStatus(0);
    mc.setCreater_id(user.getUid());
    mc.setCreate_date(DateTool.getNowShort()); // 保存当前日期

    Return re = meetingService.newMeeting(mc);
    mc.setmId(re.getCode());
    return new ModelAndView("redirect:turnStaff.html?mId=" + mc.getmId(), model);
  }
  /** 修改会议内容 */
  @RequestMapping(value = "saveModifiedMeeting.html", method = RequestMethod.POST)
  public ModelAndView saveModifiedMeeting(HttpServletRequest req, ModelMap model) {
    String mId = req.getParameter("mId");
    String bool = req.getParameter("bools");
    if (bool.equals("true")) {
      return new ModelAndView("redirect:turnStaff.html?mId=" + mId, model);
    }

    String name = req.getParameter("name");
    String start_date = req.getParameter("start_date");
    String end_date = req.getParameter("end_date");
    String start_hour = req.getParameter("start_hour");
    String start_minute = req.getParameter("start_minute");
    String start_second = req.getParameter("start_second");
    String end_hour = req.getParameter("end_hour");
    String end_minute = req.getParameter("end_minute");
    String end_second = req.getParameter("end_second");
    String master_name = req.getParameter("master_name");
    String teacher_name = req.getParameter("teacher_name");
    String _maxAttend = req.getParameter("maxAttend");
    int maxAttend = Integer.parseInt(_maxAttend);
    String remarks = req.getParameter("remarks");

    MeetingCon mc = new MeetingCon();
    UserInfoBo user = (UserInfoBo) req.getSession().getAttribute("user");
    mc.setmId(mId);
    mc.setName(name);
    mc.setStart_date(start_date);
    mc.setEnd_date(end_date);
    mc.setStart_hour(start_hour);
    mc.setStart_minute(start_minute);
    mc.setStart_second(start_second);
    mc.setEnd_hour(end_hour);
    mc.setEnd_minute(end_minute);
    mc.setEnd_second(end_second);
    mc.setMaster_id(master_name);
    mc.setTeacher_id(teacher_name);
    mc.setMaxAttend(maxAttend);
    mc.setRemarks(remarks);
    mc.setUpdater_id(user.getUid());
    mc.setUpdate_date(DateTool.getShortDate()); // 保存当前修改日期

    meetingService.newMeeting(mc);
    return new ModelAndView("redirect:turnStaff.html?mId=" + mId, model);
  }