From d6091514f2ab3f8e650a14853804cf27438b3f26 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期三, 15 十一月 2023 16:34:02 +0800
Subject: [PATCH] bug修改提交
---
controllers/operation.go | 32 ++
controllers/reorder_rule_controller.go | 53 +++
docs/swagger.yaml | 30 ++
proto/purchase_wms.proto | 37 ++
controllers/location.go | 5
docs/docs.go | 45 +++
conf/config.yaml | 1
docs/swagger.json | 45 +++
models/reorder_rule.go | 1
proto/purchase_wms/purchase_wms_grpc.pb.go | 72 +++++
proto/purchase_wms/purchase_wms.pb.go | 472 +++++++++++++++++++++++++++++++--
conf/config.go | 5
proto/purchase_wms/server.go | 1
13 files changed, 759 insertions(+), 40 deletions(-)
diff --git a/conf/config.go b/conf/config.go
index df4cfba..8f14bb5 100644
--- a/conf/config.go
+++ b/conf/config.go
@@ -40,6 +40,7 @@
grpcServerConf struct {
ApsAddr string //aps鏈嶅姟grpc鍦板潃
CrmAddr string //crm鏈嶅姟grpc鍦板潃
+ SrmAddr string //srm鏈嶅姟grpc鍦板潃
}
)
@@ -69,6 +70,7 @@
GrpcPort := os.Getenv("WMS_GRPC") // 鍙澶栨彁渚沢rpc鏈嶅姟锛屾湰鏈嶅姟涓嶇敤
apsAddr := os.Getenv("APS_GRPC")
crmAddr := os.Getenv("CRM_GRPC")
+ srmAddr := os.Getenv("SRM_GRPC")
if len(GrpcPort) > 0 {
WebConf.GrpcPort = GrpcPort
}
@@ -84,6 +86,9 @@
if len(crmAddr) > 0 {
GrpcServerConf.CrmAddr = crmAddr
}
+ if len(srmAddr) > 0 {
+ GrpcServerConf.SrmAddr = srmAddr
+ }
DBHost := os.Getenv("DB_HOST")
DBName := os.Getenv("DB_NAME")
diff --git a/conf/config.yaml b/conf/config.yaml
index bb68479..63a0e2b 100644
--- a/conf/config.yaml
+++ b/conf/config.yaml
@@ -26,3 +26,4 @@
grpcServer:
apsAddr: 192.168.20.119:9091
crmAddr: 192.168.20.118:9092
+ srmAddr: 192.168.20.118:9093
diff --git a/controllers/location.go b/controllers/location.go
index e1102fa..29ad83b 100644
--- a/controllers/location.go
+++ b/controllers/location.go
@@ -98,6 +98,11 @@
if location.ParentId == 0 {
tree = append(tree, location)
} else {
+ if _, ok := m[location.ParentId]; !ok {
+ tree = append(tree, location)
+ continue
+ }
+ m[location.ParentId].Children = make([]*models.Location, 0)
m[location.ParentId].Children = append(m[location.ParentId].Children, location)
}
}
diff --git a/controllers/operation.go b/controllers/operation.go
index 72eaadd..d7912aa 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -23,6 +23,7 @@
"wms/pkg/logx"
"wms/pkg/structx"
"wms/proto/product_inventory"
+ "wms/proto/purchase_wms"
"wms/request"
)
@@ -488,6 +489,9 @@
return err
}
}
+ if operation.SourceNumber != "" {
+ go UpdatePurchaseStatus(operation.SourceNumber)
+ }
}
@@ -530,6 +534,9 @@
if err := models.NewLocationProductAmountSearch().SetID(locAmount.Id).Update(locAmount); err != nil {
return err
}
+ }
+ if operation.SourceNumber != "" {
+ go UpdateSalesDetailStatus(operation.SourceNumber)
}
}
@@ -684,17 +691,23 @@
util.ResponseFormat(c, code.RequestError, err.Error())
return
}
- if operation.SourceNumber != "" {
- go UpdateSalesDetailStatus(operation.SourceNumber)
- }
+
util.ResponseFormat(c, code.Success, "鎿嶄綔鎴愬姛")
}
-var ProductInventoryServiceConn *grpc.ClientConn
+var (
+ ProductInventoryServiceConn *grpc.ClientConn
+ PurchaseServiceConn *grpc.ClientConn
+)
func InitProductInventoryServiceConn() {
var err error
ProductInventoryServiceConn, err = grpc.Dial(conf.GrpcServerConf.CrmAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
+ if err != nil {
+ logx.Errorf("grpc dial product service error: %v", err.Error())
+ return
+ }
+ PurchaseServiceConn, err = grpc.Dial(conf.GrpcServerConf.SrmAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
logx.Errorf("grpc dial product service error: %v", err.Error())
return
@@ -704,6 +717,9 @@
func CloseProductInventoryServiceConn() {
if ProductInventoryServiceConn != nil {
ProductInventoryServiceConn.Close()
+ }
+ if PurchaseServiceConn != nil {
+ PurchaseServiceConn.Close()
}
}
@@ -718,6 +734,14 @@
}
}
+func UpdatePurchaseStatus(number string) {
+ client := purchase_wms.NewPurchaseServiceClient(PurchaseServiceConn)
+ _, err := client.UpdatePurchaseStatus(context.Background(), &purchase_wms.UpdatePurchaseStatusRequest{Number: number})
+ if err != nil {
+ logx.Errorf("grpc dial UpdatePurchaseStatus service error: %v", err)
+ }
+}
+
// ListTransfer
// @Tags 鍏ュ簱/鍑哄簱
// @Summary 搴撳瓨璋冩嫧鍒楄〃
diff --git a/controllers/reorder_rule_controller.go b/controllers/reorder_rule_controller.go
index a2b1dbe..4eeaa18 100644
--- a/controllers/reorder_rule_controller.go
+++ b/controllers/reorder_rule_controller.go
@@ -17,6 +17,7 @@
"wms/pkg/logx"
"wms/pkg/timex"
"wms/proto/inventory_order"
+ "wms/proto/purchase_wms"
"wms/request"
)
@@ -289,6 +290,16 @@
util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屾暟鎹被鍨嬮敊璇�")
return
}
+ if params.Route == "閲囪喘" {
+ client := purchase_wms.NewPurchaseServiceClient(PurchaseServiceConn)
+ resp, err := client.GetSupplierListByProductId(c, &purchase_wms.GetSupplierListByProductIdRequest{ProductId: params.ProductId})
+ if err != nil {
+ util.ResponseFormat(c, code.RequestParamError, "grpc璋冪敤澶辫触")
+ return
+ }
+ util.ResponseFormat(c, code.Success, resp.List)
+ return
+ }
client := inventory_order.NewInventoryOrderServiceClient(InventoryOrderServiceConn)
order, err := client.CreateNewOrder(c, &inventory_order.CreateNewOrderRequest{
OrderNumber: params.OrderNumber.IntPart(),
@@ -300,18 +311,25 @@
util.ResponseFormat(c, code.RequestParamError, "grpc璋冪敤澶辫触")
return
}
+ err = orderAgain(params, order.OrderId)
+ if err != nil {
+ util.ResponseFormat(c, code.RequestParamError, "閲嶈澶辫触")
+ return
+ }
+ util.ResponseFormat(c, code.Success, "閲嶈鎴愬姛")
+}
+
+func orderAgain(params models.ReorderRule, SourceNumber string) error {
location, err := models.NewLocationSearch().SetID(params.LocationId).First()
if err != nil {
- util.ResponseFormat(c, code.RequestParamError, "鏌ヨ浣嶇疆淇℃伅澶辫触")
- return
+ return err
}
houseCode := strings.Split(location.JointName, "/")[0]
var operationType models.OperationType
err = models.NewOperationTypeSearch().Orm.Model(&models.OperationType{}).Joins("left join wms_warehouse on wms_job_type.warehouse_id = wms_warehouse.id").
Where("wms_job_type.base_operation_type = 1 and wms_warehouse.code = ?", houseCode).First(&operationType).Error
if err != nil {
- util.ResponseFormat(c, code.RequestParamError, "鏌ヨ浣嶇疆淇℃伅澶辫触")
- return
+ return err
}
var operation models.Operation
var details models.OperationDetails
@@ -327,7 +345,7 @@
operation.FromLocationID = 1
operation.Number = strconv.FormatInt(time.Now().Unix(), 10)
operation.ToLocationID = params.LocationId
- operation.SourceNumber = order.OrderId
+ operation.SourceNumber = SourceNumber
err = models.WithTransaction(func(db *gorm.DB) error {
if err = models.NewOperationSearch().SetOrm(db).Create(&operation); err != nil {
@@ -337,9 +355,32 @@
err = models.NewReorderRuleSearch().SetOrm(db).SetID(params.Id).Update(¶ms)
return err
})
+
+ return err
+}
+
+// SubmitOrder
+// @Tags 閲嶈璐ц鍒�
+// @Summary 鍐嶈涓�娆�
+// @Produce application/json
+// @Param object body models.ReorderRule true "鍙傛暟"
+// @Success 200 {object} util.Response "鎴愬姛"
+// @Router /api-wms/v1/reorderRule/submitOrder [post]
+func (slf ReorderRuleController) SubmitOrder(c *gin.Context) {
+ var params models.ReorderRule
+ client := purchase_wms.NewPurchaseServiceClient(PurchaseServiceConn)
+ resp, err := client.CreatePurchaseByWms(c, &purchase_wms.CreatePurchaseByWmsRequest{
+ SupplierId: params.SupplierId,
+ ProductId: params.ProductId,
+ Amount: params.OrderNumber.IntPart(),
+ })
+ if err != nil {
+ util.ResponseFormat(c, code.RequestParamError, "grpc璋冪敤澶辫触")
+ return
+ }
+ err = orderAgain(params, resp.PurchaseNumber)
if err != nil {
util.ResponseFormat(c, code.RequestParamError, "閲嶈澶辫触")
return
}
- util.ResponseFormat(c, code.Success, "閲嶈鎴愬姛")
}
diff --git a/docs/docs.go b/docs/docs.go
index 017f8d3..0ec54bf 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -2167,6 +2167,36 @@
}
}
},
+ "/api-wms/v1/reorderRule/submitOrder": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "閲嶈璐ц鍒�"
+ ],
+ "summary": "鍐嶈涓�娆�",
+ "parameters": [
+ {
+ "description": "鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/models.ReorderRule"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "鎴愬姛",
+ "schema": {
+ "$ref": "#/definitions/util.Response"
+ }
+ }
+ }
+ }
+ },
"/api-wms/v1/reorderRule/updateReorderRule": {
"post": {
"produces": [
@@ -3037,7 +3067,15 @@
"description": "鏈�澶у簱瀛�",
"type": "number"
},
+ "maxInventoryRule": {
+ "description": "鏈�澶у簱瀛�",
+ "type": "number"
+ },
"minInventory": {
+ "description": "鏈�灏忓簱瀛�",
+ "type": "number"
+ },
+ "minInventoryRule": {
"description": "鏈�灏忓簱瀛�",
"type": "number"
},
@@ -3108,6 +3146,9 @@
},
"purchaseType": {
"$ref": "#/definitions/constvar.PurchaseType"
+ },
+ "reorderRuleNum": {
+ "type": "integer"
},
"salePrice": {
"description": "閿�鍞崟浠�",
@@ -3390,6 +3431,10 @@
"description": "璺嚎",
"type": "string"
},
+ "supplierId": {
+ "description": "渚涘簲鍟唅d",
+ "type": "integer"
+ },
"unit": {
"description": "鍗曚綅",
"type": "string"
diff --git a/docs/swagger.json b/docs/swagger.json
index 00e8854..d545fcc 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -2155,6 +2155,36 @@
}
}
},
+ "/api-wms/v1/reorderRule/submitOrder": {
+ "post": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "閲嶈璐ц鍒�"
+ ],
+ "summary": "鍐嶈涓�娆�",
+ "parameters": [
+ {
+ "description": "鍙傛暟",
+ "name": "object",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/models.ReorderRule"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "鎴愬姛",
+ "schema": {
+ "$ref": "#/definitions/util.Response"
+ }
+ }
+ }
+ }
+ },
"/api-wms/v1/reorderRule/updateReorderRule": {
"post": {
"produces": [
@@ -3025,7 +3055,15 @@
"description": "鏈�澶у簱瀛�",
"type": "number"
},
+ "maxInventoryRule": {
+ "description": "鏈�澶у簱瀛�",
+ "type": "number"
+ },
"minInventory": {
+ "description": "鏈�灏忓簱瀛�",
+ "type": "number"
+ },
+ "minInventoryRule": {
"description": "鏈�灏忓簱瀛�",
"type": "number"
},
@@ -3096,6 +3134,9 @@
},
"purchaseType": {
"$ref": "#/definitions/constvar.PurchaseType"
+ },
+ "reorderRuleNum": {
+ "type": "integer"
},
"salePrice": {
"description": "閿�鍞崟浠�",
@@ -3378,6 +3419,10 @@
"description": "璺嚎",
"type": "string"
},
+ "supplierId": {
+ "description": "渚涘簲鍟唅d",
+ "type": "integer"
+ },
"unit": {
"description": "鍗曚綅",
"type": "string"
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 41799e9..e097e09 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -489,7 +489,13 @@
maxInventory:
description: 鏈�澶у簱瀛�
type: number
+ maxInventoryRule:
+ description: 鏈�澶у簱瀛�
+ type: number
minInventory:
+ description: 鏈�灏忓簱瀛�
+ type: number
+ minInventoryRule:
description: 鏈�灏忓簱瀛�
type: number
minPurchaseAmount:
@@ -539,6 +545,8 @@
type: number
purchaseType:
$ref: '#/definitions/constvar.PurchaseType'
+ reorderRuleNum:
+ type: integer
salePrice:
description: 閿�鍞崟浠�
type: number
@@ -729,6 +737,9 @@
route:
description: 璺嚎
type: string
+ supplierId:
+ description: 渚涘簲鍟唅d
+ type: integer
unit:
description: 鍗曚綅
type: string
@@ -2872,6 +2883,25 @@
summary: 鍐嶈涓�娆�
tags:
- 閲嶈璐ц鍒�
+ /api-wms/v1/reorderRule/submitOrder:
+ post:
+ parameters:
+ - description: 鍙傛暟
+ in: body
+ name: object
+ required: true
+ schema:
+ $ref: '#/definitions/models.ReorderRule'
+ produces:
+ - application/json
+ responses:
+ "200":
+ description: 鎴愬姛
+ schema:
+ $ref: '#/definitions/util.Response'
+ summary: 鍐嶈涓�娆�
+ tags:
+ - 閲嶈璐ц鍒�
/api-wms/v1/reorderRule/updateReorderRule:
post:
parameters:
diff --git a/models/reorder_rule.go b/models/reorder_rule.go
index 868ef41..f3a1e75 100644
--- a/models/reorder_rule.go
+++ b/models/reorder_rule.go
@@ -22,6 +22,7 @@
Unit string `json:"unit" gorm:"type:varchar(100);comment:鍗曚綅"` //鍗曚綅
Amount decimal.Decimal `json:"amount" gorm:"-"` //鍦ㄥ簱鏁伴噺
Prediction decimal.Decimal `json:"prediction" gorm:"-"` //棰勬祴鏁伴噺
+ SupplierId int64 `json:"supplierId" gorm:"-"` //渚涘簲鍟唅d
}
ReorderRuleSearch struct {
ReorderRule
diff --git a/proto/purchase_wms.proto b/proto/purchase_wms.proto
index d3c7d3e..1e8a838 100644
--- a/proto/purchase_wms.proto
+++ b/proto/purchase_wms.proto
@@ -5,8 +5,11 @@
service PurchaseService {
rpc PurchaseToWms(PurchaseToWmsRequest) returns (PurchaseToWmsResponse);
rpc UpdatePurchaseStatus(UpdatePurchaseStatusRequest) returns (UpdatePurchaseStatusResponse) {}
+ rpc GetSupplierListByProductId(GetSupplierListByProductIdRequest) returns (GetSupplierListByProductIdResponse) {}
+ rpc CreatePurchaseByWms(CreatePurchaseByWmsRequest) returns (CreatePurchaseByWmsResponse) {}
}
+//------------------------------------------PurchaseToWms--------------------------------
message PurchaseProduct{
string Id = 1;
@@ -24,7 +27,7 @@
string message = 2;
}
-//-------------------------------------------------------------------
+//------------------------------------------------UpdatePurchaseStatus-------------------------------------
message UpdatePurchaseStatusRequest {
string Number = 1;//閲囪喘缂栧彿
@@ -35,3 +38,35 @@
string Msg = 2;
}
+//--------------------------------------------------GetSupplierListByProductId------------------------------
+
+message GetSupplierListByProductIdRequest {
+ string ProductId = 1;
+}
+
+message SupplierList {
+ int64 supplierId = 1;
+ string supplierName = 2;
+ float purchasePrice = 3;//閲囪喘浠锋牸
+}
+
+message GetSupplierListByProductIdResponse {
+ int32 Code = 1;
+ string Msg = 2;
+ repeated SupplierList List = 3;
+}
+
+//-----------------------------------------------------CreatePurchaseByWms--------------------------------------
+
+message CreatePurchaseByWmsRequest {
+ int64 SupplierId = 1;
+ string ProductId = 2;
+ int64 Amount = 3;
+}
+
+message CreatePurchaseByWmsResponse {
+ int32 Code = 1;
+ string Msg = 2;
+ string PurchaseNumber = 3;
+}
+
diff --git a/proto/purchase_wms/purchase_wms.pb.go b/proto/purchase_wms/purchase_wms.pb.go
index 5189495..e60e691 100644
--- a/proto/purchase_wms/purchase_wms.pb.go
+++ b/proto/purchase_wms/purchase_wms.pb.go
@@ -295,6 +295,305 @@
return ""
}
+type GetSupplierListByProductIdRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ ProductId string `protobuf:"bytes,1,opt,name=ProductId,proto3" json:"ProductId,omitempty"`
+}
+
+func (x *GetSupplierListByProductIdRequest) Reset() {
+ *x = GetSupplierListByProductIdRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_purchase_wms_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetSupplierListByProductIdRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetSupplierListByProductIdRequest) ProtoMessage() {}
+
+func (x *GetSupplierListByProductIdRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_purchase_wms_proto_msgTypes[5]
+ 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 GetSupplierListByProductIdRequest.ProtoReflect.Descriptor instead.
+func (*GetSupplierListByProductIdRequest) Descriptor() ([]byte, []int) {
+ return file_purchase_wms_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *GetSupplierListByProductIdRequest) GetProductId() string {
+ if x != nil {
+ return x.ProductId
+ }
+ return ""
+}
+
+type SupplierList struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ SupplierId int64 `protobuf:"varint,1,opt,name=supplierId,proto3" json:"supplierId,omitempty"`
+ SupplierName string `protobuf:"bytes,2,opt,name=supplierName,proto3" json:"supplierName,omitempty"`
+ PurchasePrice float32 `protobuf:"fixed32,3,opt,name=purchasePrice,proto3" json:"purchasePrice,omitempty"` //閲囪喘浠锋牸
+}
+
+func (x *SupplierList) Reset() {
+ *x = SupplierList{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_purchase_wms_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SupplierList) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SupplierList) ProtoMessage() {}
+
+func (x *SupplierList) ProtoReflect() protoreflect.Message {
+ mi := &file_purchase_wms_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 SupplierList.ProtoReflect.Descriptor instead.
+func (*SupplierList) Descriptor() ([]byte, []int) {
+ return file_purchase_wms_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *SupplierList) GetSupplierId() int64 {
+ if x != nil {
+ return x.SupplierId
+ }
+ return 0
+}
+
+func (x *SupplierList) GetSupplierName() string {
+ if x != nil {
+ return x.SupplierName
+ }
+ return ""
+}
+
+func (x *SupplierList) GetPurchasePrice() float32 {
+ if x != nil {
+ return x.PurchasePrice
+ }
+ return 0
+}
+
+type GetSupplierListByProductIdResponse 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"`
+ List []*SupplierList `protobuf:"bytes,3,rep,name=List,proto3" json:"List,omitempty"`
+}
+
+func (x *GetSupplierListByProductIdResponse) Reset() {
+ *x = GetSupplierListByProductIdResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_purchase_wms_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetSupplierListByProductIdResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetSupplierListByProductIdResponse) ProtoMessage() {}
+
+func (x *GetSupplierListByProductIdResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_purchase_wms_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 GetSupplierListByProductIdResponse.ProtoReflect.Descriptor instead.
+func (*GetSupplierListByProductIdResponse) Descriptor() ([]byte, []int) {
+ return file_purchase_wms_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *GetSupplierListByProductIdResponse) GetCode() int32 {
+ if x != nil {
+ return x.Code
+ }
+ return 0
+}
+
+func (x *GetSupplierListByProductIdResponse) GetMsg() string {
+ if x != nil {
+ return x.Msg
+ }
+ return ""
+}
+
+func (x *GetSupplierListByProductIdResponse) GetList() []*SupplierList {
+ if x != nil {
+ return x.List
+ }
+ return nil
+}
+
+type CreatePurchaseByWmsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ SupplierId int64 `protobuf:"varint,1,opt,name=SupplierId,proto3" json:"SupplierId,omitempty"`
+ ProductId string `protobuf:"bytes,2,opt,name=ProductId,proto3" json:"ProductId,omitempty"`
+ Amount int64 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount,omitempty"`
+}
+
+func (x *CreatePurchaseByWmsRequest) Reset() {
+ *x = CreatePurchaseByWmsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_purchase_wms_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreatePurchaseByWmsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreatePurchaseByWmsRequest) ProtoMessage() {}
+
+func (x *CreatePurchaseByWmsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_purchase_wms_proto_msgTypes[8]
+ 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 CreatePurchaseByWmsRequest.ProtoReflect.Descriptor instead.
+func (*CreatePurchaseByWmsRequest) Descriptor() ([]byte, []int) {
+ return file_purchase_wms_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *CreatePurchaseByWmsRequest) GetSupplierId() int64 {
+ if x != nil {
+ return x.SupplierId
+ }
+ return 0
+}
+
+func (x *CreatePurchaseByWmsRequest) GetProductId() string {
+ if x != nil {
+ return x.ProductId
+ }
+ return ""
+}
+
+func (x *CreatePurchaseByWmsRequest) GetAmount() int64 {
+ if x != nil {
+ return x.Amount
+ }
+ return 0
+}
+
+type CreatePurchaseByWmsResponse 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"`
+ PurchaseNumber string `protobuf:"bytes,3,opt,name=PurchaseNumber,proto3" json:"PurchaseNumber,omitempty"`
+}
+
+func (x *CreatePurchaseByWmsResponse) Reset() {
+ *x = CreatePurchaseByWmsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_purchase_wms_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreatePurchaseByWmsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreatePurchaseByWmsResponse) ProtoMessage() {}
+
+func (x *CreatePurchaseByWmsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_purchase_wms_proto_msgTypes[9]
+ 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 CreatePurchaseByWmsResponse.ProtoReflect.Descriptor instead.
+func (*CreatePurchaseByWmsResponse) Descriptor() ([]byte, []int) {
+ return file_purchase_wms_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *CreatePurchaseByWmsResponse) GetCode() int32 {
+ if x != nil {
+ return x.Code
+ }
+ return 0
+}
+
+func (x *CreatePurchaseByWmsResponse) GetMsg() string {
+ if x != nil {
+ return x.Msg
+ }
+ return ""
+}
+
+func (x *CreatePurchaseByWmsResponse) GetPurchaseNumber() string {
+ if x != nil {
+ return x.PurchaseNumber
+ }
+ return ""
+}
+
var File_purchase_wms_proto protoreflect.FileDescriptor
var file_purchase_wms_proto_rawDesc = []byte{
@@ -323,19 +622,64 @@
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, 0xa8, 0x01, 0x0a, 0x0f, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65,
- 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x50, 0x75, 0x72, 0x63, 0x68,
- 0x61, 0x73, 0x65, 0x54, 0x6f, 0x57, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68,
- 0x61, 0x73, 0x65, 0x54, 0x6f, 0x57, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x16, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x6f, 0x57, 0x6d, 0x73, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74,
- 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
- 0x1c, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65,
- 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x53, 0x74,
- 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x10,
- 0x5a, 0x0e, 0x2e, 0x2f, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x5f, 0x77, 0x6d, 0x73,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x4d, 0x73, 0x67, 0x22, 0x41, 0x0a, 0x21, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69,
+ 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49,
+ 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x22, 0x78, 0x0a, 0x0c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69,
+ 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69,
+ 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x75, 0x70, 0x70,
+ 0x6c, 0x69, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69,
+ 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x75,
+ 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x75,
+ 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x02, 0x52, 0x0d, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65,
+ 0x22, 0x6d, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c,
+ 0x69, 0x73, 0x74, 0x42, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 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, 0x21, 0x0a, 0x04,
+ 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x53, 0x75, 0x70,
+ 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22,
+ 0x72, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73,
+ 0x65, 0x42, 0x79, 0x57, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a,
+ 0x0a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x03, 0x52, 0x0a, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1c, 0x0a,
+ 0x09, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x09, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41,
+ 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x41, 0x6d, 0x6f,
+ 0x75, 0x6e, 0x74, 0x22, 0x6b, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x72,
+ 0x63, 0x68, 0x61, 0x73, 0x65, 0x42, 0x79, 0x57, 0x6d, 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, 0x12, 0x26, 0x0a, 0x0e, 0x50, 0x75, 0x72, 0x63,
+ 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x0e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
+ 0x32, 0xe5, 0x02, 0x0a, 0x0f, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72,
+ 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65,
+ 0x54, 0x6f, 0x57, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65,
+ 0x54, 0x6f, 0x57, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x50,
+ 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x6f, 0x57, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75,
+ 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75,
+ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x67, 0x0a, 0x1a, 0x47,
+ 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79,
+ 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x22, 0x2e, 0x47, 0x65, 0x74, 0x53,
+ 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x79, 0x50, 0x72, 0x6f,
+ 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e,
+ 0x47, 0x65, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x42,
+ 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x75,
+ 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x42, 0x79, 0x57, 0x6d, 0x73, 0x12, 0x1b, 0x2e, 0x43, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x42, 0x79, 0x57, 0x6d,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x42, 0x79, 0x57, 0x6d, 0x73, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x10, 0x5a, 0x0e, 0x2e, 0x2f, 0x70, 0x75,
+ 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x5f, 0x77, 0x6d, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x33,
}
var (
@@ -350,25 +694,35 @@
return file_purchase_wms_proto_rawDescData
}
-var file_purchase_wms_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_purchase_wms_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_purchase_wms_proto_goTypes = []interface{}{
- (*PurchaseProduct)(nil), // 0: PurchaseProduct
- (*PurchaseToWmsRequest)(nil), // 1: PurchaseToWmsRequest
- (*PurchaseToWmsResponse)(nil), // 2: PurchaseToWmsResponse
- (*UpdatePurchaseStatusRequest)(nil), // 3: UpdatePurchaseStatusRequest
- (*UpdatePurchaseStatusResponse)(nil), // 4: UpdatePurchaseStatusResponse
+ (*PurchaseProduct)(nil), // 0: PurchaseProduct
+ (*PurchaseToWmsRequest)(nil), // 1: PurchaseToWmsRequest
+ (*PurchaseToWmsResponse)(nil), // 2: PurchaseToWmsResponse
+ (*UpdatePurchaseStatusRequest)(nil), // 3: UpdatePurchaseStatusRequest
+ (*UpdatePurchaseStatusResponse)(nil), // 4: UpdatePurchaseStatusResponse
+ (*GetSupplierListByProductIdRequest)(nil), // 5: GetSupplierListByProductIdRequest
+ (*SupplierList)(nil), // 6: SupplierList
+ (*GetSupplierListByProductIdResponse)(nil), // 7: GetSupplierListByProductIdResponse
+ (*CreatePurchaseByWmsRequest)(nil), // 8: CreatePurchaseByWmsRequest
+ (*CreatePurchaseByWmsResponse)(nil), // 9: CreatePurchaseByWmsResponse
}
var file_purchase_wms_proto_depIdxs = []int32{
0, // 0: PurchaseToWmsRequest.Product:type_name -> PurchaseProduct
- 1, // 1: PurchaseService.PurchaseToWms:input_type -> PurchaseToWmsRequest
- 3, // 2: PurchaseService.UpdatePurchaseStatus:input_type -> UpdatePurchaseStatusRequest
- 2, // 3: PurchaseService.PurchaseToWms:output_type -> PurchaseToWmsResponse
- 4, // 4: PurchaseService.UpdatePurchaseStatus:output_type -> UpdatePurchaseStatusResponse
- 3, // [3:5] is the sub-list for method output_type
- 1, // [1:3] is the sub-list for method input_type
- 1, // [1:1] is the sub-list for extension type_name
- 1, // [1:1] is the sub-list for extension extendee
- 0, // [0:1] is the sub-list for field type_name
+ 6, // 1: GetSupplierListByProductIdResponse.List:type_name -> SupplierList
+ 1, // 2: PurchaseService.PurchaseToWms:input_type -> PurchaseToWmsRequest
+ 3, // 3: PurchaseService.UpdatePurchaseStatus:input_type -> UpdatePurchaseStatusRequest
+ 5, // 4: PurchaseService.GetSupplierListByProductId:input_type -> GetSupplierListByProductIdRequest
+ 8, // 5: PurchaseService.CreatePurchaseByWms:input_type -> CreatePurchaseByWmsRequest
+ 2, // 6: PurchaseService.PurchaseToWms:output_type -> PurchaseToWmsResponse
+ 4, // 7: PurchaseService.UpdatePurchaseStatus:output_type -> UpdatePurchaseStatusResponse
+ 7, // 8: PurchaseService.GetSupplierListByProductId:output_type -> GetSupplierListByProductIdResponse
+ 9, // 9: PurchaseService.CreatePurchaseByWms:output_type -> CreatePurchaseByWmsResponse
+ 6, // [6:10] is the sub-list for method output_type
+ 2, // [2:6] 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
}
func init() { file_purchase_wms_proto_init() }
@@ -437,6 +791,66 @@
return nil
}
}
+ file_purchase_wms_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetSupplierListByProductIdRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_purchase_wms_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SupplierList); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_purchase_wms_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetSupplierListByProductIdResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_purchase_wms_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreatePurchaseByWmsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_purchase_wms_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreatePurchaseByWmsResponse); 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{
@@ -444,7 +858,7 @@
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_purchase_wms_proto_rawDesc,
NumEnums: 0,
- NumMessages: 5,
+ NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/purchase_wms/purchase_wms_grpc.pb.go b/proto/purchase_wms/purchase_wms_grpc.pb.go
index 4edcf55..bab2cda 100644
--- a/proto/purchase_wms/purchase_wms_grpc.pb.go
+++ b/proto/purchase_wms/purchase_wms_grpc.pb.go
@@ -20,6 +20,8 @@
type PurchaseServiceClient interface {
PurchaseToWms(ctx context.Context, in *PurchaseToWmsRequest, opts ...grpc.CallOption) (*PurchaseToWmsResponse, error)
UpdatePurchaseStatus(ctx context.Context, in *UpdatePurchaseStatusRequest, opts ...grpc.CallOption) (*UpdatePurchaseStatusResponse, error)
+ GetSupplierListByProductId(ctx context.Context, in *GetSupplierListByProductIdRequest, opts ...grpc.CallOption) (*GetSupplierListByProductIdResponse, error)
+ CreatePurchaseByWms(ctx context.Context, in *CreatePurchaseByWmsRequest, opts ...grpc.CallOption) (*CreatePurchaseByWmsResponse, error)
}
type purchaseServiceClient struct {
@@ -48,12 +50,32 @@
return out, nil
}
+func (c *purchaseServiceClient) GetSupplierListByProductId(ctx context.Context, in *GetSupplierListByProductIdRequest, opts ...grpc.CallOption) (*GetSupplierListByProductIdResponse, error) {
+ out := new(GetSupplierListByProductIdResponse)
+ err := c.cc.Invoke(ctx, "/PurchaseService/GetSupplierListByProductId", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *purchaseServiceClient) CreatePurchaseByWms(ctx context.Context, in *CreatePurchaseByWmsRequest, opts ...grpc.CallOption) (*CreatePurchaseByWmsResponse, error) {
+ out := new(CreatePurchaseByWmsResponse)
+ err := c.cc.Invoke(ctx, "/PurchaseService/CreatePurchaseByWms", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// PurchaseServiceServer is the server API for PurchaseService service.
// All implementations must embed UnimplementedPurchaseServiceServer
// for forward compatibility
type PurchaseServiceServer interface {
PurchaseToWms(context.Context, *PurchaseToWmsRequest) (*PurchaseToWmsResponse, error)
UpdatePurchaseStatus(context.Context, *UpdatePurchaseStatusRequest) (*UpdatePurchaseStatusResponse, error)
+ GetSupplierListByProductId(context.Context, *GetSupplierListByProductIdRequest) (*GetSupplierListByProductIdResponse, error)
+ CreatePurchaseByWms(context.Context, *CreatePurchaseByWmsRequest) (*CreatePurchaseByWmsResponse, error)
mustEmbedUnimplementedPurchaseServiceServer()
}
@@ -66,6 +88,12 @@
}
func (UnimplementedPurchaseServiceServer) UpdatePurchaseStatus(context.Context, *UpdatePurchaseStatusRequest) (*UpdatePurchaseStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdatePurchaseStatus not implemented")
+}
+func (UnimplementedPurchaseServiceServer) GetSupplierListByProductId(context.Context, *GetSupplierListByProductIdRequest) (*GetSupplierListByProductIdResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetSupplierListByProductId not implemented")
+}
+func (UnimplementedPurchaseServiceServer) CreatePurchaseByWms(context.Context, *CreatePurchaseByWmsRequest) (*CreatePurchaseByWmsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreatePurchaseByWms not implemented")
}
func (UnimplementedPurchaseServiceServer) mustEmbedUnimplementedPurchaseServiceServer() {}
@@ -116,6 +144,42 @@
return interceptor(ctx, in, info, handler)
}
+func _PurchaseService_GetSupplierListByProductId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetSupplierListByProductIdRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PurchaseServiceServer).GetSupplierListByProductId(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/PurchaseService/GetSupplierListByProductId",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PurchaseServiceServer).GetSupplierListByProductId(ctx, req.(*GetSupplierListByProductIdRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _PurchaseService_CreatePurchaseByWms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreatePurchaseByWmsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(PurchaseServiceServer).CreatePurchaseByWms(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/PurchaseService/CreatePurchaseByWms",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(PurchaseServiceServer).CreatePurchaseByWms(ctx, req.(*CreatePurchaseByWmsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
// PurchaseService_ServiceDesc is the grpc.ServiceDesc for PurchaseService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -131,6 +195,14 @@
MethodName: "UpdatePurchaseStatus",
Handler: _PurchaseService_UpdatePurchaseStatus_Handler,
},
+ {
+ MethodName: "GetSupplierListByProductId",
+ Handler: _PurchaseService_GetSupplierListByProductId_Handler,
+ },
+ {
+ MethodName: "CreatePurchaseByWms",
+ Handler: _PurchaseService_CreatePurchaseByWms_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "purchase_wms.proto",
diff --git a/proto/purchase_wms/server.go b/proto/purchase_wms/server.go
index e97ce12..173e7db 100644
--- a/proto/purchase_wms/server.go
+++ b/proto/purchase_wms/server.go
@@ -21,6 +21,7 @@
operation.OperationDate = timex.TimeToString2(time.Now())
operation.Number = strconv.FormatInt(time.Now().Unix(), 10)
operation.Status = constvar.OperationStatus_Ready
+ operation.CompanyName = req.SupplierName
warehouse, err := models.NewWarehouseSearch().First()
if err != nil {
return nil, err
--
Gitblit v1.8.0