|
@@ -30,6 +30,7 @@ import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 快手达人 信息Service业务层处理
|
|
* 快手达人 信息Service业务层处理
|
|
@@ -202,17 +203,25 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
result.put("msg", "该数据已存在,请重新输入");
|
|
result.put("msg", "该数据已存在,请重新输入");
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
- //同一达人ID 不能绑定到多个渠道角色用户上
|
|
|
|
- String roleKey = sysUserService.getRoleKeyByUserId(promoter.getUserId());
|
|
|
|
- if (roleKey.contains("bd")) {
|
|
|
|
- List<JSONObject> keys = kuaishouPromoterMapper.getBoundPromoterRoleKey(promoter.getPromoterId());
|
|
|
|
- if (Check.isNotNull(keys)) {
|
|
|
|
- for (JSONObject key : keys) {
|
|
|
|
- String rKey = key.getString("role_key");
|
|
|
|
- if ("bd".equals(rKey) || "bdManager".equals(rKey)) {
|
|
|
|
- result.put("code", 500);
|
|
|
|
- result.put("msg", "该达人已被其他渠道人员绑定,绑定人:" + key.getString("user_name"));
|
|
|
|
- return result;
|
|
|
|
|
|
+
|
|
|
|
+ // 如果 达人ID是字母 并且 媒体是快手,说明操作失误,媒体改为抖音
|
|
|
|
+ if (!isNumeric(promoter.getPromoterId()) && "2".equals(promoter.getMediaId())) {
|
|
|
|
+ promoter.setMediaId("1");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ("2".equals(promoter.getMediaId())) {
|
|
|
|
+ // 快手 同一达人ID 不能绑定到多个渠道角色用户上
|
|
|
|
+ String roleKey = sysUserService.getRoleKeyByUserId(promoter.getUserId());
|
|
|
|
+ if (roleKey.contains("bd")) {
|
|
|
|
+ List<JSONObject> keys = kuaishouPromoterMapper.getBoundPromoterRoleKey(promoter.getPromoterId());
|
|
|
|
+ if (Check.isNotNull(keys)) {
|
|
|
|
+ for (JSONObject key : keys) {
|
|
|
|
+ String rKey = key.getString("role_key");
|
|
|
|
+ if ("bd".equals(rKey) || "bdManager".equals(rKey)) {
|
|
|
|
+ result.put("code", 500);
|
|
|
|
+ result.put("msg", "该达人已被其他渠道人员绑定,绑定人:" + key.getString("user_name"));
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -285,7 +294,12 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
promoterId
|
|
promoterId
|
|
);
|
|
);
|
|
if ("1".equals(mediaId)) {
|
|
if ("1".equals(mediaId)) {
|
|
- kuaishouPromoter.setFollowerIncr(result.getLong("follower_incr"));
|
|
|
|
|
|
+ String followerincr = result.getString("follower_incr");
|
|
|
|
+ if (Check.isNotNull(followerincr) && !"-".equals(followerincr)) {
|
|
|
|
+ kuaishouPromoter.setFollowerIncr(result.getLong("follower_incr"));
|
|
|
|
+ } else {
|
|
|
|
+ kuaishouPromoter.setFollowerIncr(0l);
|
|
|
|
+ }
|
|
kuaishouPromoter.setLiveCount30(result.getInteger("live_count_30"));
|
|
kuaishouPromoter.setLiveCount30(result.getInteger("live_count_30"));
|
|
kuaishouPromoter.setLiveAverageUser30(result.getString("live_average_user_30"));
|
|
kuaishouPromoter.setLiveAverageUser30(result.getString("live_average_user_30"));
|
|
kuaishouPromoter.setAwemeDiggFollowerRation(result.getString("aweme_digg_follower_ration"));
|
|
kuaishouPromoter.setAwemeDiggFollowerRation(result.getString("aweme_digg_follower_ration"));
|
|
@@ -479,4 +493,11 @@ public class KuaishouPromoterServiceImpl implements IKuaishouPromoterService {
|
|
return kuaishouPromoterMapper.getgetMonthPromoterTotal(userList, start, end);
|
|
return kuaishouPromoterMapper.getgetMonthPromoterTotal(userList, start, end);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 判断是否为数字
|
|
|
|
+ */
|
|
|
|
+ public static boolean isNumeric(String str) {
|
|
|
|
+ Pattern pattern = Pattern.compile("[0-9]*");
|
|
|
|
+ return pattern.matcher(str).matches();
|
|
|
|
+ }
|
|
}
|
|
}
|