From 05e8b12d65aa67415f0f32893449a9a48a6c9a48 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Mon, 18 Jan 2021 00:10:50 +0800
Subject: [PATCH] modify
---
zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java | 72 ++++++++++++++++++++++++++++++++----
1 files changed, 64 insertions(+), 8 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java
index 0b7fba6..5a4b4fe 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiRankingAction.java
@@ -1,13 +1,28 @@
package com.matrix.system.app.action;
import com.matrix.core.pojo.AjaxResult;
-import com.matrix.system.app.vo.RankingDto;
+import com.matrix.core.tools.DateUtil;
+import com.matrix.system.app.dto.RankingDto;
+import com.matrix.system.app.vo.RankingVo;
+import com.matrix.system.common.tools.DataAuthUtil;
+import com.matrix.system.hive.action.util.QueryUtil;
+import com.matrix.system.hive.bean.AchieveNew;
+import com.matrix.system.hive.bean.SysOrder;
+import com.matrix.system.hive.dao.AchieveNewDao;
+import com.matrix.system.hive.service.AchieveNewService;
+import com.matrix.system.hive.service.SysOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+import java.util.List;
/**
* @author wzy
@@ -18,19 +33,60 @@
@RequestMapping(value ="/api/ranking")
public class ApiRankingAction {
- public AjaxResult findStaffAchieveRanking() {
- return null;
+ @Autowired
+ private SysOrderService sysOrderService;
+
+ @Autowired
+ private AchieveNewDao achieveNewDao;
+
+ @ApiOperation(value = "顾问业绩排行榜", notes = "顾问业绩排行榜")
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "ok", response = RankingVo.class)
+ })
+ @PostMapping(value = "/findStaffAchieveRanking")
+ public AjaxResult findStaffAchieveRanking(@RequestBody RankingDto rankingDto) {
+ AchieveNew achieveNew = new AchieveNew();
+ QueryUtil.setQueryLimitCom(achieveNew);
+ achieveNew.setType(rankingDto.getType());
+ achieveNew.setDatatime(new Date());
+ return AjaxResult.buildSuccessInstance(achieveNewDao.selectStaffSaleAchieveRanking(achieveNew));
}
@ApiOperation(value = "门店业绩排行榜", notes = "门店业绩排行榜")
@ApiResponses({
- @ApiResponse(code = 200, message = "ok", response = RankingDto.class)
+ @ApiResponse(code = 200, message = "ok", response = RankingVo.class)
})
- public AjaxResult findShopAchieveRanking() {
- return null;
+ @PostMapping(value = "/findShopAchieveRanking")
+ public AjaxResult findShopAchieveRanking(@RequestBody RankingDto rankingDto) {
+ AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("");
+ if (RankingDto.SALE.equals(rankingDto.getDataType())) {
+ AchieveNew achieveNew = new AchieveNew();
+ QueryUtil.setQueryLimitCom(achieveNew);
+ achieveNew.setType(rankingDto.getType());
+ achieveNew.setDatatime(new Date());
+ List<RankingVo> list = achieveNewDao.selectShopConsumeAchieveRanking(achieveNew);
+ ajaxResult.setRows(list);
+ } else {
+ AchieveNew achieveNew = new AchieveNew();
+ QueryUtil.setQueryLimitCom(achieveNew);
+ achieveNew.setDatatime(new Date());
+ achieveNew.setT1(rankingDto.getType());
+ List<RankingVo> rankingVos = achieveNewDao.selectShopConsumeAchieveRanking(achieveNew);
+ ajaxResult.setRows(rankingVos);
+ }
+ return ajaxResult;
}
- public AjaxResult findBeauticianAchieveRanking() {
- return null;
+ @ApiOperation(value = "美疗师业绩排行榜", notes = "美疗师业绩排行榜")
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "ok", response = RankingVo.class)
+ })
+ @PostMapping(value = "/findBeauticianAchieveRanking")
+ public AjaxResult findBeauticianAchieveRanking(@RequestBody RankingDto rankingDto) {
+ AchieveNew achieveNew = new AchieveNew();
+ QueryUtil.setQueryLimitCom(achieveNew);
+ achieveNew.setDatatime(new Date());
+ achieveNew.setT1(rankingDto.getType());
+ return AjaxResult.buildSuccessInstance(achieveNewDao.selectBeauticianConsumeAchieveRanking(achieveNew));
}
}
--
Gitblit v1.9.1