优化气站订单合同气瓶候选选择

This commit is contained in:
czl231
2026-08-18 23:43:59 +08:00
parent 9a31cadf5f
commit 569ac314b1
5 changed files with 112 additions and 1 deletions

View File

@@ -206,6 +206,14 @@ func ListGasorderContractProduct(ctx *gin.Context) {
if !ok {
return
}
// 订单候选场景先校验合同属于当前气站,再复用可读名称和有效绑定过滤。
if contractIdentity := strings.TrimSpace(ctx.Query("contract_identity")); contractIdentity != "" {
if _, ok := scopedContract(ctx, contractIdentity, station.ID); !ok {
return
}
platformgasorder.ListGasorderContractProduct(ctx)
return
}
query := common.ActiveRecords(impl.DBService.Model(&models.GasorderContractProduct{})).
Joins("JOIN gasorder_contract ON gasorder_contract.id = gasorder_contract_product.gasorder_contract_id").
Where("gasorder_contract.gas_basic_id = ?", station.ID)