|
@@ -454,6 +454,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if ("miaogousi".equals(ownershipId)) {
|
|
if ("miaogousi".equals(ownershipId)) {
|
|
int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
|
|
int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
|
|
@@ -472,6 +476,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if ("rocket".equals(ownershipId)) {
|
|
if ("rocket".equals(ownershipId)) {
|
|
int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
@@ -490,8 +498,16 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if ("yufu".equals(ownershipId)) {
|
|
if ("yufu".equals(ownershipId)) {
|
|
|
|
+ int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yufu > 0) {
|
|
|
|
+ return yufu;
|
|
|
|
+ }
|
|
int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
if (rocket > 0) {
|
|
if (rocket > 0) {
|
|
return rocket;
|
|
return rocket;
|
|
@@ -504,10 +520,32 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (mgs > 0) {
|
|
if (mgs > 0) {
|
|
return mgs;
|
|
return mgs;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ("yuxiu".equals(ownershipId)) {
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
|
|
int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (rocket > 0) {
|
|
|
|
+ return rocket;
|
|
|
|
+ }
|
|
|
|
+ int ruixuan = supplyChainMapper.updateRuixuanOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (ruixuan > 0) {
|
|
|
|
+ return ruixuan;
|
|
|
|
+ }
|
|
|
|
+ int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (mgs > 0) {
|
|
|
|
+ return mgs;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -531,6 +569,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if ("miaogousi".equals(ownershipId)) {
|
|
if ("miaogousi".equals(ownershipId)) {
|
|
@@ -550,6 +592,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if ("rocket".equals(ownershipId)) {
|
|
if ("rocket".equals(ownershipId)) {
|
|
int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
@@ -568,9 +614,39 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if ("yufu".equals(ownershipId)) {
|
|
if ("yufu".equals(ownershipId)) {
|
|
|
|
+ int yufu = supplyChainMapper.updateYufuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (yufu > 0) {
|
|
|
|
+ return yufu;
|
|
|
|
+ }
|
|
|
|
+ int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (rocket > 0) {
|
|
|
|
+ return rocket;
|
|
|
|
+ }
|
|
|
|
+ int ruixuan = supplyChainMapper.updateRuiXuanOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (ruixuan > 0) {
|
|
|
|
+ return ruixuan;
|
|
|
|
+ }
|
|
|
|
+ int mgs = supplyChainMapper.updateMgsOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (mgs > 0) {
|
|
|
|
+ return mgs;
|
|
|
|
+ }
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if ("yuxiu".equals(ownershipId)) {
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuxiuOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (rocket > 0) {
|
|
if (rocket > 0) {
|
|
return rocket;
|
|
return rocket;
|
|
@@ -617,24 +693,30 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
for (KuaishouAccessToken accessToken : tokens) {
|
|
for (KuaishouAccessToken accessToken : tokens) {
|
|
getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
- Thread.sleep(60000);
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
List<KuaishouAccessToken> mgsTokens = accessTokenService.getMgsTokenInfos();
|
|
List<KuaishouAccessToken> mgsTokens = accessTokenService.getMgsTokenInfos();
|
|
for (KuaishouAccessToken accessToken : mgsTokens) {
|
|
for (KuaishouAccessToken accessToken : mgsTokens) {
|
|
getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
|
|
|
|
- Thread.sleep(60000);
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
|
|
List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
|
|
for (KuaishouAccessToken accessToken : rocketTokens) {
|
|
for (KuaishouAccessToken accessToken : rocketTokens) {
|
|
getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
|
|
|
|
- Thread.sleep(60000);
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
List<KuaishouAccessToken> yufuTokens = accessTokenService.getYufuTokenInfos();
|
|
List<KuaishouAccessToken> yufuTokens = accessTokenService.getYufuTokenInfos();
|
|
for (KuaishouAccessToken accessToken : yufuTokens) {
|
|
for (KuaishouAccessToken accessToken : yufuTokens) {
|
|
getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
|
|
+ List<KuaishouAccessToken> yuxiuTokens = accessTokenService.getYuxiuTokenInfos();
|
|
|
|
+ for (KuaishouAccessToken accessToken : yuxiuTokens) {
|
|
|
|
+ getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private void getInfo(KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, Integer counts) throws InterruptedException {
|
|
private void getInfo(KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, Integer counts) throws InterruptedException {
|
|
@@ -642,6 +724,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
|
|
+ List<Long> yuxiuList = new ArrayList<>();
|
|
String appKey = accessToken.getAppKey();
|
|
String appKey = accessToken.getAppKey();
|
|
String signSecret = accessToken.getSignSecret();
|
|
String signSecret = accessToken.getSignSecret();
|
|
if (Check.isNull(signSecret) || Check.isNull(appKey)) {
|
|
if (Check.isNull(signSecret) || Check.isNull(appKey)) {
|
|
@@ -707,6 +790,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yufu".equals(ownership)) {
|
|
if ("yufu".equals(ownership)) {
|
|
yufuList.add(info.getLong("oid"));
|
|
yufuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("yuxiu".equals(ownership)) {
|
|
|
|
+ yuxiuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -733,6 +819,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yufuList)) {
|
|
if (!Check.isNull(yufuList)) {
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(yuxiuList)) {
|
|
|
|
+ supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -743,6 +832,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
|
|
+ List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
|
|
String appKey = accessToken.getAppKey();
|
|
String appKey = accessToken.getAppKey();
|
|
String signSecret = accessToken.getSignSecret();
|
|
String signSecret = accessToken.getSignSecret();
|
|
@@ -808,6 +898,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yufu".equals(ownership)) {
|
|
if ("yufu".equals(ownership)) {
|
|
yufuList.add(info.getLong("oid"));
|
|
yufuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("yuxiu".equals(ownership)) {
|
|
|
|
+ yuxiuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -828,10 +921,12 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(rocketList)) {
|
|
if (!Check.isNull(rocketList)) {
|
|
supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
|
|
supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
|
|
}
|
|
}
|
|
-
|
|
|
|
if (!Check.isNull(yufuList)) {
|
|
if (!Check.isNull(yufuList)) {
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(yuxiuList)) {
|
|
|
|
+ supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -842,6 +937,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
|
|
+ List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
|
|
String appKey = accessToken.getAppKey();
|
|
String appKey = accessToken.getAppKey();
|
|
String signSecret = accessToken.getSignSecret();
|
|
String signSecret = accessToken.getSignSecret();
|
|
@@ -906,6 +1002,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yufu".equals(ownership)) {
|
|
if ("yufu".equals(ownership)) {
|
|
yufuList.add(info.getLong("oid"));
|
|
yufuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("yuxiu".equals(ownership)) {
|
|
|
|
+ yuxiuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -928,6 +1027,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yufuList)) {
|
|
if (!Check.isNull(yufuList)) {
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(yuxiuList)) {
|
|
|
|
+ supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -939,6 +1041,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> mgsList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> rocketList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
List<Long> yufuList = new ArrayList<>();
|
|
|
|
+ List<Long> yuxiuList = new ArrayList<>();
|
|
String appKey = accessToken.getAppKey();
|
|
String appKey = accessToken.getAppKey();
|
|
String signSecret = accessToken.getSignSecret();
|
|
String signSecret = accessToken.getSignSecret();
|
|
if (Check.isNull(signSecret) || Check.isNull(appKey)) {
|
|
if (Check.isNull(signSecret) || Check.isNull(appKey)) {
|
|
@@ -1002,6 +1105,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yufu".equals(ownership)) {
|
|
if ("yufu".equals(ownership)) {
|
|
yufuList.add(info.getLong("oid"));
|
|
yufuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("yuxiu".equals(ownership)) {
|
|
|
|
+ yuxiuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1009,7 +1115,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
log.error("===yufu查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("error_msg"));
|
|
log.error("===yufu查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("error_msg"));
|
|
log.error("yufu游标:{},执行次数:{}", pcursor, counts);
|
|
log.error("yufu游标:{},执行次数:{}", pcursor, counts);
|
|
if (counts <= 3) {
|
|
if (counts <= 3) {
|
|
- getRocketInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
|
|
|
|
|
|
+ getYufuInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!Check.isNull(ruixuanList)) {
|
|
if (!Check.isNull(ruixuanList)) {
|
|
@@ -1024,11 +1130,116 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yufuList)) {
|
|
if (!Check.isNull(yufuList)) {
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(yuxiuList)) {
|
|
|
|
+ supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void getYuxiuInfo(KuaishouAccessToken accessToken, Long beginTime, Long endTime, String url, String pcursor, Integer counts) throws InterruptedException {
|
|
|
|
+ List<Long> ruixuanList = new ArrayList<>();
|
|
|
|
+ List<Long> mgsList = new ArrayList<>();
|
|
|
|
+ List<Long> rocketList = new ArrayList<>();
|
|
|
|
+ List<Long> yufuList = new ArrayList<>();
|
|
|
|
+ List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
+ String appKey = accessToken.getAppKey();
|
|
|
|
+ String signSecret = accessToken.getSignSecret();
|
|
|
|
+ if (Check.isNull(signSecret) || Check.isNull(appKey)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(url, appKey, signSecret);
|
|
|
|
+ OpenDistributionCpsLeaderOrderCursorListRequest request = new OpenDistributionCpsLeaderOrderCursorListRequest();
|
|
|
|
+ request.setAccessToken(accessToken.getAccessToken());
|
|
|
|
+ request.setApiMethodVersion(1L);
|
|
|
|
+
|
|
|
|
+ //排序类型 [1:按指定查询类型降序] [2:按指定查询类型升序]
|
|
|
|
+ request.setSortType(1);
|
|
|
|
+ //查询类型 [1:按分销订单创建时间查询] [2:按分销订单更新时间查询][4:按订单实际创建时间查询]
|
|
|
|
+ request.setQueryType(2);
|
|
|
|
+ //分销订单状态 [0:全部订单] [30:已付款] [50:已收货] [60:已结算] [80:已失效]
|
|
|
|
+ request.setCpsOrderStatus(0);
|
|
|
|
+ request.setDistributorId(0l);
|
|
|
|
+ request.setBeginTime(beginTime);
|
|
|
|
+ request.setEndTime(endTime);
|
|
|
|
+ request.setPcursor(pcursor);
|
|
|
|
+ request.setPageize(100);
|
|
|
|
+ request.setFundType(1);
|
|
|
|
+
|
|
|
|
+ OpenDistributionCpsLeaderOrderCursorListResponse response = null;
|
|
|
|
+ try {
|
|
|
|
+ response = client.execute(request);
|
|
|
|
+ } catch (KsMerchantApiException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ JSONObject obj = JSONObject.parseObject(GsonUtils.toJSON(response));
|
|
|
|
+ String code = obj.getString("code");
|
|
|
|
+ if ("1".equals(code)) {
|
|
|
|
+ JSONObject data = obj.getJSONObject("data");
|
|
|
|
+ pcursor = data.getString("pcursor");
|
|
|
|
+ JSONArray orderView = data.getJSONArray("orderView");
|
|
|
|
+ for (int i = 0; i < orderView.size(); i++) {
|
|
|
|
+ JSONObject info = orderView.getJSONObject(i);
|
|
|
|
+ Integer sendStatus = info.getInteger("sendStatus");
|
|
|
|
+ if (Check.isNotNull(sendStatus) && sendStatus == 1) {
|
|
|
|
+ JSONArray cpsOrderProductView = info.getJSONArray("cpsOrderProductView");
|
|
|
|
+ JSONObject itemJson = cpsOrderProductView.getJSONObject(0);
|
|
|
|
+ Long itemId = itemJson.getLong("itemId");
|
|
|
|
+ Criteria criteria = new Criteria();
|
|
|
|
+ criteria = Criteria.where("_id").is(itemId);
|
|
|
|
+ Query query = new Query(criteria);
|
|
|
|
+ ItemCheck itemCheck = mongoTemplate.findOne(query, ItemCheck.class);
|
|
|
|
+ if (Check.isNull(itemCheck)) {
|
|
|
|
+ yuxiuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(itemCheck)) {
|
|
|
|
+ String ownership = itemCheck.getOwnership();
|
|
|
|
+ if ("ruixuan".equals(ownership)) {
|
|
|
|
+ ruixuanList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ if ("miaogousi".equals(ownership)) {
|
|
|
|
+ mgsList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ if ("rocket".equals(ownership)) {
|
|
|
|
+ rocketList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ if ("yufu".equals(ownership)) {
|
|
|
|
+ yufuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ if ("yuxiu".equals(ownership)) {
|
|
|
|
+ yuxiuList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("===yuxiu查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("error_msg"));
|
|
|
|
+ log.error("yuxiu游标:{},执行次数:{}", pcursor, counts);
|
|
|
|
+ if (counts <= 3) {
|
|
|
|
+ getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(yuxiuList)) {
|
|
|
|
+ supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(ruixuanList)) {
|
|
|
|
+ supplyChainMapper.updateKuaishouSupplyChain(ruixuanList);
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(mgsList)) {
|
|
|
|
+ supplyChainMapper.updateMgsKuaishouSupplyChain(mgsList);
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(rocketList)) {
|
|
|
|
+ supplyChainMapper.updateRocketKuaishouSupplyChain(rocketList);
|
|
|
|
+ }
|
|
|
|
+ if (!Check.isNull(yufuList)) {
|
|
|
|
+ supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
|
|
+ }
|
|
|
|
+ if (!"nomore".equals(pcursor)) {
|
|
|
|
+ getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private KuaishouSupplyChain organizeData(JSONObject jsonObject, Map<Long, Long> itemMap) {
|
|
private KuaishouSupplyChain organizeData(JSONObject jsonObject, Map<Long, Long> itemMap) {
|
|
KuaishouSupplyChain supplyChain = new KuaishouSupplyChain();
|
|
KuaishouSupplyChain supplyChain = new KuaishouSupplyChain();
|
|
supplyChain.setOid(jsonObject.getLong("oid"));
|
|
supplyChain.setOid(jsonObject.getLong("oid"));
|
|
@@ -1089,21 +1300,27 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
for (KuaishouAccessToken mgsToken : mgsTokens) {
|
|
for (KuaishouAccessToken mgsToken : mgsTokens) {
|
|
getMgsInfoKuaishouActivityInfo(mgsToken, url);
|
|
getMgsInfoKuaishouActivityInfo(mgsToken, url);
|
|
}
|
|
}
|
|
- Thread.sleep(60000);
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
|
|
List<KuaishouAccessToken> rocketTokens = accessTokenService.getRocketTokenInfos();
|
|
for (KuaishouAccessToken token : rocketTokens) {
|
|
for (KuaishouAccessToken token : rocketTokens) {
|
|
getRocketInfoKuaishouActivityInfo(token, url);
|
|
getRocketInfoKuaishouActivityInfo(token, url);
|
|
}
|
|
}
|
|
- Thread.sleep(60000);
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
List<KuaishouAccessToken> tokens = accessTokenService.getTokenInfos();
|
|
List<KuaishouAccessToken> tokens = accessTokenService.getTokenInfos();
|
|
for (KuaishouAccessToken accessToken : tokens) {
|
|
for (KuaishouAccessToken accessToken : tokens) {
|
|
getInfoKuaishouActivityInfo(accessToken, url);
|
|
getInfoKuaishouActivityInfo(accessToken, url);
|
|
}
|
|
}
|
|
- Thread.sleep(60000);
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
List<KuaishouAccessToken> yufutokens = accessTokenService.getYufuTokenInfos();
|
|
List<KuaishouAccessToken> yufutokens = accessTokenService.getYufuTokenInfos();
|
|
for (KuaishouAccessToken accessToken : yufutokens) {
|
|
for (KuaishouAccessToken accessToken : yufutokens) {
|
|
getYufuInfoKuaishouActivityInfo(accessToken, url);
|
|
getYufuInfoKuaishouActivityInfo(accessToken, url);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Thread.sleep(30000);
|
|
|
|
+ List<KuaishouAccessToken> yuxiutokens = accessTokenService.getYuxiuTokenInfos();
|
|
|
|
+ for (KuaishouAccessToken accessToken : yuxiutokens) {
|
|
|
|
+ getYuxiuInfoKuaishouActivityInfo(accessToken, url);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1144,6 +1361,15 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
|
|
+ List<Long> yuxiuActivityIds = supplyChainMapper.getYuxiuKuaishouActivityInfoList();
|
|
|
|
+ List<KuaishouAccessToken> yuxiutokens = accessTokenService.getYuxiuTokenInfos();
|
|
|
|
+ for (KuaishouAccessToken accessToken : yuxiutokens) {
|
|
|
|
+ for (Long activityId : yuxiuActivityIds) {
|
|
|
|
+ getKuaishouActivityOpenItemList(accessToken, url, activityId, 1, "yuxiu");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1320,6 +1546,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
supplyChainMapper.replaceRocketKuaiShouActivityOpenItemList(list);
|
|
supplyChainMapper.replaceRocketKuaiShouActivityOpenItemList(list);
|
|
} else if ("yufu".equals(dbtype)) {
|
|
} else if ("yufu".equals(dbtype)) {
|
|
supplyChainMapper.replaceYufuKuaiShouActivityOpenItemList(list);
|
|
supplyChainMapper.replaceYufuKuaiShouActivityOpenItemList(list);
|
|
|
|
+ } else if ("yuxiu".equals(dbtype)) {
|
|
|
|
+ supplyChainMapper.replaceYuxiuKuaiShouActivityOpenItemList(list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1384,6 +1612,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
|
|
for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
|
|
supplyChainMapper.updateYufuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
|
|
supplyChainMapper.updateYufuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
|
|
}
|
|
}
|
|
|
|
+ } else if ("yuxiu".equals(dbtype)) {
|
|
|
|
+ for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
|
|
|
|
+ supplyChainMapper.updateYuxiuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1534,5 +1766,46 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
supplyChainMapper.replaceYufuKuaishouActivityInfo(list);
|
|
supplyChainMapper.replaceYufuKuaishouActivityInfo(list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void getYuxiuInfoKuaishouActivityInfo(KuaishouAccessToken accessToken, String url) {
|
|
|
|
+ List<KuaiShouActivityInfo> list = new ArrayList<>();
|
|
|
|
+ String appKey = accessToken.getAppKey();
|
|
|
|
+ String signSecret = accessToken.getSignSecret();
|
|
|
|
+ if (Check.isNull(signSecret) || Check.isNull(appKey)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ AccessTokenKsMerchantClient client = new AccessTokenKsMerchantClient(url, appKey, signSecret);
|
|
|
|
+ OpenDistributionInvestmentActivityOpenListRequest request = new OpenDistributionInvestmentActivityOpenListRequest();
|
|
|
|
+
|
|
|
|
+ request.setAccessToken(accessToken.getAccessToken());
|
|
|
|
+ request.setApiMethodVersion(1L);
|
|
|
|
+
|
|
|
|
+ //每页活动数量
|
|
|
|
+ request.setLimit(5000);
|
|
|
|
+ OpenDistributionInvestmentActivityOpenListResponse response = null;
|
|
|
|
+ try {
|
|
|
|
+ response = client.execute(request);
|
|
|
|
+ } catch (KsMerchantApiException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ JSONObject obj = JSONObject.parseObject(GsonUtils.toJSON(response));
|
|
|
|
+ String code = obj.getString("code");
|
|
|
|
+ if ("1".equals(code)) {
|
|
|
|
+ JSONObject data = obj.getJSONObject("data");
|
|
|
|
+ JSONArray result = data.getJSONArray("result");
|
|
|
|
+ for (int i = 0; i < result.size(); i++) {
|
|
|
|
+ JSONObject info = result.getJSONObject(i);
|
|
|
|
+ KuaiShouActivityInfo activityInfo = organizeKuaishouActivityInfo(info);
|
|
|
|
+ list.add(activityInfo);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("===Yuxiu团长查询招商活动列表(open.distribution.investment.activity.open.list)失败,信息:{}", obj.getString("msg"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Check.isNotNull(list) && list.size() > 0) {
|
|
|
|
+ supplyChainMapper.replaceYuxiuKuaishouActivityInfo(list);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|