作者 tangxuhui

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

... ... @@ -10,22 +10,25 @@ import (
type CreateCooperationContractCommand struct {
//操作人
Operator domain.Operator `json:"-"`
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门id
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
//合约
CooperationContract struct {
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门id
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
... ... @@ -37,7 +40,7 @@ type CreateCooperationContractCommand struct {
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
... ... @@ -46,7 +49,7 @@ type CreateCooperationContractCommand struct {
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
... ...
... ... @@ -9,24 +9,26 @@ import (
type UpdateCooperationContractCommand struct {
//操作人
Operator domain.Operator `json:"-"`
CooperationContractId int `json:"cooperationContractId"`
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门id
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
Operator domain.Operator `json:"-"`
CooperationContract struct {
CooperationContractId int `json:"cooperationContractId"`
// 共创合约描述
CooperationContractDescription string `json:"cooperationContractDescription"`
// 共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 共创项目编号,
CooperationProjectNumber string `json:"cooperationProjectNumber"`
// 共创合约发起部门id
DepartmentId string `json:"departmentId"`
// 共创合约承接对象,1员工,2共创用户,3公开
CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
// 共创合约名称
CooperationContractName string `json:"cooperationContractName"`
// 共创模式编码,
CooperationModeNumber string `json:"cooperationModeNumber"`
// 共创合约发起人uid
SponsorUid string `json:"sponsorUid"`
} `json:"cooperationContract"`
// 业绩分红激励规则列表
DividendsIncentivesRules []struct {
// 关联的项目合约编号
... ... @@ -38,7 +40,7 @@ type UpdateCooperationContractCommand struct {
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
... ... @@ -47,7 +49,7 @@ type UpdateCooperationContractCommand struct {
// 金额激励规则列表
MoneyIncentivesRules []struct {
// 金额激励规则ID
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`
MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`
// 关联的共创合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 激励金额
... ...
... ... @@ -61,14 +61,14 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
DividendsIncentivesRules: rules1,
Undertakers: underTakers,
RelevantIds: createCooperationContractCommand.RelevantIds,
CooperationContractDescription: createCooperationContractCommand.CooperationContractDescription,
CooperationContractNumber: createCooperationContractCommand.CooperationContractNumber,
CooperationProjectNumber: createCooperationContractCommand.CooperationProjectNumber,
DepartmentId: createCooperationContractCommand.DepartmentId,
CooperationContractUndertakerType: createCooperationContractCommand.CooperationContractUndertakerType,
CooperationContractName: createCooperationContractCommand.CooperationContractName,
CooperationModeNumber: createCooperationContractCommand.CooperationModeNumber,
SponsorUid: createCooperationContractCommand.SponsorUid,
CooperationContractDescription: createCooperationContractCommand.CooperationContract.CooperationContractDescription,
CooperationContractNumber: createCooperationContractCommand.CooperationContract.CooperationContractNumber,
CooperationProjectNumber: createCooperationContractCommand.CooperationContract.CooperationProjectNumber,
DepartmentId: createCooperationContractCommand.CooperationContract.DepartmentId,
CooperationContractUndertakerType: createCooperationContractCommand.CooperationContract.CooperationContractUndertakerType,
CooperationContractName: createCooperationContractCommand.CooperationContract.CooperationContractName,
CooperationModeNumber: createCooperationContractCommand.CooperationContract.CooperationModeNumber,
SponsorUid: createCooperationContractCommand.CooperationContract.SponsorUid,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ... @@ -167,19 +167,19 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
underTakers = append(underTakers, u)
}
_, err := creationCooperationGateway.CooperationContractUpdate(allied_creation_cooperation.ReqCooperationContractUpdate{
CooperationContractId: updateCooperationContractCommand.CooperationContractId,
CooperationContractId: updateCooperationContractCommand.CooperationContract.CooperationContractId,
MoneyIncentivesRules: rules2,
DividendsIncentivesRules: rules1,
Undertakers: underTakers,
RelevantIds: updateCooperationContractCommand.RelevantIds,
CooperationContractDescription: updateCooperationContractCommand.CooperationContractDescription,
CooperationContractNumber: updateCooperationContractCommand.CooperationContractNumber,
CooperationProjectNumber: updateCooperationContractCommand.CooperationProjectNumber,
DepartmentId: updateCooperationContractCommand.DepartmentId,
CooperationContractUndertakerType: updateCooperationContractCommand.CooperationContractUndertakerType,
CooperationContractName: updateCooperationContractCommand.CooperationContractName,
CooperationModeNumber: updateCooperationContractCommand.CooperationModeNumber,
SponsorUid: updateCooperationContractCommand.SponsorUid,
CooperationContractDescription: updateCooperationContractCommand.CooperationContract.CooperationContractDescription,
CooperationContractNumber: updateCooperationContractCommand.CooperationContract.CooperationContractNumber,
CooperationProjectNumber: updateCooperationContractCommand.CooperationContract.CooperationProjectNumber,
DepartmentId: updateCooperationContractCommand.CooperationContract.DepartmentId,
CooperationContractUndertakerType: updateCooperationContractCommand.CooperationContract.CooperationContractUndertakerType,
CooperationContractName: updateCooperationContractCommand.CooperationContract.CooperationContractName,
CooperationModeNumber: updateCooperationContractCommand.CooperationContract.CooperationModeNumber,
SponsorUid: updateCooperationContractCommand.CooperationContract.SponsorUid,
})
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
... ...