Bläddra i källkod

达人订单增加渠道名称

yumeng 2 år sedan
förälder
incheckning
f62fc5256d

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

@@ -94,4 +94,6 @@ public interface SupplyChainMapper {
     List<JSONObject> bdTotal(Map<String, Object> requestMap);
 
     List<JSONObject> exportBdDetail(Map<String, Object> requestMap);
+
+    List<JSONObject> getUserList(@Param("map") Map<Long, Long> map);
 }

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

@@ -7,6 +7,7 @@ import com.ruixuan.isc.service.ISupplyChainService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -20,14 +21,37 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
     public List<JSONObject> getOrderList(Map<String, Object> requestMap) {
         List<JSONObject> list = supplyChainMapper.getOrderList(requestMap);
         if (!Check.isNull(list)) {
+            Map<Long, Long> map = new HashMap<>();
             for (int i = 0; i < list.size(); i++) {
                 JSONObject jsonObject = list.get(i);
                 Long promoterId = jsonObject.getLong("promoterId");
                 requestMap.put("promoterId", promoterId);
                 List<JSONObject> topOrders = supplyChainMapper.getTopOrders(requestMap);
                 jsonObject.put("topOrders", topOrders);
+                map.put(promoterId, promoterId);
+            }
+            Map<Long, String> userMap = new HashMap<>();
+            if (!Check.isNullMap(map)) {
+                List<JSONObject> userList = supplyChainMapper.getUserList(map);
+                for (int i = 0; i < userList.size(); i++) {
+                    JSONObject jsonObject = userList.get(i);
+                    userMap.put(jsonObject.getLong("promoterId"), jsonObject.getString("userName"));
+                }
+            }
+
+            if (!Check.isNullMap(userMap)) {
+                for (int i = 0; i < list.size(); i++) {
+                    JSONObject jsonObject = list.get(i);
+                    Long promoterId = jsonObject.getLong("promoterId");
+                    String userName = userMap.get(promoterId);
+                    if (!Check.isNull(userName)) {
+                        jsonObject.put("userName", userName);
+                    }
+                }
             }
         }
+
+
         return list;
     }
 

+ 1 - 14
ruixuan-live/src/main/java/com/ruixuan/jinniu/service/impl/KuaishouAgentAccountListServiceImpl.java

@@ -1,8 +1,5 @@
 package com.ruixuan.jinniu.service.impl;
-
-
 import java.util.*;
-
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.ruixuan.common.utils.Check;
@@ -160,18 +157,8 @@ public class KuaishouAgentAccountListServiceImpl implements IKuaishouAgentAccoun
                 kuaishouAgentAccountListMapper.addBatch(addList);
                 if (adDspAccountList.size() >= pageSize) {
                     kuaishouAgentAccountListService(cookie, currentPage + 1, pageSize, createBeginTime, createEndTime);
-
                 }
-
             }
-
-
         }
-
-
-        //
-
-
     }
-}
-
+}

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

@@ -1319,7 +1319,8 @@
             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')
+            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')
@@ -1461,4 +1462,12 @@
         on t1.promoterId = t2.promoterId
         order by t1.orderNum desc
     </select>
+    <select id="getUserList" resultType="com.alibaba.fastjson.JSONObject">
+        select promoter_id as 'promoterId', group_concat(user_name) as 'userName'
+        from kuaishou_promoter where promoter_id in
+        <foreach collection="map.values" item="v" separator="," open="(" close=")">
+            ${v}
+        </foreach>
+        GROUP BY promoter_id
+    </select>
 </mapper>