| | |
| | | @ApiOperation(value = "订单完成支付订单操作【1.1】", tags = {"用户端-出租车", "用户端-专车", "用户端-跨城", "用户端-小件物流"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付方式(1=手机支付,2=银行卡支付,3=余额,4=线下支付)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=跨城,4=同城小件物流,5=跨城小件物流)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "优惠券id", name = "couponId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil payTaxiOrder(Integer payType, Integer orderId, Integer orderType, Integer couponId, Integer type, Integer language, HttpServletRequest request){ |
| | | public ResultUtil payTaxiOrder(Integer payType, Integer bankCardId, Integer orderId, Integer orderType, Integer couponId, Integer type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | |
| | | } |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.payPrivateCarOrder(payType, "user_" + uid, orderId, couponId, type, language); |
| | | return orderPrivateCarService.payPrivateCarOrder(payType, bankCardId, orderId, couponId, type, language); |
| | | // case 2: |
| | | // return orderTaxiService.payTaxiOrder(payType, orderId, couponId, type); |
| | | // case 3: |
| | | // return orderCrossCityService.payCrossCityOrder(payType, orderId, couponId, type); |
| | | case 4: |
| | | return orderLogisticsService.payLogisticsOrder(payType, "user_" + uid, orderId, type, language); |
| | | return orderLogisticsService.payLogisticsOrder(payType, bankCardId, orderId, type, language); |
| | | // case 5: |
| | | // return orderLogisticsService.payLogisticsOrder(payType, orderId, type, language); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 完成订单微信支付回调 |
| | | * @param |
| | |
| | | * @param callbackRequest |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/IGO/wxCancelUserBalance") |
| | | @PostMapping("/wxCancelUserBalance") |
| | | public CallbackResponse wxCancelUserBalance(@RequestBody CallbackRequest callbackRequest){ |
| | | System.err.println("支付成功回调------>" + JSON.toJSONString(callbackRequest)); |
| | | CallbackResponse callbackResponse = new CallbackResponse(); |
| | |
| | | Payments payments = callbackRequest.getPayments().get(0); |
| | | String order_id = payments.getPayer_transaction_id(); |
| | | if(ToolUtil.isNotEmpty(out_trade_no)){ |
| | | // Integer language = Integer.valueOf(out_trade_no.substring(17, 18)); |
| | | // Integer id = Integer.valueOf(out_trade_no.substring(18)); |
| | | // userInfoService.payCancelUserBalance(null, order_id, Integer.valueOf(id), 1, language); |
| | | Integer language = Integer.valueOf(out_trade_no.substring(17, 18)); |
| | | Integer id = Integer.valueOf(out_trade_no.substring(18)); |
| | | userInfoService.payCancelUserBalance(null, order_id, Integer.valueOf(id), 1, language); |
| | | callbackResponse.setCheckout_request_id(order_id); |
| | | callbackResponse.setMerchant_transaction_id(out_trade_no); |
| | | callbackResponse.setStatus_code("183"); |
| | |
| | | try { |
| | | /* HttpSession session = request.getSession(); |
| | | String code = (String)session.getAttribute(Constants.KAPTCHA_SESSION_KEY);*/ |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | String code = redisUtil.getValue(phone+"_Code"); |
| | | System.out.println("缓存中验证码为:"+code); |
| | | if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | |
| | | public ResultUtil queryCaptcha1(String phone, Integer type){ |
| | | if(ToolUtil.isNotEmpty(phone)){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.queryCaptcha(phone, type); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/user/captchaLogin") |
| | | @ApiOperation(value = "手机验证码登录", tags = {"用户端-登录"}, notes = "") |
| | | @ApiOperation(value = "手机验证码登录【1.1】", tags = {"用户端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号运营商(GH-MTN-B2C、GH-TIGO-B2C、GH-VODAFONE-B2C、GH-AIRTEL-B2C)", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "ip地址", name = "registIp", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = false, dataType = "double"), |
| | | @ApiImplicitParam(value = "经度", name = "lng", required = false, dataType = "double") |
| | | }) |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, Double lat, Double lng, Integer language){ |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phoneOperator, String phone, String code, String registIp, Double lat, Double lng, Integer language){ |
| | | try { |
| | | return userInfoService.captchaLogin(phone, code, registIp, lat, lng,null,null,null,language); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.captchaLogin(phoneOperator, phone, code, registIp, lat, lng,null,null,null,language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/user/captchaLogin_") |
| | | @ApiOperation(value = "手机验证码登录", tags = {"分享专用"}, notes = "") |
| | | @ApiOperation(value = "手机验证码登录【1.1】", tags = {"分享专用"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号运营商(GH-MTN-B2C、GH-TIGO-B2C、GH-VODAFONE-B2C、GH-AIRTEL-B2C)", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "手机号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "分享的用户id", name = "uid", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "用户类型(1=用户,2=司机)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "注册类型(1=司机注册,2=用户注册)", name = "userType", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<LoginWarpper> captchaLogin_(String phone, String code, Integer uid, Integer type, Integer userType, Integer language){ |
| | | public ResultUtil<LoginWarpper> captchaLogin_(String phoneOperator, String phone, String code, Integer uid, Integer type, Integer userType, Integer language){ |
| | | try { |
| | | return userInfoService.captchaLogin(phone, code, uid, type, userType, language); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.captchaLogin(phoneOperator, phone, code, uid, type, userType, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | public ResultUtil<LoginWarpper> userLogin(String phone, String password, Integer language){ |
| | | if(ToolUtil.isNotEmpty(phone) && ToolUtil.isNotEmpty(password)){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.userLogin(phone, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | public ResultUtil forgetPassword(String phone, String code, String password, Integer language){ |
| | | if(ToolUtil.isNotEmpty(phone) && ToolUtil.isNotEmpty(code) && ToolUtil.isNotEmpty(password)){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.forgetPassword(phone, code, password, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/bindingPhone") |
| | | @ApiOperation(value = "设置电话号码", tags = {"用户端-登录"}, notes = "") |
| | | @ApiOperation(value = "设置电话号码【1.1】", tags = {"用户端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "手机号运营商(GH-MTN-B2C、GH-TIGO-B2C、GH-VODAFONE-B2C、GH-AIRTEL-B2C)", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "电话号码", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<LoginWarpper> bindingPhone(String phone, String code, Integer language, HttpServletRequest request){ |
| | | public ResultUtil<LoginWarpper> bindingPhone(String phoneOperator, String phone, String code, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return userInfoService.bindingPhone(uid, phone, code, language); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.bindingPhone(uid, phoneOperator, phone, code, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | }) |
| | | public ResultUtil<Object> queryUser(String phone){ |
| | | try { |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | Map<String, Object> map = userInfoService.queryUser(phone); |
| | | if(null != map){ |
| | | return ResultUtil.success(UserInfoWarpper.getUserInfoWarpper(map)); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | userInfoService.setUrgentUser(name, phone, uid); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/depositBalance") |
| | | @ApiOperation(value = "余额充值", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "余额充值【1.1】", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付方式(1=线上支付)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=手机充值,2=银行卡充值)", name = "payType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "充值金额", name = "money", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "支付端(1=用户APP端,2=司机APP端,3=用户小程序端)", name = "type", required = false, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil depositBalance(Integer payType, Double money, Integer type, Integer language, HttpServletRequest request){ |
| | | public ResultUtil depositBalance(Integer payType, String bankCardId, Double money, Integer type, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return userInfoService.depositBalance(payType, "user_" + uid, money, uid, type, language); |
| | | return userInfoService.depositBalance(payType, bankCardId, money, uid, type, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/user/updatePhone") |
| | | @ApiOperation(value = "修改手机号码", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiOperation(value = "修改手机号码【1.1】", tags = {"用户端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "验证码", name = "code", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "手机号运营商(GH-MTN-B2C、GH-TIGO-B2C、GH-VODAFONE-B2C、GH-AIRTEL-B2C)", name = "phoneOperator", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "新手机号", name = "phone", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updatePhone(String code, String phone, Integer language, HttpServletRequest request){ |
| | | public ResultUtil updatePhone(String code, String phoneOperator, String phone, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return userInfoService.updatePhone(code, phone, uid, language); |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | return userInfoService.updatePhone(code, phoneOperator, phone, uid, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String substring = phone.substring(0, 1); |
| | | if("0".equals(substring)){ |
| | | phone = "233" + phone.substring(1); |
| | | } |
| | | if(phone.indexOf("233") < 0){ |
| | | phone = "233" + phone; |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | smsrecordService.saveData(4, userInfo.getPhone(), code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | boolean b = userInfoService.checkCaptcha(phone, code); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil payLogisticsOrder(Integer payType, String accountNumber, Integer orderId, Integer type, Integer language)throws Exception; |
| | | ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId, Integer type, Integer language)throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | /* @Autowired |
| | | private ICBCPayUtil icbcPayUtil;*/ |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | @Resource |
| | | private CarMapper carMapper; |
| | | |
| | | @Autowired |
| | | private IOrderEvaluateService orderEvaluateService; |
| | | private IBankCardService bankCardService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil payLogisticsOrder(Integer payType, String accountNumber, Integer orderId, Integer type, Integer language) throws Exception { |
| | | public ResultUtil payLogisticsOrder(Integer payType, Integer bankCardId, Integer orderId, Integer type, Integer language) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | if(orderLogistics.getState() != 7){ |
| | | return ResultUtil.error("订单已完成支付,不允许重复支付"); |
| | |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | |
| | | if(payType == 2) {//银行卡支付 |
| | | BankCard bankCard = bankCardService.selectById(bankCardId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "4" + language + orderId; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(bankCard.getCode())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(orderMoney); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient account balance" : "Solde de compte insuffisant"); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil payPrivateCarOrder(Integer payType, String accountNumber, Integer orderId, Integer couponId, Integer type, Integer language)throws Exception; |
| | | ResultUtil payPrivateCarOrder(Integer payType, Integer bankCardId, Integer orderId, Integer couponId, Integer type, Integer language)throws Exception; |
| | | |
| | | |
| | | |
| | |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Autowired |
| | |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Autowired |
| | | private IOrderPositionService orderPositionService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private IAssignOrderService assignOrderService; |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Resource |
| | | private CarMapper carMapper; |
| | |
| | | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private IBankCardService bankCardService; |
| | | |
| | | |
| | | @Value("${filePath}") |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil payPrivateCarOrder(Integer payType, String accountNumber, Integer orderId, Integer couponId, Integer type, Integer language) throws Exception { |
| | | public ResultUtil payPrivateCarOrder(Integer payType, Integer bankCardId, Integer orderId, Integer couponId, Integer type, Integer language) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){ |
| | | return ResultUtil.error("订单已完成支付,不允许重复支付"); |
| | |
| | | |
| | | } |
| | | if(payType == 2){//银行卡支付 |
| | | BankCard bankCard = bankCardService.selectById(bankCardId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "1" + language + orderId; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(accountNumber)); |
| | | checkoutRequest.setMsisdn(Long.valueOf(bankCard.getCode())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(accountNumber); |
| | | checkoutRequest.setCustomerFirstName(userInfo.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(userInfo.getLastName()); |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(orderMoney); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/3 22:49 |
| | | */ |
| | | public interface BankCardMapper extends BaseMapper<BankCard> { |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.BankCardMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.BankCard"> |
| | | <id column="id" property="id" /> |
| | | <result column="bank" property="bank" /> |
| | | <result column="lastName" property="lastName" /> |
| | | <result column="firstName" property="firstName" /> |
| | | <result column="code" property="code"/> |
| | | <result column="userType" property="userType"/> |
| | | <result column="userId" property="userId"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | </resultMap> |
| | | </mapper> |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 银行卡 |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/3 22:45 |
| | | */ |
| | | @TableName("t_bank_card") |
| | | public class BankCard { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 所属银行 |
| | | */ |
| | | @TableField("bank") |
| | | private String bank; |
| | | /** |
| | | * 姓氏 |
| | | */ |
| | | @TableField("lastName") |
| | | private String lastName; |
| | | /** |
| | | * 名 |
| | | */ |
| | | @TableField("firstName") |
| | | private String firstName; |
| | | /** |
| | | * 银行卡号 |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 用户类型(1=用户,2=司机 |
| | | */ |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getBank() { |
| | | return bank; |
| | | } |
| | | |
| | | public void setBank(String bank) { |
| | | this.bank = bank; |
| | | } |
| | | |
| | | public String getLastName() { |
| | | return lastName; |
| | | } |
| | | |
| | | public void setLastName(String lastName) { |
| | | this.lastName = lastName; |
| | | } |
| | | |
| | | public String getFirstName() { |
| | | return firstName; |
| | | } |
| | | |
| | | public void setFirstName(String firstName) { |
| | | this.firstName = firstName; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public Integer getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(Integer userType) { |
| | | this.userType = userType; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | } |
| | |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 手机号运营商 |
| | | */ |
| | | @TableField("phoneOperator") |
| | | private String phoneOperator; |
| | | /** |
| | | * 邮箱 |
| | | */ |
| | | @TableField("email") |
| | |
| | | this.language = language; |
| | | } |
| | | |
| | | public String getPhoneOperator() { |
| | | return phoneOperator; |
| | | } |
| | | |
| | | public void setPhoneOperator(String phoneOperator) { |
| | | this.phoneOperator = phoneOperator; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UserInfo{" + |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/3 22:50 |
| | | */ |
| | | public interface IBankCardService extends IService<BankCard> { |
| | | } |
| | |
| | | * @param uType 分享用户的类别1:用户,2:司机 |
| | | * @return |
| | | */ |
| | | ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, Double lat, Double lng,Integer uid,Integer uType, Integer userType, Integer language) throws Exception; |
| | | ResultUtil<LoginWarpper> captchaLogin(String phoneOperator, String phone, String code, String registIp, Double lat, Double lng,Integer uid,Integer uType, Integer userType, Integer language) throws Exception; |
| | | |
| | | |
| | | |
| | | ResultUtil<LoginWarpper> captchaLogin(String phone, String code, Integer uid, Integer type, Integer userType, Integer language) throws Exception; |
| | | ResultUtil<LoginWarpper> captchaLogin(String phoneOperator, String phone, String code, Integer uid, Integer type, Integer userType, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, |
| | | Integer sex, String nickName, String avatar,String loginType,String encryptedData, String iv,Integer uid, Integer language) throws Exception; |
| | | |
| | | |
| | | |
| | | ResultUtil<LoginWarpper> wxIsLogin( String jscode) throws Exception; |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil bindingPhone(Integer uid, String phone, String code, Integer language) throws Exception; |
| | | ResultUtil bindingPhone(Integer uid, String phoneOperator, String phone, String code, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil depositBalance(Integer payType, String accountNumber, Double money, Integer uid, Integer type, Integer language) throws Exception; |
| | | ResultUtil depositBalance(Integer payType, String bankCardId, Double money, Integer uid, Integer type, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil updatePhone(String code, String phone, Integer uid, Integer language) throws Exception; |
| | | ResultUtil updatePhone(String code, String phoneOperator, String phone, Integer uid, Integer language) throws Exception; |
| | | |
| | | |
| | | /** |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.BankCardMapper; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.service.IBankCardService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/7/3 22:51 |
| | | */ |
| | | @Service |
| | | public class BankCardServiceImpl extends ServiceImpl<BankCardMapper, BankCard> implements IBankCardService { |
| | | } |
| | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private IBankCardService bankCardService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phone, String code, String registIp, Double lat, Double lng,Integer uid,Integer type, |
| | | public ResultUtil<LoginWarpper> captchaLogin(String phoneOperator, String phone, String code, String registIp, Double lat, Double lng,Integer uid,Integer type, |
| | | Integer userType, Integer language) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(phone); |
| | | if(null == userInfo){ |
| | | userInfo = new UserInfo(); |
| | | userInfo.setPhoneOperator(phoneOperator); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | | userInfo.setNickName(this.getDefaultName()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phone, String code, Integer uid, Integer type, Integer userType, Integer language) throws Exception { |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phone, code, null, null, null,uid,type,userType,language); |
| | | |
| | | public synchronized ResultUtil<LoginWarpper> captchaLogin(String phoneOperator, String phone, String code, Integer uid, Integer type, Integer userType, Integer language) throws Exception { |
| | | ResultUtil<LoginWarpper> resultUtil = this.captchaLogin(phoneOperator, phone, code, null, null, null,uid,type,userType,language); |
| | | return resultUtil; |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil bindingPhone(Integer uid, String phone, String code, Integer language) throws Exception { |
| | | public ResultUtil bindingPhone(Integer uid, String phoneOperator, String phone, String code, Integer language) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | |
| | | return ResultUtil.success(loginWarpper); |
| | | } |
| | | |
| | | userInfo.setPhoneOperator(phoneOperator); |
| | | userInfo.setPhone(phone); |
| | | userInfo.setUpdateTime(new Date()); |
| | | userInfo.setUpdateUser(userInfo.getId()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil depositBalance(Integer payType, String accountNumber, Double money, Integer uid, Integer type, Integer language) throws Exception { |
| | | public ResultUtil depositBalance(Integer payType, String bankCardId, Double money, Integer uid, Integer type, Integer language) throws Exception { |
| | | UserInfo userInfo = userInfoMapper.selectById(uid); |
| | | if(money.compareTo(0D) <= 0){ |
| | | return ResultUtil.error("支付金额必须大于0元"); |
| | | } |
| | | if(payType == 1){//微信支付 |
| | | if(payType == 1){//手机支付 |
| | | Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 1, money, "", 1);//添加预支付数据 |
| | | // ResultUtil resultUtil = payMoneyUtil.weixinpay("余额充值",language.toString(),integer.toString(),money+"","/base/wxCancelUserBalance","JSAPI",userInfo.getAppletsOpenId()); |
| | | // if(resultUtil.getCode()==200){ |
| | | // PaymentRecord paymentRecord = paymentRecordService.selectById(integer); |
| | | // paymentRecordService.updateById(paymentRecord); |
| | | // return resultUtil; |
| | | // }else{ |
| | | // return ResultUtil.error("获取支付信息失败", ""); |
| | | // } |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + language + integer; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(userInfo.getPhone())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(accountNumber); |
| | | checkoutRequest.setAccountNumber(userInfo.getPhone()); |
| | | checkoutRequest.setCustomerFirstName(userInfo.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(userInfo.getLastName()); |
| | | checkoutRequest.setRequestAmount(money); |
| | |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | |
| | | } |
| | | // if(payType == 2){//支付宝支付 |
| | | // Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 2, money, "", 1);//添加预支付数据 |
| | | // ResultUtil resultUtil = payMoneyUtil.alipay("余额充值","余额充值",integer + "_" + language,money+"","/base/aliCancelUserBalance"); |
| | | // if(resultUtil.getCode()==200){ |
| | | // PaymentRecord paymentRecord = paymentRecordService.selectById(integer); |
| | | // paymentRecordService.updateById(paymentRecord); |
| | | // return resultUtil; |
| | | // }else{ |
| | | // return ResultUtil.error("获取支付信息失败", ""); |
| | | // } |
| | | // } |
| | | |
| | | if(payType == 2){//银行卡支付 |
| | | Integer integer = paymentRecordService.saveData(2, uid, 1, null, null, 1, money, "", 1);//添加预支付数据 |
| | | BankCard bankCard = bankCardService.selectById(bankCardId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + language + integer; |
| | | CheckoutRequest checkoutRequest = new CheckoutRequest(); |
| | | checkoutRequest.setMsisdn(Long.valueOf(bankCard.getCode())); |
| | | checkoutRequest.setCustomerEmail(userInfo.getEmail()); |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(money); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Account top-up"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelUserBalance"); |
| | | checkoutRequest.setPendingRedirectUrl(""); |
| | | checkoutRequest.setSuccessRedirectUrl("https://10pz685243.zicp.fun"); |
| | | checkoutRequest.setFailRedirectUrl("https://www.baidu.com"); |
| | | return TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil updatePhone(String code, String phone, Integer uid, Integer language) throws Exception { |
| | | public ResultUtil updatePhone(String code, String phoneOperator, String phone, Integer uid, Integer language) throws Exception { |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error(language == 1 ? "验证码无效" : language == 2 ? "Invalid captcha" : "Code de vérification invalide"); |
| | |
| | | if(null != userInfo1){ |
| | | return ResultUtil.error(language == 1 ? "手机号已被注册" : language == 2 ? "The phone number has been registered" : "Le numéro de téléphone a été enregistré"); |
| | | } |
| | | userInfo.setPhoneOperator(phoneOperator); |
| | | userInfo.setPhone(phone); |
| | | this.updateById(userInfo); |
| | | |
| | | // smsrecordService.saveData(2, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | return ResultUtil.success(); |
| | | } |
| | | |