x用户
This commit is contained in:
@@ -402,6 +402,11 @@ public class AdminUserService extends BaseService {
|
||||
return adminUserMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 特殊方法,不能当通用后台用
|
||||
* @param adminId
|
||||
* @return
|
||||
*/
|
||||
public AdminUserVo getByAdminId(Integer adminId) {
|
||||
AdminUser adminUserById = this.getAdminUserById(adminId);
|
||||
List<AdminRefUserRoleKey> roleByAdminId = adminRoleService.getRoleByAdminId(adminId);
|
||||
|
@@ -0,0 +1,98 @@
|
||||
package com.accompany.admin.controller.game;
|
||||
|
||||
import com.accompany.admin.controller.BaseController;
|
||||
import com.accompany.admin.model.AdminUser;
|
||||
import com.accompany.admin.service.system.AdminPartitionService;
|
||||
import com.accompany.admin.service.system.AdminUserService;
|
||||
import com.accompany.business.service.game.ChargeUserXDetailService;
|
||||
import com.accompany.business.vo.game.ChargeUserXDetailVo;
|
||||
import com.accompany.common.result.BusiResult;
|
||||
import com.accompany.common.utils.StringUtils;
|
||||
import com.accompany.core.exception.AdminServiceException;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.support.ExcelTypeEnum;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 用户充值等级 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author wxf
|
||||
* @since 2025-06-30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/chargeUserXDetail")
|
||||
public class ChargeUserXDetailAdminController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private AdminPartitionService adminPartitionService;
|
||||
@Autowired
|
||||
private ChargeUserXDetailService chargeUserXDetailService;
|
||||
|
||||
@GetMapping(value = "/list")
|
||||
public BusiResult<IPage<ChargeUserXDetailVo>> listPage(Long erbanNo, String ip,
|
||||
String device, Integer identity, Integer pageNo, Integer pageSize) {
|
||||
List<Integer> allPartitionId = adminPartitionService.getAllPartitionId(getAdminId());
|
||||
IPage<ChargeUserXDetailVo> ipage = chargeUserXDetailService.listPage(allPartitionId, erbanNo, ip, device, identity, pageNo, pageSize);
|
||||
return BusiResult.success(ipage);
|
||||
}
|
||||
|
||||
@ApiImplicitParam(paramType = "query", name = "erbanNos", value = "逗号隔开ID", required = false)
|
||||
@ApiOperation(value = "新增", httpMethod = "POST")
|
||||
@PostMapping(value = "/save")
|
||||
public BusiResult<Void> save(String erbanNos, String addReason) {
|
||||
if (erbanNos == null) {
|
||||
throw new AdminServiceException(5001, "请填写用户id");
|
||||
}
|
||||
AdminUser adminUserVo = adminUserService.getAdminUserById(getAdminId());
|
||||
|
||||
String[] split = erbanNos.split(",");
|
||||
List<Long> erbanNoList = new ArrayList<>();
|
||||
for (String erbanNo : split) {
|
||||
erbanNoList.add(Long.parseLong(erbanNo.trim()));
|
||||
}
|
||||
chargeUserXDetailService.saveDetail(erbanNoList, addReason, adminUserVo.getId(), adminUserVo.getUsername());
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除", httpMethod = "POST")
|
||||
@PostMapping(value = "/delete")
|
||||
public BusiResult<Void> delete(Long uid, String removeReason) {
|
||||
AdminUser adminUser = adminUserService.getAdminUserById(getAdminId());
|
||||
if (StringUtils.isEmpty(removeReason)) {
|
||||
throw new AdminServiceException(5001, "请填写删除原因");
|
||||
}
|
||||
chargeUserXDetailService.delete(uid, removeReason, adminUser.getId(), adminUser.getUsername());
|
||||
return BusiResult.success();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出", httpMethod = "POST")
|
||||
@PostMapping("/export")
|
||||
public void export(Long erbanNo, String ip, String device, Integer identity, HttpServletResponse response) throws IOException {
|
||||
List<Integer> allPartitionId = adminPartitionService.getAllPartitionId(getAdminId());
|
||||
IPage<ChargeUserXDetailVo> ipage = chargeUserXDetailService.listPage(allPartitionId, erbanNo, ip, device, identity, -1, -1);
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
// 这里URLEncoder.encode可以防止中文乱码
|
||||
String excelName = URLEncoder.encode("嫌疑人x用户", StandardCharsets.UTF_8);
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
|
||||
EasyExcel.write(response.getOutputStream(), ChargeUserXDetailVo.class).sheet("嫌疑人x用户").doWrite(ipage.getRecords());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user