Browse Source

修改导出

yumeng 2 years ago
parent
commit
6ba04d7a42

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

@@ -115,7 +115,7 @@ public class KuaishouItemListController extends BaseController {
             if (Check.isNull(accessToken)) {
                 throw new Exception("获取token授权信息为空");
             }
-            returnJson = kuaishouItemListService.getItemDetail(activityId, itemId, accessToken);
+            returnJson = kuaishouItemListService.getItemDetail(regId,activityId, itemId, accessToken);
         } catch (Exception e) {
             e.printStackTrace();
             returnJson.put("code", 500);

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

@@ -656,8 +656,10 @@ public class SupplyChainController extends BaseController {
             for (int i = 0; i < list.size(); i++) {
                 JSONObject date = list.get(i);
                 List<Object> export = new ArrayList();
-                export.add(date.getLong("promoterId"));
-                export.add(date.getString("promoterNickName"));
+                Long promoterId = date.getLong("promoterId");
+                String promoterNickName = date.getString("promoterNickName");
+                String name = promoterNickName + "(" + promoterId + ")";
+                export.add(name);
                 export.add(date.getInteger("orderNum"));
                 export.add(date.getInteger("validOrderNUm"));
                 export.add(date.getString("validRadio"));
@@ -672,7 +674,7 @@ public class SupplyChainController extends BaseController {
             }
         }
 
-        String[] headers = {"达人ID", "达人名称", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数", "绑定人"};
+        String[] headers = {"达人名称", "订单数", "有效订单数", "有效订单率", "发货数", "发货率", "未发货数", "绑定人"};
         OutputStream os = response.getOutputStream();
         ExportExcelUtils eeu = new ExportExcelUtils();
         XSSFWorkbook workbook = new XSSFWorkbook();

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

@@ -71,7 +71,7 @@ public interface SupplyChainMapper {
 
     List<JSONObject> exportUserItemDetail(Map<String, Object> requestMap);
 
-    String getCookie();
+    String getCookie(Long regId);
 
     JSONObject selectOrderInfo(@Param("promoterIds") List<Long> promoterIds, @Param("startDate") String startDate, @Param("endDate") String endDate);
 

+ 1 - 1
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouItemListService.java

@@ -21,7 +21,7 @@ public interface IKuaishouItemListService {
      * @param accessToken
      * @return
      */
-    JSONObject getItemDetail(Long activityId, Long itemId, KuaishouAccessToken accessToken) throws Exception;
+    JSONObject getItemDetail(Long regId,Long activityId, Long itemId, KuaishouAccessToken accessToken) throws Exception;
 
     KuaishouItemList getItemInfoByItemId(Long itemId);
 

+ 4 - 4
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemListServiceImpl.java

@@ -74,9 +74,9 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
     }
 
     @Override
-    public JSONObject getItemDetail(Long activityId, Long itemId, KuaishouAccessToken accessToken) throws Exception {
+    public JSONObject getItemDetail(Long regId,Long activityId, Long itemId, KuaishouAccessToken accessToken) throws Exception {
         // 调用爬虫信息
-        JSONObject invaliItemDetail = getInvaliItemDetail(activityId, itemId);
+        JSONObject invaliItemDetail = getInvaliItemDetail(regId,activityId, itemId);
         JSONObject returnJson = new JSONObject();
         AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(KuaiShouConstants.KFX_URL, accessToken.getAppKey(), accessToken.getAppSecret());
         OpenDistributionInvestmentActivityItemDetailRequest request = new OpenDistributionInvestmentActivityItemDetailRequest();
@@ -132,9 +132,9 @@ public class KuaishouItemListServiceImpl implements IKuaishouItemListService {
     }
 
 
-    private JSONObject getInvaliItemDetail(Long activityId, Long itemId) throws Exception {
+    private JSONObject getInvaliItemDetail(Long regId,Long activityId, Long itemId) throws Exception {
         JSONObject returnJson = new JSONObject();
-        String cookie = supplyChainMapper.getCookie();
+        String cookie = supplyChainMapper.getCookie(regId);
         Map<String, Object> params = new HashMap<>();
         params.put("limit", 20);
         params.put("offset", 0);

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

@@ -1051,7 +1051,7 @@
     </select>
     <select id="getCookie" resultType="java.lang.String">
         select cookie
-        from ruixuan.kuaishou_supply_chain_cookie limit 1
+        from ruixuan.kuaishou_supply_chain_cookie where id = #{regId} limit 1
     </select>
 
     <select id="selectOrderInfo" resultType="com.alibaba.fastjson.JSONObject">