Exemplo n.º 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;
    }
  }
Exemplo n.º 2
0
  /** 获得行为层评估列表设置问题的下属Id */
  @RequestMapping(value = "getBelongIds.html", method = RequestMethod.GET)
  @ResponseBody
  public String[] getBelongIds(HttpServletRequest request, ModelMap model) {
    String sId = request.getParameter("sId");
    SurveyParam sp = new SurveyParam();
    sp.setPage("1");
    sp.setMax("10");
    sp.setType("2"); // 行为层评估类型
    sp.setUpId(sId); // 将该行为层评估Id作为UpId查询下属的问题模板Id

    String upLevelTp = ""; // 上级模板Id
    String equalLevelTp = ""; // 平级模板Id
    String downLevelTp = ""; // 下级模板Id
    String elseTp = ""; // 其他模板Id
    String selfTp = ""; // 本人模板Id

    Collection<BehaviorBo> belongIdList = beService.getBehaviorList(sp);
    for (BehaviorBo belongId : belongIdList.getData()) {
      if (null != belongId.getLogo()
          && null != belongId.getsId()
          && belongId.getLogo().equals("0")) { // 上级
        upLevelTp = belongId.getsId();
      }
      if (null != belongId.getLogo()
          && null != belongId.getsId()
          && belongId.getLogo().equals("1")) { // 平级
        equalLevelTp = belongId.getsId();
      }
      if (null != belongId.getLogo()
          && null != belongId.getsId()
          && belongId.getLogo().equals("2")) { // 下级
        downLevelTp = belongId.getsId();
      }
      if (null != belongId.getLogo()
          && null != belongId.getsId()
          && belongId.getLogo().equals("3")) { // 其他
        elseTp = belongId.getsId();
      }
      if (null != belongId.getLogo()
          && null != belongId.getsId()
          && belongId.getLogo().equals("4")) { // 本人
        selfTp = belongId.getsId();
      }
    }
    String[] belongIds = {"", "", "", "", ""};
    belongIds[0] = upLevelTp;
    belongIds[1] = equalLevelTp;
    belongIds[2] = downLevelTp;
    belongIds[3] = elseTp;
    belongIds[4] = selfTp;
    return belongIds;
  }
Exemplo n.º 3
0
  @RequestMapping("new.html")
  public String tonew(HttpServletRequest request, ModelMap model) {
    String type = request.getParameter("type");
    String sid = request.getParameter("sid");
    // LMSWD-1401 by LTC 20130510
    String symbol = request.getParameter("symbol");
    if (null != symbol && symbol != "") {
      model.put("symbol", symbol);
    }
    if (!StringUtils.isBlank(sid)) {
      SurveyParam p = new SurveyParam();
      p.setId(sid);
      BehaviorBo b = beService.getBehavior(p);
      model.put("b", b);

      // 查询是否跟培训班关联
      Map<String, String> con = new HashMap<String, String>();
      con.put("surveyId", sid);
      /*List<SurveyAimClassBo> list = classService.getSurveyAimClasses(con);
      if(list!=null&&list.size()>0){
      	model.put("tc", list.get(0).getTc());
      }*/
      boolean isSameMode = true;
      if (!(b.getBehavior().get("1").getStId().equals(b.getBehavior().get("2").getStId()))) {
        isSameMode = false;
      } else if (!(b.getBehavior().get("1").getStId().equals(b.getBehavior().get("3").getStId()))) {
        isSameMode = false;
      } else if (!(b.getBehavior().get("1").getStId().equals(b.getBehavior().get("4").getStId()))) {
        isSameMode = false;
      }
      model.put("isSameMode", isSameMode);
    }
    if ("2".equals(type)) {
      return "survey/behavior_new";
    } else if ("3".equals(type)) {
      return "survey/lpi_new2";
    } else {
      return "";
    }
  }