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

@@ -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;