This commit is contained in:
Lemon
2023-08-23 15:36:14 +08:00
parent f70a26e714
commit 930486c5ff
8 changed files with 84 additions and 18 deletions

View File

@@ -30,11 +30,9 @@ import com.jsowell.common.util.id.IdUtils;
import com.jsowell.pile.domain.AdapayMemberAccount;
import com.jsowell.pile.domain.ClearingBillInfo;
import com.jsowell.pile.domain.ClearingWithdrawInfo;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.dto.PayOrderDTO;
import com.jsowell.pile.service.ClearingBillInfoService;
import com.jsowell.pile.service.ClearingWithdrawInfoService;
import com.jsowell.pile.service.IAdapayMemberAccountService;
import com.jsowell.pile.service.IPileMerchantInfoService;
import com.jsowell.pile.service.*;
import com.jsowell.wxpay.service.WxAppletRemoteService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
@@ -78,6 +76,9 @@ public class AdapayService {
@Autowired
private WxAppletRemoteService wxAppletRemoteService;
@Autowired
private IMemberBasicInfoService memberBasicInfoService;
/**
* 获取支付参数
*/
@@ -98,10 +99,15 @@ public class AdapayService {
}
// 获取openId
String openId = wxAppletRemoteService.getOpenIdByCode(dto.getCode());
if (StringUtils.isBlank(openId)) {
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMemberId(dto.getMemberId());
if (memberBasicInfo == null) {
throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
}
String openId =memberBasicInfo.getOpenId();
// String openId = wxAppletRemoteService.getOpenIdByCode(dto.getCode());
// if (StringUtils.isBlank(openId)) {
// throw new BusinessException(ReturnCodeEnum.CODE_GET_OPEN_ID_BY_CODE_ERROR);
// }
// 封装对象
String amount = AdapayUtil.formatAmount(dto.getPayAmount()); // 用户支付金额

View File

@@ -0,0 +1,32 @@
package com.jsowell.pile.dto.lutongyunting;
import lombok.Data;
/**
* 给指定车辆绑定优惠券
*
* @author Lemon
* @Date 2023/8/23 14:15
*/
@Data
public class BindCouponDTO {
/**
* 优惠券商家标识
*/
private String merchantId;
/**
* 优惠券特殊标识
*/
private String couponId;
/**
* 车牌号码
*/
private String plateNumber;
/**
* 车牌颜色
*/
private String plateColor;
}

View File

@@ -10,6 +10,7 @@ import lombok.Data;
*/
@Data
public class WechatSendMsgDTO {
private String memberId;
/**
* 用户code
*/

View File

@@ -13,6 +13,8 @@ import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.http.HttpUtils;
import com.jsowell.pile.domain.MemberBasicInfo;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IOrderBasicInfoService;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.vo.uniapp.CurrentTimePriceDetails;
@@ -53,6 +55,9 @@ public class WxAppletRemoteService {
@Autowired
private IPileBillingTemplateService pileBillingTemplateService;
@Autowired
private IMemberBasicInfoService memberBasicInfoService;
@Value("${weixin.login.appid}")
private String appid;
@@ -190,7 +195,11 @@ public class WxAppletRemoteService {
openId = dto.getOpenId();
}else {
// 通过code查询openId并set
openId = getOpenIdByCode(dto.getCode());
MemberBasicInfo memberBasicInfo = memberBasicInfoService.selectInfoByMemberId(dto.getMemberId());
if (memberBasicInfo == null) {
throw new BusinessException("99999", "开始充电发送消息 error, 查询openid为空");
}
openId = memberBasicInfo.getOpenId();
}
if (StringUtils.isBlank(openId)) {
return null;