|
@@ -52,6 +52,8 @@ public class KuaishouPopulationPackageServiceImpl extends ServiceImpl<KuaishouPo
|
|
|
@Autowired
|
|
|
private IKuaishouPopulationService kuaishouPopulationService;
|
|
|
@Autowired
|
|
|
+ private IKuaishouPopulationService iKuaishouPopulationService;
|
|
|
+ @Autowired
|
|
|
private IKuaishouPopulationGroupService populationGroupService;
|
|
|
@Value("${zip.local.download-path}")
|
|
|
private String downloadPath;
|
|
@@ -272,4 +274,37 @@ public class KuaishouPopulationPackageServiceImpl extends ServiceImpl<KuaishouPo
|
|
|
return Result.ok(new PageInfo<>(list));
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void crowdListQuery() {
|
|
|
+ List<Long> accountIds = KuaishouPopulationPackageMapper.queryListByStatus();
|
|
|
+ for (int i = 0; i <= 7; i++) {
|
|
|
+ if (i != 2) {
|
|
|
+ for (Long accountId : accountIds) {
|
|
|
+ CtopOauthToken token = tokenService.getTokenByAccountId(accountId);
|
|
|
+ if (!Check.isNull(token)) {
|
|
|
+ JSONObject jsonObject = iKuaishouPopulationService.getPopulationList(accountId, token.getAccessToken(), i);
|
|
|
+ if (jsonObject.getInteger("code") == 0) {
|
|
|
+ JSONObject data = jsonObject.getJSONObject("data");
|
|
|
+ if (!Check.isNull(data)) {
|
|
|
+ JSONArray details = data.getJSONArray("details");
|
|
|
+ if (details.size() > 0) {
|
|
|
+ for (int j = 0; j < details.size(); j++) {
|
|
|
+ JSONObject obj = details.getJSONObject(j);
|
|
|
+ KuaishouPopulationPackageMapper.updateStatus(obj.getLong("account_id"), obj.getLong("orientation_id"),obj.getInteger("status"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result<Object> getAccountByProjectId(Long projectId, String id) {
|
|
|
+ List<JSONObject> list = relMapper.getAccountByProjectId(projectId, id);
|
|
|
+ return Result.ok(new PageInfo<>(list));
|
|
|
+ }
|
|
|
+
|
|
|
}
|