示例#1
0
    /*
     * 状态报告
     *
     * 我们下发了submit订购成功消息后会上报一个状态
     * 订购成功:State=2  ErrorCode:100
     *
     *
     */
    private void report(Report command) {
      log.info("report:" + command.getErrorCode());
      log.info("report:" + command.getReportType());
      log.info("report:" + command.getReverse());
      log.info("report:" + command.getState());
      log.info("report:" + command.getSubmitSequenceNumber());
      log.info("report:" + command.getUserNumber());

      ReportModel req = new ReportModel();
      req.setErrorCode("" + command.getErrorCode());
      req.setReportType("" + command.getReportType());
      req.setReverse("" + command.getReverse());
      req.setState("" + command.getState());
      req.setSubmitSequenceNumber("" + command.getSubmitSequenceNumber());
      req.setUserNumber("" + command.getUserNumber());
      try {
        MongodbDAO.insertReport(req);
        // 第二步,更新订购状态,并通知portal已经订购成功
        MongodbDAO.updateMTReqStatus(
            command.getSubmitSequenceNumber(), Byte.toString(command.getErrorCode()));
      } catch (Exception e) {
        e.printStackTrace();
      }
    }