瀏覽代碼

工作台数据查询,招商维度 (初版)

zhaoxian 2 年之前
父節點
當前提交
540a8b1244

+ 6 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -393,14 +393,15 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
         long startTime = System.currentTimeMillis();
         JSONObject data = new JSONObject();
         List<Long> promoterIds = promoterService.selectPromoterIdList(userId);
-        System.out.println("用时:"+(System.currentTimeMillis()-startTime)/1000 +"s");
+        System.out.println("用时1:"+(System.currentTimeMillis()-startTime)/1000 +"s");
         if (Check.isNotNull(promoterIds)) {
             data.put("promoterCount", promoterIds.size());//达人总数
             JSONObject Sample = kuaishouItemCollectSamplesMapper.queryTheNumberOfCompletedJobs(promoterIds, startDate, endDate);
-            System.out.println("用时:"+(System.currentTimeMillis()-startTime)/1000 +"s");
+            System.out.println("用时2:"+(System.currentTimeMillis()-startTime)/1000 +"s");
             data.put("completeCount", Sample.getInteger("completeCount"));//完成作业数
             data.put("completeRate", Sample.getString("completeRate"));//合格作业率
             JSONObject order = supplyChainService.selectOrderInfo(promoterIds, startDate, endDate);
+            System.out.println("用时3:"+(System.currentTimeMillis()-startTime)/1000 +"s");
             data.put("allNumber", order.getInteger("allNumber"));//订单总数
             data.put("validOrderNUm", order.getInteger("validOrderNUm"));//有效订单数
             data.put("inValidOrderNUm", order.getInteger("allNumber") - order.getInteger("validOrderNUm"));//失效订单数
@@ -421,14 +422,17 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
 
             //日环比
             JSONObject dateOrderRate = supplyChainService.selectOrderRate(promoterIds, null, today, today, yesterday, yesterday);
+            System.out.println("用时4:"+(System.currentTimeMillis()-startTime)/1000 +"s");
             data.put("dateOrderRate", dateOrderRate.getString("orderRate"));
             data.put("dateAmountRate", dateOrderRate.getString("amountRate"));
             //周同比
             JSONObject monthOrderRate = supplyChainService.selectOrderRate(promoterIds, null, today, today, todayOfLastWeek, todayOfLastWeek);
+            System.out.println("用时5:"+(System.currentTimeMillis()-startTime)/1000 +"s");
             data.put("monthOrderRate", monthOrderRate.getString("orderRate"));
             data.put("monthAmountRate", monthOrderRate.getString("amountRate"));
             //数据对比
             JSONObject dataOrderRate = supplyChainService.selectOrderRate(promoterIds, null, start, today, LastStart, todayOfLastWeek);
+            System.out.println("用时6:"+(System.currentTimeMillis()-startTime)/1000 +"s");
             data.put("dataOrderRate", dataOrderRate.getString("orderRate"));
             data.put("dataAmountRate", dataOrderRate.getString("amountRate"));
         }

+ 5 - 1
ruixuan-live/src/main/resources/mapper/isc/KuaishouPromoterMapper.xml

@@ -73,7 +73,11 @@
     <select id="selectPromoterIdList" resultType="Long">
         select promoter_id
         from kuaishou_promoter
-        where user_id = #{userId}
+        <where>
+            <if test="userId != null ">
+                AND user_id = #{userId}
+            </if>
+        </where>
     </select>
 
     <select id="getOneByIdAndPromoterId" resultMap="KuaishouPromoterResult">