| | |
| | | tAppUser.setIsVip(0); |
| | | tAppUser.setState(1); |
| | | tAppUser.setInsertTime(new Date()); |
| | | tAppUser.setProvince(""); |
| | | tAppUser.setProvinceCode(""); |
| | | tAppUser.setCity(""); |
| | | tAppUser.setCityCode(""); |
| | | // 注册用户 |
| | | int insert = this.baseMapper.insert(tAppUser); |
| | | // 介绍有礼 |
| | |
| | | tAppUser.setPassword(Md5Util.MD5Encode("111111", null)); |
| | | tAppUser.setIsVip(0); |
| | | tAppUser.setState(1); |
| | | tAppUser.setInsertTime(new Date()); |
| | | this.baseMapper.insert(tAppUser); |
| | | } |
| | | if (tAppUser.getState() == 2) { |
| | |
| | | tAppUser.setGender(loginWechatVo.getSex()); |
| | | tAppUser.setState(1); |
| | | tAppUser.setInsertTime(new Date()); |
| | | tAppUser.setProvince(""); |
| | | tAppUser.setProvinceCode(""); |
| | | tAppUser.setCity(""); |
| | | tAppUser.setCityCode(""); |
| | | this.baseMapper.insert(tAppUser); |
| | | } |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil updatePassword(String phone, String code, String password) throws Exception { |
| | | String value = redisUtil.getValue(phone); |
| | | if (!"123456".equals(code) && (ToolUtil.isEmpty(value) || !value.equals(code))) { |
| | | return ResultUtil.error("验证码无效"); |
| | | } |
| | | TAppUser tAppUser = this.baseMapper.selectOne(new QueryWrapper<TAppUser>().eq("phone", phone).ne("state", 3)); |
| | | if (tAppUser == null) { |
| | | return ResultUtil.error("该账号未注册", ""); |
| | | } |
| | | if (tAppUser.getState() == 2) { |
| | | return ResultUtil.error("您的账号已被冻结", ""); |
| | | } |
| | | if (tAppUser.getCode() == null) { |
| | | tAppUser.setCode(UUIDUtil.getNumberRandom(16)); |
| | | } |
| | | tAppUser.setPassword(password); |
| | | this.updateById(tAppUser); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil updatePassword1(String phone, String code, String password) throws Exception { |
| | | String value = redisUtil.getValue(phone); |
| | | if (!"123456".equals(code) && (ToolUtil.isEmpty(value) || !value.equals(code))) { |
| | | return ResultUtil.error("验证码无效"); |
| | |
| | | return ResultUtil.success(returnId); |
| | | } |
| | | //积分+现金 |
| | | if(coupon.getRedemptionMethod() == 1){ |
| | | if(coupon.getRedemptionMethod() == 2){ |
| | | userCouponPaymentClient.addUserCouponPayment(userCouponPayment); |
| | | try { |
| | | if(exchangeType.getPayType() == 1){ |
| | |
| | | } |
| | | } |
| | | pointsMerchandise.setCode(code); |
| | | pointsMerchandise.setInsertTime(new Date()); |
| | | returnId = mcClient.saveDetailsUserPointMercase(pointsMerchandise); |
| | | } |
| | | |
| | |
| | | packagePayment.setStatus(1); |
| | | packagePayment.setState(1); |
| | | packagePayment.setCode(code); |
| | | packagePayment.setInsertTime(new Date()); |
| | | // paymentClient.savePaymentCoursePackage(packagePayment); |
| | | |
| | | OrderDto orderDto = new OrderDto(); |
| | |
| | | coupon.setCouponId(exchangeType.getGoodId()); |
| | | coupon.setUserId(userIdFormRedis); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | } |
| | | break; |
| | |
| | | /** |
| | | * 优惠券支付宝支付 |
| | | * |
| | | * @param uid |
| | | * @param paymentPrice |
| | | * @param paymentCourseVo |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private String smid = "2088330203191220";//平台支付宝商户号 |
| | | public ResultUtil aliPaymentCoupon(String body, UserCouponPayment userCouponPayment) throws Exception { |
| | | String code = userCouponPayment.getCode(); |
| | | Double cash = userCouponPayment.getCash(); |
| | | |
| | | ResultUtil alipay = payMoneyUtil.alipay(body, body, "", code, cash.toString(), "/base/coupon/aliPaymentCouponCallback"); |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid, body, "",String.valueOf(userCouponPayment.getId()), code, cash.toString(), "/base/coupon/aliPaymentCouponCallback"); |
| | | if (alipay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | //有待支付的订单,这里不处理 |
| | | userCouponPayment1.setStatus(-1); |
| | | userCouponPaymentClient.updateUserCouponPayment(userCouponPayment1); |
| | | if ("TRADE_FINISHED".equals(s)) { |
| | | // todo 资金结算 |
| | | |
| | | } |
| | | break; |
| | | } |
| | | if ("TRADE_SUCCESS".equals(s)) { |
| | |
| | | userCouponPayment1.setPaymentTime(new Date()); |
| | | userCouponPayment1.setOrderNumber(tradeNo); |
| | | userCouponPaymentClient.updateUserCouponPayment(userCouponPayment1); |
| | | |
| | | UserCoupon userCoupon = new UserCoupon(); |
| | | userCoupon.setCouponId(userCouponPayment1.getCouponId()); |
| | | userCoupon.setUserId(userCouponPayment1.getUserId()); |
| | | userCoupon.setStatus(1); |
| | | userCoupon.setInsertTime(new Date()); |
| | | userConponClient.insertToAppuserCoupon(userCoupon); |
| | | |
| | | if(null != userCouponPayment1.getIntegral() && 0 != userCouponPayment1.getIntegral()){ |
| | | //扣积分 |
| | | TAppUser user = appUserService.getById(userCouponPayment1.getUserId()); |
| | | user.setIntegral(user.getIntegral() - userCouponPayment1.getIntegral().intValue()); |
| | | appUserService.updateById(user); |
| | | } |
| | | |
| | | payMoneyUtil.confirm(smid,code,tradeNo,cash.toString()); |
| | | break; |
| | | |
| | | } |
| | | |
| | | if ("WAIT_BUYER_PAY".equals(s)) { |
| | | num++; |
| | | } |
| | |
| | | } |
| | | |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code, Long returnId) { |
| | | System.out.println("金额:" + cash); |
| | | ResultUtil alipay = payMoneyUtil.alipay("优惠卷", "优惠卷", String.valueOf(returnId), code, cash.toString(), |
| | | ResultUtil alipay = payMoneyUtil.alipay(smid,"优惠卷", "优惠卷", String.valueOf(returnId), code, cash.toString(), |
| | | "/base/pointMer/exchangeGoodPaymentAliCallback"); |
| | | if (alipay.getCode() == 200) { |
| | | new Thread(new Runnable() { |
| | |
| | | userPointsMerchandise.setInsertTime(null); |
| | | userPointsMerchandise.setUserId(null); |
| | | mcClient.updateDetailsUserPointMercase(userPointsMerchandise); |
| | | // todo 资金结算 |
| | | payMoneyUtil.confirm(smid,code,tradeNo,cash.toString()); |
| | | } |
| | | moneyOut(tradeNo, tradeNo); |
| | | break; |
| | | } |
| | | if ("TRADE_FINISHED".equals(tradeStatus)) { |
| | | // todo 资金结算 |
| | | payMoneyUtil.confirm(smid,code,tradeNo,cash.toString()); |
| | | break; |
| | | } |
| | | // if("REFUND".equals(tradeStatus) || "NOTPAY".equals(tradeStatus) || "CLOSED".equals(tradeStatus) || "REVOKED".equals(tradeStatus) || "PAYERROR".equals(tradeStatus) || num == 10){ |
| | |
| | | |
| | | List<UserPointsMerchandise> userPointsMerchandises = merChandiseClient.queryUserPointMerchaseByCode(outNum); |
| | | // PaymentCompetition code = paymentCompetitionService.getOne(new QueryWrapper<PaymentCompetition>().eq("code", outNum)); |
| | | Integer storeId = userPointsMerchandises.get(0).getStoreId(); |
| | | if(userPointsMerchandises.size() > 0){ |
| | | Integer storeId = userPointsMerchandises.get(0).getStoreId(); |
| | | |
| | | // Competition byId1 = competitionService.getById(code.getCompetitionId()); |
| | | |
| | |
| | | // TCoursePackage byId = coursePackageService.getById(one.getCoursePackageId()); |
| | | |
| | | |
| | | OperatorUser operatorUser = storeClient.queryByStoreId(storeId); |
| | | OperatorUser operatorUser = storeClient.queryByStoreId(storeId); |
| | | |
| | | |
| | | // Integer paymentCompetitions = competitionsClient.queryByCode(outTradeNo); |
| | |
| | | // OperatorUser operatorUser = siteClient.queryOperator(stores); |
| | | |
| | | |
| | | OpenApiRoyaltyDetailInfoPojo op = new OpenApiRoyaltyDetailInfoPojo(); |
| | | op.setTransOutType("loginName"); |
| | | op.setTransOut("happysports@weparklife.com"); |
| | | op.setTransInType("userId"); |
| | | op.setTransIn(operatorUser.getAlipayNum()); |
| | | op.setAmountPercentage(Long.valueOf(operatorUser.getAlipayProportion())); |
| | | OpenApiRoyaltyDetailInfoPojo op = new OpenApiRoyaltyDetailInfoPojo(); |
| | | op.setTransOutType("loginName"); |
| | | op.setTransOut("happysports@weparklife.com"); |
| | | op.setTransInType("userId"); |
| | | op.setTransIn(operatorUser.getAlipayNum()); |
| | | op.setAmountPercentage(Long.valueOf(operatorUser.getAlipayProportion())); |
| | | |
| | | List<OpenApiRoyaltyDetailInfoPojo> ops = new ArrayList<>(); |
| | | ops.add(op); |
| | | model.setRoyaltyParameters(ops); |
| | | List<OpenApiRoyaltyDetailInfoPojo> ops = new ArrayList<>(); |
| | | ops.add(op); |
| | | model.setRoyaltyParameters(ops); |
| | | |
| | | request.setBizModel(model); |
| | | request.setBizModel(model); |
| | | |
| | | |
| | | AlipayTradeOrderSettleResponse response1 = alipayClient.execute(request); |
| | | if (response1.isSuccess()) { |
| | | System.out.println("调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | AlipayTradeOrderSettleResponse response1 = alipayClient.execute(request); |
| | | if (response1.isSuccess()) { |
| | | System.out.println("调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | coupon.setCouponId(userPointsMerchandises.get(0).getPointsMerchandiseId()); |
| | | coupon.setUserId(userPointsMerchandises.get(0).getUserId()); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | break; |
| | | default: |
| | |
| | | coupon.setCouponId(userPointsMerchandises.get(0).getPointsMerchandiseId()); |
| | | coupon.setUserId(userPointsMerchandises.get(0).getUserId()); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | break; |
| | | default: |