Compare commits
79 Commits
5f1ef25d13
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d5c51a80c6 | |||
| aa905d47ac | |||
| 40c0f96518 | |||
| 8ae9dda7e6 | |||
| dbaba2532c | |||
| 4dffbb4e11 | |||
| aa3171d1ab | |||
| 08243e390e | |||
| 9a991e527a | |||
| cece05fd1f | |||
| 7cda6e8781 | |||
| cdaf7ce631 | |||
| aebeaaeabe | |||
| 646bc77c7b | |||
| 42ec325815 | |||
| d99bb17419 | |||
| a4ce439f7c | |||
| bfc2b21872 | |||
| e366af0493 | |||
| 95f2e88296 | |||
| d05ce7336c | |||
| 43dd7cf768 | |||
| d879ff7dc9 | |||
| 0d57c0a5f8 | |||
| 016b4df3e8 | |||
| f03877c1d5 | |||
| 023a01b7a2 | |||
| 30bbbfb729 | |||
| 500feb74cb | |||
| cf6290d3b4 | |||
| a65400b3e8 | |||
| 90039ad7ae | |||
| 431c943019 | |||
| 5a15f2208b | |||
| fdbd90c6de | |||
| dfdedbb92d | |||
| 1c40343c6d | |||
| 36a5b3bd0d | |||
| 78b6f5624b | |||
| 3466996f07 | |||
| ebf071b225 | |||
| f00e250be9 | |||
| c75df4743d | |||
| 6e0f41e661 | |||
| 5f84fd31b6 | |||
| 3ade777ac2 | |||
| 4c42809d3b | |||
| 10c5b04c32 | |||
| 9519000a75 | |||
| d9e2d188c1 | |||
| 2145c51814 | |||
| a7582cb558 | |||
| 145034b908 | |||
| 35be251a00 | |||
| 20a5e249aa | |||
| b29431de5b | |||
| 3cc79b6c46 | |||
| b677fd0b0f | |||
| a223f33ed0 | |||
| 2d1528b392 | |||
| e53998446b | |||
| 2650aadcbd | |||
| 7b88322ffa | |||
| 18822ef3e1 | |||
| 4411d38b39 | |||
| e3c820271d | |||
| ac29f38ae7 | |||
| 55c585bddc | |||
| e9361dcd20 | |||
| d3e072270d | |||
| 7a704dfde0 | |||
| 64339f1382 | |||
| 030472275f | |||
| bfac87f9cf | |||
| 62299502dd | |||
| e4827a8b15 | |||
| f1d3ca6f1d | |||
| dd909057b8 | |||
| 2dc363ab13 |
@@ -139,4 +139,13 @@ public class BigBrotherPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "国家名称")
|
||||
private String countryName;
|
||||
|
||||
@Schema(description = "粉丝团等级", example = "0")
|
||||
private Integer fansLevel;
|
||||
|
||||
@Schema(description = "粉丝团等级最大值", example = "0")
|
||||
private Integer fansLevelMax;
|
||||
|
||||
@Schema(description = "粉丝团等级最小值", example = "0")
|
||||
private Integer fansLevelMin;
|
||||
}
|
||||
@@ -71,4 +71,8 @@ public class BigBrotherRespVO {
|
||||
@Schema(description = "是否分配")
|
||||
@ExcelProperty("是否分配")
|
||||
private Byte isAssigned;
|
||||
|
||||
@Schema(description = "粉丝团等级", example = "0")
|
||||
@ExcelProperty("粉丝团等级")
|
||||
private Integer fansLevel;
|
||||
}
|
||||
@@ -55,4 +55,8 @@ public class BigBrotherSaveReqVO {
|
||||
@Schema(description = "是否分配", example = "0")
|
||||
private Byte isAssigned;
|
||||
|
||||
@Schema(description = "粉丝团等级", example = "0")
|
||||
private Integer fansLevel;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController;
|
||||
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.CommentPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.CommentRespVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.CommentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.comment.CommentDO;
|
||||
import cn.iocoder.yudao.module.tkdata.service.comment.CommentService;
|
||||
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.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - AI 评论内容")
|
||||
@RestController
|
||||
@RequestMapping("/server/comment")
|
||||
@Validated
|
||||
public class CommentController {
|
||||
|
||||
@Resource
|
||||
private CommentService commentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建AI 评论内容")
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:create')")
|
||||
public CommonResult<Integer> createComment(@Valid @RequestBody CommentSaveReqVO createReqVO) {
|
||||
return success(commentService.createComment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新AI 评论内容")
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:update')")
|
||||
public CommonResult<Boolean> updateComment(@Valid @RequestBody CommentSaveReqVO updateReqVO) {
|
||||
commentService.updateComment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除AI 评论内容")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:delete')")
|
||||
public CommonResult<Boolean> deleteComment(@RequestParam("id") Integer id) {
|
||||
commentService.deleteComment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除AI 评论内容")
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:delete')")
|
||||
public CommonResult<Boolean> deleteCommentList(@RequestParam("ids") List<Integer> ids) {
|
||||
commentService.deleteCommentListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得AI 评论内容")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:query')")
|
||||
public CommonResult<CommentRespVO> getComment(@RequestParam("id") Integer id) {
|
||||
CommentDO comment = commentService.getComment(id);
|
||||
return success(BeanUtils.toBean(comment, CommentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得AI 评论内容 分页")
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:query')")
|
||||
public CommonResult<PageResult<CommentRespVO>> getCommentPage(@Valid CommentPageReqVO pageReqVO) {
|
||||
PageResult<CommentDO> pageResult = commentService.getCommentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CommentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出AI 评论内容 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('server:comment:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCommentExcel(@Valid CommentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<CommentDO> list = commentService.getCommentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "AI 评论内容 .xls", "数据", CommentRespVO.class,
|
||||
BeanUtils.toBean(list, CommentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController;
|
||||
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguagePageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguageRespVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.language.LanguageDO;
|
||||
import cn.iocoder.yudao.module.tkdata.service.language.LanguageService;
|
||||
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.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - AI 语言种类")
|
||||
@RestController
|
||||
@RequestMapping("/server/language")
|
||||
@Validated
|
||||
public class LanguageController {
|
||||
|
||||
@Resource
|
||||
private LanguageService languageService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建AI 语言种类")
|
||||
@PreAuthorize("@ss.hasPermission('server:language:create')")
|
||||
public CommonResult<Integer> createLanguage(@Valid @RequestBody LanguageSaveReqVO createReqVO) {
|
||||
return success(languageService.createLanguage(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新AI 语言种类")
|
||||
@PreAuthorize("@ss.hasPermission('server:language:update')")
|
||||
public CommonResult<Boolean> updateLanguage(@Valid @RequestBody LanguageSaveReqVO updateReqVO) {
|
||||
languageService.updateLanguage(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除AI 语言种类")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('server:language:delete')")
|
||||
public CommonResult<Boolean> deleteLanguage(@RequestParam("id") Integer id) {
|
||||
languageService.deleteLanguage(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除AI 语言种类")
|
||||
@PreAuthorize("@ss.hasPermission('server:language:delete')")
|
||||
public CommonResult<Boolean> deleteLanguageList(@RequestParam("ids") List<Integer> ids) {
|
||||
languageService.deleteLanguageListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得AI 语言种类")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('server:language:query')")
|
||||
public CommonResult<LanguageRespVO> getLanguage(@RequestParam("id") Integer id) {
|
||||
LanguageDO language = languageService.getLanguage(id);
|
||||
return success(BeanUtils.toBean(language, LanguageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得AI 语言种类分页")
|
||||
@PreAuthorize("@ss.hasPermission('server:language:query')")
|
||||
public CommonResult<PageResult<LanguageRespVO>> getLanguagePage(@Valid LanguagePageReqVO pageReqVO) {
|
||||
PageResult<LanguageDO> pageResult = languageService.getLanguagePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, LanguageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出AI 语言种类 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('server:language:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportLanguageExcel(@Valid LanguagePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<LanguageDO> list = languageService.getLanguagePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "AI 语言种类.xls", "数据", LanguageRespVO.class,
|
||||
BeanUtils.toBean(list, LanguageRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - AI 评论内容分页 Request VO")
|
||||
@Data
|
||||
public class CommentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "具体评论")
|
||||
private String content;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - AI 评论内容Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CommentRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18114")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "具体评论")
|
||||
@ExcelProperty("具体评论")
|
||||
private String content;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - AI 评论内容 新增/修改 Request VO")
|
||||
@Data
|
||||
public class CommentSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "18114")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "具体评论")
|
||||
private String content;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - AI 语言种类分页 Request VO")
|
||||
@Data
|
||||
public class LanguagePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "语言")
|
||||
private String language;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - AI 语言种类 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class LanguageRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28797")
|
||||
@ExcelProperty("主键")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "语言")
|
||||
@ExcelProperty("语言")
|
||||
private String language;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - AI 语言种类新增/修改 Request VO")
|
||||
@Data
|
||||
public class LanguageSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28797")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "语言")
|
||||
private String language;
|
||||
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -6,9 +6,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherRespVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.EmployeeCompleteBarChartReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
|
||||
import cn.iocoder.yudao.module.tkdata.service.employeebigbrother.EmployeeBigBrotherService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -125,4 +128,20 @@ public class EmployeeBigBrotherController {
|
||||
employeeBigBrotherService.batchUpdateEmployeeBigBrother(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@GetMapping("/self_complete")
|
||||
@Operation(summary = "获得自己的建联率")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:selfquery')")
|
||||
public CommonResult<CompletedRateVO> getEmployeeHostsCompleteWithSelf() {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
return success(employeeBigBrotherService.getEmployeeHostsCompleteWithSelf(loginUserId));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/employeeCompleteBarChart")
|
||||
@Operation(summary = "获得员工的建联柱状图数据")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:selfquery')")
|
||||
public CommonResult<List<CompletedRateVO>> getEmployeeCompleteBarChart(@RequestBody EmployeeCompleteBarChartReqVO reqVO) {
|
||||
return success(employeeBigBrotherService.getEmployeeBrotherCompleteBarChart(reqVO.getUserId(),reqVO.getDays()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -138,4 +138,16 @@ public class EmployeeBigBrotherPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "国家名称")
|
||||
private String countryName;
|
||||
|
||||
@Schema(description = "粉丝团等级", example = "0")
|
||||
private Integer fansLevel;
|
||||
|
||||
@Schema(description = "粉丝团等级最大值", example = "0")
|
||||
private Integer fansLevelMax;
|
||||
|
||||
@Schema(description = "粉丝团等级最小值", example = "0")
|
||||
private Integer fansLevelMin;
|
||||
|
||||
@Schema(description = "是否删除", example = "0")
|
||||
private Integer isDelete;
|
||||
}
|
||||
@@ -72,4 +72,7 @@ public class EmployeeBigBrotherRespVO {
|
||||
@ExcelProperty("是否洽谈")
|
||||
private Integer operationStatus;
|
||||
|
||||
@Schema(description = "粉丝团等级", example = "0")
|
||||
@ExcelProperty("粉丝团等级")
|
||||
private Integer fansLevel;
|
||||
}
|
||||
@@ -49,4 +49,6 @@ public class EmployeeBigBrotherSaveReqVO {
|
||||
@Schema(description = "是否洽谈", example = "2")
|
||||
private Integer operationStatus;
|
||||
|
||||
@Schema(description = "粉丝团等级", example = "0")
|
||||
private Integer fansLevel;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts;
|
||||
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -111,6 +112,21 @@ public class EmployeeHostsController {
|
||||
BeanUtils.toBean(list, EmployeeHostsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-employee-excel")
|
||||
@Operation(summary = "导出员工分配主播Excel")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-self-hosts:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportEmployeeSelfHostsExcel(@Valid EmployeeHostsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
PageResult<EmployeeHostsDO> employeeHostsPageWithSelf = employeeHostsService.getEmployeeHostsPageWithSelf(pageReqVO);
|
||||
List<EmployeeHostsDO> list = employeeHostsPageWithSelf.getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "员工分配主播.xls", "数据", EmployeeHostsRespVO.class,
|
||||
BeanUtils.toBean(list, EmployeeHostsRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/allocation")
|
||||
@Operation(summary = "批量分配主播给员工")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:allocation')")
|
||||
@@ -126,4 +142,26 @@ public class EmployeeHostsController {
|
||||
return success(BeanUtils.toBean(pageResult, EmployeeHostsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/employeeComplete")
|
||||
@Operation(summary = "获得员工的建联率")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:selfquery')")
|
||||
public CommonResult<CompletedRateVO> getEmployeeHostsComplete(@Valid Long userId) {
|
||||
return success(employeeHostsService.getEmployeeHostsCompleteWithSelf(userId));
|
||||
}
|
||||
|
||||
@GetMapping("/self_complete")
|
||||
@Operation(summary = "获得自己的建联率")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:selfquery')")
|
||||
public CommonResult<CompletedRateVO> getEmployeeHostsCompleteWithSelf() {
|
||||
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
||||
return success(employeeHostsService.getEmployeeHostsCompleteWithSelf(loginUserId));
|
||||
}
|
||||
|
||||
@PostMapping("/employeeCompleteBarChart")
|
||||
@Operation(summary = "获得员工的建联柱状图数据")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:selfquery')")
|
||||
public CommonResult<List<CompletedRateVO>> getEmployeeCompleteBarChart(@RequestBody EmployeeCompleteBarChartReqVO reqVO) {
|
||||
return success(employeeHostsService.getEmployeeHostsCompleteBarChart(reqVO.getUserId(),reqVO.getDays()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/8/6 15:13
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "管理后台 - 员工建联完成率")
|
||||
public class CompletedRateVO {
|
||||
private Long userId;
|
||||
private Integer finishedNum;
|
||||
private Integer UnfinishedNum;
|
||||
private Integer totalNum;
|
||||
|
||||
public CompletedRateVO(Long userId, int i) {
|
||||
this.userId = userId;
|
||||
this.finishedNum = i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/10/17 14:55
|
||||
*/
|
||||
@Data
|
||||
public class EmployeeCompleteBarChartReqVO {
|
||||
private List<Long> userId;
|
||||
private Integer days;
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class EmployeeHostsPageReqVO extends PageParam {
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "主播等级")
|
||||
private String hostsLevel;
|
||||
private List<String> hostsLevel;
|
||||
|
||||
@Schema(description = "主播金币")
|
||||
private Integer[] hostsCoins;
|
||||
@@ -43,6 +43,9 @@ public class EmployeeHostsPageReqVO extends PageParam {
|
||||
@Schema(description = "主播国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "地区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "直播类型")
|
||||
private String hostsKind;
|
||||
|
||||
@@ -53,6 +56,10 @@ public class EmployeeHostsPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "数据更新时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 昨日金币最大值
|
||||
*/
|
||||
@@ -123,4 +130,13 @@ public class EmployeeHostsPageReqVO extends PageParam {
|
||||
private String sortName;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
|
||||
@Schema(description = "是否删除", example = "0")
|
||||
private Integer isDelete;
|
||||
}
|
||||
@@ -76,4 +76,10 @@ public class EmployeeHostsRespVO {
|
||||
|
||||
@Schema(description = "uid", example = "1")
|
||||
private String uid;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -51,4 +51,9 @@ public class EmployeeHostsSaveReqVO {
|
||||
@Schema(description = "备注", example = "1")
|
||||
private String remake;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsRespV
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||
import cn.iocoder.yudao.module.tkdata.service.newhosts.NewHostsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -33,6 +34,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Tag(name = "管理后台 - 主播数据")
|
||||
@RestController
|
||||
@RequestMapping("/server/new-hosts")
|
||||
@@ -108,6 +110,10 @@ public class NewHostsController {
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<NewHostsDO> list = newHostsService.getNewHostsPage(pageReqVO).getList();
|
||||
if (pageReqVO.getDeleteFlag()){
|
||||
newHostsService.deleteExportData(list);
|
||||
log.info("删除导出数据{}",list.size() );
|
||||
}
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "主播数据.xls", "数据", NewHostsRespVO.class,
|
||||
BeanUtils.toBean(list, NewHostsRespVO.class));
|
||||
|
||||
@@ -47,5 +47,8 @@ public class AllocationHostsSaveReqVO {
|
||||
@Schema(description = "用户 Id", example = "10967")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class NewHostsPageReqVO extends PageParam {
|
||||
private String hostsId;
|
||||
|
||||
@Schema(description = "主播等级")
|
||||
private String hostsLevel;
|
||||
private List<String> hostsLevel;
|
||||
|
||||
@Schema(description = "主播金币")
|
||||
private Integer hostsCoins;
|
||||
@@ -41,6 +41,9 @@ public class NewHostsPageReqVO extends PageParam {
|
||||
@Schema(description = "主播国家")
|
||||
private String country;
|
||||
|
||||
@Schema(description = "地区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "直播类型 娱乐,游戏 ")
|
||||
private String hostsKind;
|
||||
|
||||
@@ -51,6 +54,10 @@ public class NewHostsPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "数据插入时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "用户 Id", example = "10967")
|
||||
private Long userId;
|
||||
|
||||
@@ -132,4 +139,13 @@ public class NewHostsPageReqVO extends PageParam {
|
||||
*/
|
||||
@Schema(description = "是否建联", example = "1")
|
||||
private Byte operationStatus;
|
||||
|
||||
@Schema(description = "是否删除原数据")
|
||||
private Boolean deleteFlag;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -87,4 +87,11 @@ public class NewHostsRespVO {
|
||||
@ExcelProperty("是否建联")
|
||||
private Byte operationStatus;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
@ExcelProperty("旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
@ExcelProperty("国家英文名")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
@@ -58,4 +59,6 @@ public class NewHostsSaveReqVO {
|
||||
@Schema(description = "是否建联", example = "1")
|
||||
private Byte operationStatus;
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
}
|
||||
@@ -82,4 +82,6 @@ public class BigBrotherDO extends BaseDO {
|
||||
private Long tenantId;
|
||||
|
||||
private Integer isAssigned;
|
||||
|
||||
private Integer fansLevel;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.tkdata.dal.dataobject.comment;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* AI 评论内容
|
||||
DO
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@TableName("ai_comment")
|
||||
@KeySequence("ai_comment_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CommentDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 具体评论
|
||||
*/
|
||||
private String content;
|
||||
|
||||
private Byte deleted;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
/**
|
||||
* 国家名称
|
||||
|
||||
@@ -82,4 +82,5 @@ public class EmployeeBigBrotherDO extends BaseDO {
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Integer fansLevel;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@@ -82,4 +83,8 @@ public class EmployeeHostsDO extends BaseDO {
|
||||
private String uid;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private String flag;
|
||||
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.tkdata.dal.dataobject.language;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* AI 语言种类 DO
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@TableName("ai_language")
|
||||
@KeySequence("ai_language_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class LanguageDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 语言
|
||||
*/
|
||||
private String language;
|
||||
|
||||
private Byte deleted;
|
||||
|
||||
}
|
||||
@@ -85,4 +85,6 @@ public class NewHostsDO extends TenantBaseDO {
|
||||
* 是否建联
|
||||
*/
|
||||
private Byte operationStatus;
|
||||
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.tkdata.dal.mysql.comment;
|
||||
|
||||
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.configController.vo.CommentPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.comment.CommentDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* AI 评论内容
|
||||
Mapper
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Mapper
|
||||
public interface CommentMapper extends BaseMapperX<CommentDO> {
|
||||
|
||||
default PageResult<CommentDO> selectPage(CommentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CommentDO>()
|
||||
.eqIfPresent(CommentDO::getContent, reqVO.getContent())
|
||||
.orderByDesc(CommentDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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> {
|
||||
|
||||
|
||||
}
|
||||
@@ -3,11 +3,14 @@ package cn.iocoder.yudao.module.tkdata.dal.mysql.employeebigbrother;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 大哥数据员工业务 Mapper
|
||||
*
|
||||
@@ -20,4 +23,9 @@ public interface EmployeeBigBrotherMapper extends BaseMapperX<EmployeeBigBrother
|
||||
|
||||
|
||||
IPage<EmployeeBigBrotherDO> selectPagewithSelf(@Param("page") IPage<EmployeeBigBrotherDO> iPage,@Param("dto") EmployeeBigBrotherPageReqVO pageReqVO);
|
||||
|
||||
List<CompletedRateVO> selectEmployeeBrotherCompleteBarChart(@Param("list") List<Long> list, @Param("days") Integer days);
|
||||
|
||||
CompletedRateVO selectEmployeeBrotherWithOperationStatus(@Param("userId") Long userId);
|
||||
|
||||
}
|
||||
@@ -32,4 +32,7 @@ public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
|
||||
|
||||
void batchUpdate(ArrayList<EmployeeHostsDO> employeeHostsDOS);
|
||||
|
||||
CompletedRateVO selectEmployeeHostsWithOperationStatus(@Param("userId") Long userId);
|
||||
|
||||
List<CompletedRateVO> selectEmployeeHostsCompleteBarChart(@Param("list") List<Long> list, @Param("days") Integer days);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.tkdata.dal.mysql.language;
|
||||
|
||||
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.configController.vo.LanguagePageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.language.LanguageDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* AI 语言种类 Mapper
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Mapper
|
||||
public interface LanguageMapper extends BaseMapperX<LanguageDO> {
|
||||
|
||||
default PageResult<LanguageDO> selectPage(LanguagePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<LanguageDO>()
|
||||
.eqIfPresent(LanguageDO::getLanguage, reqVO.getLanguage())
|
||||
.orderByDesc(LanguageDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,6 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode EMPLOYEE_HOSTS_NOT_EXISTS = new ErrorCode(1_001_301_001, "分配员工数据不存在");
|
||||
ErrorCode BIG_BROTHER_NOT_EXISTS = new ErrorCode(1_001_401_001, "大哥数据不存在");
|
||||
ErrorCode EMPLOYEE_BIG_BROTHER_NOT_EXISTS = new ErrorCode(1_001_401_001, "大哥数据员工业务不存在");
|
||||
ErrorCode COMMENT_NOT_EXISTS = new ErrorCode(1_001_501_001, "AI 评论内容不存在");
|
||||
ErrorCode LANGUAGE_NOT_EXISTS = new ErrorCode(1_001_501_002, "AI 语言种类不存在");
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package cn.iocoder.yudao.module.tkdata.job;
|
||||
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package cn.iocoder.yudao.module.tkdata.service.comment;
|
||||
|
||||
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.configController.vo.CommentPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.CommentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.comment.CommentDO;
|
||||
|
||||
/**
|
||||
* AI 评论内容
|
||||
Service 接口
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
public interface CommentService {
|
||||
|
||||
/**
|
||||
* 创建AI 评论内容
|
||||
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createComment(@Valid CommentSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新AI 评论内容
|
||||
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateComment(@Valid CommentSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除AI 评论内容
|
||||
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteComment(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除AI 评论内容
|
||||
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteCommentListByIds(List<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得AI 评论内容
|
||||
|
||||
*
|
||||
* @param id 编号
|
||||
* @return AI 评论内容
|
||||
|
||||
*/
|
||||
CommentDO getComment(Integer id);
|
||||
|
||||
/**
|
||||
* 获得AI 评论内容
|
||||
分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return AI 评论内容
|
||||
分页
|
||||
*/
|
||||
PageResult<CommentDO> getCommentPage(CommentPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package cn.iocoder.yudao.module.tkdata.service.comment;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.CommentPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.CommentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.comment.CommentDO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.comment.CommentMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.tkdata.enums.ErrorCodeConstants.COMMENT_NOT_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* AI 评论内容
|
||||
Service 实现类
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CommentServiceImpl implements CommentService {
|
||||
|
||||
@Resource
|
||||
private CommentMapper commentMapper;
|
||||
|
||||
@Override
|
||||
public Integer createComment(CommentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CommentDO comment = BeanUtils.toBean(createReqVO, CommentDO.class);
|
||||
commentMapper.insert(comment);
|
||||
// 返回
|
||||
return comment.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateComment(CommentSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateCommentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
CommentDO updateObj = BeanUtils.toBean(updateReqVO, CommentDO.class);
|
||||
commentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteComment(Integer id) {
|
||||
// 校验存在
|
||||
validateCommentExists(id);
|
||||
// 删除
|
||||
commentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCommentListByIds(List<Integer> ids) {
|
||||
// 校验存在
|
||||
validateCommentExists(ids);
|
||||
// 删除
|
||||
commentMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateCommentExists(List<Integer> ids) {
|
||||
List<CommentDO> list = commentMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(COMMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateCommentExists(Integer id) {
|
||||
if (commentMapper.selectById(id) == null) {
|
||||
throw exception(COMMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommentDO getComment(Integer id) {
|
||||
return commentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CommentDO> getCommentPage(CommentPageReqVO pageReqVO) {
|
||||
return commentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,9 @@ import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,4 +67,8 @@ public interface EmployeeBigBrotherService {
|
||||
PageResult<EmployeeBigBrotherDO> getEmployeeBigBrotherPageWithSelf(@Valid EmployeeBigBrotherPageReqVO pageReqVO);
|
||||
|
||||
void batchUpdateEmployeeBigBrother(@Valid List<EmployeeBigBrotherSaveReqVO> updateReqVO);
|
||||
|
||||
List<CompletedRateVO> getEmployeeBrotherCompleteBarChart(@Param("list") List<Long> list, @Param("days") Integer days);
|
||||
|
||||
CompletedRateVO getEmployeeHostsCompleteWithSelf(Long loginUserId);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
||||
@@ -21,6 +22,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
@@ -157,4 +160,36 @@ public class EmployeeBigBrotherServiceImpl implements EmployeeBigBrotherService
|
||||
employeeBigBrotherMapper.updateBatch(employeeBigBrotherDOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompletedRateVO> getEmployeeBrotherCompleteBarChart(List<Long> userIdList, Integer days) {
|
||||
|
||||
List<CompletedRateVO> dbList = employeeBigBrotherMapper.selectEmployeeBrotherCompleteBarChart(userIdList,days);
|
||||
|
||||
|
||||
try {
|
||||
// 2. 转 Map,key 是 userId
|
||||
Map<Long, CompletedRateVO> dbMap = dbList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CompletedRateVO::getUserId,
|
||||
Function.identity(),
|
||||
(oldVal, newVal) -> newVal)); // 重复时保留新的
|
||||
// 3. 组装结果
|
||||
return userIdList.stream()
|
||||
.map(userId -> dbMap.getOrDefault(userId, new CompletedRateVO(userId, 0))) // 缺数据补0
|
||||
.collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
ArrayList<CompletedRateVO> nullData = new ArrayList<>();
|
||||
for (Long userId : userIdList) {
|
||||
nullData.add(new CompletedRateVO(userId, 0));
|
||||
}
|
||||
return nullData;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletedRateVO getEmployeeHostsCompleteWithSelf(Long loginUserId) {
|
||||
return employeeBigBrotherMapper.selectEmployeeBrotherWithOperationStatus(loginUserId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,4 +64,8 @@ public interface EmployeeHostsService {
|
||||
PageResult<EmployeeHostsDO> getEmployeeHostsPageWithSelf(@Valid EmployeeHostsPageReqVO pageReqVO);
|
||||
|
||||
void batchUpdateEmployeeHosts(List<EmployeeHostsSaveReqVO> updateReqVOList);
|
||||
|
||||
CompletedRateVO getEmployeeHostsCompleteWithSelf(@Valid Long userId);
|
||||
|
||||
List<CompletedRateVO> getEmployeeHostsCompleteBarChart(@Valid List<Long> userId,Integer days);
|
||||
}
|
||||
@@ -1,32 +1,35 @@
|
||||
package cn.iocoder.yudao.module.tkdata.service.employeehosts;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.EmployeeHostsPageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.EmployeeHostsSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.employeehosts.EmployeeHostsMapper;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.newhosts.NewHostsMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.*;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.employeehosts.EmployeeHostsMapper;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.tkdata.enums.ErrorCodeConstants.EMPLOYEE_HOSTS_NOT_EXISTS;
|
||||
|
||||
|
||||
@@ -37,6 +40,7 @@ import static cn.iocoder.yudao.module.tkdata.enums.ErrorCodeConstants.EMPLOYEE_H
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
|
||||
@Resource
|
||||
@@ -59,12 +63,15 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
// 校验存在
|
||||
validateEmployeeHostsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
List<EmployeeHostsDO> employeeHostsDOS = employeeHostsMapper.selectList(new LambdaQueryWrapper<EmployeeHostsDO>().
|
||||
eq(EmployeeHostsDO::getHostsId, updateReqVO.getHostsId())
|
||||
List<EmployeeHostsDO> employeeHostsDOS = employeeHostsMapper.selectList(new LambdaQueryWrapper<EmployeeHostsDO>()
|
||||
.eq(EmployeeHostsDO::getHostsId, updateReqVO.getHostsId())
|
||||
.eq(EmployeeHostsDO::getUserId, updateReqVO.getUserId()));
|
||||
for (EmployeeHostsDO hostsDO : employeeHostsDOS) {
|
||||
hostsDO.setOperationStatus(updateReqVO.getOperationStatus());
|
||||
hostsDO.setRemake(updateReqVO.getRemake());
|
||||
if (updateReqVO.getFlag() != null) {
|
||||
hostsDO.setFlag(updateReqVO.getFlag());
|
||||
}
|
||||
}
|
||||
employeeHostsMapper.updateById(employeeHostsDOS);
|
||||
}
|
||||
@@ -78,12 +85,12 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteEmployeeHostsListByIds(List<Long> ids) {
|
||||
public void deleteEmployeeHostsListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateEmployeeHostsExists(ids);
|
||||
// 删除
|
||||
employeeHostsMapper.deleteByIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateEmployeeHostsExists(List<Long> ids) {
|
||||
List<EmployeeHostsDO> list = employeeHostsMapper.selectByIds(ids);
|
||||
@@ -119,6 +126,7 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
for (EmployeeHostsSaveReqVO employeeHostsSaveReqVO : hostsList) {
|
||||
NewHostsDO newHostsDO = new NewHostsDO();
|
||||
newHostsDO.setId(employeeHostsSaveReqVO.getId());
|
||||
newHostsDO.setHostsId(employeeHostsSaveReqVO.getHostsId());
|
||||
newHostsDO.setUserId(employeeHostsSaveReqVO.getUserId());
|
||||
newHostsDO.setIsAssigned(1);
|
||||
newHostsDOArrayList.add(newHostsDO);
|
||||
@@ -126,8 +134,20 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
employeeHostsDO.setOperationStatus(0);
|
||||
employeeHostsDOS.add(employeeHostsDO);
|
||||
}
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
int i = employeeHostsMapper.batchInsertIgnore(employeeHostsDOS);
|
||||
newHostsMapper.updateBatch(newHostsDOArrayList);
|
||||
LambdaUpdateWrapper<NewHostsDO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
List<String> hostsIds = newHostsDOArrayList.stream()
|
||||
.map(NewHostsDO::getHostsId)
|
||||
.collect(Collectors.toList());
|
||||
int update = newHostsMapper.update(lambdaUpdateWrapper
|
||||
.in(NewHostsDO::getHostsId, hostsIds)
|
||||
.eq(NewHostsDO::getTenantId, tenantId)
|
||||
.set(NewHostsDO::getIsAssigned, 1));
|
||||
log.info("修改租户:{}下 {} 个主播分配状态,共更新 {} 条记录", tenantId, hostsIds.size(), update);
|
||||
|
||||
// newHostsMapper.updateBatch(newHostsDOArrayList);
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -137,11 +157,11 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
|
||||
if (loginUser != null) {
|
||||
pageReqVO.setUserId(loginUser.getId());
|
||||
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
|
||||
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXMLWithSelf(iPage, pageReqVO);
|
||||
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
|
||||
return new PageResult<>(newHostsDOIPage.getRecords(), newHostsDOIPage.getTotal());
|
||||
}
|
||||
return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -155,4 +175,41 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
employeeHostsMapper.batchUpdate(employeeHostsDOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompletedRateVO getEmployeeHostsCompleteWithSelf(Long userId) {
|
||||
return employeeHostsMapper.selectEmployeeHostsWithOperationStatus(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompletedRateVO> getEmployeeHostsCompleteBarChart(List<Long> userIdList, Integer days) {
|
||||
|
||||
List<CompletedRateVO> dbList = employeeHostsMapper.selectEmployeeHostsCompleteBarChart(userIdList,days);
|
||||
|
||||
|
||||
try {
|
||||
// 2. 转 Map,key 是 userId
|
||||
Map<Long, CompletedRateVO> dbMap = dbList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
CompletedRateVO::getUserId,
|
||||
Function.identity(),
|
||||
(oldVal, newVal) -> newVal)); // 重复时保留新的
|
||||
// 3. 组装结果
|
||||
return userIdList.stream()
|
||||
.map(userId -> dbMap.getOrDefault(userId, new CompletedRateVO(userId, 0))) // 缺数据补0
|
||||
.collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
ArrayList<CompletedRateVO> nullData = new ArrayList<>();
|
||||
for (Long userId : userIdList) {
|
||||
nullData.add(new CompletedRateVO(userId, 0));
|
||||
}
|
||||
return nullData;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.tkdata.service.language;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguagePageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.language.LanguageDO;
|
||||
|
||||
/**
|
||||
* AI 语言种类 Service 接口
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
public interface LanguageService {
|
||||
|
||||
/**
|
||||
* 创建AI 语言种类
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createLanguage(@Valid LanguageSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新AI 语言种类
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateLanguage(@Valid LanguageSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除AI 语言种类
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteLanguage(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除AI 语言种类
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteLanguageListByIds(List<Integer> ids);
|
||||
|
||||
/**
|
||||
* 获得AI 语言种类
|
||||
*
|
||||
* @param id 编号
|
||||
* @return AI 语言种类
|
||||
*/
|
||||
LanguageDO getLanguage(Integer id);
|
||||
|
||||
/**
|
||||
* 获得AI 语言种类分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return AI 语言种类分页
|
||||
*/
|
||||
PageResult<LanguageDO> getLanguagePage(LanguagePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package cn.iocoder.yudao.module.tkdata.service.language;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguagePageReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.controller.admin.configController.vo.LanguageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.language.LanguageDO;
|
||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.language.LanguageMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.tkdata.enums.ErrorCodeConstants.LANGUAGE_NOT_EXISTS;
|
||||
|
||||
|
||||
/**
|
||||
* AI 语言种类 Service 实现类
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class LanguageServiceImpl implements LanguageService {
|
||||
|
||||
@Resource
|
||||
private LanguageMapper languageMapper;
|
||||
|
||||
@Override
|
||||
public Integer createLanguage(LanguageSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
LanguageDO language = BeanUtils.toBean(createReqVO, LanguageDO.class);
|
||||
languageMapper.insert(language);
|
||||
// 返回
|
||||
return language.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLanguage(LanguageSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateLanguageExists(updateReqVO.getId());
|
||||
// 更新
|
||||
LanguageDO updateObj = BeanUtils.toBean(updateReqVO, LanguageDO.class);
|
||||
languageMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLanguage(Integer id) {
|
||||
// 校验存在
|
||||
validateLanguageExists(id);
|
||||
// 删除
|
||||
languageMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteLanguageListByIds(List<Integer> ids) {
|
||||
// 校验存在
|
||||
validateLanguageExists(ids);
|
||||
// 删除
|
||||
languageMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateLanguageExists(List<Integer> ids) {
|
||||
List<LanguageDO> list = languageMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(LANGUAGE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateLanguageExists(Integer id) {
|
||||
if (languageMapper.selectById(id) == null) {
|
||||
throw exception(LANGUAGE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LanguageDO getLanguage(Integer id) {
|
||||
return languageMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<LanguageDO> getLanguagePage(LanguagePageReqVO pageReqVO) {
|
||||
return languageMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,4 +62,6 @@ public interface NewHostsService {
|
||||
PageResult<NewHostsDO> getNewHostsPage(NewHostsPageReqVO pageReqVO);
|
||||
|
||||
void batchUpdateNewHosts(@Valid List<NewHostsSaveReqVO> updateReqVO);
|
||||
|
||||
void deleteExportData(List<NewHostsDO> list);
|
||||
}
|
||||
@@ -22,8 +22,6 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
|
||||
/**
|
||||
* 主播数据 Service 实现类
|
||||
@@ -108,4 +106,9 @@ public class NewHostsServiceImpl implements NewHostsService {
|
||||
newHostsMapper.updateBatch(newHostsDOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExportData(List<NewHostsDO> list) {
|
||||
newHostsMapper.deleteBatchIds(list);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -31,6 +31,7 @@
|
||||
<result column="updater" jdbcType="VARCHAR" property="updater" />
|
||||
<result column="deleted" jdbcType="BOOLEAN" property="deleted" />
|
||||
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
|
||||
<result column="fans_level" jdbcType="INTEGER" property="fansLevel" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -38,7 +39,7 @@
|
||||
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO">
|
||||
select sbr.id, sbr.display_id, sbr.user_id_str,sbr.nickname,sbr.level,sbr.hostcoins,
|
||||
sbr.follower_count, sbr.following_count, sbr.region, sbr.historic_high_coins, sbr.total_gift_coins,
|
||||
sbr.host_display_id,sbr.create_time, sbr.is_assigned from
|
||||
sbr.host_display_id,sbr.create_time, sbr.is_assigned,sbr.fans_level from
|
||||
server_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
|
||||
where sbr.tenant_id=#{dto.tenantId}
|
||||
and sbr.deleted = 0
|
||||
@@ -57,15 +58,15 @@
|
||||
<if test="dto.displayId != null and dto.displayId != '' ">
|
||||
and sbr.display_id like concat(#{dto.displayId,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<!-- 大哥打赏金币筛选 -->
|
||||
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax == null ">
|
||||
and sbr.hostcoins >=#{dto.hostcoinsMin,jdbcType=INTEGER}
|
||||
<!-- 大哥打赏的历史最高金币筛选 -->
|
||||
<if test="dto.historicHighCoinsMin != null and dto.historicHighCoinsMin == null ">
|
||||
and sbr.historic_high_coins >=#{dto.historicHighCoinsMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.hostcoinsMax != null and dto.hostcoinsMin == null ">
|
||||
and sbr.hostcoins <=#{dto.hostcoinsMax,jdbcType=INTEGER}
|
||||
<if test="dto.historicHighCoinsMax != null and dto.historicHighCoinsMax == null ">
|
||||
and sbr.historic_high_coins <=#{dto.historicHighCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax != null " >
|
||||
and sbr.hostcoins between #{dto.hostcoinsMin,jdbcType=INTEGER} and #{dto.hostcoinsMax,jdbcType=INTEGER}
|
||||
<if test="dto.historicHighCoinsMin != null and dto.historicHighCoinsMax != null " >
|
||||
and sbr.historic_high_coins between #{dto.historicHighCoinsMin,jdbcType=INTEGER} and #{dto.historicHighCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 大哥打赏总金币筛选 -->
|
||||
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax == null ">
|
||||
@@ -87,6 +88,17 @@
|
||||
<if test="dto.levelMin != null and dto.levelMax != null " >
|
||||
and sbr.level between #{dto.levelMin,jdbcType=INTEGER} and #{dto.levelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 粉丝团等级筛选 -->
|
||||
<if test="dto.fansLevelMin != null and dto.fansLevelMax == null ">
|
||||
and sbr.fans_level >=#{dto.fansLevelMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.fansLevelMax != null and dto.fansLevelMin == null ">
|
||||
and sbr.fans_level <=#{dto.fansLevelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.fansLevelMin != null and dto.fansLevelMax != null " >
|
||||
and sbr.fans_level between #{dto.fansLevelMin,jdbcType=INTEGER} and #{dto.fansLevelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
|
||||
<if test="dto.isAssigned != null">
|
||||
and sbr.is_assigned =#{dto.isAssigned}
|
||||
</if>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.tkdata.dal.mysql.comment.CommentMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -31,6 +31,7 @@
|
||||
<result column="updater" jdbcType="VARCHAR" property="updater" />
|
||||
<result column="deleted" jdbcType="BOOLEAN" property="deleted" />
|
||||
<result column="operation_status" jdbcType="BOOLEAN" property="operationStatus"/>
|
||||
<result column="fans_level" jdbcType="INTEGER" property="fansLevel"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -38,7 +39,7 @@
|
||||
resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO">
|
||||
select sbr.id, sbr.display_id, sbr.user_id_str,sbr.nickname,sbr.level,sbr.hostcoins,
|
||||
sbr.follower_count, sbr.following_count, sbr.region, sbr.historic_high_coins, sbr.total_gift_coins,
|
||||
sbr.host_display_id,sbr.create_time, sbr.user_id, sbr.operation_status from
|
||||
sbr.host_display_id,sbr.create_time, sbr.user_id, sbr.operation_status,sbr.fans_level from
|
||||
server_employee_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
|
||||
where sbr.tenant_id=#{dto.tenantId}
|
||||
and sbr.deleted = 0
|
||||
@@ -58,15 +59,15 @@
|
||||
<if test="dto.displayId != null and dto.displayId != '' ">
|
||||
and sbr.display_id like concat(#{dto.displayId,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<!-- 大哥打赏金币筛选 -->
|
||||
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax == null ">
|
||||
and sbr.hostcoins >=#{dto.hostcoinsMin,jdbcType=INTEGER}
|
||||
<!-- 大哥打赏的历史最高金币筛选 -->
|
||||
<if test="dto.historicHighCoinsMin != null and dto.historicHighCoinsMin == null ">
|
||||
and sbr.historic_high_coins >=#{dto.historicHighCoinsMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.hostcoinsMax != null and dto.hostcoinsMin == null ">
|
||||
and sbr.hostcoins <=#{dto.hostcoinsMax,jdbcType=INTEGER}
|
||||
<if test="dto.historicHighCoinsMax != null and dto.historicHighCoinsMax == null ">
|
||||
and sbr.historic_high_coins <=#{dto.historicHighCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax != null " >
|
||||
and sbr.hostcoins between #{dto.hostcoinsMin,jdbcType=INTEGER} and #{dto.hostcoinsMax,jdbcType=INTEGER}
|
||||
<if test="dto.historicHighCoinsMin != null and dto.historicHighCoinsMax != null " >
|
||||
and sbr.historic_high_coins between #{dto.historicHighCoinsMin,jdbcType=INTEGER} and #{dto.historicHighCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 大哥打赏总金币筛选 -->
|
||||
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax == null ">
|
||||
@@ -88,6 +89,16 @@
|
||||
<if test="dto.levelMin != null and dto.levelMax != null " >
|
||||
and sbr.level between #{dto.levelMin,jdbcType=INTEGER} and #{dto.levelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 粉丝团等级筛选 -->
|
||||
<if test="dto.fansLevelMin != null and dto.fansLevelMax == null ">
|
||||
and sbr.fans_level >=#{dto.fansLevelMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.fansLevelMax != null and dto.fansLevelMin == null ">
|
||||
and sbr.fans_level <=#{dto.fansLevelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.fansLevelMin != null and dto.fansLevelMax != null " >
|
||||
and sbr.fans_level between #{dto.fansLevelMin,jdbcType=INTEGER} and #{dto.fansLevelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.operationStatus != null">
|
||||
and sbr.operation_status =#{dto.operationStatus}
|
||||
</if>
|
||||
@@ -124,10 +135,19 @@
|
||||
resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO">
|
||||
select sbr.id, sbr.display_id, sbr.user_id_str,sbr.nickname,sbr.level,sbr.hostcoins,
|
||||
sbr.follower_count, sbr.following_count, sbr.region, sbr.historic_high_coins, sbr.total_gift_coins,
|
||||
sbr.host_display_id,sbr.create_time, sbr.user_id, sbr.operation_status from
|
||||
sbr.host_display_id,sbr.create_time, sbr.user_id, sbr.operation_status,sbr.fans_level from
|
||||
server_employee_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
|
||||
where sbr.tenant_id=#{dto.tenantId}
|
||||
and sbr.deleted = 0
|
||||
<if test="dto.isDelete == 1">
|
||||
and deleted = 1
|
||||
</if>
|
||||
<if test="dto.isDelete == 0">
|
||||
and deleted = 0
|
||||
</if>
|
||||
<if test="dto.isDelete == 3">
|
||||
and (deleted = 0
|
||||
or deleted = 1)
|
||||
</if>
|
||||
<if test="dto.userId != null" >
|
||||
and sbr.user_id = #{dto.userId,jdbcType=VARCHAR}
|
||||
</if>
|
||||
@@ -156,16 +176,16 @@
|
||||
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax != null " >
|
||||
and sbr.hostcoins between #{dto.hostcoinsMin,jdbcType=INTEGER} and #{dto.hostcoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 大哥打赏总金币筛选 -->
|
||||
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax == null ">
|
||||
and sbr.total_gift_coins >=#{dto.totalGiftCoinsMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.totalGiftCoinsMax != null and dto.totalGiftCoinsMin == null ">
|
||||
and sbr.total_gift_coins <=#{dto.totalGiftCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax != null " >
|
||||
and sbr.total_gift_coins between #{dto.totalGiftCoinsMin,jdbcType=INTEGER} and #{dto.totalGiftCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 大哥打赏的历史最高金币筛选 -->
|
||||
<if test="dto.historicHighCoinsMin != null and dto.historicHighCoinsMin == null ">
|
||||
and sbr.historic_high_coins >=#{dto.historicHighCoinsMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.historicHighCoinsMax != null and dto.historicHighCoinsMax == null ">
|
||||
and sbr.historic_high_coins <=#{dto.historicHighCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.historicHighCoinsMin != null and dto.historicHighCoinsMax != null " >
|
||||
and sbr.historic_high_coins between #{dto.historicHighCoinsMin,jdbcType=INTEGER} and #{dto.historicHighCoinsMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 大哥等级筛选 -->
|
||||
<if test="dto.levelMin != null and dto.levelMax == null ">
|
||||
and sbr.level >=#{dto.levelMin,jdbcType=INTEGER}
|
||||
@@ -176,6 +196,16 @@
|
||||
<if test="dto.levelMin != null and dto.levelMax != null " >
|
||||
and sbr.level between #{dto.levelMin,jdbcType=INTEGER} and #{dto.levelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 粉丝团等级筛选 -->
|
||||
<if test="dto.fansLevelMin != null and dto.fansLevelMax == null ">
|
||||
and sbr.fans_level >=#{dto.fansLevelMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.fansLevelMax != null and dto.fansLevelMin == null ">
|
||||
and sbr.fans_level <=#{dto.fansLevelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.fansLevelMin != null and dto.fansLevelMax != null " >
|
||||
and sbr.fans_level between #{dto.fansLevelMin,jdbcType=INTEGER} and #{dto.fansLevelMax,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.operationStatus != null">
|
||||
and sbr.operation_status =#{dto.operationStatus}
|
||||
</if>
|
||||
@@ -207,4 +237,39 @@
|
||||
</when>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeBrotherCompleteBarChart"
|
||||
resultType="cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO">
|
||||
SELECT
|
||||
user_id AS userId,
|
||||
COUNT(DISTINCT
|
||||
CASE WHEN operation_status = 1 THEN display_id END) AS finishedNum
|
||||
FROM server_employee_big_brother
|
||||
WHERE deleted = 0
|
||||
AND operation_status = 1
|
||||
<!-- 日期范围:今天或过去 7 天(含今天) -->
|
||||
AND update_time >= DATE_SUB(CURDATE(), INTERVAL #{days,jdbcType=INTEGER} - 1 DAY)
|
||||
<if test="list != null and list.size() > 0">
|
||||
AND user_id IN
|
||||
<foreach collection="list" item="user_id" open="(" separator="," close=")">
|
||||
#{user_id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY user_id
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeBrotherWithOperationStatus"
|
||||
resultType="cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO">
|
||||
SELECT
|
||||
user_id AS userId,
|
||||
SUM(CASE WHEN operation_status = 1 THEN 1 ELSE 0 END) AS finishedNum,
|
||||
SUM(CASE WHEN operation_status = 0 THEN 1 ELSE 0 END) AS unfinishedNum,
|
||||
COUNT(*) AS totalNum
|
||||
FROM server_employee_big_brother
|
||||
WHERE deleted = 0
|
||||
<if test="userId != null">
|
||||
AND user_id = #{userId}
|
||||
</if>
|
||||
GROUP BY user_id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -12,6 +12,54 @@
|
||||
|
||||
|
||||
<!-- 使用 IGNORE 关键字忽略重复插入 -->
|
||||
<sql id="Base_Column_List">
|
||||
id,
|
||||
hosts_id,
|
||||
user_id,
|
||||
hosts_level,
|
||||
hosts_coins,
|
||||
invitation_type,
|
||||
online_fans,
|
||||
fans,
|
||||
fllowernum,
|
||||
yesterday_coins,
|
||||
country,
|
||||
hosts_kind,
|
||||
operation_status,
|
||||
remake,
|
||||
`uid`,
|
||||
tenant_id,
|
||||
flag,
|
||||
create_time,
|
||||
update_time,
|
||||
creator,
|
||||
updater,
|
||||
deleted
|
||||
</sql>
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="hosts_id" property="hostsId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="hosts_level" property="hostsLevel"/>
|
||||
<result column="hosts_coins" property="hostsCoins"/>
|
||||
<result column="invitation_type" property="invitationType"/>
|
||||
<result column="online_fans" property="onlineFans"/>
|
||||
<result column="fans" property="fans"/>
|
||||
<result column="fllowernum" property="fllowernum"/>
|
||||
<result column="yesterday_coins" property="yesterdayCoins"/>
|
||||
<result column="country" property="country"/>
|
||||
<result column="hosts_kind" property="hostsKind"/>
|
||||
<result column="operation_status" property="operationStatus"/>
|
||||
<result column="remake" property="remake"/>
|
||||
<result column="uid" property="uid"/>
|
||||
<result column="tenant_id" property="tenantId"/>
|
||||
<result column="flag" property="flag"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="updater" property="updater"/>
|
||||
<result column="deleted" property="deleted"/>
|
||||
</resultMap>
|
||||
<insert id="insertIgnore" parameterType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
||||
INSERT IGNORE INTO server_employee_hosts
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
@@ -63,17 +111,28 @@
|
||||
<select id="selectPageWithXMLWithSelf" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
||||
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
|
||||
yesterday_coins,ns.create_time, country, online_fans,hosts_kind,remake ,
|
||||
operation_status,ns.user_id ,ns.update_time from server_employee_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
||||
operation_status,ns.user_id ,ns.update_time,ns.flag,ns.deleted,ns.country_eng
|
||||
from server_employee_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
||||
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.region != 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.hostsKind != null">
|
||||
and ns.hosts_kind = #{req.hostsKind,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 按照入库时间筛选主播 -->
|
||||
<if test="req.createTime != null">
|
||||
and DATE(ns.create_time) =#{req.createTime}
|
||||
</if>
|
||||
<!-- 按照更新时间筛选主播 -->
|
||||
<if test="req.updateTime != null">
|
||||
and DATE(ns.update_time) =#{req.updateTime}
|
||||
</if>
|
||||
<if test="req.operationStatus != null">
|
||||
and operation_status =#{req.operationStatus,jdbcType=INTEGER}
|
||||
</if>
|
||||
@@ -81,11 +140,18 @@
|
||||
<if test="req.hostsId != '' and req.hostsId != null ">
|
||||
and ns.hosts_id like concat(#{req.hostsId,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
|
||||
<!-- 主播等级筛选 -->
|
||||
<if test="req.hostsLevel != null and req.hostsLevel != ''">
|
||||
and ns.hosts_level =#{req.hostsLevel,jdbcType=VARCHAR}
|
||||
<!-- 主播旗帜搜索 -->
|
||||
<if test="req.flag != null">
|
||||
and ns.flag =#{req.flag}
|
||||
</if>
|
||||
<!-- 主播等级筛选 -->
|
||||
<if test="req.hostsLevel != null and req.hostsLevel.size() > 0">
|
||||
AND ns.hosts_level IN
|
||||
<foreach collection="req.hostsLevel" item="level" open="(" separator="," close=")">
|
||||
#{level, jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
and deleted = 0
|
||||
<!-- 今日主播金币筛选 -->
|
||||
<if test="req.hostsCoinsMin != null and req.hostsCoinsMax == null and req.hostsCoinsMax != '' ">
|
||||
and ns.hosts_coins >=#{req.hostsCoinsMin,jdbcType=INTEGER}
|
||||
@@ -152,27 +218,30 @@
|
||||
<!-- sortNmae 有值的情况下排序 -->
|
||||
<when test="req.sortName != null and req.sort != null ">
|
||||
<if test="req.sortName == 'createTime' and req.sort != null">
|
||||
ns.create_time ${req.sort}
|
||||
ns.create_time ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 昨日主播金币条件排序 -->
|
||||
<if test="req.sortName == 'yesterdayCoins' and req.sort != null">
|
||||
ns.yesterday_coins ${req.sort}
|
||||
ns.yesterday_coins ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播金币条件排序 -->
|
||||
<if test="req.sortName == 'hostsCoins' and req.sort != null">
|
||||
ns.hosts_coins ${req.sort}
|
||||
ns.hosts_coins ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播粉丝条件排序 -->
|
||||
<if test="req.sortName == 'fans' and req.sort != null">
|
||||
ns.fans ${req.sort}
|
||||
ns.fans ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播关注数量排序 -->
|
||||
<if test="req.sortName == 'fllowernum' and req.sort != null">
|
||||
ns.fllowernum ${req.sort}
|
||||
ns.fllowernum ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播直播间在线数量排序 -->
|
||||
<if test="req.sortName == 'onlineFans' and req.sort != null">
|
||||
ns.online_fans ${req.sort}
|
||||
ns.online_fans ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<if test="req.sortName == 'updateTime' and req.sort != null">
|
||||
ns.update_time ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -183,31 +252,60 @@
|
||||
|
||||
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
||||
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
|
||||
yesterday_coins,ns.create_time, country, online_fans,hosts_kind,remake ,operation_status,user_id,uid,ns.update_time from server_employee_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
||||
yesterday_coins,ns.create_time, country, online_fans,hosts_kind,remake ,operation_status,user_id,uid,ns.update_time,ns.flag,ns.country_eng
|
||||
from server_employee_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.isDelete == 1">
|
||||
and deleted = 1
|
||||
</if>
|
||||
<if test="req.isDelete == 0">
|
||||
and deleted = 0
|
||||
</if>
|
||||
<if test="req.isDelete == 3">
|
||||
and (deleted = 0
|
||||
or deleted = 1)
|
||||
</if>
|
||||
<!-- 筛选员工名下主播 -->
|
||||
<if test="req.userId != null ">
|
||||
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.region != null">
|
||||
and ci.country_group_name =#{req.region,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<!-- 主播类型筛选 -->
|
||||
<if test="req.hostsKind != null">
|
||||
and ns.hosts_kind = #{req.hostsKind,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="req.country != '' and req.country !=null ">
|
||||
and ns.country = #{req.country}
|
||||
</if>
|
||||
<!-- 按照入库时间筛选主播 -->
|
||||
<if test="req.createTime != null">
|
||||
and DATE(ns.create_time) =#{req.createTime}
|
||||
</if>
|
||||
|
||||
<!-- 按照更新时间筛选主播 -->
|
||||
<if test="req.updateTime != null">
|
||||
and DATE(ns.update_time) =#{req.updateTime}
|
||||
</if>
|
||||
<if test="req.operationStatus != null">
|
||||
and operation_status =#{req.operationStatus,jdbcType=INTEGER}
|
||||
and operation_status = #{req.operationStatus,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 主播 Id 模糊搜索 -->
|
||||
<if test="req.hostsId != '' and req.hostsId != null ">
|
||||
and ns.hosts_id like concat(#{req.hostsId,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<!-- 主播旗帜搜索 -->
|
||||
<if test="req.flag != null">
|
||||
and ns.flag =#{req.flag}
|
||||
</if>
|
||||
<!-- 主播等级筛选 -->
|
||||
<if test="req.hostsLevel != null and req.hostsLevel != ''">
|
||||
and ns.hosts_level =#{req.hostsLevel,jdbcType=VARCHAR}
|
||||
<if test="req.hostsLevel != null and req.hostsLevel.size() > 0">
|
||||
AND ns.hosts_level IN
|
||||
<foreach collection="req.hostsLevel" item="level" open="(" separator="," close=")">
|
||||
#{level, jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 今日主播金币筛选 -->
|
||||
<if test="req.hostsCoinsMin != null and req.hostsCoinsMax == null ">
|
||||
@@ -275,27 +373,30 @@
|
||||
<!-- sortNmae 有值的情况下排序 -->
|
||||
<when test="req.sortName != null and req.sort != null ">
|
||||
<if test="req.sortName == 'createTime' and req.sort != null">
|
||||
ns.create_time ${req.sort}
|
||||
ns.create_time ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 昨日主播金币条件排序 -->
|
||||
<if test="req.sortName == 'yesterdayCoins' and req.sort != null">
|
||||
ns.yesterday_coins ${req.sort}
|
||||
ns.yesterday_coins ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播金币条件排序 -->
|
||||
<if test="req.sortName == 'hostsCoins' and req.sort != null">
|
||||
ns.hosts_coins ${req.sort}
|
||||
ns.hosts_coins ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播粉丝条件排序 -->
|
||||
<if test="req.sortName == 'fans' and req.sort != null">
|
||||
ns.fans ${req.sort}
|
||||
ns.fans ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播关注数量排序 -->
|
||||
<if test="req.sortName == 'fllowernum' and req.sort != null">
|
||||
ns.fllowernum ${req.sort}
|
||||
ns.fllowernum ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<!-- 主播直播间在线数量排序 -->
|
||||
<if test="req.sortName == 'onlineFans' and req.sort != null">
|
||||
ns.online_fans ${req.sort}
|
||||
ns.online_fans ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
<if test="req.sortName == 'updateTime' and req.sort != null">
|
||||
ns.update_time ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -315,4 +416,38 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="selectEmployeeHostsWithOperationStatus"
|
||||
resultType="cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO">
|
||||
SELECT
|
||||
user_id AS userId,
|
||||
SUM(CASE WHEN operation_status = 1 THEN 1 ELSE 0 END) AS finishedNum,
|
||||
SUM(CASE WHEN operation_status = 0 THEN 1 ELSE 0 END) AS unfinishedNum,
|
||||
COUNT(*) AS totalNum
|
||||
FROM server_employee_hosts
|
||||
WHERE deleted = 0
|
||||
<if test="userId != null">
|
||||
AND user_id = #{userId}
|
||||
</if>
|
||||
GROUP BY user_id
|
||||
</select>
|
||||
|
||||
<select id="selectEmployeeHostsCompleteBarChart"
|
||||
resultType="cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.CompletedRateVO">
|
||||
SELECT
|
||||
user_id AS userId,
|
||||
COUNT(DISTINCT
|
||||
CASE WHEN operation_status = 1 THEN hosts_id END) AS finishedNum
|
||||
FROM server_employee_hosts
|
||||
WHERE deleted = 0
|
||||
AND operation_status = 1
|
||||
<!-- 日期范围:今天或过去 7 天(含今天) -->
|
||||
AND update_time >= DATE_SUB(CURDATE(), INTERVAL #{days,jdbcType=INTEGER} - 1 DAY)
|
||||
<if test="list != null and list.size() > 0">
|
||||
AND user_id IN
|
||||
<foreach collection="list" item="user_id" open="(" separator="," close=")">
|
||||
#{user_id}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY user_id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.tkdata.dal.mysql.language.LanguageMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -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,ns.country_eng
|
||||
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.region != 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}
|
||||
@@ -30,13 +35,20 @@
|
||||
<if test="req.hostsId != '' and req.hostsId != null ">
|
||||
and ns.hosts_id like concat(#{req.hostsId,jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<!-- 直播类型模糊搜索 -->
|
||||
<if test="req.hostsKind != null and req.hostsKind != ''">
|
||||
and ns.hosts_kind like concat("%",#{req.hostsKind,jdbcType=VARCHAR},"%")
|
||||
</if>
|
||||
<!-- 是否分配筛选 -->
|
||||
<if test="req.isAssigned != null ">
|
||||
and ns.is_assigned =#{req.isAssigned,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 主播等级筛选 -->
|
||||
<if test="req.hostsLevel != null and req.hostsLevel != ''">
|
||||
and ns.hosts_level =#{req.hostsLevel,jdbcType=VARCHAR}
|
||||
<if test="req.hostsLevel != null and req.hostsLevel.size() > 0">
|
||||
AND ns.hosts_level IN
|
||||
<foreach collection="req.hostsLevel" item="level" open="(" separator="," close=")">
|
||||
#{level, jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="req.aiOperation != null ">
|
||||
and ns.ai_operation = #{req.aiOperation,jdbcType=TINYINT}
|
||||
@@ -95,7 +107,6 @@
|
||||
<if test="req.invitationType != null">
|
||||
and ns.Invitation_type =#{req.invitationType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 排序类型 -->
|
||||
<!-- 排序类型 -->
|
||||
group by
|
||||
ns.hosts_id
|
||||
@@ -126,6 +137,9 @@
|
||||
<when test="req.sortName == 'onlineFans'">
|
||||
ns.online_fans ${req.sort}
|
||||
</when>
|
||||
<when test="req.sortName == 'updateTime'">
|
||||
ns.update_time ${req.sort}
|
||||
</when>
|
||||
<otherwise>
|
||||
ns.create_time desc
|
||||
</otherwise>
|
||||
|
||||
@@ -29,7 +29,7 @@ public class PageParam implements Serializable {
|
||||
|
||||
@Schema(description = "每页条数,最大值为 1000", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@NotNull(message = "每页条数不能为空")
|
||||
@Min(value = 1, message = "每页条数最小值为 1")
|
||||
// @Min(value = 1, message = "每页条数最小值为 1")
|
||||
@Max(value = 1000, message = "每页条数最大值为 1000")
|
||||
private Integer pageSize = PAGE_SIZE;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ public class JobLogServiceImpl implements JobLogService {
|
||||
.result(result).build();
|
||||
jobLogMapper.updateById(updateObj);
|
||||
} catch (Exception ex) {
|
||||
log.error("更新 Job 日志失败", ex);
|
||||
log.error("[updateJobLogResultAsync][logId({}) endTime({}) duration({}) success({}) result({})]",
|
||||
logId, endTime, duration, success, result);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantSaveReqVO;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -109,7 +108,11 @@ public class TenantController {
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:query')")
|
||||
public CommonResult<PageResult<TenantRespVO>> getTenantPage(@Valid TenantPageReqVO pageVO) {
|
||||
PageResult<TenantDO> pageResult = tenantService.getTenantPage(pageVO);
|
||||
return success(BeanUtils.toBean(pageResult, TenantRespVO.class));
|
||||
PageResult<TenantRespVO> bean = BeanUtils.toBean(pageResult, TenantRespVO.class);
|
||||
for (TenantRespVO tenantRespVO : bean.getList()) {
|
||||
tenantRespVO.setHasChildren(tenantRespVO.getTenantType().equals("代理"));
|
||||
}
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@@ -124,4 +127,53 @@ public class TenantController {
|
||||
BeanUtils.toBean(list, TenantRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
// 以下是控制代理租户的租户查询
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
@GetMapping("/page_self")
|
||||
@Operation(summary = "代理获得自己下属租户分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:query-self')")
|
||||
public CommonResult<PageResult<TenantRespVO>> getSelfTenantPage(@Valid TenantPageReqVO pageVO) {
|
||||
PageResult<TenantDO> pageResult = tenantService.getSelfTenantPage(pageVO);
|
||||
PageResult<TenantRespVO> bean = BeanUtils.toBean(pageResult, TenantRespVO.class);
|
||||
for (TenantRespVO tenantRespVO : bean.getList()) {
|
||||
tenantRespVO.setHasChildren(tenantRespVO.getTenantType().equals("代理"));
|
||||
}
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@GetMapping("/getSelfTenantLevel")
|
||||
@Operation(summary = "获取自身代理级别")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:query-self-Level')")
|
||||
public CommonResult<TenantLevelRespVO> getSelfTenantPage() {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
TenantDO tenant = tenantService.getTenant(tenantId);
|
||||
return success(BeanUtils.toBean(tenant, TenantLevelRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/get-children")
|
||||
@Operation(summary = "获得代理租户下级")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:query-children')")
|
||||
public CommonResult<List<TenantRespVO>> getChildrenTenant(@RequestParam("id") Long id) {
|
||||
List<TenantDO> tenantList = tenantService.getChildrenTenant(id);
|
||||
List<TenantRespVO> bean = BeanUtils.toBean(tenantList, TenantRespVO.class);
|
||||
for (TenantRespVO tenantRespVO : bean) {
|
||||
tenantRespVO.setHasChildren(tenantRespVO.getTenantType().equals("代理"));
|
||||
}
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/renewal")
|
||||
@Operation(summary = "租户续费")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant:renewal')")
|
||||
public CommonResult<Boolean> renewalTenant(@Valid @RequestBody TenantRenewalReqVO renewalReqVO) {
|
||||
tenantService.renewalTenant(renewalReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantagencypackage.TenantAgencyPackageDO;
|
||||
import cn.iocoder.yudao.module.system.service.tenant.TenantPackageService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -73,7 +74,7 @@ public class TenantPackageController {
|
||||
@GetMapping({"/get-simple-list", "simple-list"})
|
||||
@Operation(summary = "获取租户套餐精简信息列表", description = "只包含被开启的租户套餐,主要用于前端的下拉选项")
|
||||
public CommonResult<List<TenantPackageSimpleRespVO>> getTenantPackageList() {
|
||||
List<TenantPackageDO> list = tenantPackageService.getTenantPackageListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
List<TenantAgencyPackageDO> list = tenantPackageService.getTenantPackageListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(BeanUtils.toBean(list, TenantPackageSimpleRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,12 @@ public class TenantPackageSimpleRespVO {
|
||||
@NotNull(message = "套餐名不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "套餐类型", example = "1")
|
||||
private Integer packageType;
|
||||
|
||||
@Schema(description = "套餐价格", example = "30")
|
||||
private Integer price;
|
||||
|
||||
@Schema(description = "套餐有效期天数", example = "30")
|
||||
private Integer days;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 租户 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TenantLevelRespVO {
|
||||
|
||||
@Schema(description = "租户等级",example = "1")
|
||||
private String tenantLevel;
|
||||
}
|
||||
@@ -33,4 +33,24 @@ public class TenantPageReqVO extends PageParam {
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Schema(description = "AI到期时间")
|
||||
private LocalDateTime[] aiExpireTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Schema(description = "爬虫到期时间")
|
||||
private LocalDateTime[] expireTime;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
@Schema(description = "爬大哥到期时间")
|
||||
private LocalDateTime[] brotherExpireTime;
|
||||
|
||||
@Schema
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "父租户Id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "租户类型", example = "代理/客户")
|
||||
private String tenantType;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.AssertTrue;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/25 20:54
|
||||
*/
|
||||
@Schema(description = "管理后台 - 租户续费 Request VO")
|
||||
@Data
|
||||
public class TenantRenewalReqVO {
|
||||
@Schema(description = "租户编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "租户套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "租户套餐编号不能为空")
|
||||
private Long packageId;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户 Response VO")
|
||||
@@ -45,6 +46,14 @@ public class TenantRespVO {
|
||||
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
|
||||
@Schema(description = "ai过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime aiExpireTime;
|
||||
|
||||
@Schema(description = "大哥过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime brotherExpireTime;
|
||||
|
||||
|
||||
@Schema(description = "账号数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Integer accountCount;
|
||||
|
||||
@@ -52,4 +61,18 @@ public class TenantRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "上级租户 Id", example = "1024")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "租户类型", example = "代理/客户")
|
||||
private String tenantType;
|
||||
|
||||
@Schema(description = "租户等级",example = "1")
|
||||
private String tenantLevel;
|
||||
|
||||
@Schema(description = "是否存在下级",example = "true")
|
||||
private Boolean hasChildren;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,13 @@ public class TenantSaveReqVO {
|
||||
@NotNull(message = "过期时间不能为空")
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
@Schema(description = "ai过期时间")
|
||||
private LocalDateTime aiExpireTime;
|
||||
|
||||
@Schema(description = "大哥过期时间")
|
||||
private LocalDateTime brotherExpireTime;
|
||||
|
||||
|
||||
@Schema(description = "账号数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "账号数量不能为空")
|
||||
private Integer accountCount;
|
||||
@@ -76,4 +83,11 @@ public class TenantSaveReqVO {
|
||||
@Schema(description = "能否登录 AI 聊天工具", example = "0不允许,1允许")
|
||||
private Byte aiChat;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "租户类型", example = "代理/客户")
|
||||
@NotNull(message = "租户类型不能为空")
|
||||
private String tenantType;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackageSimpleRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantagencypackage.TenantAgencyPackageDO;
|
||||
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.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.vo.*;
|
||||
import cn.iocoder.yudao.module.system.service.tenantagencypackage.TenantAgencyPackageService;
|
||||
|
||||
@Tag(name = "管理后台 - 代理租户套餐")
|
||||
@RestController
|
||||
@RequestMapping("/system/tenant-agency-package")
|
||||
@Validated
|
||||
public class TenantAgencyPackageController {
|
||||
|
||||
@Resource
|
||||
private TenantAgencyPackageService tenantAgencyPackageService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建代理租户套餐")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:create')")
|
||||
public CommonResult<Long> createTenantAgencyPackage(@Valid @RequestBody TenantAgencyPackageSaveReqVO createReqVO) {
|
||||
return success(tenantAgencyPackageService.createTenantAgencyPackage(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新代理租户套餐")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:update')")
|
||||
public CommonResult<Boolean> updateTenantAgencyPackage(@Valid @RequestBody TenantAgencyPackageSaveReqVO updateReqVO) {
|
||||
tenantAgencyPackageService.updateTenantAgencyPackage(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除代理租户套餐")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:delete')")
|
||||
public CommonResult<Boolean> deleteTenantAgencyPackage(@RequestParam("id") Long id) {
|
||||
tenantAgencyPackageService.deleteTenantAgencyPackage(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除代理租户套餐")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:delete')")
|
||||
public CommonResult<Boolean> deleteTenantAgencyPackageList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantAgencyPackageService.deleteTenantAgencyPackageListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得代理租户套餐")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:query')")
|
||||
public CommonResult<TenantAgencyPackageRespVO> getTenantAgencyPackage(@RequestParam("id") Long id) {
|
||||
TenantAgencyPackageDO tenantAgencyPackage = tenantAgencyPackageService.getTenantAgencyPackage(id);
|
||||
return success(BeanUtils.toBean(tenantAgencyPackage, TenantAgencyPackageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得代理租户套餐分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:query')")
|
||||
public CommonResult<PageResult<TenantAgencyPackageRespVO>> getTenantAgencyPackagePage(@Valid TenantAgencyPackagePageReqVO pageReqVO) {
|
||||
PageResult<TenantAgencyPackageDO> pageResult = tenantAgencyPackageService.getTenantAgencyPackagePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TenantAgencyPackageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出代理租户套餐 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTenantAgencyPackageExcel(@Valid TenantAgencyPackagePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TenantAgencyPackageDO> list = tenantAgencyPackageService.getTenantAgencyPackagePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "代理租户套餐.xls", "数据", TenantAgencyPackageRespVO.class,
|
||||
BeanUtils.toBean(list, TenantAgencyPackageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping({"/get-simple-list", "代理套餐精简列表"})
|
||||
@Operation(summary = "获取代理租户套餐精简信息列表", description = "只包含被开启的租户套餐,主要用于前端的下拉选项")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-agency-package:simple-list')")
|
||||
public CommonResult<List<AgencyTenantPackageSimpleRespVO>> getTenantPackageList() {
|
||||
List<TenantAgencyPackageDO> list = tenantAgencyPackageService.getTenantPackageListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(BeanUtils.toBean(list, AgencyTenantPackageSimpleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 租户套餐精简 Response VO")
|
||||
@Data
|
||||
public class AgencyTenantPackageSimpleRespVO {
|
||||
|
||||
@Schema(description = "套餐编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "套餐名", example = "VIP")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "Ai自动回复权限 0关闭 1 开启", example = "1")
|
||||
private Integer packageType;
|
||||
|
||||
@Schema(description = "套餐价格", example = "1000")
|
||||
private Integer price;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
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 TenantAgencyPackagePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "套餐名", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "租户状态(0正常 1停用)", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "关联的菜单编号")
|
||||
private Set<Long> menuIds;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "套餐天数")
|
||||
private Integer days;
|
||||
|
||||
@Schema(description = "套餐价格", example = "22890")
|
||||
private Integer price;
|
||||
|
||||
@Schema(description = "爬主播客户端 0 关闭 1 开启")
|
||||
private Integer hostslClient;
|
||||
|
||||
@Schema(description = "爬大哥客户端 0 关闭 1 开启")
|
||||
private Integer brotherClient;
|
||||
|
||||
@Schema(description = "AI 客户端 0 关闭 1 开启")
|
||||
private Integer aiClient;
|
||||
|
||||
@Schema(description = "Ai自动回复权限 0关闭 1 开启")
|
||||
private Integer aiReplay;
|
||||
|
||||
@Schema(description = "套餐类型", example = "2")
|
||||
private Integer packageType;
|
||||
|
||||
@Schema(description = "WebAi权限 0关闭 1开启")
|
||||
private Integer webAi;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.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 TenantAgencyPackageRespVO {
|
||||
|
||||
@Schema(description = "套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20125")
|
||||
@ExcelProperty("套餐编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("套餐名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "租户状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("租户状态(0正常 1停用)")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "关联的菜单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("关联的菜单编号")
|
||||
private Set<Long> menuIds;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "套餐天数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("套餐天数")
|
||||
private Integer days;
|
||||
|
||||
@Schema(description = "套餐价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "22890")
|
||||
@ExcelProperty("套餐价格")
|
||||
private Integer price;
|
||||
|
||||
@Schema(description = "爬主播客户端 0 关闭 1 开启")
|
||||
@ExcelProperty("爬主播客户端 0 关闭 1 开启")
|
||||
private Integer hostslClient;
|
||||
|
||||
@Schema(description = "爬大哥客户端 0 关闭 1 开启")
|
||||
@ExcelProperty("爬大哥客户端 0 关闭 1 开启")
|
||||
private Integer brotherClient;
|
||||
|
||||
@Schema(description = "AI 客户端 0 关闭 1 开启")
|
||||
@ExcelProperty("AI 客户端 0 关闭 1 开启")
|
||||
private Integer aiClient;
|
||||
|
||||
@Schema(description = "套餐类型", example = "2")
|
||||
@ExcelProperty("套餐类型")
|
||||
private Integer packageType;
|
||||
|
||||
@Schema(description = "Ai自动回复权限 0关闭 1 开启")
|
||||
@ExcelProperty("Ai 自动回复权限 0关闭 1开启")
|
||||
private Integer aiReplay;
|
||||
|
||||
@Schema(description = "WebAi权限 0关闭 1开启")
|
||||
@ExcelProperty("WebAi权限 0关闭 1开启")
|
||||
private Integer webAi;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.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 TenantAgencyPackageSaveReqVO {
|
||||
|
||||
@Schema(description = "套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20125")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "套餐名", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "套餐名不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "租户状态(0正常 1停用)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "租户状态(0正常 1停用)不能为空")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "关联的菜单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "关联的菜单编号不能为空")
|
||||
private Set<Long> menuIds;
|
||||
|
||||
@Schema(description = "套餐天数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "套餐天数不能为空")
|
||||
private Integer days;
|
||||
|
||||
@Schema(description = "套餐价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "22890")
|
||||
@NotNull(message = "套餐价格不能为空")
|
||||
private Integer price;
|
||||
|
||||
@Schema(description = "爬主播客户端 0 关闭 1 开启")
|
||||
private Integer hostslClient;
|
||||
|
||||
@Schema(description = "爬大哥客户端 0 关闭 1 开启")
|
||||
private Integer brotherClient;
|
||||
|
||||
@Schema(description = "AI 客户端 0 关闭 1 开启")
|
||||
private Integer aiClient;
|
||||
|
||||
@Schema(description = "套餐类型", example = "2")
|
||||
private Integer packageType;
|
||||
|
||||
@Schema(description = "Ai自动回复权限 0关闭 1 开启")
|
||||
private Integer aiReplay;
|
||||
|
||||
@Schema(description = "WebAi权限 0关闭 1开启")
|
||||
private Integer webAi;
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance;
|
||||
|
||||
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.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantbalance.TenantBalanceDO;
|
||||
import cn.iocoder.yudao.module.system.service.tenantbalance.TenantBalanceService;
|
||||
|
||||
@Tag(name = "管理后台 - 租户余额")
|
||||
@RestController
|
||||
@RequestMapping("/system/tenant-balance")
|
||||
@Validated
|
||||
public class TenantBalanceController {
|
||||
|
||||
@Resource
|
||||
private TenantBalanceService tenantBalanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:create')")
|
||||
public CommonResult<Long> createTenantBalance(@Valid @RequestBody TenantBalanceSaveReqVO createReqVO) {
|
||||
return success(tenantBalanceService.createTenantBalance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:update')")
|
||||
public CommonResult<Boolean> updateTenantBalance(@Valid @RequestBody TenantBalanceSaveReqVO updateReqVO) {
|
||||
tenantBalanceService.updateTenantBalance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除租户余额")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:delete')")
|
||||
public CommonResult<Boolean> deleteTenantBalance(@RequestParam("id") Long id) {
|
||||
tenantBalanceService.deleteTenantBalance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:delete')")
|
||||
public CommonResult<Boolean> deleteTenantBalanceList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantBalanceService.deleteTenantBalanceListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得租户余额")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:query')")
|
||||
public CommonResult<TenantBalanceRespVO> getTenantBalance(@RequestParam("id") Long id) {
|
||||
TenantBalanceDO tenantBalance = tenantBalanceService.getTenantBalance(id);
|
||||
return success(BeanUtils.toBean(tenantBalance, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得租户余额分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:query')")
|
||||
public CommonResult<PageResult<TenantBalanceRespVO>> getTenantBalancePage(@Valid TenantBalancePageReqVO pageReqVO) {
|
||||
PageResult<TenantBalanceRespVO> tenantBalancePage = tenantBalanceService.getTenantBalancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(tenantBalancePage, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出租户余额 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTenantBalanceExcel(@Valid TenantBalancePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<TenantBalanceRespVO> list = tenantBalanceService.getTenantBalancePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "租户余额.xls", "数据", TenantBalanceRespVO.class,
|
||||
BeanUtils.toBean(list, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/addAmount")
|
||||
@Operation(summary = "添加租户余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:add')")
|
||||
public CommonResult<Boolean> addTenantBalance(@Valid @RequestBody TenantBalanceAddReqVO addReqVO) {
|
||||
tenantBalanceService.addTenantBalance(addReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/transfer")
|
||||
@Operation(summary = "租户余额转账")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:transfer')")
|
||||
public CommonResult<Boolean> transferToTenant(@Valid @RequestBody TenantBalanceTransferReqVO transferReqVO) {
|
||||
tenantBalanceService.transferToTenant(transferReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-self-amount")
|
||||
@Operation(summary = "获得自己的余额")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:self-amount')")
|
||||
public CommonResult<TenantBalanceRespVO> getTenantBalance() {
|
||||
TenantBalanceDO tenantBalance = tenantBalanceService.getSelfBalance();
|
||||
return success(BeanUtils.toBean(tenantBalance, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/get-self-subordinate-amount-page")
|
||||
@Operation(summary = "获得自己下级余额的分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:self-subordinate')")
|
||||
public CommonResult<PageResult<TenantBalanceRespVO>> getSelfSubordinate(@Valid TenantBalancePageReqVO pageReqVO) {
|
||||
PageResult<TenantBalanceRespVO> tenantBalancePage = tenantBalanceService.getSelfSubordinateTenantBalancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(tenantBalancePage, TenantBalanceRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/19 21:05
|
||||
*/
|
||||
@Schema(description = "管理后台 - 租户余额添加VO")
|
||||
@Data
|
||||
public class TenantBalanceAddReqVO {
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19954")
|
||||
@NotNull(message = "租户 Id 不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "增加的余额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000000")
|
||||
@NotNull(message = "增加的余额不能为空")
|
||||
private Integer amount;
|
||||
|
||||
@Schema(description = "备注", example = "备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/24 15:32
|
||||
*/
|
||||
@Schema(description = "管理后台 - 租户余额消费")
|
||||
@Data
|
||||
public class TenantBalanceConsumptionReqVO {
|
||||
|
||||
@Schema( description = "套餐编号")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
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 TenantBalancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "租户编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "当前积分余额")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "乐观锁版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "测试账号数")
|
||||
@ExcelProperty("测试账号数")
|
||||
private Integer testAccountNum;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance.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 TenantBalanceRespVO {
|
||||
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("租户 Id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "当前积分余额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("当前积分余额")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "代理名称")
|
||||
@ExcelProperty("代理名称")
|
||||
private String tenantName;
|
||||
|
||||
@Schema(description = "测试账号数")
|
||||
@ExcelProperty("测试账号数")
|
||||
private Integer testAccountNum;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户余额新增/修改 Request VO")
|
||||
@Data
|
||||
public class TenantBalanceSaveReqVO {
|
||||
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19954")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "当前积分余额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "当前积分余额不能为空")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "乐观锁版本号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "乐观锁版本号不能为空")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "更新时间不能为空")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
@Schema(description = "测试账号数")
|
||||
@ExcelProperty("测试账号数")
|
||||
private Integer testAccountNum;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/19 21:05
|
||||
*/
|
||||
@Schema(description = "管理后台 - 租户余额添加VO")
|
||||
@Data
|
||||
public class TenantBalanceTransferReqVO {
|
||||
@Schema(description = "租户 Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "租户 Id 不能为空")
|
||||
private Long targetTenantId;
|
||||
|
||||
|
||||
@Schema(description = "转账的金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000")
|
||||
@NotNull(message = "增加的余额不能为空")
|
||||
private Integer transferAmount;
|
||||
|
||||
|
||||
@Schema(description = "登录密码", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
|
||||
@NotNull(message = "登录密码不能为空")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "备注", example = "转账")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantpoints;
|
||||
|
||||
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.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenantpoints.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantpoints.TenantPointsDO;
|
||||
import cn.iocoder.yudao.module.system.service.tenantpoints.TenantPointsService;
|
||||
|
||||
@Tag(name = "管理后台 - 租户积分记录")
|
||||
@RestController
|
||||
@RequestMapping("/system/tenant-points")
|
||||
@Validated
|
||||
public class TenantPointsController {
|
||||
|
||||
@Resource
|
||||
private TenantPointsService tenantPointsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:create')")
|
||||
public CommonResult<Long> createTenantPoints(@Valid @RequestBody TenantPointsSaveReqVO createReqVO) {
|
||||
return success(tenantPointsService.createTenantPoints(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:update')")
|
||||
public CommonResult<Boolean> updateTenantPoints(@Valid @RequestBody TenantPointsSaveReqVO updateReqVO) {
|
||||
tenantPointsService.updateTenantPoints(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除租户积分记录")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:delete')")
|
||||
public CommonResult<Boolean> deleteTenantPoints(@RequestParam("id") Long id) {
|
||||
tenantPointsService.deleteTenantPoints(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除租户积分记录")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:delete')")
|
||||
public CommonResult<Boolean> deleteTenantPointsList(@RequestParam("ids") List<Long> ids) {
|
||||
tenantPointsService.deleteTenantPointsListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得租户积分记录")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:query')")
|
||||
public CommonResult<TenantPointsRespVO> getTenantPoints(@RequestParam("id") Long id) {
|
||||
TenantPointsDO tenantPoints = tenantPointsService.getTenantPoints(id);
|
||||
return success(BeanUtils.toBean(tenantPoints, TenantPointsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得租户积分记录分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:query')")
|
||||
public CommonResult<PageResult<TenantPointsPageRespVO>> getTenantPointsPage(@Valid TenantPointsPageReqVO pageReqVO) {
|
||||
PageResult<TenantPointsPageRespVO> tenantPointsPage = tenantPointsService.getTenantPointsPage(pageReqVO);
|
||||
return success(tenantPointsPage);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出租户积分记录 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-points:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportTenantPointsExcel(@Valid TenantPointsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
|
||||
List<TenantPointsPageRespVO> list = tenantPointsService.getTenantPointsPage(pageReqVO).getList();
|
||||
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "租户积分记录.xls", "数据", TenantPointsPageRespVO.class,
|
||||
BeanUtils.toBean(list, TenantPointsPageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/transaction-history/page")
|
||||
@Operation(summary = "获得租户积分记录分页")
|
||||
@Parameter(name = "tenantId", description = "租户 Id")
|
||||
@PreAuthorize("@ss.hasPermission('system:tenant-balance:query')")
|
||||
public CommonResult<PageResult<TenantPointsDO>> getTenantTransactionHistoryPointsPage(PageParam pageReqVO,
|
||||
@RequestParam("tenantId") Long tenantId) {
|
||||
return success(tenantPointsService.getTenantTransactionHistoryPointsPage(pageReqVO, tenantId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantpoints.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 TenantPointsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "本次变动点数,正加负减")
|
||||
private Integer points;
|
||||
|
||||
@Schema(description = "变动后余额快照(冗余)")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "变动类型,如 RECHARGE, CONSUME, TRANSFER_OUT, TRANSFER_IN", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "变动描述", example = "随便")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "订单 Id/业务单号", example = "84")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "业务流水号(转账、订单等唯一标识)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "操作人 Id", example = "8171")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "目标租户 Id(转账使用)", example = "18731")
|
||||
private Long targetTenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createdAt;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantpoints.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户积分记录 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TenantPointsPageRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16587")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "本次变动点数,正加负减", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("本次变动点数,正加负减")
|
||||
private Integer points;
|
||||
|
||||
@Schema(description = "变动后余额快照(冗余)")
|
||||
@ExcelProperty("变动后余额快照(冗余)")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "变动类型,", example = "转账")
|
||||
@ExcelProperty("变动类型,")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "变动描述", example = "转账金额 100")
|
||||
@ExcelProperty("变动描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "订单 Id/业务单号", example = "84")
|
||||
@ExcelProperty("订单 Id/业务单号")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "业务流水号(转账、订单等唯一标识)")
|
||||
@ExcelProperty("业务流水号(转账、订单等唯一标识)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "操作人 Id", example = "8171")
|
||||
@ExcelProperty("操作人 Id")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "目标租户 Id(转账使用)", example = "18731")
|
||||
@ExcelProperty("目标租户 Id(转账使用)")
|
||||
private Long targetTenantId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "租户名称", example = "租户 A")
|
||||
@ExcelProperty("租户名称")
|
||||
private String tenantName;
|
||||
|
||||
@Schema(description = "测试账号数", example = "1")
|
||||
@ExcelProperty("测试账号数")
|
||||
private Integer testAccountNum;
|
||||
|
||||
@Schema(description = "备注", example = "转账金额:1000")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantpoints.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 TenantPointsRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16587")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "本次变动点数,正加负减", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("本次变动点数,正加负减")
|
||||
private Integer points;
|
||||
|
||||
@Schema(description = "变动后余额快照(冗余)")
|
||||
@ExcelProperty("变动后余额快照(冗余)")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "变动类型,如 RECHARGE, CONSUME, TRANSFER_OUT, TRANSFER_IN", example = "1")
|
||||
@ExcelProperty("变动类型,如 RECHARGE, CONSUME, TRANSFER_OUT, TRANSFER_IN")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "变动描述", example = "随便")
|
||||
@ExcelProperty("变动描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "订单 Id/业务单号", example = "84")
|
||||
@ExcelProperty("订单 Id/业务单号")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "业务流水号(转账、订单等唯一标识)")
|
||||
@ExcelProperty("业务流水号(转账、订单等唯一标识)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "操作人 Id", example = "8171")
|
||||
@ExcelProperty("操作人 Id")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "目标租户 Id(转账使用)", example = "18731")
|
||||
@ExcelProperty("目标租户 Id(转账使用)")
|
||||
private Long targetTenantId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "测试账号数", example = "1")
|
||||
@ExcelProperty("测试账号数")
|
||||
private Integer testAccountNum;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.tenantpoints.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 租户积分记录新增/修改 Request VO")
|
||||
@Data
|
||||
public class TenantPointsSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16587")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "本次变动点数,正加负减", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "本次变动点数,正加负减不能为空")
|
||||
private Integer points;
|
||||
|
||||
@Schema(description = "变动后余额快照(冗余)")
|
||||
private Integer balance;
|
||||
|
||||
@Schema(description = "变动类型,如 RECHARGE, CONSUME, TRANSFER_OUT, TRANSFER_IN", example = "1")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "变动描述", example = "随便")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "订单 Id/业务单号", example = "84")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "业务流水号(转账、订单等唯一标识)")
|
||||
private String bizNo;
|
||||
|
||||
@Schema(description = "操作人 Id", example = "8171")
|
||||
private Long operatorId;
|
||||
|
||||
@Schema(description = "目标租户 Id(转账使用)", example = "18731")
|
||||
private Long targetTenantId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "创建时间不能为空")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
}
|
||||
@@ -33,4 +33,10 @@ public class UserClientSaveReqVO {
|
||||
|
||||
@Schema(description = "能否登录 AI 聊天工具", example = "0不允许,1允许")
|
||||
private Byte aiChat;
|
||||
|
||||
@Schema(description = "是否允许使用 AI 回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录 Web AI 客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -80,4 +80,10 @@ public class UserRespVO{
|
||||
|
||||
@Schema(description = "爬取大哥")
|
||||
private Byte aiChat;
|
||||
|
||||
@Schema(description = "是否允许使用 AI 回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录 Web AI 客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -88,4 +88,10 @@ public class UserSaveReqVO {
|
||||
|
||||
@Schema(description = "能否登录 AI 聊天工具", example = "0不允许,1允许")
|
||||
private Byte aiChat;
|
||||
|
||||
@Schema(description = "是否允许使用 AI 回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录 Web AI 客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -74,9 +74,43 @@ public class TenantDO extends BaseDO {
|
||||
* 过期时间
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
/**
|
||||
* ai过期时间
|
||||
*/
|
||||
private LocalDateTime aiExpireTime;
|
||||
|
||||
/**
|
||||
* 大哥过期时间
|
||||
*/
|
||||
private LocalDateTime brotherExpireTime;
|
||||
/**
|
||||
* 账号数量
|
||||
*/
|
||||
|
||||
private Integer accountCount;
|
||||
|
||||
/**
|
||||
* 上级租户 Id
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 租户类型
|
||||
*/
|
||||
private String tenantType;
|
||||
|
||||
/**
|
||||
* 代理级别
|
||||
*/
|
||||
private Integer tenantLevel;
|
||||
|
||||
private String initialUser;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.tenantagencypackage;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 代理租户套餐 DO
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@TableName(value = "system_tenant_agency_package",autoResultMap = true)
|
||||
@KeySequence("system_tenant_agency_package_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TenantIgnore
|
||||
public class TenantAgencyPackageDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 套餐编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 套餐名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 租户状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 关联的菜单编号
|
||||
*/
|
||||
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Set<Long> menuIds;
|
||||
|
||||
/**
|
||||
* 套餐天数
|
||||
*/
|
||||
private Integer days;
|
||||
/**
|
||||
* 套餐价格
|
||||
*/
|
||||
private Integer price;
|
||||
/**
|
||||
* 爬主播客户端 0 关闭 1 开启
|
||||
*/
|
||||
private Integer hostslClient;
|
||||
/**
|
||||
* 爬大哥客户端 0 关闭 1 开启
|
||||
*/
|
||||
private Integer brotherClient;
|
||||
/**
|
||||
* AI 客户端 0 关闭 1 开启
|
||||
*/
|
||||
private Integer aiClient;
|
||||
/**
|
||||
* 套餐类型
|
||||
*/
|
||||
private Integer packageType;
|
||||
|
||||
/**
|
||||
* Ai自动回复权限 0关闭 1开启
|
||||
*/
|
||||
private Integer aiReplay;
|
||||
|
||||
/**
|
||||
* WebAi权限 0关闭 1开启
|
||||
*/
|
||||
private Integer webAi;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.tenantbalance;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 租户余额 DO
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@TableName("system_tenant_balance")
|
||||
@KeySequence("system_tenant_balance_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TenantBalanceDO{
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 当前积分余额
|
||||
*/
|
||||
private Integer balance;
|
||||
/**
|
||||
* 乐观锁版本号
|
||||
*/
|
||||
private Integer version;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
private Integer testAccountNum;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.tenantpoints;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 租户积分记录 DO
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@TableName("system_tenant_points")
|
||||
@KeySequence("system_tenant_points_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TenantPointsDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
/**
|
||||
* 本次变动点数,正加负减
|
||||
*/
|
||||
private Integer points;
|
||||
/**
|
||||
* 变动后余额快照(冗余)
|
||||
*/
|
||||
private Integer balance;
|
||||
/**
|
||||
* 变动类型,如 RECHARGE, CONSUME, TRANSFER_OUT, TRANSFER_IN
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 变动描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 订单 Id/业务单号
|
||||
*/
|
||||
private String orderId;
|
||||
/**
|
||||
* 业务流水号(转账、订单等唯一标识)
|
||||
*/
|
||||
private String bizNo;
|
||||
/**
|
||||
* 操作人 Id
|
||||
*/
|
||||
private Long operatorId;
|
||||
/**
|
||||
* 目标租户 Id(转账使用)
|
||||
*/
|
||||
private Long targetTenantId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private String remark;
|
||||
|
||||
private Integer testAccountNum;
|
||||
}
|
||||
@@ -105,4 +105,10 @@ public class AdminUserDO extends TenantBaseDO {
|
||||
|
||||
@Schema(description = "是否允许登录AI客户端", example = "0不允许,1允许")
|
||||
private Byte aiChat;
|
||||
|
||||
@Schema(description = "是否允许使用AI回复", example = "0不允许,1允许")
|
||||
private Byte aiReplay;
|
||||
|
||||
@Schema(description = "是否允许登录Web AI客户端", example = "0不允许,1允许")
|
||||
private Byte webAi;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.tenant;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
@@ -23,7 +28,12 @@ public interface TenantMapper extends BaseMapperX<TenantDO> {
|
||||
.likeIfPresent(TenantDO::getContactName, reqVO.getContactName())
|
||||
.likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile())
|
||||
.eqIfPresent(TenantDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(TenantDO::getTenantType, reqVO.getTenantType())
|
||||
.betweenIfPresent(TenantDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(TenantDO::getAiExpireTime, reqVO.getAiExpireTime())
|
||||
.betweenIfPresent(TenantDO::getExpireTime, reqVO.getExpireTime())
|
||||
.betweenIfPresent(TenantDO::getBrotherExpireTime, reqVO.getBrotherExpireTime())
|
||||
.likeIfPresent(TenantDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(TenantDO::getId));
|
||||
}
|
||||
|
||||
@@ -47,4 +57,29 @@ public interface TenantMapper extends BaseMapperX<TenantDO> {
|
||||
return selectList(TenantDO::getStatus, status);
|
||||
}
|
||||
|
||||
default List<TenantDO> selectByAiExpireTime() {
|
||||
LambdaQueryWrapper<TenantDO> myQuery = Wrappers.lambdaQuery(TenantDO.class);
|
||||
myQuery.isNull(TenantDO::getAiExpireTime);
|
||||
return selectList(myQuery);
|
||||
}
|
||||
|
||||
|
||||
default PageResult<TenantDO> selectSelfPage(TenantPageReqVO reqVO){
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantDO>()
|
||||
.eq(TenantDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(TenantDO::getName, reqVO.getName())
|
||||
.likeIfPresent(TenantDO::getContactName, reqVO.getContactName())
|
||||
.likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile())
|
||||
.eqIfPresent(TenantDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(TenantDO::getCreateTime, reqVO.getCreateTime())
|
||||
.betweenIfPresent(TenantDO::getAiExpireTime, reqVO.getAiExpireTime())
|
||||
.betweenIfPresent(TenantDO::getExpireTime, reqVO.getExpireTime())
|
||||
.betweenIfPresent(TenantDO::getBrotherExpireTime, reqVO.getBrotherExpireTime())
|
||||
.likeIfPresent(TenantDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(TenantDO::getId));
|
||||
}
|
||||
|
||||
default List<TenantDO> selectTenantByParentId(Long id){
|
||||
return selectList(TenantDO::getParentId, id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.tenantagencypackage;
|
||||
|
||||
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.system.dal.dataobject.tenant.TenantPackageDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantagencypackage.TenantAgencyPackageDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenantagencypackage.vo.*;
|
||||
|
||||
/**
|
||||
* 代理租户套餐 Mapper
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Mapper
|
||||
public interface TenantAgencyPackageMapper extends BaseMapperX<TenantAgencyPackageDO> {
|
||||
|
||||
default PageResult<TenantAgencyPackageDO> selectPage(TenantAgencyPackagePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantAgencyPackageDO>()
|
||||
.likeIfPresent(TenantAgencyPackageDO::getName, reqVO.getName())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getMenuIds, reqVO.getMenuIds())
|
||||
.betweenIfPresent(TenantAgencyPackageDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getDays, reqVO.getDays())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getPrice, reqVO.getPrice())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getHostslClient, reqVO.getHostslClient())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getBrotherClient, reqVO.getBrotherClient())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getAiClient, reqVO.getAiClient())
|
||||
.eqIfPresent(TenantAgencyPackageDO::getPackageType, reqVO.getPackageType())
|
||||
.orderByDesc(TenantAgencyPackageDO::getId));
|
||||
}
|
||||
|
||||
default List<TenantAgencyPackageDO> selectListByStatus(Integer status) {
|
||||
return selectList(TenantAgencyPackageDO::getStatus, status);
|
||||
}
|
||||
|
||||
TenantAgencyPackageDO selectWithXml(Long packageId);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.tenantbalance;
|
||||
|
||||
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.system.dal.dataobject.tenantbalance.TenantBalanceDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenantbalance.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户余额 Mapper
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Mapper
|
||||
public interface TenantBalanceMapper extends BaseMapperX<TenantBalanceDO> {
|
||||
|
||||
default PageResult<TenantBalanceDO> selectPage(TenantBalancePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantBalanceDO>()
|
||||
.eqIfPresent(TenantBalanceDO::getBalance, reqVO.getBalance())
|
||||
.eqIfPresent(TenantBalanceDO::getVersion, reqVO.getVersion())
|
||||
.eqIfPresent(TenantBalanceDO::getUpdatedAt, reqVO.getUpdatedAt())
|
||||
.orderByDesc(TenantBalanceDO::getId));
|
||||
}
|
||||
|
||||
default Integer updateBalanceWithVersion(Long id, int amount, Integer oldVersion) {
|
||||
LambdaUpdateWrapper<TenantBalanceDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
wrapper.eq(TenantBalanceDO::getId, id);
|
||||
wrapper.eq(TenantBalanceDO::getVersion, oldVersion);
|
||||
|
||||
// balance = balance + amount
|
||||
wrapper.setSql("balance = balance + " + amount);
|
||||
|
||||
// version = version + 1
|
||||
wrapper.setSql("version = version + 1");
|
||||
|
||||
return this.update(null, wrapper);
|
||||
}
|
||||
|
||||
|
||||
IPage<TenantBalanceRespVO> selectPageWithTenantName(IPage<TenantBalanceRespVO> iPage,@Param("req") TenantBalancePageReqVO pageReqVO);
|
||||
|
||||
IPage<TenantBalanceRespVO> selectPageWithSelfSubordinateTenant(@Param("iPage") IPage<TenantBalanceRespVO> iPage, @Param("pageReqVO") TenantBalancePageReqVO pageReqVO, @Param("tenantId") Long tenantId);
|
||||
|
||||
default Integer updateTestAccountNumWithVersion(Long currentTenantId, Integer newTestAccountNum, Integer oldVersion){
|
||||
LambdaUpdateWrapper<TenantBalanceDO> wrapper = new LambdaUpdateWrapper<>();
|
||||
|
||||
wrapper.eq(TenantBalanceDO::getId, currentTenantId);
|
||||
wrapper.eq(TenantBalanceDO::getVersion, oldVersion);
|
||||
|
||||
// testAccount = testAccount + -1
|
||||
wrapper.setSql("test_account_num = test_account_num + " + newTestAccountNum);
|
||||
|
||||
// version = version + 1
|
||||
wrapper.setSql("version = version + 1");
|
||||
|
||||
return this.update(null, wrapper);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user