作者 tangxuhui

更新

@@ -203,7 +203,6 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon @@ -203,7 +203,6 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
203 UndertakerTypesUncheckedAvailable: undertakerTypesUncheckedAvailable, 203 UndertakerTypesUncheckedAvailable: undertakerTypesUncheckedAvailable,
204 } 204 }
205 return &data 205 return &data
206 -  
207 } 206 }
208 207
209 type CooperationContractUndertake struct { 208 type CooperationContractUndertake struct {
@@ -10,11 +10,8 @@ import ( @@ -10,11 +10,8 @@ import (
10 //业绩分红 确定预算。。。 10 //业绩分红 确定预算。。。
11 type EstimateDividendsIncentivesCommand struct { 11 type EstimateDividendsIncentivesCommand struct {
12 //操作人 12 //操作人
13 - Operator domain.Operator `json:"-"`  
14 - // 分红订单号/退货单号  
15 - OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`  
16 - // 合约编号  
17 - CooperationContractNumber string `json:"cooperationContractNumber" ` 13 + Operator domain.Operator `json:"-"`
  14 + OrderGoodIds []string `json:"orderGoodIds"`
18 } 15 }
19 16
20 func (estimateDividendsIncentivesCommand *EstimateDividendsIncentivesCommand) Valid(validation *validation.Validation) { 17 func (estimateDividendsIncentivesCommand *EstimateDividendsIncentivesCommand) Valid(validation *validation.Validation) {
@@ -11,9 +11,9 @@ type EstimateMoneyIncentivesCommand struct { @@ -11,9 +11,9 @@ type EstimateMoneyIncentivesCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
13 // 共创项目合约编号 13 // 共创项目合约编号
14 - CooperationContractNumber string `json:"cooperationContractNumber" valid:"Required"` 14 + CooperationContractId string `json:"cooperationContractId" valid:"Required"`
15 // 承接人UID 15 // 承接人UID
16 - UndertakerUid string `json:"undertakerUid,omitempty"` 16 + UndertakerUids []string `json:"undertakerUids,omitempty"`
17 //分红阶段 17 //分红阶段
18 DividendsIncentivesStage int `json:"dividendsIncentivesStage"` 18 DividendsIncentivesStage int `json:"dividendsIncentivesStage"`
19 } 19 }
@@ -10,6 +10,7 @@ type MoneyIncentivesItem struct { @@ -10,6 +10,7 @@ type MoneyIncentivesItem struct {
10 10
11 //业绩分红列表 11 //业绩分红列表
12 type DividendsEstimateDividendItem struct { 12 type DividendsEstimateDividendItem struct {
  13 + OrderGoodId int `json:"orderGoodId,string"`
13 CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号 14 CooperationContractNumber string `json:"cooperationContractNumber"` //共创合约编号
14 CustomerName string `json:"customerName"` //客户名称 15 CustomerName string `json:"customerName"` //客户名称
15 DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额 16 DividendsIncentivesAmount float64 `json:"dividendsIncentivesAmount"` //业绩激励分红金额
@@ -23,6 +24,7 @@ func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDivi @@ -23,6 +24,7 @@ func ToDividendsEstimateDividendItem(param *allied_creation_cooperation.DataDivi
23 var listdata []DividendsEstimateDividendItem 24 var listdata []DividendsEstimateDividendItem
24 for _, v := range param.List { 25 for _, v := range param.List {
25 item := DividendsEstimateDividendItem{ 26 item := DividendsEstimateDividendItem{
  27 + OrderGoodId: v.OrderGoodId,
26 CooperationContractNumber: v.CooperationContractNumber, 28 CooperationContractNumber: v.CooperationContractNumber,
27 CustomerName: v.CustomerName, 29 CustomerName: v.CustomerName,
28 DividendsIncentivesAmount: v.OrderAmount, 30 DividendsIncentivesAmount: v.OrderAmount,
@@ -29,8 +29,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen @@ -29,8 +29,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen
29 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 29 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
30 estimateDividendsIncentivesCommand.Operator) 30 estimateDividendsIncentivesCommand.Operator)
31 _, err := creationCooperationGateway.DividendsEstimateDividendsIncentives(allied_creation_cooperation.ReqDividendsEstimateDividendsIncentives{ 31 _, err := creationCooperationGateway.DividendsEstimateDividendsIncentives(allied_creation_cooperation.ReqDividendsEstimateDividendsIncentives{
32 - CooperationContractNumber: estimateDividendsIncentivesCommand.CooperationContractNumber,  
33 - OrderOrReturnedOrderNum: estimateDividendsIncentivesCommand.OrderOrReturnedOrderNum, 32 + OrderGoodIds: estimateDividendsIncentivesCommand.OrderGoodIds,
34 }) 33 })
35 if err != nil { 34 if err != nil {
36 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 35 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -42,15 +41,15 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen @@ -42,15 +41,15 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen
42 func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentives(estimateMoneyIncentivesCommand *command.EstimateMoneyIncentivesCommand) (interface{}, error) { 41 func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentives(estimateMoneyIncentivesCommand *command.EstimateMoneyIncentivesCommand) (interface{}, error) {
43 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation( 42 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
44 estimateMoneyIncentivesCommand.Operator) 43 estimateMoneyIncentivesCommand.Operator)
45 - result, err := creationCooperationGateway.DividendsEstimatesEstimateMoneys(allied_creation_cooperation.ReqDividendsEstimateMoneyIncentives{  
46 - CooperationContractNumber: estimateMoneyIncentivesCommand.CooperationContractNumber,  
47 - DividendsIncentivesStage: estimateMoneyIncentivesCommand.DividendsIncentivesStage,  
48 - UndertakerUid: estimateMoneyIncentivesCommand.UndertakerUid, 44 + _, err := creationCooperationGateway.DividendsEstimatesEstimateMoneys(allied_creation_cooperation.ReqDividendsEstimateMoneyIncentives{
  45 + CooperationContractId: estimateMoneyIncentivesCommand.CooperationContractId,
  46 + DividendsIncentivesStage: estimateMoneyIncentivesCommand.DividendsIncentivesStage,
  47 + UndertakerUids: estimateMoneyIncentivesCommand.UndertakerUids,
49 }) 48 })
50 if err != nil { 49 if err != nil {
51 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 50 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
52 } 51 }
53 - return result, nil 52 + return estimateMoneyIncentivesCommand, nil
54 } 53 }
55 54
56 // 查询分红预算单列表 55 // 查询分红预算单列表
@@ -15,7 +15,7 @@ type ( @@ -15,7 +15,7 @@ type (
15 Total int `json:"total"` 15 Total int `json:"total"`
16 List []struct { 16 List []struct {
17 // 分红订单产品ID 17 // 分红订单产品ID
18 - OrderGoodId int64 `json:"orderGoodId,string"` 18 + OrderGoodId int `json:"orderGoodId,string"`
19 // 共创合约编号 19 // 共创合约编号
20 CooperationContractNumber string `json:"cooperationContractNumber"` 20 CooperationContractNumber string `json:"cooperationContractNumber"`
21 // 分红订单号或退货单号、 21 // 分红订单号或退货单号、
@@ -29,7 +29,7 @@ type ( @@ -29,7 +29,7 @@ type (
29 // 订单金额 29 // 订单金额
30 OrderAmount float64 `json:"orderAmount"` 30 OrderAmount float64 `json:"orderAmount"`
31 // 订单/退货单日期 31 // 订单/退货单日期
32 - OrderDate time.Time `json:"-"` //TODO 等待数据调整 32 + OrderDate time.Time `json:"orderData"`
33 } `json:"list"` 33 } `json:"list"`
34 } 34 }
35 ) 35 )
@@ -125,13 +125,15 @@ type ( @@ -125,13 +125,15 @@ type (
125 //确定预算金额激励分红 125 //确定预算金额激励分红
126 type ( 126 type (
127 ReqDividendsEstimateMoneyIncentives struct { 127 ReqDividendsEstimateMoneyIncentives struct {
128 - //合约编码  
129 - CooperationContractNumber string `json:"cooperationContractNumber"`  
130 - DividendsIncentivesStage int `json:"dividendsIncentivesStage"`  
131 - UndertakerUid string `json:"undertakerUid"` 128 + // 共创合约ID
  129 + CooperationContractId string `json:"cooperationContractId"` //cname:"共创合约ID"
  130 + // 分红阶段
  131 + DividendsIncentivesStage int `json:"dividendsIncentivesStage"` //cname:"分红阶段"
  132 + // 承接人UID
  133 + UndertakerUids []string `json:"undertakerUids"` //cname:"承接人UID列表"
132 } 134 }
133 135
134 - DataDividendsEstimateMoneyIncentives struct { 136 + DataDividendsEstimateMoneyIncentives []struct {
135 } 137 }
136 ) 138 )
137 139
@@ -184,10 +186,9 @@ type ( @@ -184,10 +186,9 @@ type (
184 //确定业绩分红激励 186 //确定业绩分红激励
185 type ( 187 type (
186 ReqDividendsEstimateDividendsIncentives struct { 188 ReqDividendsEstimateDividendsIncentives struct {
187 - CooperationContractNumber string `json:"cooperationContractNumber"`  
188 - OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` 189 + OrderGoodIds []string `json:"orderGoodIds"`
189 } 190 }
190 191
191 - DataDividendsEstimateDividendsIncentives struct { 192 + DataDividendsEstimateDividendsIncentives []struct {
192 } 193 }
193 ) 194 )