Esempio n. 1
0
 private void log2Db(String driverId) {
   OperationLogInfoBo bo = new OperationLogInfoBo();
   bo.setOperationName("addNewDriverUserAssessAction");
   bo.setOperationType(42);
   bo.setRemark("新增货源评价");
   if (StringUtils.isNotBlank(driverId)) {
     bo.setUserDriverId(Integer.parseInt(driverId));
   }
   operationLogService.insertOperationLog(bo);
 }
Esempio n. 2
0
 private void log2Db(String driverId) {
   OperationLogInfoBo bo = new OperationLogInfoBo();
   bo.setOperationName("noteSendAction");
   bo.setOperationType(18);
   bo.setRemark("手机验证码");
   if (StringUtils.isNotBlank(driverId)) {
     bo.setUserDriverId(Integer.parseInt(driverId));
   }
   operationLogService.insertOperationLog(bo);
 }
Esempio n. 3
0
 private void log2Db(String driverId) {
   OperationLogInfoBo bo = new OperationLogInfoBo();
   bo.setOperationName("transactionInfoDetailAction");
   bo.setOperationType(34);
   bo.setRemark("订单详情");
   if (StringUtils.isNotBlank(driverId)) {
     bo.setUserDriverId(Integer.parseInt(driverId));
   }
   operationLogService.insertOperationLog(bo);
 }
Esempio n. 4
0
  public String exec() {
    try {
      String driverId = "";
      String resulte = "0";
      String message = "";

      StringBuilder content = new StringBuilder();
      content.append("【快到网】");
      String code = getRandomStr(6); // 随机生成6位验证码

      String phoneNumber = request.getParameter("mobilephone");
      if (StringUtils.isBlank(phoneNumber)) {
        log.info("用户没有输入手机号码. ");
        sendResponseToJson("-8", "请输入手机号码");
        return ERROR;
      }
      boolean match = ValidateUtil.validateTelePhone(phoneNumber); // 手机号码格式验证
      if (!match) {
        log.info("手机号码格式不正确. ");
        sendResponseToJson("-8", "手机号码格式不正确");
        return ERROR;
      }
      boolean exist = false;
      String flag =
          request.getParameter("differenceFlag"); // Register or Login ? 0-> Register,1 -> Login
      if (StringUtils.isNotBlank(flag)) {
        if ("0".equals(flag)) {
          content.append("感谢您注册,验证码:");
          content.append(code);
          content.append("(5分钟内有效),如非本人操作请忽略,谢谢合作。");
          exist = loginUserInfoService.checkUserAccountExist(phoneNumber);
          if (exist) {
            resulte = "0";
            message = "账号已注册, 请重新输入. ";
            sendResponseToJson(resulte, message);
            return ERROR;
          }
        } else if ("1".equals(flag)) {
          exist = loginUserInfoService.checkUserAccountExist(phoneNumber);
          if (!exist) {
            resulte = "0";
            message = "该号码不存在, 请重新输入. ";
            sendResponseToJson(resulte, message);
            return ERROR;
          }
        }
      } else {
        driverId = request.getParameter("driverId");
        if (StringUtils.isBlank(driverId)) {
          sendResponseToJson("-9", "司机不存在");
          return ERROR;
        }
        int accFlag = operationLogService.checkUser(driverId);
        if (accFlag == 1) {
          log.info("该用户不存在或已被删除");
          sendResponseToJson("-9", "该用户不存在或已被删除");
          return ERROR;
        } else if (accFlag == 11) {
          log.info("该用户已被冻结");
          sendResponseToJson("-9", "该用户已被冻结");
          return ERROR;
        }

        content.append("感谢您进行手机认证,验证码:");
        content.append(code);
        content.append("(5分钟内有效),如非本人操作请忽略,谢谢合作。");
      }
      //			String code = "123456";
      log.info("验证手机号码: " + phoneNumber + "; 验证码: " + code);
      String sdk = driverUserCargoInfoService.noteSend(phoneNumber, content.toString());
      String returnStatus = XmlParseUtil.getXmlStr(sdk, "status");
      if ("0".equals(returnStatus)) {
        resulte = "1";
        message = "用户注册发送验证码成功";
      } else {
        resulte = "0";
        message = "用户注册发送验证码失败";
      }

      log2Db(driverId);
      sendResponseToJson(resulte, message, code);

      NoteLogInfo noteLogInfo = new NoteLogInfo();
      noteLogInfo.setMobilephone(phoneNumber);
      noteLogInfo.setNoteCode(code);
      noteLogInfo.setReturnedValue(XmlParseUtil.getXmlStr(sdk, "taskid"));
      noteLogInfo.setVisitIp(request.getRemoteAddr());
      operationLogService.insertNoteLogInfo(noteLogInfo);
    } catch (Exception e) {
      log.error(e.getMessage());
      try {
        sendResponseToJson("-8", e.getMessage());
      } catch (IOException e1) {
        e1.printStackTrace();
      }
      e.printStackTrace();
    }
    return SUCCESS;
  }