订单排行
This commit is contained in:
@@ -61,7 +61,7 @@ public class OrderRankingSettlementTask {
|
|||||||
//3、根据订单信息,生成对应排名数据
|
//3、根据订单信息,生成对应排名数据
|
||||||
updateClerkRanking(clerkUserInfo.getId(), startTime, endTime, rankingInfo, orderInfoEntities, newSerialNumber);
|
updateClerkRanking(clerkUserInfo.getId(), startTime, endTime, rankingInfo, orderInfoEntities, newSerialNumber);
|
||||||
}
|
}
|
||||||
//根据订单数量,更新排行名词
|
//根据订单数量,更新排行名次
|
||||||
List<PlayClerkRankingInfoEntity> list = clerkRankingInfoService.selectMaxSerialNumber();
|
List<PlayClerkRankingInfoEntity> list = clerkRankingInfoService.selectMaxSerialNumber();
|
||||||
// 使用匿名比较器排序
|
// 使用匿名比较器排序
|
||||||
list.sort((p1, p2) -> p2.getOrderNumber() - p1.getOrderNumber());
|
list.sort((p1, p2) -> p2.getOrderNumber() - p1.getOrderNumber());
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.starry.admin.modules.clerk.controller;
|
package com.starry.admin.modules.clerk.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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.module.entity.PlayClerkRankingInfoEntity;
|
||||||
import com.starry.admin.modules.clerk.service.IPlayClerkRankingInfoService;
|
import com.starry.admin.modules.clerk.service.IPlayClerkRankingInfoService;
|
||||||
import com.starry.common.annotation.Log;
|
import com.starry.common.annotation.Log;
|
||||||
import com.starry.common.enums.BusinessType;
|
import com.starry.common.enums.BusinessType;
|
||||||
import com.starry.common.result.R;
|
import com.starry.common.result.R;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -26,8 +29,8 @@ public class PlayClerkRankingInfoController {
|
|||||||
* 查询店员排行列表
|
* 查询店员排行列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/listByPage")
|
@GetMapping("/listByPage")
|
||||||
public R list(PlayClerkRankingInfoEntity playClerkRankingInfo) {
|
public R list(@Validated @RequestBody IPlayClerkRankingInfoQueryVo vo) {
|
||||||
IPage<PlayClerkRankingInfoEntity> list = playClerkRankingInfoService.selectPlayClerkRankingInfoByPage(playClerkRankingInfo);
|
IPage<IPlayClerkRankingInfoReturnVo> list = playClerkRankingInfoService.selectByPage(vo);
|
||||||
return R.ok(list);
|
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;
|
package com.starry.admin.modules.clerk.module.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.starry.common.domain.BaseEntity;
|
import com.starry.common.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@@ -35,24 +37,39 @@ public class PlayClerkRankingInfoEntity extends BaseEntity<PlayClerkRankingInfoE
|
|||||||
*/
|
*/
|
||||||
private String clerkId;
|
private String clerkId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否为历史统计(1:是;0:不是)
|
||||||
|
*/
|
||||||
|
private String historicalStatistics;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日排名还是周排名(0:每日排名;1:每周排名)
|
||||||
|
*/
|
||||||
|
private String weeklyRanking;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统计批次
|
* 统计批次
|
||||||
*/
|
*/
|
||||||
private Integer serialNumber;
|
private Integer serialNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序名词
|
* 排序名次
|
||||||
*/
|
*/
|
||||||
private Integer rankingIndex;
|
private Integer rankingIndex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始统计时间
|
* 开始统计时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private LocalDate startCountDate;
|
private LocalDate startCountDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束统计时间
|
* 结束统计时间
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
private LocalDate endCountDate;
|
private LocalDate endCountDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -86,5 +103,12 @@ public class PlayClerkRankingInfoEntity extends BaseEntity<PlayClerkRankingInfoE
|
|||||||
*/
|
*/
|
||||||
private BigDecimal previousMoney;
|
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.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
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.clerk.module.entity.PlayClerkRankingInfoEntity;
|
||||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderHistoryRankingReturnVo;
|
import com.starry.admin.modules.weichat.entity.order.PlayOrderHistoryRankingReturnVo;
|
||||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderRankingReturnVo;
|
import com.starry.admin.modules.weichat.entity.order.PlayOrderRankingReturnVo;
|
||||||
@@ -16,6 +18,15 @@ import java.util.List;
|
|||||||
* @since 2024-05-25
|
* @since 2024-05-25
|
||||||
*/
|
*/
|
||||||
public interface IPlayClerkRankingInfoService extends IService<PlayClerkRankingInfoEntity> {
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.starry.admin.modules.clerk.mapper.PlayClerkRankingInfoMapper;
|
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.*;
|
||||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkRankingInfoEntity;
|
|
||||||
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
|
||||||
import com.starry.admin.modules.clerk.service.IPlayClerkRankingInfoService;
|
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.PlayOrderHistoryRankingReturnVo;
|
||||||
import com.starry.admin.modules.weichat.entity.order.PlayOrderRankingListVo;
|
import com.starry.admin.modules.weichat.entity.order.PlayOrderRankingListVo;
|
||||||
@@ -33,6 +31,26 @@ public class PlayClerkRankingInfoServiceImpl extends ServiceImpl<PlayClerkRankin
|
|||||||
@Resource
|
@Resource
|
||||||
private PlayClerkRankingInfoMapper playClerkRankingInfoMapper;
|
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 LocalDate endCountDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序名词
|
* 排序名次
|
||||||
*/
|
*/
|
||||||
private Long rankingIndex;
|
private Long rankingIndex;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class PlayOrderRankingListVo {
|
|||||||
private String clerkSex;
|
private String clerkSex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序名词
|
* 排序名次
|
||||||
*/
|
*/
|
||||||
private Long rankingIndex;
|
private Long rankingIndex;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user