作者 tangxuhui

合约 请求入参数据结构修正

@@ -10,6 +10,8 @@ import ( @@ -10,6 +10,8 @@ import (
10 type CreateCooperationContractCommand struct { 10 type CreateCooperationContractCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + //合约
  14 + CooperationContract struct {
13 // 共创合约描述 15 // 共创合约描述
14 CooperationContractDescription string `json:"cooperationContractDescription"` 16 CooperationContractDescription string `json:"cooperationContractDescription"`
15 // 共创合约编号 17 // 共创合约编号
@@ -26,6 +28,7 @@ type CreateCooperationContractCommand struct { @@ -26,6 +28,7 @@ type CreateCooperationContractCommand struct {
26 CooperationModeNumber string `json:"cooperationModeNumber"` 28 CooperationModeNumber string `json:"cooperationModeNumber"`
27 // 共创合约发起人uid 29 // 共创合约发起人uid
28 SponsorUid string `json:"sponsorUid"` 30 SponsorUid string `json:"sponsorUid"`
  31 + } `json:"cooperationContract"`
29 // 业绩分红激励规则列表 32 // 业绩分红激励规则列表
30 DividendsIncentivesRules []struct { 33 DividendsIncentivesRules []struct {
31 // 关联的项目合约编号 34 // 关联的项目合约编号
@@ -37,7 +40,7 @@ type CreateCooperationContractCommand struct { @@ -37,7 +40,7 @@ type CreateCooperationContractCommand struct {
37 // 分红规则激励百分点 40 // 分红规则激励百分点
38 DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` 41 DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
39 // 分红规则激励阶段, 42 // 分红规则激励阶段,
40 - DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"` 43 + DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
41 // 分红规则激励阶段结束 44 // 分红规则激励阶段结束
42 DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"` 45 DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
43 // 分红规则激励阶段开始 46 // 分红规则激励阶段开始
@@ -46,7 +49,7 @@ type CreateCooperationContractCommand struct { @@ -46,7 +49,7 @@ type CreateCooperationContractCommand struct {
46 // 金额激励规则列表 49 // 金额激励规则列表
47 MoneyIncentivesRules []struct { 50 MoneyIncentivesRules []struct {
48 // 金额激励规则ID 51 // 金额激励规则ID
49 - MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"` 52 + MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
50 // 关联的共创合约编号 53 // 关联的共创合约编号
51 CooperationContractNumber string `json:"cooperationContractNumber"` 54 CooperationContractNumber string `json:"cooperationContractNumber"`
52 // 激励金额 55 // 激励金额
@@ -10,6 +10,7 @@ import ( @@ -10,6 +10,7 @@ import (
10 type UpdateCooperationContractCommand struct { 10 type UpdateCooperationContractCommand struct {
11 //操作人 11 //操作人
12 Operator domain.Operator `json:"-"` 12 Operator domain.Operator `json:"-"`
  13 + CooperationContract struct {
13 CooperationContractId int `json:"cooperationContractId"` 14 CooperationContractId int `json:"cooperationContractId"`
14 // 共创合约描述 15 // 共创合约描述
15 CooperationContractDescription string `json:"cooperationContractDescription"` 16 CooperationContractDescription string `json:"cooperationContractDescription"`
@@ -27,6 +28,7 @@ type UpdateCooperationContractCommand struct { @@ -27,6 +28,7 @@ type UpdateCooperationContractCommand struct {
27 CooperationModeNumber string `json:"cooperationModeNumber"` 28 CooperationModeNumber string `json:"cooperationModeNumber"`
28 // 共创合约发起人uid 29 // 共创合约发起人uid
29 SponsorUid string `json:"sponsorUid"` 30 SponsorUid string `json:"sponsorUid"`
  31 + } `json:"cooperationContract"`
30 // 业绩分红激励规则列表 32 // 业绩分红激励规则列表
31 DividendsIncentivesRules []struct { 33 DividendsIncentivesRules []struct {
32 // 关联的项目合约编号 34 // 关联的项目合约编号
@@ -38,7 +40,7 @@ type UpdateCooperationContractCommand struct { @@ -38,7 +40,7 @@ type UpdateCooperationContractCommand struct {
38 // 分红规则激励百分点 40 // 分红规则激励百分点
39 DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` 41 DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
40 // 分红规则激励阶段, 42 // 分红规则激励阶段,
41 - DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"` 43 + DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
42 // 分红规则激励阶段结束 44 // 分红规则激励阶段结束
43 DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"` 45 DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
44 // 分红规则激励阶段开始 46 // 分红规则激励阶段开始
@@ -47,7 +49,7 @@ type UpdateCooperationContractCommand struct { @@ -47,7 +49,7 @@ type UpdateCooperationContractCommand struct {
47 // 金额激励规则列表 49 // 金额激励规则列表
48 MoneyIncentivesRules []struct { 50 MoneyIncentivesRules []struct {
49 // 金额激励规则ID 51 // 金额激励规则ID
50 - MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"` 52 + MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
51 // 关联的共创合约编号 53 // 关联的共创合约编号
52 CooperationContractNumber string `json:"cooperationContractNumber"` 54 CooperationContractNumber string `json:"cooperationContractNumber"`
53 // 激励金额 55 // 激励金额
@@ -61,14 +61,14 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC @@ -61,14 +61,14 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
61 DividendsIncentivesRules: rules1, 61 DividendsIncentivesRules: rules1,
62 Undertakers: underTakers, 62 Undertakers: underTakers,
63 RelevantIds: createCooperationContractCommand.RelevantIds, 63 RelevantIds: createCooperationContractCommand.RelevantIds,
64 - CooperationContractDescription: createCooperationContractCommand.CooperationContractDescription,  
65 - CooperationContractNumber: createCooperationContractCommand.CooperationContractNumber,  
66 - CooperationProjectNumber: createCooperationContractCommand.CooperationProjectNumber,  
67 - DepartmentId: createCooperationContractCommand.DepartmentId,  
68 - CooperationContractUndertakerType: createCooperationContractCommand.CooperationContractUndertakerType,  
69 - CooperationContractName: createCooperationContractCommand.CooperationContractName,  
70 - CooperationModeNumber: createCooperationContractCommand.CooperationModeNumber,  
71 - SponsorUid: createCooperationContractCommand.SponsorUid, 64 + CooperationContractDescription: createCooperationContractCommand.CooperationContract.CooperationContractDescription,
  65 + CooperationContractNumber: createCooperationContractCommand.CooperationContract.CooperationContractNumber,
  66 + CooperationProjectNumber: createCooperationContractCommand.CooperationContract.CooperationProjectNumber,
  67 + DepartmentId: createCooperationContractCommand.CooperationContract.DepartmentId,
  68 + CooperationContractUndertakerType: createCooperationContractCommand.CooperationContract.CooperationContractUndertakerType,
  69 + CooperationContractName: createCooperationContractCommand.CooperationContract.CooperationContractName,
  70 + CooperationModeNumber: createCooperationContractCommand.CooperationContract.CooperationModeNumber,
  71 + SponsorUid: createCooperationContractCommand.CooperationContract.SponsorUid,
72 }) 72 })
73 if err != nil { 73 if err != nil {
74 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 74 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
@@ -167,19 +167,19 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC @@ -167,19 +167,19 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
167 underTakers = append(underTakers, u) 167 underTakers = append(underTakers, u)
168 } 168 }
169 _, err := creationCooperationGateway.CooperationContractUpdate(allied_creation_cooperation.ReqCooperationContractUpdate{ 169 _, err := creationCooperationGateway.CooperationContractUpdate(allied_creation_cooperation.ReqCooperationContractUpdate{
170 - CooperationContractId: updateCooperationContractCommand.CooperationContractId, 170 + CooperationContractId: updateCooperationContractCommand.CooperationContract.CooperationContractId,
171 MoneyIncentivesRules: rules2, 171 MoneyIncentivesRules: rules2,
172 DividendsIncentivesRules: rules1, 172 DividendsIncentivesRules: rules1,
173 Undertakers: underTakers, 173 Undertakers: underTakers,
174 RelevantIds: updateCooperationContractCommand.RelevantIds, 174 RelevantIds: updateCooperationContractCommand.RelevantIds,
175 - CooperationContractDescription: updateCooperationContractCommand.CooperationContractDescription,  
176 - CooperationContractNumber: updateCooperationContractCommand.CooperationContractNumber,  
177 - CooperationProjectNumber: updateCooperationContractCommand.CooperationProjectNumber,  
178 - DepartmentId: updateCooperationContractCommand.DepartmentId,  
179 - CooperationContractUndertakerType: updateCooperationContractCommand.CooperationContractUndertakerType,  
180 - CooperationContractName: updateCooperationContractCommand.CooperationContractName,  
181 - CooperationModeNumber: updateCooperationContractCommand.CooperationModeNumber,  
182 - SponsorUid: updateCooperationContractCommand.SponsorUid, 175 + CooperationContractDescription: updateCooperationContractCommand.CooperationContract.CooperationContractDescription,
  176 + CooperationContractNumber: updateCooperationContractCommand.CooperationContract.CooperationContractNumber,
  177 + CooperationProjectNumber: updateCooperationContractCommand.CooperationContract.CooperationProjectNumber,
  178 + DepartmentId: updateCooperationContractCommand.CooperationContract.DepartmentId,
  179 + CooperationContractUndertakerType: updateCooperationContractCommand.CooperationContract.CooperationContractUndertakerType,
  180 + CooperationContractName: updateCooperationContractCommand.CooperationContract.CooperationContractName,
  181 + CooperationModeNumber: updateCooperationContractCommand.CooperationContract.CooperationModeNumber,
  182 + SponsorUid: updateCooperationContractCommand.CooperationContract.SponsorUid,
183 }) 183 })
184 if err != nil { 184 if err != nil {
185 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 185 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())