|
@@ -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);
|
|
|
}
|
|
|
|