正在显示
6 个修改的文件
包含
18 行增加
和
2 行删除
@@ -22,6 +22,8 @@ type ListMoneyIncentivesEstimateQuery struct { | @@ -22,6 +22,8 @@ type ListMoneyIncentivesEstimateQuery struct { | ||
22 | UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"` | 22 | UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"` |
23 | // 用户基础数据id | 23 | // 用户基础数据id |
24 | UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"` | 24 | UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"` |
25 | + // 激励方式 | ||
26 | + IncentivesType int32 `cname:"激励方式" json:"incentivesType,omitempty"` | ||
25 | } | 27 | } |
26 | 28 | ||
27 | func (listMoneyIncentivesEstimateQuery *ListMoneyIncentivesEstimateQuery) Valid(validation *validation.Validation) { | 29 | func (listMoneyIncentivesEstimateQuery *ListMoneyIncentivesEstimateQuery) Valid(validation *validation.Validation) { |
@@ -130,6 +130,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentivesEst | @@ -130,6 +130,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentivesEst | ||
130 | cooperationContractRepository = value | 130 | cooperationContractRepository = value |
131 | } | 131 | } |
132 | // 查找共创合约 | 132 | // 查找共创合约 |
133 | + listMoneyIncentivesEstimateQuery.IncentivesType = 2 | ||
133 | if count, cooperationContracts, err := cooperationContractRepository.Find(tool_funs.SimpleStructToMap(listMoneyIncentivesEstimateQuery)); err != nil { | 134 | if count, cooperationContracts, err := cooperationContractRepository.Find(tool_funs.SimpleStructToMap(listMoneyIncentivesEstimateQuery)); err != nil { |
134 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 135 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
135 | } else { | 136 | } else { |
@@ -36,6 +36,8 @@ type CooperationContract struct { | @@ -36,6 +36,8 @@ type CooperationContract struct { | ||
36 | DividendsIncentivesRules []*DividendsIncentivesRule `json:"dividendsIncentivesRules"` | 36 | DividendsIncentivesRules []*DividendsIncentivesRule `json:"dividendsIncentivesRules"` |
37 | // 金额激励规则 | 37 | // 金额激励规则 |
38 | MoneyIncentivesRules []*MoneyIncentivesRule `json:"moneyIncentivesRules"` | 38 | MoneyIncentivesRules []*MoneyIncentivesRule `json:"moneyIncentivesRules"` |
39 | + // 激励方式,1业绩分红激励,2金额激励 | ||
40 | + IncentivesType int32 `json:"incentivesType"` | ||
39 | // 共创承接人列表 | 41 | // 共创承接人列表 |
40 | Undertakers []*Undertaker `json:"undertakers"` | 42 | Undertakers []*Undertaker `json:"undertakers"` |
41 | // 共创合约相关人列表 | 43 | // 共创合约相关人列表 |
@@ -23,10 +23,12 @@ type CooperationContract struct { | @@ -23,10 +23,12 @@ type CooperationContract struct { | ||
23 | CooperationContractSponsor *domain.User `comment:"共创合约发起人"` | 23 | CooperationContractSponsor *domain.User `comment:"共创合约发起人"` |
24 | // 共创模式编号 | 24 | // 共创模式编号 |
25 | CooperationModeNumber string `comment:"共创模式编号"` | 25 | CooperationModeNumber string `comment:"共创模式编号"` |
26 | - // 合约状态,1启用,2禁用 | ||
27 | - Status int32 `comment:"合约状态,1启用,2禁用"` | 26 | + // 合约状态,1正常,2暂停 |
27 | + Status int32 `comment:"合约状态,1正常,2暂停"` | ||
28 | // 数据所属组织机构 | 28 | // 数据所属组织机构 |
29 | Org *domain.Org `comment:"数据所属组织机构"` | 29 | Org *domain.Org `comment:"数据所属组织机构"` |
30 | + // 激励方式,1业绩分红激励,2金额激励 | ||
31 | + IncentivesType int32 `comment:"激励方式"` | ||
30 | // 公司 | 32 | // 公司 |
31 | Company *domain.Company `comment:"公司"` | 33 | Company *domain.Company `comment:"公司"` |
32 | // 共创合约发起部门 | 34 | // 共创合约发起部门 |
@@ -118,6 +118,7 @@ func TransformToCooperationContractDomainModelFromPgModels( | @@ -118,6 +118,7 @@ func TransformToCooperationContractDomainModelFromPgModels( | ||
118 | RelevantPeople: relevantPeopleDomain, | 118 | RelevantPeople: relevantPeopleDomain, |
119 | Undertakers: undertakersDomain, | 119 | Undertakers: undertakersDomain, |
120 | Status: cooperationContractModel.Status, | 120 | Status: cooperationContractModel.Status, |
121 | + IncentivesType: cooperationContractModel.IncentivesType, | ||
121 | Org: cooperationContractModel.Org, | 122 | Org: cooperationContractModel.Org, |
122 | Company: cooperationContractModel.Company, | 123 | Company: cooperationContractModel.Company, |
123 | Department: cooperationContractModel.Department, | 124 | Department: cooperationContractModel.Department, |
@@ -38,6 +38,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -38,6 +38,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
38 | "cooperation_mode_number", | 38 | "cooperation_mode_number", |
39 | "status", | 39 | "status", |
40 | "org", | 40 | "org", |
41 | + "incentives_type", | ||
41 | "company", | 42 | "company", |
42 | "operator", | 43 | "operator", |
43 | "operate_time", | 44 | "operate_time", |
@@ -70,6 +71,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -70,6 +71,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
70 | &cooperationContract.CooperationMode.CooperationModeNumber, | 71 | &cooperationContract.CooperationMode.CooperationModeNumber, |
71 | &cooperationContract.Status, | 72 | &cooperationContract.Status, |
72 | &cooperationContract.Org, | 73 | &cooperationContract.Org, |
74 | + &cooperationContract.IncentivesType, | ||
73 | &cooperationContract.Company, | 75 | &cooperationContract.Company, |
74 | &cooperationContract.Operator, | 76 | &cooperationContract.Operator, |
75 | &cooperationContract.OperateTime, | 77 | &cooperationContract.OperateTime, |
@@ -88,6 +90,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -88,6 +90,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
88 | cooperationContract.CooperationMode.CooperationModeNumber, | 90 | cooperationContract.CooperationMode.CooperationModeNumber, |
89 | cooperationContract.Status, | 91 | cooperationContract.Status, |
90 | cooperationContract.Org, | 92 | cooperationContract.Org, |
93 | + cooperationContract.IncentivesType, | ||
91 | cooperationContract.Company, | 94 | cooperationContract.Company, |
92 | cooperationContract.Operator, | 95 | cooperationContract.Operator, |
93 | cooperationContract.OperateTime, | 96 | cooperationContract.OperateTime, |
@@ -213,6 +216,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -213,6 +216,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
213 | &cooperationContract.CooperationMode.CooperationModeNumber, | 216 | &cooperationContract.CooperationMode.CooperationModeNumber, |
214 | &cooperationContract.Status, | 217 | &cooperationContract.Status, |
215 | &cooperationContract.Org, | 218 | &cooperationContract.Org, |
219 | + &cooperationContract.IncentivesType, | ||
216 | &cooperationContract.Company, | 220 | &cooperationContract.Company, |
217 | &cooperationContract.Operator, | 221 | &cooperationContract.Operator, |
218 | &cooperationContract.OperateTime, | 222 | &cooperationContract.OperateTime, |
@@ -231,6 +235,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | @@ -231,6 +235,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai | ||
231 | cooperationContract.CooperationMode.CooperationModeNumber, | 235 | cooperationContract.CooperationMode.CooperationModeNumber, |
232 | cooperationContract.Status, | 236 | cooperationContract.Status, |
233 | cooperationContract.Org, | 237 | cooperationContract.Org, |
238 | + cooperationContract.IncentivesType, | ||
234 | cooperationContract.Company, | 239 | cooperationContract.Company, |
235 | cooperationContract.Operator, | 240 | cooperationContract.Operator, |
236 | cooperationContract.OperateTime, | 241 | cooperationContract.OperateTime, |
@@ -840,6 +845,9 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | @@ -840,6 +845,9 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in | ||
840 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 845 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
841 | query.Where("org->>'orgId' = '?'", orgId) | 846 | query.Where("org->>'orgId' = '?'", orgId) |
842 | } | 847 | } |
848 | + if incentivesType, ok := queryOptions["incentivesType"]; ok && incentivesType.(int32) != 0 { | ||
849 | + query.Where("incentives_type = ?", incentivesType) | ||
850 | + } | ||
843 | offsetLimitFlag := true | 851 | offsetLimitFlag := true |
844 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { | 852 | if offsetLimit, ok := queryOptions["offsetLimit"]; ok { |
845 | offsetLimitFlag = offsetLimit.(bool) | 853 | offsetLimitFlag = offsetLimit.(bool) |
-
请 注册 或 登录 后发表评论