CIS公会钻石

This commit is contained in:
2025-09-20 17:30:03 +08:00
parent 9573275843
commit 14ef00e5d9
23 changed files with 422 additions and 147 deletions

View File

@@ -0,0 +1,55 @@
package com.accompany.admin.service.guildsoviet;
import com.accompany.business.service.guildsoviet.GuildExtraDiamondDayService;
import com.accompany.business.service.guildsoviet.RoomExtraDiamondDayService;
import com.accompany.business.service.user.UsersService;
import com.accompany.business.vo.guildsoviet.GuildMemberSovietAdminVo;
import com.accompany.business.vo.guildsoviet.GuildSovietAdminVo;
import com.accompany.common.result.PageResult;
import com.accompany.core.exception.AdminServiceException;
import com.accompany.core.model.Users;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class GuildSovietAdminService {
@Autowired
private GuildExtraDiamondDayService guildExtraDiamondDayService;
@Autowired
private RoomExtraDiamondDayService roomExtraDiamondDayService;
@Autowired
private UsersService usersService;
public PageResult<GuildSovietAdminVo> listGuildSovietAdminVo(Integer partitionId, Integer guildId, Long erbanNo,
Integer regionId, String startDate, String endDate,
Integer pageNo, Integer pageSize) {
Long uid = null;
if (erbanNo != null) {
Users user = usersService.getUserByErbanNo(erbanNo);
if (user == null) {
throw new AdminServiceException("公会长ID不存在");
}
uid = user.getUid();
}
Page<GuildSovietAdminVo> guildSovietAdminVoPage =
guildExtraDiamondDayService.pageGuildSovietAdminVo(new Page<>(pageNo, pageSize), partitionId, guildId, uid, regionId, startDate, endDate);
return new PageResult<>(guildSovietAdminVoPage);
}
public PageResult<GuildMemberSovietAdminVo> listGuildMemberSovietAdminVo(Integer partitionId, Byte ebable, Long erbanNo, Integer regionId, String startDate, String endDate,
Integer pageNo, Integer pageSize) {
Long uid = null;
if (erbanNo != null) {
Users user = usersService.getUserByErbanNo(erbanNo);
if (user == null) {
throw new AdminServiceException("公会长ID不存在");
}
uid = user.getUid();
}
Page<GuildMemberSovietAdminVo> guildSovietAdminVoPage =
guildExtraDiamondDayService.pageGuildMemberSovietAdminVo(new Page<>(pageNo, pageSize), partitionId, uid, regionId, ebable, startDate, endDate);
return new PageResult<>(guildSovietAdminVoPage);
}
}

View File

@@ -0,0 +1,93 @@
package com.accompany.admin.controller.guildsoviet;
import com.accompany.admin.service.guildsoviet.GuildSovietAdminService;
import com.accompany.business.vo.guildsoviet.GuildMemberSovietAdminVo;
import com.accompany.business.vo.guildsoviet.GuildSovietAdminVo;
import com.accompany.common.result.PageResult;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
@Api(tags = "CIS公会/主播" , value = "CIS公会/主播")
@RestController
@RequestMapping(value = "/admin/guildSoviet")
public class GuildSovietAdminController {
@Autowired
private GuildSovietAdminService guildSovietAdminService;
@ApiOperation(value = "CIS公会钻石" , httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "guildId" , value = "公会id" , required = true, dataType = "Byte"),
@ApiImplicitParam(name = "erbanNo" , value = "公会长ID" , required = true, dataType = "Long"),
@ApiImplicitParam(name = "regionId" , value = "公会国家" , required = true, dataType = "Integer"),
@ApiImplicitParam(name = "startDate" , value = "开始时间" , required = true, dataType = "String"),
@ApiImplicitParam(name = "endDate" , value = "结束时间" , required = true, dataType = "String"),
@ApiImplicitParam(name = "pageNo" , value = "页码" , required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize" , value = "每页条数" , required = true, dataType = "Integer")
})
@GetMapping("/list")
public PageResult<GuildSovietAdminVo> listGuildSovietAdminVo(@RequestParam(defaultValue = "32") Integer partitionId, Integer guildId, Long erbanNo, Integer regionId,
String startDate, String endDate, Integer pageNo, Integer pageSize) {
return guildSovietAdminService.listGuildSovietAdminVo(partitionId, guildId, erbanNo, regionId, startDate, endDate, pageNo, pageSize);
}
@ApiOperation(value = "CIS公会钻石-导出" , httpMethod = "POST")
@PostMapping("/export")
public void exportGuildSovietAdminVo(HttpServletResponse response, @RequestParam(defaultValue = "32") Integer partitionId,
Integer guildId, Long erbanNo, Integer regionId, String startDate, String endDate) throws IOException {
Integer pageNo = -1;
Integer pageSize = -1;
PageResult<GuildSovietAdminVo> pageResult = guildSovietAdminService.listGuildSovietAdminVo(partitionId, guildId, erbanNo, regionId, startDate, endDate, pageNo, pageSize);
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码
String excelName = URLEncoder.encode("CIS公会钻石", StandardCharsets.UTF_8);
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
EasyExcel.write(response.getOutputStream(), GuildSovietAdminVo.class).sheet("CIS公会钻石").doWrite(pageResult.getRows());
}
@ApiOperation(value = "CIS公会成员钻石" , httpMethod = "GET")
@ApiImplicitParams({
@ApiImplicitParam(name = "erbanNo" , value = "用户ID" , required = true, dataType = "Long"),
@ApiImplicitParam(name = "regionId" , value = "用户国家" , required = true, dataType = "Integer"),
@ApiImplicitParam(name = "startDate" , value = "开始时间" , required = true, dataType = "String"),
@ApiImplicitParam(name = "endDate" , value = "结束时间" , required = true, dataType = "String"),
@ApiImplicitParam(name = "enable" , value = "0-无效1-有效" , required = true, dataType = "Byte"),
@ApiImplicitParam(name = "pageNo" , value = "页码" , required = true, dataType = "Integer"),
@ApiImplicitParam(name = "pageSize" , value = "每页条数" , required = true, dataType = "Integer")
})
@GetMapping("/memberList")
public PageResult<GuildMemberSovietAdminVo> listGuildMemberSovietAdminVo(@RequestParam(defaultValue = "32") Integer partitionId, Byte enable, Long erbanNo, Integer regionId,
String startDate, String endDate, Integer pageNo, Integer pageSize) {
return guildSovietAdminService.listGuildMemberSovietAdminVo(partitionId, enable, erbanNo, regionId, startDate, endDate, pageNo, pageSize);
}
@ApiOperation(value = "CIS公会钻石-导出" , httpMethod = "POST")
@PostMapping("/memberExport")
public void exportGuildMemberSovietAdminVo(HttpServletResponse response, @RequestParam(defaultValue = "32") Integer partitionId, Byte enable,
Long erbanNo, Integer regionId, String startDate, String endDate) throws IOException {
Integer pageNo = -1;
Integer pageSize = -1;
PageResult<GuildMemberSovietAdminVo> pageResult = guildSovietAdminService.listGuildMemberSovietAdminVo(partitionId, enable, erbanNo, regionId, startDate, endDate, pageNo, pageSize);
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码
String excelName = URLEncoder.encode("CIS公会成员钻石", StandardCharsets.UTF_8);
response.setHeader("Content-disposition", "attachment;filename=" + excelName + ExcelTypeEnum.XLSX.getValue());
EasyExcel.write(response.getOutputStream(), GuildMemberSovietAdminVo.class).sheet("CIS公会成员钻石").doWrite(pageResult.getRows());
}
}

View File

@@ -0,0 +1,11 @@
package com.accompany.admin.controller.guildsoviet;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "CIS房间", value = "CIS房间")
@RestController
@RequestMapping(value = "/admin/roomSoviet")
public class RoomSovietAdminController {
}