Browse Source

Merge branch 'master' into test

zhaoxian 2 years ago
parent
commit
a68a699db6

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

@@ -1235,7 +1235,7 @@ public class SupplyChainController extends BaseController {
     public TableDataInfo bdReportList(
             @ApiParam("开始时间") @RequestParam(value = "orderStartDate", required = false) String orderStartDate,
             @ApiParam("结束时间") @RequestParam(value = "orderEndDate", required = false) String orderEndDate,
-            @ApiParam("用户ID") @RequestParam(value = "userId", required = false) Long collectSampleId) {
+            @ApiParam("用户ID") @RequestParam(value = "collectSampleId", required = false) Long collectSampleId) {
         Map<String, Object> requestMap = new HashMap<>();
         if (!Check.isNull(orderStartDate)) {
             Integer start = DateUtils.getIntegerTime(orderStartDate);

+ 29 - 7
ruixuan-live/src/main/resources/mapper/isc/SupplyChainMapper.xml

@@ -1263,20 +1263,23 @@
         t1.collectSampleName,
         t2.promoterCount,
         t3.sampleCount,
-        round(t3.sampleCount / promoterCount * 100, 3) as 'sampleRate',
+        round(t3.sampleCount / t2.promoterCount * 100, 2) as 'sampleRate',
         t2.promoterCount - t3.sampleCount as 'notSampleCount',
         t1.orderNum,
         t1.validOrderNum,
         t1.validOrderRate,
         t1.orderAmount,
         t1.regimentalPromotionAmount,
-        t1.totalRegimentalSettleAmount
+        t1.totalRegimentalSettleAmount,
+        t4.sendTotalCount,
+        t4.sendPromoterCount,
+        t4.sendItemCount
         from (
         select collect_sample_id as 'collectSampleId',
         collect_sample_name as 'collectSampleName',
         sum(order_num) as 'orderNum',
         sum(valid_order_num) as 'validOrderNum',
-        round(sum(valid_order_num) / sum(order_num) * 100, 3) as 'validOrderRate',
+        round(sum(valid_order_num) / sum(order_num) * 100, 2) as 'validOrderRate',
         sum(order_amount) as 'orderAmount',
         sum(regimental_promotion_amount) as 'regimentalPromotionAmount',
         sum(total_regimental_settle_amount) as 'totalRegimentalSettleAmount'
@@ -1305,6 +1308,25 @@
         where collect_sample_status > 2
         group by collect_sample_id) t3
         on t2.userId = t3.collectSampleId
+        left join (
+        select collect_sample_id as 'collectSampleId',
+        count(1) as 'sendTotalCount',
+        count(distinct promoter_id) as 'sendPromoterCount',
+        count(distinct item_id) as 'sendItemCount'
+        from kuaishou_item_collect_samples
+        where collect_sample_status > 2
+        <if test="collectSampleId != null and collectSampleId != ''">
+            and collect_sample_id = #{collectSampleId}
+        </if>
+        <if test="start != null and start != ''">
+            and create_time &gt;= str_to_date(concat(date_format(#{start}, '%Y-%m-%d'), '00:00:01'), '%Y-%m-%d %H:%i:%s')
+        </if>
+        <if test="end != null and end != ''">
+            and create_time &lt;= str_to_date(concat(date_format(#{end}, '%Y-%m-%d'), '23:59:59'), '%Y-%m-%d %H:%i:%s')
+        </if>
+        group by collect_sample_id
+        ) t4
+        on t1.collectSampleId = t4.collectSampleId
         order by t1.orderNum desc
     </select>
     <select id="bdDetailList" resultType="com.alibaba.fastjson.JSONObject">
@@ -1325,7 +1347,7 @@
         promoter_url as 'promoterUrl',
         sum(order_num) as 'orderNum',
         sum(valid_order_num) as 'validOrderNum',
-        round(sum(valid_order_num) / sum(order_num) * 100, 3) as 'validOrderRate',
+        round(sum(valid_order_num) / sum(order_num) * 100, 2) as 'validOrderRate',
         sum(order_amount) as 'orderAmount',
         sum(regimental_promotion_amount) as 'regimentalPromotionAmount',
         sum(total_regimental_settle_amount) as 'totalRegimentalSettleAmount'
@@ -1366,7 +1388,7 @@
         select
         sum(order_num) as 'orderNum',
         sum(valid_order_num) as 'validOrderNum',
-        round(sum(valid_order_num) / sum(order_num) * 100, 3) as 'validOrderRate',
+        round(sum(valid_order_num) / sum(order_num) * 100, 2) as 'validOrderRate',
         sum(order_amount) as 'orderAmount',
         sum(regimental_promotion_amount) as 'regimentalPromotionAmount',
         sum(total_regimental_settle_amount) as 'totalRegimentalSettleAmount'
@@ -1411,7 +1433,7 @@
         promoter_url as 'promoterUrl',
         sum(order_num) as 'orderNum',
         sum(valid_order_num) as 'validOrderNum',
-        round(sum(valid_order_num) / sum(order_num) * 100, 3) as 'validOrderRate',
+        round(sum(valid_order_num) / sum(order_num) * 100, 2) as 'validOrderRate',
         sum(order_amount) as 'orderAmount',
         sum(regimental_promotion_amount) as 'regimentalPromotionAmount',
         sum(total_regimental_settle_amount) as 'totalRegimentalSettleAmount'
@@ -1437,6 +1459,6 @@
         </if>
         group by promoter_id) t2
         on t1.promoterId = t2.promoterId
-        order by  t1.orderNum desc
+        order by t1.orderNum desc
     </select>
 </mapper>