コード例 #1
0
  /**
   * 保存存生成运行线时临时数据
   *
   * @param reqMap
   * @return
   */
  @ResponseBody
  @RequestMapping(value = "/savePlanTrainInfoTemp", method = RequestMethod.POST)
  public Result savePlanTrainInfoTemp(@RequestBody String reqStr) {
    Result result = new Result();
    logger.info("saveWdCmdTrain~~reqStr==" + reqStr);
    try {
      JSONObject reqObj = JSONObject.fromObject(reqStr);
      String trainStr = (String) reqObj.get("cmdTrainMap");
      JSONObject trainMap = JSONObject.fromObject(trainStr);
      PlanTrainInFoTemp planTrainInFoTemp = new PlanTrainInFoTemp();
      ShiroRealm.ShiroUser user = (ShiroRealm.ShiroUser) SecurityUtils.getSubject().getPrincipal();
      // 局简称
      String bureuaShortName = user.getBureauShortName();
      logger.debug("bureuaShortName==" + bureuaShortName);

      planTrainInfoTempService.insertPlanTrainInFoTemp(planTrainInFoTemp);

    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      result.setCode(StaticCodeType.SYSTEM_ERROR.getCode());
      result.setMessage(StaticCodeType.SYSTEM_ERROR.getDescription());
    }

    return result;
  }
コード例 #2
0
  /**
   * 查询本局的PlanTrainInfoTemp信息
   *
   * @param reqMap
   * @return
   */
  @ResponseBody
  @RequestMapping(value = "/getPlanTrainInfoTemp", method = RequestMethod.POST)
  public Result getPlanTrainInfoTemp(@RequestBody Map<String, Object> reqMap) {
    Result result = new Result();
    logger.info("getCmdTrainInfo~~reqMap==" + reqMap);
    String startDate = StringUtil.objToStr(reqMap.get("startDate"));
    String endDate = StringUtil.objToStr(reqMap.get("endDate"));

    ShiroRealm.ShiroUser user = (ShiroRealm.ShiroUser) SecurityUtils.getSubject().getPrincipal();
    // 本局局码
    String bureuaCode = user.getBureau();
    logger.debug("bureuaCode==" + bureuaCode);

    List<PlanTrainInFoTemp> returnList = new ArrayList<PlanTrainInFoTemp>();
    try {
      PlanTrainInFoTemp planTrainInFoTemp = new PlanTrainInFoTemp();

      returnList = planTrainInfoTempService.getPlanTrainInFoTemp(planTrainInFoTemp);
      logger.info("文电命令:" + returnList.size());
      result.setData(returnList);
    } catch (Exception e) {
      logger.error(e.getMessage(), e);
      result.setCode(StaticCodeType.SYSTEM_ERROR.getCode());
      result.setMessage(StaticCodeType.SYSTEM_ERROR.getDescription());
    }

    return result;
  }