winter 1 год назад
Родитель
Сommit
88c8719e2a
3 измененных файлов: 41 добавлений и 0 удалений
  1. +28
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxGameController.java
  2. +6
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxGameActionLog.java
  3. +7
    -0
      mallinkService/src/main/resources/mapper/WxGameActionLogMapper.xml

+ 28
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxGameController.java Просмотреть файл

@@ -7,6 +7,7 @@ import com.iformall.common.ErrorCode;
import com.iformall.common.Result; import com.iformall.common.Result;
import com.iformall.common.ResultData; import com.iformall.common.ResultData;
import com.iformall.controller.base.BaseController; import com.iformall.controller.base.BaseController;
import com.iformall.domain.po.WxCUserBasicInfo;
import com.iformall.domain.po.WxGame; import com.iformall.domain.po.WxGame;
import com.iformall.domain.po.WxGameActionLog; import com.iformall.domain.po.WxGameActionLog;
import com.iformall.domain.po.WxGameUserCount; import com.iformall.domain.po.WxGameUserCount;
@@ -14,11 +15,16 @@ import com.iformall.domain.po.base.BaseEntity;
import com.iformall.domain.vo.WxGameUserActionLogVo; import com.iformall.domain.vo.WxGameUserActionLogVo;
import com.iformall.enums.EnumGameStatus; import com.iformall.enums.EnumGameStatus;
import com.iformall.exception.MallinkException; import com.iformall.exception.MallinkException;
import com.iformall.service.WxCUserBasicInfoService;
import com.iformall.service.WxGameService; import com.iformall.service.WxGameService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@@ -33,6 +39,9 @@ public class WxGameController extends BaseController {


@Autowired @Autowired
private WxGameService wxGameService; private WxGameService wxGameService;
@Autowired
private WxCUserBasicInfoService wxCUserBasicInfoService;


@ApiOperation("分页列表接口") @ApiOperation("分页列表接口")
@GetMapping("list") @GetMapping("list")
@@ -60,6 +69,19 @@ public class WxGameController extends BaseController {
} }
wxGameLog.updateTenantInfo(getTenantInfo()); wxGameLog.updateTenantInfo(getTenantInfo());
wxGameLog.setSortColumns("user_id asc"); wxGameLog.setSortColumns("user_id asc");
if (StringUtils.isNotBlank(wxGameLog.getUserPhone())) {
WxCUserBasicInfo iq = new WxCUserBasicInfo();
iq.setFinalTenantId(wxGameLog.getFinalTenantId());
iq.setPhone(wxGameLog.getUserPhone());
List<Long> userIdList = wxCUserBasicInfoService.findIdList(iq);
if (null == userIdList || userIdList.size() <= 0 ) {
userIdList = new ArrayList<Long>();
userIdList.add(-1L);
wxGameLog.setUserIdList(userIdList);
}else {
wxGameLog.setUserIdList(userIdList);
}
}
final PageInfo<WxGameUserActionLogVo> page = wxGameService.listUserActionLogAsPage(wxGameLog, pageNum, pageSize); final PageInfo<WxGameUserActionLogVo> page = wxGameService.listUserActionLogAsPage(wxGameLog, pageNum, pageSize);
return new ResultData(page); return new ResultData(page);
} }
@@ -145,6 +167,12 @@ public class WxGameController extends BaseController {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"参数错误"); return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"参数错误");
} }
gameUserCount.updateTenantInfo(getTenantInfo()); gameUserCount.updateTenantInfo(getTenantInfo());
WxCUserBasicInfo cuser = wxCUserBasicInfoService.getById(gameUserCount.getUserId(), gameUserCount.getFinalTenantId());
if (null == cuser) {
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL,"未查询到会员");
}
gameUserCount.setUserNickName(cuser.getNickName());
try{ try{
wxGameService.saveOrUpdateGameUserCount(gameUserCount); wxGameService.saveOrUpdateGameUserCount(gameUserCount);
return new ResultData(); return new ResultData();


+ 6
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxGameActionLog.java Просмотреть файл

@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;


import java.util.Date; import java.util.Date;
import java.util.List;


@TableName(value = "wx_game_action_log") @TableName(value = "wx_game_action_log")
@Data @Data
@@ -40,6 +41,11 @@ public class WxGameActionLog extends TenantEntity {


@io.swagger.annotations.ApiModelProperty(value = "", name = "usedCredit") @io.swagger.annotations.ApiModelProperty(value = "", name = "usedCredit")
private Integer addCredit; private Integer addCredit;
@TableField(exist = false)
private String userPhone;
@TableField(exist = false)
private List<Long> userIdList;




} }

+ 7
- 0
mallinkService/src/main/resources/mapper/WxGameActionLogMapper.xml Просмотреть файл

@@ -163,6 +163,13 @@
sum(add_credit) as add_credit_sum,sum(used_credit) as use_credit_sum sum(add_credit) as add_credit_sum,sum(used_credit) as use_credit_sum
from wx_game_action_log from wx_game_action_log
where `tenant_id` = #{tenantId} and `game_id` = #{gameId} where `tenant_id` = #{tenantId} and `game_id` = #{gameId}
<if test=" null != userIdList ">
and user_id in
<foreach collection="userIdList" index="index" item="uidItem" open="(" separator="," close=")">
#{uidItem}
</foreach>
</if>
group by user_id group by user_id
</select> </select>




Загрузка…
Отмена
Сохранить