|
@@ -458,6 +458,11 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yuxiu > 0) {
|
|
if (yuxiu > 0) {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (zhishui > 0) {
|
|
|
|
+ return zhishui;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if ("miaogousi".equals(ownershipId)) {
|
|
if ("miaogousi".equals(ownershipId)) {
|
|
int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
|
|
int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
|
|
@@ -481,6 +486,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (zhishui > 0) {
|
|
|
|
+ return zhishui;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if ("rocket".equals(ownershipId)) {
|
|
if ("rocket".equals(ownershipId)) {
|
|
int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
@@ -503,6 +512,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yuxiu > 0) {
|
|
if (yuxiu > 0) {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (zhishui > 0) {
|
|
|
|
+ return zhishui;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
if ("yufu".equals(ownershipId)) {
|
|
if ("yufu".equals(ownershipId)) {
|
|
@@ -526,6 +539,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yuxiu > 0) {
|
|
if (yuxiu > 0) {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (zhishui > 0) {
|
|
|
|
+ return zhishui;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if ("yuxiu".equals(ownershipId)) {
|
|
if ("yuxiu".equals(ownershipId)) {
|
|
@@ -549,6 +566,40 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (zhishui > 0) {
|
|
|
|
+ return zhishui;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ("zhishui".equals(ownershipId)) {
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (zhishui > 0) {
|
|
|
|
+ return zhishui;
|
|
|
|
+ }
|
|
|
|
+ int yuxiu = supplyChainMapper.updateYuXiuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yuxiu > 0) {
|
|
|
|
+ return yuxiu;
|
|
|
|
+ }
|
|
|
|
+ int ruixuan = supplyChainMapper.updateRuixuanOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (ruixuan > 0) {
|
|
|
|
+ return ruixuan;
|
|
|
|
+ }
|
|
|
|
+ int mgs = supplyChainMapper.updateMgsOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (mgs > 0) {
|
|
|
|
+ return mgs;
|
|
|
|
+ }
|
|
|
|
+ int rocket = supplyChainMapper.updateRocketOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (rocket > 0) {
|
|
|
|
+ return rocket;
|
|
|
|
+ }
|
|
|
|
+ int yufu = supplyChainMapper.updateYufuOrder(oid, cpsOrderStatus);
|
|
|
|
+ if (yufu > 0) {
|
|
|
|
+ return yufu;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
if ("zhishui".equals(ownershipId)) {
|
|
if ("zhishui".equals(ownershipId)) {
|
|
@@ -605,7 +656,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yuxiu > 0) {
|
|
if (yuxiu > 0) {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
- int zhishui = supplyChainMapper.updatezhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (zhishui > 0) {
|
|
if (zhishui > 0) {
|
|
return zhishui;
|
|
return zhishui;
|
|
}
|
|
}
|
|
@@ -632,7 +683,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yuxiu > 0) {
|
|
if (yuxiu > 0) {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
- int zhishui = supplyChainMapper.updatezhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (zhishui > 0) {
|
|
if (zhishui > 0) {
|
|
return zhishui;
|
|
return zhishui;
|
|
}
|
|
}
|
|
@@ -659,7 +710,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yuxiu > 0) {
|
|
if (yuxiu > 0) {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
- int zhishui = supplyChainMapper.updatezhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (zhishui > 0) {
|
|
if (zhishui > 0) {
|
|
return zhishui;
|
|
return zhishui;
|
|
}
|
|
}
|
|
@@ -675,12 +726,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (ruixuan > 0) {
|
|
if (ruixuan > 0) {
|
|
return ruixuan;
|
|
return ruixuan;
|
|
}
|
|
}
|
|
-
|
|
|
|
int mgs = supplyChainMapper.updateMgsOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
int mgs = supplyChainMapper.updateMgsOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (mgs > 0) {
|
|
if (mgs > 0) {
|
|
return mgs;
|
|
return mgs;
|
|
}
|
|
}
|
|
-
|
|
|
|
int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
int rocket = supplyChainMapper.updateRocketOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (rocket > 0) {
|
|
if (rocket > 0) {
|
|
return rocket;
|
|
return rocket;
|
|
@@ -691,7 +740,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
return yuxiu;
|
|
return yuxiu;
|
|
}
|
|
}
|
|
|
|
|
|
- int zhishui = supplyChainMapper.updatezhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (zhishui > 0) {
|
|
if (zhishui > 0) {
|
|
return zhishui;
|
|
return zhishui;
|
|
}
|
|
}
|
|
@@ -717,7 +766,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (yufu > 0) {
|
|
if (yufu > 0) {
|
|
return yufu;
|
|
return yufu;
|
|
}
|
|
}
|
|
- int zhishui = supplyChainMapper.updatezhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (zhishui > 0) {
|
|
if (zhishui > 0) {
|
|
return zhishui;
|
|
return zhishui;
|
|
}
|
|
}
|
|
@@ -725,7 +774,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
}
|
|
}
|
|
|
|
|
|
if ("zhishui".equals(ownershipId)) {
|
|
if ("zhishui".equals(ownershipId)) {
|
|
- int zhishui = supplyChainMapper.updatezhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
|
|
|
|
+ int zhishui = supplyChainMapper.updateZhishuiOrderRegimentalSettleAmount(oid, cpsOrderStatus);
|
|
if (zhishui > 0) {
|
|
if (zhishui > 0) {
|
|
return zhishui;
|
|
return zhishui;
|
|
}
|
|
}
|
|
@@ -805,6 +854,12 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Thread.sleep(3000);
|
|
|
|
+ List<KuaishouAccessToken> zhishuiTokens = accessTokenService.getZhishuiTokenInfos();
|
|
|
|
+ for (KuaishouAccessToken accessToken : zhishuiTokens) {
|
|
|
|
+ getZhishuiInfo(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 {
|
|
@@ -813,6 +868,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
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<>();
|
|
List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
+ List<Long> zhishuiList = 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)) {
|
|
@@ -881,6 +937,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yuxiu".equals(ownership)) {
|
|
if ("yuxiu".equals(ownership)) {
|
|
yuxiuList.add(info.getLong("oid"));
|
|
yuxiuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("zhishui".equals(ownership)) {
|
|
|
|
+ zhishuiList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -910,6 +969,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(zhishuiList)) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaishouSupplyChain(zhishuiList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -921,6 +983,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
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<>();
|
|
List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
+ List<Long> zhishuiList = new ArrayList<>();
|
|
|
|
|
|
String appKey = accessToken.getAppKey();
|
|
String appKey = accessToken.getAppKey();
|
|
String signSecret = accessToken.getSignSecret();
|
|
String signSecret = accessToken.getSignSecret();
|
|
@@ -989,6 +1052,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yuxiu".equals(ownership)) {
|
|
if ("yuxiu".equals(ownership)) {
|
|
yuxiuList.add(info.getLong("oid"));
|
|
yuxiuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("zhishui".equals(ownership)) {
|
|
|
|
+ zhishuiList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1015,6 +1081,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(zhishuiList)) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaishouSupplyChain(zhishuiList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getMgsInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -1026,6 +1095,7 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
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<>();
|
|
List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
+ List<Long> zhishuiList = new ArrayList<>();
|
|
|
|
|
|
String appKey = accessToken.getAppKey();
|
|
String appKey = accessToken.getAppKey();
|
|
String signSecret = accessToken.getSignSecret();
|
|
String signSecret = accessToken.getSignSecret();
|
|
@@ -1093,6 +1163,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yuxiu".equals(ownership)) {
|
|
if ("yuxiu".equals(ownership)) {
|
|
yuxiuList.add(info.getLong("oid"));
|
|
yuxiuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("zhishui".equals(ownership)) {
|
|
|
|
+ zhishuiList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1118,6 +1191,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(zhishuiList)) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaishouSupplyChain(zhishuiList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getRocketInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -1130,6 +1206,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
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<>();
|
|
List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
+ List<Long> zhishuiList = 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)) {
|
|
@@ -1196,6 +1274,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yuxiu".equals(ownership)) {
|
|
if ("yuxiu".equals(ownership)) {
|
|
yuxiuList.add(info.getLong("oid"));
|
|
yuxiuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("zhishui".equals(ownership)) {
|
|
|
|
+ zhishuiList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1221,6 +1302,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
if (!Check.isNull(yuxiuList)) {
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
supplyChainMapper.updateYuxiuKuaishouSupplyChain(yuxiuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(zhishuiList)) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaishouSupplyChain(zhishuiList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getYufuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
@@ -1232,6 +1316,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
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<>();
|
|
List<Long> yuxiuList = new ArrayList<>();
|
|
|
|
+ List<Long> zhishuiList = 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)) {
|
|
@@ -1298,6 +1385,9 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if ("yuxiu".equals(ownership)) {
|
|
if ("yuxiu".equals(ownership)) {
|
|
yuxiuList.add(info.getLong("oid"));
|
|
yuxiuList.add(info.getLong("oid"));
|
|
}
|
|
}
|
|
|
|
+ if ("zhishui".equals(ownership)) {
|
|
|
|
+ zhishuiList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1323,11 +1413,125 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
if (!Check.isNull(yufuList)) {
|
|
if (!Check.isNull(yufuList)) {
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
supplyChainMapper.updateYufuKuaishouSupplyChain(yufuList);
|
|
}
|
|
}
|
|
|
|
+ if (!Check.isNull(zhishuiList)) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaishouSupplyChain(zhishuiList);
|
|
|
|
+ }
|
|
if (!"nomore".equals(pcursor)) {
|
|
if (!"nomore".equals(pcursor)) {
|
|
getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
getYuxiuInfo(accessToken, beginTime, endTime, url, pcursor, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void getZhishuiInfo(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<>();
|
|
|
|
+ List<Long> zhishuiList = 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)) {
|
|
|
|
+ zhishuiList.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"));
|
|
|
|
+ }
|
|
|
|
+ if ("zhishui".equals(ownership)) {
|
|
|
|
+ zhishuiList.add(info.getLong("oid"));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ log.error("===zhishui查询分销团长订单列表(open.distribution.cps.leader.order.cursor.list)失败,信息:{}", obj.getString("error_msg"));
|
|
|
|
+ log.error("zhishui游标:{},执行次数:{}", pcursor, counts);
|
|
|
|
+ if (counts <= 3) {
|
|
|
|
+ getZhishuiInfo(accessToken, beginTime, endTime, url, pcursor, counts + 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!Check.isNull(zhishuiList)) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaishouSupplyChain(zhishuiList);
|
|
|
|
+ }
|
|
|
|
+ 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)) {
|
|
|
|
+ getZhishuiInfo(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"));
|
|
@@ -1409,6 +1613,12 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
for (KuaishouAccessToken accessToken : yuxiutokens) {
|
|
for (KuaishouAccessToken accessToken : yuxiutokens) {
|
|
getYuxiuInfoKuaishouActivityInfo(accessToken, url);
|
|
getYuxiuInfoKuaishouActivityInfo(accessToken, url);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ Thread.sleep(3000);
|
|
|
|
+ List<KuaishouAccessToken> zhishuitokens = accessTokenService.getZhishuiTokenInfos();
|
|
|
|
+ for (KuaishouAccessToken accessToken : zhishuitokens) {
|
|
|
|
+ getZhishuiInfoKuaishouActivityInfo(accessToken, url);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1458,6 +1668,15 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Thread.sleep(30000);
|
|
|
|
+ List<Long> zhishuiActivityIds = supplyChainMapper.getZhishuiKuaishouActivityInfoList();
|
|
|
|
+ List<KuaishouAccessToken> zhishuitokens = accessTokenService.getZhishuiTokenInfos();
|
|
|
|
+ for (KuaishouAccessToken accessToken : zhishuitokens) {
|
|
|
|
+ for (Long activityId : zhishuiActivityIds) {
|
|
|
|
+ getKuaishouActivityOpenItemList(accessToken, url, activityId, 1, "zhishui");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -1636,6 +1855,8 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
supplyChainMapper.replaceYufuKuaiShouActivityOpenItemList(list);
|
|
supplyChainMapper.replaceYufuKuaiShouActivityOpenItemList(list);
|
|
} else if ("yuxiu".equals(dbtype)) {
|
|
} else if ("yuxiu".equals(dbtype)) {
|
|
supplyChainMapper.replaceYuxiuKuaiShouActivityOpenItemList(list);
|
|
supplyChainMapper.replaceYuxiuKuaiShouActivityOpenItemList(list);
|
|
|
|
+ } else if ("zhishui".equals(dbtype)) {
|
|
|
|
+ supplyChainMapper.replaceZhishuiKuaiShouActivityOpenItemList(list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1704,6 +1925,10 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
|
|
for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
|
|
supplyChainMapper.updateYuxiuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
|
|
supplyChainMapper.updateYuxiuKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
|
|
}
|
|
}
|
|
|
|
+ } else if ("zhishui".equals(dbtype)) {
|
|
|
|
+ for (KuaiShouActivityOpenItemList kuaiShouActivityOpenItemList : list) {
|
|
|
|
+ supplyChainMapper.updateZhishuiKuaiShouActivityOpenItemList(kuaiShouActivityOpenItemList);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
@@ -1895,5 +2120,46 @@ public class SupplyChainServiceImpl implements ISupplyChainService {
|
|
supplyChainMapper.replaceYuxiuKuaishouActivityInfo(list);
|
|
supplyChainMapper.replaceYuxiuKuaishouActivityInfo(list);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private void getZhishuiInfoKuaishouActivityInfo(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(200);
|
|
|
|
+ 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("===zhishui团长查询招商活动列表(open.distribution.investment.activity.open.list)失败,信息:{}", obj.getString("msg"));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (Check.isNotNull(list) && list.size() > 0) {
|
|
|
|
+ supplyChainMapper.replaceZhishuiKuaishouActivityInfo(list);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|