lizhe 4 年之前
父節點
當前提交
404be18a83

+ 51 - 50
api/internal/logic/createorderlogic.go

@@ -27,56 +27,57 @@ func NewCreateOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) Create
 func (l *CreateOrderLogic) CreateOrder(req types.Request) (*types.Response, error) {
 	// todo: add your logic here and delete this line
 	result := &types.Response{}
-	resp, err :=l.svcCtx.JyOrder.CreateOrder(l.ctx,&jyOrder.Request{
-		PayMoney:req.Pay_money,
-		OrderMoney:req.Order_money,
-		UserNickname:req.User_nickname,
-		PayTime:req.Pay_time,
-		OrderStatus:req.Order_status,
-		CreateTime:req.Create_time,
-		UserOpenid:req.User_openid,
-		ServiceStatus:req.Service_status,
-		Filter:req.Filter,
-		PrepayId:req.Prepay_id,
-		CodeUrl:req.Code_url,
-		OutTradeNo:req.Out_trade_no,
-		FilterKeys:req.Filter_keys,
-		FilterPublishtime:req.Filter_publishtime,
-		DataCount:req.Data_count,
-		UserMail:req.User_mail,
-		DataSpec:req.Data_spec,
-		OriginalPrice:req.Original_price,
-		OrderCode:req.Order_code,
-		PrepayTime:req.Prepay_time,
-		ProductType:req.Product_type,
-		FilterId:req.Filter_id,
-		PayWay:req.Pay_way,
-		UserPhone:req.User_phone,
-		ApplybillStatus:req.Applybill_status,
-		DownloadUrl:req.Download_url,
-		ApplybillType:req.Applybill_type,
-		ApplybillTaxnum:req.Applybill_taxnum,
-		RemindStatus:req.Remind_status,
-		ApplybillCompany:req.Applybill_company,
-		UserId:req.User_id,
-		VipStarttime:req.Vip_starttime,
-		VipEndtime:req.Vip_endtime,
-		VipType:req.Vip_type,
-		CourseStatus:req.Course_status,
-		ApplyRefundName:req.Apply_refund_name,
-		ApplyRefundReason:req.Apply_refund_reason,
-		ApplyRefundTime:req.Apply_refund_time,
-		DelStatus:req.Del_status,
-		DelTime:req.Del_time,
-		DisWord:req.Dis_word,
-		DiscountPrice:req.Discount_price,
-		DRelationId:req.D_relation_id,
-		ReturnStatus:req.Return_status,
-		RefundStatus:req.Refund_status,
-		IsBackstageOrder:req.Is_backstage_order,
-		Salesperson:req.Salesperson,
-		CompanyName:req.Company_name,
-		BillingMode: req.BillingMode,
+	resp, err := l.svcCtx.JyOrder.CreateOrder(l.ctx, &jyOrder.Request{
+		PayMoney:          req.Pay_money,
+		OrderMoney:        req.Order_money,
+		UserNickname:      req.User_nickname,
+		PayTime:           req.Pay_time,
+		OrderStatus:       req.Order_status,
+		CreateTime:        req.Create_time,
+		UserOpenid:        req.User_openid,
+		ServiceStatus:     req.Service_status,
+		Filter:            req.Filter,
+		PrepayId:          req.Prepay_id,
+		CodeUrl:           req.Code_url,
+		OutTradeNo:        req.Out_trade_no,
+		FilterKeys:        req.Filter_keys,
+		FilterPublishtime: req.Filter_publishtime,
+		DataCount:         req.Data_count,
+		UserMail:          req.User_mail,
+		DataSpec:          req.Data_spec,
+		OriginalPrice:     req.Original_price,
+		OrderCode:         req.Order_code,
+		PrepayTime:        req.Prepay_time,
+		ProductType:       req.Product_type,
+		FilterId:          req.Filter_id,
+		PayWay:            req.Pay_way,
+		UserPhone:         req.User_phone,
+		ApplybillStatus:   req.Applybill_status,
+		DownloadUrl:       req.Download_url,
+		ApplybillType:     req.Applybill_type,
+		ApplybillTaxnum:   req.Applybill_taxnum,
+		RemindStatus:      req.Remind_status,
+		ApplybillCompany:  req.Applybill_company,
+		UserId:            req.User_id,
+		VipStarttime:      req.Vip_starttime,
+		VipEndtime:        req.Vip_endtime,
+		VipType:           req.Vip_type,
+		CourseStatus:      req.Course_status,
+		ApplyRefundName:   req.Apply_refund_name,
+		ApplyRefundReason: req.Apply_refund_reason,
+		ApplyRefundTime:   req.Apply_refund_time,
+		DelStatus:         req.Del_status,
+		DelTime:           req.Del_time,
+		DisWord:           req.Dis_word,
+		DiscountPrice:     req.Discount_price,
+		DRelationId:       req.D_relation_id,
+		ReturnStatus:      req.Return_status,
+		RefundStatus:      req.Refund_status,
+		IsBackstageOrder:  req.Is_backstage_order,
+		Salesperson:       req.Salesperson,
+		CompanyName:       req.Company_name,
+		BillingMode:       req.BillingMode,
+		SaleTime:          req.Sale_time,
 		/*PaymentType:req.Payment_type,
 		SourceOrderId: req.Source_order_id,*/
 	})

+ 1 - 0
api/internal/types/types.go

@@ -52,6 +52,7 @@ type Request struct {
 	Salesperson         string `form:"salesperson,optional"`
 	Company_name        string `form:"company_name,optional"`
 	BillingMode         int64  `form:"billingMode,optional"`
+	Sale_time           string `form:"sale_time,optional"`
 }
 
 type Response struct {

+ 1 - 0
api/jyOrder.api

@@ -59,6 +59,7 @@ type request {
 	Salesperson         string `form:"salesperson,optional"`
 	Company_name        string `form:"company_name,optional"`
 	BillingMode         int64  `form:"billingMode,optional"`
+	Sale_time           string `form:"sale_time,optional"`
 }
 
 type response {

+ 1 - 0
entity/order.go

@@ -58,6 +58,7 @@ type Order struct {
 	Salesperson        string    `xorm:"salesperson" form:"salesperson" json:"salesperson"`
 	Company_name       string    `xorm:"company_name" form:"company_name" json:"company_name"`
 	BillingMode        int64     `xorm:"billingMode" form:"billingMode" json:"billingMode"`
+	Sale_time           string `xorm:"sale_time" form:"sale_time" json:"sale_time"` //销售时间
 	/*Payment_type       int64  `xorm:"payment_type" form:"payment_type" json:"payment_type"`
 	Source_order_id    int64  `xorm:"source_order_id" form:"source_order_id" json:"source_order_id"`*/
 }

+ 1 - 1
rpc/etc/jyorder.yaml

@@ -4,7 +4,7 @@ Etcd:
   Hosts:
   - 127.0.0.1:2379
   Key: jyorder.rpc
-DataSource: root:root@tcp(127.0.0.1:3306)/jianyu?charset=utf8mb4&parseTime=true&loc=Local
+DataSource: root:Topnet123@tcp(192.168.3.11:3366)/jianyu?charset=utf8mb4&parseTime=true&loc=Local
 FileSystemConf:
   Etcd:
     Hosts:

+ 1 - 0
rpc/jyOrder.proto

@@ -53,6 +53,7 @@ message Request {
   string salesperson = 48;
   string company_name = 49;
   int64  billingMode = 50;
+  string sale_time = 51;
 }
 
 message Response {

+ 35 - 25
rpc/jyOrder/jyOrder.pb.go

@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // 	protoc-gen-go v1.25.0
-// 	protoc        v3.15.3
+// 	protoc        v3.15.1
 // source: jyOrder.proto
 
 package jyOrder
@@ -84,6 +84,7 @@ type Request struct {
 	Salesperson       string `protobuf:"bytes,48,opt,name=salesperson,proto3" json:"salesperson,omitempty"`
 	CompanyName       string `protobuf:"bytes,49,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"`
 	BillingMode       int64  `protobuf:"varint,50,opt,name=billingMode,proto3" json:"billingMode,omitempty"`
+	SaleTime          string `protobuf:"bytes,51,opt,name=sale_time,json=saleTime,proto3" json:"sale_time,omitempty"`
 }
 
 func (x *Request) Reset() {
@@ -468,6 +469,13 @@ func (x *Request) GetBillingMode() int64 {
 	return 0
 }
 
+func (x *Request) GetSaleTime() string {
+	if x != nil {
+		return x.SaleTime
+	}
+	return ""
+}
+
 type Response struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -606,7 +614,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, 0x12,
-	0x07, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0xc8, 0x0d, 0x0a, 0x07, 0x52, 0x65, 0x71,
+	0x07, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0xe5, 0x0d, 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,
@@ -715,29 +723,31 @@ var file_jyOrder_proto_rawDesc = []byte{
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x4e, 0x61, 0x6d,
 	0x65, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x4d, 0x6f, 0x64, 0x65,
 	0x18, 0x32, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x4d,
-	0x6f, 0x64, 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, 0x81, 0x01, 0x0a, 0x07, 0x4a,
-	0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
-	0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x10, 0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e,
-	0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65,
-	0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x13, 0x43, 0x72,
-	0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65,
-	0x64, 0x12, 0x18, 0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75,
-	0x65, 0x73, 0x74, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x11, 0x2e, 0x6a, 0x79,
-	0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x6f, 0x64, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x73, 0x61, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65,
+	0x18, 0x33, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x73, 0x61, 0x6c, 0x65, 0x54, 0x69, 0x6d, 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, 0x81, 0x01, 0x0a, 0x07, 0x4a, 0x79, 0x4f, 0x72,
+	0x64, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4f, 0x72, 0x64,
+	0x65, 0x72, 0x12, 0x10, 0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71,
+	0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x52,
+	0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74,
+	0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x18,
+	0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x1a, 0x11, 0x2e, 0x6a, 0x79, 0x4f, 0x72, 0x64,
+	0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x33,
 }
 
 var (

+ 1 - 1
rpc/jyorderclient/jyorder.go

@@ -14,9 +14,9 @@ import (
 )
 
 type (
+	Request         = jyOrder.Request
 	Response        = jyOrder.Response
 	RequestDetailed = jyOrder.RequestDetailed
-	Request         = jyOrder.Request
 
 	JyOrder interface {
 		// 创建订单

+ 7 - 2
service/orderService.go

@@ -58,16 +58,21 @@ func (s OrderService) CreateOrder(in *jyOrder.Request) (int64, string, int64) {
 	order.Salesperson = in.Salesperson
 	order.Company_name = in.CompanyName
 	order.BillingMode = in.BillingMode
+	//if in.SaleTime == "" {
+		order.Sale_time = in.SaleTime
+	//}
 	/*order.Payment_type = in.PaymentType
 	order.Source_order_id = in.SourceOrderId*/
+
 	numb, err := orm.Table("dataexport_order").Insert(order)
+	log.Println(numb, err)
 	if err != nil || numb == int64(0) {
 		log.Panicln("创建订单失败:", err)
 		orm.Rollback()
 		return entity.ErrorCode, "创建订单失败", entity.ErrorCode
 	}
 	orm.Commit()
-	return entity.SuccessCode,"创建订单成功",order.Id
+	return entity.SuccessCode, "创建订单成功", order.Id
 }
 
 func (s OrderService) CreateOrderDetailed(in *jyOrder.RequestDetailed) (int64, string, int64) {
@@ -89,5 +94,5 @@ func (s OrderService) CreateOrderDetailed(in *jyOrder.RequestDetailed) (int64, s
 		return entity.ErrorCode, "创建订单明细失败", entity.ErrorCode
 	}
 	orm.Commit()
-	return entity.SuccessCode,"创建订单明细成功",orderDetailed.Id
+	return entity.SuccessCode, "创建订单明细成功", orderDetailed.Id
 }