From 517a089be40aebad647c316ee0d026d32807f87b Mon Sep 17 00:00:00 2001 From: puzhibing <393733352@qq.com> Date: 星期四, 08 二月 2024 17:12:47 +0800 Subject: [PATCH] 新增加接口 --- cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java index c666c39..5b053b4 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java +++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java @@ -45,6 +45,7 @@ import com.dsh.account.model.vo.classDetails.RegisteredCourse; import com.dsh.account.model.vo.classDetails.classInsVo.ClassInfoVo; import com.dsh.account.model.vo.userBenefitDetail.*; +import com.dsh.account.service.IRefereeService; import com.dsh.account.service.TAppGiftService; import com.dsh.account.service.TAppUserService; import com.dsh.account.util.*; @@ -116,7 +117,6 @@ @Resource private ImgConfigClient icfgClient; - @Resource private VideoOfCourseListClient voclClient; @@ -177,6 +177,9 @@ @Resource private UserCouponPaymentClient userCouponPaymentClient; + + @Autowired + private IRefereeService refereeService; @@ -753,7 +756,6 @@ @Override public IndexOfUserBenefirVo queryBenefitDetails(Integer appUserId, String lon, String lat) { IndexOfUserBenefirVo benefirVo = new IndexOfUserBenefirVo(); - TAppUser appUser = this.getById(appUserId); if (appUser.getHeadImg() != null) { benefirVo.setUserHeadImg(appUser.getHeadImg()); @@ -775,6 +777,8 @@ List<IntegralCommodity> convertibleGoods = mcClient.getConvertibleGoods(location); benefirVo.setCommodities(convertibleGoods); benefirVo.setImage(icfgClient.getImageConfig()); + Referee referee = refereeService.getOne(new QueryWrapper<Referee>().eq("phone", appUser.getPhone()).eq("state", 1)); + benefirVo.setReferee(null == referee ? 0 : 1); return benefirVo; } @@ -1707,11 +1711,12 @@ * @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 @@ -1746,8 +1751,7 @@ userCouponPaymentClient.updateUserCouponPayment(userCouponPayment1); if ("TRADE_FINISHED".equals(s)) { // todo 资金结算 - payMoneyUtil.confirm(code,tradeNo,cash.toString()); - break; + } break; } @@ -1756,21 +1760,21 @@ 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)) { @@ -1844,7 +1848,7 @@ } private ResultUtil AlipayPayment(BigDecimal cash, String code, Long returnId) { - 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() { @@ -1894,7 +1898,7 @@ } if ("TRADE_FINISHED".equals(tradeStatus)) { // todo 资金结算 - payMoneyUtil.confirm(code,tradeNo,cash.toString()); + 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){ -- Gitblit v1.7.1