| | |
| | | |
| | | OperationTypeSearch struct { |
| | | OperationType |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | WarehouseIds []int |
| | | } |
| | | |
| | | OperationTypeByStatus struct { |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationTypeSearch) SetWarehouseIds(warehouseIds []int) *OperationTypeSearch { |
| | | slf.WarehouseIds = warehouseIds |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationTypeSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Model(&OperationType{}) |
| | | |
| | |
| | | db = db.Where("warehouse_id = ?", slf.WarehouseId) |
| | | } |
| | | |
| | | if len(slf.WarehouseIds) > 0 { |
| | | db = db.Where("warehouse_id in ?", slf.WarehouseIds) |
| | | } |
| | | |
| | | if int(slf.BaseOperationType) != 0 { |
| | | db = db.Where("base_operation_type = ?", slf.BaseOperationType) |
| | | } |
| | |
| | | rpc GetInventoryProductInfo(GetInventoryProductInfoRequest) returns (GetInventoryProductInfoResponse) {} |
| | | rpc UpdateSalesDetailStatus(UpdateSalesDetailStatusRequest) returns (UpdateSalesDetailStatusResponse) {} |
| | | rpc GetOrderInputAndOutputInfo(GetOrderInputAndOutputInfoRequest) returns (GetOrderInputAndOutputInfoResponse) {} |
| | | rpc OrderProductOutput(OrderProductOutputRequest) returns (OrderProductOutputResponse) {} |
| | | } |
| | | |
| | | message CreateOperationRequest{ |
| | |
| | | string Amount = 11; //数量 |
| | | FinishStatus Status = 13; |
| | | string CreateTime = 14; |
| | | int64 LocationID = 15; |
| | | int64 WareHouseID = 16; |
| | | } |
| | | message GetOrderInputAndOutputInfoRequest { |
| | | string Number = 1;//明细单编码 |
| | |
| | | string Msg = 2; |
| | | repeated InputAndOutputInfo InputList = 3; |
| | | repeated InputAndOutputInfo OutputList = 4; |
| | | } |
| | | |
| | | message OutputProduct { |
| | | string Number = 1;//产品编码 |
| | | string Amount = 2; //发货数量 |
| | | } |
| | | |
| | | |
| | | message OrderProductOutputRequest { |
| | | string OrderNumber = 1;//明细单编码 |
| | | repeated OutputProduct Products= 2;//发货明细 |
| | | } |
| | | |
| | | message OrderProductOutputResponse { |
| | | int32 Code = 1; |
| | | string Msg = 2; |
| | | } |
| | |
| | | Amount string `protobuf:"bytes,11,opt,name=Amount,proto3" json:"Amount,omitempty"` //数量 |
| | | Status FinishStatus `protobuf:"varint,13,opt,name=Status,proto3,enum=FinishStatus" json:"Status,omitempty"` |
| | | CreateTime string `protobuf:"bytes,14,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"` |
| | | LocationID int64 `protobuf:"varint,15,opt,name=LocationID,proto3" json:"LocationID,omitempty"` |
| | | WareHouseID int64 `protobuf:"varint,16,opt,name=WareHouseID,proto3" json:"WareHouseID,omitempty"` |
| | | } |
| | | |
| | | func (x *InputAndOutputInfo) Reset() { |
| | |
| | | return "" |
| | | } |
| | | |
| | | func (x *InputAndOutputInfo) GetLocationID() int64 { |
| | | if x != nil { |
| | | return x.LocationID |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | func (x *InputAndOutputInfo) GetWareHouseID() int64 { |
| | | if x != nil { |
| | | return x.WareHouseID |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | type GetOrderInputAndOutputInfoRequest struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | |
| | | return nil |
| | | } |
| | | |
| | | type OutputProduct struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"` //产品编码 |
| | | Amount string `protobuf:"bytes,2,opt,name=Amount,proto3" json:"Amount,omitempty"` //发货数量 |
| | | } |
| | | |
| | | func (x *OutputProduct) Reset() { |
| | | *x = OutputProduct{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_product_inventory_proto_msgTypes[11] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *OutputProduct) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*OutputProduct) ProtoMessage() {} |
| | | |
| | | func (x *OutputProduct) ProtoReflect() protoreflect.Message { |
| | | mi := &file_product_inventory_proto_msgTypes[11] |
| | | 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 OutputProduct.ProtoReflect.Descriptor instead. |
| | | func (*OutputProduct) Descriptor() ([]byte, []int) { |
| | | return file_product_inventory_proto_rawDescGZIP(), []int{11} |
| | | } |
| | | |
| | | func (x *OutputProduct) GetNumber() string { |
| | | if x != nil { |
| | | return x.Number |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | func (x *OutputProduct) GetAmount() string { |
| | | if x != nil { |
| | | return x.Amount |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | type OrderProductOutputRequest struct { |
| | | state protoimpl.MessageState |
| | | sizeCache protoimpl.SizeCache |
| | | unknownFields protoimpl.UnknownFields |
| | | |
| | | OrderNumber string `protobuf:"bytes,1,opt,name=OrderNumber,proto3" json:"OrderNumber,omitempty"` //明细单编码 |
| | | Products []*OutputProduct `protobuf:"bytes,2,rep,name=Products,proto3" json:"Products,omitempty"` //发货明细 |
| | | } |
| | | |
| | | func (x *OrderProductOutputRequest) Reset() { |
| | | *x = OrderProductOutputRequest{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_product_inventory_proto_msgTypes[12] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *OrderProductOutputRequest) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*OrderProductOutputRequest) ProtoMessage() {} |
| | | |
| | | func (x *OrderProductOutputRequest) ProtoReflect() protoreflect.Message { |
| | | mi := &file_product_inventory_proto_msgTypes[12] |
| | | 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 OrderProductOutputRequest.ProtoReflect.Descriptor instead. |
| | | func (*OrderProductOutputRequest) Descriptor() ([]byte, []int) { |
| | | return file_product_inventory_proto_rawDescGZIP(), []int{12} |
| | | } |
| | | |
| | | func (x *OrderProductOutputRequest) GetOrderNumber() string { |
| | | if x != nil { |
| | | return x.OrderNumber |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | func (x *OrderProductOutputRequest) GetProducts() []*OutputProduct { |
| | | if x != nil { |
| | | return x.Products |
| | | } |
| | | return nil |
| | | } |
| | | |
| | | type OrderProductOutputResponse 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 *OrderProductOutputResponse) Reset() { |
| | | *x = OrderProductOutputResponse{} |
| | | if protoimpl.UnsafeEnabled { |
| | | mi := &file_product_inventory_proto_msgTypes[13] |
| | | ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| | | ms.StoreMessageInfo(mi) |
| | | } |
| | | } |
| | | |
| | | func (x *OrderProductOutputResponse) String() string { |
| | | return protoimpl.X.MessageStringOf(x) |
| | | } |
| | | |
| | | func (*OrderProductOutputResponse) ProtoMessage() {} |
| | | |
| | | func (x *OrderProductOutputResponse) ProtoReflect() protoreflect.Message { |
| | | mi := &file_product_inventory_proto_msgTypes[13] |
| | | 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 OrderProductOutputResponse.ProtoReflect.Descriptor instead. |
| | | func (*OrderProductOutputResponse) Descriptor() ([]byte, []int) { |
| | | return file_product_inventory_proto_rawDescGZIP(), []int{13} |
| | | } |
| | | |
| | | func (x *OrderProductOutputResponse) GetCode() int32 { |
| | | if x != nil { |
| | | return x.Code |
| | | } |
| | | return 0 |
| | | } |
| | | |
| | | func (x *OrderProductOutputResponse) GetMsg() string { |
| | | if x != nil { |
| | | return x.Msg |
| | | } |
| | | return "" |
| | | } |
| | | |
| | | var File_product_inventory_proto protoreflect.FileDescriptor |
| | | |
| | | var file_product_inventory_proto_rawDesc = []byte{ |
| | |
| | | 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, |
| | | 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, |
| | | 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, |
| | | 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0xf9, |
| | | 0x02, 0x0a, 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, |
| | | 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0xbb, |
| | | 0x03, 0x0a, 0x12, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, |
| | | 0x74, 0x49, 0x6e, 0x66, 0x6f, 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, 0x12, 0x0a, |
| | | 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, |
| | |
| | | 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, |
| | | 0x75, 0x73, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, |
| | | 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, |
| | | 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x21, 0x47, 0x65, |
| | | 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4c, 0x6f, |
| | | 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, |
| | | 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x57, 0x61, |
| | | 0x72, 0x65, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x44, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, |
| | | 0x0b, 0x57, 0x61, 0x72, 0x65, 0x48, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x44, 0x22, 0x3b, 0x0a, 0x21, |
| | | 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, |
| | | 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 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, 0xb2, 0x01, 0x0a, 0x22, 0x47, 0x65, |
| | | 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, |
| | | 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 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, 0xb2, 0x01, 0x0a, 0x22, 0x47, 0x65, 0x74, 0x4f, |
| | | 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, |
| | | 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 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, 0x31, 0x0a, 0x09, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, |
| | | 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, |
| | | 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x49, 0x6e, |
| | | 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0a, 0x4f, 0x75, 0x74, 0x70, 0x75, |
| | | 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x49, 0x6e, |
| | | 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, |
| | | 0x52, 0x0a, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x2a, 0x25, 0x0a, 0x0c, |
| | | 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, 0x0a, 0x05, |
| | | 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x69, 0x6e, 0x69, 0x73, |
| | | 0x68, 0x10, 0x01, 0x32, 0x8a, 0x03, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, |
| | | 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, |
| | | 0x46, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, |
| | | 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, |
| | | 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, |
| | | 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, |
| | | 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, |
| | | 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, |
| | | 0x66, 0x6f, 0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, |
| | | 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, |
| | | 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, |
| | | 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, |
| | | 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, |
| | | 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, |
| | | 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, |
| | | 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, |
| | | 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, |
| | | 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, |
| | | 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x67, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x4f, 0x72, |
| | | 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, |
| | | 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, |
| | | 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 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, 0x31, 0x0a, 0x09, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4c, |
| | | 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x49, 0x6e, 0x70, 0x75, |
| | | 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, |
| | | 0x49, 0x6e, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x0a, 0x4f, 0x75, 0x74, |
| | | 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, |
| | | 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, |
| | | 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x47, 0x65, 0x74, 0x4f, |
| | | 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, |
| | | 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, |
| | | 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x6e, |
| | | 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, |
| | | 0x66, 0x6f, 0x52, 0x0a, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3f, |
| | | 0x0a, 0x0d, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 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, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, |
| | | 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, |
| | | 0x69, 0x0a, 0x19, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, |
| | | 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, |
| | | 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, |
| | | 0x09, 0x52, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2a, |
| | | 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, |
| | | 0x32, 0x0e, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, |
| | | 0x52, 0x08, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x22, 0x42, 0x0a, 0x1a, 0x4f, 0x72, |
| | | 0x64, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, |
| | | 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, 0x2a, 0x25, |
| | | 0x0a, 0x0c, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x09, |
| | | 0x0a, 0x05, 0x52, 0x65, 0x61, 0x64, 0x79, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x69, 0x6e, |
| | | 0x69, 0x73, 0x68, 0x10, 0x01, 0x32, 0xdb, 0x03, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, |
| | | 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, |
| | | 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, |
| | | 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, |
| | | 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, |
| | | 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, |
| | | 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, |
| | | 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, |
| | | 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, |
| | | 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, |
| | | 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, |
| | | 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, |
| | | 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x55, 0x70, 0x64, |
| | | 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, |
| | | 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, |
| | | 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, |
| | | 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, |
| | | 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, |
| | | 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x67, 0x0a, 0x1a, 0x47, 0x65, 0x74, |
| | | 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, |
| | | 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x22, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, |
| | | 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, |
| | | 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x47, 0x65, |
| | | 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x41, 0x6e, 0x64, 0x4f, 0x75, |
| | | 0x74, 0x70, 0x75, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, |
| | | 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x64, 0x75, |
| | | 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x1a, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, |
| | | 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x71, |
| | | 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x64, |
| | | 0x75, 0x63, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, |
| | | 0x65, 0x22, 0x00, 0x42, 0x15, 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, |
| | | 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, |
| | | 0x6f, 0x33, |
| | | } |
| | | |
| | | var ( |
| | |
| | | } |
| | | |
| | | var file_product_inventory_proto_enumTypes = make([]protoimpl.EnumInfo, 1) |
| | | var file_product_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 11) |
| | | var file_product_inventory_proto_msgTypes = make([]protoimpl.MessageInfo, 14) |
| | | var file_product_inventory_proto_goTypes = []interface{}{ |
| | | (FinishStatus)(0), // 0: FinishStatus |
| | | (*CreateOperationRequest)(nil), // 1: CreateOperationRequest |
| | |
| | | (*InputAndOutputInfo)(nil), // 9: InputAndOutputInfo |
| | | (*GetOrderInputAndOutputInfoRequest)(nil), // 10: GetOrderInputAndOutputInfoRequest |
| | | (*GetOrderInputAndOutputInfoResponse)(nil), // 11: GetOrderInputAndOutputInfoResponse |
| | | (*OutputProduct)(nil), // 12: OutputProduct |
| | | (*OrderProductOutputRequest)(nil), // 13: OrderProductOutputRequest |
| | | (*OrderProductOutputResponse)(nil), // 14: OrderProductOutputResponse |
| | | } |
| | | var file_product_inventory_proto_depIdxs = []int32{ |
| | | 2, // 0: CreateOperationRequest.ProductList:type_name -> InventoryProduct |
| | |
| | | 0, // 2: InputAndOutputInfo.Status:type_name -> FinishStatus |
| | | 9, // 3: GetOrderInputAndOutputInfoResponse.InputList:type_name -> InputAndOutputInfo |
| | | 9, // 4: GetOrderInputAndOutputInfoResponse.OutputList:type_name -> InputAndOutputInfo |
| | | 1, // 5: productInventoryService.CreateOperation:input_type -> CreateOperationRequest |
| | | 4, // 6: productInventoryService.GetInventoryProductInfo:input_type -> GetInventoryProductInfoRequest |
| | | 7, // 7: productInventoryService.UpdateSalesDetailStatus:input_type -> UpdateSalesDetailStatusRequest |
| | | 10, // 8: productInventoryService.GetOrderInputAndOutputInfo:input_type -> GetOrderInputAndOutputInfoRequest |
| | | 3, // 9: productInventoryService.CreateOperation:output_type -> CreateOperationResponse |
| | | 6, // 10: productInventoryService.GetInventoryProductInfo:output_type -> GetInventoryProductInfoResponse |
| | | 8, // 11: productInventoryService.UpdateSalesDetailStatus:output_type -> UpdateSalesDetailStatusResponse |
| | | 11, // 12: productInventoryService.GetOrderInputAndOutputInfo:output_type -> GetOrderInputAndOutputInfoResponse |
| | | 9, // [9:13] is the sub-list for method output_type |
| | | 5, // [5:9] is the sub-list for method input_type |
| | | 5, // [5:5] is the sub-list for extension type_name |
| | | 5, // [5:5] is the sub-list for extension extendee |
| | | 0, // [0:5] is the sub-list for field type_name |
| | | 12, // 5: OrderProductOutputRequest.Products:type_name -> OutputProduct |
| | | 1, // 6: productInventoryService.CreateOperation:input_type -> CreateOperationRequest |
| | | 4, // 7: productInventoryService.GetInventoryProductInfo:input_type -> GetInventoryProductInfoRequest |
| | | 7, // 8: productInventoryService.UpdateSalesDetailStatus:input_type -> UpdateSalesDetailStatusRequest |
| | | 10, // 9: productInventoryService.GetOrderInputAndOutputInfo:input_type -> GetOrderInputAndOutputInfoRequest |
| | | 13, // 10: productInventoryService.OrderProductOutput:input_type -> OrderProductOutputRequest |
| | | 3, // 11: productInventoryService.CreateOperation:output_type -> CreateOperationResponse |
| | | 6, // 12: productInventoryService.GetInventoryProductInfo:output_type -> GetInventoryProductInfoResponse |
| | | 8, // 13: productInventoryService.UpdateSalesDetailStatus:output_type -> UpdateSalesDetailStatusResponse |
| | | 11, // 14: productInventoryService.GetOrderInputAndOutputInfo:output_type -> GetOrderInputAndOutputInfoResponse |
| | | 14, // 15: productInventoryService.OrderProductOutput:output_type -> OrderProductOutputResponse |
| | | 11, // [11:16] is the sub-list for method output_type |
| | | 6, // [6:11] is the sub-list for method input_type |
| | | 6, // [6:6] is the sub-list for extension type_name |
| | | 6, // [6:6] is the sub-list for extension extendee |
| | | 0, // [0:6] is the sub-list for field type_name |
| | | } |
| | | |
| | | func init() { file_product_inventory_proto_init() } |
| | |
| | | return nil |
| | | } |
| | | } |
| | | file_product_inventory_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*OutputProduct); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_product_inventory_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*OrderProductOutputRequest); i { |
| | | case 0: |
| | | return &v.state |
| | | case 1: |
| | | return &v.sizeCache |
| | | case 2: |
| | | return &v.unknownFields |
| | | default: |
| | | return nil |
| | | } |
| | | } |
| | | file_product_inventory_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { |
| | | switch v := v.(*OrderProductOutputResponse); 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{ |
| | |
| | | GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| | | RawDescriptor: file_product_inventory_proto_rawDesc, |
| | | NumEnums: 1, |
| | | NumMessages: 11, |
| | | NumMessages: 14, |
| | | NumExtensions: 0, |
| | | NumServices: 1, |
| | | }, |
| | |
| | | ProductInventoryService_GetInventoryProductInfo_FullMethodName = "/productInventoryService/GetInventoryProductInfo" |
| | | ProductInventoryService_UpdateSalesDetailStatus_FullMethodName = "/productInventoryService/UpdateSalesDetailStatus" |
| | | ProductInventoryService_GetOrderInputAndOutputInfo_FullMethodName = "/productInventoryService/GetOrderInputAndOutputInfo" |
| | | ProductInventoryService_OrderProductOutput_FullMethodName = "/productInventoryService/OrderProductOutput" |
| | | ) |
| | | |
| | | // ProductInventoryServiceClient is the client API for ProductInventoryService service. |
| | |
| | | GetInventoryProductInfo(ctx context.Context, in *GetInventoryProductInfoRequest, opts ...grpc.CallOption) (*GetInventoryProductInfoResponse, error) |
| | | UpdateSalesDetailStatus(ctx context.Context, in *UpdateSalesDetailStatusRequest, opts ...grpc.CallOption) (*UpdateSalesDetailStatusResponse, error) |
| | | GetOrderInputAndOutputInfo(ctx context.Context, in *GetOrderInputAndOutputInfoRequest, opts ...grpc.CallOption) (*GetOrderInputAndOutputInfoResponse, error) |
| | | OrderProductOutput(ctx context.Context, in *OrderProductOutputRequest, opts ...grpc.CallOption) (*OrderProductOutputResponse, error) |
| | | } |
| | | |
| | | type productInventoryServiceClient struct { |
| | |
| | | return out, nil |
| | | } |
| | | |
| | | func (c *productInventoryServiceClient) OrderProductOutput(ctx context.Context, in *OrderProductOutputRequest, opts ...grpc.CallOption) (*OrderProductOutputResponse, error) { |
| | | out := new(OrderProductOutputResponse) |
| | | err := c.cc.Invoke(ctx, ProductInventoryService_OrderProductOutput_FullMethodName, in, out, opts...) |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | return out, nil |
| | | } |
| | | |
| | | // ProductInventoryServiceServer is the server API for ProductInventoryService service. |
| | | // All implementations must embed UnimplementedProductInventoryServiceServer |
| | | // for forward compatibility |
| | |
| | | GetInventoryProductInfo(context.Context, *GetInventoryProductInfoRequest) (*GetInventoryProductInfoResponse, error) |
| | | UpdateSalesDetailStatus(context.Context, *UpdateSalesDetailStatusRequest) (*UpdateSalesDetailStatusResponse, error) |
| | | GetOrderInputAndOutputInfo(context.Context, *GetOrderInputAndOutputInfoRequest) (*GetOrderInputAndOutputInfoResponse, error) |
| | | OrderProductOutput(context.Context, *OrderProductOutputRequest) (*OrderProductOutputResponse, error) |
| | | mustEmbedUnimplementedProductInventoryServiceServer() |
| | | } |
| | | |
| | |
| | | } |
| | | func (UnimplementedProductInventoryServiceServer) GetOrderInputAndOutputInfo(context.Context, *GetOrderInputAndOutputInfoRequest) (*GetOrderInputAndOutputInfoResponse, error) { |
| | | return nil, status.Errorf(codes.Unimplemented, "method GetOrderInputAndOutputInfo not implemented") |
| | | } |
| | | func (UnimplementedProductInventoryServiceServer) OrderProductOutput(context.Context, *OrderProductOutputRequest) (*OrderProductOutputResponse, error) { |
| | | return nil, status.Errorf(codes.Unimplemented, "method OrderProductOutput not implemented") |
| | | } |
| | | func (UnimplementedProductInventoryServiceServer) mustEmbedUnimplementedProductInventoryServiceServer() { |
| | | } |
| | |
| | | return interceptor(ctx, in, info, handler) |
| | | } |
| | | |
| | | func _ProductInventoryService_OrderProductOutput_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| | | in := new(OrderProductOutputRequest) |
| | | if err := dec(in); err != nil { |
| | | return nil, err |
| | | } |
| | | if interceptor == nil { |
| | | return srv.(ProductInventoryServiceServer).OrderProductOutput(ctx, in) |
| | | } |
| | | info := &grpc.UnaryServerInfo{ |
| | | Server: srv, |
| | | FullMethod: ProductInventoryService_OrderProductOutput_FullMethodName, |
| | | } |
| | | handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| | | return srv.(ProductInventoryServiceServer).OrderProductOutput(ctx, req.(*OrderProductOutputRequest)) |
| | | } |
| | | return interceptor(ctx, in, info, handler) |
| | | } |
| | | |
| | | // ProductInventoryService_ServiceDesc is the grpc.ServiceDesc for ProductInventoryService service. |
| | | // It's only intended for direct use with grpc.RegisterService, |
| | | // and not to be introspected or modified (even as a copy) |
| | |
| | | MethodName: "GetOrderInputAndOutputInfo", |
| | | Handler: _ProductInventoryService_GetOrderInputAndOutputInfo_Handler, |
| | | }, |
| | | { |
| | | MethodName: "OrderProductOutput", |
| | | Handler: _ProductInventoryService_OrderProductOutput_Handler, |
| | | }, |
| | | }, |
| | | Streams: []grpc.StreamDesc{}, |
| | | Metadata: "product_inventory.proto", |
| | |
| | | import ( |
| | | "context" |
| | | "errors" |
| | | "fmt" |
| | | "github.com/shopspring/decimal" |
| | | "strconv" |
| | | "strings" |
| | | "time" |
| | | "wms/constvar" |
| | | "wms/models" |
| | | "wms/pkg/logx" |
| | | "wms/pkg/timex" |
| | | "wms/service" |
| | | ) |
| | |
| | | if detail.BaseOperationType == constvar.BaseOperationTypeIncoming && detail.Status == constvar.OperationStatus_Finish { |
| | | if locationHouseMap[detail.ToLocationId] != nil { |
| | | info.Warehouse = locationHouseMap[detail.ToLocationId].Name //入库仓库名 |
| | | info.LocationID = int64(detail.ToLocationId) |
| | | info.WareHouseID = int64(locationHouseMap[detail.ToLocationId].Id) |
| | | } |
| | | inputList = append(inputList, &info) |
| | | } else if detail.BaseOperationType == constvar.BaseOperationTypeOutgoing { |
| | | if locationHouseMap[detail.FromLocationId] != nil { |
| | | info.Warehouse = locationHouseMap[detail.FromLocationId].Name //发货仓库名 |
| | | info.LocationID = int64(detail.FromLocationId) |
| | | info.WareHouseID = int64(locationHouseMap[detail.FromLocationId].Id) |
| | | } |
| | | outputList = append(outputList, &info) |
| | | } |
| | |
| | | |
| | | return resp, nil |
| | | } |
| | | |
| | | type StoreInfo struct { |
| | | Name string `json:"name"` //产品名称 |
| | | Number string `json:"number"` //产品编号 |
| | | StoreAmount decimal.Decimal `json:"storeAmount"` //订单入库数量 |
| | | AvailableAmount decimal.Decimal `json:"availableAmount"` //剩余可用数量 |
| | | } |
| | | |
| | | type OutputSimpleInfo struct { |
| | | Number string `json:"number"` //产品编号 |
| | | Amount decimal.Decimal `json:"amount"` //在库数量 |
| | | Status int `json:"status"` //0就绪 1完成 |
| | | } |
| | | |
| | | func (s *Server) OrderProductOutput(ctx context.Context, req *OrderProductOutputRequest) (resp *OrderProductOutputResponse, err error) { |
| | | if req.OrderNumber == "" || len(req.Products) == 0 { |
| | | return nil, errors.New("参数缺失") |
| | | } |
| | | orderInputAndOutputInfoResponse, err := s.GetOrderInputAndOutputInfo(ctx, &GetOrderInputAndOutputInfoRequest{ |
| | | Number: req.OrderNumber, |
| | | }) |
| | | if err != nil { |
| | | logx.Errorf("OrderProductOutput GetOrderInputAndOutputInfo err:%v, req:%v", err, req) |
| | | return nil, errors.New("获取出入库信息失败") |
| | | } |
| | | |
| | | outputList := orderInputAndOutputInfoResponse.OutputList |
| | | inputList := orderInputAndOutputInfoResponse.InputList |
| | | inputProductMap := make(map[string]*StoreInfo) |
| | | outputProductMap := make(map[string]*OutputSimpleInfo) |
| | | inputLocationAmountMap := make(map[int64]map[string]decimal.Decimal) |
| | | outputLocationAmountMap := make(map[int64]map[string]decimal.Decimal) |
| | | for _, v := range outputList { |
| | | if outputProductMap[v.Number] == nil { |
| | | simpleInfo := &OutputSimpleInfo{ |
| | | Number: v.Number, |
| | | } |
| | | amount, _ := decimal.NewFromString(v.Amount) |
| | | simpleInfo.Amount = amount |
| | | outputProductMap[v.Number] = simpleInfo |
| | | } else { |
| | | amount, _ := decimal.NewFromString(v.Amount) |
| | | outputProductMap[v.Number].Amount = outputProductMap[v.Number].Amount.Add(amount) |
| | | } |
| | | } |
| | | for _, v := range inputList { |
| | | if inputProductMap[v.Number] == nil { |
| | | storeInfo := &StoreInfo{ |
| | | Number: v.Number, |
| | | Name: v.Name, |
| | | } |
| | | storeAmount, _ := decimal.NewFromString(v.Amount) |
| | | storeInfo.StoreAmount = storeAmount |
| | | storeInfo.AvailableAmount = storeAmount |
| | | inputProductMap[v.Number] = storeInfo |
| | | } else { |
| | | storeAmount, _ := decimal.NewFromString(v.Amount) |
| | | inputProductMap[v.Number].StoreAmount = inputProductMap[v.Number].StoreAmount.Add(storeAmount) |
| | | inputProductMap[v.Number].AvailableAmount = inputProductMap[v.Number].StoreAmount |
| | | } |
| | | } |
| | | |
| | | for number, inputInfo := range inputProductMap { |
| | | outputInfo := outputProductMap[inputInfo.Number] |
| | | if outputInfo != nil { |
| | | inputProductMap[number].AvailableAmount = inputProductMap[number].AvailableAmount.Sub(outputInfo.Amount) //可用数量 = 入库完成数量 - 已发货数量 |
| | | } |
| | | } |
| | | |
| | | //校验可用数量是否足够 |
| | | productNeedSendAmount := make(map[string]decimal.Decimal) |
| | | for _, product := range req.Products { |
| | | sendAmount, _ := decimal.NewFromString(product.Amount) |
| | | productNeedSendAmount[product.Number] = sendAmount |
| | | if inputProductMap[product.Number] == nil { |
| | | return nil, fmt.Errorf("获取入库信息失败,产品编号:%v", product.Number) |
| | | } |
| | | if sendAmount.GreaterThan(inputProductMap[product.Number].AvailableAmount) { |
| | | return nil, fmt.Errorf("产品可用数量不足以发货,产品编号:%v", product.Number) |
| | | } |
| | | } |
| | | |
| | | LocationIDWarehouseIDMap := make(map[int64]int64) |
| | | for _, output := range outputList { |
| | | if outputLocationAmountMap[output.LocationID] == nil { |
| | | outputLocationAmountMap[output.LocationID] = make(map[string]decimal.Decimal) |
| | | } |
| | | outputAmount, _ := decimal.NewFromString(output.Amount) |
| | | outputLocationAmountMap[output.LocationID][output.Number] = outputAmount |
| | | } |
| | | for _, input := range inputList { |
| | | LocationIDWarehouseIDMap[input.LocationID] = input.WareHouseID |
| | | |
| | | if inputLocationAmountMap[input.LocationID] == nil { |
| | | inputLocationAmountMap[input.LocationID] = make(map[string]decimal.Decimal) |
| | | } |
| | | storeAmount, _ := decimal.NewFromString(input.Amount) |
| | | if outputLocationAmountMap[input.LocationID] != nil { |
| | | storeAmount = storeAmount.Sub(outputLocationAmountMap[input.LocationID][input.Number]) |
| | | } |
| | | inputLocationAmountMap[input.LocationID][input.Number] = storeAmount |
| | | } |
| | | |
| | | productHasSendAmount := make(map[string]decimal.Decimal) //本次已发货数量 |
| | | |
| | | //find location ID |
| | | outputInfoList := make([]*service.OutputInfo, 0) |
| | | for locationID, locationProductAmounts := range inputLocationAmountMap { |
| | | productInfoList := make([]*service.ProductInfo, 0) |
| | | for productNumber, productAmount := range locationProductAmounts { |
| | | remainAmount := productNeedSendAmount[productNumber].Sub(productHasSendAmount[productNumber]) |
| | | var locationSendAmount decimal.Decimal |
| | | if productAmount.GreaterThanOrEqual(remainAmount) { |
| | | locationSendAmount = remainAmount |
| | | } else { |
| | | locationSendAmount = productAmount |
| | | } |
| | | productInfoList = append(productInfoList, &service.ProductInfo{ |
| | | ProductID: productNumber, |
| | | Amount: locationSendAmount, |
| | | }) |
| | | productHasSendAmount[productNumber] = productHasSendAmount[productNumber].Add(locationSendAmount) |
| | | } |
| | | outputInfoList = append(outputInfoList, &service.OutputInfo{ |
| | | LocationID: int(locationID), |
| | | WarehouseID: int(LocationIDWarehouseIDMap[locationID]), |
| | | Products: productInfoList, |
| | | OperationID: 0, |
| | | SourceNumber: req.OrderNumber, |
| | | }) |
| | | } |
| | | |
| | | err = service.AddOutputOperations(outputInfoList) |
| | | |
| | | if err != nil { |
| | | return nil, err |
| | | } |
| | | |
| | | resp.Code = 1 |
| | | resp.Msg = "success" |
| | | return nil, nil |
| | | } |
New file |
| | |
| | | package service |
| | | |
| | | import ( |
| | | "github.com/shopspring/decimal" |
| | | "time" |
| | | "wms/constvar" |
| | | "wms/models" |
| | | ) |
| | | |
| | | type OutputInfo struct { |
| | | LocationID int |
| | | WarehouseID int |
| | | Products []*ProductInfo |
| | | OperationID int |
| | | SourceNumber string |
| | | } |
| | | |
| | | type ProductInfo struct { |
| | | ProductID string |
| | | Amount decimal.Decimal |
| | | } |
| | | |
| | | func AddOutputOperations(outputList []*OutputInfo) (err error) { |
| | | //查找operationID |
| | | warehouseIds := make([]int, 0) |
| | | for _, output := range outputList { |
| | | warehouseIds = append(warehouseIds, output.WarehouseID) |
| | | } |
| | | opTypes, err := models.NewOperationTypeSearch().SetWarehouseIds(warehouseIds).SetBaseOperationType(constvar.BaseOperationTypeOutgoing).FindNotTotal() |
| | | if err != nil { |
| | | return err |
| | | } |
| | | opTypeMap := make(map[int]*models.OperationType, len(opTypes)) |
| | | for _, opType := range opTypes { |
| | | opTypeMap[opType.WarehouseId] = opType |
| | | } |
| | | operations := make([]*models.Operation, 0, len(outputList)) |
| | | for _, output := range outputList { |
| | | details := make([]*models.OperationDetails, 0, len(output.Products)) |
| | | for _, product := range output.Products { |
| | | details = append(details, &models.OperationDetails{ |
| | | OperationID: 0, |
| | | ProductId: product.ProductID, |
| | | Amount: product.Amount, |
| | | FromLocationID: output.LocationID, |
| | | }) |
| | | } |
| | | operation := &models.Operation{ |
| | | Id: 0, |
| | | Number: "", |
| | | SourceNumber: output.SourceNumber, |
| | | OperationTypeId: opTypeMap[output.WarehouseID].Id, |
| | | OperationTypeName: opTypeMap[output.WarehouseID].Name, |
| | | Status: constvar.OperationStatus_Ready, |
| | | OperationDate: time.Now().Format("2006-01-02 15:04:05"), |
| | | ContacterID: 0, |
| | | ContacterName: "", |
| | | CompanyID: 0, |
| | | CompanyName: "", |
| | | Comment: "crm发货申请", |
| | | LogisticCompanyId: "", |
| | | LogisticCompany: models.LogisticCompany{}, |
| | | WaybillNumber: "", |
| | | Weight: decimal.Decimal{}, |
| | | LogisticWeight: decimal.Decimal{}, |
| | | Source: "crm", |
| | | Details: details, |
| | | BaseOperationType: constvar.BaseOperationTypeOutgoing, |
| | | LocationID: output.LocationID, |
| | | } |
| | | operations = append(operations, operation) |
| | | } |
| | | |
| | | return models.NewOperationSearch().CreateBatch(operations) |
| | | } |