完成气站标准资源全页管理改造
This commit is contained in:
@@ -163,6 +163,19 @@ func ListGasorderContractProduct(ctx *gin.Context) {
|
||||
listScoped(ctx, &models.GasorderContractProduct{}, query, "gasorder_contract_product.created_at desc")
|
||||
}
|
||||
|
||||
// GetGasorderContractProduct 返回当前气站合同范围内的单条合同气瓶。
|
||||
func GetGasorderContractProduct(ctx *gin.Context) {
|
||||
station, ok := currentGas(ctx)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
query := common.ActiveRecords(impl.DBService.Model(&models.GasorderContractProduct{})).
|
||||
Select("gasorder_contract_product.*").
|
||||
Joins("JOIN gasorder_contract ON gasorder_contract.id = gasorder_contract_product.gasorder_contract_id").
|
||||
Where("gasorder_contract_product.identity = ? AND gasorder_contract.gas_basic_id = ?", ctx.Param("identity"), station.ID)
|
||||
respondScopedRecord(ctx, query, &models.GasorderContractProduct{})
|
||||
}
|
||||
|
||||
// ListContractProductCandidate 仅返回当前气站服务用户名下可用于合同绑定的气瓶。
|
||||
func ListContractProductCandidate(ctx *gin.Context) {
|
||||
station, ok := currentGas(ctx)
|
||||
@@ -176,6 +189,19 @@ func ListContractProductCandidate(ctx *gin.Context) {
|
||||
listScoped(ctx, &models.ProductInfo{}, query, "product_info.created_at desc")
|
||||
}
|
||||
|
||||
// GetContractProductCandidate 返回当前气站服务用户范围内的单条候选气瓶。
|
||||
func GetContractProductCandidate(ctx *gin.Context) {
|
||||
station, ok := currentGas(ctx)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
query := common.ActiveRecords(impl.DBService.Model(&models.ProductInfo{})).
|
||||
Select("product_info.*").
|
||||
Joins("JOIN user_service_relation ON user_service_relation.user_account_id = product_info.user_account_id AND user_service_relation.status <> ?", common.StatusArchived).
|
||||
Where("product_info.identity = ? AND user_service_relation.gas_basic_id = ?", ctx.Param("identity"), station.ID)
|
||||
respondScopedRecord(ctx, query, &models.ProductInfo{})
|
||||
}
|
||||
|
||||
func ListGasorderContractRevision(ctx *gin.Context) {
|
||||
station, ok := currentGas(ctx)
|
||||
if !ok {
|
||||
@@ -187,6 +213,19 @@ func ListGasorderContractRevision(ctx *gin.Context) {
|
||||
listScoped(ctx, &models.GasorderContractRevision{}, query, "gasorder_contract_revision.created_at desc")
|
||||
}
|
||||
|
||||
// GetGasorderContractRevision 返回当前气站合同范围内的单条修订记录。
|
||||
func GetGasorderContractRevision(ctx *gin.Context) {
|
||||
station, ok := currentGas(ctx)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
query := common.ActiveRecords(impl.DBService.Model(&models.GasorderContractRevision{})).
|
||||
Select("gasorder_contract_revision.*").
|
||||
Joins("JOIN gasorder_contract ON gasorder_contract.id = gasorder_contract_revision.gasorder_contract_id").
|
||||
Where("gasorder_contract_revision.identity = ? AND gasorder_contract.gas_basic_id = ?", ctx.Param("identity"), station.ID)
|
||||
respondScopedRecord(ctx, query, &models.GasorderContractRevision{})
|
||||
}
|
||||
|
||||
func ListGasorderBasic(ctx *gin.Context) {
|
||||
station, ok := currentGas(ctx)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user