【ID1005331】【星级成长礼】
parent
069da0c108
commit
0bc42cbe76
|
@ -230,7 +230,7 @@ public class BuyGoodsLogic {
|
||||||
int tempvalue = discountType[1];
|
int tempvalue = discountType[1];
|
||||||
if(temptype == 4){
|
if(temptype == 4){
|
||||||
|
|
||||||
int dytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(tempvalue,0)-1;
|
int dytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(goodsId,0)-1;
|
||||||
if(dytime <=0){
|
if(dytime <=0){
|
||||||
if (rechargeInfo.getTypeBagMap().containsKey(tempvalue)){
|
if (rechargeInfo.getTypeBagMap().containsKey(tempvalue)){
|
||||||
rechargeInfo.removeTypeBagMap(tempvalue);
|
rechargeInfo.removeTypeBagMap(tempvalue);
|
||||||
|
@ -239,7 +239,7 @@ public class BuyGoodsLogic {
|
||||||
rechargeInfo.getCacheSendedTypes().remove(tempvalue);
|
rechargeInfo.getCacheSendedTypes().remove(tempvalue);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
rechargeInfo.putDyGoodsCanBuyTimes(dytime,dytime);
|
rechargeInfo.putDyGoodsCanBuyTimes(goodsId,dytime);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityConfig.rechargeCommodityConfigMap.size());
|
||||||
|
@ -393,7 +393,7 @@ public class BuyGoodsLogic {
|
||||||
int addtime = discountType[2];
|
int addtime = discountType[2];
|
||||||
int diffHour = (int) ((now - startTime) / 3600 / 1000);
|
int diffHour = (int) ((now - startTime) / 3600 / 1000);
|
||||||
if (diffHour >= addtime) {
|
if (diffHour >= addtime) {
|
||||||
rechargeInfo.removeDyGoodsCanBuyTimes(value);
|
rechargeInfo.removeDyGoodsCanBuyTimes(goodsId);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
endTime = startTime + addtime * 3600 * 1000;
|
endTime = startTime + addtime * 3600 * 1000;
|
||||||
|
@ -411,7 +411,7 @@ public class BuyGoodsLogic {
|
||||||
}else {
|
}else {
|
||||||
rechargeInfo.getCacheSendedTypes().put(value, startTime);
|
rechargeInfo.getCacheSendedTypes().put(value, startTime);
|
||||||
}
|
}
|
||||||
dybuytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(value,0);
|
dybuytime = rechargeInfo.getDyGoodsCanBuyTimes().getOrDefault(goodsId,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
@ -437,8 +437,7 @@ public class BuyGoodsLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
goodsOrder.put(sRechargeCommodityConfig.getType(),order*10000 + goodsId);
|
goodsOrder.put(sRechargeCommodityConfig.getType(),order*10000 + goodsId);
|
||||||
giftGoodsInfoMap.put(goodsId,CommonProto.GiftGoodsInfo.newBuilder().setGoodsId(goodsId).setStartTime((int)(startTime/1000)).setBuyTimes(buyTimes).setEndTime((int)(endTime/1000))
|
giftGoodsInfoMap.put(goodsId,CommonProto.GiftGoodsInfo.newBuilder().setGoodsId(goodsId).setStartTime((int)(startTime/1000)).setBuyTimes(buyTimes).setEndTime((int)(endTime/1000)).build());
|
||||||
.setDynamicBuyTimes(dybuytime).build());
|
|
||||||
boolean isNew = rechargeInfo.addNewSendId(goodsId);
|
boolean isNew = rechargeInfo.addNewSendId(goodsId);
|
||||||
if(isNew){
|
if(isNew){
|
||||||
needChange = true;
|
needChange = true;
|
||||||
|
@ -449,7 +448,12 @@ public class BuyGoodsLogic {
|
||||||
if(isNew){
|
if(isNew){
|
||||||
needChange = true;
|
needChange = true;
|
||||||
}
|
}
|
||||||
giftGoodsInfoList.add(CommonProto.GiftGoodsInfo.newBuilder().setGoodsId(goodsId).setBuyTimes(buyTimes).setStartTime((int)(startTime/1000)).setEndTime((int)(endTime/1000)).build());
|
CommonProto.GiftGoodsInfo.Builder builder = CommonProto.GiftGoodsInfo.newBuilder();
|
||||||
|
builder.setGoodsId(goodsId).setStartTime((int)(startTime/1000)).setBuyTimes(buyTimes).setEndTime((int)(endTime/1000));
|
||||||
|
if(dybuytime!=-1){
|
||||||
|
builder.setDynamicBuyTimes(dybuytime);
|
||||||
|
}
|
||||||
|
giftGoodsInfoList.add(builder.build());
|
||||||
}
|
}
|
||||||
giftGoodsInfoList.addAll(giftGoodsInfoMap.values());
|
giftGoodsInfoList.addAll(giftGoodsInfoMap.values());
|
||||||
return needChange;
|
return needChange;
|
||||||
|
|
Loading…
Reference in New Issue