Bläddra i källkod

人群包功能开发,推送人群包逻辑修改

zhaoxian 4 år sedan
förälder
incheckning
3ebd5496b0

+ 2 - 2
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/KuaishouCrowdPackController.java

@@ -205,8 +205,8 @@ public class KuaishouCrowdPackController {
     public Result<Object> accountPush(@RequestBody JSONObject request) {
         try {
             JSONArray accountIds = request.getJSONArray("accountIds");
-            String orientationId = request.getString("orientationId");
-            if (Check.isNull(accountIds) || Check.isNull(orientationId)) {
+            String signature = request.getString("signature");
+            if (Check.isNull(accountIds) || Check.isNull(signature)) {
                 return Result.error("缺少参数");
             }
             return kuaishouCrowdPackService.accountPush(request);

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/mapper/xml/KuaishouCrowdPackMapper.xml

@@ -78,7 +78,7 @@
         WHEN 33 THEN 5
         WHEN 44 THEN 6
         WHEN 55 THEN 7
-        ELSE ''
+        ELSE -1
         END as 'status'
         FROM (
         SELECT signature,max(level) as 'maxlevel' FROM (

+ 5 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/KuaishouCrowdPackServiceImpl.java

@@ -18,7 +18,6 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import lombok.extern.slf4j.Slf4j;
 import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -131,15 +130,16 @@ public class KuaishouCrowdPackServiceImpl extends ServiceImpl<KuaishouCrowdPackM
     @Override
     public Result<Object> accountPush(JSONObject request) {
         JSONArray accountIds = request.getJSONArray("accountIds");
-        Long orientationId = request.getLong("orientationId");
+        Long signature = request.getLong("signature");
         Long accountId = request.getLong("accountId");
         CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
         QueryWrapper<KuaishouCrowdPack> wrapper = new QueryWrapper<>();
         wrapper.eq("account_id", accountId);
-        wrapper.eq("orientation_id", orientationId);
+        wrapper.eq("signature", signature);
+        wrapper.eq("status", 4);
         wrapper.last("limit 1");
         KuaishouCrowdPack kuaishouCrowdPack = crowdPackMapper.selectOne(wrapper);
-        JSONObject jsonObject = iKuaishouPopulationService.pushAccountsPopulation(token, orientationId, accountIds);
+        JSONObject jsonObject = iKuaishouPopulationService.pushAccountsPopulation(token, kuaishouCrowdPack.getOrientationId(), accountIds);
         if (jsonObject.getInteger("code") == 0) {
             List<KuaishouCrowdPack> list = new ArrayList<>();
             JSONObject data = jsonObject.getJSONObject("data");
@@ -154,7 +154,7 @@ public class KuaishouCrowdPackServiceImpl extends ServiceImpl<KuaishouCrowdPackM
                 JSONArray fail = data.getJSONArray("fail");
                 for (Object account : fail) {
                     Long aaccount = Long.valueOf(String.valueOf(account));
-                    KuaishouCrowdPack crowdPack = crowdPackMapper.queryByAccountId(aaccount, orientationId);
+                    KuaishouCrowdPack crowdPack = crowdPackMapper.queryByAccountId(aaccount, kuaishouCrowdPack.getOrientationId());
                     if (Check.isNull(crowdPack)) {
                         kuaishouCrowdPack.setAccountId(aaccount);
                         kuaishouCrowdPack.setMessage("推送失败");