Compare commits

..

No commits in common. "095679c38e7d5d70c1963272c468139769700917" and "9b1a6034af214ba28c5936a8a2aab18ae7200648" have entirely different histories.

3 changed files with 2 additions and 8 deletions

View File

@ -3995,15 +3995,13 @@ class RecheckOrderService extends OrderBaseService {
);
// 步骤3:检查是否存在 wms_picking 记录(仅统计 pending 且未删除的记录)
// 使用 FOR UPDATE 行锁,防止并发事务读取到相同的 picking 记录导致重复扣减库存
const pickingRows = await ctx.model.query(
`SELECT id, storage_id, quantity, space_id
FROM wms_picking
WHERE order_id = :orderId
AND warehouse_id = :warehouseId
AND status = 'pending'
AND deleted_at IS NULL
FOR UPDATE`,
AND deleted_at IS NULL`,
{
replacements: { orderId, warehouseId },
type: ctx.model.QueryTypes.SELECT,

View File

@ -706,7 +706,7 @@ class ExpressPlatformService extends MainService {
let playload = {
object_Id: `${order.warehouse_id}_${order.id}_${order_tmp.business_key}`, // 菠萝派平台要求订单唯一标识必须为字符串
orderno: `${order.warehouse_id}_${order.id}_${order_tmp.business_key}`, // 菠萝派平台要求订单号必须为字符串
plattradeno: listByWarehousePlatformCode.platform_code === 'DY' && order.from_key === 23060081 && !!order.pay_no ? order.pay_no : order.source_order_codes || order.delivery_order_code || '',
plattradeno: listByWarehousePlatformCode.platform_code === 'DY' && order.from_key == 23060081? order.pay_no : order.source_order_codes || order.delivery_order_code || '',
ismultiplepieces: order.package_count > 1 ? 1 : 0,
logisticno: allocatedWaybillMap.get(`${Number(order.id) || 0}:${Number(order_tmp.business_key) || 0}`) || '',
logistictype: order.logistics_code || '',

View File

@ -335,7 +335,6 @@ class PickCompensationService extends MainService {
try {
// Step 1: 重新查询 wms_picking,确保只处理仍然 status='pending' 的记录
// 使用 FOR UPDATE 行锁,防止并发事务读取到相同的 picking 记录导致重复释放锁定库存
const confirmedRows = await ctx.model.query(`
SELECT
p.id,
@ -349,7 +348,6 @@ class PickCompensationService extends MainService {
AND p.storage_id IS NOT NULL
AND p.storage_id > 0
AND p.deleted_at IS NULL -- 排除软删除记录
FOR UPDATE
`, {
replacements: { pickingIds, warehouseId },
type: ctx.model.QueryTypes.SELECT,
@ -476,7 +474,6 @@ class PickCompensationService extends MainService {
try {
// Step 1: 重新查询 wms_picking,确保只处理仍然 status='pending' 的记录
// 使用 FOR UPDATE 行锁,防止并发事务读取到相同的 picking 记录导致重复扣减库存
const confirmedRows = await ctx.model.query(`
SELECT
p.id,
@ -490,7 +487,6 @@ class PickCompensationService extends MainService {
AND p.storage_id IS NOT NULL
AND p.storage_id > 0
AND p.deleted_at IS NULL -- 排除软删除记录
FOR UPDATE
`, {
replacements: { pickingIds, warehouseId },
type: ctx.model.QueryTypes.SELECT,