作者 陈志颖

feat:金额激励预算信息增加查询条件

... ... @@ -22,6 +22,8 @@ type ListMoneyIncentivesEstimateQuery struct {
UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"`
// 用户基础数据id
UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"`
// 激励方式
IncentivesType int32 `cname:"激励方式" json:"incentivesType,omitempty"`
}
func (listMoneyIncentivesEstimateQuery *ListMoneyIncentivesEstimateQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -130,6 +130,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentivesEst
cooperationContractRepository = value
}
// 查找共创合约
listMoneyIncentivesEstimateQuery.IncentivesType = 2
if count, cooperationContracts, err := cooperationContractRepository.Find(tool_funs.SimpleStructToMap(listMoneyIncentivesEstimateQuery)); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
... ...
... ... @@ -36,6 +36,8 @@ type CooperationContract struct {
DividendsIncentivesRules []*DividendsIncentivesRule `json:"dividendsIncentivesRules"`
// 金额激励规则
MoneyIncentivesRules []*MoneyIncentivesRule `json:"moneyIncentivesRules"`
// 激励方式,1业绩分红激励,2金额激励
IncentivesType int32 `json:"incentivesType"`
// 共创承接人列表
Undertakers []*Undertaker `json:"undertakers"`
// 共创合约相关人列表
... ...
... ... @@ -23,10 +23,12 @@ type CooperationContract struct {
CooperationContractSponsor *domain.User `comment:"共创合约发起人"`
// 共创模式编号
CooperationModeNumber string `comment:"共创模式编号"`
// 合约状态,1启用,2禁用
Status int32 `comment:"合约状态,1启用,2禁用"`
// 合约状态,1正常,2暂停
Status int32 `comment:"合约状态,1正常,2暂停"`
// 数据所属组织机构
Org *domain.Org `comment:"数据所属组织机构"`
// 激励方式,1业绩分红激励,2金额激励
IncentivesType int32 `comment:"激励方式"`
// 公司
Company *domain.Company `comment:"公司"`
// 共创合约发起部门
... ...
... ... @@ -118,6 +118,7 @@ func TransformToCooperationContractDomainModelFromPgModels(
RelevantPeople: relevantPeopleDomain,
Undertakers: undertakersDomain,
Status: cooperationContractModel.Status,
IncentivesType: cooperationContractModel.IncentivesType,
Org: cooperationContractModel.Org,
Company: cooperationContractModel.Company,
Department: cooperationContractModel.Department,
... ...
... ... @@ -38,6 +38,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
"cooperation_mode_number",
"status",
"org",
"incentives_type",
"company",
"operator",
"operate_time",
... ... @@ -70,6 +71,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
&cooperationContract.CooperationMode.CooperationModeNumber,
&cooperationContract.Status,
&cooperationContract.Org,
&cooperationContract.IncentivesType,
&cooperationContract.Company,
&cooperationContract.Operator,
&cooperationContract.OperateTime,
... ... @@ -88,6 +90,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
cooperationContract.CooperationMode.CooperationModeNumber,
cooperationContract.Status,
cooperationContract.Org,
cooperationContract.IncentivesType,
cooperationContract.Company,
cooperationContract.Operator,
cooperationContract.OperateTime,
... ... @@ -213,6 +216,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
&cooperationContract.CooperationMode.CooperationModeNumber,
&cooperationContract.Status,
&cooperationContract.Org,
&cooperationContract.IncentivesType,
&cooperationContract.Company,
&cooperationContract.Operator,
&cooperationContract.OperateTime,
... ... @@ -231,6 +235,7 @@ func (repository *CooperationContractRepository) Save(cooperationContract *domai
cooperationContract.CooperationMode.CooperationModeNumber,
cooperationContract.Status,
cooperationContract.Org,
cooperationContract.IncentivesType,
cooperationContract.Company,
cooperationContract.Operator,
cooperationContract.OperateTime,
... ... @@ -840,6 +845,9 @@ func (repository *CooperationContractRepository) Find(queryOptions map[string]in
if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
query.Where("org->>'orgId' = '?'", orgId)
}
if incentivesType, ok := queryOptions["incentivesType"]; ok && incentivesType.(int32) != 0 {
query.Where("incentives_type = ?", incentivesType)
}
offsetLimitFlag := true
if offsetLimit, ok := queryOptions["offsetLimit"]; ok {
offsetLimitFlag = offsetLimit.(bool)
... ...