|
@@ -0,0 +1,559 @@
|
|
|
+package com.ruixuan.isc.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.ruixuan.common.core.controller.BaseController;
|
|
|
+import com.ruixuan.common.core.page.TableDataInfo;
|
|
|
+import com.ruixuan.common.utils.Check;
|
|
|
+import com.ruixuan.common.utils.DateUtils;
|
|
|
+import com.ruixuan.isc.service.ISupplyChainService;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping("/isv/supply_chain")
|
|
|
+public class SupplyChainController extends BaseController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISupplyChainService supplyChainService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 达人订单
|
|
|
+ *
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @param promoterNickName
|
|
|
+ * @param promoterId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/orderList")
|
|
|
+ @ApiOperation(value = "达人订单")
|
|
|
+ public TableDataInfo orderList(@ApiParam("订单开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
|
|
|
+ @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName,
|
|
|
+ @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId) {
|
|
|
+
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(promoterNickName)) {
|
|
|
+ requestMap.put("promoterNickName", promoterNickName);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(promoterId)) {
|
|
|
+ requestMap.put("promoterId", promoterId);
|
|
|
+ }
|
|
|
+ TableDataInfo dataInfo = new TableDataInfo();
|
|
|
+ if (Check.isNullMap(requestMap)) {
|
|
|
+ dataInfo.setCode(-1);
|
|
|
+ dataInfo.setMsg("入参不能为空");
|
|
|
+ return dataInfo;
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> list = supplyChainService.getOrderList(requestMap);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 达人带货详情
|
|
|
+ *
|
|
|
+ * @param promoterId
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @param itemTitle
|
|
|
+ * @param itemId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/anchorOrderDetail")
|
|
|
+ @ApiOperation(value = "达人带货详情")
|
|
|
+ public TableDataInfo anchorOrderDetail(
|
|
|
+ @ApiParam("达人Id") @RequestParam(value = "promoterId", required = false) String promoterId,
|
|
|
+ @ApiParam("订单开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
|
|
|
+ @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
|
|
|
+ @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) String itemId) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(promoterId)) {
|
|
|
+ requestMap.put("promoterId", promoterId);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemId)) {
|
|
|
+ requestMap.put("itemId", itemId);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemTitle)) {
|
|
|
+ requestMap.put("itemTitle", itemTitle);
|
|
|
+ }
|
|
|
+
|
|
|
+ TableDataInfo dataInfo = new TableDataInfo();
|
|
|
+ if (Check.isNullMap(requestMap)) {
|
|
|
+ dataInfo.setCode(-1);
|
|
|
+ dataInfo.setMsg("入参不能为空");
|
|
|
+ return dataInfo;
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> list = supplyChainService.anchorOrderDetail(requestMap);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 订单统计
|
|
|
+ *
|
|
|
+ * @param promoterId
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/orderStatistics")
|
|
|
+ @ApiOperation(value = "订单统计")
|
|
|
+ public TableDataInfo orderStatistics(
|
|
|
+ @ApiParam("达人Id") @RequestParam(value = "promoterId", required = false) String promoterId,
|
|
|
+ @ApiParam("订单开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(promoterId)) {
|
|
|
+ requestMap.put("promoterId", promoterId);
|
|
|
+ }
|
|
|
+ TableDataInfo dataInfo = new TableDataInfo();
|
|
|
+ if (Check.isNullMap(requestMap)) {
|
|
|
+ dataInfo.setCode(-1);
|
|
|
+ dataInfo.setMsg("入参不能为空");
|
|
|
+ return dataInfo;
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> list = supplyChainService.orderStatistics(requestMap);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商品列表
|
|
|
+ *
|
|
|
+ * @param itemId
|
|
|
+ * @param itemTitle
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/itemList")
|
|
|
+ @ApiOperation(value = "商品列表")
|
|
|
+ public TableDataInfo itemList(
|
|
|
+ @ApiParam("商品Id") @RequestParam(value = "itemId", required = false) String itemId,
|
|
|
+ @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemId)) {
|
|
|
+ requestMap.put("itemId", itemId);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemTitle)) {
|
|
|
+ requestMap.put("itemTitle", itemTitle);
|
|
|
+ }
|
|
|
+ TableDataInfo dataInfo = new TableDataInfo();
|
|
|
+ if (Check.isNullMap(requestMap)) {
|
|
|
+ dataInfo.setCode(-1);
|
|
|
+ dataInfo.setMsg("入参不能为空");
|
|
|
+ return dataInfo;
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> list = supplyChainService.itemList(requestMap);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 商品详情
|
|
|
+ *
|
|
|
+ * @param itemId
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @param promoterId
|
|
|
+ * @param promoterNickName
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/itemDetail")
|
|
|
+ @ApiOperation(value = "商品详情")
|
|
|
+ public TableDataInfo itemDetail(
|
|
|
+ @ApiParam("商品ID") @RequestParam(value = "itemId", required = false) String itemId,
|
|
|
+ @ApiParam("订单开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("订单结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
|
|
|
+ @ApiParam("达人Id") @RequestParam(value = "itemId", required = false) String promoterId,
|
|
|
+ @ApiParam("商品名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(promoterId)) {
|
|
|
+ requestMap.put("promoterId", promoterId);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemId)) {
|
|
|
+ requestMap.put("itemId", itemId);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(promoterNickName)) {
|
|
|
+ requestMap.put("itemTitle", promoterNickName);
|
|
|
+ }
|
|
|
+
|
|
|
+ TableDataInfo dataInfo = new TableDataInfo();
|
|
|
+ if (Check.isNullMap(requestMap)) {
|
|
|
+ dataInfo.setCode(-1);
|
|
|
+ dataInfo.setMsg("入参不能为空");
|
|
|
+ return dataInfo;
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> list = supplyChainService.itemDetail(requestMap);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 产品服务费
|
|
|
+ *
|
|
|
+ * @param itemId
|
|
|
+ * @param itemTitle
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/itemServiceCharge")
|
|
|
+ @ApiOperation(value = "产品服务费")
|
|
|
+ public TableDataInfo itemServiceCharge(
|
|
|
+ @ApiParam("商品Id") @RequestParam(value = "itemId", required = false) String itemId,
|
|
|
+ @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemId)) {
|
|
|
+ requestMap.put("itemId", itemId);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(itemTitle)) {
|
|
|
+ requestMap.put("itemTitle", itemTitle);
|
|
|
+ }
|
|
|
+ TableDataInfo dataInfo = new TableDataInfo();
|
|
|
+ if (Check.isNullMap(requestMap)) {
|
|
|
+ dataInfo.setCode(-1);
|
|
|
+ dataInfo.setMsg("入参不能为空");
|
|
|
+ return dataInfo;
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> list = supplyChainService.itemServiceCharge(requestMap);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首页-订单数据
|
|
|
+ *
|
|
|
+ * @param dateType
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+
|
|
|
+ @GetMapping("/indexOrderInfo")
|
|
|
+ @ApiOperation(value = "首页-订单数据")
|
|
|
+ public JSONObject orderTotal(
|
|
|
+ @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
+ if (dateType == 0) {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //当天开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 当天结束时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ JSONObject orderTotal = supplyChainService.getOrderTotal(requestMap);
|
|
|
+ returnJson.put("orderTotal", orderTotal);
|
|
|
+ Integer hour = DateUtils.getNowHour() - 1; // 当前小时
|
|
|
+ if (hour >= 0) {
|
|
|
+ JSONObject ratioJson = new JSONObject();
|
|
|
+ Long nowStartHourTemp = DateUtils.getStartLongTime(orderStartDate); // 当天开始时间戳
|
|
|
+ Long nowEndHourTemp = DateUtils.getNowEndHourTemp(orderStartDate, hour); // 当前结束时间戳
|
|
|
+ String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", orderStartDate, -1); // 昨日日期
|
|
|
+ Long yesterdayStartHourTemp = DateUtils.getStartLongTime(yesterday); //昨日开始时间戳
|
|
|
+ Long yesterdayEndHourTemp = DateUtils.getNowEndHourTemp(yesterday, hour); // 昨日结束时间戳
|
|
|
+
|
|
|
+ Map<String, Object> ratioMap = new HashMap<>();
|
|
|
+ ratioMap.put("nowStartHourTemp", nowStartHourTemp);
|
|
|
+ ratioMap.put("nowEndHourTemp", nowEndHourTemp);
|
|
|
+ ratioMap.put("yesterdayStartHourTemp", yesterdayStartHourTemp);
|
|
|
+ ratioMap.put("yesterdayEndHourTemp", yesterdayEndHourTemp);
|
|
|
+ Double ringRatio = supplyChainService.getOrderTotalRatio(ratioMap); //环比
|
|
|
+ ratioJson.put("ringRatio", ringRatio);
|
|
|
+ String yearDay = DateUtils.getAnotherDay("yyyy-MM-dd", orderStartDate, -6); // 昨日日期
|
|
|
+ Long yearStartHourTemp = DateUtils.getStartLongTime(yearDay); //前7日开始时间戳
|
|
|
+ Long yearEndHourTemp = DateUtils.getNowEndHourTemp(yearDay, hour);//前7日结束时间戳
|
|
|
+ ratioMap.put("yesterdayStartHourTemp", yearStartHourTemp);
|
|
|
+ ratioMap.put("yesterdayEndHourTemp", yearEndHourTemp);
|
|
|
+ Double yearRatio = supplyChainService.getOrderTotalRatio(ratioMap); //同比
|
|
|
+ ratioJson.put("yearRatio", yearRatio);
|
|
|
+ returnJson.put("ratio", ratioJson);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //昨日开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 前日开始时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ JSONObject orderTotal = supplyChainService.getOrderTotal(requestMap);
|
|
|
+ returnJson.put("orderTotal", orderTotal);
|
|
|
+ }
|
|
|
+ return returnJson;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首页-金额数据
|
|
|
+ *
|
|
|
+ * @param dateType
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/indexAmountInfo")
|
|
|
+ @ApiOperation(value = "首页-金额数据")
|
|
|
+ public JSONObject indexAmountInfo(
|
|
|
+ @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
+ if (dateType == 0) {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //当天开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 当天结束时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ JSONObject amountTotal = supplyChainService.getAmountTotal(requestMap);
|
|
|
+ returnJson.put("amountTotal", amountTotal);
|
|
|
+ Integer hour = DateUtils.getNowHour() - 1; // 当前小时
|
|
|
+ if (hour >= 0) {
|
|
|
+ JSONObject amountRatioJson = new JSONObject();
|
|
|
+ Long nowStartHourTemp = DateUtils.getStartLongTime(orderStartDate); // 当天开始时间戳
|
|
|
+ Long nowEndHourTemp = DateUtils.getNowEndHourTemp(orderStartDate, hour); // 当前结束时间戳
|
|
|
+ String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", orderStartDate, -1); // 昨日日期
|
|
|
+ Long yesterdayStartHourTemp = DateUtils.getStartLongTime(yesterday); //昨日开始时间戳
|
|
|
+ Long yesterdayEndHourTemp = DateUtils.getNowEndHourTemp(yesterday, hour); // 昨日结束时间戳
|
|
|
+
|
|
|
+ Map<String, Object> ratioMap = new HashMap<>();
|
|
|
+ ratioMap.put("nowStartHourTemp", nowStartHourTemp);
|
|
|
+ ratioMap.put("nowEndHourTemp", nowEndHourTemp);
|
|
|
+ ratioMap.put("yesterdayStartHourTemp", yesterdayStartHourTemp);
|
|
|
+ ratioMap.put("yesterdayEndHourTemp", yesterdayEndHourTemp);
|
|
|
+ Double amountRingRatio = supplyChainService.getAmountTotalRatio(ratioMap); //环比
|
|
|
+ amountRatioJson.put("amountRingRatio", amountRingRatio);
|
|
|
+ String yearDay = DateUtils.getAnotherDay("yyyy-MM-dd", orderStartDate, -6); // 昨日日期
|
|
|
+ Long yearStartHourTemp = DateUtils.getStartLongTime(yearDay); //前7日开始时间戳
|
|
|
+ Long yearEndHourTemp = DateUtils.getNowEndHourTemp(yearDay, hour);//前7日结束时间戳
|
|
|
+ ratioMap.put("yesterdayStartHourTemp", yearStartHourTemp);
|
|
|
+ ratioMap.put("yesterdayEndHourTemp", yearEndHourTemp);
|
|
|
+ Double amountYearRatio = supplyChainService.getAmountTotalRatio(ratioMap); //同比
|
|
|
+ amountRatioJson.put("amountYearRatio", amountYearRatio);
|
|
|
+ returnJson.put("amountRatio", amountRatioJson);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //昨日开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 前日开始时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ JSONObject amountTotal = supplyChainService.getAmountTotal(requestMap);
|
|
|
+ returnJson.put("amountTotal", amountTotal);
|
|
|
+ }
|
|
|
+ return returnJson;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首页-服务费数据
|
|
|
+ *
|
|
|
+ * @param dateType
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/indexServiceAmountInfo")
|
|
|
+ @ApiOperation(value = "首页-服务费数据")
|
|
|
+ public JSONObject indexServiceAmountInfo(
|
|
|
+ @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
+
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //昨日开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 前日开始时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ JSONObject serviceAmountTotal = supplyChainService.getServiceAmountTotal(requestMap);
|
|
|
+ returnJson.put("serviceAmountTotal", serviceAmountTotal);
|
|
|
+ return returnJson;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 首页-商品排行
|
|
|
+ *
|
|
|
+ * @param dateType
|
|
|
+ * @param orderStartDate
|
|
|
+ * @param orderEndDate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("/indexOrderRank")
|
|
|
+ @ApiOperation(value = "首页-商品排行")
|
|
|
+ public TableDataInfo indexOrderRank(
|
|
|
+ @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (dateType == 0) {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //当天开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 当天结束时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ Integer hour = DateUtils.getNowHour(); // 当前小时
|
|
|
+ Long nowStartHourTemp = DateUtils.getStartLongTime(orderStartDate); // 当天开始时间戳
|
|
|
+ Long nowEndHourTemp = DateUtils.getNowEndHourTemp(orderStartDate, hour); // 当前结束时间戳
|
|
|
+ String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", orderStartDate, -1); // 昨日日期
|
|
|
+ Long yesterdayStartHourTemp = DateUtils.getStartLongTime(yesterday); //昨日开始时间戳
|
|
|
+ Long yesterdayEndHourTemp = DateUtils.getNowEndHourTemp(yesterday, hour); // 昨日结束时间戳
|
|
|
+ requestMap.put("nowStartHourTemp", nowStartHourTemp);
|
|
|
+ requestMap.put("nowEndHourTemp", nowEndHourTemp);
|
|
|
+ requestMap.put("yesterdayStartHourTemp", yesterdayStartHourTemp);
|
|
|
+ requestMap.put("yesterdayEndHourTemp", yesterdayEndHourTemp);
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> orderRankRatioList = supplyChainService.getOrderRankRatioList(requestMap);
|
|
|
+ return getDataTable(orderRankRatioList);
|
|
|
+ } else {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> orderRankRatioList = supplyChainService.getOrderRankList(requestMap);
|
|
|
+ return getDataTable(orderRankRatioList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/indexPromoterRank")
|
|
|
+ @ApiOperation(value = "首页-达人排行")
|
|
|
+ public TableDataInfo indexPromoterRank(
|
|
|
+ @ApiParam("时间类型") @RequestParam(value = "dateType", required = false) Integer dateType,
|
|
|
+ @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
|
|
|
+ @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate) {
|
|
|
+
|
|
|
+ Map<String, Object> requestMap = new HashMap<>();
|
|
|
+ if (dateType == 0) {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate); //当天开始时间
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate); // 当天结束时间
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ Integer hour = DateUtils.getNowHour(); // 当前小时
|
|
|
+ Long nowStartHourTemp = DateUtils.getStartLongTime(orderStartDate); // 当天开始时间戳
|
|
|
+ Long nowEndHourTemp = DateUtils.getNowEndHourTemp(orderStartDate, hour); // 当前结束时间戳
|
|
|
+ String yesterday = DateUtils.getAnotherDay("yyyy-MM-dd", orderStartDate, -1); // 昨日日期
|
|
|
+ Long yesterdayStartHourTemp = DateUtils.getStartLongTime(yesterday); //昨日开始时间戳
|
|
|
+ Long yesterdayEndHourTemp = DateUtils.getNowEndHourTemp(yesterday, hour); // 昨日结束时间戳
|
|
|
+ requestMap.put("nowStartHourTemp", nowStartHourTemp);
|
|
|
+ requestMap.put("nowEndHourTemp", nowEndHourTemp);
|
|
|
+ requestMap.put("yesterdayStartHourTemp", yesterdayStartHourTemp);
|
|
|
+ requestMap.put("yesterdayEndHourTemp", yesterdayEndHourTemp);
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> promoterRankRatioList = supplyChainService.getPromoterRankRatioList(requestMap);
|
|
|
+ return getDataTable(promoterRankRatioList);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ if (!Check.isNull(orderStartDate)) {
|
|
|
+ Long start = DateUtils.getStartLongTime(orderStartDate);
|
|
|
+ requestMap.put("start", start);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(orderEndDate)) {
|
|
|
+ Long end = DateUtils.getEndLongTime(orderEndDate);
|
|
|
+ requestMap.put("end", end);
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<JSONObject> orderRatioList = supplyChainService.getPromoterRatioList(requestMap);
|
|
|
+ return getDataTable(orderRatioList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|