|
|
@@ -157,7 +157,7 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WxGameActionLog wxGameActionLog = new WxGameActionLog(); |
|
|
WxGameActionLog wxGameActionLog = new WxGameActionLog(); |
|
|
if(wxGame.getLimitType().equals(1)){//每天 |
|
|
|
|
|
|
|
|
if(wxGame.getLimitType().equals(Constant.limitType)){//每天 |
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
Calendar calendar = Calendar.getInstance(); |
|
|
calendar.setTime(new Date()); |
|
|
calendar.setTime(new Date()); |
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0); |
|
|
calendar.set(Calendar.HOUR_OF_DAY, 0); |
|
|
@@ -197,11 +197,11 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
map.put("AwardCount",AwardCount);//当前中奖次数 |
|
|
map.put("AwardCount",AwardCount);//当前中奖次数 |
|
|
|
|
|
|
|
|
boolean playAble = true; |
|
|
boolean playAble = true; |
|
|
if(AwardLimit != 0 && AwardCount >= AwardLimit){//中奖次数没了,不能完了 |
|
|
|
|
|
|
|
|
if(AwardLimit != Constant.limit && AwardCount >= AwardLimit){//中奖次数没了,不能完了 |
|
|
playAble = false; |
|
|
playAble = false; |
|
|
} |
|
|
} |
|
|
if((playLimit > 0 && playCount >= playLimit) || playLimit < 0){//免费不能玩了 |
|
|
|
|
|
if((playCreditLimit > 0 && playCreditCount >= playCreditLimit) || playCreditLimit < 0){//积分不能玩了 |
|
|
|
|
|
|
|
|
if((playLimit > Constant.limit && playCount >= playLimit) || playLimit == Constant.notLimit){//免费不能玩了 |
|
|
|
|
|
if((playCreditLimit > Constant.limit && playCreditCount >= playCreditLimit) || playCreditLimit == Constant.notLimit){//积分不能玩了 |
|
|
playAble = false; |
|
|
playAble = false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -231,15 +231,16 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
List couponIdsList = new ArrayList(); |
|
|
List couponIdsList = new ArrayList(); |
|
|
JSONArray couponChannelIds = JSON.parseArray(record.getCouponIds()); |
|
|
JSONArray couponChannelIds = JSON.parseArray(record.getCouponIds()); |
|
|
ValueOperations<String, WxCouponCVo> operations = cdRedisTemplate.opsForValue(); |
|
|
ValueOperations<String, WxCouponCVo> operations = cdRedisTemplate.opsForValue(); |
|
|
for(int i=0; i<couponChannelIds.size();i++) { |
|
|
|
|
|
|
|
|
for(int i = 0; i<couponChannelIds.size();i++) { |
|
|
JSONObject couponChanObj = (JSONObject) couponChannelIds.get(i); |
|
|
JSONObject couponChanObj = (JSONObject) couponChannelIds.get(i); |
|
|
Integer type = couponChanObj.getInteger("prizeType"); |
|
|
|
|
|
if(type != null && type == 0){ |
|
|
|
|
|
|
|
|
Integer prizeType = couponChanObj.getInteger("prizeType"); |
|
|
|
|
|
if(prizeType != null && prizeType == Constant.creditPlayType){ |
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
map.put("prizeType",0); |
|
|
|
|
|
|
|
|
map.put("prizeType",Constant.creditPlayType); |
|
|
map.put("gameWeight",couponChanObj.getInteger("weight")); |
|
|
map.put("gameWeight",couponChanObj.getInteger("weight")); |
|
|
map.put("credit",couponChanObj.getInteger("credit")); |
|
|
map.put("credit",couponChanObj.getInteger("credit")); |
|
|
map.put("couponId",couponChanObj.getLong("couponId")); |
|
|
|
|
|
|
|
|
map.put("id",couponChanObj.getInteger("id")); |
|
|
|
|
|
// map.put("couponId",couponChanObj.getLong("couponId")); |
|
|
couponIdsList.add(map); |
|
|
couponIdsList.add(map); |
|
|
}else{ |
|
|
}else{ |
|
|
Long couponId = couponChanObj.getLong("couponId"); |
|
|
Long couponId = couponChanObj.getLong("couponId"); |
|
|
@@ -327,14 +328,17 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
// 上架 couponChannel 更新 |
|
|
// 上架 couponChannel 更新 |
|
|
for(int i=0; i<couponIds.size();i++) { |
|
|
for(int i=0; i<couponIds.size();i++) { |
|
|
JSONObject obj = (JSONObject)couponIds.get(i); |
|
|
JSONObject obj = (JSONObject)couponIds.get(i); |
|
|
Long couponId = obj.getLong("couponId"); |
|
|
|
|
|
int weight = obj.getIntValue("weight"); |
|
|
|
|
|
try { |
|
|
|
|
|
if(couponId != null){ |
|
|
|
|
|
saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); |
|
|
|
|
|
|
|
|
Integer prizeType = obj.getInteger("prizeType"); |
|
|
|
|
|
if(prizeType == null || prizeType != Constant.creditPlayType){ |
|
|
|
|
|
Long couponId = obj.getLong("couponId"); |
|
|
|
|
|
int weight = obj.getIntValue("weight"); |
|
|
|
|
|
try { |
|
|
|
|
|
if(couponId != null){ |
|
|
|
|
|
saveOrUpdateCouponChannel(couponId, wxCouponChannelsMap, record); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (MallinkException e) { |
|
|
|
|
|
logger.error(e.getMessage()); |
|
|
} |
|
|
} |
|
|
} catch (MallinkException e) { |
|
|
|
|
|
logger.error(e.getMessage()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -457,7 +461,7 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),wxGame) ; |
|
|
wxCreditHistoryService.creditUsercheck(wxCreditHistory.getCUserId(),wxGame) ; |
|
|
wxCreditHistoryService.saveOrUpdate(wxCreditHistory); |
|
|
wxCreditHistoryService.saveOrUpdate(wxCreditHistory); |
|
|
addCredit = credit; |
|
|
addCredit = credit; |
|
|
orderId = -1L; |
|
|
|
|
|
|
|
|
orderId = Constant.creditPlayOrderIdTab; |
|
|
} |
|
|
} |
|
|
resultData.data = null; |
|
|
resultData.data = null; |
|
|
// } |
|
|
// } |
|
|
@@ -487,7 +491,7 @@ public class WxGameServiceImpl implements WxGameService { |
|
|
wxGameActionLog.setCreateTime(new Date()); |
|
|
wxGameActionLog.setCreateTime(new Date()); |
|
|
wxGameActionLog.setUsedCredit(userCredit); |
|
|
wxGameActionLog.setUsedCredit(userCredit); |
|
|
if(userCredit > 0){ |
|
|
if(userCredit > 0){ |
|
|
wxGameActionLog.setType(1); |
|
|
|
|
|
|
|
|
wxGameActionLog.setType(Constant.creditPlayType); |
|
|
} |
|
|
} |
|
|
wxGameActionLog.setCouponOrderId(orderId); |
|
|
wxGameActionLog.setCouponOrderId(orderId); |
|
|
wxGameActionLog.setAddCredit(addCredit); |
|
|
wxGameActionLog.setAddCredit(addCredit); |
|
|
|