order info 增加预约下单的相关三字段

This commit is contained in:
Jack 2025-10-21 16:27:24 +08:00
parent aeb3c0d029
commit 2b03dee62d
4 changed files with 99 additions and 82 deletions

View File

@ -75,7 +75,7 @@ public class ShopOrderInfo implements Serializable {
@ApiModelProperty(value = "下单时间:检索使用") @ApiModelProperty(value = "下单时间:检索使用")
private Long order_time; private Long order_time;
@ApiModelProperty(value = "当前状态的处理时间") @ApiModelProperty(value = "当前状态的处理时间,一般是确认收货时间")
private Long order_deal_time; private Long order_deal_time;
@ApiModelProperty(value = "买家删除(BOOL): 1-是; 0-否") @ApiModelProperty(value = "买家删除(BOOL): 1-是; 0-否")
@ -204,6 +204,15 @@ public class ShopOrderInfo implements Serializable {
@ApiModelProperty(value = "拣货完成时间戳") @ApiModelProperty(value = "拣货完成时间戳")
private Long order_picked_time; private Long order_picked_time;
@ApiModelProperty(value = "订单配送预约状态1-立即配送2-预约配送")
private Integer booking_state;
@ApiModelProperty(value = "预约送达起始时间格式如10:15")
private String booking_begin_time;
@ApiModelProperty(value = "预约送达截止时间格式如10:45")
private String booking_end_time;
@ApiModelProperty(value = "新建时间") @ApiModelProperty(value = "新建时间")
private Date created_at; private Date created_at;

View File

@ -3050,9 +3050,9 @@ public class LakalaApiServiceImpl implements LakalaApiService {
public Integer fixUnSuccessSeparateStatusJob() { public Integer fixUnSuccessSeparateStatusJob() {
log.info("[分账状态修复任务] 开始执行未成功分账记录的状态修复任务"); log.info("[分账状态修复任务] 开始执行未成功分账记录的状态修复任务");
// 获取2天前分账状态未成功的记录 // 获取3天前分账状态未成功的记录
Date now = new Date(); Date endDate = new Date();
Date threeDaysAgo = DateUtils.addHours(now, -48); Date beginDate = DateUtils.addDays(endDate, -3); // 3天前
// 分页参数 // 分页参数
int pageSize = 200; int pageSize = 200;
@ -3062,11 +3062,13 @@ public class LakalaApiServiceImpl implements LakalaApiService {
// 记录处理开始时间 // 记录处理开始时间
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
String redisPrefKey = "lkl:separate:status:retry:";
try {
List<LklOrderSeparate> lklOrderSeparates; List<LklOrderSeparate> lklOrderSeparates;
do { do {
// 分页获取未成功分账的记录 // 分页获取未成功分账的记录
lklOrderSeparates = lklOrderSeparateService.getUnSuccessSeparateList(threeDaysAgo, now, currentPage, pageSize); lklOrderSeparates = lklOrderSeparateService.getUnSuccessSeparateList(beginDate, endDate, currentPage, pageSize);
if (CollectionUtil.isEmpty(lklOrderSeparates)) { if (CollectionUtil.isEmpty(lklOrderSeparates)) {
break; break;
@ -3074,8 +3076,6 @@ public class LakalaApiServiceImpl implements LakalaApiService {
log.info("[分账状态修复任务] 获取到第{}页数据,共{}条记录", currentPage, lklOrderSeparates.size()); log.info("[分账状态修复任务] 获取到第{}页数据,共{}条记录", currentPage, lklOrderSeparates.size());
String redisPrefKey = "lkl:separate:status:retry:";
// 按处理次数排序从未处理过的记录优先处理处理次数越多优先级越低 // 按处理次数排序从未处理过的记录优先处理处理次数越多优先级越低
lklOrderSeparates.sort((o1, o2) -> { lklOrderSeparates.sort((o1, o2) -> {
String redisKey1 = redisPrefKey + o1.getSeparate_no(); String redisKey1 = redisPrefKey + o1.getSeparate_no();
@ -3111,7 +3111,7 @@ public class LakalaApiServiceImpl implements LakalaApiService {
redisService.incr(redisKey, 1); redisService.incr(redisKey, 1);
redisService.expire(redisKey, 3 * 24 * 60 * 60); redisService.expire(redisKey, 3 * 24 * 60 * 60);
// 调用分账通知回调接口进行状态补偿 // 调用拉卡拉分账通知回调接口进行状态补偿
JSONObject notifyResp = sacsSeparateNotify(null, record.getMerchant_no(), record.getSeparate_no()); JSONObject notifyResp = sacsSeparateNotify(null, record.getMerchant_no(), record.getSeparate_no());
// 检查处理结果 // 检查处理结果
@ -3141,21 +3141,25 @@ public class LakalaApiServiceImpl implements LakalaApiService {
currentPage++; currentPage++;
// 添加短暂延迟避免对系统造成过大压力 // 添加短暂延迟避免对系统造成过大压力
try {
Thread.sleep(100); Thread.sleep(100);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
break;
}
} while (!CollectionUtil.isEmpty(lklOrderSeparates)); } while (!CollectionUtil.isEmpty(lklOrderSeparates));
} catch (InterruptedException e) {
log.warn("[分账状态修复任务] 任务被中断");
Thread.currentThread().interrupt();
} catch (Exception e) {
log.error("[分账状态修复任务] 任务执行过程中发生异常", e);
}
long endTime = System.currentTimeMillis(); long endTime = System.currentTimeMillis();
log.info("[分账状态修复任务] 任务执行完成,总共处理 {} 条记录,成功处理 {} 条记录,耗时 {} ms", log.info("[分账状态修复任务] 任务执行完成,总共处理 {} 条记录,成功处理 {} 条记录,耗时 {} ms",
totalProcessed, totalSuccessCount, (endTime - startTime)); totalProcessed, totalSuccessCount, (endTime - startTime));
return totalSuccessCount; return totalSuccessCount;
} }
/** /**
* 检测修复补全商户的商户分账业务信息及分账接收方绑定关系分账业务申请异步通知的补偿机制 * 检测修复补全商户的商户分账业务信息及分账接收方绑定关系分账业务申请异步通知的补偿机制
* *

View File

@ -9,6 +9,7 @@ import com.suisung.mall.common.constant.CommonConstant;
import com.suisung.mall.common.constant.MqConstant; import com.suisung.mall.common.constant.MqConstant;
import com.suisung.mall.common.constant.RedisConstant; import com.suisung.mall.common.constant.RedisConstant;
import com.suisung.mall.common.modules.order.ShopOrderInfo; import com.suisung.mall.common.modules.order.ShopOrderInfo;
import com.suisung.mall.common.utils.CheckUtil;
import com.suisung.mall.common.utils.DateTimeUtils; import com.suisung.mall.common.utils.DateTimeUtils;
import com.suisung.mall.core.web.service.RedisService; import com.suisung.mall.core.web.service.RedisService;
import com.suisung.mall.shop.message.service.PushMessageService; import com.suisung.mall.shop.message.service.PushMessageService;
@ -138,10 +139,10 @@ public class OrderPayedListener {
} }
} }
logger.info("[订单支付监听] 支付异步通知回调处理结果: {}, 订单ID: {}", flag, orderId); logger.info("[订单支付监听] 订单ID: {},支付异步通知回调处理是否成功: {} ", flag, orderId);
// 生成取单号和打印小票 // 生成取单号和打印小票
if (flag) { if (flag) {
// TODO 以下仅处理下单打印的情况还需要处理退单打印分支
// 原始状态 2010-待付款;2011--待订单审核;2013-待财务审核 变成 2020-待配货2016-已经付款 的时候 // 原始状态 2010-待付款;2011--待订单审核;2013-待财务审核 变成 2020-待配货2016-已经付款 的时候
// 生成取单号打票机打印订单向顺丰同城下单 // 生成取单号打票机打印订单向顺丰同城下单
@ -152,12 +153,14 @@ public class OrderPayedListener {
Long orderPickupNum = shopOrderInfoService.isPaidOrderGenPickNumAndPrint(orderInfoOld.getStore_id(), orderId); Long orderPickupNum = shopOrderInfoService.isPaidOrderGenPickNumAndPrint(orderInfoOld.getStore_id(), orderId);
// 如果配送方式是 顺丰同城下单 // 如果配送方式是 顺丰同城下单
if (orderInfoOld.getDelivery_type_id() != null && orderInfoOld.getDelivery_type_id().equals(StateCode.DELIVERY_TYPE_SAME_CITY) if (CheckUtil.isNotEmpty(orderInfoOld.getDelivery_type_id())
&& orderPickupNum > 0) { && orderInfoOld.getDelivery_type_id().equals(StateCode.DELIVERY_TYPE_SAME_CITY)
// 发送顺丰同城快递 && CheckUtil.isNotEmpty(orderPickupNum)) {
// 顺丰同城下单
Pair<Boolean, String> pairCreateSfOrder = sfExpressApiService.innerCreateSfExpressOrder(orderId, orderPickupNum); Pair<Boolean, String> pairCreateSfOrder = sfExpressApiService.innerCreateSfExpressOrder(orderId, orderPickupNum);
if (pairCreateSfOrder == null) { if (pairCreateSfOrder == null) {
logger.error("[订单支付监听] 顺丰同城下单失败pairCreateSfOrder 返回空值. 订单ID: {}", orderId); logger.error("[订单支付监听] 顺丰同城下单失败,无返回值 订单ID: {}", orderId);
continue; continue;
} }

View File

@ -11,7 +11,8 @@
order_is_received, chain_id, delivery_type_id, order_is_offline, cart_type_id, order_express_print, activity_id, order_is_received, chain_id, delivery_type_id, order_is_offline, cart_type_id, order_express_print, activity_id,
activity_type_id, salesperson_id, order_is_sync, store_is_selfsupport, store_type, order_erp_id, activity_type_id, salesperson_id, order_is_sync, store_is_selfsupport, store_type, order_erp_id,
distributor_user_id, order_is_cb, order_is_cb_sync, src_order_id, order_is_transfer, order_is_transfer_note, distributor_user_id, order_is_cb, order_is_cb_sync, src_order_id, order_is_transfer, order_is_transfer_note,
order_fx_is_settlemented, order_fx_settlement_time, order_pickup_num,order_picked_notice_count,order_picked_time order_fx_is_settlemented, order_fx_settlement_time, order_pickup_num,order_picked_notice_count,order_picked_time,
booking_state, booking_begin_time, booking_end_time,created_at, updated_at
</sql> </sql>
<!--// refundstatus 退款状态:0-是无退款;1-是部分退款;2-是全部退款 <!--// refundstatus 退款状态:0-是无退款;1-是部分退款;2-是全部退款