|
|
|
@ -206,6 +206,26 @@ public class CustomerRewardLogServiceImpl implements CustomerRewardLogService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void reSendRedPacks() {
|
|
|
|
|
List<JSONObject> redpacks = cusRewardLogsMapper.resendRewards();
|
|
|
|
|
for(JSONObject pack:redpacks){
|
|
|
|
|
String sendName = "RoyalPay";
|
|
|
|
|
String actName = cusRewardConfigMapper.getValue("act_name").getString("value");
|
|
|
|
|
String wishing = cusRewardConfigMapper.getValue("wishing").getString("value");
|
|
|
|
|
String notifyUrl = PlatformEnvironment.getEnv().concatUrl("/act/new_year/redpacks/"+pack.getString("reward_id"));
|
|
|
|
|
MpWechatApi redpackApi = mpWechatApiProvider.getApi("redpack");
|
|
|
|
|
WechatRedpack wechatRedpack = new WechatRedpack();
|
|
|
|
|
wechatRedpack.setSendName(sendName).setOpenId(pack.getString("openid")).setActName(actName)
|
|
|
|
|
.setRemark(actName).setAmount(pack.getBigDecimal("amount")).setWishing(wishing).setNotifyUrl(notifyUrl);
|
|
|
|
|
JSONObject res = redpackApi.sendRedpack(wechatRedpack);
|
|
|
|
|
logger.info("2019新年活动获取的红包信息==>"+res.toJSONString());
|
|
|
|
|
pack.put("status",0);
|
|
|
|
|
pack.put("send_listid",res.getString("redpack_id"));
|
|
|
|
|
cusRewardLogsMapper.update(pack);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JSONObject getRandomReward(String openid){
|
|
|
|
|
JSONObject reward = cusRewardCouponMapper.randomType();
|
|
|
|
|