コード例 #1
0
  @Override
  public void insertUpmpFlow(SendFlowCondition condition) {

    logger.info("[开始将t_pay_upmp 表中的流水写入到t_history表中!]");
    // 查出payupmp表中满足条件的数据
    PayUpmpCondition payUpmpCondition = new PayUpmpCondition();
    payUpmpCondition.setTransBeginDate(condition.getStartDate());
    payUpmpCondition.setTransEndDate(condition.getEndDate());
    payUpmpCondition.setTransType(condition.getTransType());

    Page<PayUpmp> payUpmpPage =
        payUpmpService.queryPayUpmpByCondition(payUpmpCondition, 0, EVERY_PAGE_NUMBER);
    int startIndexUpmp = 0;
    int totalUpmp = payUpmpPage.getTotalCount();
    int countTimeUpmp =
        totalUpmp % EVERY_PAGE_NUMBER > 0
            ? (totalUpmp / EVERY_PAGE_NUMBER) + 1
            : (totalUpmp / EVERY_PAGE_NUMBER);

    if (totalUpmp <= 0) {
      logger.error(
          "[将t_pay_upmp 表中的流水写入到t_history表失败,指定查询周期("
              + condition.getStartDate()
              + ")到("
              + condition.getEndDate()
              + ") t_pay_upmp表 中无流水记录!]");
      return;
    }
    // 分页查询
    for (int i = 0; i < countTimeUpmp; i++) {
      List<PayUpmp> payUpmpList = new ArrayList<PayUpmp>();
      List<SendFlow> flowList = new LinkedList<SendFlow>();
      payUpmpList =
          payUpmpService
              .queryPayUpmpByCondition(payUpmpCondition, startIndexUpmp, EVERY_PAGE_NUMBER)
              .getItems();
      flowList = insertPayUpmp(payUpmpList);
      startIndexUpmp = startIndexUpmp + EVERY_PAGE_NUMBER;
      sendFlowDao.saveAll(flowList);
      logger.info("[payUpmp分页第" + (i + 1) + "页同步完成...]");
    }
    logger.info("[将t_pay_upmp 表中的流水写入到t_history表完成!]");
  }
コード例 #2
0
  @Override
  public void insertPayCupsFlow(SendFlowCondition condition) {

    logger.info("[开始将t_pay_cups 表中的流水写入到t_history表中!]");
    // 查出paycup表中满足条件的数据
    PayCupsCondition payCupsCondition = new PayCupsCondition();
    payCupsCondition.setBeginDate(condition.getStartDate());
    payCupsCondition.setEndDate(condition.getEndDate());
    payCupsCondition.setTransType(condition.getTransType());
    // 分页的参数
    Page<PayCups> payCupsPage =
        payCupsService.queryPayCupsByCondition(payCupsCondition, 0, EVERY_PAGE_NUMBER);
    int startIndexCups = 0;
    int totalCups = payCupsPage.getTotalCount();
    int countTimeCups =
        totalCups % EVERY_PAGE_NUMBER > 0
            ? (totalCups / EVERY_PAGE_NUMBER) + 1
            : (totalCups / EVERY_PAGE_NUMBER);

    if (totalCups <= 0) {
      logger.error(
          "[将t_pay_cups 表中的流水写入到t_history表失败,指定查询周期("
              + condition.getStartDate()
              + ")到("
              + condition.getEndDate()
              + ") t_pay_cups 中无流水记录!]");
      return;
    }
    // 分页查询
    for (int i = 0; i < countTimeCups; i++) {
      List<PayCups> payCupsList = new ArrayList<PayCups>();
      List<SendFlow> flowList = new LinkedList<SendFlow>();
      payCupsList =
          payCupsService
              .queryPayCupsByCondition(payCupsCondition, startIndexCups, EVERY_PAGE_NUMBER)
              .getItems();
      flowList = insertPayCups(payCupsList);
      startIndexCups = startIndexCups + EVERY_PAGE_NUMBER;
      sendFlowDao.saveAll(flowList);
      logger.info("[payCups分页第" + (i + 1) + "页同步完成...]");
    }
    logger.info("[将t_pay_cups 表中的流水写入到t_history表完成!]");
  }