返利error优化
parent
08042195cb
commit
a1e2bffd8b
|
@ -54,24 +54,28 @@ public class GmActivityLogic implements IEventHandler {
|
|||
return;
|
||||
}
|
||||
AutoRechargeBackEvent rechargeBackEvent = (AutoRechargeBackEvent) event;
|
||||
if (rechargeBackEvent.getGiftId() <= 0){
|
||||
User user = UserManager.getUser(rechargeBackEvent.getUserId());
|
||||
|
||||
int giftId = rechargeBackEvent.getGiftId();
|
||||
if (giftId <= 0){
|
||||
LOGGER.info("返利活动信息,礼包id为0:uid:{},info:{}",user.getId(), rechargeBackEvent);
|
||||
return;
|
||||
}
|
||||
|
||||
double price = 0;
|
||||
String method = rechargeBackEvent.getRechargeMethod();
|
||||
if (method.equals(item_token)){
|
||||
price = rechargeBackEvent.getGiftId();
|
||||
price = giftId;
|
||||
}else {
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(rechargeBackEvent.getGiftId());
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(giftId);
|
||||
if (config != null){
|
||||
price = config.getPrice();
|
||||
}
|
||||
}
|
||||
if (price <= 0){
|
||||
LOGGER.info("返利活动信息,金额为0:uid:{},info:{}",user.getId(), rechargeBackEvent);
|
||||
return;
|
||||
}
|
||||
User user = UserManager.getUser(rechargeBackEvent.getUserId());
|
||||
// 自动返利
|
||||
zeroUpdateGmActivity(user);
|
||||
// 活动信息获取
|
||||
|
@ -81,6 +85,7 @@ public class GmActivityLogic implements IEventHandler {
|
|||
int i = 1;
|
||||
for (Map.Entry<String, ARBActivity> entry : arbActivityMap.entrySet()) {
|
||||
LOGGER.info("返利活动信息,第{}次循环:uid:{},aid:{}",i,user.getId(),entry.getKey());
|
||||
try {
|
||||
ARBActivity arbActivity = entry.getValue();
|
||||
LOGGER.info("返利活动信息,第{}次循环:uid:{},aid:{},type:{}",i,user.getId(),arbActivity.getId(),arbActivity.getType());
|
||||
// 时间校验
|
||||
|
@ -109,6 +114,10 @@ public class GmActivityLogic implements IEventHandler {
|
|||
}
|
||||
manager.putActivityMap(gmActivity.getId(),gmActivity);
|
||||
}
|
||||
}catch (Exception e){
|
||||
LOGGER.error("返利活动异常,活动id:{}, 礼包信息:{},价值金额:{},报错信息:{}",entry.getKey(), rechargeBackEvent,price,e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue