请购成功的版本

This commit is contained in:
2026-06-02 19:16:10 +08:00
parent 0f2e328455
commit 228c4cf732
6 changed files with 533 additions and 79 deletions

View File

@@ -37,10 +37,22 @@ public interface ILbGoodsService extends IService<LbGoods> {
Map<String, Object> syncFromHxrGoods(String tenantId, String token);
/**
* {@code total_money} 从大到小选取金额小于39000的 {@code lb_goods},调用 hxrd {@code /api/order/buy} 抢购;
* 分页拉取第三方 {@code /api/order/goods},仅组装为内存对象列表,不写入 {@code lb_goods}。
*
* @param token 可选;非空时作为请求头 token否则使用集成配置中的 goodsApiToken
*/
Map<String, Object> fetchGoodsFromHxrInMemory(String tenantId, String token);
/**
* 选取金额大于29000且24小时内更新的 {@code lb_goods},调用 hxrd {@code /api/order/buy} 抢购;
* 成功笔数达到 {@code maxBuyCount} 后停止,且循环抢购总次数不超过 {@code maxBuyCount} 的5倍。
*
* @param token 可选;非空时作为请求头 token否则使用 {@code lb_third_integration_config} 中的 goodsApiToken
* @param rushBuyAccountLabel 可选;批量账号抢单时传入,用于日志标识当前抢单账号
*/
Map<String, Object> rushBuy(String tenantId, String token, Integer maxBuyCount);
default Map<String, Object> rushBuy(String tenantId, String token, Integer maxBuyCount) {
return rushBuy(tenantId, token, maxBuyCount, null);
}
Map<String, Object> rushBuy(String tenantId, String token, Integer maxBuyCount, String rushBuyAccountLabel);
}