订单排行
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package com.starry.admin.modules.clerk.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.starry.admin.modules.clerk.module.entity.IPlayClerkRankingInfoQueryVo;
|
||||
import com.starry.admin.modules.clerk.module.entity.IPlayClerkRankingInfoReturnVo;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkRankingInfoEntity;
|
||||
import com.starry.admin.modules.clerk.service.IPlayClerkRankingInfoService;
|
||||
import com.starry.common.annotation.Log;
|
||||
import com.starry.common.enums.BusinessType;
|
||||
import com.starry.common.result.R;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -26,8 +29,8 @@ public class PlayClerkRankingInfoController {
|
||||
* 查询店员排行列表
|
||||
*/
|
||||
@GetMapping("/listByPage")
|
||||
public R list(PlayClerkRankingInfoEntity playClerkRankingInfo) {
|
||||
IPage<PlayClerkRankingInfoEntity> list = playClerkRankingInfoService.selectPlayClerkRankingInfoByPage(playClerkRankingInfo);
|
||||
public R list(@Validated @RequestBody IPlayClerkRankingInfoQueryVo vo) {
|
||||
IPage<IPlayClerkRankingInfoReturnVo> list = playClerkRankingInfoService.selectByPage(vo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.starry.admin.modules.clerk.module.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @since 2024/6/7 上午9:49
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class IPlayClerkRankingInfoQueryVo extends BasePageEntity {
|
||||
|
||||
/**
|
||||
* 日排名还是周排名(0:每日排名;1:每周排名)
|
||||
*/
|
||||
private String weeklyRanking;
|
||||
|
||||
|
||||
/**
|
||||
* 店员ID
|
||||
*/
|
||||
private String clerkId;
|
||||
|
||||
|
||||
/**
|
||||
* 店员性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate settlementDate;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.starry.admin.modules.clerk.module.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.starry.common.domain.BasePageEntity;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @since 2024/6/7 上午9:49
|
||||
**/
|
||||
@Data
|
||||
public class IPlayClerkRankingInfoReturnVo {
|
||||
|
||||
/**
|
||||
* UUID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 店员ID
|
||||
*/
|
||||
private String clerkId;
|
||||
|
||||
|
||||
/**
|
||||
* 店员昵称
|
||||
*/
|
||||
private String clerkNickname;
|
||||
|
||||
/**
|
||||
* 店员分组名称
|
||||
*/
|
||||
private String clerkGroupName;
|
||||
|
||||
|
||||
/**
|
||||
* 排序名次
|
||||
*/
|
||||
private Integer rankingIndex;
|
||||
|
||||
/**
|
||||
* 开始统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate startCountDate;
|
||||
|
||||
/**
|
||||
* 结束统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate endCountDate;
|
||||
|
||||
/**
|
||||
* 订单总数
|
||||
*/
|
||||
private Integer orderNumber;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private BigDecimal orderMoney;
|
||||
|
||||
/**
|
||||
* 续单数
|
||||
*/
|
||||
private Integer orderContinueNumber;
|
||||
|
||||
/**
|
||||
* 续单金额
|
||||
*/
|
||||
private BigDecimal orderContinueMoney;
|
||||
|
||||
/**
|
||||
* 超时未接单数量
|
||||
*/
|
||||
private Integer ordersExpiredNumber = 0;
|
||||
|
||||
/**
|
||||
* 续单比例
|
||||
*/
|
||||
private BigDecimal orderContinueProportion = BigDecimal.ZERO;
|
||||
|
||||
|
||||
/**
|
||||
* 客户数
|
||||
*/
|
||||
private Integer customNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 评价单价
|
||||
*/
|
||||
private BigDecimal averageUnitPrice = BigDecimal.ZERO;
|
||||
/**
|
||||
* 距离前一名相差金额
|
||||
*/
|
||||
private BigDecimal previousMoney;
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate settlementDate;
|
||||
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.starry.admin.modules.clerk.module.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.starry.common.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@@ -35,24 +37,39 @@ public class PlayClerkRankingInfoEntity extends BaseEntity<PlayClerkRankingInfoE
|
||||
*/
|
||||
private String clerkId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否为历史统计(1:是;0:不是)
|
||||
*/
|
||||
private String historicalStatistics;
|
||||
|
||||
/**
|
||||
* 日排名还是周排名(0:每日排名;1:每周排名)
|
||||
*/
|
||||
private String weeklyRanking;
|
||||
|
||||
/**
|
||||
* 统计批次
|
||||
*/
|
||||
private Integer serialNumber;
|
||||
|
||||
/**
|
||||
* 排序名词
|
||||
* 排序名次
|
||||
*/
|
||||
private Integer rankingIndex;
|
||||
|
||||
/**
|
||||
* 开始统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate startCountDate;
|
||||
|
||||
/**
|
||||
* 结束统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate endCountDate;
|
||||
|
||||
/**
|
||||
@@ -86,5 +103,12 @@ public class PlayClerkRankingInfoEntity extends BaseEntity<PlayClerkRankingInfoE
|
||||
*/
|
||||
private BigDecimal previousMoney;
|
||||
|
||||
/**
|
||||
* 统计时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
private LocalDate settlementDate;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.starry.admin.modules.clerk.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.starry.admin.modules.clerk.module.entity.IPlayClerkRankingInfoQueryVo;
|
||||
import com.starry.admin.modules.clerk.module.entity.IPlayClerkRankingInfoReturnVo;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkRankingInfoEntity;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderHistoryRankingReturnVo;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderRankingReturnVo;
|
||||
@@ -16,6 +18,15 @@ import java.util.List;
|
||||
* @since 2024-05-25
|
||||
*/
|
||||
public interface IPlayClerkRankingInfoService extends IService<PlayClerkRankingInfoEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询店员排行
|
||||
* @param vo 店员排行查询对象
|
||||
* @return 店员排查询对象
|
||||
*/
|
||||
IPage<IPlayClerkRankingInfoReturnVo> selectByPage(IPlayClerkRankingInfoQueryVo vo);
|
||||
|
||||
/**
|
||||
* 查询店员排行
|
||||
*
|
||||
|
||||
@@ -7,9 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.starry.admin.modules.clerk.mapper.PlayClerkRankingInfoMapper;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkLevelInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkRankingInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
||||
import com.starry.admin.modules.clerk.module.entity.*;
|
||||
import com.starry.admin.modules.clerk.service.IPlayClerkRankingInfoService;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderHistoryRankingReturnVo;
|
||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderRankingListVo;
|
||||
@@ -33,6 +31,26 @@ public class PlayClerkRankingInfoServiceImpl extends ServiceImpl<PlayClerkRankin
|
||||
@Resource
|
||||
private PlayClerkRankingInfoMapper playClerkRankingInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<IPlayClerkRankingInfoReturnVo> selectByPage(IPlayClerkRankingInfoQueryVo vo) {
|
||||
MPJLambdaWrapper<PlayClerkRankingInfoEntity> lambdaQueryWrapper = new MPJLambdaWrapper<>();
|
||||
lambdaQueryWrapper.selectAll(PlayClerkRankingInfoEntity.class);
|
||||
//拼接店员表
|
||||
lambdaQueryWrapper.selectAs(PlayClerkUserInfoEntity::getNickname, "clerkNickName");
|
||||
lambdaQueryWrapper.leftJoin(PlayClerkUserInfoEntity.class, PlayClerkUserInfoEntity::getId, PlayClerkRankingInfoEntity::getClerkId);
|
||||
if (StrUtil.isNotBlank(vo.getClerkId())) {
|
||||
lambdaQueryWrapper.eq(PlayClerkRankingInfoEntity::getClerkId, vo.getClerkId());
|
||||
}
|
||||
if (StrUtil.isNotBlank(vo.getWeeklyRanking())) {
|
||||
lambdaQueryWrapper.eq(PlayClerkRankingInfoEntity::getWeeklyRanking, vo.getWeeklyRanking());
|
||||
}
|
||||
if (vo.getSettlementDate() != null) {
|
||||
lambdaQueryWrapper.eq(PlayClerkRankingInfoEntity::getSettlementDate, vo.getSettlementDate());
|
||||
}
|
||||
return this.baseMapper.selectJoinPage(new Page<>(vo.getPageNum(), vo.getPageSize()), IPlayClerkRankingInfoReturnVo.class, lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询店员排行
|
||||
*
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PlayOrderHistoryRankingReturnVo {
|
||||
private LocalDate endCountDate;
|
||||
|
||||
/**
|
||||
* 排序名词
|
||||
* 排序名次
|
||||
*/
|
||||
private Long rankingIndex;
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class PlayOrderRankingListVo {
|
||||
private String clerkSex;
|
||||
|
||||
/**
|
||||
* 排序名词
|
||||
* 排序名次
|
||||
*/
|
||||
private Long rankingIndex;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user