Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS
| | |
| | | grpcServerConf struct { |
| | | ApsAddr string //aps服务grpc地址 |
| | | CrmAddr string //crm服务grpc地址 |
| | | SrmAddr string //srm服务grpc地址 |
| | | } |
| | | ) |
| | | |
| | |
| | | GrpcPort := os.Getenv("WMS_GRPC") // 只对外提供grpc服务,本服务不用 |
| | | apsAddr := os.Getenv("APS_GRPC") |
| | | crmAddr := os.Getenv("CRM_GRPC") |
| | | srmAddr := os.Getenv("SRM_GRPC") |
| | | if len(GrpcPort) > 0 { |
| | | WebConf.GrpcPort = GrpcPort |
| | | } |
| | |
| | | if len(crmAddr) > 0 { |
| | | GrpcServerConf.CrmAddr = crmAddr |
| | | } |
| | | if len(srmAddr) > 0 { |
| | | GrpcServerConf.SrmAddr = srmAddr |
| | | } |
| | | |
| | | DBHost := os.Getenv("DB_HOST") |
| | | DBName := os.Getenv("DB_NAME") |
| | |
| | | grpcServer: |
| | | apsAddr: 192.168.20.119:9091 |
| | | crmAddr: 192.168.20.118:9092 |
| | | srmAddr: 192.168.20.118:9093 |
| | |
| | | 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) |
| | | } |
| | | } |
| | |
| | | "wms/pkg/logx" |
| | | "wms/pkg/structx" |
| | | "wms/proto/product_inventory" |
| | | "wms/proto/purchase_wms" |
| | | "wms/request" |
| | | ) |
| | | |
| | |
| | | return err |
| | | } |
| | | } |
| | | if operation.SourceNumber != "" { |
| | | go UpdatePurchaseStatus(operation.SourceNumber) |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | if err := models.NewLocationProductAmountSearch().SetID(locAmount.Id).Update(locAmount); err != nil { |
| | | return err |
| | | } |
| | | } |
| | | if operation.SourceNumber != "" { |
| | | go UpdateSalesDetailStatus(operation.SourceNumber) |
| | | } |
| | | } |
| | | |
| | |
| | | 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 |
| | |
| | | func CloseProductInventoryServiceConn() { |
| | | if ProductInventoryServiceConn != nil { |
| | | ProductInventoryServiceConn.Close() |
| | | } |
| | | if PurchaseServiceConn != nil { |
| | | PurchaseServiceConn.Close() |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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 库存调拨列表 |
| | |
| | | "wms/pkg/logx" |
| | | "wms/pkg/timex" |
| | | "wms/proto/inventory_order" |
| | | "wms/proto/purchase_wms" |
| | | "wms/request" |
| | | ) |
| | | |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, "参数解析失败,数据类型错误") |
| | | 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(), |
| | |
| | | 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 |
| | |
| | | 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 { |
| | |
| | | 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, "重订成功") |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | "description": "HSCode string ` + "`" + `gorm:\"type:varchar(255);comment:HS编码\" json:\"HSCode\"` + "`" + ` //HS编码\nOriginCountryId int ` + "`" + `gorm:\"type:int(11);comment:原产地id\" json:\"originCountryId\"` + "`" + ` //原产地id\nOriginCountryName string ` + "`" + `gorm:\"type:varchar(255);comment:原产地名称\" json:\"originCountryName\"` + "`" + ` //原产地名称", |
| | | "type": "string" |
| | | }, |
| | | "inputAmount": { |
| | | "type": "number" |
| | | }, |
| | | "internalNotes": { |
| | | "description": "内部说明", |
| | | "type": "string" |
| | |
| | | "description": "最大库存", |
| | | "type": "number" |
| | | }, |
| | | "maxInventoryRule": { |
| | | "description": "最大库存", |
| | | "type": "number" |
| | | }, |
| | | "minInventory": { |
| | | "description": "最小库存", |
| | | "type": "number" |
| | | }, |
| | | "minInventoryRule": { |
| | | "description": "最小库存", |
| | | "type": "number" |
| | | }, |
| | |
| | | "description": "出库说明", |
| | | "type": "string" |
| | | }, |
| | | "outputAmount": { |
| | | "type": "number" |
| | | }, |
| | | "predictionAmount": { |
| | | "type": "number" |
| | | }, |
| | | "principal": { |
| | | "description": "负责人", |
| | | "type": "string" |
| | |
| | | }, |
| | | "purchaseType": { |
| | | "$ref": "#/definitions/constvar.PurchaseType" |
| | | }, |
| | | "reorderRuleNum": { |
| | | "type": "integer" |
| | | }, |
| | | "salePrice": { |
| | | "description": "销售单价", |
| | |
| | | "description": "路线", |
| | | "type": "string" |
| | | }, |
| | | "supplierId": { |
| | | "description": "供应商id", |
| | | "type": "integer" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/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": [ |
| | |
| | | "description": "HSCode string `gorm:\"type:varchar(255);comment:HS编码\" json:\"HSCode\"` //HS编码\nOriginCountryId int `gorm:\"type:int(11);comment:原产地id\" json:\"originCountryId\"` //原产地id\nOriginCountryName string `gorm:\"type:varchar(255);comment:原产地名称\" json:\"originCountryName\"` //原产地名称", |
| | | "type": "string" |
| | | }, |
| | | "inputAmount": { |
| | | "type": "number" |
| | | }, |
| | | "internalNotes": { |
| | | "description": "内部说明", |
| | | "type": "string" |
| | |
| | | "description": "最大库存", |
| | | "type": "number" |
| | | }, |
| | | "maxInventoryRule": { |
| | | "description": "最大库存", |
| | | "type": "number" |
| | | }, |
| | | "minInventory": { |
| | | "description": "最小库存", |
| | | "type": "number" |
| | | }, |
| | | "minInventoryRule": { |
| | | "description": "最小库存", |
| | | "type": "number" |
| | | }, |
| | |
| | | "description": "出库说明", |
| | | "type": "string" |
| | | }, |
| | | "outputAmount": { |
| | | "type": "number" |
| | | }, |
| | | "predictionAmount": { |
| | | "type": "number" |
| | | }, |
| | | "principal": { |
| | | "description": "负责人", |
| | | "type": "string" |
| | |
| | | }, |
| | | "purchaseType": { |
| | | "$ref": "#/definitions/constvar.PurchaseType" |
| | | }, |
| | | "reorderRuleNum": { |
| | | "type": "integer" |
| | | }, |
| | | "salePrice": { |
| | | "description": "销售单价", |
| | |
| | | "description": "路线", |
| | | "type": "string" |
| | | }, |
| | | "supplierId": { |
| | | "description": "供应商id", |
| | | "type": "integer" |
| | | }, |
| | | "unit": { |
| | | "description": "单位", |
| | | "type": "string" |
| | |
| | | OriginCountryId int `gorm:"type:int(11);comment:原产地id" json:"originCountryId"` //原产地id |
| | | OriginCountryName string `gorm:"type:varchar(255);comment:原产地名称" json:"originCountryName"` //原产地名称 |
| | | type: string |
| | | inputAmount: |
| | | type: number |
| | | internalNotes: |
| | | description: 内部说明 |
| | | type: string |
| | |
| | | maxInventory: |
| | | description: 最大库存 |
| | | type: number |
| | | maxInventoryRule: |
| | | description: 最大库存 |
| | | type: number |
| | | minInventory: |
| | | description: 最小库存 |
| | | type: number |
| | | minInventoryRule: |
| | | description: 最小库存 |
| | | type: number |
| | | minPurchaseAmount: |
| | |
| | | outStorageExplain: |
| | | description: 出库说明 |
| | | type: string |
| | | outputAmount: |
| | | type: number |
| | | predictionAmount: |
| | | type: number |
| | | principal: |
| | | description: 负责人 |
| | | type: string |
| | |
| | | type: number |
| | | purchaseType: |
| | | $ref: '#/definitions/constvar.PurchaseType' |
| | | reorderRuleNum: |
| | | type: integer |
| | | salePrice: |
| | | description: 销售单价 |
| | | type: number |
| | |
| | | route: |
| | | description: 路线 |
| | | type: string |
| | | supplierId: |
| | | description: 供应商id |
| | | type: integer |
| | | unit: |
| | | description: 单位 |
| | | type: string |
| | |
| | | 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: |
| | |
| | | "wms/models" |
| | | "wms/pkg/logx" |
| | | "wms/proto/product_inventory" |
| | | "wms/proto/purchase_wms" |
| | | "wms/router" |
| | | ) |
| | | |
| | |
| | | s := grpc.NewServer() |
| | | //todo 添加具体服务 |
| | | product_inventory.RegisterProductInventoryServiceServer(s, &product_inventory.Server{}) |
| | | purchase_wms.RegisterPurchaseServiceServer(s, &purchase_wms.Server{}) |
| | | err = s.Serve(ln) |
| | | if err != nil { |
| | | logx.Errorf("grpc server init error: %v", err.Error()) |
| | |
| | | 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:"-"` //供应商id |
| | | } |
| | | ReorderRuleSearch struct { |
| | | ReorderRule |
| | |
| | | } |
| | | operation.OperationTypeName = operationType.Name |
| | | operation.OperationTypeId = operationType.Id |
| | | location, err := models.NewLocationSearch().SetJointNames([]string{warehouse.Code}).First() |
| | | location, err := models.NewLocationSearch().SetID(warehouse.LocationId).First() |
| | | if err != nil { |
| | | return nil, err |
| | | } |
New file |
| | |
| | | syntax = "proto3"; |
| | | |
| | | option go_package = "./purchase_wms"; |
| | | |
| | | 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; |
| | | int64 Amount = 2; |
| | | } |
| | | |
| | | message PurchaseToWmsRequest { |
| | | string Number = 1; //采购编号 |
| | | string SupplierName = 2; //供应商 |
| | | repeated PurchaseProduct Product = 3; |
| | | } |
| | | |
| | | message PurchaseToWmsResponse { |
| | | int32 code = 1; |
| | | string message = 2; |
| | | } |
| | | |
| | | //------------------------------------------------UpdatePurchaseStatus------------------------------------- |
| | | |
| | | message UpdatePurchaseStatusRequest { |
| | | string Number = 1;//采购编号 |
| | | } |
| | | |
| | | message UpdatePurchaseStatusResponse { |
| | | int32 Code = 1; |
| | | 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; |
| | | } |
| | | |
New file |
| | |
| | | // Code generated by protoc-gen-go. DO NOT EDIT. |
| | | // versions: |
| | | // protoc-gen-go v1.26.0 |
| | | // protoc v4.24.0 |
| | | // source: purchase_wms.proto |
| | | |
| | | package purchase_wms |
| | | |
| | | import ( |
| | | protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| | | protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| | | reflect "reflect" |
| | | sync "sync" |
| | | ) |
| | | |
| | | const ( |
| | | // Verify that this generated code is sufficiently up-to-date. |
| | | _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) |
| | | // Verify that runtime/protoimpl is sufficiently up-to-date. |
| | | _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) |
| | | ) |
| | | |
| | | type PurchaseProduct struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"` |
| | | Amount int64 `protobuf:"varint,2,opt,name=Amount,proto3" json:"Amount,omitempty"` |
| | | } |
| | | |
| | | func (x *PurchaseProduct) Reset() { |
| | | *x = PurchaseProduct{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_purchase_wms_proto_msgTypes[0] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *PurchaseProduct) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*PurchaseProduct) ProtoMessage() {} |
| | | |
| | | func (x *PurchaseProduct) ProtoReflect() protoreflect.Message { |
| | | mi := &file_purchase_wms_proto_msgTypes[0] |
| | | 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 PurchaseProduct.ProtoReflect.Descriptor instead. |
| | | func (*PurchaseProduct) Descriptor() ([]byte, []int) { |
| | | return file_purchase_wms_proto_rawDescGZIP(), []int{0} |
| | | } |
| | | |
| | | func (x *PurchaseProduct) GetId() string { |
| | | if x != nil { |
| | | return x.Id |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | func (x *PurchaseProduct) GetAmount() int64 { |
| | | if x != nil { |
| | | return x.Amount |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | type PurchaseToWmsRequest struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"` //采购编号 |
| | | SupplierName string `protobuf:"bytes,2,opt,name=SupplierName,proto3" json:"SupplierName,omitempty"` //供应商 |
| | | Product []*PurchaseProduct `protobuf:"bytes,3,rep,name=Product,proto3" json:"Product,omitempty"` |
| | | } |
| | | |
| | | func (x *PurchaseToWmsRequest) Reset() { |
| | | *x = PurchaseToWmsRequest{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_purchase_wms_proto_msgTypes[1] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *PurchaseToWmsRequest) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*PurchaseToWmsRequest) ProtoMessage() {} |
| | | |
| | | func (x *PurchaseToWmsRequest) ProtoReflect() protoreflect.Message { |
| | | mi := &file_purchase_wms_proto_msgTypes[1] |
| | | 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 PurchaseToWmsRequest.ProtoReflect.Descriptor instead. |
| | | func (*PurchaseToWmsRequest) Descriptor() ([]byte, []int) { |
| | | return file_purchase_wms_proto_rawDescGZIP(), []int{1} |
| | | } |
| | | |
| | | func (x *PurchaseToWmsRequest) GetNumber() string { |
| | | if x != nil { |
| | | return x.Number |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | func (x *PurchaseToWmsRequest) GetSupplierName() string { |
| | | if x != nil { |
| | | return x.SupplierName |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | func (x *PurchaseToWmsRequest) GetProduct() []*PurchaseProduct { |
| | | if x != nil { |
| | | return x.Product |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | type PurchaseToWmsResponse struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` |
| | | Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` |
| | | } |
| | | |
| | | func (x *PurchaseToWmsResponse) Reset() { |
| | | *x = PurchaseToWmsResponse{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_purchase_wms_proto_msgTypes[2] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *PurchaseToWmsResponse) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*PurchaseToWmsResponse) ProtoMessage() {} |
| | | |
| | | func (x *PurchaseToWmsResponse) ProtoReflect() protoreflect.Message { |
| | | mi := &file_purchase_wms_proto_msgTypes[2] |
| | | 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 PurchaseToWmsResponse.ProtoReflect.Descriptor instead. |
| | | func (*PurchaseToWmsResponse) Descriptor() ([]byte, []int) { |
| | | return file_purchase_wms_proto_rawDescGZIP(), []int{2} |
| | | } |
| | | |
| | | func (x *PurchaseToWmsResponse) GetCode() int32 { |
| | | if x != nil { |
| | | return x.Code |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | func (x *PurchaseToWmsResponse) GetMessage() string { |
| | | if x != nil { |
| | | return x.Message |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | type UpdatePurchaseStatusRequest struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"` //采购编号 |
| | | } |
| | | |
| | | func (x *UpdatePurchaseStatusRequest) Reset() { |
| | | *x = UpdatePurchaseStatusRequest{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_purchase_wms_proto_msgTypes[3] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *UpdatePurchaseStatusRequest) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*UpdatePurchaseStatusRequest) ProtoMessage() {} |
| | | |
| | | func (x *UpdatePurchaseStatusRequest) ProtoReflect() protoreflect.Message { |
| | | mi := &file_purchase_wms_proto_msgTypes[3] |
| | | 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 UpdatePurchaseStatusRequest.ProtoReflect.Descriptor instead. |
| | | func (*UpdatePurchaseStatusRequest) Descriptor() ([]byte, []int) { |
| | | return file_purchase_wms_proto_rawDescGZIP(), []int{3} |
| | | } |
| | | |
| | | func (x *UpdatePurchaseStatusRequest) GetNumber() string { |
| | | if x != nil { |
| | | return x.Number |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | type UpdatePurchaseStatusResponse 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 *UpdatePurchaseStatusResponse) Reset() { |
| | | *x = UpdatePurchaseStatusResponse{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_purchase_wms_proto_msgTypes[4] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *UpdatePurchaseStatusResponse) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*UpdatePurchaseStatusResponse) ProtoMessage() {} |
| | | |
| | | func (x *UpdatePurchaseStatusResponse) ProtoReflect() protoreflect.Message { |
| | | mi := &file_purchase_wms_proto_msgTypes[4] |
| | | 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 UpdatePurchaseStatusResponse.ProtoReflect.Descriptor instead. |
| | | func (*UpdatePurchaseStatusResponse) Descriptor() ([]byte, []int) { |
| | | return file_purchase_wms_proto_rawDescGZIP(), []int{4} |
| | | } |
| | | |
| | | func (x *UpdatePurchaseStatusResponse) GetCode() int32 { |
| | | if x != nil { |
| | | return x.Code |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | func (x *UpdatePurchaseStatusResponse) GetMsg() string { |
| | | if x != nil { |
| | | return x.Msg |
| | | } |
| | | 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{ |
| | | 0x0a, 0x12, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x5f, 0x77, 0x6d, 0x73, 0x2e, 0x70, |
| | | 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x39, 0x0a, 0x0f, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, |
| | | 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, |
| | | 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, |
| | | 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, |
| | | 0x7e, 0x0a, 0x14, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x6f, 0x57, 0x6d, 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, |
| | | 0x22, 0x0a, 0x0c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, |
| | | 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, |
| | | 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, 0x03, |
| | | 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x50, |
| | | 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x22, |
| | | 0x45, 0x0a, 0x15, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x54, 0x6f, 0x57, 0x6d, 0x73, |
| | | 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, |
| | | 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, |
| | | 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, |
| | | 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x35, 0x0a, 0x1b, 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, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, |
| | | 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x44, 0x0a, |
| | | 0x1c, 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, 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, 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 ( |
| | | file_purchase_wms_proto_rawDescOnce sync.Once |
| | | file_purchase_wms_proto_rawDescData = file_purchase_wms_proto_rawDesc |
| | | ) |
| | | |
| | | func file_purchase_wms_proto_rawDescGZIP() []byte { |
| | | file_purchase_wms_proto_rawDescOnce.Do(func() { |
| | | file_purchase_wms_proto_rawDescData = protoimpl.X.CompressGZIP(file_purchase_wms_proto_rawDescData) |
| | | }) |
| | | return file_purchase_wms_proto_rawDescData |
| | | } |
| | | |
| | | 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 |
| | | (*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 |
| | | 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() } |
| | | func file_purchase_wms_proto_init() { |
| | | if File_purchase_wms_proto != nil { |
| | | return |
| | | } |
| | | if !protoimpl.UnsafeEnabled { |
| | | file_purchase_wms_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*PurchaseProduct); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_purchase_wms_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*PurchaseToWmsRequest); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_purchase_wms_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*PurchaseToWmsResponse); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_purchase_wms_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*UpdatePurchaseStatusRequest); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_purchase_wms_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*UpdatePurchaseStatusResponse); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | 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{ |
| | | File: protoimpl.DescBuilder{ |
| | | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| | | RawDescriptor: file_purchase_wms_proto_rawDesc, |
| | | NumEnums: 0, |
| | | NumMessages: 10, |
| | | NumExtensions: 0, |
| | | NumServices: 1, |
| | | }, |
| | | GoTypes: file_purchase_wms_proto_goTypes, |
| | | DependencyIndexes: file_purchase_wms_proto_depIdxs, |
| | | MessageInfos: file_purchase_wms_proto_msgTypes, |
| | | }.Build() |
| | | File_purchase_wms_proto = out.File |
| | | file_purchase_wms_proto_rawDesc = nil |
| | | file_purchase_wms_proto_goTypes = nil |
| | | file_purchase_wms_proto_depIdxs = nil |
| | | } |
New file |
| | |
| | | // Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| | | |
| | | package purchase_wms |
| | | |
| | | import ( |
| | | context "context" |
| | | grpc "google.golang.org/grpc" |
| | | codes "google.golang.org/grpc/codes" |
| | | status "google.golang.org/grpc/status" |
| | | ) |
| | | |
| | | // This is a compile-time assertion to ensure that this generated file |
| | | // is compatible with the grpc package it is being compiled against. |
| | | // Requires gRPC-Go v1.32.0 or later. |
| | | const _ = grpc.SupportPackageIsVersion7 |
| | | |
| | | // PurchaseServiceClient is the client API for PurchaseService service. |
| | | // |
| | | // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| | | 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 { |
| | | cc grpc.ClientConnInterface |
| | | } |
| | | |
| | | func NewPurchaseServiceClient(cc grpc.ClientConnInterface) PurchaseServiceClient { |
| | | return &purchaseServiceClient{cc} |
| | | } |
| | | |
| | | func (c *purchaseServiceClient) PurchaseToWms(ctx context.Context, in *PurchaseToWmsRequest, opts ...grpc.CallOption) (*PurchaseToWmsResponse, error) { |
| | | out := new(PurchaseToWmsResponse) |
| | | err := c.cc.Invoke(ctx, "/PurchaseService/PurchaseToWms", in, out, opts...) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | return out, nil |
| | | } |
| | | |
| | | func (c *purchaseServiceClient) UpdatePurchaseStatus(ctx context.Context, in *UpdatePurchaseStatusRequest, opts ...grpc.CallOption) (*UpdatePurchaseStatusResponse, error) { |
| | | out := new(UpdatePurchaseStatusResponse) |
| | | err := c.cc.Invoke(ctx, "/PurchaseService/UpdatePurchaseStatus", in, out, opts...) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | 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() |
| | | } |
| | | |
| | | // UnimplementedPurchaseServiceServer must be embedded to have forward compatible implementations. |
| | | type UnimplementedPurchaseServiceServer struct { |
| | | } |
| | | |
| | | func (UnimplementedPurchaseServiceServer) PurchaseToWms(context.Context, *PurchaseToWmsRequest) (*PurchaseToWmsResponse, error) { |
| | | return nil, status.Errorf(codes.Unimplemented, "method PurchaseToWms not implemented") |
| | | } |
| | | 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() {} |
| | | |
| | | // UnsafePurchaseServiceServer may be embedded to opt out of forward compatibility for this service. |
| | | // Use of this interface is not recommended, as added methods to PurchaseServiceServer will |
| | | // result in compilation errors. |
| | | type UnsafePurchaseServiceServer interface { |
| | | mustEmbedUnimplementedPurchaseServiceServer() |
| | | } |
| | | |
| | | func RegisterPurchaseServiceServer(s grpc.ServiceRegistrar, srv PurchaseServiceServer) { |
| | | s.RegisterService(&PurchaseService_ServiceDesc, srv) |
| | | } |
| | | |
| | | func _PurchaseService_PurchaseToWms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| | | in := new(PurchaseToWmsRequest) |
| | | if err := dec(in); err != nil { |
| | | return nil, err |
| | | } |
| | | if interceptor == nil { |
| | | return srv.(PurchaseServiceServer).PurchaseToWms(ctx, in) |
| | | } |
| | | info := &grpc.UnaryServerInfo{ |
| | | Server: srv, |
| | | FullMethod: "/PurchaseService/PurchaseToWms", |
| | | } |
| | | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| | | return srv.(PurchaseServiceServer).PurchaseToWms(ctx, req.(*PurchaseToWmsRequest)) |
| | | } |
| | | return interceptor(ctx, in, info, handler) |
| | | } |
| | | |
| | | func _PurchaseService_UpdatePurchaseStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| | | in := new(UpdatePurchaseStatusRequest) |
| | | if err := dec(in); err != nil { |
| | | return nil, err |
| | | } |
| | | if interceptor == nil { |
| | | return srv.(PurchaseServiceServer).UpdatePurchaseStatus(ctx, in) |
| | | } |
| | | info := &grpc.UnaryServerInfo{ |
| | | Server: srv, |
| | | FullMethod: "/PurchaseService/UpdatePurchaseStatus", |
| | | } |
| | | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| | | return srv.(PurchaseServiceServer).UpdatePurchaseStatus(ctx, req.(*UpdatePurchaseStatusRequest)) |
| | | } |
| | | 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) |
| | | var PurchaseService_ServiceDesc = grpc.ServiceDesc{ |
| | | ServiceName: "PurchaseService", |
| | | HandlerType: (*PurchaseServiceServer)(nil), |
| | | Methods: []grpc.MethodDesc{ |
| | | { |
| | | MethodName: "PurchaseToWms", |
| | | Handler: _PurchaseService_PurchaseToWms_Handler, |
| | | }, |
| | | { |
| | | 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", |
| | | } |
New file |
| | |
| | | package purchase_wms |
| | | |
| | | import ( |
| | | "context" |
| | | "github.com/shopspring/decimal" |
| | | "strconv" |
| | | "time" |
| | | "wms/constvar" |
| | | "wms/models" |
| | | "wms/pkg/timex" |
| | | ) |
| | | |
| | | type Server struct { |
| | | UnimplementedPurchaseServiceServer |
| | | } |
| | | |
| | | func (s *Server) PurchaseToWms(c context.Context, req *PurchaseToWmsRequest) (*PurchaseToWmsResponse, error) { |
| | | var operation models.Operation |
| | | var details []*models.OperationDetails |
| | | operation.SourceNumber = req.Number |
| | | 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 |
| | | } |
| | | operationType, err := models.NewOperationTypeSearch().SetWarehouseId(warehouse.Id).SetBaseOperationType(constvar.BaseOperationTypeIncoming).First() |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | operation.OperationTypeName = operationType.Name |
| | | operation.OperationTypeId = operationType.Id |
| | | location, err := models.NewLocationSearch().SetID(warehouse.LocationId).First() |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | operation.ToLocationID = location.Id |
| | | first, err := models.NewLocationSearch().SetType(int(constvar.LocationTypeVendor)).First() |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | operation.FromLocationID = first.Id |
| | | operation.BaseOperationType = constvar.BaseOperationTypeIncoming |
| | | for _, product := range req.Product { |
| | | var detail models.OperationDetails |
| | | detail.ProductId = product.Id |
| | | detail.Amount = decimal.NewFromInt(product.Amount) |
| | | details = append(details, &detail) |
| | | } |
| | | err = models.NewOperationSearch().Create(&operation) |
| | | return new(PurchaseToWmsResponse), err |
| | | } |