购买礼包逻辑小调整
parent
b464e9a630
commit
20263675c2
|
@ -41,21 +41,18 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
|
||||
@Override
|
||||
public Result deliveryRecharge(int uid, String goodsId, String openId, String orderId, long orderTime, int amount) {
|
||||
Result result = new Result();
|
||||
try {
|
||||
LOGGER.info("deliveryRecharge start",uid );
|
||||
return BuyGoodsNewLogic.sendGoods(uid, goodsId, openId, orderId, orderTime, amount);
|
||||
LOGGER.info("deliveryRecharge start {}", uid);
|
||||
result = BuyGoodsNewLogic.sendGoods(uid, goodsId, openId, orderId, orderTime, amount);
|
||||
} catch (Exception e) {
|
||||
User user = UserManager.getUserNotCache(uid);
|
||||
Result result = new Result();
|
||||
LOGGER.error("user:{},购买礼包抛出异常:{}",uid,e);
|
||||
User user = UserManager.getUserNotCache(uid);
|
||||
result.setResultCode(0);
|
||||
if(user == null){
|
||||
LOGGER.info("the uid={} not found",uid );
|
||||
}
|
||||
result.setResultMsg("server exce");
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,orderId,result.getResultCode(),amount);
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -46,7 +46,7 @@ public class UseAndPriceItemHandler extends BaseHandler<PlayerInfoProto.UseAndPr
|
|||
case 4://分解宝器
|
||||
ItemLogic.getInstance().decomposeJewel(iSession,equipIdsList);
|
||||
break;
|
||||
case 6:
|
||||
case 6://使用选择宝箱道具
|
||||
ItemLogic.getInstance().useItem(iSession,itemList,useAndPriceItemRequest.getItemId());
|
||||
break;
|
||||
case 7://资源包 可以获取指定挂机奖励
|
||||
|
|
|
@ -39,6 +39,10 @@ public class KtEventUtils {
|
|||
|
||||
|
||||
public static void onKtEvent(User user, int eventType, Object... parm) {
|
||||
if (user == null){
|
||||
LOGGER.error("开天上报提前退出,用户不存在");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
ParamEventBean paramEventBean = new ParamEventBean(eventType);
|
||||
switch (eventType) {
|
||||
|
@ -127,8 +131,7 @@ public class KtEventUtils {
|
|||
KTParam ktParam = ParamBuilder.paramBuild(user, eventType, paramEventBean);
|
||||
DataMessageUtils.addLogQueue(ktParam);
|
||||
}catch (Exception e){
|
||||
LOGGER.error("开天上报异常:{},{},{},{}",e.getMessage(),user.getId(),eventType, Arrays.asList(parm));
|
||||
e.printStackTrace();
|
||||
LOGGER.error("开天上报异常:{},{},{},{}", user.getId(),eventType, Arrays.asList(parm),e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -236,13 +236,6 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
// 礼包购买
|
||||
bag.buy();
|
||||
// gm充值不进行单笔充值活动
|
||||
if (!gm_modifier.equals(orderId)){
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),(int)price));
|
||||
// 线下自动返利
|
||||
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),goodsId,orderId));
|
||||
}
|
||||
|
||||
int[] forbid = config.getForbid();
|
||||
if(forbid != null){
|
||||
|
@ -267,11 +260,9 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
}
|
||||
|
||||
//发货
|
||||
sendGoodsByType(user,config,list);
|
||||
//处理特权
|
||||
activePrivilege(user,config);
|
||||
|
||||
// 校验
|
||||
if(config.getAccumulativeRecharge() == 1){
|
||||
if(info.getMaxSingleR() < price){
|
||||
info.setMaxSingleR(price);
|
||||
|
@ -282,11 +273,32 @@ public class BuyGoodsNewLogic {
|
|||
changeActivity(user,price,info);
|
||||
}
|
||||
|
||||
// 首充标记
|
||||
if(!info.getIsFirst()){
|
||||
info.setIsFirst(true);
|
||||
info.setFirstTime(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
// 全部礼包状态推送
|
||||
sendGiftGoodsWithoutJudge(uid);
|
||||
// 推送礼包
|
||||
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId,1);
|
||||
// 惊喜礼盒,事件推送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId(),1,1));
|
||||
|
||||
// gm充值不进行单笔充值活动
|
||||
if (!gm_modifier.equals(orderId)){
|
||||
// 单笔充值
|
||||
Poster.getPoster().dispatchEvent(new SingleRechargeEvent(user.getId(),(int)price));
|
||||
// 线下自动返利
|
||||
Poster.getPoster().dispatchEvent(new AutoRechargeBackEvent(user.getId(),goodsId,orderId));
|
||||
}
|
||||
|
||||
// 发货
|
||||
sendGoodsByType(user,config,list);
|
||||
// 通知前端
|
||||
notifyPaySuccessFul(uid,goodsId,amount != -999);
|
||||
|
||||
//发送邮件
|
||||
int[] mail = config.getMail();
|
||||
if(config.getPrice()!=0&&mail!=null&&mail.length>1){
|
||||
|
@ -303,17 +315,10 @@ public class BuyGoodsNewLogic {
|
|||
// 开天上报
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent, goodsId, orderId, resultRes.getResultCode(), price);
|
||||
}
|
||||
|
||||
notifyPaySuccessFul(uid,goodsId,amount != -999);
|
||||
sendGiftGoodsWithoutJudge(uid);
|
||||
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId,1);
|
||||
// 惊喜礼盒,事件推送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId(),1,1));
|
||||
// 更新入库
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.RECHARGE_SUCCESS_INDICATION_VALUE,
|
||||
PlayerInfoProto.RechargeSuccessIndication.newBuilder().setOrderId(orderId).build(), true);
|
||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.RECHARGE_SUCCESS_INDICATION_VALUE, PlayerInfoProto.RechargeSuccessIndication.newBuilder().setOrderId(orderId).build(), true);
|
||||
return resultRes;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue