游戏薪资官方提现记录

This commit is contained in:
2025-08-04 18:09:29 +08:00
parent fc383098d3
commit 9d0e90ad80
5 changed files with 358 additions and 0 deletions

View File

@@ -0,0 +1,133 @@
package com.accompany.admin.service.guildgame;
import com.accompany.business.constant.CountryEnum;
import com.accompany.business.constant.guild.GuildConstant;
import com.accompany.business.constant.guild.GuildWithdrawAccountTypeEnum;
import com.accompany.business.model.guildgame.GameUsdWithdrawRecord;
import com.accompany.business.param.BasePageParams;
import com.accompany.business.service.SendSysMsgService;
import com.accompany.business.service.account.AccountBlockService;
import com.accompany.business.service.guildgame.GameUsdOperateService;
import com.accompany.business.service.guildgame.GameUsdWithdrawRecordService;
import com.accompany.business.vo.guildgame.GameUsdWithdrawExamineVo;
import com.accompany.common.constant.Constant;
import com.accompany.core.enumeration.I18nAlertEnum;
import com.accompany.core.model.AccountBlock;
import com.accompany.core.model.PartitionInfo;
import com.accompany.core.service.partition.PartitionInfoService;
import com.accompany.core.util.I18NMessageSourceUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
public class GameUsdWithdrawRecordAdminService {
@Autowired
private GameUsdWithdrawRecordService gameUsdWithdrawRecordService;
@Autowired
private AccountBlockService accountBlockService;
@Autowired
private SendSysMsgService sendSysMsgService;
@Autowired
private GameUsdOperateService gameUsdOperateService;
@Autowired
private PartitionInfoService partitionInfoService;
public Page<GameUsdWithdrawExamineVo> listPage(BasePageParams basePageParams,
Long agencyOwnerErbanNo, Integer status,
String accountType, String country) {
Page<GameUsdWithdrawExamineVo> page = new Page<>(basePageParams.getPageNo(),basePageParams.getPageSize());
Page<GameUsdWithdrawExamineVo> agencyWithdrawExamineVoPage = gameUsdWithdrawRecordService.getBaseMapper()
.listPage(page, agencyOwnerErbanNo, basePageParams.getStartTime(), basePageParams.getEndTime(),
basePageParams.getPartitionId(), status, accountType, country);
if (!CollectionUtils.isEmpty(agencyWithdrawExamineVoPage.getRecords())){
List<String> erbanNoList = agencyWithdrawExamineVoPage.getRecords().stream()
.map(GameUsdWithdrawExamineVo::getErbanNo).distinct()
.map(Object::toString)
.collect(Collectors.toList());
Map<String, Integer> accountBlockMap = accountBlockService.batchQueryAccountBlock(erbanNoList).stream()
.collect(Collectors.toMap(AccountBlock::getBlockValue, AccountBlock::getBlockStatus));
Map<Integer, String> partitionDescMap = partitionInfoService.listAll().stream()
.collect(Collectors.toMap(PartitionInfo::getId, PartitionInfo::getDesc));
for (GameUsdWithdrawExamineVo vo: agencyWithdrawExamineVoPage.getRecords()){
vo.setPartitionDesc(partitionDescMap.get(vo.getPartitionId()));
vo.setRoleTypeDesc(GuildConstant.RoleType.OWNER.equals(vo.getRoleType())?
"会长": GuildConstant.RoleType.MANAGER.equals(vo.getRoleType())? "管理员": "成员");
String erbanNoStr = vo.getErbanNo().toString();
vo.setBlocked(accountBlockMap.containsKey(erbanNoStr));
GuildWithdrawAccountTypeEnum typeEnum = GuildWithdrawAccountTypeEnum.valueOf(vo.getAccountType());
vo.setAccountType(typeEnum.getType());
CountryEnum countryEnum = CountryEnum.valueOf(vo.getAccountCountry());
vo.setAccountCountry(countryEnum.getName());
}
}
return agencyWithdrawExamineVoPage;
}
public void settle(List<Integer> ids, String adminUser) {
List<GameUsdWithdrawRecord> dbList = gameUsdWithdrawRecordService.lambdaQuery()
.in(GameUsdWithdrawRecord::getId, ids)
.eq(GameUsdWithdrawRecord::getStatus, Constant.status.delete)
.list();
if (CollectionUtils.isEmpty(dbList)){
return;
}
List<Long> idList = dbList.stream().map(GameUsdWithdrawRecord::getId).collect(Collectors.toList());
gameUsdWithdrawRecordService.lambdaUpdate()
.set(GameUsdWithdrawRecord::getUpdateTime, new Date())
.set(GameUsdWithdrawRecord::getOperator, adminUser)
.set(GameUsdWithdrawRecord::getStatus, Constant.status.valid)
.in(GameUsdWithdrawRecord::getId, idList)
.update();
List<Long> uidList = dbList.stream().map(GameUsdWithdrawRecord::getUid).distinct().collect(Collectors.toList());
for (Long uid: uidList){
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.GUILD_USD_WITHDRAW_SUCCESS, new Object[]{}, uid);
sendSysMsgService.sendPersonTextMsg(uid, content);
}
}
@Transactional(rollbackFor = Exception.class)
public void reject(List<Integer> ids, String adminName, String remark) {
List<GameUsdWithdrawRecord> dbList = gameUsdWithdrawRecordService.lambdaQuery()
.in(GameUsdWithdrawRecord::getId, ids)
.eq(GameUsdWithdrawRecord::getStatus, Constant.status.delete)
.list();
if (CollectionUtils.isEmpty(dbList)){
return;
}
List<Long> idList = dbList.stream().map(GameUsdWithdrawRecord::getId).collect(Collectors.toList());
gameUsdWithdrawRecordService.lambdaUpdate()
.set(GameUsdWithdrawRecord::getUpdateTime, new Date())
.set(GameUsdWithdrawRecord::getOperator, adminName)
.set(GameUsdWithdrawRecord::getRemark, remark)
.set(GameUsdWithdrawRecord::getStatus, Constant.status.invalid)
.in(GameUsdWithdrawRecord::getId, idList)
.update();
for (GameUsdWithdrawRecord record: dbList){
String content = I18NMessageSourceUtil.getMessage(I18nAlertEnum.GUILD_USD_WITHDRAW_FAIL, new Object[]{}, record.getUid());
sendSysMsgService.sendPersonTextMsg(record.getUid(), content);
gameUsdOperateService.withdrawReject(record.getGuildId(), record.getUid(), record.getGameUsdNum());
}
}
}

View File

@@ -0,0 +1,88 @@
package com.accompany.admin.controller.guildgame;
import com.accompany.admin.controller.BaseController;
import com.accompany.admin.service.guildgame.GameUsdWithdrawRecordAdminService;
import com.accompany.admin.service.system.AdminUserService;
import com.accompany.business.param.BasePageParams;
import com.accompany.business.vo.guildgame.GameUsdWithdrawExamineVo;
import com.accompany.common.status.BusiStatus;
import com.accompany.core.exception.ServiceException;
import com.accompany.core.vo.BaseResponseVO;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/gameUsdWithdrawExamine")
public class GameUsdWithdrawExamineController extends BaseController {
@Autowired
private GameUsdWithdrawRecordAdminService gameUsdWithdrawRecordAdminService;
@Autowired
private AdminUserService adminUserService;
@ApiOperation("列表")
@GetMapping("/list")
public BaseResponseVO<Page<GameUsdWithdrawExamineVo>> list(BasePageParams basePageParams,
Long agencyOwnerErbanNo, Integer status,
String accountType, String country) throws Exception {
Page<GameUsdWithdrawExamineVo> iPage = gameUsdWithdrawRecordAdminService.listPage(basePageParams,
agencyOwnerErbanNo,status, accountType, country);
return new BaseResponseVO<>(iPage);
}
@ApiOperation("批量结算")
@PostMapping("/batchSettle")
public BaseResponseVO<Void> batchSettle(String ids){
if (!StringUtils.hasText(ids)){
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
}
String adminName = adminUserService.getAdminName(getAdminId());
List<Integer> idList = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList());
gameUsdWithdrawRecordAdminService.settle(idList, adminName);
return new BaseResponseVO<>(BusiStatus.SUCCESS);
}
@ApiOperation("批量驳回")
@PostMapping("/batchReject")
public BaseResponseVO<Void> batchReject(String ids, String remark){
if (!StringUtils.hasText(ids)){
throw new ServiceException(BusiStatus.PARAMETERILLEGAL);
}
String adminName = adminUserService.getAdminName(getAdminId());
List<Integer> idList = Arrays.stream(ids.split(",")).map(Integer::parseInt).collect(Collectors.toList());
gameUsdWithdrawRecordAdminService.reject(idList, adminName, remark);
return new BaseResponseVO<>(BusiStatus.SUCCESS);
}
@SneakyThrows
@ApiOperation("导出")
@PostMapping("/export")
public void export(HttpServletResponse response,BasePageParams basePageParams,
Long agencyOwnerErbanNo, Integer status, String accountType, String country) {
basePageParams.setPageSize(-1);
Page<GameUsdWithdrawExamineVo> iPage = gameUsdWithdrawRecordAdminService.listPage(basePageParams,
agencyOwnerErbanNo,status, accountType, country);
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码
String excelName = URLEncoder.encode("游戏薪资官方提现记录", StandardCharsets.UTF_8);
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
EasyExcel.write(response.getOutputStream(), GameUsdWithdrawExamineVo.class).sheet("游戏薪资官方提现记录").doWrite(iPage.getRecords());
}
}

View File

@@ -0,0 +1,96 @@
package com.accompany.business.vo.guildgame;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* <p>
* 主播提现表
* </p>
*
* @author wxf
* @since 2024-08-01
*/
@Data
public class GameUsdWithdrawExamineVo {
@ExcelProperty("id")
@ApiModelProperty("id")
private Long erbanNo;
@ExcelProperty("昵称")
@ApiModelProperty("昵称")
private String nick;
@ExcelIgnore
@ApiModelProperty("分区id")
private Integer partitionId;
@ExcelProperty("分区")
@ApiModelProperty("分区")
private String partitionDesc;
@ExcelProperty("公会id")
@ApiModelProperty("公会id")
private Integer guildId;
@ExcelIgnore
@ApiModelProperty("公会角色")
private Byte roleType;
@ExcelProperty("公会角色")
@ApiModelProperty("公会角色")
private String roleTypeDesc;
@ExcelProperty("公会长id")
@ApiModelProperty("公会长id")
private Integer guildOwnerErbanNo;
@ExcelProperty("是否封禁")
@ApiModelProperty("是否封禁状态")
private Boolean blocked;
@ExcelProperty("记录id")
@ApiModelProperty("记录id")
private Long id;
@ExcelProperty("状态")
@ApiModelProperty("状态")
private Byte status;
@ExcelProperty("申请时间")
@ApiModelProperty("创建时间")
private String createTime;
@ExcelProperty("账户类型")
@ApiModelProperty("账户类型")
private String accountType;
@ExcelProperty("账户国家")
@ApiModelProperty("账户国家")
private String accountCountry;
@ExcelProperty("账户详细信息")
@ApiModelProperty("账户详细信息")
private String accountInfos;
@ExcelProperty("游戏薪资数量")
@ApiModelProperty("游戏薪资数量")
private BigDecimal gameUsdNum;
@ExcelProperty("货币")
@ApiModelProperty("货币")
private String currency;
@ExcelProperty("货币数")
@ApiModelProperty("货币数")
private BigDecimal currencyNum;
@ExcelProperty("手续费")
@ApiModelProperty("手续费")
private BigDecimal withdrawRate;
@ExcelProperty("实际提现货币数")
@ApiModelProperty("实际提现货币数")
private BigDecimal withdrawNum;
@ExcelProperty("备注")
@ApiModelProperty("备注")
private String remark;
@ExcelProperty("更新时间")
@ApiModelProperty("更新时间")
private String updateTime;
@ExcelProperty("操作人")
@ApiModelProperty("操作人")
private String operator;
}

View File

@@ -1,7 +1,10 @@
package com.accompany.business.mybatismapper.guildgame;
import com.accompany.business.model.guildgame.GameUsdWithdrawRecord;
import com.accompany.business.vo.guildgame.GameUsdWithdrawExamineVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
/**
* Mapper 接口
@@ -11,4 +14,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface GameUsdWithdrawRecordMapper extends BaseMapper<GameUsdWithdrawRecord> {
Page<GameUsdWithdrawExamineVo> listPage(@Param("page") Page<GameUsdWithdrawExamineVo> page,
@Param("agencyOwnerErbanNo") Long agencyOwnerErbanNo,
@Param("startTime") String startTime, @Param("endTime") String endTime,
@Param("partitionId") Integer partitionId, @Param("status") Integer status,
@Param("accountType") String accountType, @Param("country") String country);
}

View File

@@ -2,4 +2,36 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.accompany.business.mybatismapper.guildgame.GameUsdWithdrawRecordMapper">
<select id="listPage" resultType="com.accompany.business.vo.guildgame.GameUsdWithdrawExamineVo">
select awe.id, awe.partition_id, awe.guild_id, awe.uid, game_usd_num, remark, status, awe.create_time, awe.update_time,
operator, account_type, account_country, account_infos, currency, currency_num, withdraw_rate, withdraw_num,
u.erban_no erbanNo, u.nick, (if(g.owner_uid = awe.uid, 1, 3)) roleType, gu.erban_no guildOwnerErbanNo
from game_usd_withdraw_record awe
inner join users u on awe.uid = u.uid
inner join guild g on awe.guild_id = g.id
inner join users gu on g.owner_uid = gu.uid
where 1= 1
<if test="agencyOwnerErbanNo != null">
and u.erban_no = #{agencyOwnerErbanNo}
</if>
<if test="partitionId != null">
and awe.partition_id = #{partitionId}
</if>
<if test="startTime != null">
and awe.create_time >=#{startTime}
</if>
<if test="endTime != null">
and awe.create_time &lt;=#{endTime}
</if>
<if test="status != null">
and awe.status =#{status}
</if>
<if test="accountType != null">
and awe.account_type = #{accountType}
</if>
<if test="country != null">
and awe.account_country = #{country}
</if>
order by awe.create_time desc
</select>
</mapper>