Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
c9580f6ba4
|
@ -178,8 +178,9 @@ public class BuyGoodsNewLogic {
|
|||
pbag.setBuyTimes(pbag.getBuyTimes()+1);
|
||||
}
|
||||
}
|
||||
int[][] dropByBag = bag.getDropByBag();
|
||||
//发货
|
||||
sendGoodsByType(user,config);
|
||||
sendGoodsByType(user,config,dropByBag);
|
||||
|
||||
if(config.getAccumulativeRecharge() == 1){
|
||||
info.setRr(MathUtils.doubleAdd(price,info.getRr()));
|
||||
|
@ -199,7 +200,7 @@ public class BuyGoodsNewLogic {
|
|||
//发送邮件
|
||||
int[] mail = config.getMail();
|
||||
if(mail!=null&&mail.length>1){
|
||||
String title = SErrorCodeEerverConfig.errorMap.get(mail[0]).getkey();
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage(SErrorCodeEerverConfig.errorMap.get(mail[0]).getkey());
|
||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert(SErrorCodeEerverConfig.errorMap.get(mail[1]).getkey(), new Object[]{config.getName()}, new int[]{1}, "#");
|
||||
MailLogic.getInstance().sendMail(uid,title,content,"",(int) (TimeUtils.now() / 1000),Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
@ -212,7 +213,7 @@ public class BuyGoodsNewLogic {
|
|||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
sendGiftGoodsWithoutJudge(uid);
|
||||
onChargeSuccess(user,price,0,orderId,cfgType);//充值成功上报
|
||||
Map<Integer, Integer> mapReward = ItemUtil.arrayToMap(config.getBaseReward());
|
||||
Map<Integer, Integer> mapReward = ItemUtil.arrayToMap(dropByBag);
|
||||
if(price>0){
|
||||
MessageUtil.sendIndicationMessage(session,1,
|
||||
MessageTypeProto.MessageType.RECHARGE_SUCCESS_INDICATION_VALUE,
|
||||
|
@ -315,10 +316,10 @@ public class BuyGoodsNewLogic {
|
|||
/**
|
||||
* 处理特殊类型发货
|
||||
*/
|
||||
public static void sendGoodsByType(User user,SRechargeCommodityNewConfig config) throws Exception{
|
||||
public static void sendGoodsByType(User user,SRechargeCommodityNewConfig config,int[][] dropArray) throws Exception{
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
int type = config.getType();
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, config.getBaseReward(), BIReason.DIRECT_BUY);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,dropArray, BIReason.DIRECT_BUY);
|
||||
//直购礼包
|
||||
if(type == GiftGoodsType.DIRECTBAG){
|
||||
|
||||
|
|
|
@ -90,6 +90,31 @@ public class AbstractWelfareBag extends MongoBase{
|
|||
setLastBuyTime(TimeUtils.getTodayZero());
|
||||
return true;
|
||||
}
|
||||
public int[][] getDropByBag() throws Exception{
|
||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(modId);
|
||||
int[][] baseReward = config.getBaseReward();
|
||||
int[][] firstMultiple = config.getFirstMultiple();
|
||||
int length = baseReward.length;
|
||||
int[][] result ;
|
||||
if(buyTimes == 1){
|
||||
length += firstMultiple.length;
|
||||
result = new int[length][];
|
||||
int i=0;
|
||||
for(;i<baseReward.length;i++){
|
||||
result[i] =baseReward[i];
|
||||
}
|
||||
for(int j=0;j<firstMultiple.length;j++){
|
||||
result[i++] = firstMultiple[j];
|
||||
}
|
||||
}else{
|
||||
result = new int[length][];
|
||||
int i=0;
|
||||
for(;i<baseReward.length;i++){
|
||||
result[i] =baseReward[i];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新时间到刷新礼包状态
|
||||
|
@ -231,4 +256,6 @@ public class AbstractWelfareBag extends MongoBase{
|
|||
isUserBuyRefresh = userBuyRefresh;
|
||||
updateString("isUserBuyRefresh",isUserBuyRefresh);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue