|
@@ -171,6 +171,8 @@ public class DfOrderServiceImpl implements IErpOrderService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsStoreServiceImpl fsStoreServiceImpl;
|
|
private FsStoreServiceImpl fsStoreServiceImpl;
|
|
|
|
|
|
|
|
|
|
+ private final String signedKey = "ai:express:signed:sent:";
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public ErpOrderResponse addOrder(ErpOrder order) {
|
|
public ErpOrderResponse addOrder(ErpOrder order) {
|
|
|
if (!Objects.isNull(order.getIsIntegralOrder()) && order.getIsIntegralOrder())
|
|
if (!Objects.isNull(order.getIsIntegralOrder()) && order.getIsIntegralOrder())
|
|
@@ -900,6 +902,13 @@ public class DfOrderServiceImpl implements IErpOrderService {
|
|
|
case 4:
|
|
case 4:
|
|
|
case 5:
|
|
case 5:
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ boolean signed = redisCache.sIsMember(signedKey, orderId.toString());
|
|
|
|
|
+ if ("301".equals(stateEx) && signed){
|
|
|
|
|
+ log.info("签收消息已发送过,跳过 - orderId: {}", orderId);
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (!"".contentEquals(sBuilder)) {
|
|
if (!"".contentEquals(sBuilder)) {
|
|
|
//2.发送模板中的文字内容
|
|
//2.发送模板中的文字内容
|
|
|
String content = sBuilder.toString();
|
|
String content = sBuilder.toString();
|
|
@@ -927,6 +936,10 @@ public class DfOrderServiceImpl implements IErpOrderService {
|
|
|
redisCache.setCacheObject(todayRedisKey, "1", (int) secondsUntilTomorrow, java.util.concurrent.TimeUnit.SECONDS);
|
|
redisCache.setCacheObject(todayRedisKey, "1", (int) secondsUntilTomorrow, java.util.concurrent.TimeUnit.SECONDS);
|
|
|
log.info("设置今天Redis发送标识 - orderId: {}, todayRedisKey: {}, 过期时间(秒): {}", orderId, todayRedisKey, secondsUntilTomorrow);
|
|
log.info("设置今天Redis发送标识 - orderId: {}, todayRedisKey: {}, 过期时间(秒): {}", orderId, todayRedisKey, secondsUntilTomorrow);
|
|
|
|
|
|
|
|
|
|
+ // 设置已签收的发送标识
|
|
|
|
|
+ if ("301".equals(stateEx)){
|
|
|
|
|
+ redisCache.sAdd(signedKey, orderId.toString());
|
|
|
|
|
+ }
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("AI物流消息发送失败 - orderId: {}, sendId: {}, 错误信息: {}", orderId, sendId, e.getMessage(), e);
|
|
log.error("AI物流消息发送失败 - orderId: {}, sendId: {}, 错误信息: {}", orderId, sendId, e.getMessage(), e);
|
|
|
}
|
|
}
|