优化接单模板改价同步范围
This commit is contained in:
@@ -132,14 +132,14 @@ export async function getWorkProductRuleById(
|
||||
return result.rows[0] || null
|
||||
}
|
||||
|
||||
/** 查询尚未形成不可变履约合同、需要跟随模板价格更新的工单。 */
|
||||
/** 查询已经进入接单大厅、需要立即跟随模板价格更新的工单。 */
|
||||
export async function listWorkOrdersForPriceSyncByProductRuleId(
|
||||
ruleId: number | string,
|
||||
client?: Pick<PoolClient, 'query'>,
|
||||
): Promise<WorkOrderRow[]> {
|
||||
const sql = `${WORK_ORDER_SELECT}
|
||||
WHERE wo.product_rule_id = $1
|
||||
AND wo.status IN ('pending_material', 'unassigned', 'open')
|
||||
AND wo.status = 'open'
|
||||
ORDER BY wo.id ASC`
|
||||
const result = client
|
||||
? await client.query<WorkOrderRow>(sql, [Number(ruleId)])
|
||||
|
||||
Reference in New Issue
Block a user