作者 tangxuhui

调试

@@ -14,9 +14,8 @@ type CreateDividendsReturnedOrderCommand struct { @@ -14,9 +14,8 @@ type CreateDividendsReturnedOrderCommand struct {
14 //货品 14 //货品
15 OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"` 15 OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"`
16 16
17 - DividendsReturnedDate int `json:"dividendsReturnedDate"` //退货日期  
18 - OrderDate int `json:"orderDate"` //订单日期  
19 -  
20 - Remarks string `json:"remarks"` //  
21 - RegionName string `json:"regionName"` 17 + DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
  18 + OrderDate int64 `json:"orderDate"` //订单日期
  19 + Remarks string `json:"remarks"` //
  20 + RegionName string `json:"regionName"`
22 } 21 }
@@ -7,6 +7,17 @@ import ( @@ -7,6 +7,17 @@ import (
7 7
8 type UpdateDividendsReturnedOrderCommand struct { 8 type UpdateDividendsReturnedOrderCommand struct {
9 //操作人 9 //操作人
10 - Operator domain.Operator `json:"-"`  
11 - allied_creation_cooperation.ReqDividendsReturnedOrderUpdate 10 + Operator domain.Operator `json:"-"`
  11 + DividendsReturnedOrderID int `json:"dividendsReturnedOrderId,string"` //分红退货单记录id
  12 + DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户
  13 + DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
  14 + OriginalOrderNum string `json:"originalOrderNum"` //源单号
  15 + //货品
  16 + OrderGoods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"orderGoods"`
  17 +
  18 + DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
  19 + OrderDate int64 `json:"orderDate"` //订单日期
  20 +
  21 + Remarks string `json:"remarks"` //
  22 + RegionName string `json:"regionName"`
12 } 23 }
@@ -2,6 +2,7 @@ package service @@ -2,6 +2,7 @@ package service
2 2
3 import ( 3 import (
4 "strconv" 4 "strconv"
  5 + "time"
5 6
6 "github.com/linmadan/egglib-go/core/application" 7 "github.com/linmadan/egglib-go/core/application"
7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
@@ -16,23 +17,24 @@ type DividendsReturnedOrderService struct { @@ -16,23 +17,24 @@ type DividendsReturnedOrderService struct {
16 17
17 // 创建分红退货单服务 18 // 创建分红退货单服务
18 func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) { 19 func (dividendsReturnedOrderService *DividendsReturnedOrderService) CreateDividendsReturnedOrder(createDividendsReturnedOrderCommand *command.CreateDividendsReturnedOrderCommand) (interface{}, error) {
19 -  
20 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator) 20 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createDividendsReturnedOrderCommand.Operator)
21 - _, err := creationCooperationGateway.DividendsReturnedOrderAdd(allied_creation_cooperation.ReqDividendsReturnedOrderAdd{  
22 - // DividendsReturnedCustomerName:createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,  
23 - // DividendsOrderAmount :a  
24 - // DividendsOrderNumber  
25 - // DividendsReturnedOrderNumber  
26 - // OriginalOrderNum  
27 - // OrderGoods  
28 - // DividendsReturnedDate  
29 - // Remarks  
30 - // RegionName 21 + dividendsReturnedDate := time.Unix(createDividendsReturnedOrderCommand.DividendsReturnedDate, 0)
  22 + orderDate := time.Unix(createDividendsReturnedOrderCommand.OrderDate, 0)
  23 + result, err := creationCooperationGateway.DividendsReturnedOrderAdd(allied_creation_cooperation.ReqDividendsReturnedOrderAdd{
  24 + DividendsReturnedCustomerName: createDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
  25 + DividendsOrderNumber: createDividendsReturnedOrderCommand.DividendsOrderNumber,
  26 + OriginalOrderNum: createDividendsReturnedOrderCommand.OriginalOrderNum,
  27 + OrderGoods: createDividendsReturnedOrderCommand.OrderGoods,
  28 + DividendsReturnedDate: dividendsReturnedDate,
  29 + OrderData: orderDate,
  30 + OrgId: int(createDividendsReturnedOrderCommand.Operator.OrgId),
  31 + Remarks: createDividendsReturnedOrderCommand.Remarks,
  32 + RegionName: createDividendsReturnedOrderCommand.RegionName,
31 }) 33 })
32 if err != nil { 34 if err != nil {
33 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 35 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
34 } 36 }
35 - return createDividendsReturnedOrderCommand, nil 37 + return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil
36 } 38 }
37 39
38 // 返回分红退货单服务 40 // 返回分红退货单服务
@@ -87,7 +89,20 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide @@ -87,7 +89,20 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
87 // 更新分红退货单服务 89 // 更新分红退货单服务
88 func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) { 90 func (dividendsReturnedOrderService *DividendsReturnedOrderService) UpdateDividendsReturnedOrder(updateDividendsReturnedOrderCommand *command.UpdateDividendsReturnedOrderCommand) (interface{}, error) {
89 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator) 91 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(updateDividendsReturnedOrderCommand.Operator)
90 - _, err := creationCooperationGateway.DividendsReturnedOrderUpdate(updateDividendsReturnedOrderCommand.ReqDividendsReturnedOrderUpdate) 92 + dividendsReturnedDate := time.Unix(updateDividendsReturnedOrderCommand.DividendsReturnedDate, 0)
  93 + orderDate := time.Unix(updateDividendsReturnedOrderCommand.OrderDate, 0)
  94 + _, err := creationCooperationGateway.DividendsReturnedOrderUpdate(allied_creation_cooperation.ReqDividendsReturnedOrderUpdate{
  95 + DividendsReturnedOrderID: updateDividendsReturnedOrderCommand.DividendsReturnedOrderID,
  96 + DividendsReturnedCustomerName: updateDividendsReturnedOrderCommand.DividendsReturnedCustomerName,
  97 + DividendsOrderNumber: updateDividendsReturnedOrderCommand.DividendsOrderNumber,
  98 + OriginalOrderNum: updateDividendsReturnedOrderCommand.OriginalOrderNum,
  99 + OrderGoods: updateDividendsReturnedOrderCommand.OrderGoods,
  100 + DividendsReturnedDate: dividendsReturnedDate,
  101 + OrderData: orderDate,
  102 + OrgId: int(updateDividendsReturnedOrderCommand.Operator.OrgId),
  103 + Remarks: updateDividendsReturnedOrderCommand.Remarks,
  104 + RegionName: updateDividendsReturnedOrderCommand.RegionName,
  105 + })
91 if err != nil { 106 if err != nil {
92 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 107 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
93 } 108 }
@@ -53,6 +53,8 @@ type DividendsOrder struct { @@ -53,6 +53,8 @@ type DividendsOrder struct {
53 type ( 53 type (
54 //订单产品 54 //订单产品
55 DividendsOrderGoods struct { 55 DividendsOrderGoods struct {
  56 + // 订单产品
  57 + OrderGoodId int64 `json:"orderGoodId,string"`
56 CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号 58 CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
57 DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号 59 DividendsOrderNumber string `json:"dividendsOrderNumber"` //关联分红订单号
58 OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额 60 OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
@@ -60,6 +62,7 @@ type ( @@ -60,6 +62,7 @@ type (
60 OrderGoodName string `json:"orderGoodName"` //订单产品名称 62 OrderGoodName string `json:"orderGoodName"` //订单产品名称
61 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价 63 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
62 OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量 64 OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
  65 + OrderGoodDividendsStatus int32 `json:"OrderGoodDividendsStatus"` // 订单产品分红状态, 1待分红,2已分红
63 } 66 }
64 ReqDividendsOrderAdd struct { 67 ReqDividendsOrderAdd struct {
65 CompanyId int `json:"companyId,string"` 68 CompanyId int `json:"companyId,string"`
@@ -5,11 +5,13 @@ import "time" @@ -5,11 +5,13 @@ import "time"
5 //创建分红退货单 5 //创建分红退货单
6 type ( 6 type (
7 DividendsReturnedOrderGoods struct { 7 DividendsReturnedOrderGoods struct {
  8 + OrderGoodId int64 `json:"orderGoodId,string"` // 订单产品id
8 CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号 9 CooperationContractNumber string `json:"cooperationContractNumber"` //关联的共创合约编号
9 OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额 10 OrderGoodAmount float64 `json:"orderGoodAmount"` //订单产品金额
10 OrderGoodName string `json:"orderGoodName"` //订单产品名称 11 OrderGoodName string `json:"orderGoodName"` //订单产品名称
11 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价 12 OrderGoodPrice float64 `json:"orderGoodPrice"` //订单产品单价
12 OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量 13 OrderGoodQuantity int `json:"orderGoodQuantity"` //订单产品数量
  14 +
13 } 15 }
14 16
15 DividendsReturnedOrder struct { 17 DividendsReturnedOrder struct {
@@ -48,36 +50,37 @@ type ( @@ -48,36 +50,37 @@ type (
48 ReqDividendsReturnedOrderAdd struct { 50 ReqDividendsReturnedOrderAdd struct {
49 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` 51 DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
50 DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号 52 DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
51 - DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"`  
52 OriginalOrderNum string `json:"originalOrderNum"` 53 OriginalOrderNum string `json:"originalOrderNum"`
53 OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"` 54 OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
54 - DividendsReturnedDate time.Time `json:"orderTime"` 55 + DividendsReturnedDate time.Time `json:"dividendsReturnedDate"`
  56 + OrderData time.Time `json:"orderData"`
55 OrgId int `json:"orgId"` 57 OrgId int `json:"orgId"`
56 Remarks string `json:"remarks"` 58 Remarks string `json:"remarks"`
57 RegionName string `json:"regionName"` 59 RegionName string `json:"regionName"`
58 } 60 }
59 61
60 DataDividendsReturnedOrderAdd struct { 62 DataDividendsReturnedOrderAdd struct {
  63 + DividendsReturnedOrder
61 } 64 }
62 ) 65 )
63 66
64 //更新分红退货单 67 //更新分红退货单
65 type ( 68 type (
66 ReqDividendsReturnedOrderUpdate struct { 69 ReqDividendsReturnedOrderUpdate struct {
67 - DividendsReturnedOrderID int `json:"dividendsReturnedOrderId"` //分红退货单记录id  
68 - CustomerName string `json:"customerName"`  
69 - DividendsOrderAmount string `json:"dividendsOrderAmount"`  
70 - DividendsOrderNumber string `json:"dividendsOrderNumber"`  
71 - DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"`  
72 - OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`  
73 - OrderTime time.Time `json:"orderTime"`  
74 - OrgId int `json:"orgId"`  
75 - Remarks string `json:"remarks"`  
76 - SalesmanUid string `json:"salesmanUid"`  
77 - RegionName string `json:"regionName"` 70 + DividendsReturnedOrderID int `json:"dividendsReturnedOrderId,string"` //分红退货单记录id
  71 + DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"`
  72 + DividendsOrderNumber string `json:"dividendsOrderNumber"` //分红单号
  73 + OriginalOrderNum string `json:"originalOrderNum"`
  74 + OrderGoods []DividendsReturnedOrderGoods `json:"orderGoods"`
  75 + DividendsReturnedDate time.Time `json:"orderTime"`
  76 + OrderData time.Time `json:"orderData"`
  77 + OrgId int `json:"orgId"`
  78 + Remarks string `json:"remarks"`
  79 + RegionName string `json:"regionName"`
78 } 80 }
79 81
80 DataDividendsReturnedOrderUpdate struct { 82 DataDividendsReturnedOrderUpdate struct {
  83 + DividendsReturnedOrder
81 } 84 }
82 ) 85 )
83 86