|
|
|
@@ -6,10 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.starry.admin.common.aspect.ClerkUserLogin;
|
|
|
|
import com.starry.admin.common.aspect.ClerkUserLogin;
|
|
|
|
import com.starry.admin.common.conf.ThreadLocalRequestDetail;
|
|
|
|
import com.starry.admin.common.conf.ThreadLocalRequestDetail;
|
|
|
|
import com.starry.admin.common.exception.CustomException;
|
|
|
|
import com.starry.admin.common.exception.CustomException;
|
|
|
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkCommodityEntity;
|
|
|
|
import com.starry.admin.modules.clerk.module.entity.*;
|
|
|
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkDataReviewInfoEntity;
|
|
|
|
|
|
|
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserInfoEntity;
|
|
|
|
|
|
|
|
import com.starry.admin.modules.clerk.module.entity.PlayClerkUserReviewInfoEntity;
|
|
|
|
|
|
|
|
import com.starry.admin.modules.clerk.module.vo.PlayClerkCommodityEditVo;
|
|
|
|
import com.starry.admin.modules.clerk.module.vo.PlayClerkCommodityEditVo;
|
|
|
|
import com.starry.admin.modules.clerk.module.vo.PlayClerkCommodityQueryVo;
|
|
|
|
import com.starry.admin.modules.clerk.module.vo.PlayClerkCommodityQueryVo;
|
|
|
|
import com.starry.admin.modules.clerk.service.*;
|
|
|
|
import com.starry.admin.modules.clerk.service.*;
|
|
|
|
@@ -17,6 +14,7 @@ import com.starry.admin.modules.clerk.service.impl.PlayClerkUserInfoServiceImpl;
|
|
|
|
import com.starry.admin.modules.clerk.service.impl.PlayClerkUserReviewInfoServiceImpl;
|
|
|
|
import com.starry.admin.modules.clerk.service.impl.PlayClerkUserReviewInfoServiceImpl;
|
|
|
|
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
|
|
|
import com.starry.admin.modules.gift.module.entity.PlayGiftInfoEntity;
|
|
|
|
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
|
|
|
import com.starry.admin.modules.gift.service.IPlayGiftInfoService;
|
|
|
|
|
|
|
|
import com.starry.admin.modules.order.module.entity.PlayOrderInfoEntity;
|
|
|
|
import com.starry.admin.modules.order.module.vo.PlayOrderEvaluateQueryVo;
|
|
|
|
import com.starry.admin.modules.order.module.vo.PlayOrderEvaluateQueryVo;
|
|
|
|
import com.starry.admin.modules.order.module.vo.PlayOrderStateEditVo;
|
|
|
|
import com.starry.admin.modules.order.module.vo.PlayOrderStateEditVo;
|
|
|
|
import com.starry.admin.modules.order.service.IPlayOrderEvaluateInfoService;
|
|
|
|
import com.starry.admin.modules.order.service.IPlayOrderEvaluateInfoService;
|
|
|
|
@@ -32,18 +30,15 @@ import com.starry.admin.utils.SecurityUtils;
|
|
|
|
import com.starry.common.redis.RedisCache;
|
|
|
|
import com.starry.common.redis.RedisCache;
|
|
|
|
import com.starry.common.result.R;
|
|
|
|
import com.starry.common.result.R;
|
|
|
|
import com.starry.common.utils.ConvertUtil;
|
|
|
|
import com.starry.common.utils.ConvertUtil;
|
|
|
|
import com.starry.common.utils.IdUtils;
|
|
|
|
|
|
|
|
import com.starry.common.utils.VerificationCodeUtils;
|
|
|
|
import com.starry.common.utils.VerificationCodeUtils;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
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;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -58,10 +53,12 @@ public class WxClerkController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
RedisCache redisCache;
|
|
|
|
RedisCache redisCache;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private PlayClerkUserInfoServiceImpl playClerkUserInfoService;
|
|
|
|
private PlayClerkUserInfoServiceImpl playClerkUserInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private IPlayClerkLevelInfoService playClerkLevelInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IPlayClerkUserInfoService clerkUserInfoService;
|
|
|
|
private IPlayClerkUserInfoService clerkUserInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -84,9 +81,6 @@ public class WxClerkController {
|
|
|
|
private IPlayClerkDataReviewInfoService playClerkDataReviewInfoService;
|
|
|
|
private IPlayClerkDataReviewInfoService playClerkDataReviewInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private IPlayClerkLevelInfoService playClerkLevelInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private IPlayClerkClassificationInfoService playClerkClassificationInfoService;
|
|
|
|
private IPlayClerkClassificationInfoService playClerkClassificationInfoService;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -100,8 +94,53 @@ public class WxClerkController {
|
|
|
|
@ClerkUserLogin
|
|
|
|
@ClerkUserLogin
|
|
|
|
@PostMapping("/user/queryPerformanceInfo")
|
|
|
|
@PostMapping("/user/queryPerformanceInfo")
|
|
|
|
public R queryPerformanceInfo(@Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
|
|
|
public R queryPerformanceInfo(@Validated @RequestBody PlayClerkPerformanceInfoQueryVo vo) {
|
|
|
|
|
|
|
|
PlayClerkUserInfoEntity entity = clerkUserInfoService.selectById(ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
|
|
|
|
|
|
|
PlayClerkLevelInfoEntity level = playClerkLevelInfoService.selectPlayClerkLevelInfoById(entity.getLevelId());
|
|
|
|
|
|
|
|
List<PlayOrderInfoEntity> orderInfoEntities = playOrderInfoService.clerkSelectOrderInfoList(entity.getId(), vo.getStartTime(), vo.getEndTime());
|
|
|
|
|
|
|
|
Set<String> customIds = new HashSet<>();
|
|
|
|
|
|
|
|
int orderContinueNumber = 0;
|
|
|
|
|
|
|
|
int orderRefundNumber = 0;
|
|
|
|
|
|
|
|
int ordersExpiredNumber = 0;
|
|
|
|
|
|
|
|
BigDecimal finalAmount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal orderFirstAmount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal orderTotalAmount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal orderRewardAmount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal orderRefundAmount = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
BigDecimal estimatedRevenue = BigDecimal.ZERO;
|
|
|
|
|
|
|
|
for (PlayOrderInfoEntity orderInfoEntity : orderInfoEntities) {
|
|
|
|
|
|
|
|
customIds.add(orderInfoEntity.getPurchaserBy());
|
|
|
|
|
|
|
|
finalAmount = finalAmount.add(orderInfoEntity.getFinalAmount());
|
|
|
|
|
|
|
|
if ("1".equals(orderInfoEntity.getFirstOrder())) {
|
|
|
|
|
|
|
|
orderFirstAmount = orderFirstAmount.add(orderInfoEntity.getFinalAmount());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
orderContinueNumber++;
|
|
|
|
|
|
|
|
orderTotalAmount = orderTotalAmount.add(orderInfoEntity.getFinalAmount());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("2".equals(orderInfoEntity.getPlaceType())) {
|
|
|
|
|
|
|
|
orderRewardAmount = orderRewardAmount.add(orderInfoEntity.getFinalAmount());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("1".equals(orderInfoEntity.getRefundType())) {
|
|
|
|
|
|
|
|
orderRefundNumber++;
|
|
|
|
|
|
|
|
orderRefundAmount = orderRefundAmount.add(orderInfoEntity.getRefundAmount());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ("1".equals(orderInfoEntity.getOrdersExpiredState())) {
|
|
|
|
|
|
|
|
ordersExpiredNumber++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
PlayClerkPerformanceInfoReturnVo returnVo = new PlayClerkPerformanceInfoReturnVo();
|
|
|
|
PlayClerkPerformanceInfoReturnVo returnVo = new PlayClerkPerformanceInfoReturnVo();
|
|
|
|
returnVo.setClerkId(ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
|
|
|
returnVo.setClerkId(ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
|
|
|
|
|
|
|
returnVo.setLevelName(level.getName());
|
|
|
|
|
|
|
|
returnVo.setOrderNumber(orderInfoEntities.size());
|
|
|
|
|
|
|
|
returnVo.setOrderContinueNumber(orderContinueNumber);
|
|
|
|
|
|
|
|
returnVo.setOrderRefundNumber(orderRefundNumber);
|
|
|
|
|
|
|
|
returnVo.setOrdersExpiredNumber(ordersExpiredNumber);
|
|
|
|
|
|
|
|
returnVo.setFinalAmount(finalAmount);
|
|
|
|
|
|
|
|
returnVo.setOrderFirstAmount(orderFirstAmount);
|
|
|
|
|
|
|
|
returnVo.setOrderTotalAmount(orderTotalAmount);
|
|
|
|
|
|
|
|
returnVo.setOrderRewardAmount(orderRewardAmount);
|
|
|
|
|
|
|
|
returnVo.setOrderRefundAmount(orderRefundAmount);
|
|
|
|
|
|
|
|
returnVo.setCustomNumber(customIds.size());
|
|
|
|
|
|
|
|
returnVo.setEstimatedRevenue(estimatedRevenue);
|
|
|
|
return R.ok(returnVo);
|
|
|
|
return R.ok(returnVo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -112,16 +151,18 @@ public class WxClerkController {
|
|
|
|
@ClerkUserLogin
|
|
|
|
@ClerkUserLogin
|
|
|
|
@GetMapping("/user/queryLevelInfo")
|
|
|
|
@GetMapping("/user/queryLevelInfo")
|
|
|
|
public R queryLevelInfo() {
|
|
|
|
public R queryLevelInfo() {
|
|
|
|
|
|
|
|
PlayClerkUserInfoEntity entity = clerkUserInfoService.selectById(ThreadLocalRequestDetail.getClerkUserInfo().getId());
|
|
|
|
|
|
|
|
PlayClerkLevelInfoEntity level = playClerkLevelInfoService.selectPlayClerkLevelInfoById(entity.getLevelId());
|
|
|
|
PlayClerkLevelInfoReturnVo returnVo = new PlayClerkLevelInfoReturnVo();
|
|
|
|
PlayClerkLevelInfoReturnVo returnVo = new PlayClerkLevelInfoReturnVo();
|
|
|
|
returnVo.setLevelName("金牌");
|
|
|
|
returnVo.setLevelName(level.getName());
|
|
|
|
returnVo.setLevelId(IdUtils.getUuid());
|
|
|
|
returnVo.setLevelId(level.getId());
|
|
|
|
List<PlayClerkLevelAndRankingVo> levelAndRanking = new ArrayList<>();
|
|
|
|
List<PlayClerkLevelAndRankingVo> levelAndRanking = new ArrayList<>();
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("普通", 19, 150, 5));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("金牌", 9, 18, 4));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("镇店", 3, 8, 3));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("首席", 1, 2, 2));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("男神", 0, 0, 1));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("女神", 0, 0, 0));
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("女神", 0, 0, 0));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("男神", 0, 0, 1));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("首席", 1, 2, 2));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("镇店", 3, 8, 3));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("金牌", 9, 18, 4));
|
|
|
|
|
|
|
|
levelAndRanking.add(new PlayClerkLevelAndRankingVo("普通", 19, 150, 5));
|
|
|
|
returnVo.setLevelAndRanking(levelAndRanking);
|
|
|
|
returnVo.setLevelAndRanking(levelAndRanking);
|
|
|
|
return R.ok(returnVo);
|
|
|
|
return R.ok(returnVo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|