Browse Source

供应链v2调整

yumeng 2 years ago
parent
commit
6b095460a4

+ 19 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/controller/SupplyChainController.java

@@ -964,7 +964,10 @@ public class SupplyChainController extends BaseController {
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
             @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
             @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
             @ApiParam("商品Id") @RequestParam(value = "itemId", required = false) Long itemId,
             @ApiParam("商品Id") @RequestParam(value = "itemId", required = false) Long itemId,
-            @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle) {
+            @ApiParam("商品名称") @RequestParam(value = "itemTitle", required = false) String itemTitle,
+            @ApiParam("排序字段") @RequestParam(value = "fieId", required = false) String fieId,
+            @ApiParam("排序方式") @RequestParam(value = "sort", required = false) String sort
+    ) {
         Map<String, Object> requestMap = new HashMap<>();
         Map<String, Object> requestMap = new HashMap<>();
         if (!Check.isNull(userId)) {
         if (!Check.isNull(userId)) {
             requestMap.put("userId", userId);
             requestMap.put("userId", userId);
@@ -983,6 +986,9 @@ public class SupplyChainController extends BaseController {
         if (!Check.isNull(itemTitle)) {
         if (!Check.isNull(itemTitle)) {
             requestMap.put("itemTitle", itemTitle);
             requestMap.put("itemTitle", itemTitle);
         }
         }
+        requestMap.put("fieId", fieId);
+        requestMap.put("sort", sort);
+
         TableDataInfo dataInfo = new TableDataInfo();
         TableDataInfo dataInfo = new TableDataInfo();
         if (Check.isNullMap(requestMap)) {
         if (Check.isNullMap(requestMap)) {
             dataInfo.setCode(-1);
             dataInfo.setCode(-1);
@@ -996,6 +1002,18 @@ public class SupplyChainController extends BaseController {
 
 
 
 
     /**
     /**
+     * 商品认领汇总
+     * @return
+     */
+    @GetMapping("/itemBindSummary")
+    @ApiOperation(value = "商品认领汇总")
+    public JSONObject itemBindSummary() {
+        JSONObject json = supplyChainService.itemBindSummary();
+        return json;
+    }
+
+
+    /**
      * 首页-时段对比
      * 首页-时段对比
      *
      *
      * @param orderStartDate
      * @param orderStartDate

+ 2 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/SupplyChainMapper.java

@@ -64,4 +64,6 @@ public interface SupplyChainMapper {
     JSONObject getTimeIntervalRatio(Map<String, Object> requestMap);
     JSONObject getTimeIntervalRatio(Map<String, Object> requestMap);
 
 
     List<JSONObject> indexStatistics(Map<String, Object> requestMap);
     List<JSONObject> indexStatistics(Map<String, Object> requestMap);
+
+    JSONObject itemBindSummary();
 }
 }

+ 3 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/ISupplyChainService.java

@@ -86,4 +86,7 @@ public interface ISupplyChainService {
 
 
     // 首页-曲线图
     // 首页-曲线图
     List<JSONObject> indexStatistics(Map<String, Object> requestMap);
     List<JSONObject> indexStatistics(Map<String, Object> requestMap);
+
+    // 商品热认领汇总
+    JSONObject itemBindSummary();
 }
 }

+ 5 - 0
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/SupplyChainServiceImpl.java

@@ -165,4 +165,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
     public List<JSONObject> indexStatistics(Map<String, Object> requestMap) {
     public List<JSONObject> indexStatistics(Map<String, Object> requestMap) {
         return supplyChainMapper.indexStatistics(requestMap);
         return supplyChainMapper.indexStatistics(requestMap);
     }
     }
+
+    @Override
+    public JSONObject itemBindSummary() {
+        return supplyChainMapper.itemBindSummary();
+    }
 }
 }

+ 11 - 1
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -666,6 +666,7 @@
         4) as 'deliveryRadio',
         4) as 'deliveryRadio',
         sum(case when t2.order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
         sum(case when t2.order_status = 80 then 1 else 0 end) as 'invalidOrderNUm',
         sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) as 'payAmount',
         sum(case when t2.order_status != 80 then t2.pay_amount else 0 end) as 'payAmount',
+        t2.regimental_promotion_rate as 'regimentalPromotionRate',
         sum(case
         sum(case
         when t2.order_status != 80 then t2.regimental_promotion_amount
         when t2.order_status != 80 then t2.regimental_promotion_amount
         else 0 end) as 'regimentalPromotionAmount'
         else 0 end) as 'regimentalPromotionAmount'
@@ -690,7 +691,7 @@
             and t1.item_title like concat(concat('%',#{itemTitle}),'%')
             and t1.item_title like concat(concat('%',#{itemTitle}),'%')
         </if>
         </if>
         group by t1.item_id) t
         group by t1.item_id) t
-        order by t.orderNum desc
+        order by ${fieId} ${sort}
     </select>
     </select>
     <select id="getTimeIntervalRatio" resultType="com.alibaba.fastjson.JSONObject">
     <select id="getTimeIntervalRatio" resultType="com.alibaba.fastjson.JSONObject">
         select
         select
@@ -758,6 +759,15 @@
         group by FROM_UNIXTIME(t.order_create_time / 1000, '%y-%m-%d')
         group by FROM_UNIXTIME(t.order_create_time / 1000, '%y-%m-%d')
         order by FROM_UNIXTIME(t.order_create_time / 1000, '%y-%m-%d') asc
         order by FROM_UNIXTIME(t.order_create_time / 1000, '%y-%m-%d') asc
     </select>
     </select>
+    <select id="itemBindSummary" resultType="com.alibaba.fastjson.JSONObject">
+       select count(t1.item_id)                                       as 'itemTotal',
+       sum(case when t2.item_id is not null then 1 else 0 end) as 'claimCount',
+       sum(case when t2.item_id is null then 1 else 0 end)     as 'unClaimCount'
+       from kuaishou_item_info t1
+         left join kuaishou_item_bind_user t2
+                   on t1.item_id = t2.item_id
+       where 1=1
+    </select>
 
 
 
 
 </mapper>
 </mapper>