From ed3d45b189f102249eabd0cb5a0299bc66b0dea6 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 18 十二月 2023 21:04:12 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS --- controllers/product_controller.go | 21 proto/inventory_order.proto | 34 + response/report_forms_response.go | 2 controllers/report_forms_controller.go | 15 models/operation.go | 16 docs/swagger.yaml | 43 + proto/product_inventory/server.go | 2 proto/product_inventory/product_inventory.pb.go | 159 ++-- proto/inventory_order/inventory_order.pb.go | 510 ++++++++++++++++- proto/purchase_wms/purchase_wms.pb.go | 213 +++--- proto/supplier/client.go | 50 proto/product_inventory.proto | 3 proto/purchase_wms/server.go | 1 controllers/location_product_amount.go | 3 proto/inventory_order/server.go | 24 controllers/operation.go | 185 ++++- proto/init_client/init_client.go | 45 + controllers/code.go | 55 + proto/inventory_order/inventory_order_grpc.pb.go | 72 ++ models/file_template_attachment.go | 1 controllers/reorder_rule_controller.go | 43 proto/client/client.go | 43 proto/purchase_wms.proto | 3 request/operation.go | 5 docs/docs.go | 63 ++ conf/config.yaml | 4 docs/swagger.json | 63 ++ router/router.go | 1 constvar/const.go | 12 utils/upload/seaweed.go | 3 request/product_request.go | 1 main.go | 26 32 files changed, 1,320 insertions(+), 401 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index 1d5cc35..2985275 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -25,5 +25,5 @@ storePath: uploads/file grpcServer: apsAddr: 192.168.20.119:9091 - crmAddr: :9092 - srmAddr: 192.168.20.118:9093 + crmAddr: 192.168.20.119:9092 + srmAddr: 192.168.20.119:9093 diff --git a/constvar/const.go b/constvar/const.go index bcbb44c..cb12151 100644 --- a/constvar/const.go +++ b/constvar/const.go @@ -176,7 +176,7 @@ OperationStatus_Waiting //姝e湪绛夊緟 OperationStatus_Ready //灏辩华 OperationStatus_Finish //瀹屾垚 - OperationStatus_Cancel //瀹屾垚 + OperationStatus_Cancel //鍙栨秷 ) type PostType int @@ -230,3 +230,13 @@ FileTemplateCategory_Selfmade FileTemplateCategory = iota + 1 //鍏ュ簱-鑷埗 FileTemplateCategory_Output //鍑哄簱 ) + +type CodeStandardType string + +const ( + CodeStandardType_Material CodeStandardType = "鐗╂枡缂栫爜" + CodeStandardType_Incoming CodeStandardType = "鍏ュ簱缂栫爜" + CodeStandardType_Outgoing CodeStandardType = "鍑哄簱缂栫爜" + CodeStandardType_Internal CodeStandardType = "璋冩嫧缂栫爜" + CodeStandardType_Disuse CodeStandardType = "浠撳簱鎶ュ簾缂栫爜" +) diff --git a/controllers/code.go b/controllers/code.go index f293bb3..eea0f4a 100644 --- a/controllers/code.go +++ b/controllers/code.go @@ -3,38 +3,37 @@ import ( "github.com/gin-gonic/gin" "github.com/spf13/cast" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - "wms/conf" + "wms/constvar" cd "wms/extend/code" "wms/extend/util" "wms/models" "wms/pkg/contextx" "wms/pkg/logx" "wms/proto/code" + "wms/proto/init_client" "wms/request" ) type CodeApi struct{} -var ( - codeServiceConn *grpc.ClientConn -) - -func InitCodeServiceConn() { - var err error - codeServiceConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - logx.Errorf("grpc dial product service error: %v", err.Error()) - return - } -} - -func CloseCodeServiceConn() { - if codeServiceConn != nil { - codeServiceConn.Close() - } -} +//var ( +// codeServiceConn *grpc.ClientConn +//) +// +//func InitCodeServiceConn() { +// var err error +// codeServiceConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) +// if err != nil { +// logx.Errorf("grpc dial product service error: %v", err.Error()) +// return +// } +//} +// +//func CloseCodeServiceConn() { +// if codeServiceConn != nil { +// codeServiceConn.Close() +// } +//} // GetCodeList // @@ -54,7 +53,7 @@ params.CodeStandID = c.Query("codeStandID") params.Name = c.Query("name") params.Type = c.Query("type") - client := code.NewCodeServiceClient(codeServiceConn) + client := code.NewCodeServiceClient(init_client.ApsConn) list, err := client.GetCodeList(ctx.GetCtx(), &code.GetCodeListRequest{ Page: cast.ToInt32(params.Page), PageSize: cast.ToInt32(params.PageSize), @@ -89,9 +88,17 @@ id = 0 err error ) - switch params.Type { - case "鐗╂枡缂栫爜": + switch constvar.CodeStandardType(params.Type) { + case constvar.CodeStandardType_Material: id, err = models.NewMaterialSearch().MaxAutoIncr() + case constvar.CodeStandardType_Incoming: + id, err = models.NewOperationSearch().SetBaseOperationType(constvar.BaseOperationTypeIncoming).MaxAutoIncr() + case constvar.CodeStandardType_Outgoing: + id, err = models.NewOperationSearch().SetBaseOperationType(constvar.BaseOperationTypeOutgoing).MaxAutoIncr() + case constvar.CodeStandardType_Internal: + id, err = models.NewOperationSearch().SetBaseOperationType(constvar.BaseOperationTypeInternal).MaxAutoIncr() + case constvar.CodeStandardType_Disuse: + id, err = models.NewOperationSearch().SetBaseOperationType(constvar.BaseOperationTypeDisuse).MaxAutoIncr() default: util.ResponseFormat(c, cd.RequestError, "缂栫爜瑙勫垯涓嶅瓨鍦�") return diff --git a/controllers/location_product_amount.go b/controllers/location_product_amount.go index b003c1b..36d7c28 100644 --- a/controllers/location_product_amount.go +++ b/controllers/location_product_amount.go @@ -12,6 +12,7 @@ "wms/extend/code" "wms/extend/util" "wms/models" + "wms/pkg/mysqlx" "wms/request" "wms/response" "wms/service" @@ -67,7 +68,7 @@ } var operation models.Operation for k, v := range records { - if res := models.NewOperationSearch().Orm.Preload("Details", "product_id=?", v.ProductId).Where("wms_operation.base_operation_type=? and wms_operation.status=? and wms_operation.to_location_id=?", constvar.BaseOperationTypeAdjust, constvar.OperationStatus_Ready, v.LocationId).First(&operation); res.Error != nil { + if res := mysqlx.GetDB().Table("wms_operation").InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").Where("wms_operation.base_operation_type=? and wms_operation.status=? and wms_operation.to_location_id=? and wms_operation_details.product_id=?", constvar.BaseOperationTypeAdjust, constvar.OperationStatus_Ready, v.LocationId, v.ProductId).First(&operation); res.Error != nil { if errors.Is(res.Error, gorm.ErrRecordNotFound) { records[k].Status = constvar.OperationStatus_Finish records[k].BaseOperationType = constvar.BaseOperationTypeAdjust diff --git a/controllers/operation.go b/controllers/operation.go index e75abc4..e467303 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -8,27 +8,28 @@ "github.com/gin-gonic/gin" "github.com/shopspring/decimal" "github.com/xuri/excelize/v2" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" "gorm.io/gorm" "os" "sort" "strconv" "strings" "time" - "wms/conf" "wms/constvar" "wms/extend/code" "wms/extend/util" "wms/models" "wms/opa" "wms/pkg/logx" + "wms/pkg/mysqlx" "wms/pkg/structx" "wms/proto/client" + "wms/proto/init_client" + "wms/proto/inventory_order" "wms/proto/product_inventory" "wms/proto/purchase_wms" "wms/proto/supplier" "wms/request" + "wms/response" "wms/service" "wms/utils/http" "wms/utils/upload" @@ -76,8 +77,19 @@ } params.Status = constvar.OperationStatus_Ready - params.Number = strconv.FormatInt(time.Now().Unix(), 10) + //params.Number = strconv.FormatInt(time.Now().Unix(), 10) params.BaseOperationType = operationType.BaseOperationType + + var numberNum int64 + if err := mysqlx.GetDB().Model(&models.Operation{}).Where("number=?", params.Number).Count(&numberNum).Error; err != nil { + util.ResponseFormat(c, code.RequestParamError, err.Error()) + return + } + if numberNum > 0 { + util.ResponseFormat(c, code.RequestParamError, "鍗曞彿宸插瓨鍦�") + return + } + if err := models.NewOperationSearch().Create(¶ms); err != nil { logx.Errorf("Operation create err: %v", err) util.ResponseFormat(c, code.SaveFail, "娣诲姞澶辫触锛�"+err.Error()) @@ -142,6 +154,10 @@ func (slf OperationController) CheckParams(params models.Operation) error { if params.SourceNumber == "" { return errors.New("璇峰~鍏ユ簮鍗曞彿") + } + + if params.Number == "" { + return errors.New("璇峰~鍏ュ崟鍙�") } if params.OperationTypeId == 0 && int(params.BaseOperationType) == 0 { @@ -363,7 +379,7 @@ util.ResponseFormat(c, code.RequestError, "璇ュ嚭鍏ュ簱淇℃伅鏃犳硶瀹屾垚") return } - if err := models.WithTransaction(func(tx *gorm.DB) error { + err = models.WithTransaction(func(tx *gorm.DB) error { if err := models.NewOperationSearch().SetOrm(tx).SetID(id).Update(&models.Operation{Status: constvar.OperationStatus_Finish, AuditDate: time.Now().Format("2006-01-02 15:04:05")}); err != nil { return err @@ -523,8 +539,8 @@ return err } } - if operation.SourceNumber != "" { - go UpdatePurchaseStatus(operation.SourceNumber) + if operation.Source != "" { + go UpdatePurchaseStatus(operation.Source, operation.SourceNumber) } } @@ -556,10 +572,13 @@ } locAmount, res := models.NewLocationProductAmountSearch(). SetProductId(v.ID). - SetLocationId(operation.ToLocationID). + SetLocationId(operation.FromLocationID). FirstRes() if res.Error != nil { - return err + if res.Error == gorm.ErrRecordNotFound { + return errors.New("褰撳墠浠撳簱娌℃湁璇ヤ骇鍝�,璇峰厛鍏ュ簱") + } + return res.Error } if locAmount.Amount.LessThan(value) { return errors.New(fmt.Sprintf("浜у搧锛�%v,搴撳瓨锛�%v,鍑哄簱锛�%v,鏁伴噺涓嶅锛屾棤娉曞畬鎴愬嚭搴撴搷浣�", v.Name, v.Amount.String(), value.String())) @@ -569,8 +588,8 @@ return err } } - if operation.SourceNumber != "" { - go UpdateSalesDetailStatus(operation.SourceNumber) + if operation.Source != "" { + go UpdateOutStatus(operation.Source, operation.Number, 4) } } @@ -723,7 +742,8 @@ } } return nil - }); err != nil { + }) + if err != nil { util.ResponseFormat(c, code.RequestError, err.Error()) return } @@ -765,50 +785,64 @@ return nil } -var ( - ProductInventoryServiceConn *grpc.ClientConn - PurchaseServiceConn *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 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 +func UpdateOutStatus(source, number string, status int64) { + if source == "CRM" { + cl := product_inventory.NewProductInventoryServiceClient(init_client.CrmConn) + _, err := cl.UpdateSalesDetailStatus(context.Background(), &product_inventory.UpdateSalesDetailStatusRequest{ + Number: number, + SalesDetailStatus: "宸插嚭搴�", + }) + if err != nil { + logx.Errorf("grpc dial UpdateSalesDetailStatus service error: %v", err) + } } - 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 + if source == "APS_APPLY_MATERIAL" { + cl := inventory_order.NewInventoryOrderServiceClient(init_client.ApsConn) + _, err := cl.UpdateMaterialApplyStatus(context.Background(), &inventory_order.UpdateMaterialApplyStatusRequest{ + Number: number, + Status: status, + }) + if err != nil { + logx.Errorf("grpc dial UpdateSalesDetailStatus service error: %v", err) + } } } -func CloseProductInventoryServiceConn() { - if ProductInventoryServiceConn != nil { - ProductInventoryServiceConn.Close() - } - if PurchaseServiceConn != nil { - PurchaseServiceConn.Close() - } -} - -func UpdateSalesDetailStatus(number string) { - client := product_inventory.NewProductInventoryServiceClient(ProductInventoryServiceConn) - _, err := client.UpdateSalesDetailStatus(context.Background(), &product_inventory.UpdateSalesDetailStatusRequest{ - Number: number, - SalesDetailStatus: "宸插嚭搴�", - }) - if err != nil { - logx.Errorf("grpc dial UpdateSalesDetailStatus service error: %v", err) - } -} - -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) +func UpdatePurchaseStatus(source, number string) { + if source == "SRM_PURCHASE" { + cl := purchase_wms.NewPurchaseServiceClient(init_client.SrmConn) + _, err := cl.UpdatePurchaseStatus(context.Background(), &purchase_wms.UpdatePurchaseStatusRequest{Number: number}) + if err != nil { + logx.Errorf("grpc dial UpdatePurchaseStatus service error: %v", err) + } } } @@ -891,6 +925,10 @@ util.ResponseFormat(c, code.SaveFail, err.Error()) return } + //鏇存柊aps鐗╂枡鐢宠鐘舵�� + if operation.Source == "APS_APPLY_MATERIAL" { + go UpdateOutStatus(operation.Source, operation.Number, 3) + } util.ResponseFormat(c, code.Success, "鎿嶄綔鎴愬姛") } @@ -958,6 +996,7 @@ return "", errors.New("璇诲彇excel妯$増澶辫触锛�" + err.Error()) } readerCloser.Close() + defer f.Close() style, _ := f.NewStyle(&excelize.Style{ Border: []excelize.Border{ @@ -1038,6 +1077,7 @@ return "", errors.New("璇诲彇excel妯$増澶辫触锛�" + err.Error()) } readerCloser.Close() + defer f.Close() style, _ := f.NewStyle(&excelize.Style{ Border: []excelize.Border{ @@ -1108,7 +1148,7 @@ // // @Router /api-wms/v1/operation/getSupplierList [get] func (slf OperationController) GetSupplierList(c *gin.Context) { - cli := supplier.NewSupplierServiceClient(supplier.SupplierConn) + cli := supplier.NewSupplierServiceClient(init_client.SrmConn) resp, err := cli.GetSupplierList(c, &supplier.SupplierListRequest{Status: 1}) if err != nil { util.ResponseFormat(c, code.RequestParamError, "grpc璋冪敤澶辫触:"+err.Error()) @@ -1126,7 +1166,7 @@ // // @Router /api-wms/v1/operation/getClientList [get] func (slf OperationController) GetClientList(c *gin.Context) { - cli := client.NewClientServiceClient(client.ClientConn) + cli := client.NewClientServiceClient(init_client.CrmConn) resp, err := cli.GetClientList(c, &client.ClientListRequest{}) if err != nil { util.ResponseFormat(c, code.RequestParamError, "grpc璋冪敤澶辫触:"+err.Error()) @@ -1134,3 +1174,42 @@ } util.ResponseFormat(c, code.Success, resp.List) } + +// ListByCondition +// @Tags 鍏ュ簱/鍑哄簱 +// @Summary 鍑哄叆搴撴槑缁� +// @Produce application/json +// @Param object body request.OperationCondition true "鍙傛暟" +// @Success 200 {object} util.Response "鎴愬姛" +// @Router /api-wms/v1/operation/listByCondition [post] +func (slf OperationController) ListByCondition(c *gin.Context) { + var params request.OperationCondition + if err := c.BindJSON(¶ms); err != nil { + util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屾暟鎹被鍨嬮敊璇�:"+err.Error()) + return + } + if !params.PageInfo.Check() { + util.ResponseFormat(c, code.RequestParamError, "鏁版嵁鍒嗛〉淇℃伅閿欒") + return + } + + db := mysqlx.GetDB().Table("wms_operation").Select("wms_operation.id as operation_id,wms_operation.number,wms_operation.base_operation_type,material.id AS product_id,material.`name` AS product_name,wms_operation_details.amount,material.unit,wms_operation.from_location_id,from_location.`name` AS from_location,wms_operation.to_location_id,to_location.`name` AS to_location,wms_operation.operation_date as date,wms_operation.`status`").InnerJoins("inner join wms_operation_details ON wms_operation_details.operation_id = wms_operation.id").InnerJoins("INNER JOIN material ON material.id = wms_operation_details.product_id").InnerJoins("INNER JOIN wms_location AS from_location ON from_location.id = wms_operation.from_location_id").InnerJoins("INNER JOIN wms_location AS to_location ON to_location.id = wms_operation.to_location_id") + if params.Condition != "" { + db = db.Where("wms_operation.number like ? or wms_operation.source_number like ? or from_location.`name` like ? or to_location.`name` like ?", "%"+params.Condition+"%", "%"+params.Condition+"%", "%"+params.Condition+"%", "%"+params.Condition+"%") + } + var ( + records = make([]*response.InventoryHistory, 0) + total int64 + ) + + if err := db.Count(&total).Error; err != nil { + util.ResponseFormat(c, code.RequestError, "鏌ユ壘澶辫触:"+err.Error()) + return + } + + if err := db.Offset((params.Page - 1) * params.PageSize).Limit(params.PageSize).Find(&records).Error; err != nil { + util.ResponseFormat(c, code.RequestError, "鏌ユ壘澶辫触:"+err.Error()) + return + } + util.ResponseFormatListWithPage(c, code.Success, records, int(total), params.Page, params.PageSize) +} diff --git a/controllers/product_controller.go b/controllers/product_controller.go index 43a9db0..449e97b 100644 --- a/controllers/product_controller.go +++ b/controllers/product_controller.go @@ -14,6 +14,7 @@ "wms/extend/util" "wms/models" "wms/pkg/logx" + "wms/pkg/mysqlx" "wms/request" ) @@ -447,12 +448,28 @@ util.ResponseFormat(c, code.RequestParamError, "璇疯緭鍏ユ簮鍗曟嵁") return } + if params.Number == "" { + util.ResponseFormat(c, code.RequestParamError, "璇疯緭鍏ュ崟鍙�") + return + } + + var numberNum int64 + if err := mysqlx.GetDB().Model(&models.Operation{}).Where("number=?", params.Number).Count(&numberNum).Error; err != nil { + util.ResponseFormat(c, code.RequestParamError, err.Error()) + return + } + if numberNum > 0 { + util.ResponseFormat(c, code.RequestParamError, "鍗曞彿宸插瓨鍦�") + return + } + detail := &models.OperationDetails{ ProductId: params.ProductId, Amount: params.Amount, } operation := models.Operation{ - Number: strconv.FormatInt(time.Now().Unix(), 10), + //Number: strconv.FormatInt(time.Now().Unix(), 10), + Number: params.Number, SourceNumber: params.SourceNumber, OperationTypeId: 0, Status: constvar.OperationStatus_Ready, @@ -488,7 +505,7 @@ return } - db := models.NewOperationSearch().Orm.Table("wms_operation").Select("wms_operation.id,wms_operation.number,wms_operation.source_number,wms_operation.status,wms_operation.from_location_id,wms_operation.to_location_id,wms_operation.operation_date,wms_operation.contacter_id,wms_operation.contacter_name,wms_operation.company_id,wms_operation.company_name,wms_operation.comment,wms_operation_details.product_id,material.name as product_name,material.unit,wms_operation_details.amount").InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").InnerJoins("inner join material on material.id=wms_operation_details.product_id").Where("wms_operation.base_operation_type=?", constvar.BaseOperationTypeDisuse) + db := models.NewOperationSearch().Orm.Table("wms_operation").Select("wms_operation.id,wms_operation.number,wms_operation.source_number,wms_operation.status,wms_operation.from_location_id,wms_operation.to_location_id,wms_operation.operation_date,wms_operation.contacter_id,wms_operation.contacter_name,wms_operation.company_id,wms_operation.company_name,wms_operation.comment,wms_operation_details.product_id,material.name as product_name,material.unit,wms_operation_details.amount,wms_operation.base_operation_type").InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").InnerJoins("inner join material on material.id=wms_operation_details.product_id").Where("wms_operation.base_operation_type=?", constvar.BaseOperationTypeDisuse) if params.Number != "" { db = db.Where("wms_operation.number like ? or wms_operation.source_number like ? or material.name like ?", fmt.Sprintf("%%%v%%", params.Number), fmt.Sprintf("%%%v%%", params.Number), fmt.Sprintf("%%%v%%", params.Number)) diff --git a/controllers/reorder_rule_controller.go b/controllers/reorder_rule_controller.go index 13002bd..d1fce38 100644 --- a/controllers/reorder_rule_controller.go +++ b/controllers/reorder_rule_controller.go @@ -3,19 +3,16 @@ import ( "github.com/gin-gonic/gin" "github.com/shopspring/decimal" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" "gorm.io/gorm" "strconv" "strings" "time" - "wms/conf" "wms/constvar" "wms/extend/code" "wms/extend/util" "wms/models" - "wms/pkg/logx" "wms/pkg/timex" + "wms/proto/init_client" "wms/proto/inventory_order" "wms/proto/purchase_wms" "wms/request" @@ -260,22 +257,22 @@ util.ResponseFormat(c, code.Success, "鏇存柊鎴愬姛") } -var InventoryOrderServiceConn *grpc.ClientConn - -func InitInventoryOrderServiceConn() { - var err error - InventoryOrderServiceConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - logx.Errorf("grpc dial product service error: %v", err.Error()) - return - } -} - -func CloseInventoryOrderServiceConn() { - if InventoryOrderServiceConn != nil { - InventoryOrderServiceConn.Close() - } -} +//var InventoryOrderServiceConn *grpc.ClientConn +// +//func InitInventoryOrderServiceConn() { +// var err error +// InventoryOrderServiceConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) +// if err != nil { +// logx.Errorf("grpc dial product service error: %v", err.Error()) +// return +// } +//} +// +//func CloseInventoryOrderServiceConn() { +// if InventoryOrderServiceConn != nil { +// InventoryOrderServiceConn.Close() +// } +//} // OrderAgain // @Tags 閲嶈璐ц鍒� @@ -291,7 +288,7 @@ return } if params.Route == "閲囪喘" { - client := purchase_wms.NewPurchaseServiceClient(PurchaseServiceConn) + client := purchase_wms.NewPurchaseServiceClient(init_client.SrmConn) resp, err := client.GetSupplierListByProductId(c, &purchase_wms.GetSupplierListByProductIdRequest{ProductId: params.ProductId}) if err != nil { util.ResponseFormat(c, code.RequestParamError, "grpc璋冪敤澶辫触") @@ -300,7 +297,7 @@ util.ResponseFormat(c, code.Success, resp.List) return } - client := inventory_order.NewInventoryOrderServiceClient(InventoryOrderServiceConn) + client := inventory_order.NewInventoryOrderServiceClient(init_client.ApsConn) order, err := client.CreateNewOrder(c, &inventory_order.CreateNewOrderRequest{ OrderNumber: params.OrderNumber.IntPart(), Unit: params.Unit, @@ -368,7 +365,7 @@ // @Router /api-wms/v1/reorderRule/submitOrder [post] func (slf ReorderRuleController) SubmitOrder(c *gin.Context) { var params models.ReorderRule - client := purchase_wms.NewPurchaseServiceClient(PurchaseServiceConn) + client := purchase_wms.NewPurchaseServiceClient(init_client.SrmConn) resp, err := client.CreatePurchaseByWms(c, &purchase_wms.CreatePurchaseByWmsRequest{ SupplierId: params.SupplierId, ProductId: params.ProductId, diff --git a/controllers/report_forms_controller.go b/controllers/report_forms_controller.go index 25bb3f3..a495b07 100644 --- a/controllers/report_forms_controller.go +++ b/controllers/report_forms_controller.go @@ -265,13 +265,23 @@ } detailsSearch.Orm = detailsSearch.Orm.Model(&models.MoveHistory{}). - Select("number, updated_at as date, product_name as product_name, from_location_id, operation_id," + - "to_location_id, amount, unit, operator as contacted_name, base_operation_type, weight, product_id, from_location, to_location").Order("id desc") + Select("number, updated_at as date, product_name as product_name, from_location_id, operation_id,to_location_id, amount, " + + "unit, operator as contacted_name, base_operation_type, weight, product_id, from_location, to_location, operation_type_name").Order("id desc") if len(ids) > 0 { detailsSearch.Orm = detailsSearch.Orm.Where("id in ?", ids) } if params.BaseOperationType != 0 { detailsSearch.Orm = detailsSearch.Orm.Where("base_operation_type = ?", params.BaseOperationType) + } + var t int64 + err = detailsSearch.Orm.Count(&t).Error + if err != nil { + util.ResponseFormat(c, code.RequestParamError, fmt.Errorf("鏌ヨ鎬绘潯鏁板け璐�: %v", err)) + return + } + total = uint64(t) + if params.Page*params.PageSize > 0 { + detailsSearch.Orm = detailsSearch.Orm.Offset((params.Page - 1) * params.PageSize).Limit(params.PageSize) } err = detailsSearch.Orm.Find(&result).Error if err != nil { @@ -329,6 +339,7 @@ for _, amount := range amounts { var resp response.LocationForms resp.Amount = amount.Amount + resp.LocationId = amount.LocationId resp.LocationName = amount.Location.Name resp.ProduceId = amount.Product.ID resp.ProductName = amount.Product.Name diff --git a/docs/docs.go b/docs/docs.go index 3f4b27a..9db38a4 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1227,6 +1227,36 @@ } } }, + "/api-wms/v1/operation/listByCondition": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鍑哄叆搴撴槑缁�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.OperationCondition" + } + } + ], + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, "/api-wms/v1/operation/listTransfer": { "post": { "produces": [ @@ -2736,7 +2766,7 @@ 5 ], "x-enum-comments": { - "OperationStatus_Cancel": "瀹屾垚", + "OperationStatus_Cancel": "鍙栨秷", "OperationStatus_Draft": "鑽夌", "OperationStatus_Finish": "瀹屾垚", "OperationStatus_Ready": "灏辩华", @@ -3371,6 +3401,9 @@ "receiverPhone": { "type": "string" }, + "source": { + "type": "string" + }, "sourceNumber": { "description": "婧愬崟鍙�", "type": "string" @@ -3674,6 +3707,10 @@ }, "fromLocationId": { "type": "integer" + }, + "number": { + "description": "Unit string ` + "`" + `json:\"unit\"` + "`" + `", + "type": "string" }, "productId": { "type": "string" @@ -4157,6 +4194,22 @@ }, "sourceNumber": { "type": "string" + } + } + }, + "request.OperationCondition": { + "type": "object", + "properties": { + "condition": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" } } }, @@ -4659,6 +4712,10 @@ "operationId": { "type": "integer" }, + "operationTypeName": { + "description": "浣滀笟绫诲瀷鍚嶇О", + "type": "string" + }, "productId": { "type": "string" }, @@ -4694,6 +4751,10 @@ "description": "鏁伴噺", "type": "number" }, + "locationId": { + "description": "浣嶇疆id", + "type": "integer" + }, "locationName": { "description": "浣嶇疆鍚嶇О", "type": "string" diff --git a/docs/swagger.json b/docs/swagger.json index 9d13c83..c1acd3f 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1215,6 +1215,36 @@ } } }, + "/api-wms/v1/operation/listByCondition": { + "post": { + "produces": [ + "application/json" + ], + "tags": [ + "鍏ュ簱/鍑哄簱" + ], + "summary": "鍑哄叆搴撴槑缁�", + "parameters": [ + { + "description": "鍙傛暟", + "name": "object", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.OperationCondition" + } + } + ], + "responses": { + "200": { + "description": "鎴愬姛", + "schema": { + "$ref": "#/definitions/util.Response" + } + } + } + } + }, "/api-wms/v1/operation/listTransfer": { "post": { "produces": [ @@ -2724,7 +2754,7 @@ 5 ], "x-enum-comments": { - "OperationStatus_Cancel": "瀹屾垚", + "OperationStatus_Cancel": "鍙栨秷", "OperationStatus_Draft": "鑽夌", "OperationStatus_Finish": "瀹屾垚", "OperationStatus_Ready": "灏辩华", @@ -3359,6 +3389,9 @@ "receiverPhone": { "type": "string" }, + "source": { + "type": "string" + }, "sourceNumber": { "description": "婧愬崟鍙�", "type": "string" @@ -3662,6 +3695,10 @@ }, "fromLocationId": { "type": "integer" + }, + "number": { + "description": "Unit string `json:\"unit\"`", + "type": "string" }, "productId": { "type": "string" @@ -4145,6 +4182,22 @@ }, "sourceNumber": { "type": "string" + } + } + }, + "request.OperationCondition": { + "type": "object", + "properties": { + "condition": { + "type": "string" + }, + "page": { + "description": "椤电爜", + "type": "integer" + }, + "pageSize": { + "description": "姣忛〉澶у皬", + "type": "integer" } } }, @@ -4647,6 +4700,10 @@ "operationId": { "type": "integer" }, + "operationTypeName": { + "description": "浣滀笟绫诲瀷鍚嶇О", + "type": "string" + }, "productId": { "type": "string" }, @@ -4682,6 +4739,10 @@ "description": "鏁伴噺", "type": "number" }, + "locationId": { + "description": "浣嶇疆id", + "type": "integer" + }, "locationName": { "description": "浣嶇疆鍚嶇О", "type": "string" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 83761e3..a4cbae1 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -180,7 +180,7 @@ - 5 type: integer x-enum-comments: - OperationStatus_Cancel: 瀹屾垚 + OperationStatus_Cancel: 鍙栨秷 OperationStatus_Draft: 鑽夌 OperationStatus_Finish: 瀹屾垚 OperationStatus_Ready: 灏辩华 @@ -636,6 +636,8 @@ type: string receiverPhone: type: string + source: + type: string sourceNumber: description: 婧愬崟鍙� type: string @@ -843,6 +845,9 @@ type: number fromLocationId: type: integer + number: + description: Unit string `json:"unit"` + type: string productId: type: string sourceNumber: @@ -1176,6 +1181,17 @@ type: integer sourceNumber: type: string + type: object + request.OperationCondition: + properties: + condition: + type: string + page: + description: 椤电爜 + type: integer + pageSize: + description: 姣忛〉澶у皬 + type: integer type: object request.OperationDetails: properties: @@ -1521,6 +1537,9 @@ type: string operationId: type: integer + operationTypeName: + description: 浣滀笟绫诲瀷鍚嶇О + type: string productId: type: string productName: @@ -1546,6 +1565,9 @@ amount: description: 鏁伴噺 type: number + locationId: + description: 浣嶇疆id + type: integer locationName: description: 浣嶇疆鍚嶇О type: string @@ -2343,6 +2365,25 @@ summary: 鍏ュ簱/鍑哄簱鍒楄〃 tags: - 鍏ュ簱/鍑哄簱 + /api-wms/v1/operation/listByCondition: + post: + parameters: + - description: 鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.OperationCondition' + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 鍑哄叆搴撴槑缁� + tags: + - 鍏ュ簱/鍑哄簱 /api-wms/v1/operation/listTransfer: post: parameters: diff --git a/main.go b/main.go index 68e32ad..1801bbf 100644 --- a/main.go +++ b/main.go @@ -11,14 +11,12 @@ "syscall" "time" "wms/conf" - "wms/controllers" "wms/models" "wms/pkg/logx" - "wms/proto/client" + "wms/proto/init_client" "wms/proto/inventory_order" "wms/proto/product_inventory" "wms/proto/purchase_wms" - "wms/proto/supplier" "wms/router" "wms/service" ) @@ -49,11 +47,12 @@ } go shutdown(server) //鍚姩grpc瀹㈡埛绔� - go controllers.InitInventoryOrderServiceConn() - go controllers.InitProductInventoryServiceConn() - go controllers.InitCodeServiceConn() - go supplier.InitConn() - go client.InitConn() + //go controllers.InitInventoryOrderServiceConn() + //go controllers.InitProductInventoryServiceConn() + //go controllers.InitCodeServiceConn() + //go supplier.InitConn() + //go client.InitConn() + go init_client.InitClient() //鍚姩grpc鏈嶅姟 go func() { ln, err := net.Listen("tcp", ":"+conf.WebConf.GrpcPort) @@ -90,11 +89,12 @@ ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() - controllers.CloseInventoryOrderServiceConn() - controllers.CloseProductInventoryServiceConn() - controllers.CloseCodeServiceConn() - supplier.CloseConn() - client.CloseConn() + //controllers.CloseInventoryOrderServiceConn() + //controllers.CloseProductInventoryServiceConn() + //controllers.CloseCodeServiceConn() + //supplier.CloseConn() + //client.CloseConn() + init_client.CloseClient() // 鍏抽棴HTTP鏈嶅姟鍣� if err := server.Shutdown(ctx); err != nil { logx.Infof("鏈嶅姟浼橀泤閫�鍑哄け璐�: %v", err) diff --git a/models/file_template_attachment.go b/models/file_template_attachment.go index 59f6853..575213e 100644 --- a/models/file_template_attachment.go +++ b/models/file_template_attachment.go @@ -15,6 +15,7 @@ Name string `json:"name" gorm:"type:varchar(63);comment:妯$増鍚嶇О"` AttachmentId uint `json:"attachmentId" gorm:"comment:闄勪欢琛ㄥ閿�"` Attachment Attachment `json:"attachment" gorm:"foreignKey:AttachmentId;references:Id"` + TableInfo string `json:"tableInfo" gorm:"type:varchar(31);comment:琛ㄥ悕"` } FileTemplateAttachmentSearch struct { FileTemplateAttachment diff --git a/models/operation.go b/models/operation.go index 96e5754..2009733 100644 --- a/models/operation.go +++ b/models/operation.go @@ -33,6 +33,7 @@ WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:杩愬崟鍙�"` //杩愬崟鍙� Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:閲嶉噺" json:"weight"` //閲嶉噺 LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺" json:"logisticWeight"` //鐗╂祦閲嶉噺 + Source string `json:"source" gorm:"type:varchar(255);comment:鏉ユ簮绯荤粺,鐢ㄤ簬杩斿洖淇敼鐘舵��"` Details []*OperationDetails `json:"details" gorm:"foreignKey:OperationID;references:Id"` BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:鍩虹浣滀笟绫诲瀷"` //鍩虹浣滀笟绫诲瀷 @@ -157,8 +158,7 @@ } if slf.Preload { - db = db.Model(&Operation{}).Preload("Details").Preload("Details.Product").Preload("FromLocation"). - Preload("ToLocation").Preload("LogisticCompany") + db = db.Model(&Operation{}).Preload("Details").Preload("Details.Product").Preload("LogisticCompany").Preload("FromLocation").Preload("ToLocation") } if slf.Disuse { @@ -337,3 +337,15 @@ return records, nil } + +func (slf *OperationSearch) MaxAutoIncr() (int, error) { + var ( + db = slf.build() + total int64 + ) + + if err := db.Count(&total).Error; err != nil { + return int(total), fmt.Errorf("max err: %v", err) + } + return int(total), nil +} diff --git a/proto/client/client.go b/proto/client/client.go index 14289b3..b3be957 100644 --- a/proto/client/client.go +++ b/proto/client/client.go @@ -1,27 +1,20 @@ package client -import ( - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - "wms/conf" - "wms/pkg/logx" -) - -var ( - ClientConn *grpc.ClientConn -) - -func InitConn() { - var err error - ClientConn, err = grpc.Dial(conf.GrpcServerConf.CrmAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - logx.Errorf("grpc dial product service error: %v", err.Error()) - return - } -} - -func CloseConn() { - if ClientConn != nil { - ClientConn.Close() - } -} +//var ( +// ClientConn *grpc.ClientConn +//) +// +//func InitConn() { +// var err error +// ClientConn, err = grpc.Dial(conf.GrpcServerConf.CrmAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) +// if err != nil { +// logx.Errorf("grpc dial product service error: %v", err.Error()) +// return +// } +//} +// +//func CloseConn() { +// if ClientConn != nil { +// ClientConn.Close() +// } +//} diff --git a/proto/init_client/init_client.go b/proto/init_client/init_client.go new file mode 100644 index 0000000..d0acfb7 --- /dev/null +++ b/proto/init_client/init_client.go @@ -0,0 +1,45 @@ +package init_client + +import ( + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" + "wms/conf" + "wms/pkg/logx" +) + +var ( + ApsConn *grpc.ClientConn + CrmConn *grpc.ClientConn + SrmConn *grpc.ClientConn +) + +func InitClient() { + var err error + ApsConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + logx.Errorf("grpc dial product service error: %v", err.Error()) + return + } + CrmConn, err = grpc.Dial(conf.GrpcServerConf.CrmAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) + if err != nil { + logx.Errorf("grpc dial product service error: %v", err.Error()) + return + } + SrmConn, 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 CloseClient() { + if ApsConn != nil { + ApsConn.Close() + } + if CrmConn != nil { + CrmConn.Close() + } + if SrmConn != nil { + SrmConn.Close() + } +} diff --git a/proto/inventory_order.proto b/proto/inventory_order.proto index b624137..abd9f73 100644 --- a/proto/inventory_order.proto +++ b/proto/inventory_order.proto @@ -5,6 +5,8 @@ service inventoryOrderService { rpc CreateNewOrder(CreateNewOrderRequest) returns(CreateNewOrderResponse) {} rpc CreateOperationList(CreateOperationListRequest) returns(CreateOperationListResponse) {} + rpc UpdateMaterialApplyStatus(UpdateMaterialApplyStatusRequest) returns(UpdateMaterialApplyStatusResponse) {} + rpc GetWarehouseInfo(GetWarehouseInfoRequest) returns(GetWarehouseInfoResponse) {} } message CreateNewOrderRequest{ @@ -34,9 +36,39 @@ message CreateOperationListRequest{ int64 OperationType = 1; - repeated OperationList List = 2; + string Source = 2; + repeated OperationList List = 3; +} + +message OperationResponse{ + string WorkOrderId = 1; + string Number = 2; } message CreateOperationListResponse{ + repeated OperationResponse List = 1; } +//--------------------------------------------------UpdateMaterialApplyStatus----------------------------------- + +message UpdateMaterialApplyStatusRequest{ + string Number = 1; + int64 Status = 2; +} + +message UpdateMaterialApplyStatusResponse{ +} + +//-------------------------------------------------GetWarehouseInfo----------------------------------------- + +message GetWarehouseInfoRequest{ +} + +message WarehouseInfo{ + string Id = 1;//浠撳簱id + string Name = 2;//浠撳簱鍚嶇О +} + +message GetWarehouseInfoResponse{ + repeated WarehouseInfo List = 1; +} \ No newline at end of file diff --git a/proto/inventory_order/inventory_order.pb.go b/proto/inventory_order/inventory_order.pb.go index d65e27b..9294466 100644 --- a/proto/inventory_order/inventory_order.pb.go +++ b/proto/inventory_order/inventory_order.pb.go @@ -270,7 +270,8 @@ unknownFields protoimpl.UnknownFields OperationType int64 `protobuf:"varint,1,opt,name=OperationType,proto3" json:"OperationType,omitempty"` - List []*OperationList `protobuf:"bytes,2,rep,name=List,proto3" json:"List,omitempty"` + Source string `protobuf:"bytes,2,opt,name=Source,proto3" json:"Source,omitempty"` + List []*OperationList `protobuf:"bytes,3,rep,name=List,proto3" json:"List,omitempty"` } func (x *CreateOperationListRequest) Reset() { @@ -312,6 +313,13 @@ return 0 } +func (x *CreateOperationListRequest) GetSource() string { + if x != nil { + return x.Source + } + return "" +} + func (x *CreateOperationListRequest) GetList() []*OperationList { if x != nil { return x.List @@ -319,16 +327,73 @@ return nil } +type OperationResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + WorkOrderId string `protobuf:"bytes,1,opt,name=WorkOrderId,proto3" json:"WorkOrderId,omitempty"` + Number string `protobuf:"bytes,2,opt,name=Number,proto3" json:"Number,omitempty"` +} + +func (x *OperationResponse) Reset() { + *x = OperationResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inventory_order_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OperationResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationResponse) ProtoMessage() {} + +func (x *OperationResponse) ProtoReflect() protoreflect.Message { + mi := &file_inventory_order_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 OperationResponse.ProtoReflect.Descriptor instead. +func (*OperationResponse) Descriptor() ([]byte, []int) { + return file_inventory_order_proto_rawDescGZIP(), []int{5} +} + +func (x *OperationResponse) GetWorkOrderId() string { + if x != nil { + return x.WorkOrderId + } + return "" +} + +func (x *OperationResponse) GetNumber() string { + if x != nil { + return x.Number + } + return "" +} + type CreateOperationListResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + List []*OperationResponse `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"` } func (x *CreateOperationListResponse) Reset() { *x = CreateOperationListResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventory_order_proto_msgTypes[5] + mi := &file_inventory_order_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -341,7 +406,7 @@ func (*CreateOperationListResponse) ProtoMessage() {} func (x *CreateOperationListResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventory_order_proto_msgTypes[5] + mi := &file_inventory_order_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -354,7 +419,247 @@ // Deprecated: Use CreateOperationListResponse.ProtoReflect.Descriptor instead. func (*CreateOperationListResponse) Descriptor() ([]byte, []int) { - return file_inventory_order_proto_rawDescGZIP(), []int{5} + return file_inventory_order_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateOperationListResponse) GetList() []*OperationResponse { + if x != nil { + return x.List + } + return nil +} + +type UpdateMaterialApplyStatusRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Number string `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"` + Status int64 `protobuf:"varint,2,opt,name=Status,proto3" json:"Status,omitempty"` +} + +func (x *UpdateMaterialApplyStatusRequest) Reset() { + *x = UpdateMaterialApplyStatusRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_inventory_order_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateMaterialApplyStatusRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMaterialApplyStatusRequest) ProtoMessage() {} + +func (x *UpdateMaterialApplyStatusRequest) ProtoReflect() protoreflect.Message { + mi := &file_inventory_order_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 UpdateMaterialApplyStatusRequest.ProtoReflect.Descriptor instead. +func (*UpdateMaterialApplyStatusRequest) Descriptor() ([]byte, []int) { + return file_inventory_order_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateMaterialApplyStatusRequest) GetNumber() string { + if x != nil { + return x.Number + } + return "" +} + +func (x *UpdateMaterialApplyStatusRequest) GetStatus() int64 { + if x != nil { + return x.Status + } + return 0 +} + +type UpdateMaterialApplyStatusResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UpdateMaterialApplyStatusResponse) Reset() { + *x = UpdateMaterialApplyStatusResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inventory_order_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateMaterialApplyStatusResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateMaterialApplyStatusResponse) ProtoMessage() {} + +func (x *UpdateMaterialApplyStatusResponse) ProtoReflect() protoreflect.Message { + mi := &file_inventory_order_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 UpdateMaterialApplyStatusResponse.ProtoReflect.Descriptor instead. +func (*UpdateMaterialApplyStatusResponse) Descriptor() ([]byte, []int) { + return file_inventory_order_proto_rawDescGZIP(), []int{8} +} + +type GetWarehouseInfoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *GetWarehouseInfoRequest) Reset() { + *x = GetWarehouseInfoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_inventory_order_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWarehouseInfoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWarehouseInfoRequest) ProtoMessage() {} + +func (x *GetWarehouseInfoRequest) ProtoReflect() protoreflect.Message { + mi := &file_inventory_order_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 GetWarehouseInfoRequest.ProtoReflect.Descriptor instead. +func (*GetWarehouseInfoRequest) Descriptor() ([]byte, []int) { + return file_inventory_order_proto_rawDescGZIP(), []int{9} +} + +type WarehouseInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"` //浠撳簱id + Name string `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` //浠撳簱鍚嶇О +} + +func (x *WarehouseInfo) Reset() { + *x = WarehouseInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_inventory_order_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WarehouseInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WarehouseInfo) ProtoMessage() {} + +func (x *WarehouseInfo) ProtoReflect() protoreflect.Message { + mi := &file_inventory_order_proto_msgTypes[10] + 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 WarehouseInfo.ProtoReflect.Descriptor instead. +func (*WarehouseInfo) Descriptor() ([]byte, []int) { + return file_inventory_order_proto_rawDescGZIP(), []int{10} +} + +func (x *WarehouseInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *WarehouseInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetWarehouseInfoResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*WarehouseInfo `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"` +} + +func (x *GetWarehouseInfoResponse) Reset() { + *x = GetWarehouseInfoResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inventory_order_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetWarehouseInfoResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetWarehouseInfoResponse) ProtoMessage() {} + +func (x *GetWarehouseInfoResponse) ProtoReflect() protoreflect.Message { + mi := &file_inventory_order_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 GetWarehouseInfoResponse.ProtoReflect.Descriptor instead. +func (*GetWarehouseInfoResponse) Descriptor() ([]byte, []int) { + return file_inventory_order_proto_rawDescGZIP(), []int{11} +} + +func (x *GetWarehouseInfoResponse) GetList() []*WarehouseInfo { + if x != nil { + return x.List + } + return nil } var File_inventory_order_proto protoreflect.FileDescriptor @@ -387,28 +692,65 @@ 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x08, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x73, 0x22, 0x66, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x73, 0x22, 0x7e, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x1d, 0x0a, 0x1b, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb0, 0x01, 0x0a, 0x15, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x77, 0x4f, - 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x77, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x13, 0x5a, 0x11, 0x2e, - 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x22, 0x0a, + 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x4f, 0x70, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x04, 0x4c, 0x69, 0x73, + 0x74, 0x22, 0x4d, 0x0a, 0x11, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x57, 0x6f, 0x72, 0x6b, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x57, 0x6f, 0x72, + 0x6b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x22, 0x45, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x26, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x52, 0x0a, 0x20, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x23, 0x0a, 0x21, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x41, 0x70, 0x70, + 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x19, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x33, 0x0a, 0x0d, 0x57, + 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, + 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, + 0x22, 0x3e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x04, + 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x57, 0x61, 0x72, + 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, + 0x32, 0xe1, 0x02, 0x0a, 0x15, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x4f, 0x72, + 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x43, 0x0a, 0x0e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x16, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x65, 0x77, + 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x52, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x64, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x74, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x21, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x74, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x74, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x10, 0x47, 0x65, 0x74, + 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, + 0x47, 0x65, 0x74, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x72, + 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x13, 0x5a, 0x11, 0x2e, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x5f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -423,27 +765,39 @@ return file_inventory_order_proto_rawDescData } -var file_inventory_order_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_inventory_order_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_inventory_order_proto_goTypes = []interface{}{ - (*CreateNewOrderRequest)(nil), // 0: CreateNewOrderRequest - (*CreateNewOrderResponse)(nil), // 1: CreateNewOrderResponse - (*OperationProduct)(nil), // 2: OperationProduct - (*OperationList)(nil), // 3: OperationList - (*CreateOperationListRequest)(nil), // 4: CreateOperationListRequest - (*CreateOperationListResponse)(nil), // 5: CreateOperationListResponse + (*CreateNewOrderRequest)(nil), // 0: CreateNewOrderRequest + (*CreateNewOrderResponse)(nil), // 1: CreateNewOrderResponse + (*OperationProduct)(nil), // 2: OperationProduct + (*OperationList)(nil), // 3: OperationList + (*CreateOperationListRequest)(nil), // 4: CreateOperationListRequest + (*OperationResponse)(nil), // 5: OperationResponse + (*CreateOperationListResponse)(nil), // 6: CreateOperationListResponse + (*UpdateMaterialApplyStatusRequest)(nil), // 7: UpdateMaterialApplyStatusRequest + (*UpdateMaterialApplyStatusResponse)(nil), // 8: UpdateMaterialApplyStatusResponse + (*GetWarehouseInfoRequest)(nil), // 9: GetWarehouseInfoRequest + (*WarehouseInfo)(nil), // 10: WarehouseInfo + (*GetWarehouseInfoResponse)(nil), // 11: GetWarehouseInfoResponse } var file_inventory_order_proto_depIdxs = []int32{ - 2, // 0: OperationList.Products:type_name -> OperationProduct - 3, // 1: CreateOperationListRequest.List:type_name -> OperationList - 0, // 2: inventoryOrderService.CreateNewOrder:input_type -> CreateNewOrderRequest - 4, // 3: inventoryOrderService.CreateOperationList:input_type -> CreateOperationListRequest - 1, // 4: inventoryOrderService.CreateNewOrder:output_type -> CreateNewOrderResponse - 5, // 5: inventoryOrderService.CreateOperationList:output_type -> CreateOperationListResponse - 4, // [4:6] is the sub-list for method output_type - 2, // [2:4] 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 + 2, // 0: OperationList.Products:type_name -> OperationProduct + 3, // 1: CreateOperationListRequest.List:type_name -> OperationList + 5, // 2: CreateOperationListResponse.List:type_name -> OperationResponse + 10, // 3: GetWarehouseInfoResponse.List:type_name -> WarehouseInfo + 0, // 4: inventoryOrderService.CreateNewOrder:input_type -> CreateNewOrderRequest + 4, // 5: inventoryOrderService.CreateOperationList:input_type -> CreateOperationListRequest + 7, // 6: inventoryOrderService.UpdateMaterialApplyStatus:input_type -> UpdateMaterialApplyStatusRequest + 9, // 7: inventoryOrderService.GetWarehouseInfo:input_type -> GetWarehouseInfoRequest + 1, // 8: inventoryOrderService.CreateNewOrder:output_type -> CreateNewOrderResponse + 6, // 9: inventoryOrderService.CreateOperationList:output_type -> CreateOperationListResponse + 8, // 10: inventoryOrderService.UpdateMaterialApplyStatus:output_type -> UpdateMaterialApplyStatusResponse + 11, // 11: inventoryOrderService.GetWarehouseInfo:output_type -> GetWarehouseInfoResponse + 8, // [8:12] is the sub-list for method output_type + 4, // [4:8] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_inventory_order_proto_init() } @@ -513,7 +867,79 @@ } } file_inventory_order_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*OperationResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventory_order_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateOperationListResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventory_order_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateMaterialApplyStatusRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventory_order_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateMaterialApplyStatusResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventory_order_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWarehouseInfoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventory_order_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WarehouseInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventory_order_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetWarehouseInfoResponse); i { case 0: return &v.state case 1: @@ -531,7 +957,7 @@ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_inventory_order_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 12, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/inventory_order/inventory_order_grpc.pb.go b/proto/inventory_order/inventory_order_grpc.pb.go index fd1952a..dc8b072 100644 --- a/proto/inventory_order/inventory_order_grpc.pb.go +++ b/proto/inventory_order/inventory_order_grpc.pb.go @@ -20,6 +20,8 @@ type InventoryOrderServiceClient interface { CreateNewOrder(ctx context.Context, in *CreateNewOrderRequest, opts ...grpc.CallOption) (*CreateNewOrderResponse, error) CreateOperationList(ctx context.Context, in *CreateOperationListRequest, opts ...grpc.CallOption) (*CreateOperationListResponse, error) + UpdateMaterialApplyStatus(ctx context.Context, in *UpdateMaterialApplyStatusRequest, opts ...grpc.CallOption) (*UpdateMaterialApplyStatusResponse, error) + GetWarehouseInfo(ctx context.Context, in *GetWarehouseInfoRequest, opts ...grpc.CallOption) (*GetWarehouseInfoResponse, error) } type inventoryOrderServiceClient struct { @@ -48,12 +50,32 @@ return out, nil } +func (c *inventoryOrderServiceClient) UpdateMaterialApplyStatus(ctx context.Context, in *UpdateMaterialApplyStatusRequest, opts ...grpc.CallOption) (*UpdateMaterialApplyStatusResponse, error) { + out := new(UpdateMaterialApplyStatusResponse) + err := c.cc.Invoke(ctx, "/inventoryOrderService/UpdateMaterialApplyStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *inventoryOrderServiceClient) GetWarehouseInfo(ctx context.Context, in *GetWarehouseInfoRequest, opts ...grpc.CallOption) (*GetWarehouseInfoResponse, error) { + out := new(GetWarehouseInfoResponse) + err := c.cc.Invoke(ctx, "/inventoryOrderService/GetWarehouseInfo", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // InventoryOrderServiceServer is the server API for InventoryOrderService service. // All implementations must embed UnimplementedInventoryOrderServiceServer // for forward compatibility type InventoryOrderServiceServer interface { CreateNewOrder(context.Context, *CreateNewOrderRequest) (*CreateNewOrderResponse, error) CreateOperationList(context.Context, *CreateOperationListRequest) (*CreateOperationListResponse, error) + UpdateMaterialApplyStatus(context.Context, *UpdateMaterialApplyStatusRequest) (*UpdateMaterialApplyStatusResponse, error) + GetWarehouseInfo(context.Context, *GetWarehouseInfoRequest) (*GetWarehouseInfoResponse, error) mustEmbedUnimplementedInventoryOrderServiceServer() } @@ -66,6 +88,12 @@ } func (UnimplementedInventoryOrderServiceServer) CreateOperationList(context.Context, *CreateOperationListRequest) (*CreateOperationListResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateOperationList not implemented") +} +func (UnimplementedInventoryOrderServiceServer) UpdateMaterialApplyStatus(context.Context, *UpdateMaterialApplyStatusRequest) (*UpdateMaterialApplyStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateMaterialApplyStatus not implemented") +} +func (UnimplementedInventoryOrderServiceServer) GetWarehouseInfo(context.Context, *GetWarehouseInfoRequest) (*GetWarehouseInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWarehouseInfo not implemented") } func (UnimplementedInventoryOrderServiceServer) mustEmbedUnimplementedInventoryOrderServiceServer() {} @@ -116,6 +144,42 @@ return interceptor(ctx, in, info, handler) } +func _InventoryOrderService_UpdateMaterialApplyStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateMaterialApplyStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryOrderServiceServer).UpdateMaterialApplyStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventoryOrderService/UpdateMaterialApplyStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryOrderServiceServer).UpdateMaterialApplyStatus(ctx, req.(*UpdateMaterialApplyStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InventoryOrderService_GetWarehouseInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetWarehouseInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(InventoryOrderServiceServer).GetWarehouseInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/inventoryOrderService/GetWarehouseInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InventoryOrderServiceServer).GetWarehouseInfo(ctx, req.(*GetWarehouseInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + // InventoryOrderService_ServiceDesc is the grpc.ServiceDesc for InventoryOrderService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -131,6 +195,14 @@ MethodName: "CreateOperationList", Handler: _InventoryOrderService_CreateOperationList_Handler, }, + { + MethodName: "UpdateMaterialApplyStatus", + Handler: _InventoryOrderService_UpdateMaterialApplyStatus_Handler, + }, + { + MethodName: "GetWarehouseInfo", + Handler: _InventoryOrderService_GetWarehouseInfo_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "inventory_order.proto", diff --git a/proto/inventory_order/server.go b/proto/inventory_order/server.go index 884c8d9..faa9a98 100644 --- a/proto/inventory_order/server.go +++ b/proto/inventory_order/server.go @@ -44,9 +44,11 @@ if err != nil { return nil, err } + operationResp := make([]*OperationResponse, 0) for _, list := range req.List { var operation models.Operation var details []*models.OperationDetails + var or OperationResponse operation.SourceNumber = list.SourceNumber operation.OperationDate = timex.TimeToString2(time.Now()) operation.Number = strconv.FormatInt(time.Now().Unix(), 10) @@ -56,6 +58,10 @@ operation.FromLocationID = fromLocation.Id operation.ToLocationID = toLocation.Id operation.BaseOperationType = constvar.BaseOperationTypeOutgoing + operation.Source = req.Source + or.WorkOrderId = operation.SourceNumber + or.Number = operation.Number + operationResp = append(operationResp, &or) if req.OperationType == 1 { operation.BaseOperationType = constvar.BaseOperationTypeIncoming } @@ -70,5 +76,23 @@ } err = models.NewOperationSearch().CreateBatch(operations) resp := new(CreateOperationListResponse) + resp.List = operationResp return resp, err } + +func (s *Server) GetWarehouseInfo(ctx context.Context, req *GetWarehouseInfoRequest) (*GetWarehouseInfoResponse, error) { + warehouses, err := models.NewWarehouseSearch().FindNotTotal() + if err != nil { + return nil, err + } + list := make([]*WarehouseInfo, 0) + for _, warehouse := range warehouses { + var wi WarehouseInfo + wi.Id = strconv.Itoa(warehouse.Id) + wi.Name = warehouse.Name + list = append(list, &wi) + } + resp := new(GetWarehouseInfoResponse) + resp.List = list + return resp, nil +} diff --git a/proto/product_inventory.proto b/proto/product_inventory.proto index 7da35cb..4c6552f 100644 --- a/proto/product_inventory.proto +++ b/proto/product_inventory.proto @@ -14,7 +14,8 @@ string Address = 3;//鏀惰揣鍦板潃 string Phone = 4; int32 DeliverType = 5;//浜や粯绫诲瀷 - repeated InventoryProduct ProductList = 6; + string Source = 6; + repeated InventoryProduct ProductList = 7; } message InventoryProduct{ diff --git a/proto/product_inventory/product_inventory.pb.go b/proto/product_inventory/product_inventory.pb.go index 26c7209..d9473c7 100644 --- a/proto/product_inventory/product_inventory.pb.go +++ b/proto/product_inventory/product_inventory.pb.go @@ -30,7 +30,8 @@ Address string `protobuf:"bytes,3,opt,name=Address,proto3" json:"Address,omitempty"` //鏀惰揣鍦板潃 Phone string `protobuf:"bytes,4,opt,name=Phone,proto3" json:"Phone,omitempty"` DeliverType int32 `protobuf:"varint,5,opt,name=DeliverType,proto3" json:"DeliverType,omitempty"` //浜や粯绫诲瀷 - ProductList []*InventoryProduct `protobuf:"bytes,6,rep,name=ProductList,proto3" json:"ProductList,omitempty"` + Source string `protobuf:"bytes,6,opt,name=Source,proto3" json:"Source,omitempty"` + ProductList []*InventoryProduct `protobuf:"bytes,7,rep,name=ProductList,proto3" json:"ProductList,omitempty"` } func (x *CreateOperationRequest) Reset() { @@ -98,6 +99,13 @@ return x.DeliverType } return 0 +} + +func (x *CreateOperationRequest) GetSource() string { + if x != nil { + return x.Source + } + return "" } func (x *CreateOperationRequest) GetProductList() []*InventoryProduct { @@ -576,7 +584,7 @@ var file_product_inventory_proto_rawDesc = []byte{ 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd5, 0x01, 0x0a, 0x16, 0x43, 0x72, + 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x1c, 0x0a, 0x09, @@ -586,82 +594,83 @@ 0x72, 0x65, 0x73, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x33, 0x0a, 0x0b, - 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x11, 0x2e, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0x3a, 0x0a, 0x10, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 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, 0x09, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3f, 0x0a, - 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 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, 0x38, - 0x0a, 0x1e, 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, - 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, 0xcd, 0x02, 0x0a, 0x0b, 0x50, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, - 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, - 0x0a, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x6e, - 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x49, 0x6e, 0x76, 0x6f, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x43, 0x61, 0x72, 0x72, 0x69, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, - 0x61, 0x72, 0x72, 0x69, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x57, 0x61, 0x79, 0x62, 0x69, 0x6c, - 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x57, 0x61, 0x79, 0x62, 0x69, 0x6c, 0x6c, - 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x61, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x61, 0x6c, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x56, 0x61, 0x6c, 0x6f, 0x72, 0x65, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x56, 0x61, 0x6c, 0x6f, 0x72, 0x65, 0x6d, 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x61, 0x72, 0x65, - 0x68, 0x6f, 0x75, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x57, 0x61, 0x72, - 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, - 0x0a, 0x0f, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, - 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, - 0x6c, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x77, 0x0a, 0x1f, 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, 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, 0x2e, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, - 0x74, 0x22, 0x66, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x11, 0x53, - 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x47, 0x0a, 0x1f, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, - 0x73, 0x67, 0x32, 0xa1, 0x02, 0x0a, 0x17, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, - 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, + 0x0b, 0x44, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, + 0x69, 0x73, 0x74, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x49, 0x6e, 0x76, 0x65, + 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x0b, 0x50, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3a, 0x0a, 0x10, 0x49, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 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, 0x09, 0x52, 0x06, 0x41, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x3f, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, + 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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, 0x38, 0x0a, 0x1e, 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, + 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, 0xcd, 0x02, 0x0a, 0x0b, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, + 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, + 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x49, 0x6e, + 0x76, 0x6f, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x49, 0x6e, 0x76, + 0x6f, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x61, 0x72, 0x72, 0x69, 0x65, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x61, 0x72, 0x72, 0x69, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x57, 0x61, 0x79, 0x62, 0x69, 0x6c, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x57, 0x61, 0x79, 0x62, 0x69, 0x6c, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x61, 0x6c, 0x65, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x53, 0x61, 0x6c, + 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x56, 0x61, 0x6c, 0x6f, 0x72, 0x65, + 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x56, 0x61, 0x6c, 0x6f, 0x72, 0x65, 0x6d, + 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x18, 0x0a, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x12, 0x16, + 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, + 0x62, 0x6c, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x22, 0x77, 0x0a, 0x1f, 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, 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, 0x2e, 0x0a, 0x0b, 0x50, 0x72, 0x6f, + 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x50, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x66, 0x0a, 0x1e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x4e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x11, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, - 0x73, 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, + 0x73, 0x22, 0x47, 0x0a, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 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, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x4d, 0x73, 0x67, 0x32, 0xa1, 0x02, 0x0a, 0x17, 0x70, + 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x70, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, + 0x0a, 0x17, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x2e, 0x47, 0x65, 0x74, 0x49, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x47, 0x65, 0x74, + 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5e, + 0x0a, 0x17, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, + 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x61, 0x6c, 0x65, 0x73, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x53, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x15, + 0x5a, 0x13, 0x2e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x6e, 0x76, 0x65, + 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/product_inventory/server.go b/proto/product_inventory/server.go index 1b624b7..f64413b 100644 --- a/proto/product_inventory/server.go +++ b/proto/product_inventory/server.go @@ -170,6 +170,7 @@ operation.ReceiverName = req.Addressee operation.ReceiverPhone = req.Phone operation.ReceiverAddr = req.Address + operation.Source = req.Source if req.DeliverType == 1 { for _, product := range req.ProductList { var detail models.OperationDetails @@ -187,7 +188,6 @@ detail.ProductId = product.Id amount, _ := decimal.NewFromString(product.Amount) detail.Amount = amount - details = append(details, &detail) newOperation.Details = append(newOperation.Details, &detail) operations = append(operations, &newOperation) } diff --git a/proto/purchase_wms.proto b/proto/purchase_wms.proto index 57b61a0..c344dfd 100644 --- a/proto/purchase_wms.proto +++ b/proto/purchase_wms.proto @@ -20,7 +20,8 @@ message PurchaseToWmsRequest { string Number = 1; //閲囪喘缂栧彿 string SupplierName = 2; //渚涘簲鍟� - repeated PurchaseProduct Product = 3; + string Source = 3;//鏉ユ簮 + repeated PurchaseProduct Product = 4; } message PurchaseToWmsResponse { diff --git a/proto/purchase_wms/purchase_wms.pb.go b/proto/purchase_wms/purchase_wms.pb.go index 94f9372..5af5073 100644 --- a/proto/purchase_wms/purchase_wms.pb.go +++ b/proto/purchase_wms/purchase_wms.pb.go @@ -82,7 +82,8 @@ 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"` + Source string `protobuf:"bytes,3,opt,name=Source,proto3" json:"Source,omitempty"` //鏉ユ簮 + Product []*PurchaseProduct `protobuf:"bytes,4,rep,name=Product,proto3" json:"Product,omitempty"` } func (x *PurchaseToWmsRequest) Reset() { @@ -127,6 +128,13 @@ func (x *PurchaseToWmsRequest) GetSupplierName() string { if x != nil { return x.SupplierName + } + return "" +} + +func (x *PurchaseToWmsRequest) GetSource() string { + if x != nil { + return x.Source } return "" } @@ -791,111 +799,112 @@ 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, - 0x63, 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, 0x12, 0x1c, 0x0a, 0x09, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, - 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x57, 0x61, 0x72, 0x65, 0x68, - 0x6f, 0x75, 0x73, 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, + 0x96, 0x01, 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, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x07, + 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x18, 0x04, 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, 0x63, 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, 0x12, + 0x1c, 0x0a, 0x09, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 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, 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, 0x8a, 0x01, - 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, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 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, 0x22, 0x42, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x75, - 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x50, 0x75, 0x72, 0x63, - 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x0c, - 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x0a, 0x0e, - 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0c, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x72, 0x63, - 0x68, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x75, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x17, - 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x32, 0xad, 0x03, 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, + 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, 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, + 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, 0x8a, 0x01, 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, 0x12, 0x16, 0x0a, 0x06, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 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, 0x22, 0x00, 0x12, 0x46, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, - 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, - 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, - 0x66, 0x6f, 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, + 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, + 0x22, 0x42, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0f, 0x50, 0x75, + 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0f, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x0c, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, + 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x0a, 0x0e, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, + 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, + 0x0c, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, + 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x73, + 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, + 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x23, 0x0a, 0x05, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, + 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x32, 0xad, 0x03, 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, 0x12, 0x46, 0x0a, + 0x0f, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x12, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x50, + 0x75, 0x72, 0x63, 0x68, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x66, 0x6f, 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 ( diff --git a/proto/purchase_wms/server.go b/proto/purchase_wms/server.go index bdae0cd..9cf3096 100644 --- a/proto/purchase_wms/server.go +++ b/proto/purchase_wms/server.go @@ -23,6 +23,7 @@ operation.Number = strconv.FormatInt(time.Now().Unix(), 10) operation.Status = constvar.OperationStatus_Ready operation.CompanyName = req.SupplierName + operation.Source = req.Source warehouse, err := models.NewWarehouseSearch().First() if err != nil { return nil, err diff --git a/proto/supplier/client.go b/proto/supplier/client.go index be1c71f..d261344 100644 --- a/proto/supplier/client.go +++ b/proto/supplier/client.go @@ -1,27 +1,27 @@ package supplier -import ( - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - "wms/conf" - "wms/pkg/logx" -) - -var ( - SupplierConn *grpc.ClientConn -) - -func InitConn() { - var err error - SupplierConn, 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 CloseConn() { - if SupplierConn != nil { - SupplierConn.Close() - } -} +//import ( +// "google.golang.org/grpc" +// "google.golang.org/grpc/credentials/insecure" +// "wms/conf" +// "wms/pkg/logx" +//) +// +//var ( +// SupplierConn *grpc.ClientConn +//) +// +//func InitConn() { +// var err error +// SupplierConn, 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 CloseConn() { +// if SupplierConn != nil { +// SupplierConn.Close() +// } +//} diff --git a/request/operation.go b/request/operation.go index 6ab8a19..138d2d9 100644 --- a/request/operation.go +++ b/request/operation.go @@ -77,3 +77,8 @@ Number string `json:"number"` SourceNumber string `json:"sourceNumber"` } + +type OperationCondition struct { + PageInfo + Condition string `json:"condition"` +} diff --git a/request/product_request.go b/request/product_request.go index b484263..8402959 100644 --- a/request/product_request.go +++ b/request/product_request.go @@ -24,6 +24,7 @@ ToLocationId int `json:"toLocationId"` SourceNumber string `json:"sourceNumber"` //Unit string `json:"unit"` + Number string `json:"number"` } type QueryDisuseList struct { diff --git a/response/report_forms_response.go b/response/report_forms_response.go index 6585587..0aafe8e 100644 --- a/response/report_forms_response.go +++ b/response/report_forms_response.go @@ -34,10 +34,12 @@ FromLocationId int `json:"fromLocationId"` ToLocationId int `json:"toLocationId"` OperationId int `json:"operationId"` + OperationTypeName string `json:"operationTypeName"` //浣滀笟绫诲瀷鍚嶇О } type LocationForms struct { ProduceId string `json:"produceId"` //浜у搧id + LocationId int `json:"locationId"` //浣嶇疆id LocationName string `json:"locationName"` //浣嶇疆鍚嶇О ProductName string `json:"productName"` //浜у搧鍚嶇О ProductTypeName string `json:"productTypeName"` //浜у搧绫诲埆 diff --git a/router/router.go b/router/router.go index ae57b87..e7565eb 100644 --- a/router/router.go +++ b/router/router.go @@ -92,6 +92,7 @@ operationAPI.PUT("outputOperation/:id", operationController.OutputOperation) operationAPI.GET("getSupplierList", operationController.GetSupplierList) operationAPI.GET("getClientList", operationController.GetClientList) + operationAPI.POST("listByCondition", operationController.ListByCondition) } diff --git a/utils/upload/seaweed.go b/utils/upload/seaweed.go index 931df16..40eea74 100644 --- a/utils/upload/seaweed.go +++ b/utils/upload/seaweed.go @@ -3,7 +3,6 @@ import ( "basic.com/fileserver/WeedFSClient.git" uuid "github.com/satori/go.uuid" - "strconv" "time" "wms/conf" "wms/pkg/logx" @@ -11,7 +10,7 @@ func UploadFileToSeaWeed(fileType, ext string, fileBytes []byte) (string, error) { //assignUrl := conf.WebConf.FileServer + "/dir/assign?collection=" + time.Now().Format("2006-01-02 15:04:05")[:10] + "-" + conf.WebConf.ServerId + "-" + fileType - assignUrl := conf.WebConf.FileServer + "/dir/assign?collection=" + strconv.FormatInt(time.Now().Unix(), 10) + "-" + conf.WebConf.ServerId + "-" + fileType + assignUrl := conf.WebConf.FileServer + "/dir/assign?collection=12345-" + conf.WebConf.ServerId + "-" + fileType picUrl, err := WeedFSClient.GetFid(assignUrl) if err != nil { -- Gitblit v1.8.0