Browse Source

child

release_toaliyun_real
xhxu 5 years ago
parent
commit
b78fbc06a0
2 changed files with 25 additions and 24 deletions
  1. +3
    -3
      mallinkCApi/src/main/java/com/iformall/controller/WxGameController.java
  2. +22
    -21
      mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java

+ 3
- 3
mallinkCApi/src/main/java/com/iformall/controller/WxGameController.java View File

@@ -148,9 +148,9 @@ public class WxGameController extends BaseController {
return new ResultData(ErrorCode.GAME_NOT_FOUND);
}
int playLimit = (int) data.get("playLimit");
if(playLimit < Constant.limit){
return new ResultData(ErrorCode.GAME_NOT_COUNT);
}
// if(playLimit < Constant.limit){
// return new ResultData(ErrorCode.GAME_NOT_COUNT);
// }
int AwardLimit = (int) data.get("AwardLimit");
int AwardCount = (int) data.get("AwardCount");
if(AwardLimit != Constant.limit && AwardCount >= AwardLimit){


+ 22
- 21
mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java View File

@@ -425,12 +425,13 @@ public class WxGameServiceImpl implements WxGameService {
if(couponIdsList != null || couponIdsList.size() > 0){
for (Object a:couponIdsList) {
int weight = 0;
if(a instanceof Map){
Map map = (Map) a;
weight = (int) map.get("weight");
}else if(a instanceof WxCouponChannelVo){
if(a instanceof WxCouponChannelVo){
WxCouponChannelVo vo = (WxCouponChannelVo) a;
weight = vo.getGameWeight();
}else if(a instanceof JSONObject){
JSONObject map = (JSONObject) a;
Integer w = map.getInteger("weight");
weight = (w==null?0:w);
}
y += weight;
if(x <= y){
@@ -443,12 +444,25 @@ public class WxGameServiceImpl implements WxGameService {
Long orderId = 0L;
Integer addCredit = 0;
if(data != null){
if(data instanceof Map){
Map dataMap = (Map) data;
if(data instanceof WxCouponChannelVo){
WxCouponChannelVo vo = (WxCouponChannelVo) data;
OrderSaveDto orderSaveDto = new OrderSaveDto();
orderSaveDto.setCouponChannelId(vo.getId());
orderSaveDto.setCouponId(vo.getCouponId());
ResultData resultData1 = wxOrderService.saveOrder(orderSaveDto, userId, EnumPayWay.PAY_WAY_WECHAT, wxGame);

if(resultData1.code == Result.SUCCESS && resultData1.data != null && resultData1.data instanceof WxOrder){
WxOrder order = (WxOrder)resultData1.data;
orderId = order.getId();
}else{
resultData.data = null;
}
}else if(data instanceof JSONObject){
JSONObject dataMap = (JSONObject) data;
// Integer prizeType = (Integer) dataMap.get("prizeType");
// if(prizeType != null && prizeType == 0){
Integer credit = (Integer) dataMap.get("credit");
if(credit > 0){
Integer credit = dataMap.getInteger("credit");
if(credit != null && credit > 0){
WxCreditHistory wxCreditHistory = new WxCreditHistory();
wxCreditHistory.setTenantId(wxGame.getFinalTenantId());
wxCreditHistory.setCUserId(userId);
@@ -466,19 +480,6 @@ public class WxGameServiceImpl implements WxGameService {
}
// }

}else if(data instanceof WxCouponChannelVo){
WxCouponChannelVo vo = (WxCouponChannelVo) data;
OrderSaveDto orderSaveDto = new OrderSaveDto();
orderSaveDto.setCouponChannelId(vo.getId());
orderSaveDto.setCouponId(vo.getCouponId());
ResultData resultData1 = wxOrderService.saveOrder(orderSaveDto, userId, EnumPayWay.PAY_WAY_WECHAT, wxGame);

if(resultData1.code == Result.SUCCESS && resultData1.data != null && resultData1.data instanceof WxOrder){
WxOrder order = (WxOrder)resultData1.data;
orderId = order.getId();
}else{
resultData.data = null;
}
}

}


Loading…
Cancel
Save