Browse Source

达人ID 类型改为String

zhaoxian 2 years ago
parent
commit
edd9bfcbcd

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

@@ -831,7 +831,7 @@ public class KuaishouItemCollectSamplesController extends BaseController {
 
     @GetMapping("/samplesCheck")
     @ResponseBody
-    public JSONObject samplesCheck(Long itemId, Long promoterId, Long userId) {
+    public JSONObject samplesCheck(Long itemId, String promoterId, Long userId) {
         JSONObject returnJson = new JSONObject();
         try {
 

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

@@ -46,7 +46,7 @@ public class KuaishouPromoterController extends BaseController {
     @GetMapping("/list")
     @ApiOperation(value = "查询快手达人")
     public TableDataInfo list(@ApiParam("创建人ID") @RequestParam(value = "userId", required = true) Long userId,
-                              @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId,
+                              @ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId,
                               @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName,
                               @ApiParam("媒体") @RequestParam(value = "mediaId", required = false) String mediaId,
                               @ApiParam("排序参数") @RequestParam(value = "parameter", required = false) String parameter,
@@ -62,7 +62,7 @@ public class KuaishouPromoterController extends BaseController {
      */
     @GetMapping("/list2")
     @ApiOperation(value = "达人公海")
-    public TableDataInfo list2(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId,
+    public TableDataInfo list2(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId,
                                @ApiParam("渠道人员ID") @RequestParam(value = "bdUserId", required = false) Long bdUserId,
                                @ApiParam("达人名称") @RequestParam(value = "promoterNickName", required = false) String promoterNickName,
                                @ApiParam("认领状态,1-认领,2-未认领") @RequestParam(value = "status", required = false) String status,
@@ -95,7 +95,7 @@ public class KuaishouPromoterController extends BaseController {
      */
     @GetMapping(value = "/getPromoterInfo")
     @ApiOperation(value = "获取快手达人短视频信息")
-    public AjaxResult getPromoterInfo(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = true) Long promoterId) {
+    public AjaxResult getPromoterInfo(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = true) String promoterId) {
         return kuaishouPromoterService.getPromoterInfo(promoterId);
     }
 
@@ -105,7 +105,7 @@ public class KuaishouPromoterController extends BaseController {
      */
     @GetMapping(value = "/getOnlyPromoterInfo")
     @ApiOperation(value = "只获取达人信息")
-    public AjaxResult getOnlyPromoterInfo(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = true) Long promoterId) {
+    public AjaxResult getOnlyPromoterInfo(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = true) String promoterId) {
         return AjaxResult.success(kuaishouPromoterService.getOnlyPromoterInfo(promoterId));
     }
 
@@ -227,7 +227,7 @@ public class KuaishouPromoterController extends BaseController {
      */
     @GetMapping("/getGongHaiVideoSales")
     @ApiOperation(value = "获取达人公海视频销售")
-    public Result getGongHaiVideoSales(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) Long promoterId) {
+    public Result getGongHaiVideoSales(@ApiParam("达人ID") @RequestParam(value = "promoterId", required = false) String promoterId) {
         return kuaishouPromoterService.getGongHaiVideoSales(promoterId);
     }
 }

+ 32 - 2
ruixuan-live/src/main/java/com/ruixuan/isc/entity/KuaishouPromoter.java

@@ -43,7 +43,7 @@ public class KuaishouPromoter {
      * 达人id(快手lD)
      */
     @ApiModelProperty(name = "达人id(快手lD)")
-    private Long promoterId;
+    private String promoterId;
 
     /**
      * 达人昵称
@@ -136,6 +136,36 @@ public class KuaishouPromoter {
     private String validAmount;
 
     /**
+     * 粉丝增量
+     */
+    @ApiModelProperty(name = "粉丝增量")
+    private Long followerIncr;
+
+    /**
+     * 出单金额
+     */
+    @ApiModelProperty(name = "真播场次")
+    private Integer liveCount30;
+
+    /**
+     * 平均点赞量
+     */
+    @ApiModelProperty(name = "平均点赞量")
+    private Long awemeAvgDiggCount30;
+
+    /**
+     * 平均赞粉比
+     */
+    @ApiModelProperty(name = "平均赞粉比")
+    private String awemeDiggFollowerRation;
+
+    /**
+     * 真播平均场观
+     */
+    @ApiModelProperty(name = "真播平均场观")
+    private String liveAverageUser30;
+
+    /**
      * 跟进记录
      */
     @ApiModelProperty(name = "跟进记录")
@@ -161,7 +191,7 @@ public class KuaishouPromoter {
     public KuaishouPromoter() {
     }
 
-    public KuaishouPromoter(Long id, String promoterNickName, String province, String promoterUrl, String fansNumber, String avgVideoSales, String videoSales, String totalSale,Long promoterId) {
+    public KuaishouPromoter(Long id, String promoterNickName, String province, String promoterUrl, String fansNumber, String avgVideoSales, String videoSales, String totalSale, String promoterId) {
         this.id = id;
         this.promoterNickName = promoterNickName;
         this.province = province;

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

@@ -113,7 +113,7 @@ public interface KuaishouItemCollectSamplesMapper {
 
     void batchProcess(@Param("ids") JSONArray ids, @Param("status") Integer status);
 
-    List<KuaishouItemCollectSamples> getListByPromoterId(@Param("promoterId") Long promoterId, @Param("userId") Long userId);
+    List<KuaishouItemCollectSamples> getListByPromoterId(@Param("promoterId") String promoterId, @Param("userId") Long userId);
 
     Integer checkByRelateIdAndPromoterId(@Param("relateId") Long relateId, @Param("promoterId") Long promoterId);
 

+ 10 - 10
ruixuan-live/src/main/java/com/ruixuan/isc/mapper/KuaishouPromoterMapper.java

@@ -21,7 +21,7 @@ public interface KuaishouPromoterMapper {
      * @param kuaishouPromoter 快手达人 信息
      * @return 快手达人 信息集合
      */
-    public List<KuaishouPromoter> selectKuaishouPromoterList(@Param("userList") List<Long> userList, @Param("promoterId") Long promoterId,
+    public List<KuaishouPromoter> selectKuaishouPromoterList(@Param("userList") List<Long> userList, @Param("promoterId") String promoterId,
                                                              @Param("promoterNickName") String promoterNickName,
                                                              @Param("mediaId") String mediaId,
                                                              @Param("parameter") String parameter, @Param("orderBy") String orderBy);
@@ -58,9 +58,9 @@ public interface KuaishouPromoterMapper {
      */
     public int deleteKuaishouPromoterByIds(Long[] ids);
 
-    KuaishouPromoter getOneByIdAndPromoterId(@Param("userId") Long userId, @Param("promoterId") Long promoterId);
+    KuaishouPromoter getOneByIdAndPromoterId(@Param("userId") Long userId, @Param("promoterId") String promoterId);
 
-    JSONObject getNearlyMonthGmv(@Param("promoterId") Long promoterId, @Param("start") String start, @Param("end") String end);
+    JSONObject getNearlyMonthGmv(@Param("promoterId") String promoterId, @Param("start") String start, @Param("end") String end);
 
     void insertKuaishouPromoterRecord(JSONObject record);
 
@@ -70,28 +70,28 @@ public interface KuaishouPromoterMapper {
 
     void updateKuaishouPromoterByPromoterId(KuaishouPromoter promoters);
 
-    List<JSONObject> selectAllPromoterList(@Param("userId") Long userId, @Param("promoterId") Long promoterId, @Param("promoterNickName") String promoterNickName, @Param("status") String status, @Param("parameter") String parameter, @Param("orderBy") String orderBy);
+    List<JSONObject> selectAllPromoterList(@Param("userId") Long userId, @Param("promoterId") String promoterId, @Param("promoterNickName") String promoterNickName, @Param("status") String status, @Param("parameter") String parameter, @Param("orderBy") String orderBy);
 
     List<KuaishouPromoter> getFailInfo();
 
-    List<JSONObject> getBoundPromoterRoleKey(@Param("promoterId") Long promoterId);
+    List<JSONObject> getBoundPromoterRoleKey(@Param("promoterId") String promoterId);
 
     int addFollowUpRecords(@Param("result") JSONObject result);
 
     void updateFollowUpRecords(@Param("result") JSONObject result);
 
-    JSONObject getFollowUpRecordsByUserId(@Param("promoterId") Long promoterId, @Param("userId") Long userId);
+    JSONObject getFollowUpRecordsByUserId(@Param("promoterId") String promoterId, @Param("userId") Long userId);
 
-    List<JSONObject> getFollowUpRecordListByPromoterId(@Param("promoterId") Long promoterId, @Param("id") Long id);
+    List<JSONObject> getFollowUpRecordListByPromoterId(@Param("promoterId") String promoterId, @Param("id") Long id);
 
-    int deletePromoterLabel(@Param("promoterId") Long promoterId, @Param("userId") Long userId);
+    int deletePromoterLabel(@Param("promoterId") String promoterId, @Param("userId") Long userId);
 
     void insertPromoterLabels(@Param("list") List<JSONObject> list);
 
-    List<JSONObject> getPromoterLabel(@Param("promoterId") Long promoterId, @Param("userId") Long userId);
+    List<JSONObject> getPromoterLabel(@Param("promoterId") String promoterId, @Param("userId") Long userId);
 
 
-    KuaishouPromoter getOnlyPromoterInfoByUserId(@Param("promoterId") Long promoterId, @Param("userId") Long userId);
+    KuaishouPromoter getOnlyPromoterInfoByUserId(@Param("promoterId") String promoterId, @Param("userId") Long userId);
 
     Integer getUserPromotersCount(@Param("userId") Long userId);
 

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

@@ -108,7 +108,7 @@ public interface IKuaishouItemCollectSamplesService {
 
     void batchAddLogs(List<KuaishouItemCollectSampleLog> logs);
 
-    List<KuaishouItemCollectSamples> getListByPromoterId(Long promoterId, Long userId);
+    List<KuaishouItemCollectSamples> getListByPromoterId(String promoterId, Long userId);
 
     void checkAndUpdateStatus();
 }

+ 6 - 6
ruixuan-live/src/main/java/com/ruixuan/isc/service/IKuaishouPromoterService.java

@@ -28,7 +28,7 @@ public interface IKuaishouPromoterService {
      * @param kuaishouPromoter 快手达人 信息
      * @return 快手达人 信息集合
      */
-    public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, Long promoterId, String promoterNickName, String mediaId, String parameter, String orderBy);
+    public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, String promoterId, String promoterNickName, String mediaId, String parameter, String orderBy);
 
     /**
      * 新增快手达人 信息
@@ -54,15 +54,15 @@ public interface IKuaishouPromoterService {
      */
     public Result deleteKuaishouPromoterById(Long id, Long userId);
 
-    AjaxResult getPromoterInfo(Long promoterId);
+    AjaxResult getPromoterInfo(String promoterId);
 
-    KuaishouPromoter getOnlyPromoterInfo(Long promoterId);
+    KuaishouPromoter getOnlyPromoterInfo(String promoterId);
 
     List<Long> selectPromoterIdList(List<Long> userList);
 
     JSONObject getgetMonthPromoterTotal(List<Long> userList, String start, String end);
 
-    List<JSONObject> selectKuaishouPromoterList2(Long userId, Long promoterId, String promoterNickName, String status, String parameter, String orderBy);
+    List<JSONObject> selectKuaishouPromoterList2(Long userId, String promoterId, String promoterNickName, String status, String parameter, String orderBy);
 
     Result supplementInfo();
 
@@ -72,9 +72,9 @@ public interface IKuaishouPromoterService {
 
     void updateFollowUpRecords(JSONObject result);
 
-    Result getGongHaiVideoSales(Long promoterId);
+    Result getGongHaiVideoSales(String promoterId);
 
-    KuaishouPromoter getOnlyPromoterInfoByUserId(Long promoterId, Long userId);
+    KuaishouPromoter getOnlyPromoterInfoByUserId(String promoterId, Long userId);
 
     JSONObject addPromotersCount(Long userId, Long promotersCount);
 }

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

@@ -677,7 +677,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
     }
 
     @Override
-    public List<KuaishouItemCollectSamples> getListByPromoterId(Long promoterId, Long userId) {
+    public List<KuaishouItemCollectSamples> getListByPromoterId(String promoterId, Long userId) {
         return kuaishouItemCollectSamplesMapper.getListByPromoterId(promoterId, userId);
     }
 

+ 23 - 11
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouPromoterServiceImpl.java

@@ -71,7 +71,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
      * @return 快手达人 信息
      */
     @Override
-    public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, Long promoterId, String promoterNickName, String mediaId, String parameter, String orderBy) {
+    public List<KuaishouPromoter> selectKuaishouPromoterList(Long userId, String promoterId, String promoterNickName, String mediaId, String parameter, String orderBy) {
         String roleKey = sysUserService.getRoleKeyByUserId(userId);
         List<Long> userList = null;
         //角色:供应链管理员、招商、招商经理可以看到所有的达人信息
@@ -120,7 +120,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public List<JSONObject> selectKuaishouPromoterList2(Long userId, Long promoterId, String promoterNickName, String status, String parameter, String orderBy) {
+    public List<JSONObject> selectKuaishouPromoterList2(Long userId, String promoterId, String promoterNickName, String status, String parameter, String orderBy) {
         if (Check.isNull(parameter)) {
             parameter = "promoterId";
         } else if ("avgVideoSales".equals(parameter)) {
@@ -241,7 +241,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     /**
      * 同步更新数据
      */
-    private void editPromoter(Long id, String mediaId, Long promoterId, boolean flag) {
+    private void editPromoter(Long id, String mediaId, String promoterId, boolean flag) {
         try {
             if (flag) {
                 /*缓存标记,每日第一次访问调用该接口,更新达人部分(昵称,省市,粉丝,总销售,头像等)数据*/
@@ -256,15 +256,20 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
             /*更新达人数据*/
             Map<String, Object> param = new HashMap<>();
             param.put("promoterId", promoterId);
+            param.put("mediaId", mediaId);
             Long startTime = System.currentTimeMillis();
             String content = HttpUtil.httpPostRequest(startIpPath + "promoterInfo/getPromoterId", param, null);
             Thread.sleep(1500);
             JSONObject result = JSONObject.parseObject(content);
             if (Check.isNotNull(result) && Check.isNotNull(result.getString("promoterNickName"))) {
+                String province = "";
+                if (Check.isNotNull(result.getString("province"))) {
+                    province = result.getString("province").concat("-").concat(result.getString("city"));
+                }
                 KuaishouPromoter kuaishouPromoter = new KuaishouPromoter(
                         id,
                         result.getString("promoterNickName"),
-                        result.getString("province").concat("-").concat(result.getString("city")),
+                        province,
                         result.getString("promoterHeadImgUrl"),
                         result.getString("fanNum"),
                         result.getString("avgVideoSales"),
@@ -272,9 +277,16 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
                         result.getString("totalSale"),
                         promoterId
                 );
+                if ("1".equals(mediaId)) {
+                    kuaishouPromoter.setFollowerIncr(result.getLong("follower_incr"));
+                    kuaishouPromoter.setLiveCount30(result.getInteger("live_count_30"));
+                    kuaishouPromoter.setLiveAverageUser30(result.getString("live_average_user_30"));
+                    kuaishouPromoter.setAwemeDiggFollowerRation(result.getString("aweme_digg_follower_ration"));
+                    kuaishouPromoter.setAwemeAvgDiggCount30(result.getLong("aweme_avg_digg_count_30"));
+                }
                 kuaishouPromoterMapper.updateKuaishouPromoterByPromoterId(kuaishouPromoter);
             } else {
-                log.error("更新达人失败,达人ID:{}         【返回结果】:{}", promoterId, result);
+                log.error("更新达人失败,达人ID:{} 【返回结果】:{}", promoterId, result);
             }
         } catch (Exception e) {
             e.printStackTrace();
@@ -296,7 +308,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
             }
         };
         thread.start();
-        List<Long> promoters = new ArrayList<>();
+        List<String> promoters = new ArrayList<>();
         list.forEach(kuaishouPromoter -> promoters.add(kuaishouPromoter.getPromoterId()));
         return Result.success("共计" + list.size() + "条,数据补充中...", promoters);
     }
@@ -312,7 +324,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public Result getGongHaiVideoSales(Long promoterId) {
+    public Result getGongHaiVideoSales(String promoterId) {
         Map<String, Object> param = new HashMap<>();
         param.put("promoterId", promoterId);
         String url = startIpPath + "promoterInfo/updatePromoter";
@@ -326,7 +338,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public KuaishouPromoter getOnlyPromoterInfoByUserId(Long promoterId, Long userId) {
+    public KuaishouPromoter getOnlyPromoterInfoByUserId(String promoterId, Long userId) {
         return kuaishouPromoterMapper.getOnlyPromoterInfoByUserId(promoterId, userId);
     }
 
@@ -341,7 +353,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
 
     @Override
     public Result updatePromoterLabel(JSONObject result) {
-        Long promoterId = result.getLong("promoterId");
+        String promoterId = result.getString("promoterId");
         Long userId = result.getLong("userId");
         kuaishouPromoterMapper.deletePromoterLabel(promoterId, userId);
         JSONArray ids = result.getJSONArray("ids");
@@ -399,7 +411,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public AjaxResult getPromoterInfo(Long promoterId) {
+    public AjaxResult getPromoterInfo(String promoterId) {
         AjaxResult ajaxResult = null;
         try {
             KuaishouPromoter promoter = kuaishouPromoterMapper.getOneByIdAndPromoterId(null, promoterId);
@@ -446,7 +458,7 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
     }
 
     @Override
-    public KuaishouPromoter getOnlyPromoterInfo(Long promoterId) {
+    public KuaishouPromoter getOnlyPromoterInfo(String promoterId) {
         return kuaishouPromoterMapper.getOneByIdAndPromoterId(null, promoterId);
     }
 

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

@@ -28,6 +28,11 @@
         <result property="monthDayGmv" column="30day_gmv"/>
         <result property="monthDayOrderNum" column="30day_order_num"/>
         <result property="validAmount" column="valid_amount"/>
+        <result property="followerIncr" column="follower_incr"/>
+        <result property="liveCount30" column="live_count_30"/>
+        <result property="awemeAvgDiggCount30" column="aweme_avg_digg_count_30"/>
+        <result property="awemeDiggFollowerRation" column="aweme_digg_follower_ration"/>
+        <result property="liveAverageUser30" column="live_average_user_30"/>
         <result property="followUpRecord" column="txt"/>
     </resultMap>
 
@@ -77,7 +82,12 @@
         t1.video_sales,
         t1.create_time,
         t2.30day_gmv,
-        t2.30day_order_num
+        t2.30day_order_num,
+        t1.follower_incr,
+        t1.live_count_30,
+        t1.aweme_avg_digg_count_30,
+        t1.aweme_digg_follower_ration,
+        t1.live_average_user_30
         FROM
         kuaishou_promoter t1
         LEFT JOIN promoter_oerder_amount t2 on t1.promoter_id = t2.promoter_id
@@ -346,6 +356,11 @@
             <if test="videoSales != null">video_sales = #{videoSales},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="followerIncr != null">follower_incr = #{followerIncr},</if>
+            <if test="liveCount30 != null">live_count_30 = #{liveCount30},</if>
+            <if test="awemeAvgDiggCount30 != null">aweme_avg_digg_count_30 = #{awemeAvgDiggCount30},</if>
+            <if test="awemeDiggFollowerRation != null">aweme_digg_follower_ration = #{awemeDiggFollowerRation},</if>
+            <if test="liveAverageUser30 != null">live_average_user_30 = #{liveAverageUser30},</if>
         </trim>
         where promoter_id = #{promoterId}
     </update>