1.区分国家地区筛选

2.添加获取地区内国家接口
This commit is contained in:
2025-08-04 21:57:38 +08:00
parent 2dc363ab13
commit dd909057b8
13 changed files with 264 additions and 11 deletions

View File

@@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoRespVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.countryinfo.CountryInfoDO;
import cn.iocoder.yudao.module.tkdata.service.countryInfo.CountryInfoService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.annotation.security.PermitAll;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 国家与地区信息统计")
@RestController
@RequestMapping("/server/country-info")
@Validated
public class CountryInfoController {
@Resource
private CountryInfoService countryInfoService;
@GetMapping("/get")
@Operation(summary = "获得国家与地区信息统计")
@Parameter(name = "region", description = "地区名称", required = true, example = "波黑")
@PermitAll
public CommonResult<List<CountryInfoRespVO>> getCountryInfo(@RequestParam("region") String region) {
return success(countryInfoService.getCountryInfo(region));
}
}

View File

@@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 国家与地区信息统计分页 Request VO")
@Data
public class CountryInfoPageReqVO extends PageParam {
@Schema(description = "业务区与地区码")
private String countryGroup;
@Schema(description = "业务区与地区名称", example = "芋艿")
private String countryGroupName;
@Schema(description = "国家名称", example = "赵六")
private String countryName;
@Schema(description = "语言")
private String language;
@Schema(description = "语言中文", example = "王五")
private String languageName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 国家与地区信息统计 Response VO")
@Data
@ExcelIgnoreUnannotated
public class CountryInfoRespVO {
@Schema(description = "主键id无业务含义", requiredMode = Schema.RequiredMode.REQUIRED, example = "7941")
@ExcelProperty("主键id无业务含义")
private Integer id;
@Schema(description = "业务区与地区码")
@ExcelProperty("业务区与地区码")
private String countryGroup;
@Schema(description = "业务区与地区名称", example = "芋艿")
@ExcelProperty("业务区与地区名称")
private String countryGroupName;
@Schema(description = "国家id", requiredMode = Schema.RequiredMode.REQUIRED, example = "4153")
@ExcelProperty("国家id")
private String countryId;
@Schema(description = "国家名称", example = "赵六")
@ExcelProperty("国家名称")
private String countryName;
@Schema(description = "语言")
@ExcelProperty("语言")
private String language;
@Schema(description = "语言中文", example = "王五")
@ExcelProperty("语言中文")
private String languageName;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@@ -0,0 +1,33 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 国家与地区信息统计新增/修改 Request VO")
@Data
public class CountryInfoSaveReqVO {
@Schema(description = "主键id无业务含义", requiredMode = Schema.RequiredMode.REQUIRED, example = "7941")
private Integer id;
@Schema(description = "业务区与地区码")
private String countryGroup;
@Schema(description = "业务区与地区名称", example = "芋艿")
private String countryGroupName;
@Schema(description = "国家id", requiredMode = Schema.RequiredMode.REQUIRED, example = "4153")
private String countryId;
@Schema(description = "国家名称", example = "赵六")
private String countryName;
@Schema(description = "语言")
private String language;
@Schema(description = "语言中文", example = "王五")
private String languageName;
}

View File

@@ -43,6 +43,9 @@ public class EmployeeHostsPageReqVO extends PageParam {
@Schema(description = "主播国家")
private String country;
@Schema(description = "地区")
private String region;
@Schema(description = "直播类型")
private String hostsKind;

View File

@@ -41,6 +41,9 @@ public class NewHostsPageReqVO extends PageParam {
@Schema(description = "主播国家")
private String country;
@Schema(description = "地区")
private String region;
@Schema(description = "直播类型 娱乐,游戏 ")
private String hostsKind;

View File

@@ -10,14 +10,12 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
* @author 芋道源码
*/
@TableName("server_country_info")
@KeySequence("server_country_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CountryInfoDO extends BaseDO {
public class CountryInfoDO {
/**
* 主键id无业务含义
@@ -35,7 +33,6 @@ public class CountryInfoDO extends BaseDO {
/**
* 国家id
*/
@TableId(type = IdType.INPUT)
private String countryId;
/**
* 国家名称

View File

@@ -0,0 +1,21 @@
package cn.iocoder.yudao.module.tkdata.dal.mysql.countryinfo;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoPageReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.countryinfo.CountryInfoDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 国家与地区信息统计 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface CountryInfoMapper extends BaseMapperX<CountryInfoDO> {
}

View File

@@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.tkdata.service.countryInfo;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoRespVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.countryinfo.CountryInfoDO;
/**
* 国家与地区信息统计 Service 接口
*
* @author 芋道源码
*/
public interface CountryInfoService {
List<CountryInfoRespVO> getCountryInfo(String region);
}

View File

@@ -0,0 +1,43 @@
package cn.iocoder.yudao.module.tkdata.service.countryInfo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoRespVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.countryInfo.vo.CountryInfoSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.countryinfo.CountryInfoDO;
import cn.iocoder.yudao.module.tkdata.dal.mysql.countryinfo.CountryInfoMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import java.util.*;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
/**
* 国家与地区信息统计 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class CountryInfoServiceImpl implements CountryInfoService {
@Resource
private CountryInfoMapper countryInfoMapper;
@Override
public List<CountryInfoRespVO> getCountryInfo(String region) {
LambdaQueryWrapper<CountryInfoDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
countryInfoMapper.selectList(lambdaQueryWrapper.eq(CountryInfoDO::getCountryGroupName, region));
return BeanUtils.toBean(countryInfoMapper.selectList(lambdaQueryWrapper), CountryInfoRespVO.class);
}
}

View File

@@ -67,8 +67,11 @@
WHERE tenant_id =#{req.tenantId,jdbcType=BIGINT}
and ns.user_id =#{req.userId,jdbcType=BIGINT}
<!-- 主播国家筛选 -->
<if test="req.country!= '' and req.country != null">
and ci.country_group_name =#{req.country,jdbcType=VARCHAR}
<if test="req.region!= '' and req.country != null">
and ci.country_group_name =#{req.region,jdbcType=VARCHAR}
</if>
<if test="req.country != '' and req.country !=null ">
and ns.country = #{req.country}
</if>
<!-- 按照入库时间筛选主播 -->
<if test="req.createTime != null">
@@ -193,8 +196,11 @@
and user_id = #{req.userId,jdbcType=BIGINT}
</if>
<!-- 主播国家筛选 -->
<if test="req.country!= '' and req.country != null">
and ci.country_group_name =#{req.country,jdbcType=VARCHAR}
<if test="req.region!= '' and req.country != null">
and ci.country_group_name =#{req.region,jdbcType=VARCHAR}
</if>
<if test="req.country != '' and req.country !=null ">
and ns.country = #{req.country}
</if>
<!-- 按照入库时间筛选主播 -->
<if test="req.createTime != null">

View File

@@ -12,12 +12,17 @@
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO">
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
yesterday_coins,ns.create_time, country, online_fans,hosts_kind ,is_assigned,uid ,ns.update_time,ns.operation_status,ns.ai_operation from server_new_hosts ns left join server_country_info ci ON ns.country = ci.country_name
yesterday_coins,ns.create_time, country, online_fans,hosts_kind ,is_assigned,uid ,ns.update_time,ns.operation_status,ns.ai_operation
from server_new_hosts ns left join
server_country_info ci ON ns.country = ci.country_name
WHERE tenant_id =#{req.tenantId,jdbcType=BIGINT}
and deleted = 0
<!-- 主播国家筛选 -->
<if test="req.country!= '' and req.country != null">
and ci.country_group_name =#{req.country,jdbcType=VARCHAR}
<if test="req.region!= '' and req.country != null">
and ci.country_group_name =#{req.region,jdbcType=VARCHAR}
</if>
<if test="req.country != '' and req.country !=null ">
and ns.country = #{req.country}
</if>
<if test="req.userId != null " >
and ns.user_id =#{req.userId,jdbcType=BIGINT}

View File

@@ -190,6 +190,7 @@ yudao:
- /admin-api/system/user/profile/**
- /admin-api/system/auth/**
ignore-tables:
- server_country_info
ignore-caches:
- user_role_ids
- permission_menu_ids