コード例 #1
0
  private HighlineCrossCmd generatorHighlineCrossByPlanTrain(
      PlanTrainCMD planTrain, String bureuaCode, Date runDate) {
    HighlineCrossCmd highlineCross = new HighlineCrossCmd();
    highlineCross.setHighlineCrossId(UUID.randomUUID().toString());
    highlineCross.setCrossName(planTrain.getTrainNbr());
    highlineCross.setCrossStartDate(planTrain.getRunDate());
    highlineCross.setCrossEndDate(planTrain.getRunDate());
    highlineCross.setCrossStartStn(planTrain.getStartStn());
    highlineCross.setCrossEndStn(planTrain.getEndStn());
    highlineCross.setSpareFlag(
        planTrain.getSpareFlag() == null ? "" : (planTrain.getSpareFlag() + ""));
    // P-京
    highlineCross.setTokenVehBureau(
        planTrain.getTokenVehBureau() == null
            ? ""
            : bureauDao.getShortBureauNameByCode(planTrain.getTokenVehBureau()));
    highlineCross.setTokenPsgBureau(
        planTrain.getTokenPsgBureau() == null
            ? ""
            : bureauDao.getShortBureauNameByCode(planTrain.getTokenPsgBureau()));

    highlineCross.setCrossBureau(bureuaCode);
    highlineCross.setCrossDate(StringAndTimeUtil.yearMonthDaySimpleSdf.format(runDate));
    // 20150506 增加交路显示名的拼接
    List<PlanTrainCMD> trainList = new ArrayList<PlanTrainCMD>();
    trainList.add(planTrain);
    highlineCross.setCrossDisplayName(getHighlineCrossDisplayName(trainList));
    if (ConstantUtil.PLAN_TRAIN_CREATE_TYPE_CMD == planTrain.getCreatType().intValue()) {
      highlineCross.setCreatReason(
          planTrain.getCmdShortinfo() == null ? "" : planTrain.getCmdShortinfo());
    }
    if (ConstantUtil.PLAN_TRAIN_CREATE_TYPE_TELEGRAPH == planTrain.getCreatType().intValue()) {
      highlineCross.setCreatReason(
          planTrain.getTelShortinfo() == null ? "" : planTrain.getTelShortinfo());
    }

    cmdPlanDao.insertHighlineCross(highlineCross);
    return highlineCross;
  }
コード例 #2
0
  private HighlineCrossCmd generatorHighlineCrossByPlanCross(
      PlanCrossCmd planCross, String bureuaCode, Date runDate) {
    // TODO Auto-generated method stub
    HighlineCrossCmd highlineCross = new HighlineCrossCmd();
    highlineCross.setHighlineCrossId(UUID.randomUUID().toString());

    highlineCross.setPlanCrossId(
        planCross.getPlanCrossId() == null ? "" : planCross.getPlanCrossId());
    highlineCross.setBaseCrossId(planCross.getBaseCrossId());
    highlineCross.setCrossName(planCross.getCrossName() == null ? "" : planCross.getCrossName());
    if (planCross.getTrainList() == null || planCross.getTrainList().isEmpty()) return null;
    PlanTrainCMD firstTrain = planCross.getTrainList().get(0);
    PlanTrainCMD lastTrain = planCross.getTrainList().get(planCross.getTrainList().size() - 1);
    highlineCross.setCrossStartDate(firstTrain.getRunDate() == null ? "" : firstTrain.getRunDate());
    highlineCross.setCrossEndDate(lastTrain.getRunDate() == null ? "" : lastTrain.getRunDate());
    highlineCross.setCrossStartStn(
        firstTrain.getStartStn() == null ? "" : firstTrain.getStartStn());
    highlineCross.setCrossEndStn(lastTrain.getEndStn() == null ? "" : lastTrain.getEndStn());
    highlineCross.setSpareFlag(planCross.getSpareFlag());
    highlineCross.setThroughLine(
        planCross.getThroughLine() == null ? "" : planCross.getThroughLine());
    highlineCross.setTokenVehBureau(
        planCross.getTokenVehBureau() == null ? "" : planCross.getTokenVehBureau());
    highlineCross.setTokenVehDepot(
        planCross.getTokenVehDepot() == null ? "" : planCross.getTokenVehDepot());
    highlineCross.setTokenVehDept(
        planCross.getTokenVehDept() == null ? "" : planCross.getTokenVehDept());
    highlineCross.setTokenPsgBureau(
        planCross.getTokenPsgBureau() == null ? "" : planCross.getTokenPsgBureau());
    highlineCross.setTokenPsgDept(
        planCross.getTokenPsgDept() == null ? "" : planCross.getTokenPsgDept());
    highlineCross.setCrossBureau(bureuaCode);
    highlineCross.setRelevantBureau(
        planCross.getRelevantBureau() == null ? "" : planCross.getRelevantBureau());
    highlineCross.setCrhType(planCross.getCrhType() == null ? "" : planCross.getCrhType());
    highlineCross.setCreatReason(ConstantUtil.HIGHLINE_CROSS_CREAT_REASON_BASEMAP);
    highlineCross.setCrossDate(StringAndTimeUtil.yearMonthDaySimpleSdf.format(runDate));
    highlineCross.setPostId(planCross.getPostId());
    highlineCross.setPostName(planCross.getPostName() == null ? "" : planCross.getPostName());
    // 20150506 增加交路显示名的拼接
    highlineCross.setCrossDisplayName(getHighlineCrossDisplayName(planCross.getTrainList()));
    cmdPlanDao.insertHighlineCross(highlineCross);
    return highlineCross;
  }