docs: swagger docs refacto & perf
This commit is contained in:
@@ -13,6 +13,11 @@ import com.starry.admin.modules.statistics.module.vo.PlayClerkPerformanceInfoQue
|
||||
import com.starry.admin.modules.statistics.module.vo.PlayClerkPerformanceInfoReturnVo;
|
||||
import com.starry.admin.modules.statistics.service.IPlayClerkPerformanceService;
|
||||
import com.starry.common.result.R;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
import io.swagger.annotations.ApiResponses;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -34,6 +39,7 @@ import java.util.stream.Collectors;
|
||||
* @author admin
|
||||
* @since 2024/6/15 下午3:15
|
||||
**/
|
||||
@Api(tags = "店员业绩统计", description = "店员业绩统计相关接口,包括按日期、月份查询等操作")
|
||||
@RestController
|
||||
@RequestMapping("/statistics/performance")
|
||||
public class PlayClerkPerformanceController {
|
||||
@@ -54,8 +60,12 @@ public class PlayClerkPerformanceController {
|
||||
private IPlayClerkPerformanceService playClerkPerformanceService;
|
||||
|
||||
|
||||
@ApiOperation(value = "分页查询店员业绩", notes = "分页查询店员业绩统计信息")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "操作成功", response = PlayClerkPerformanceInfoReturnVo.class, responseContainer = "Page")
|
||||
})
|
||||
@PostMapping("/listByPage")
|
||||
public R listByPage(@Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
||||
public R listByPage(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
||||
IPage<PlayClerkUserInfoEntity> page = clerkUserInfoService.selectByPage(vo);
|
||||
IPage<PlayClerkPerformanceInfoReturnVo> voPage = page.convert(u -> {
|
||||
List<PlayClerkLevelInfoEntity> clerkLevelInfoEntity = playClerkLevelInfoService.selectAll();
|
||||
@@ -70,8 +80,12 @@ public class PlayClerkPerformanceController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "按日查询业绩", notes = "按日期查询店员业绩统计信息")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "操作成功")
|
||||
})
|
||||
@PostMapping("/listByTime")
|
||||
public R listByTime(@Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
||||
public R listByTime(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
||||
//时间范围
|
||||
List<String> dates = getDateRangeByDay(vo.getEndOrderTime().get(0), vo.getEndOrderTime().get(1));
|
||||
//指定时间内所有订单
|
||||
@@ -89,8 +103,12 @@ public class PlayClerkPerformanceController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "按月查询业绩", notes = "按月份查询店员业绩统计信息")
|
||||
@ApiResponses({
|
||||
@ApiResponse(code = 200, message = "操作成功")
|
||||
})
|
||||
@PostMapping("/listByMonth")
|
||||
public R listByMonth(@Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
||||
public R listByMonth(@ApiParam(value = "查询条件", required = true) @Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
||||
String startTime = LocalDate.of(Integer.parseInt(vo.getEndOrderTime().get(0).split("-")[0]), Integer.parseInt(vo.getEndOrderTime().get(0).split("-")[1]), 1).toString() + " 00:00:00";
|
||||
LocalDate endDate = LocalDate.of(Integer.parseInt(vo.getEndOrderTime().get(1).split("-")[0]), Integer.parseInt(vo.getEndOrderTime().get(1).split("-")[1]), 1);
|
||||
String endTime = endDate.with(TemporalAdjusters.lastDayOfMonth()) + " 23:59:59";
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.starry.admin.modules.statistics.module.vo;
|
||||
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -12,37 +14,44 @@ import java.util.List;
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@ApiModel(value = "店员业绩查询参数", description = "查询店员业绩统计信息的条件参数")
|
||||
public class PlayClerkPerformanceInfoQueryVo extends BasePageEntity {
|
||||
|
||||
/**
|
||||
* 分组ID
|
||||
*/
|
||||
@ApiModelProperty(value = "分组ID", example = "1", notes = "店员所属分组ID")
|
||||
private String groupId;
|
||||
|
||||
|
||||
/**
|
||||
* 店员ID
|
||||
*/
|
||||
@ApiModelProperty(value = "店员ID", example = "1", notes = "店员ID")
|
||||
private String clerkId;
|
||||
|
||||
|
||||
/**
|
||||
* 店员性别
|
||||
*/
|
||||
@ApiModelProperty(value = "店员性别", example = "1", notes = "店员性别,1男2女")
|
||||
private String sex;
|
||||
|
||||
|
||||
/**
|
||||
* 店员上架状态
|
||||
*/
|
||||
@ApiModelProperty(value = "上架状态", example = "1", notes = "店员上架状态,1上架0下架")
|
||||
private String listingState;
|
||||
|
||||
/**
|
||||
* 订单状态ID
|
||||
*/
|
||||
@ApiModelProperty(value = "订单状态", example = "[\"1\",\"2\"]", notes = "订单状态ID列表")
|
||||
private List<String> orderStatus;
|
||||
/**
|
||||
* 完成订单时间
|
||||
*/
|
||||
@ApiModelProperty(value = "订单时间范围", example = "[\"2024-01-01 00:00:00\",\"2024-12-31 23:59:59\"]", notes = "订单开始和结束时间")
|
||||
private List<String> endOrderTime;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.starry.admin.modules.statistics.module.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -9,124 +11,152 @@ import java.math.BigDecimal;
|
||||
* @since 2024/6/10 下午8:58
|
||||
**/
|
||||
@Data
|
||||
@ApiModel(value = "店员业绩返回数据", description = "店员业绩统计信息的返回数据")
|
||||
public class PlayClerkPerformanceInfoReturnVo {
|
||||
|
||||
|
||||
/**
|
||||
* 店员ID
|
||||
*/
|
||||
@ApiModelProperty(value = "店员ID", example = "1")
|
||||
private String clerkId;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "店员昵称", example = "张三")
|
||||
private String clerkNickname;
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
@ApiModelProperty(value = "店员性别", example = "1", notes = "1男2女")
|
||||
private String clerkSex;
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
@ApiModelProperty(value = "分组名称", example = "销售组")
|
||||
private String groupName = "";
|
||||
/**
|
||||
* 分组名称
|
||||
*/
|
||||
@ApiModelProperty(value = "等级名称", example = "初级")
|
||||
private String levelName = "";
|
||||
/**
|
||||
* 在线时长
|
||||
*/
|
||||
@ApiModelProperty(value = "在线时长", example = "120", notes = "单位:分钟")
|
||||
private Integer onlineDuration = 0;
|
||||
/**
|
||||
* 订单总数
|
||||
*/
|
||||
@ApiModelProperty(value = "订单总数", example = "10")
|
||||
private Integer orderNumber = 0;
|
||||
/**
|
||||
* 首单数
|
||||
*/
|
||||
@ApiModelProperty(value = "首单数", example = "5")
|
||||
private Integer orderFirstNumber = 0;
|
||||
/**
|
||||
* 续单数
|
||||
*/
|
||||
@ApiModelProperty(value = "续单数", example = "5")
|
||||
private Integer orderContinueNumber = 0;
|
||||
/**
|
||||
* 退款单数
|
||||
*/
|
||||
@ApiModelProperty(value = "退款单数", example = "1")
|
||||
private Integer orderRefundNumber = 0;
|
||||
/**
|
||||
* 超时未接单数
|
||||
*/
|
||||
@ApiModelProperty(value = "超时未接单数", example = "1")
|
||||
private Integer ordersExpiredNumber = 0;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
@ApiModelProperty(value = "订单金额", example = "1000.00")
|
||||
private BigDecimal orderMoney;
|
||||
|
||||
/**
|
||||
* 订单最终金额(支付金额)
|
||||
*/
|
||||
@ApiModelProperty(value = "支付金额", example = "900.00", notes = "订单最终金额(支付金额)")
|
||||
private BigDecimal finalAmount = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 充值金额
|
||||
*/
|
||||
@ApiModelProperty(value = "充值金额", example = "500.00")
|
||||
private BigDecimal rechargeAmount = BigDecimal.ZERO;
|
||||
/**
|
||||
* 首单金额
|
||||
*/
|
||||
@ApiModelProperty(value = "首单金额", example = "300.00")
|
||||
private BigDecimal orderFirstAmount = BigDecimal.ZERO;
|
||||
/**
|
||||
* 续单金额
|
||||
*/
|
||||
@ApiModelProperty(value = "续单金额", example = "600.00")
|
||||
private BigDecimal orderTotalAmount = BigDecimal.ZERO;
|
||||
/**
|
||||
* 打赏金额
|
||||
*/
|
||||
@ApiModelProperty(value = "打赏金额", example = "100.00")
|
||||
private BigDecimal orderRewardAmount = BigDecimal.ZERO;
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
@ApiModelProperty(value = "退款金额", example = "50.00")
|
||||
private BigDecimal orderRefundAmount = BigDecimal.ZERO;
|
||||
/**
|
||||
* 用户数
|
||||
*/
|
||||
@ApiModelProperty(value = "用户数", example = "8")
|
||||
private Integer customNumber = 0;
|
||||
|
||||
/**
|
||||
* 连续用户数
|
||||
*/
|
||||
private final Integer continuousCustomNumber = 0;
|
||||
@ApiModelProperty(value = "连续用户数", example = "3")
|
||||
private final Integer continuousCustomNumber = 0;
|
||||
/**
|
||||
* 续单比例
|
||||
*/
|
||||
@ApiModelProperty(value = "续单比例", example = "0.5", notes = "续单数/订单总数")
|
||||
private final BigDecimal orderContinueProportion = BigDecimal.ZERO;
|
||||
/**
|
||||
* 订单平均价格
|
||||
*/
|
||||
@ApiModelProperty(value = "订单平均价格", example = "90.00")
|
||||
private final BigDecimal averageUnitPrice = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 续费率
|
||||
*/
|
||||
@ApiModelProperty(value = "续费率", example = "0.6")
|
||||
private BigDecimal orderContinueRechargeProportion = BigDecimal.ZERO;
|
||||
/**
|
||||
* 退单率
|
||||
*/
|
||||
@ApiModelProperty(value = "退单率", example = "0.1")
|
||||
private BigDecimal orderChargebackProportion = BigDecimal.ZERO;
|
||||
/**
|
||||
* 续客率
|
||||
*/
|
||||
@ApiModelProperty(value = "续客率", example = "0.4")
|
||||
private BigDecimal continuousCustomProportion = BigDecimal.ZERO;
|
||||
/**
|
||||
* 店员预计收入
|
||||
*/
|
||||
@ApiModelProperty(value = "预计收入", example = "450.00")
|
||||
private BigDecimal estimatedRevenue = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@ApiModelProperty(value = "统计时间", example = "2024-06-01")
|
||||
private String performanceDate;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user