|
@@ -91,8 +91,13 @@ public class KD100Util {
|
|
|
if (Objects.equals(message, "ok")) {
|
|
|
Integer state = result.getState();
|
|
|
if (!Objects.equals(state, KD100Status.STATUS_3)) {
|
|
|
- // 如果不是已签收状态,则开启订阅(物流状态跟踪并推送)
|
|
|
- KD100Util.subscribe(com, num);
|
|
|
+ //判断是否已经订阅过 防止重复订阅
|
|
|
+ LogisticsInfoService logisticsInfoService = SpringUtil.getBean(LogisticsInfoService.class);
|
|
|
+ long count = logisticsInfoService.count(q -> q.eq(LogisticsInfo::getNumber, num).eq(LogisticsInfo::getCompany, com));
|
|
|
+ if (count == 0) {
|
|
|
+ // 如果不是已签收状态,则开启订阅(物流状态跟踪并推送)
|
|
|
+ KD100Util.subscribe(com, num);
|
|
|
+ }
|
|
|
}
|
|
|
return saveInfo(com, num, state, businessId, businessType, cls);
|
|
|
} else {
|