/**
   * 查询本局的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;
  }
  /** runDate :格式:yyyyMMdd */
  public List<ParamDto> getTotalTrains(String runDate, String startBureauFull, String trainNbr) {
    List<ParamDto> list = new ArrayList<ParamDto>();
    Map<String, String> paramMap = new HashMap<String, String>();
    paramMap.put("runDate", runDate);
    paramMap.put("startBureauFull", startBureauFull);
    if (trainNbr != null && !"".equals(trainNbr.trim())) {
      paramMap.put("trainNbr", trainNbr);
    }

    List<Map<String, Object>> mapList =
        baseDao.selectListBySql(Constants.TRAINPLANDAO_GET_TOTALTRAINS, paramMap);
    if (mapList != null && mapList.size() > 0) {
      // System.err.println("mapList.size===" + mapList.size());
      for (Map<String, Object> map : mapList) {
        ParamDto dto = new ParamDto();
        dto.setSourceEntityId(StringUtil.objToStr(map.get("BASE_TRAIN_ID")));
        dto.setPlanTrainId(StringUtil.objToStr(map.get("PLAN_TRAIN_ID")));
        String time = StringUtil.objToStr(map.get("RUN_DATE"));
        dto.setTime(DateUtil.formateDate(time));
        list.add(dto);
      }
    }
    return list;
  }
 /**
  * 查询车次的始发站和终点站等信息
  *
  * @param runDate 开行日期
  * @param trainNbr 车次
  * @param count 返回的条数
  */
 public List<PlanTrainDto> getTrainShortInfo(String runDate, String trainNbr, int count) {
   List<PlanTrainDto> returnList = new ArrayList<PlanTrainDto>();
   Map<String, Object> paramMap = new HashMap<String, Object>();
   paramMap.put("runDate", runDate);
   paramMap.put("rownum", count);
   if (trainNbr != null && !"".equals(trainNbr)) {
     paramMap.put("trainNbr", trainNbr);
   }
   // 调用dao获取数据  TRAINPLANDAO_GET_TRAIN_SHORTINFO
   List<Map<String, Object>> listMap =
       baseDao.selectListBySql(Constants.TRAINPLANDAO_GET_TRAIN_SHORTINFO, paramMap);
   if (listMap != null && listMap.size() > 0) {
     for (Map<String, Object> map : listMap) {
       PlanTrainDto dto = new PlanTrainDto();
       dto.setPlanTrainId(StringUtil.objToStr(map.get("PLAN_TRAIN_ID")));
       dto.setEndStn(StringUtil.objToStr(map.get("END_STN")));
       dto.setRunDate(StringUtil.objToStr(map.get("RUN_DATE")));
       dto.setStartStn(StringUtil.objToStr(map.get("START_STN")));
       dto.setTrainNbr(StringUtil.objToStr(map.get("TRAIN_NBR")));
       returnList.add(dto);
     }
   }
   return returnList;
 }