Compare commits
69 Commits
d3e072270d
...
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 |
@@ -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;
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -112,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')")
|
||||
@@ -134,8 +149,6 @@ public class EmployeeHostsController {
|
||||
return success(employeeHostsService.getEmployeeHostsCompleteWithSelf(userId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/self_complete")
|
||||
@Operation(summary = "获得自己的建联率")
|
||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:selfquery')")
|
||||
@@ -143,4 +156,12 @@ public class EmployeeHostsController {
|
||||
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()));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,17 +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;
|
||||
}
|
||||
@@ -56,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;
|
||||
|
||||
/**
|
||||
* 昨日金币最大值
|
||||
*/
|
||||
@@ -129,4 +133,10 @@ public class EmployeeHostsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
|
||||
@Schema(description = "是否删除", example = "0")
|
||||
private Integer isDelete;
|
||||
}
|
||||
@@ -79,4 +79,7 @@ public class EmployeeHostsRespVO {
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -53,4 +53,7 @@ public class EmployeeHostsSaveReqVO {
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -54,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;
|
||||
|
||||
@@ -141,4 +145,7 @@ public class NewHostsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -90,4 +90,8 @@ public class NewHostsRespVO {
|
||||
@Schema(description = "旗帜")
|
||||
@ExcelProperty("旗帜")
|
||||
private String flag;
|
||||
|
||||
@Schema(description = "国家英文名", example = "United States")
|
||||
@ExcelProperty("国家英文名")
|
||||
private String countryEng;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
@@ -82,4 +82,5 @@ public class EmployeeBigBrotherDO extends BaseDO {
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
private Integer fansLevel;
|
||||
}
|
||||
@@ -85,4 +85,6 @@ public class EmployeeHostsDO extends BaseDO {
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -33,4 +33,6 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,4 +66,6 @@ public interface EmployeeHostsService {
|
||||
void batchUpdateEmployeeHosts(List<EmployeeHostsSaveReqVO> updateReqVOList);
|
||||
|
||||
CompletedRateVO getEmployeeHostsCompleteWithSelf(@Valid Long userId);
|
||||
|
||||
List<CompletedRateVO> getEmployeeHostsCompleteBarChart(@Valid List<Long> userId,Integer days);
|
||||
}
|
||||
@@ -1,10 +1,17 @@
|
||||
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;
|
||||
@@ -12,26 +19,17 @@ 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.util.StopWatch;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
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 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 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;
|
||||
|
||||
|
||||
@@ -71,7 +69,7 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
for (EmployeeHostsDO hostsDO : employeeHostsDOS) {
|
||||
hostsDO.setOperationStatus(updateReqVO.getOperationStatus());
|
||||
hostsDO.setRemake(updateReqVO.getRemake());
|
||||
if (updateReqVO.getFlag() != null){
|
||||
if (updateReqVO.getFlag() != null) {
|
||||
hostsDO.setFlag(updateReqVO.getFlag());
|
||||
}
|
||||
}
|
||||
@@ -87,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);
|
||||
@@ -144,10 +142,10 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
.map(NewHostsDO::getHostsId)
|
||||
.collect(Collectors.toList());
|
||||
int update = newHostsMapper.update(lambdaUpdateWrapper
|
||||
.in(NewHostsDO::getHostsId,hostsIds)
|
||||
.in(NewHostsDO::getHostsId, hostsIds)
|
||||
.eq(NewHostsDO::getTenantId, tenantId)
|
||||
.set(NewHostsDO::getIsAssigned, 1));
|
||||
log.info("修改租户:{}下 {} 个主播分配状态,共更新 {} 条记录",tenantId,hostsIds.size(),update);
|
||||
log.info("修改租户:{}下 {} 个主播分配状态,共更新 {} 条记录", tenantId, hostsIds.size(), update);
|
||||
|
||||
// newHostsMapper.updateBatch(newHostsDOArrayList);
|
||||
return i;
|
||||
@@ -159,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
|
||||
@@ -182,5 +180,36 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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,7 +111,8 @@
|
||||
<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,ns.flag 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}
|
||||
<!-- 主播国家筛选 -->
|
||||
@@ -73,10 +122,17 @@
|
||||
<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>
|
||||
@@ -95,6 +151,7 @@
|
||||
#{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}
|
||||
@@ -161,30 +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.update_time ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -195,10 +252,19 @@
|
||||
|
||||
<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,ns.flag
|
||||
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}
|
||||
@@ -207,6 +273,10 @@
|
||||
<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>
|
||||
@@ -214,8 +284,13 @@
|
||||
<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 ">
|
||||
@@ -298,30 +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.update_time ${req.sort},ns.id ${req.sort}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
@@ -355,4 +430,24 @@
|
||||
</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,7 +12,7 @@
|
||||
|
||||
<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
|
||||
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}
|
||||
@@ -35,6 +35,10 @@
|
||||
<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}
|
||||
@@ -103,7 +107,6 @@
|
||||
<if test="req.invitationType != null">
|
||||
and ns.Invitation_type =#{req.invitationType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<!-- 排序类型 -->
|
||||
<!-- 排序类型 -->
|
||||
group by
|
||||
ns.hosts_id
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.tenantpoints;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.tenantpoints.TenantPointsDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenantpoints.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 租户积分记录 Mapper
|
||||
*
|
||||
* @author 总后台
|
||||
*/
|
||||
@Mapper
|
||||
public interface TenantPointsMapper extends BaseMapperX<TenantPointsDO> {
|
||||
|
||||
default PageResult<TenantPointsDO> selectPage(TenantPointsPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantPointsDO>()
|
||||
.eqIfPresent(TenantPointsDO::getPoints, reqVO.getPoints())
|
||||
.eqIfPresent(TenantPointsDO::getBalance, reqVO.getBalance())
|
||||
.eqIfPresent(TenantPointsDO::getType, reqVO.getType())
|
||||
.eqIfPresent(TenantPointsDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(TenantPointsDO::getOrderId, reqVO.getOrderId())
|
||||
.eqIfPresent(TenantPointsDO::getBizNo, reqVO.getBizNo())
|
||||
.eqIfPresent(TenantPointsDO::getOperatorId, reqVO.getOperatorId())
|
||||
.eqIfPresent(TenantPointsDO::getTargetTenantId, reqVO.getTargetTenantId())
|
||||
.eqIfPresent(TenantPointsDO::getCreatedAt, reqVO.getCreatedAt())
|
||||
.orderByDesc(TenantPointsDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<TenantPointsDO> TenantTransactionHistoryPointsPage(PageParam pageReqVO, Long tenantId){
|
||||
return selectPage(pageReqVO, new LambdaQueryWrapperX<TenantPointsDO>()
|
||||
.eq(TenantPointsDO::getTenantId, tenantId)
|
||||
.orderByDesc(TenantPointsDO::getCreatedAt));
|
||||
}
|
||||
|
||||
default PageResult<TenantPointsDO> selectPageWithTenantId(TenantPointsPageReqVO reqVO, Long tenantId) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantPointsDO>()
|
||||
.eq(TenantPointsDO::getTenantId, tenantId)
|
||||
.eqIfPresent(TenantPointsDO::getPoints, reqVO.getPoints())
|
||||
.eqIfPresent(TenantPointsDO::getBalance, reqVO.getBalance())
|
||||
.eqIfPresent(TenantPointsDO::getType, reqVO.getType())
|
||||
.eqIfPresent(TenantPointsDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(TenantPointsDO::getOrderId, reqVO.getOrderId())
|
||||
.eqIfPresent(TenantPointsDO::getBizNo, reqVO.getBizNo())
|
||||
.eqIfPresent(TenantPointsDO::getOperatorId, reqVO.getOperatorId())
|
||||
.eqIfPresent(TenantPointsDO::getTargetTenantId, reqVO.getTargetTenantId())
|
||||
.eqIfPresent(TenantPointsDO::getCreatedAt, reqVO.getCreatedAt())
|
||||
.orderByDesc(TenantPointsDO::getId));
|
||||
}
|
||||
|
||||
IPage<TenantPointsPageRespVO> selectPageWithXML(@Param("iPage") IPage<TenantPointsPageRespVO> iPage, @Param("pageReqVO") TenantPointsPageReqVO pageReqVO);
|
||||
|
||||
IPage<TenantPointsPageRespVO> selectPageWithTenantIdXML(@Param("iPage")IPage<TenantPointsPageRespVO> iPage,@Param("pageReqVO") TenantPointsPageReqVO pageReqVO,@Param("tenantId") Long tenantId);
|
||||
}
|
||||
@@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.system.dal.mysql.user;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -18,6 +20,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
return selectOne(AdminUserDO::getUsername, username);
|
||||
}
|
||||
|
||||
|
||||
default AdminUserDO selectByUsernameAndTenantId(String username,Long tenantId) {
|
||||
return selectOne(AdminUserDO::getUsername, username
|
||||
,AdminUserDO::getTenantId, tenantId);
|
||||
@@ -62,4 +65,10 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
}
|
||||
|
||||
List<UserRespVO> selectTenantUserById(Long tenantId);
|
||||
|
||||
@TenantIgnore
|
||||
AdminUserDO selectByUsernameAndTenantIdWithAgencyRenewal(@Param("initialUser") String initialUser,@Param("targetTenantId") Long targetTenantId);
|
||||
|
||||
@TenantIgnore
|
||||
int updateByIdWithRenwal(AdminUserDO targetTenantUser);
|
||||
}
|
||||
|
||||
@@ -109,25 +109,47 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode TENANT_CAN_NOT_UPDATE_SYSTEM = new ErrorCode(1_002_015_003, "系统租户不能进行修改、删除等操作!");
|
||||
ErrorCode TENANT_NAME_DUPLICATE = new ErrorCode(1_002_015_004, "名字为【{}】的租户已存在");
|
||||
ErrorCode TENANT_WEBSITE_DUPLICATE = new ErrorCode(1_002_015_005, "域名为【{}】的租户已存在");
|
||||
ErrorCode TENANT_LEVEL_CANT_CREATE_AGENCY = new ErrorCode(1_002_015_006, "租户级别不能创建代理租户");
|
||||
|
||||
|
||||
// ========== 租户套餐 1-002-016-000 ==========
|
||||
ErrorCode TENANT_PACKAGE_NOT_EXISTS = new ErrorCode(1_002_016_000, "租户套餐不存在");
|
||||
ErrorCode TENANT_PACKAGE_USED = new ErrorCode(1_002_016_001, "租户正在使用该套餐,请给租户重新设置套餐后再尝试删除");
|
||||
ErrorCode TENANT_PACKAGE_DISABLE = new ErrorCode(1_002_016_002, "名字为【{}】的租户套餐已被禁用");
|
||||
ErrorCode TENANT_PACKAGE_NAME_DUPLICATE = new ErrorCode(1_002_016_003, "已经存在该名字的租户套餐");
|
||||
ErrorCode TENANT_USER_NOT_EXISTS = new ErrorCode(1_002_016_004, "租户初始用户不存在");
|
||||
|
||||
// ========== 租户套餐 1-002-017-000 ==========
|
||||
ErrorCode TENANT_POINTS_NOT_EXISTS = new ErrorCode(1_002_017_000, "租户积分不存在");
|
||||
|
||||
// ========== 租户余额 1-003-017-000 ==========
|
||||
ErrorCode TENANT_BALANCE_NOT_EXISTS = new ErrorCode(1_003_017_000, "租户余额不存在");
|
||||
ErrorCode TENANT_BALANCE_VERSION_ERROR = new ErrorCode(1_003_017_001, "租户余额版本号错误");
|
||||
ErrorCode TENANT_BALANCE_BALANCE_ERROR = new ErrorCode(1_003_017_002, "租户余额余额错误");
|
||||
ErrorCode TENANT_BALANCE_BALANCE_NOT_ENOUGH = new ErrorCode(1_003_017_003, "租户余额余额不足");
|
||||
ErrorCode TENANT_BALANCE_RECHARGE_ERROR = new ErrorCode(1_003_017_004, "租户余额充值错误");
|
||||
ErrorCode TENANT_WALLET_NOT_EXISTS = new ErrorCode(1_003_017_005, "租户钱包不存在");
|
||||
ErrorCode TENANT_BALANCE_NOT_ENOUGH = new ErrorCode(1_003_017_006, "当前余额余额不足");
|
||||
ErrorCode TENANT_BALANCE_TRANSFER_ERROR = new ErrorCode(1_003_017_007, "转账余额不能小于等与 0");
|
||||
ErrorCode TENANT_BALANCE_TRANSFER_TARGET_NOT_EXISTS = new ErrorCode(1_003_017_008, "转账目标租户钱包不存在");
|
||||
ErrorCode TENANT_BALANCE_TRANSFER_OPERATION_ERROR = new ErrorCode(1_003_017_009, "转账操作失败");
|
||||
ErrorCode TENANT_BALANCE_TRANSFER_PASSWORD_ERROR = new ErrorCode(1_003_017_010, "转账密码错误");
|
||||
ErrorCode TENANT_BALANCE_TRANSFER_PASSWORD_ERROR_IS_NULL = new ErrorCode(1_003_017_011, "转账密码不能为空");
|
||||
ErrorCode TENANT_BALANCE_TRANSFER_ERROR_TARGET_NOT_SUBORDINATE = new ErrorCode(1_003_017_012, "转账目标租户不是当前租户的下级");
|
||||
ErrorCode TENANT_BALANCE_CONSUMPTION_OPERATION_ERROR = new ErrorCode(1_003_017_013, "租户余额消费操作失败");
|
||||
ErrorCode TENANT_CREATE_FAIL = new ErrorCode(1_003_017_014, "租户创建失败");
|
||||
ErrorCode TENANT_BALANCE_TEST_ACCOUNT_NUM_NOT_ENOUGH = new ErrorCode(1_003_017_015, "当前账户测试账户数量不足");
|
||||
ErrorCode TENANT_BALANCE_TEST_ACCOUNT_NUM_OPERATION_ERROR = new ErrorCode(1_003_017_016, "租户测试账户数量操作错误");
|
||||
ErrorCode TENANT_IS_AGENCY = new ErrorCode(1_003_017_017, "代理租户,不能进行续费操作");
|
||||
ErrorCode TENANT_UPDATE_INITIAL_USER_INFO_FAIL = new ErrorCode(1_003_017_018, "更新租户初始用户信息失败");
|
||||
ErrorCode TENANT_RENEWAL_FAIL = new ErrorCode(1_003_017_019, "租户续费失败");
|
||||
|
||||
// ================= 租户套餐 1-003-018-000 ==================
|
||||
ErrorCode TENANT_AGENCY_PACKAGE_NOT_EXISTS = new ErrorCode(1_003_018_000, "代理租户套餐不存在");
|
||||
|
||||
|
||||
|
||||
// ========== 社交用户 1-002-018-000 ==========
|
||||
ErrorCode SOCIAL_USER_AUTH_FAILURE = new ErrorCode(1_002_018_000, "社交授权失败,原因是:{}");
|
||||
ErrorCode SOCIAL_USER_NOT_FOUND = new ErrorCode(1_002_018_001, "社交授权失败,找不到对应的用户");
|
||||
|
||||
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_PHONE_CODE_ERROR = new ErrorCode(1_002_018_200, "获得手机号失败");
|
||||
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_QRCODE_ERROR = new ErrorCode(1_002_018_201, "获得小程序码失败");
|
||||
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_SUBSCRIBE_TEMPLATE_ERROR = new ErrorCode(1_002_018_202, "获得小程序订阅消息模版失败");
|
||||
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_SUBSCRIBE_MESSAGE_ERROR = new ErrorCode(1_002_018_203, "发送小程序订阅消息失败");
|
||||
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_ORDER_UPLOAD_SHIPPING_INFO_ERROR = new ErrorCode(1_002_018_204, "上传微信小程序发货信息失败");
|
||||
ErrorCode SOCIAL_CLIENT_WEIXIN_MINI_APP_ORDER_NOTIFY_CONFIRM_RECEIVE_ERROR = new ErrorCode(1_002_018_205, "上传微信小程序订单收货信息失败");
|
||||
ErrorCode SOCIAL_CLIENT_NOT_EXISTS = new ErrorCode(1_002_018_210, "社交客户端不存在");
|
||||
ErrorCode SOCIAL_CLIENT_UNIQUE = new ErrorCode(1_002_018_211, "社交客户端已存在配置");
|
||||
|
||||
// ========== OAuth2 客户端 1-002-020-000 =========
|
||||
ErrorCode OAUTH2_CLIENT_NOT_EXISTS = new ErrorCode(1_002_020_000, "OAuth2 客户端不存在");
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.system.enums.agencyTenantPackage;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/25 15:22
|
||||
*/
|
||||
@Getter
|
||||
public enum PackageTypeEnum {
|
||||
|
||||
AI(0, "AI"),
|
||||
CRAWL(1, "爬虫"),
|
||||
BROTHER_CRAWL(2, "兄弟爬虫"),
|
||||
TEST(99, "测试账户"),
|
||||
AGENCY(999, "代理");
|
||||
|
||||
private final Integer value;
|
||||
private final String name;
|
||||
|
||||
PackageTypeEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.system.enums.balance;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/19 21:30
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public enum BalanceEnum {
|
||||
|
||||
|
||||
RECHARGE("充值"),
|
||||
TRANSFER_OUT("转出"),
|
||||
TRANSFER_IN("转入"),
|
||||
CONSUMPTION("消费"),
|
||||
BONUS("奖励");
|
||||
|
||||
|
||||
private String desc;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.enums.tenant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/*
|
||||
* @author: ziin
|
||||
* @date: 2025/11/21 18:55
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public enum TenantEnum {
|
||||
|
||||
|
||||
AGENCY("代理"),
|
||||
USER("用户");
|
||||
|
||||
|
||||
private String tenantType;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package cn.iocoder.yudao.module.system.job;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 禁用过期账号定时任务处理器
|
||||
* <p>
|
||||
* 该类用于定时检查并禁用已过期的AI账号和大哥账号。
|
||||
* 通过查询租户表中已过期的账号,然后将对应用户的权限状态更新为禁用。
|
||||
* </p>
|
||||
*
|
||||
* @author ziin
|
||||
* @date 2025/9/16 14:35
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DisableAIExpiredAccount implements JobHandler{
|
||||
|
||||
/**
|
||||
* 租户数据访问对象
|
||||
* 用于查询租户信息和过期时间
|
||||
*/
|
||||
@Resource
|
||||
TenantMapper tenantMapper;
|
||||
|
||||
/**
|
||||
* 管理员用户数据访问对象
|
||||
* 用于查询和更新用户权限状态
|
||||
*/
|
||||
@Resource
|
||||
private AdminUserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 执行禁用过期账号的定时任务
|
||||
* <p>
|
||||
* 该方法会执行以下操作:
|
||||
* 1. 查询所有AI账号已过期的租户
|
||||
* 2. 查询所有大哥账号已过期的租户
|
||||
* 3. 分别禁用这些租户下的用户对应权限
|
||||
* 4. 返回操作结果统计信息
|
||||
* </p>
|
||||
*
|
||||
* @param param 任务参数(当前未使用)
|
||||
* @return 操作结果字符串,包含禁用的AI账号和大哥账号数量
|
||||
* @throws Exception 执行过程中可能抛出的异常
|
||||
*/
|
||||
@Override
|
||||
@TenantJob
|
||||
public String execute(String param) throws Exception {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
TenantDO tenant = tenantMapper.selectById(tenantId);
|
||||
if (tenant.getAiExpireTime()!=null) {
|
||||
Duration brotherDuration = LocalDateTimeUtil.between(tenant.getAiExpireTime(), LocalDateTime.now());
|
||||
long minutes = brotherDuration.toMinutes();
|
||||
LambdaQueryWrapper<AdminUserDO> aiUserQueryWrapper = new LambdaQueryWrapper<>();
|
||||
aiUserQueryWrapper.eq(AdminUserDO::getTenantId, tenantId);
|
||||
aiUserQueryWrapper.eq(AdminUserDO::getAiChat, 1);
|
||||
List<AdminUserDO> aiUserList = userMapper.selectList(aiUserQueryWrapper);
|
||||
int aiAccountNum = 0 ;
|
||||
if (minutes >= 0) {
|
||||
for (AdminUserDO adminUserDO : aiUserList) {
|
||||
adminUserDO.setAiChat((byte) 0);
|
||||
userMapper.updateById(adminUserDO);
|
||||
aiAccountNum++;
|
||||
log.info("禁用过期AI账号,账号ID:{}", adminUserDO.getId());
|
||||
}
|
||||
}
|
||||
// 返回操作结果:包含禁用的AI账号和大哥账号数量统计
|
||||
return "禁用过期账号成功,禁用了 " + aiAccountNum + " 个 AI 账号。";
|
||||
}
|
||||
return "租户未配置过期时间";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package cn.iocoder.yudao.module.system.job;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 禁用过期账号定时任务处理器
|
||||
* <p>
|
||||
* 该类用于定时检查并禁用已过期的AI账号和大哥账号。
|
||||
* 通过查询租户表中已过期的账号,然后将对应用户的权限状态更新为禁用。
|
||||
* </p>
|
||||
*
|
||||
* @author ziin
|
||||
* @date 2025/9/16 14:35
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DisableBrotherExpiredAccount implements JobHandler {
|
||||
|
||||
/**
|
||||
* 租户数据访问对象
|
||||
* 用于查询租户信息和过期时间
|
||||
*/
|
||||
@Resource
|
||||
TenantMapper tenantMapper;
|
||||
|
||||
/**
|
||||
* 管理员用户数据访问对象
|
||||
* 用于查询和更新用户权限状态
|
||||
*/
|
||||
@Resource
|
||||
private AdminUserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 执行禁用过期账号的定时任务
|
||||
* <p>
|
||||
* 该方法会执行以下操作:
|
||||
* 1. 查询所有AI账号已过期的租户
|
||||
* 2. 查询所有大哥账号已过期的租户
|
||||
* 3. 分别禁用这些租户下的用户对应权限
|
||||
* 4. 返回操作结果统计信息
|
||||
* </p>
|
||||
*
|
||||
* @param param 任务参数(当前未使用)
|
||||
* @return 操作结果字符串,包含禁用的AI账号和大哥账号数量
|
||||
* @throws Exception 执行过程中可能抛出的异常
|
||||
*/
|
||||
@Override
|
||||
@TenantJob
|
||||
/**
|
||||
* 执行禁用过期大哥账号的定时任务
|
||||
* @param param 任务参数(未使用)
|
||||
* @return 执行结果信息
|
||||
* @throws Exception 执行过程中可能抛出的异常
|
||||
*/
|
||||
public String execute(String param) throws Exception {
|
||||
// 获取当前租户ID
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
// 查询当前租户信息
|
||||
TenantDO tenant = tenantMapper.selectById(tenantId);
|
||||
|
||||
// 检查租户是否配置了大哥账号过期时间,如未配置则直接返回提示
|
||||
if (tenant.getBrotherExpireTime() == null) {
|
||||
return "租户未配置大哥过期时间";
|
||||
}
|
||||
|
||||
// 计算从租户设置的过期时间到当前时间的时间差
|
||||
Duration brotherDuration = LocalDateTimeUtil.between(tenant.getBrotherExpireTime(), LocalDateTime.now());
|
||||
// 转换为分钟数
|
||||
long minutes = brotherDuration.toMinutes();
|
||||
|
||||
// 创建查询条件,查找当前租户下的所有大哥账号
|
||||
LambdaQueryWrapper<AdminUserDO> brotherUserQueryWrapper = new LambdaQueryWrapper<>();
|
||||
brotherUserQueryWrapper.eq(AdminUserDO::getTenantId, tenantId);
|
||||
brotherUserQueryWrapper.eq(AdminUserDO::getBigBrother, 1);
|
||||
|
||||
// 查询符合条件的大哥账号列表
|
||||
List<AdminUserDO> aiUserList = userMapper.selectList(brotherUserQueryWrapper);
|
||||
|
||||
// 统计被禁用的大哥账号数量
|
||||
int brotherAccountNum = 0;
|
||||
|
||||
// 如果已过过期时间(minutes >= 0表示当前时间已超过过期时间)
|
||||
if (minutes >= 0) {
|
||||
// 遍历所有大哥账号进行禁用操作
|
||||
for (AdminUserDO adminUserDO : aiUserList) {
|
||||
// 将BigBrother标志设置为0,表示禁用大哥权限
|
||||
adminUserDO.setBigBrother((byte) 0);
|
||||
// 更新用户信息到数据库
|
||||
userMapper.updateById(adminUserDO);
|
||||
// 更新统计计数
|
||||
brotherAccountNum++;
|
||||
// 记录禁用操作日志
|
||||
log.info("禁用过期大哥账号,账号ID:{}", adminUserDO.getId());
|
||||
}
|
||||
}
|
||||
// 返回操作结果:包含禁用的大哥账号数量统计
|
||||
return "禁用过期账号成功,禁用了 " + brotherAccountNum + " 个 大哥账号。";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.system.job;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 禁用过期账号定时任务处理器
|
||||
* <p>
|
||||
* 该类用于定时检查并禁用已过期的AI账号和大哥账号。
|
||||
* 通过查询租户表中已过期的账号,然后将对应用户的权限状态更新为禁用。
|
||||
* </p>
|
||||
*
|
||||
* @author ziin
|
||||
* @date 2025/9/16 14:35
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DisableCrawlExpiredAccount implements JobHandler{
|
||||
|
||||
/**
|
||||
* 租户数据访问对象
|
||||
* 用于查询租户信息和过期时间
|
||||
*/
|
||||
@Resource
|
||||
TenantMapper tenantMapper;
|
||||
|
||||
/**
|
||||
* 管理员用户数据访问对象
|
||||
* 用于查询和更新用户权限状态
|
||||
*/
|
||||
@Resource
|
||||
private AdminUserMapper userMapper;
|
||||
|
||||
/**
|
||||
* 执行禁用过期账号的定时任务
|
||||
* <p>
|
||||
* 该方法会执行以下操作:
|
||||
* 1. 查询所有AI账号已过期的租户
|
||||
* 2. 查询所有大哥账号已过期的租户
|
||||
* 3. 分别禁用这些租户下的用户对应权限
|
||||
* 4. 返回操作结果统计信息
|
||||
* </p>
|
||||
*
|
||||
* @param param 任务参数(当前未使用)
|
||||
* @return 操作结果字符串,包含禁用的AI账号和大哥账号数量
|
||||
* @throws Exception 执行过程中可能抛出的异常
|
||||
*/
|
||||
@Override
|
||||
@TenantJob
|
||||
public String execute(String param) throws Exception {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
TenantDO tenant = tenantMapper.selectById(tenantId);
|
||||
if (tenant.getExpireTime()!=null) {
|
||||
Duration brotherDuration = LocalDateTimeUtil.between(tenant.getExpireTime(), LocalDateTime.now());
|
||||
long minutes = brotherDuration.toMinutes();
|
||||
LambdaQueryWrapper<AdminUserDO> aiUserQueryWrapper = new LambdaQueryWrapper<>();
|
||||
aiUserQueryWrapper.eq(AdminUserDO::getTenantId, tenantId);
|
||||
aiUserQueryWrapper.eq(AdminUserDO::getCrawl, 1);
|
||||
List<AdminUserDO> aiUserList = userMapper.selectList(aiUserQueryWrapper);
|
||||
int aiAccountNum = 0 ;
|
||||
if (minutes >= 0) {
|
||||
for (AdminUserDO adminUserDO : aiUserList) {
|
||||
adminUserDO.setCrawl((byte) 0);
|
||||
userMapper.updateById(adminUserDO);
|
||||
aiAccountNum++;
|
||||
log.info("禁用过期爬虫账号,账号ID:{}", adminUserDO.getId());
|
||||
}
|
||||
}
|
||||
// 返回操作结果:包含禁用的AI账号和大哥账号数量统计
|
||||
return "禁用过期账号成功,禁用了 " + aiAccountNum + " 个 爬虫 账号。";
|
||||
}
|
||||
return "租户未配置过期时间";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package cn.iocoder.yudao.module.system.job;
|
||||
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;/*
|
||||
* @author: ziin
|
||||
* @date: 2025/12/11 20:55
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DisableWebAIExpiredAccount implements JobHandler{
|
||||
|
||||
/**
|
||||
* 租户数据访问对象
|
||||
* 用于查询租户信息和过期时间
|
||||
*/
|
||||
@Resource
|
||||
TenantMapper tenantMapper;
|
||||
|
||||
/**
|
||||
* 管理员用户数据访问对象
|
||||
* 用于查询和更新用户权限状态
|
||||
*/
|
||||
@Resource
|
||||
private AdminUserMapper userMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@TenantJob
|
||||
public String execute(String param) throws Exception {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
TenantDO tenant = tenantMapper.selectById(tenantId);
|
||||
if (tenant.getExpireTime()!=null) {
|
||||
Duration brotherDuration = LocalDateTimeUtil.between(tenant.getAiExpireTime(), LocalDateTime.now());
|
||||
long minutes = brotherDuration.toMinutes();
|
||||
LambdaQueryWrapper<AdminUserDO> aiUserQueryWrapper = new LambdaQueryWrapper<>();
|
||||
aiUserQueryWrapper.eq(AdminUserDO::getTenantId, tenantId);
|
||||
aiUserQueryWrapper.eq(AdminUserDO::getWebAi, 1);
|
||||
List<AdminUserDO> aiUserList = userMapper.selectList(aiUserQueryWrapper);
|
||||
int aiAccountNum = 0 ;
|
||||
if (minutes >= 0) {
|
||||
for (AdminUserDO adminUserDO : aiUserList) {
|
||||
adminUserDO.setWebAi((byte) 0);
|
||||
userMapper.updateById(adminUserDO);
|
||||
aiAccountNum++;
|
||||
log.info("禁用过期WebAI账号,账号ID:{}", adminUserDO.getId());
|
||||
}
|
||||
}
|
||||
// 返回操作结果:包含禁用的AI账号和大哥账号数量统计
|
||||
return "禁用过期账号成功,禁用了 " + aiAccountNum + " 个 WebAI 账号。";
|
||||
}
|
||||
return "租户未配置过期时间";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackagePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenantagencypackage.TenantAgencyPackageDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
@@ -67,6 +68,6 @@ public interface TenantPackageService {
|
||||
* @param status 状态
|
||||
* @return 租户套餐
|
||||
*/
|
||||
List<TenantPackageDO> getTenantPackageListByStatus(Integer status);
|
||||
List<TenantAgencyPackageDO> getTenantPackageListByStatus(Integer status);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
package cn.iocoder.yudao.module.system.service.tenant;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackagePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.packages.TenantPackageSimpleRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
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.dal.mysql.tenant.TenantPackageMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.tenantagencypackage.TenantAgencyPackageMapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
@@ -38,6 +43,9 @@ public class TenantPackageServiceImpl implements TenantPackageService {
|
||||
@Lazy // 避免循环依赖的报错
|
||||
private TenantService tenantService;
|
||||
|
||||
@Resource
|
||||
private TenantAgencyPackageMapper tenantAgencyPackageMapper;
|
||||
|
||||
@Override
|
||||
public Long createTenantPackage(TenantPackageSaveReqVO createReqVO) {
|
||||
// 校验套餐名是否重复
|
||||
@@ -113,8 +121,14 @@ public class TenantPackageServiceImpl implements TenantPackageService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TenantPackageDO> getTenantPackageListByStatus(Integer status) {
|
||||
return tenantPackageMapper.selectListByStatus(status);
|
||||
public List<TenantAgencyPackageDO> getTenantPackageListByStatus(Integer status) {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
if (tenantId != 1) {
|
||||
return tenantAgencyPackageMapper.selectListByStatus(status);
|
||||
}
|
||||
List<TenantPackageDO> tenantPackageDOS = tenantPackageMapper.selectListByStatus(status);
|
||||
return BeanUtils.toBean(tenantPackageDOS, TenantAgencyPackageDO.class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.tenant;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantRenewalReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.TenantSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.service.tenant.handler.TenantInfoHandler;
|
||||
@@ -135,4 +136,9 @@ public interface TenantService {
|
||||
*/
|
||||
void validTenant(Long id);
|
||||
|
||||
PageResult<TenantDO> getSelfTenantPage(@Valid TenantPageReqVO pageVO);
|
||||
|
||||
List<TenantDO> getChildrenTenant(Long id);
|
||||
|
||||
void renewalTenant( TenantRenewalReqVO updateReqVO);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user