From 53b44dab82da8c59fdabbd8099a2af59ca3e6f3c Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期四, 09 十一月 2023 15:41:06 +0800
Subject: [PATCH] 销售明细状态更新修改
---
api/v1/salesDetails.go | 8 ++--
model/request/salesDetails.go | 5 ++
router/salesDetails.go | 1
docs/swagger.yaml | 44 +++++++++++++---------
docs/docs.go | 17 +++++++-
docs/swagger.json | 17 +++++++-
6 files changed, 66 insertions(+), 26 deletions(-)
diff --git a/api/v1/salesDetails.go b/api/v1/salesDetails.go
index 4ad4730..dcd825e 100644
--- a/api/v1/salesDetails.go
+++ b/api/v1/salesDetails.go
@@ -209,18 +209,18 @@
// @Tags SalesDetails
// @Summary 鏇存柊閿�鍞槑缁嗙姸鎬�
// @Produce application/json
-// @Param object body request.UpdateSalesDetails true "鏌ヨ鍙傛暟"
+// @Param object body request.UpdateSalesDetailsStatus true "鏌ヨ鍙傛暟"
// @Success 200 {object} contextx.Response{}
-// @Router /api/salesDetails/update [post]
+// @Router /api/salesDetails/updateStatus [post]
func (s *SalesDetailsApi) UpdateStatus(c *gin.Context) {
- var params request.UpdateSalesDetails
+ var params request.UpdateSalesDetailsStatus
ctx, ok := contextx.NewContext(c, ¶ms)
if !ok {
return
}
m := make(map[string]interface{})
- m["status"] = params.SalesDetails.Status
+ m["status"] = params.Status
err := model.NewSalesDetailsSearch().SetId(params.Id).UpdateByMap(m)
if err != nil {
ctx.FailWithMsg(ecode.UnknownErr, "鏇存柊澶辫触")
diff --git a/docs/docs.go b/docs/docs.go
index 73b05bd..294962d 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -7148,7 +7148,9 @@
}
}
}
- },
+ }
+ },
+ "/api/salesDetails/updateStatus": {
"post": {
"produces": [
"application/json"
@@ -7164,7 +7166,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/request.UpdateSalesDetails"
+ "$ref": "#/definitions/request.UpdateSalesDetailsStatus"
}
}
],
@@ -17811,6 +17813,17 @@
}
}
},
+ "request.UpdateSalesDetailsStatus": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
+ }
+ }
+ },
"request.UpdateSalesLeads": {
"type": "object",
"properties": {
diff --git a/docs/swagger.json b/docs/swagger.json
index 0cb5b92..95efe8d 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -7136,7 +7136,9 @@
}
}
}
- },
+ }
+ },
+ "/api/salesDetails/updateStatus": {
"post": {
"produces": [
"application/json"
@@ -7152,7 +7154,7 @@
"in": "body",
"required": true,
"schema": {
- "$ref": "#/definitions/request.UpdateSalesDetails"
+ "$ref": "#/definitions/request.UpdateSalesDetailsStatus"
}
}
],
@@ -17799,6 +17801,17 @@
}
}
},
+ "request.UpdateSalesDetailsStatus": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
+ }
+ }
+ },
"request.UpdateSalesLeads": {
"type": "object",
"properties": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index a6cfba3..aa85bd5 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -5180,6 +5180,13 @@
salesDetails:
$ref: '#/definitions/request.SalesDetails'
type: object
+ request.UpdateSalesDetailsStatus:
+ properties:
+ id:
+ type: integer
+ status:
+ $ref: '#/definitions/constvar.SalesDetailsStatus'
+ type: object
request.UpdateSalesLeads:
properties:
city_id:
@@ -10710,24 +10717,6 @@
tags:
- SalesDetails
/api/salesDetails/update:
- post:
- parameters:
- - description: 鏌ヨ鍙傛暟
- in: body
- name: object
- required: true
- schema:
- $ref: '#/definitions/request.UpdateSalesDetails'
- produces:
- - application/json
- responses:
- "200":
- description: OK
- schema:
- $ref: '#/definitions/contextx.Response'
- summary: 鏇存柊閿�鍞槑缁嗙姸鎬�
- tags:
- - SalesDetails
put:
parameters:
- description: 鏌ヨ鍙傛暟
@@ -10746,6 +10735,25 @@
summary: 鏇存柊閿�鍞槑缁�
tags:
- SalesDetails
+ /api/salesDetails/updateStatus:
+ post:
+ parameters:
+ - description: 鏌ヨ鍙傛暟
+ in: body
+ name: object
+ required: true
+ schema:
+ $ref: '#/definitions/request.UpdateSalesDetailsStatus'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/contextx.Response'
+ summary: 鏇存柊閿�鍞槑缁嗙姸鎬�
+ tags:
+ - SalesDetails
/api/salesLeads/add:
post:
parameters:
diff --git a/model/request/salesDetails.go b/model/request/salesDetails.go
index 56d6a62..4915b69 100644
--- a/model/request/salesDetails.go
+++ b/model/request/salesDetails.go
@@ -39,6 +39,11 @@
SalesDetails SalesDetails `json:"salesDetails"`
}
+type UpdateSalesDetailsStatus struct {
+ Id int `json:"id"`
+ Status constvar.SalesDetailsStatus `json:"status" gorm:"column:status;type:int;comment:鐘舵��"`
+}
+
type GetSalesDetailsList struct {
PageInfo
KeywordType constvar.SalesDetailsKeywordType `json:"keywordType"`
diff --git a/router/salesDetails.go b/router/salesDetails.go
index cbf2ff9..fdcf041 100644
--- a/router/salesDetails.go
+++ b/router/salesDetails.go
@@ -15,6 +15,7 @@
salesDetailsRouter.DELETE("delete/:id", salesDetailsApi.Delete) // 鍒犻櫎閿�鍞槑缁�
salesDetailsRouter.DELETE("delete", salesDetailsApi.BatchDelete) // 鎵归噺鍒犻櫎閿�鍞槑缁�
salesDetailsRouter.PUT("update", salesDetailsApi.Update) // 鏇存柊閿�鍞槑缁�
+ salesDetailsRouter.PUT("updateStatus", salesDetailsApi.UpdateStatus) // 鏇存柊閿�鍞槑缁嗙姸鎬�
salesDetailsRouter.POST("list", salesDetailsApi.List) // 鑾峰彇閿�鍞槑缁嗗崟鍒楄〃
salesDetailsRouter.GET("getProductInventoryInfo/:number", salesDetailsApi.GetProductInventoryInfo) // 鑾峰彇浜у搧搴撳瓨淇℃伅
salesDetailsRouter.POST("createOperation", salesDetailsApi.CreateOperation) // 鍒涘缓浜у搧鍑哄簱淇℃伅
--
Gitblit v1.8.0