Browse Source

fix:创建&编辑订单新增付款人字段

duxin 8 months ago
parent
commit
3389e906fb

+ 1 - 0
api/internal/logic/createorderlogic.go

@@ -94,6 +94,7 @@ func (l *CreateOrderLogic) CreateOrder(req types.Request) (*types.Response, erro
 		SaleDep:           req.SaleDep,
 		SaleMoney:         req.SaleMoney,
 		ContractNature:    req.ContractNature,
+		PaymentUser:       req.PaymentUser,
 	})
 	if err != nil {
 		return nil, err

+ 1 - 0
api/internal/logic/updateorderlogic.go

@@ -93,6 +93,7 @@ func (l *UpdateOrderLogic) UpdateOrder(req types.Request) (*types.Response, erro
 		SaleDep:           req.SaleDep,
 		SaleMoney:         req.SaleMoney,
 		ContractNature:    req.ContractNature,
+		PaymentUser:       req.PaymentUser,
 	})
 	if err != nil {
 		return nil, err

+ 7 - 6
api/internal/types/types.go

@@ -69,12 +69,7 @@ type Request struct {
 	SaleDep             string `form:"saleDep,optional"`
 	SaleMoney           string `form:"saleMoney,optional"`
 	ContractNature      string `form:"contract_nature,optional"`
-}
-
-type Response struct {
-	Code    int64  `json:"code"`    //响应代码
-	Message string `json:"message"` //响应消息
-	Data    int64  `json:"data"`    //订单ID
+	PaymentUser         string `form:"payment_user,optional"`
 }
 
 type RequestDetailed struct {
@@ -83,3 +78,9 @@ type RequestDetailed struct {
 	Operator    string `form:"operator,optional"`
 	Sale_time   string `form:"sale_time,optional"`
 }
+
+type Response struct {
+	Code    int64  `json:"code"`    //响应代码
+	Message string `json:"message"` //响应消息
+	Data    int64  `json:"data"`    //订单ID
+}

+ 9 - 8
api/jyOrder.api

@@ -1,10 +1,10 @@
 syntax = "v1"
 
-info(
-	title: // TODO: add title
-	desc: // TODO: add description
+info (
+	title:  "订单管理模块" // TODO: add title
+	desc:   "订单创建与修改功能" // TODO: add description
 	author: "lizhe"
-	email: "lizhe@topnet.net.cn"
+	email:  "lizhe@topnet.net.cn"
 )
 
 type request {
@@ -76,13 +76,14 @@ type request {
 	SaleDep             string `form:"saleDep,optional"`
 	SaleMoney           string `form:"saleMoney,optional"`
 	ContractNature      string `form:"contract_nature,optional"`
+	PaymentUser         string `form:"payment_user,optional"`
 }
 
 type response {
 	// TODO: add members here and delete this comment
-	Code    int64  `json:"code"`    //响应代码
+	Code    int64  `json:"code"` //响应代码
 	Message string `json:"message"` //响应消息
-	Data    int64  `json:"data"`    //订单ID
+	Data    int64  `json:"data"` //订单ID
 }
 
 type requestDetailed {
@@ -95,10 +96,10 @@ type requestDetailed {
 service jyOrder-api {
 	@handler CreateOrderHandler // TODO: set handler name and delete this comment
 	post /CreateOrder (request) returns (response)
-	
+
 	@handler CreateOrderDetailedHandler // TODO: set handler name and delete this comment
 	post /CreateOrderDetailed (requestDetailed) returns (response)
-	
+
 	@handler UpdateOrderHandler // TODO: set handler name and delete this comment
 	post /UpdateOrder (request) returns (response)
 }

+ 1 - 0
rpc/jyOrder.proto

@@ -71,6 +71,7 @@ message Request {
   string saleDep = 66;
   string saleMoney = 67;
   string contract_nature = 68;
+  string paymentUser     = 69;
 }
 
 message Response {

+ 37 - 27
rpc/jyOrder/jyOrder.pb.go

@@ -1,6 +1,6 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.28.0
+// 	protoc-gen-go v1.28.1
 // 	protoc        v3.19.4
 // source: jyOrder.proto
 
@@ -92,6 +92,7 @@ type Request struct {
 	SaleDep           string `protobuf:"bytes,66,opt,name=saleDep,proto3" json:"saleDep,omitempty"`
 	SaleMoney         string `protobuf:"bytes,67,opt,name=saleMoney,proto3" json:"saleMoney,omitempty"`
 	ContractNature    string `protobuf:"bytes,68,opt,name=contract_nature,json=contractNature,proto3" json:"contract_nature,omitempty"`
+	PaymentUser       string `protobuf:"bytes,69,opt,name=paymentUser,proto3" json:"paymentUser,omitempty"`
 }
 
 func (x *Request) Reset() {
@@ -595,6 +596,13 @@ func (x *Request) GetContractNature() string {
 	return ""
 }
 
+func (x *Request) GetPaymentUser() string {
+	if x != nil {
+		return x.PaymentUser
+	}
+	return ""
+}
+
 type Response struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -733,7 +741,7 @@ var File_jyOrder_proto protoreflect.FileDescriptor
 
 var file_jyOrder_proto_rawDesc = []byte{
 	0x0a, 0x0d, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
-	0x9d, 0x12, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70,
+	0xbf, 0x12, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70,
 	0x61, 0x79, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08,
 	0x70, 0x61, 0x79, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x72, 0x64, 0x65,
 	0x72, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6f,
@@ -878,31 +886,33 @@ var file_jyOrder_proto_rawDesc = []byte{
 	0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x43, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6c,
 	0x65, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61,
 	0x63, 0x74, 0x5f, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x44, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22,
-	0x4c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63,
-	0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
-	0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x86, 0x01,
-	0x0a, 0x0f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65,
-	0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b,
-	0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1a, 0x0a,
-	0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x61, 0x6c,
-	0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x61,
-	0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x85, 0x01, 0x0a, 0x07, 0x4a, 0x79, 0x4f, 0x72, 0x64,
-	0x65, 0x72, 0x12, 0x22, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65,
-	0x72, 0x12, 0x08, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65,
-	0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
-	0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x10, 0x2e,
-	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a,
-	0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0b, 0x55, 0x70,
-	0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x08, 0x2e, 0x52, 0x65, 0x71, 0x75,
-	0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a,
-	0x5a, 0x08, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
-	0x6f, 0x33,
+	0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x4e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12,
+	0x20, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x18, 0x45,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65,
+	0x72, 0x22, 0x4c, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 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, 0x12, 0x0a, 0x04, 0x64,
+	0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
+	0x86, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69,
+	0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f,
+	0x0a, 0x0b, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12,
+	0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x73,
+	0x61, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x73, 0x61, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x32, 0x85, 0x01, 0x0a, 0x07, 0x4a, 0x79, 0x4f,
+	0x72, 0x64, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72,
+	0x64, 0x65, 0x72, 0x12, 0x08, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e,
+	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61,
+	0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12,
+	0x10, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65,
+	0x64, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x0b,
+	0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x08, 0x2e, 0x52, 0x65,
+	0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x09, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+	0x42, 0x0a, 0x5a, 0x08, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x62, 0x06, 0x70, 0x72,
+	0x6f, 0x74, 0x6f, 0x33,
 }
 
 var (

+ 4 - 0
service/orderService.go

@@ -70,6 +70,7 @@ func (s OrderService) CreateOrder(in *jyOrder.Request) (int64, string, int64) {
 	order["dis_word"] = in.DisWord
 	order["discount_price"] = in.DiscountPrice
 	order["d_relation_id"] = in.DRelationId
+	order["payment_user"] = in.PaymentUser
 	if in.OrderChannel == OrderChannelWX {
 		order["discount_price"] = in.OriginalPrice
 	}
@@ -183,6 +184,9 @@ func (s OrderService) UpdateOrder(in *jyOrder.Request) (int64, string) {
 	order["saleMoney"] = in.SaleMoney
 	order["pay_way"] = in.PayWay
 	order["contract_nature"] = in.ContractNature
+	if in.PaymentUser != "" {
+		order["payment_user"] = in.PaymentUser
+	}
 	if in.OrderChannel == "d03" {
 		delete(order, "return_status")
 	}