|
@@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
|
|
+import com.fs.core.config.WxOpenProperties;
|
|
|
import com.fs.course.config.CourseConfig;
|
|
import com.fs.course.config.CourseConfig;
|
|
|
import com.fs.course.domain.FsCourseAnswerLogs;
|
|
import com.fs.course.domain.FsCourseAnswerLogs;
|
|
|
import com.fs.course.domain.FsCourseRedPacketLog;
|
|
import com.fs.course.domain.FsCourseRedPacketLog;
|
|
@@ -55,12 +56,18 @@ public class FirstLoginRedPacketStrategy implements RewardStrategy {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISysConfigService configService;
|
|
private ISysConfigService configService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WxOpenProperties openProperties;
|
|
|
@Override
|
|
@Override
|
|
|
public RewardResult process(FsUserRewards reward) {
|
|
public RewardResult process(FsUserRewards reward) {
|
|
|
log.info("处理首次登录红包发放: rewardId={}", reward.getId());
|
|
log.info("处理首次登录红包发放: rewardId={}", reward.getId());
|
|
|
try {
|
|
try {
|
|
|
FsUser fsUser=fsUserMapper.selectFsUserById(reward.getFsUserId());
|
|
FsUser fsUser=fsUserMapper.selectFsUserById(reward.getFsUserId());
|
|
|
if (fsUser!=null){
|
|
if (fsUser!=null){
|
|
|
|
|
+ if (fsUser.getAppOpenId()==null) {
|
|
|
|
|
+ return RewardResult.fail("请绑定微信后再领取");
|
|
|
|
|
+ }
|
|
|
WxSendRedPacketParam param=buildRedPacketParam(reward, fsUser);
|
|
WxSendRedPacketParam param=buildRedPacketParam(reward, fsUser);
|
|
|
//调用发送红包接口逻辑
|
|
//调用发送红包接口逻辑
|
|
|
R sendRedPacket = fsStorePaymentService.sendRedPacketAppReward(param);
|
|
R sendRedPacket = fsStorePaymentService.sendRedPacketAppReward(param);
|
|
@@ -155,7 +162,7 @@ public class FirstLoginRedPacketStrategy implements RewardStrategy {
|
|
|
*/
|
|
*/
|
|
|
private WxSendRedPacketParam buildRedPacketParam(FsUserRewards reward, FsUser fsUser) {
|
|
private WxSendRedPacketParam buildRedPacketParam(FsUserRewards reward, FsUser fsUser) {
|
|
|
WxSendRedPacketParam param = new WxSendRedPacketParam();
|
|
WxSendRedPacketParam param = new WxSendRedPacketParam();
|
|
|
- param.setAppId("wxd10af32266cf4566");
|
|
|
|
|
|
|
+ param.setAppId(openProperties.getAppId());
|
|
|
param.setOpenId(fsUser.getMaOpenId());
|
|
param.setOpenId(fsUser.getMaOpenId());
|
|
|
param.setRedPacketMode(1);//1:为总公司
|
|
param.setRedPacketMode(1);//1:为总公司
|
|
|
param.setCompanyId(reward.getCompanyId());
|
|
param.setCompanyId(reward.getCompanyId());
|