From ae4076a20e4b93703028dc1af321f6920290375f Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 10 十一月 2023 21:29:35 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/crm
---
api/v1/product.go | 7
model/request/salesDetails.go | 5
router/salesDetails.go | 1
docs/swagger.yaml | 136 +++++++
docs/docs.go | 209 ++++++++++++
docs/swagger.json | 209 ++++++++++++
proto/product_inventory/server.go | 27 +
conf/aps-crm.json | 1
proto/product_inventory/product_inventory.pb.go | 197 ++++++++++-
proto/product_inventory/product_inventory_grpc.pb.go | 36 ++
proto/product.proto | 3
api/v1/salesDetails.go | 17
proto/product/product.pb.go | 104 +++--
conf/config.go | 1
proto/product_inventory.proto | 13
main.go | 21 +
router/product.go | 5
17 files changed, 909 insertions(+), 83 deletions(-)
diff --git a/api/v1/product.go b/api/v1/product.go
index d8f910d..f1d1f7b 100644
--- a/api/v1/product.go
+++ b/api/v1/product.go
@@ -147,10 +147,11 @@
}
params := make([]*product.Info, 0)
for _, p := range first.Products {
- var pa *product.Info
+ var pa product.Info
pa.ProductId = p.Number
- pa.Time = utils.TimeToString(first.UpdatedAt)
- params = append(params, pa)
+ pa.StartTime = utils.TimeToString(first.UpdatedAt)
+ pa.EndTime = first.DeliveryDate
+ params = append(params, &pa)
}
client := product.NewProductServiceClient(productServiceConn)
info, err := client.GetProductOrder(ctx.GetCtx(), &product.GetProductOrderRequest{Params: params})
diff --git a/api/v1/salesDetails.go b/api/v1/salesDetails.go
index 4ad4730..4511e60 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, "鏇存柊澶辫触")
@@ -289,6 +289,13 @@
if !ok {
return
}
+ m := make(map[string]interface{})
+ m["status"] = params.Status
+ err := model.NewSalesDetailsSearch().SetNumber(params.Number).UpdateByMap(m)
+ if err != nil {
+ ctx.FailWithMsg(ecode.UnknownErr, "鐘舵�佹洿鏂板け璐�")
+ return
+ }
client := product_inventory.NewProductInventoryServiceClient(ProductInventoryServiceConn)
products := make([]*product_inventory.InventoryProduct, 0)
@@ -298,7 +305,7 @@
p.Amount = product.Amount.String()
products = append(products, &p)
}
- _, err := client.CreateOperation(ctx.GetCtx(), &product_inventory.CreateOperationRequest{
+ _, err = client.CreateOperation(ctx.GetCtx(), &product_inventory.CreateOperationRequest{
Number: params.Number,
Addressee: params.Addressee,
Address: params.Address,
diff --git a/conf/aps-crm.json b/conf/aps-crm.json
index 5ab8741..a56afa5 100644
--- a/conf/aps-crm.json
+++ b/conf/aps-crm.json
@@ -2,6 +2,7 @@
"system": {
"env": "develop",
"port": 8002,
+ "grpcPort": "9092",
"UseMultipoint": false,
"UseRedis": false,
"LimitCountIP": 15000,
diff --git a/conf/config.go b/conf/config.go
index b0dd58a..96fe2b2 100644
--- a/conf/config.go
+++ b/conf/config.go
@@ -49,6 +49,7 @@
System struct {
Env string // 鐜鍊� develop test public
Port int // 绔彛
+ GrpcPort string //grpc绔彛
DbType string // 鏁版嵁搴撶被鍨�
UseMultipoint bool // 澶氱偣鐧诲綍鎷︽埅
UseRedis bool // 浣跨敤redis
diff --git a/docs/docs.go b/docs/docs.go
index 8452e69..294962d 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -4917,6 +4917,49 @@
}
}
},
+ "/api/product/getProductOrderInfo/{number}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "浜у搧"
+ ],
+ "summary": "鑾峰彇浜у搧璁㈠崟淇℃伅",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "鏄庣粏缂栫爜",
+ "name": "number",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "鎴愬姛",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/contextx.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/product.WorkOrderInfo"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/product/info": {
"get": {
"produces": [
@@ -6919,6 +6962,36 @@
}
}
},
+ "/api/salesDetails/createOperation": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SalesDetails"
+ ],
+ "summary": "鍒涘缓浜у搧鍑哄簱淇℃伅",
+ "parameters": [
+ {
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.SalesDetails"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/response.ListResponse"
+ }
+ }
+ }
+ }
+ },
"/api/salesDetails/delete": {
"delete": {
"produces": [
@@ -6972,6 +7045,34 @@
"description": "OK",
"schema": {
"$ref": "#/definitions/contextx.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/salesDetails/getProductInventoryInfo/{number}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SalesDetails"
+ ],
+ "summary": "鑾峰彇浜у搧搴撳瓨淇℃伅",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "鏄庣粏缂栫爜",
+ "name": "number",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/response.ListResponse"
}
}
}
@@ -7036,6 +7137,36 @@
"required": true,
"schema": {
"$ref": "#/definitions/request.UpdateSalesDetails"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/contextx.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/salesDetails/updateStatus": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SalesDetails"
+ ],
+ "summary": "鏇存柊閿�鍞槑缁嗙姸鎬�",
+ "parameters": [
+ {
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.UpdateSalesDetailsStatus"
}
}
],
@@ -10361,6 +10492,27 @@
"SalesDetailsKeywordTypeProductName"
]
},
+ "constvar.SalesDetailsStatus": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "x-enum-comments": {
+ "OverCLose": "宸插叧闂�",
+ "OverOutbound": "鍑哄簱瀹屾垚",
+ "WaitConfirmed": "寰呯‘璁�",
+ "WaitOutbound": "寰呭嚭搴�"
+ },
+ "x-enum-varnames": [
+ "WaitConfirmed",
+ "WaitOutbound",
+ "OverOutbound",
+ "OverCLose"
+ ]
+ },
"constvar.SalesRefundKeywordType": {
"type": "string",
"enum": [
@@ -12235,6 +12387,12 @@
"signTime": {
"type": "string"
},
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
+ },
"updateTime": {
"type": "string"
},
@@ -13278,6 +13436,32 @@
"type": "string"
},
"Unit": {
+ "type": "string"
+ }
+ }
+ },
+ "product.WorkOrderInfo": {
+ "type": "object",
+ "properties": {
+ "EndTime": {
+ "type": "string"
+ },
+ "OrderId": {
+ "type": "string"
+ },
+ "OrderStatus": {
+ "type": "string"
+ },
+ "ProductName": {
+ "type": "string"
+ },
+ "StartTime": {
+ "type": "string"
+ },
+ "WorkOrderId": {
+ "type": "string"
+ },
+ "WorkOrderStatus": {
"type": "string"
}
}
@@ -14374,6 +14558,12 @@
},
"signTime": {
"type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
},
"wechatOrderStatusId": {
"type": "integer"
@@ -15571,7 +15761,7 @@
"$ref": "#/definitions/constvar.SalesDetailsKeywordType"
},
"number": {
- "description": "閿�鍞瓙鍗曞彿",
+ "description": "閿�鍞槑缁嗗崟鍙�",
"type": "string"
},
"page": {
@@ -15937,6 +16127,12 @@
},
"signTime": {
"type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
},
"wechatOrderStatusId": {
"type": "integer"
@@ -17617,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 64bc3af..95efe8d 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -4905,6 +4905,49 @@
}
}
},
+ "/api/product/getProductOrderInfo/{number}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "浜у搧"
+ ],
+ "summary": "鑾峰彇浜у搧璁㈠崟淇℃伅",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "鏄庣粏缂栫爜",
+ "name": "number",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "鎴愬姛",
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/definitions/contextx.Response"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/product.WorkOrderInfo"
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ },
"/api/product/info": {
"get": {
"produces": [
@@ -6907,6 +6950,36 @@
}
}
},
+ "/api/salesDetails/createOperation": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SalesDetails"
+ ],
+ "summary": "鍒涘缓浜у搧鍑哄簱淇℃伅",
+ "parameters": [
+ {
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.SalesDetails"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/response.ListResponse"
+ }
+ }
+ }
+ }
+ },
"/api/salesDetails/delete": {
"delete": {
"produces": [
@@ -6960,6 +7033,34 @@
"description": "OK",
"schema": {
"$ref": "#/definitions/contextx.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/salesDetails/getProductInventoryInfo/{number}": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SalesDetails"
+ ],
+ "summary": "鑾峰彇浜у搧搴撳瓨淇℃伅",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "鏄庣粏缂栫爜",
+ "name": "number",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/response.ListResponse"
}
}
}
@@ -7024,6 +7125,36 @@
"required": true,
"schema": {
"$ref": "#/definitions/request.UpdateSalesDetails"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "OK",
+ "schema": {
+ "$ref": "#/definitions/contextx.Response"
+ }
+ }
+ }
+ }
+ },
+ "/api/salesDetails/updateStatus": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "SalesDetails"
+ ],
+ "summary": "鏇存柊閿�鍞槑缁嗙姸鎬�",
+ "parameters": [
+ {
+ "description": "鏌ヨ鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/request.UpdateSalesDetailsStatus"
}
}
],
@@ -10349,6 +10480,27 @@
"SalesDetailsKeywordTypeProductName"
]
},
+ "constvar.SalesDetailsStatus": {
+ "type": "integer",
+ "enum": [
+ 1,
+ 2,
+ 3,
+ 4
+ ],
+ "x-enum-comments": {
+ "OverCLose": "宸插叧闂�",
+ "OverOutbound": "鍑哄簱瀹屾垚",
+ "WaitConfirmed": "寰呯‘璁�",
+ "WaitOutbound": "寰呭嚭搴�"
+ },
+ "x-enum-varnames": [
+ "WaitConfirmed",
+ "WaitOutbound",
+ "OverOutbound",
+ "OverCLose"
+ ]
+ },
"constvar.SalesRefundKeywordType": {
"type": "string",
"enum": [
@@ -12223,6 +12375,12 @@
"signTime": {
"type": "string"
},
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
+ },
"updateTime": {
"type": "string"
},
@@ -13266,6 +13424,32 @@
"type": "string"
},
"Unit": {
+ "type": "string"
+ }
+ }
+ },
+ "product.WorkOrderInfo": {
+ "type": "object",
+ "properties": {
+ "EndTime": {
+ "type": "string"
+ },
+ "OrderId": {
+ "type": "string"
+ },
+ "OrderStatus": {
+ "type": "string"
+ },
+ "ProductName": {
+ "type": "string"
+ },
+ "StartTime": {
+ "type": "string"
+ },
+ "WorkOrderId": {
+ "type": "string"
+ },
+ "WorkOrderStatus": {
"type": "string"
}
}
@@ -14362,6 +14546,12 @@
},
"signTime": {
"type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
},
"wechatOrderStatusId": {
"type": "integer"
@@ -15559,7 +15749,7 @@
"$ref": "#/definitions/constvar.SalesDetailsKeywordType"
},
"number": {
- "description": "閿�鍞瓙鍗曞彿",
+ "description": "閿�鍞槑缁嗗崟鍙�",
"type": "string"
},
"page": {
@@ -15925,6 +16115,12 @@
},
"signTime": {
"type": "string"
+ },
+ "source": {
+ "type": "string"
+ },
+ "status": {
+ "$ref": "#/definitions/constvar.SalesDetailsStatus"
},
"wechatOrderStatusId": {
"type": "integer"
@@ -17605,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 a27c9b3..aa85bd5 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -187,6 +187,23 @@
- SalesDetailsKeywordTypeSignTime
- SalesDetailsKeywordTypePrincipal
- SalesDetailsKeywordTypeProductName
+ constvar.SalesDetailsStatus:
+ enum:
+ - 1
+ - 2
+ - 3
+ - 4
+ type: integer
+ x-enum-comments:
+ OverCLose: 宸插叧闂�
+ OverOutbound: 鍑哄簱瀹屾垚
+ WaitConfirmed: 寰呯‘璁�
+ WaitOutbound: 寰呭嚭搴�
+ x-enum-varnames:
+ - WaitConfirmed
+ - WaitOutbound
+ - OverOutbound
+ - OverCLose
constvar.SalesRefundKeywordType:
enum:
- 閿�鍞��璐у崟缂栧彿
@@ -1477,6 +1494,10 @@
type: integer
signTime:
type: string
+ source:
+ type: string
+ status:
+ $ref: '#/definitions/constvar.SalesDetailsStatus'
updateTime:
type: string
wechatOrderStatus:
@@ -2179,6 +2200,23 @@
description: 鍨嬪彿
type: string
Unit:
+ type: string
+ type: object
+ product.WorkOrderInfo:
+ properties:
+ EndTime:
+ type: string
+ OrderId:
+ type: string
+ OrderStatus:
+ type: string
+ ProductName:
+ type: string
+ StartTime:
+ type: string
+ WorkOrderId:
+ type: string
+ WorkOrderStatus:
type: string
type: object
request.AddAccountId:
@@ -2914,6 +2952,10 @@
type: integer
signTime:
type: string
+ source:
+ type: string
+ status:
+ $ref: '#/definitions/constvar.SalesDetailsStatus'
wechatOrderStatusId:
type: integer
type: object
@@ -3755,7 +3797,7 @@
keywordType:
$ref: '#/definitions/constvar.SalesDetailsKeywordType'
number:
- description: 閿�鍞瓙鍗曞彿
+ description: 閿�鍞槑缁嗗崟鍙�
type: string
page:
description: 椤电爜
@@ -4008,6 +4050,10 @@
type: integer
signTime:
type: string
+ source:
+ type: string
+ status:
+ $ref: '#/definitions/constvar.SalesDetailsStatus'
wechatOrderStatusId:
type: integer
type: object
@@ -5133,6 +5179,13 @@
type: integer
salesDetails:
$ref: '#/definitions/request.SalesDetails'
+ type: object
+ request.UpdateSalesDetailsStatus:
+ properties:
+ id:
+ type: integer
+ status:
+ $ref: '#/definitions/constvar.SalesDetailsStatus'
type: object
request.UpdateSalesLeads:
properties:
@@ -9304,6 +9357,31 @@
summary: 鏇存柊浼樺厛绾у埆
tags:
- 浼樺厛绾у埆绠$悊
+ /api/product/getProductOrderInfo/{number}:
+ get:
+ parameters:
+ - description: 鏄庣粏缂栫爜
+ in: path
+ name: number
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 鎴愬姛
+ schema:
+ allOf:
+ - $ref: '#/definitions/contextx.Response'
+ - properties:
+ data:
+ items:
+ $ref: '#/definitions/product.WorkOrderInfo'
+ type: array
+ type: object
+ summary: 鑾峰彇浜у搧璁㈠崟淇℃伅
+ tags:
+ - 浜у搧
/api/product/info:
get:
parameters:
@@ -10540,6 +10618,25 @@
summary: 娣诲姞閿�鍞槑缁�
tags:
- SalesDetails
+ /api/salesDetails/createOperation:
+ post:
+ parameters:
+ - description: 鏌ヨ鍙傛暟
+ in: body
+ name: object
+ required: true
+ schema:
+ $ref: '#/definitions/request.SalesDetails'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/response.ListResponse'
+ summary: 鍒涘缓浜у搧鍑哄簱淇℃伅
+ tags:
+ - SalesDetails
/api/salesDetails/delete:
delete:
parameters:
@@ -10575,6 +10672,24 @@
schema:
$ref: '#/definitions/contextx.Response'
summary: 鍒犻櫎閿�鍞槑缁�
+ tags:
+ - SalesDetails
+ /api/salesDetails/getProductInventoryInfo/{number}:
+ get:
+ parameters:
+ - description: 鏄庣粏缂栫爜
+ in: path
+ name: number
+ required: true
+ type: string
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: OK
+ schema:
+ $ref: '#/definitions/response.ListResponse'
+ summary: 鑾峰彇浜у搧搴撳瓨淇℃伅
tags:
- SalesDetails
/api/salesDetails/list:
@@ -10620,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/main.go b/main.go
index 984e465..18843c8 100644
--- a/main.go
+++ b/main.go
@@ -7,8 +7,11 @@
"aps_crm/middleware"
"aps_crm/model"
"aps_crm/pkg/logx"
+ "aps_crm/proto/product_inventory"
"aps_crm/router"
"fmt"
+ "google.golang.org/grpc"
+ "net"
"net/http"
"os"
"os/signal"
@@ -46,11 +49,27 @@
WriteTimeout: 5 * time.Second,
}
+ //鍚姩grpc瀹㈡埛绔�
go v1.InitProductServiceConn()
go middleware.InitUserConn()
go v1.InitCodeServiceConn()
go v1.InitProductInventoryServiceConn()
-
+ //鍚姩grpc鏈嶅姟
+ go func() {
+ ln, err := net.Listen("tcp", ":"+conf.Conf.System.GrpcPort)
+ if err != nil {
+ logx.Errorf("grpc server init error: %v", err.Error())
+ panic(fmt.Sprintf("grpc server init error: %v", err.Error()))
+ }
+ s := grpc.NewServer()
+ //todo 娣诲姞鍏蜂綋鏈嶅姟
+ product_inventory.RegisterProductInventoryServiceServer(s, &product_inventory.Server{})
+ err = s.Serve(ln)
+ if err != nil {
+ logx.Errorf("grpc server init error: %v", err.Error())
+ panic(fmt.Sprintf("grpc server init error: %v", err.Error()))
+ }
+ }()
//c := cron.New()
//c.AddFunc("@every 15s", service.SyncUserInfo) // 姣�15绉掑悓姝ヤ竴娆�
//c.Start()
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/proto/product.proto b/proto/product.proto
index c75cf26..559ca32 100644
--- a/proto/product.proto
+++ b/proto/product.proto
@@ -51,7 +51,8 @@
message Info {
string ProductId = 1;
- string Time = 2;
+ string StartTime = 2;
+ string EndTime = 3;
}
message GetProductOrderRequest {
diff --git a/proto/product/product.pb.go b/proto/product/product.pb.go
index bfbc313..104f5a8 100644
--- a/proto/product/product.pb.go
+++ b/proto/product/product.pb.go
@@ -421,7 +421,8 @@
unknownFields protoimpl.UnknownFields
ProductId string `protobuf:"bytes,1,opt,name=ProductId,proto3" json:"ProductId,omitempty"`
- Time string `protobuf:"bytes,2,opt,name=Time,proto3" json:"Time,omitempty"`
+ StartTime string `protobuf:"bytes,2,opt,name=StartTime,proto3" json:"StartTime,omitempty"`
+ EndTime string `protobuf:"bytes,3,opt,name=EndTime,proto3" json:"EndTime,omitempty"`
}
func (x *Info) Reset() {
@@ -463,9 +464,16 @@
return ""
}
-func (x *Info) GetTime() string {
+func (x *Info) GetStartTime() string {
if x != nil {
- return x.Time
+ return x.StartTime
+ }
+ return ""
+}
+
+func (x *Info) GetEndTime() string {
+ if x != nil {
+ return x.EndTime
}
return ""
}
@@ -727,51 +735,53 @@
0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x50,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x54, 0x6f, 0x74,
- 0x61, 0x6c, 0x22, 0x38, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x72,
+ 0x61, 0x6c, 0x22, 0x5c, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x50,
- 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x54, 0x69, 0x6d, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x37, 0x0a, 0x16,
- 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
- 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x50,
- 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x0d, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72,
- 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72,
- 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49,
- 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4e,
- 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
- 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53,
- 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64,
- 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x57, 0x6f, 0x72, 0x6b,
- 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x4f,
- 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75,
- 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12,
- 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x63, 0x0a, 0x17, 0x47, 0x65, 0x74,
- 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69,
- 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x4f,
- 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x32, 0xe2,
- 0x01, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
- 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49,
- 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
- 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65,
- 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f,
- 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72,
- 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73,
- 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47,
- 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x17,
- 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f,
- 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72,
+ 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61,
+ 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d,
+ 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
+ 0x22, 0x37, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72,
+ 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x06, 0x50, 0x61,
+ 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x49, 0x6e, 0x66,
+ 0x6f, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf1, 0x01, 0x0a, 0x0d, 0x57, 0x6f,
+ 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x4f,
+ 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4f, 0x72,
+ 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
+ 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72,
+ 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x72,
+ 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x57, 0x6f, 0x72,
+ 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
+ 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x57,
+ 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69,
+ 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x74, 0x61, 0x72, 0x74, 0x54,
+ 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x45, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x63, 0x0a,
+ 0x17, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03,
+ 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x22,
+ 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x57,
+ 0x6f, 0x72, 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69,
+ 0x73, 0x74, 0x32, 0xe2, 0x01, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x65,
+ 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f,
+ 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x47, 0x65,
+ 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x47,
+ 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63,
+ 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
+ 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64,
+ 0x65, 0x72, 0x12, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f,
+ 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x47, 0x65,
+ 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x70, 0x72, 0x6f,
+ 0x64, 0x75, 0x63, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/product_inventory.proto b/proto/product_inventory.proto
index ad9328d..7da35cb 100644
--- a/proto/product_inventory.proto
+++ b/proto/product_inventory.proto
@@ -5,6 +5,7 @@
service productInventoryService {
rpc CreateOperation(CreateOperationRequest) returns(CreateOperationResponse) {}
rpc GetInventoryProductInfo(GetInventoryProductInfoRequest) returns (GetInventoryProductInfoResponse) {}
+ rpc UpdateSalesDetailStatus(UpdateSalesDetailStatusRequest) returns (UpdateSalesDetailStatusResponse) {}
}
message CreateOperationRequest{
@@ -51,4 +52,16 @@
int32 Code = 1;
string Msg = 2;
repeated ProductInfo ProductList = 3;
+}
+
+//------------------------------------------------------------
+
+message UpdateSalesDetailStatusRequest {
+ string Number = 1;//鏄庣粏鍗曠紪鐮�
+ string SalesDetailStatus = 2;
+}
+
+message UpdateSalesDetailStatusResponse{
+ int32 Code = 1;
+ string Msg = 2;
}
\ No newline at end of file
diff --git a/proto/product_inventory/product_inventory.pb.go b/proto/product_inventory/product_inventory.pb.go
index 3e3c46f..26c7209 100644
--- a/proto/product_inventory/product_inventory.pb.go
+++ b/proto/product_inventory/product_inventory.pb.go
@@ -462,6 +462,116 @@
return nil
}
+type UpdateSalesDetailStatusRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"` //鏄庣粏鍗曠紪鐮�
+ SalesDetailStatus string `protobuf:"bytes,2,opt,name=SalesDetailStatus,proto3" json:"SalesDetailStatus,omitempty"`
+}
+
+func (x *UpdateSalesDetailStatusRequest) Reset() {
+ *x = UpdateSalesDetailStatusRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_product_inventory_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateSalesDetailStatusRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateSalesDetailStatusRequest) ProtoMessage() {}
+
+func (x *UpdateSalesDetailStatusRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_product_inventory_proto_msgTypes[6]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UpdateSalesDetailStatusRequest.ProtoReflect.Descriptor instead.
+func (*UpdateSalesDetailStatusRequest) Descriptor() ([]byte, []int) {
+ return file_product_inventory_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *UpdateSalesDetailStatusRequest) GetNumber() string {
+ if x != nil {
+ return x.Number
+ }
+ return ""
+}
+
+func (x *UpdateSalesDetailStatusRequest) GetSalesDetailStatus() string {
+ if x != nil {
+ return x.SalesDetailStatus
+ }
+ return ""
+}
+
+type UpdateSalesDetailStatusResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Code int32 `protobuf:"varint,1,opt,name=Code,proto3" json:"Code,omitempty"`
+ Msg string `protobuf:"bytes,2,opt,name=Msg,proto3" json:"Msg,omitempty"`
+}
+
+func (x *UpdateSalesDetailStatusResponse) Reset() {
+ *x = UpdateSalesDetailStatusResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_product_inventory_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateSalesDetailStatusResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateSalesDetailStatusResponse) ProtoMessage() {}
+
+func (x *UpdateSalesDetailStatusResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_product_inventory_proto_msgTypes[7]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UpdateSalesDetailStatusResponse.ProtoReflect.Descriptor instead.
+func (*UpdateSalesDetailStatusResponse) Descriptor() ([]byte, []int) {
+ return file_product_inventory_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *UpdateSalesDetailStatusResponse) GetCode() int32 {
+ if x != nil {
+ return x.Code
+ }
+ return 0
+}
+
+func (x *UpdateSalesDetailStatusResponse) GetMsg() string {
+ if x != nil {
+ return x.Msg
+ }
+ return ""
+}
+
var File_product_inventory_proto protoreflect.FileDescriptor
var file_product_inventory_proto_rawDesc = []byte{
@@ -520,21 +630,38 @@
0x67, 0x12, 0x2e, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73,
- 0x74, 0x32, 0xc1, 0x01, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x76,
- 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a,
- 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65, 0x61,
- 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65,
- 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f,
- 0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50,
- 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79,
- 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75,
- 0x63, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x22, 0x66, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73,
+ 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x11, 0x53,
+ 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74,
+ 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x47, 0x0a, 0x1f, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74,
+ 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04,
+ 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65,
+ 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d,
+ 0x73, 0x67, 0x32, 0xa1, 0x02, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e,
+ 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46,
+ 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76,
+ 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66,
+ 0x6f, 0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79,
+ 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72,
+ 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x12, 0x1f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44,
+ 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73,
+ 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64,
+ 0x75, 0x63, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -549,7 +676,7 @@
return file_product_inventory_proto_rawDescData
}
-var file_product_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_product_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_product_inventory_proto_goTypes = []interface{}{
(*CreateOperationRequest)(nil), // 0: CreateOperationRequest
(*InventoryProduct)(nil), // 1: InventoryProduct
@@ -557,16 +684,20 @@
(*GetInventoryProductInfoRequest)(nil), // 3: GetInventoryProductInfoRequest
(*ProductInfo)(nil), // 4: ProductInfo
(*GetInventoryProductInfoResponse)(nil), // 5: GetInventoryProductInfoResponse
+ (*UpdateSalesDetailStatusRequest)(nil), // 6: UpdateSalesDetailStatusRequest
+ (*UpdateSalesDetailStatusResponse)(nil), // 7: UpdateSalesDetailStatusResponse
}
var file_product_inventory_proto_depIdxs = []int32{
1, // 0: CreateOperationRequest.ProductList:type_name -> InventoryProduct
4, // 1: GetInventoryProductInfoResponse.ProductList:type_name -> ProductInfo
0, // 2: productInventoryService.CreateOperation:input_type -> CreateOperationRequest
3, // 3: productInventoryService.GetInventoryProductInfo:input_type -> GetInventoryProductInfoRequest
- 2, // 4: productInventoryService.CreateOperation:output_type -> CreateOperationResponse
- 5, // 5: productInventoryService.GetInventoryProductInfo:output_type -> GetInventoryProductInfoResponse
- 4, // [4:6] is the sub-list for method output_type
- 2, // [2:4] is the sub-list for method input_type
+ 6, // 4: productInventoryService.UpdateSalesDetailStatus:input_type -> UpdateSalesDetailStatusRequest
+ 2, // 5: productInventoryService.CreateOperation:output_type -> CreateOperationResponse
+ 5, // 6: productInventoryService.GetInventoryProductInfo:output_type -> GetInventoryProductInfoResponse
+ 7, // 7: productInventoryService.UpdateSalesDetailStatus:output_type -> UpdateSalesDetailStatusResponse
+ 5, // [5:8] is the sub-list for method output_type
+ 2, // [2:5] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
@@ -650,6 +781,30 @@
return nil
}
}
+ file_product_inventory_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateSalesDetailStatusRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_product_inventory_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateSalesDetailStatusResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -657,7 +812,7 @@
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_product_inventory_proto_rawDesc,
NumEnums: 0,
- NumMessages: 6,
+ NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/product_inventory/product_inventory_grpc.pb.go b/proto/product_inventory/product_inventory_grpc.pb.go
index 79ac5a6..bd4da08 100644
--- a/proto/product_inventory/product_inventory_grpc.pb.go
+++ b/proto/product_inventory/product_inventory_grpc.pb.go
@@ -20,6 +20,7 @@
type ProductInventoryServiceClient interface {
CreateOperation(ctx context.Context, in *CreateOperationRequest, opts ...grpc.CallOption) (*CreateOperationResponse, error)
GetInventoryProductInfo(ctx context.Context, in *GetInventoryProductInfoRequest, opts ...grpc.CallOption) (*GetInventoryProductInfoResponse, error)
+ UpdateSalesDetailStatus(ctx context.Context, in *UpdateSalesDetailStatusRequest, opts ...grpc.CallOption) (*UpdateSalesDetailStatusResponse, error)
}
type productInventoryServiceClient struct {
@@ -48,12 +49,22 @@
return out, nil
}
+func (c *productInventoryServiceClient) UpdateSalesDetailStatus(ctx context.Context, in *UpdateSalesDetailStatusRequest, opts ...grpc.CallOption) (*UpdateSalesDetailStatusResponse, error) {
+ out := new(UpdateSalesDetailStatusResponse)
+ err := c.cc.Invoke(ctx, "/productInventoryService/UpdateSalesDetailStatus", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// ProductInventoryServiceServer is the server API for ProductInventoryService service.
// All implementations must embed UnimplementedProductInventoryServiceServer
// for forward compatibility
type ProductInventoryServiceServer interface {
CreateOperation(context.Context, *CreateOperationRequest) (*CreateOperationResponse, error)
GetInventoryProductInfo(context.Context, *GetInventoryProductInfoRequest) (*GetInventoryProductInfoResponse, error)
+ UpdateSalesDetailStatus(context.Context, *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error)
mustEmbedUnimplementedProductInventoryServiceServer()
}
@@ -66,6 +77,9 @@
}
func (UnimplementedProductInventoryServiceServer) GetInventoryProductInfo(context.Context, *GetInventoryProductInfoRequest) (*GetInventoryProductInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetInventoryProductInfo not implemented")
+}
+func (UnimplementedProductInventoryServiceServer) UpdateSalesDetailStatus(context.Context, *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateSalesDetailStatus not implemented")
}
func (UnimplementedProductInventoryServiceServer) mustEmbedUnimplementedProductInventoryServiceServer() {
}
@@ -117,6 +131,24 @@
return interceptor(ctx, in, info, handler)
}
+func _ProductInventoryService_UpdateSalesDetailStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateSalesDetailStatusRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ProductInventoryServiceServer).UpdateSalesDetailStatus(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/productInventoryService/UpdateSalesDetailStatus",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ProductInventoryServiceServer).UpdateSalesDetailStatus(ctx, req.(*UpdateSalesDetailStatusRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
// ProductInventoryService_ServiceDesc is the grpc.ServiceDesc for ProductInventoryService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -132,6 +164,10 @@
MethodName: "GetInventoryProductInfo",
Handler: _ProductInventoryService_GetInventoryProductInfo_Handler,
},
+ {
+ MethodName: "UpdateSalesDetailStatus",
+ Handler: _ProductInventoryService_UpdateSalesDetailStatus_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "product_inventory.proto",
diff --git a/proto/product_inventory/server.go b/proto/product_inventory/server.go
new file mode 100644
index 0000000..e00f19b
--- /dev/null
+++ b/proto/product_inventory/server.go
@@ -0,0 +1,27 @@
+package product_inventory
+
+import (
+ "aps_crm/constvar"
+ "aps_crm/model"
+ "context"
+ "errors"
+)
+
+type Server struct {
+ UnimplementedProductInventoryServiceServer
+}
+
+func (s *Server) UpdateSalesDetailStatus(ctx context.Context, req *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error) {
+ if req.Number == "" {
+ return nil, errors.New("缂栫爜涓嶈兘涓虹┖")
+ }
+ _, err := model.NewSalesDetailsSearch().SetNumber(req.Number).First()
+ if err != nil {
+ return nil, err
+ }
+ m := make(map[string]interface{})
+ m["status"] = constvar.OverOutbound
+ err = model.NewSalesDetailsSearch().SetNumber(req.Number).UpdateByMap(m)
+ resp := new(UpdateSalesDetailStatusResponse)
+ return resp, err
+}
diff --git a/router/product.go b/router/product.go
index 7add36b..36c89f0 100644
--- a/router/product.go
+++ b/router/product.go
@@ -9,7 +9,8 @@
productRouter := router.Group("product")
productApi := v1.ProductApi{}
{
- productRouter.GET("info", productApi.Info) // 浜у搧璇︽儏
- productRouter.GET("list", productApi.List) // 浜у搧鍒楄〃
+ productRouter.GET("info", productApi.Info) // 浜у搧璇︽儏
+ productRouter.GET("list", productApi.List) // 浜у搧鍒楄〃
+ productRouter.GET("getProductOrderInfo/:number", productApi.GetProductOrderInfo) // 鑾峰彇浜у搧璁㈠崟淇℃伅
}
}
diff --git a/router/salesDetails.go b/router/salesDetails.go
index cbf2ff9..3ce17bd 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.POST("updateStatus", salesDetailsApi.UpdateStatus) // 鏇存柊閿�鍞槑缁嗙姸鎬�
salesDetailsRouter.POST("list", salesDetailsApi.List) // 鑾峰彇閿�鍞槑缁嗗崟鍒楄〃
salesDetailsRouter.GET("getProductInventoryInfo/:number", salesDetailsApi.GetProductInventoryInfo) // 鑾峰彇浜у搧搴撳瓨淇℃伅
salesDetailsRouter.POST("createOperation", salesDetailsApi.CreateOperation) // 鍒涘缓浜у搧鍑哄簱淇℃伅
--
Gitblit v1.8.0