正在显示
13 个修改的文件
包含
243 行增加
和
126 行删除
| 1 | +package command | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "fmt" | ||
| 5 | + "github.com/beego/beego/v2/core/validation" | ||
| 6 | + "reflect" | ||
| 7 | + "strings" | ||
| 8 | +) | ||
| 9 | + | ||
| 10 | +// BatchCancelDividendsEstimateCommand 批量取消分红预算 | ||
| 11 | +type BatchCancelDividendsEstimateCommand struct { | ||
| 12 | + // 承接人分红预算记录ID | ||
| 13 | + DividendsEstimateIds []string `cname:"承接人分红预算记录ID列表" json:"dividendsEstimateIds,omitempty"` | ||
| 14 | + // 公司ID,通过集成REST上下文获取 | ||
| 15 | + CompanyId int64 `cname:"公司ID" json:"companyId,string" valid:"Required"` | ||
| 16 | + // 组织机构ID | ||
| 17 | + OrgId int64 `cname:"组织机构ID" json:"orgId,string" valid:"Required"` | ||
| 18 | + // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 | ||
| 19 | + UserId int64 `cname:"用户ID" json:"userId,string" valid:"Required"` | ||
| 20 | + // 用户基础数据id | ||
| 21 | + UserBaseId int64 `cname:"用户基础数据ID" json:"userBaseId,string" valid:"Required"` | ||
| 22 | +} | ||
| 23 | + | ||
| 24 | +func (batchCancelDividendsEstimateCommand *BatchCancelDividendsEstimateCommand) Valid(validation *validation.Validation) { | ||
| 25 | + //validation.SetError("CustomValid", "未实现的自定义认证") | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +func (batchCancelDividendsEstimateCommand *BatchCancelDividendsEstimateCommand) ValidateCommand() error { | ||
| 29 | + valid := validation.Validation{} | ||
| 30 | + b, err := valid.Valid(batchCancelDividendsEstimateCommand) | ||
| 31 | + if err != nil { | ||
| 32 | + return err | ||
| 33 | + } | ||
| 34 | + if !b { | ||
| 35 | + elem := reflect.TypeOf(batchCancelDividendsEstimateCommand).Elem() | ||
| 36 | + for _, validErr := range valid.Errors { | ||
| 37 | + field, isExist := elem.FieldByName(validErr.Field) | ||
| 38 | + if isExist { | ||
| 39 | + return fmt.Errorf(strings.Replace(validErr.Message, validErr.Field, field.Tag.Get("cname"), -1)) | ||
| 40 | + } else { | ||
| 41 | + return fmt.Errorf(validErr.Message) | ||
| 42 | + } | ||
| 43 | + } | ||
| 44 | + } | ||
| 45 | + return nil | ||
| 46 | +} |
| @@ -17,7 +17,7 @@ import ( | @@ -17,7 +17,7 @@ import ( | ||
| 17 | type DividendsEstimateService struct { | 17 | type DividendsEstimateService struct { |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | -// CancelDividendsEstimate 取消分红预算 | 20 | +// CancelDividendsEstimate 取消分红预算单 |
| 21 | func (dividendsEstimateService *DividendsEstimateService) CancelDividendsEstimate(cancelDividendsEstimateCommand *command.CancelDividendsEstimateCommand) (interface{}, error) { | 21 | func (dividendsEstimateService *DividendsEstimateService) CancelDividendsEstimate(cancelDividendsEstimateCommand *command.CancelDividendsEstimateCommand) (interface{}, error) { |
| 22 | if err := cancelDividendsEstimateCommand.ValidateCommand(); err != nil { | 22 | if err := cancelDividendsEstimateCommand.ValidateCommand(); err != nil { |
| 23 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 23 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| @@ -38,7 +38,28 @@ func (dividendsEstimateService *DividendsEstimateService) CancelDividendsEstimat | @@ -38,7 +38,28 @@ func (dividendsEstimateService *DividendsEstimateService) CancelDividendsEstimat | ||
| 38 | return nil, nil | 38 | return nil, nil |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | -// CreateDividendsEstimate 创建分红预算服务 | 41 | +// BatchCancelDividendsEstimate 批量取消分红预算单 |
| 42 | +func (dividendsEstimateService *DividendsEstimateService) BatchCancelDividendsEstimate(batchCancelEstimateCommand *command.BatchCancelDividendsEstimateCommand) (interface{}, error) { | ||
| 43 | + if err := batchCancelEstimateCommand.ValidateCommand(); err != nil { | ||
| 44 | + return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | ||
| 45 | + } | ||
| 46 | + transactionContext, err := factory.CreateTransactionContext(nil) | ||
| 47 | + if err != nil { | ||
| 48 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 49 | + } | ||
| 50 | + if err := transactionContext.StartTransaction(); err != nil { | ||
| 51 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 52 | + } | ||
| 53 | + defer func() { | ||
| 54 | + _ = transactionContext.RollbackTransaction() | ||
| 55 | + }() | ||
| 56 | + if err := transactionContext.CommitTransaction(); err != nil { | ||
| 57 | + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | ||
| 58 | + } | ||
| 59 | + return nil, nil | ||
| 60 | +} | ||
| 61 | + | ||
| 62 | +// CreateDividendsEstimate 创建分红预算单 (预留) | ||
| 42 | func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimate(createDividendsEstimateCommand *command.CreateDividendsEstimateCommand) (interface{}, error) { | 63 | func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimate(createDividendsEstimateCommand *command.CreateDividendsEstimateCommand) (interface{}, error) { |
| 43 | if err := createDividendsEstimateCommand.ValidateCommand(); err != nil { | 64 | if err := createDividendsEstimateCommand.ValidateCommand(); err != nil { |
| 44 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 65 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| @@ -140,9 +161,9 @@ func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimat | @@ -140,9 +161,9 @@ func (dividendsEstimateService *DividendsEstimateService) CreateDividendsEstimat | ||
| 140 | } | 161 | } |
| 141 | } | 162 | } |
| 142 | 163 | ||
| 143 | -// EstimateDividendsIncentives 确定预算分红激励 | ||
| 144 | -func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncentives(estimateDividendsIncentivesCommand *command.ConfirmDividendsIncentivesEstimateCommand) (interface{}, error) { | ||
| 145 | - if err := estimateDividendsIncentivesCommand.ValidateCommand(); err != nil { | 164 | +// ConfirmDividendsIncentivesEstimate 确定业绩激励分红预算 |
| 165 | +func (dividendsEstimateService *DividendsEstimateService) ConfirmDividendsIncentivesEstimate(confirmDividendsIncentivesEstimateCommand *command.ConfirmDividendsIncentivesEstimateCommand) (interface{}, error) { | ||
| 166 | + if err := confirmDividendsIncentivesEstimateCommand.ValidateCommand(); err != nil { | ||
| 146 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 167 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 147 | } | 168 | } |
| 148 | transactionContext, err := factory.CreateTransactionContext(nil) | 169 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -161,9 +182,9 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen | @@ -161,9 +182,9 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncen | ||
| 161 | return nil, nil | 182 | return nil, nil |
| 162 | } | 183 | } |
| 163 | 184 | ||
| 164 | -// EstimateMoneyIncentives 确定预算金额激励分红 | ||
| 165 | -func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentives(estimateMoneyIncentivesCommand *command.ConfirmMoneyIncentivesEstimateCommand) (interface{}, error) { | ||
| 166 | - if err := estimateMoneyIncentivesCommand.ValidateCommand(); err != nil { | 185 | +// ConfirmMoneyIncentivesEstimate 确定金额激励分红预算 |
| 186 | +func (dividendsEstimateService *DividendsEstimateService) ConfirmMoneyIncentivesEstimate(confirmMoneyIncentivesEstimateCommand *command.ConfirmMoneyIncentivesEstimateCommand) (interface{}, error) { | ||
| 187 | + if err := confirmMoneyIncentivesEstimateCommand.ValidateCommand(); err != nil { | ||
| 167 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 188 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 168 | } | 189 | } |
| 169 | transactionContext, err := factory.CreateTransactionContext(nil) | 190 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -182,7 +203,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive | @@ -182,7 +203,7 @@ func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentive | ||
| 182 | return nil, nil | 203 | return nil, nil |
| 183 | } | 204 | } |
| 184 | 205 | ||
| 185 | -// GetDividendsEstimate 返回分红预算服务 | 206 | +// GetDividendsEstimate 返回分红预算单详情 |
| 186 | func (dividendsEstimateService *DividendsEstimateService) GetDividendsEstimate(getDividendsEstimateQuery *query.GetDividendsEstimateQuery) (interface{}, error) { | 207 | func (dividendsEstimateService *DividendsEstimateService) GetDividendsEstimate(getDividendsEstimateQuery *query.GetDividendsEstimateQuery) (interface{}, error) { |
| 187 | if err := getDividendsEstimateQuery.ValidateQuery(); err != nil { | 208 | if err := getDividendsEstimateQuery.ValidateQuery(); err != nil { |
| 188 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 209 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| @@ -219,7 +240,7 @@ func (dividendsEstimateService *DividendsEstimateService) GetDividendsEstimate(g | @@ -219,7 +240,7 @@ func (dividendsEstimateService *DividendsEstimateService) GetDividendsEstimate(g | ||
| 219 | } | 240 | } |
| 220 | } | 241 | } |
| 221 | 242 | ||
| 222 | -// ListDividendsEstimate 返回分红预算服务列表 | 243 | +// ListDividendsEstimate 返回分红预算单列表 |
| 223 | func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate(listDividendsEstimateQuery *query.ListDividendsEstimateQuery) (interface{}, error) { | 244 | func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate(listDividendsEstimateQuery *query.ListDividendsEstimateQuery) (interface{}, error) { |
| 224 | if err := listDividendsEstimateQuery.ValidateQuery(); err != nil { | 245 | if err := listDividendsEstimateQuery.ValidateQuery(); err != nil { |
| 225 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 246 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| @@ -257,9 +278,9 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate( | @@ -257,9 +278,9 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate( | ||
| 257 | } | 278 | } |
| 258 | } | 279 | } |
| 259 | 280 | ||
| 260 | -// ListDividendsIncentives 返回业绩激励分红 | ||
| 261 | -func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentives(listDividendsIncentivesQuery *query.ListDividendsIncentivesEstimateQuery) (interface{}, error) { | ||
| 262 | - if err := listDividendsIncentivesQuery.ValidateQuery(); err != nil { | 281 | +// ListDividendsIncentivesEstimate 返回业绩激励分红预算列表 |
| 282 | +func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentivesEstimate(listDividendsIncentivesEstimateQuery *query.ListDividendsIncentivesEstimateQuery) (interface{}, error) { | ||
| 283 | + if err := listDividendsIncentivesEstimateQuery.ValidateQuery(); err != nil { | ||
| 263 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 284 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 264 | } | 285 | } |
| 265 | transactionContext, err := factory.CreateTransactionContext(nil) | 286 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -278,9 +299,9 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive | @@ -278,9 +299,9 @@ func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentive | ||
| 278 | return nil, nil | 299 | return nil, nil |
| 279 | } | 300 | } |
| 280 | 301 | ||
| 281 | -// ListMoneyIncentives 返回金额激励分红 | ||
| 282 | -func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentives(listMoneyIncentivesQuery *query.ListMoneyIncentivesEstimateQuery) (interface{}, error) { | ||
| 283 | - if err := listMoneyIncentivesQuery.ValidateQuery(); err != nil { | 302 | +// ListMoneyIncentivesEstimate 返回金额激励分红预算列表 |
| 303 | +func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentivesEstimate(listMoneyIncentivesEstimateQuery *query.ListMoneyIncentivesEstimateQuery) (interface{}, error) { | ||
| 304 | + if err := listMoneyIncentivesEstimateQuery.ValidateQuery(); err != nil { | ||
| 284 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 305 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 285 | } | 306 | } |
| 286 | transactionContext, err := factory.CreateTransactionContext(nil) | 307 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -299,7 +320,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentives(li | @@ -299,7 +320,7 @@ func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentives(li | ||
| 299 | return nil, nil | 320 | return nil, nil |
| 300 | } | 321 | } |
| 301 | 322 | ||
| 302 | -// RemoveDividendsEstimate 移除分红预算服务 | 323 | +// RemoveDividendsEstimate 移除分红预算单(预留) |
| 303 | func (dividendsEstimateService *DividendsEstimateService) RemoveDividendsEstimate(removeDividendsEstimateCommand *command.RemoveDividendsEstimateCommand) (interface{}, error) { | 324 | func (dividendsEstimateService *DividendsEstimateService) RemoveDividendsEstimate(removeDividendsEstimateCommand *command.RemoveDividendsEstimateCommand) (interface{}, error) { |
| 304 | if err := removeDividendsEstimateCommand.ValidateCommand(); err != nil { | 325 | if err := removeDividendsEstimateCommand.ValidateCommand(); err != nil { |
| 305 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 326 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| @@ -360,9 +381,9 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat | @@ -360,9 +381,9 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimat | ||
| 360 | return nil, nil | 381 | return nil, nil |
| 361 | } | 382 | } |
| 362 | 383 | ||
| 363 | -// SearchDividendsIncentives 查询业绩分红 | ||
| 364 | -func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentives(searchDividendsIncentivesQuery *query.SearchDividendsIncentivesEstimateQuery) (interface{}, error) { | ||
| 365 | - if err := searchDividendsIncentivesQuery.ValidateQuery(); err != nil { | 384 | +// SearchDividendsIncentivesEstimate 查询业绩激励分红预算 |
| 385 | +func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentivesEstimate(searchDividendsIncentivesEstimateQuery *query.SearchDividendsIncentivesEstimateQuery) (interface{}, error) { | ||
| 386 | + if err := searchDividendsIncentivesEstimateQuery.ValidateQuery(); err != nil { | ||
| 366 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 387 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 367 | } | 388 | } |
| 368 | transactionContext, err := factory.CreateTransactionContext(nil) | 389 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -381,9 +402,9 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti | @@ -381,9 +402,9 @@ func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncenti | ||
| 381 | return nil, nil | 402 | return nil, nil |
| 382 | } | 403 | } |
| 383 | 404 | ||
| 384 | -// SearchMoneyIncentives 查询金额激励分红 | ||
| 385 | -func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentives(searchMoneyIncentivesQuery *query.SearchMoneyIncentivesEstimateQuery) (interface{}, error) { | ||
| 386 | - if err := searchMoneyIncentivesQuery.ValidateQuery(); err != nil { | 405 | +// SearchMoneyIncentivesEstimate 查询金额激励分红预算 |
| 406 | +func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentivesEstimate(searchMoneyIncentivesEstimateQuery *query.SearchMoneyIncentivesEstimateQuery) (interface{}, error) { | ||
| 407 | + if err := searchMoneyIncentivesEstimateQuery.ValidateQuery(); err != nil { | ||
| 387 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 408 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 388 | } | 409 | } |
| 389 | transactionContext, err := factory.CreateTransactionContext(nil) | 410 | transactionContext, err := factory.CreateTransactionContext(nil) |
| @@ -402,7 +423,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentives( | @@ -402,7 +423,7 @@ func (dividendsEstimateService *DividendsEstimateService) SearchMoneyIncentives( | ||
| 402 | return nil, nil | 423 | return nil, nil |
| 403 | } | 424 | } |
| 404 | 425 | ||
| 405 | -// UpdateDividendsEstimate 更新分红预算服务 | 426 | +// UpdateDividendsEstimate 更新分红预算单(预留) |
| 406 | func (dividendsEstimateService *DividendsEstimateService) UpdateDividendsEstimate(updateDividendsEstimateCommand *command.UpdateDividendsEstimateCommand) (interface{}, error) { | 427 | func (dividendsEstimateService *DividendsEstimateService) UpdateDividendsEstimate(updateDividendsEstimateCommand *command.UpdateDividendsEstimateCommand) (interface{}, error) { |
| 407 | if err := updateDividendsEstimateCommand.ValidateCommand(); err != nil { | 428 | if err := updateDividendsEstimateCommand.ValidateCommand(); err != nil { |
| 408 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) | 429 | return nil, application.ThrowError(application.ARG_ERROR, err.Error()) |
| 1 | package factory | 1 | package factory |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | + pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | ||
| 4 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain/service" |
| 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/domain_service" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/domain_service" |
| 6 | ) | 7 | ) |
| @@ -20,3 +21,11 @@ func CreateDepartmentService(options map[string]interface{}) (service.Department | @@ -20,3 +21,11 @@ func CreateDepartmentService(options map[string]interface{}) (service.Department | ||
| 20 | func CreateOrganizationService(options map[string]interface{}) (service.OrgService, error) { | 21 | func CreateOrganizationService(options map[string]interface{}) (service.OrgService, error) { |
| 21 | return domain_service.NewOrganizationService() | 22 | return domain_service.NewOrganizationService() |
| 22 | } | 23 | } |
| 24 | + | ||
| 25 | +func CreateCancelDividendsEstimateService(options map[string]interface{}) (service.CancelDividendsEstimate, error) { | ||
| 26 | + var transactionContext *pgTransaction.TransactionContext | ||
| 27 | + if value, ok := options["transactionContext"]; ok { | ||
| 28 | + transactionContext = value.(*pgTransaction.TransactionContext) | ||
| 29 | + } | ||
| 30 | + return domain_service.NewCancelDividendsEstimateService(transactionContext) | ||
| 31 | +} |
| @@ -2,6 +2,18 @@ package domain | @@ -2,6 +2,18 @@ package domain | ||
| 2 | 2 | ||
| 3 | import "time" | 3 | import "time" |
| 4 | 4 | ||
| 5 | +const ( | ||
| 6 | + UNDERTAKER = iota + 1 // 承接人 | ||
| 7 | + REFERRER // 推荐人 | ||
| 8 | + SALESMAN // 业务员 | ||
| 9 | +) | ||
| 10 | + | ||
| 11 | +const ( | ||
| 12 | + ORDER_DIVIDENDS = iota + 1 // 订单分红 | ||
| 13 | + RETURN_WRITE_OFF // 退货冲销 | ||
| 14 | + MONEY_INCENTIVES // 金额激励 | ||
| 15 | +) | ||
| 16 | + | ||
| 5 | // DividendsEstimate 分红预算实体 | 17 | // DividendsEstimate 分红预算实体 |
| 6 | type DividendsEstimate struct { | 18 | type DividendsEstimate struct { |
| 7 | // 承接人分红预算记录ID | 19 | // 承接人分红预算记录ID |
| @@ -22,8 +34,10 @@ type DividendsEstimate struct { | @@ -22,8 +34,10 @@ type DividendsEstimate struct { | ||
| 22 | OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` | 34 | OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` |
| 23 | // 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001 | 35 | // 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001 |
| 24 | CooperationContractNumber string `json:"cooperationContractNumber"` | 36 | CooperationContractNumber string `json:"cooperationContractNumber"` |
| 25 | - // 分红用户 | 37 | + // 分红用户(共创参与) |
| 26 | DividendsUser *User `json:"dividendsUser"` | 38 | DividendsUser *User `json:"dividendsUser"` |
| 39 | + // 分红阶段 | ||
| 40 | + DividendsStage int32 `json:"dividendsStage"` | ||
| 27 | // 数据所属组织机构 | 41 | // 数据所属组织机构 |
| 28 | Org *Org `json:"org"` | 42 | Org *Org `json:"org"` |
| 29 | // 公司 | 43 | // 公司 |
| @@ -42,6 +56,7 @@ type DividendsEstimate struct { | @@ -42,6 +56,7 @@ type DividendsEstimate struct { | ||
| 42 | 56 | ||
| 43 | type DividendsEstimateRepository interface { | 57 | type DividendsEstimateRepository interface { |
| 44 | Save(dividendsEstimate *DividendsEstimate) (*DividendsEstimate, error) | 58 | Save(dividendsEstimate *DividendsEstimate) (*DividendsEstimate, error) |
| 59 | + UpdateMany(dividendsEstimates []*DividendsEstimate) ([]*DividendsEstimate, error) | ||
| 45 | Remove(dividendsEstimate *DividendsEstimate) (*DividendsEstimate, error) | 60 | Remove(dividendsEstimate *DividendsEstimate) (*DividendsEstimate, error) |
| 46 | FindOne(queryOptions map[string]interface{}) (*DividendsEstimate, error) | 61 | FindOne(queryOptions map[string]interface{}) (*DividendsEstimate, error) |
| 47 | Find(queryOptions map[string]interface{}) (int64, []*DividendsEstimate, error) | 62 | Find(queryOptions map[string]interface{}) (int64, []*DividendsEstimate, error) |
| @@ -55,9 +70,6 @@ func (dividendsEstimate *DividendsEstimate) Identify() interface{} { | @@ -55,9 +70,6 @@ func (dividendsEstimate *DividendsEstimate) Identify() interface{} { | ||
| 55 | } | 70 | } |
| 56 | 71 | ||
| 57 | func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) error { | 72 | func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) error { |
| 58 | - if dividendsEstimateId, ok := data["dividendsEstimateId"]; ok { | ||
| 59 | - dividendsEstimate.DividendsEstimateId = dividendsEstimateId.(int64) | ||
| 60 | - } | ||
| 61 | if dividendsAccountStatus, ok := data["dividendsAccountStatus"]; ok { | 73 | if dividendsAccountStatus, ok := data["dividendsAccountStatus"]; ok { |
| 62 | dividendsEstimate.DividendsAccountStatus = dividendsAccountStatus.(int32) | 74 | dividendsEstimate.DividendsAccountStatus = dividendsAccountStatus.(int32) |
| 63 | } | 75 | } |
| @@ -82,62 +94,5 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) | @@ -82,62 +94,5 @@ func (dividendsEstimate *DividendsEstimate) Update(data map[string]interface{}) | ||
| 82 | if cooperationProjectNumber, ok := data["cooperationProjectNumber"]; ok { | 94 | if cooperationProjectNumber, ok := data["cooperationProjectNumber"]; ok { |
| 83 | dividendsEstimate.CooperationContractNumber = cooperationProjectNumber.(string) | 95 | dividendsEstimate.CooperationContractNumber = cooperationProjectNumber.(string) |
| 84 | } | 96 | } |
| 85 | - if userId, ok := data["userId"]; ok { | ||
| 86 | - dividendsEstimate.DividendsUser.UserId = userId.(int64) | ||
| 87 | - } | ||
| 88 | - if userBaseId, ok := data["userBaseId"]; ok { | ||
| 89 | - dividendsEstimate.DividendsUser.UserBaseId = userBaseId.(int64) | ||
| 90 | - } | ||
| 91 | - if orgId, ok := data["orgId"]; ok { | ||
| 92 | - dividendsEstimate.DividendsUser.Org.OrgId = orgId.(int64) | ||
| 93 | - } | ||
| 94 | - if orgName, ok := data["orgName"]; ok { | ||
| 95 | - dividendsEstimate.DividendsUser.Org.OrgName = orgName.(string) | ||
| 96 | - } | ||
| 97 | - if companyId, ok := data["companyId"]; ok { | ||
| 98 | - dividendsEstimate.DividendsUser.Org.Company.CompanyId = companyId.(int64) | ||
| 99 | - } | ||
| 100 | - if companyLogo, ok := data["companyLogo"]; ok { | ||
| 101 | - dividendsEstimate.DividendsUser.Org.Company.CompanyLogo = companyLogo.(string) | ||
| 102 | - } | ||
| 103 | - if companyName, ok := data["companyName"]; ok { | ||
| 104 | - dividendsEstimate.DividendsUser.Org.Company.CompanyName = companyName.(string) | ||
| 105 | - } | ||
| 106 | - if orgs, ok := data["orgs"]; ok { | ||
| 107 | - dividendsEstimate.DividendsUser.Orgs = orgs.([]*Org) | ||
| 108 | - } | ||
| 109 | - if departmentId, ok := data["departmentId"]; ok { | ||
| 110 | - dividendsEstimate.DividendsUser.Department.DepartmentId = departmentId.(int64) | ||
| 111 | - } | ||
| 112 | - if departmentName, ok := data["departmentName"]; ok { | ||
| 113 | - dividendsEstimate.DividendsUser.Department.DepartmentName = departmentName.(string) | ||
| 114 | - } | ||
| 115 | - if departmentNumber, ok := data["departmentNumber"]; ok { | ||
| 116 | - dividendsEstimate.DividendsUser.Department.DepartmentNumber = departmentNumber.(string) | ||
| 117 | - } | ||
| 118 | - if isOrganization, ok := data["isOrganization"]; ok { | ||
| 119 | - dividendsEstimate.DividendsUser.Department.IsOrganization = isOrganization.(bool) | ||
| 120 | - } | ||
| 121 | - if userAvatar, ok := data["userAvatar"]; ok { | ||
| 122 | - dividendsEstimate.DividendsUser.UserInfo.UserAvatar = userAvatar.(string) | ||
| 123 | - } | ||
| 124 | - if userEmail, ok := data["userEmail"]; ok { | ||
| 125 | - dividendsEstimate.DividendsUser.UserInfo.UserEmail = userEmail.(string) | ||
| 126 | - } | ||
| 127 | - if userName, ok := data["userName"]; ok { | ||
| 128 | - dividendsEstimate.DividendsUser.UserInfo.UserName = userName.(string) | ||
| 129 | - } | ||
| 130 | - if userPhone, ok := data["userPhone"]; ok { | ||
| 131 | - dividendsEstimate.DividendsUser.UserInfo.UserPhone = userPhone.(string) | ||
| 132 | - } | ||
| 133 | - if userAccount, ok := data["userAccount"]; ok { | ||
| 134 | - dividendsEstimate.DividendsUser.UserInfo.UserAccount = userAccount.(string) | ||
| 135 | - } | ||
| 136 | - if userType, ok := data["userType"]; ok { | ||
| 137 | - dividendsEstimate.DividendsUser.UserType = userType.(int32) | ||
| 138 | - } | ||
| 139 | - if status, ok := data["status"]; ok { | ||
| 140 | - dividendsEstimate.DividendsUser.Status = status.(int32) | ||
| 141 | - } | ||
| 142 | return nil | 97 | return nil |
| 143 | } | 98 | } |
| 1 | +package domain_service | ||
| 2 | + | ||
| 3 | +import ( | ||
| 4 | + "fmt" | ||
| 5 | + coreDomain "github.com/linmadan/egglib-go/core/domain" | ||
| 6 | + pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | ||
| 7 | +) | ||
| 8 | + | ||
| 9 | +type CancelDividendsEstimateService struct { | ||
| 10 | + coreDomain.BaseEventPublisher | ||
| 11 | + transactionContext *pgTransaction.TransactionContext | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +func (c *CancelDividendsEstimateService) CancelEstimate() { | ||
| 15 | + panic("implement me") | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +func NewCancelDividendsEstimateService(transactionContext *pgTransaction.TransactionContext) (*CancelDividendsEstimateService, error) { | ||
| 19 | + if transactionContext == nil { | ||
| 20 | + return nil, fmt.Errorf("transactionContext参数不能为nil") | ||
| 21 | + } else { | ||
| 22 | + return &CancelDividendsEstimateService{ | ||
| 23 | + transactionContext: transactionContext, | ||
| 24 | + }, nil | ||
| 25 | + } | ||
| 26 | +} |
| @@ -27,6 +27,8 @@ type DividendsEstimate struct { | @@ -27,6 +27,8 @@ type DividendsEstimate struct { | ||
| 27 | CooperationContractNumber string `comment:"共创项目合约编号"` | 27 | CooperationContractNumber string `comment:"共创项目合约编号"` |
| 28 | // 分红用户 | 28 | // 分红用户 |
| 29 | DividendsUser *domain.User `comment:"分红用户"` | 29 | DividendsUser *domain.User `comment:"分红用户"` |
| 30 | + // 分红阶段 | ||
| 31 | + DividendsStage int32 `comment:"分红阶段"` | ||
| 30 | // 数据所属组织机构 | 32 | // 数据所属组织机构 |
| 31 | Org *domain.Org `comment:"数据所属组织机构"` | 33 | Org *domain.Org `comment:"数据所属组织机构"` |
| 32 | // 公司 | 34 | // 公司 |
| @@ -17,6 +17,7 @@ func TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel | @@ -17,6 +17,7 @@ func TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel | ||
| 17 | OrderOrReturnedOrderNum: dividendsEstimateModel.OrderOrReturnedOrderNum, | 17 | OrderOrReturnedOrderNum: dividendsEstimateModel.OrderOrReturnedOrderNum, |
| 18 | CooperationContractNumber: dividendsEstimateModel.CooperationContractNumber, | 18 | CooperationContractNumber: dividendsEstimateModel.CooperationContractNumber, |
| 19 | DividendsUser: dividendsEstimateModel.DividendsUser, | 19 | DividendsUser: dividendsEstimateModel.DividendsUser, |
| 20 | + DividendsStage: dividendsEstimateModel.DividendsStage, | ||
| 20 | Org: dividendsEstimateModel.Org, | 21 | Org: dividendsEstimateModel.Org, |
| 21 | Company: dividendsEstimateModel.Company, | 22 | Company: dividendsEstimateModel.Company, |
| 22 | Operator: dividendsEstimateModel.Operator, | 23 | Operator: dividendsEstimateModel.Operator, |
| @@ -24,6 +24,7 @@ func (repository *DividendsEstimateRepository) nextIdentify() (int64, error) { | @@ -24,6 +24,7 @@ func (repository *DividendsEstimateRepository) nextIdentify() (int64, error) { | ||
| 24 | id, err := IdWorker.NextId() | 24 | id, err := IdWorker.NextId() |
| 25 | return id, err | 25 | return id, err |
| 26 | } | 26 | } |
| 27 | + | ||
| 27 | func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) { | 28 | func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) { |
| 28 | sqlBuildFields := []string{ | 29 | sqlBuildFields := []string{ |
| 29 | "dividends_estimate_id", | 30 | "dividends_estimate_id", |
| @@ -36,6 +37,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -36,6 +37,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 36 | "order_or_returned_order_num", | 37 | "order_or_returned_order_num", |
| 37 | "cooperation_contract_number", | 38 | "cooperation_contract_number", |
| 38 | "dividends_user", | 39 | "dividends_user", |
| 40 | + "dividends_stage", | ||
| 39 | "org", | 41 | "org", |
| 40 | "company", | 42 | "company", |
| 41 | "operator", | 43 | "operator", |
| @@ -69,6 +71,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -69,6 +71,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 69 | ÷ndsEstimate.OrderOrReturnedOrderNum, | 71 | ÷ndsEstimate.OrderOrReturnedOrderNum, |
| 70 | ÷ndsEstimate.CooperationContractNumber, | 72 | ÷ndsEstimate.CooperationContractNumber, |
| 71 | ÷ndsEstimate.DividendsUser, | 73 | ÷ndsEstimate.DividendsUser, |
| 74 | + ÷ndsEstimate.DividendsStage, | ||
| 72 | ÷ndsEstimate.Org, | 75 | ÷ndsEstimate.Org, |
| 73 | ÷ndsEstimate.Company, | 76 | ÷ndsEstimate.Company, |
| 74 | ÷ndsEstimate.Operator, | 77 | ÷ndsEstimate.Operator, |
| @@ -88,6 +91,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -88,6 +91,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 88 | dividendsEstimate.OrderOrReturnedOrderNum, | 91 | dividendsEstimate.OrderOrReturnedOrderNum, |
| 89 | dividendsEstimate.CooperationContractNumber, | 92 | dividendsEstimate.CooperationContractNumber, |
| 90 | dividendsEstimate.DividendsUser, | 93 | dividendsEstimate.DividendsUser, |
| 94 | + dividendsEstimate.DividendsStage, | ||
| 91 | dividendsEstimate.Org, | 95 | dividendsEstimate.Org, |
| 92 | dividendsEstimate.Company, | 96 | dividendsEstimate.Company, |
| 93 | dividendsEstimate.Operator, | 97 | dividendsEstimate.Operator, |
| @@ -111,6 +115,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -111,6 +115,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 111 | ÷ndsEstimate.OrderOrReturnedOrderNum, | 115 | ÷ndsEstimate.OrderOrReturnedOrderNum, |
| 112 | ÷ndsEstimate.CooperationContractNumber, | 116 | ÷ndsEstimate.CooperationContractNumber, |
| 113 | ÷ndsEstimate.DividendsUser, | 117 | ÷ndsEstimate.DividendsUser, |
| 118 | + ÷ndsEstimate.DividendsStage, | ||
| 114 | ÷ndsEstimate.Org, | 119 | ÷ndsEstimate.Org, |
| 115 | ÷ndsEstimate.Company, | 120 | ÷ndsEstimate.Company, |
| 116 | ÷ndsEstimate.Operator, | 121 | ÷ndsEstimate.Operator, |
| @@ -130,6 +135,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -130,6 +135,7 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 130 | dividendsEstimate.OrderOrReturnedOrderNum, | 135 | dividendsEstimate.OrderOrReturnedOrderNum, |
| 131 | dividendsEstimate.CooperationContractNumber, | 136 | dividendsEstimate.CooperationContractNumber, |
| 132 | dividendsEstimate.DividendsUser, | 137 | dividendsEstimate.DividendsUser, |
| 138 | + dividendsEstimate.DividendsStage, | ||
| 133 | dividendsEstimate.Org, | 139 | dividendsEstimate.Org, |
| 134 | dividendsEstimate.Company, | 140 | dividendsEstimate.Company, |
| 135 | dividendsEstimate.Operator, | 141 | dividendsEstimate.Operator, |
| @@ -144,6 +150,11 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | @@ -144,6 +150,11 @@ func (repository *DividendsEstimateRepository) Save(dividendsEstimate *domain.Di | ||
| 144 | } | 150 | } |
| 145 | return dividendsEstimate, nil | 151 | return dividendsEstimate, nil |
| 146 | } | 152 | } |
| 153 | + | ||
| 154 | +func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []*domain.DividendsEstimate) ([]*domain.DividendsEstimate, error) { | ||
| 155 | + panic("implement me") | ||
| 156 | +} | ||
| 157 | + | ||
| 147 | func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) { | 158 | func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) { |
| 148 | tx := repository.transactionContext.PgTx | 159 | tx := repository.transactionContext.PgTx |
| 149 | dividendsEstimateModel := new(models.DividendsEstimate) | 160 | dividendsEstimateModel := new(models.DividendsEstimate) |
| @@ -153,6 +164,7 @@ func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain. | @@ -153,6 +164,7 @@ func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain. | ||
| 153 | } | 164 | } |
| 154 | return dividendsEstimate, nil | 165 | return dividendsEstimate, nil |
| 155 | } | 166 | } |
| 167 | + | ||
| 156 | func (repository *DividendsEstimateRepository) FindOne(queryOptions map[string]interface{}) (*domain.DividendsEstimate, error) { | 168 | func (repository *DividendsEstimateRepository) FindOne(queryOptions map[string]interface{}) (*domain.DividendsEstimate, error) { |
| 157 | tx := repository.transactionContext.PgTx | 169 | tx := repository.transactionContext.PgTx |
| 158 | dividendsEstimateModel := new(models.DividendsEstimate) | 170 | dividendsEstimateModel := new(models.DividendsEstimate) |
| @@ -171,6 +183,7 @@ func (repository *DividendsEstimateRepository) FindOne(queryOptions map[string]i | @@ -171,6 +183,7 @@ func (repository *DividendsEstimateRepository) FindOne(queryOptions map[string]i | ||
| 171 | return transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel) | 183 | return transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel) |
| 172 | } | 184 | } |
| 173 | } | 185 | } |
| 186 | + | ||
| 174 | func (repository *DividendsEstimateRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.DividendsEstimate, error) { | 187 | func (repository *DividendsEstimateRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.DividendsEstimate, error) { |
| 175 | tx := repository.transactionContext.PgTx | 188 | tx := repository.transactionContext.PgTx |
| 176 | var dividendsEstimateModels []*models.DividendsEstimate | 189 | var dividendsEstimateModels []*models.DividendsEstimate |
| @@ -197,6 +210,7 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte | @@ -197,6 +210,7 @@ func (repository *DividendsEstimateRepository) Find(queryOptions map[string]inte | ||
| 197 | return int64(count), dividendsEstimates, nil | 210 | return int64(count), dividendsEstimates, nil |
| 198 | } | 211 | } |
| 199 | } | 212 | } |
| 213 | + | ||
| 200 | func NewDividendsEstimateRepository(transactionContext *pgTransaction.TransactionContext) (*DividendsEstimateRepository, error) { | 214 | func NewDividendsEstimateRepository(transactionContext *pgTransaction.TransactionContext) (*DividendsEstimateRepository, error) { |
| 201 | if transactionContext == nil { | 215 | if transactionContext == nil { |
| 202 | return nil, fmt.Errorf("transactionContext参数不能为nil") | 216 | return nil, fmt.Errorf("transactionContext参数不能为nil") |
| @@ -24,6 +24,7 @@ func (repository *DividendsIncentivesRuleRepository) nextIdentify() (int64, erro | @@ -24,6 +24,7 @@ func (repository *DividendsIncentivesRuleRepository) nextIdentify() (int64, erro | ||
| 24 | id, err := IdWorker.NextId() | 24 | id, err := IdWorker.NextId() |
| 25 | return id, err | 25 | return id, err |
| 26 | } | 26 | } |
| 27 | + | ||
| 27 | func (repository *DividendsIncentivesRuleRepository) Save(dividendsIncentivesRule *domain.DividendsIncentivesRule) (*domain.DividendsIncentivesRule, error) { | 28 | func (repository *DividendsIncentivesRuleRepository) Save(dividendsIncentivesRule *domain.DividendsIncentivesRule) (*domain.DividendsIncentivesRule, error) { |
| 28 | sqlBuildFields := []string{ | 29 | sqlBuildFields := []string{ |
| 29 | "dividends_incentives_rule_id", | 30 | "dividends_incentives_rule_id", |
| @@ -129,6 +130,7 @@ func (repository *DividendsIncentivesRuleRepository) Save(dividendsIncentivesRul | @@ -129,6 +130,7 @@ func (repository *DividendsIncentivesRuleRepository) Save(dividendsIncentivesRul | ||
| 129 | } | 130 | } |
| 130 | return dividendsIncentivesRule, nil | 131 | return dividendsIncentivesRule, nil |
| 131 | } | 132 | } |
| 133 | + | ||
| 132 | func (repository *DividendsIncentivesRuleRepository) Remove(dividendsIncentivesRule *domain.DividendsIncentivesRule) (*domain.DividendsIncentivesRule, error) { | 134 | func (repository *DividendsIncentivesRuleRepository) Remove(dividendsIncentivesRule *domain.DividendsIncentivesRule) (*domain.DividendsIncentivesRule, error) { |
| 133 | tx := repository.transactionContext.PgTx | 135 | tx := repository.transactionContext.PgTx |
| 134 | dividendsIncentivesRuleModel := new(models.DividendsIncentivesRule) | 136 | dividendsIncentivesRuleModel := new(models.DividendsIncentivesRule) |
| @@ -138,6 +140,7 @@ func (repository *DividendsIncentivesRuleRepository) Remove(dividendsIncentivesR | @@ -138,6 +140,7 @@ func (repository *DividendsIncentivesRuleRepository) Remove(dividendsIncentivesR | ||
| 138 | } | 140 | } |
| 139 | return dividendsIncentivesRule, nil | 141 | return dividendsIncentivesRule, nil |
| 140 | } | 142 | } |
| 143 | + | ||
| 141 | func (repository *DividendsIncentivesRuleRepository) FindOne(queryOptions map[string]interface{}) (*domain.DividendsIncentivesRule, error) { | 144 | func (repository *DividendsIncentivesRuleRepository) FindOne(queryOptions map[string]interface{}) (*domain.DividendsIncentivesRule, error) { |
| 142 | tx := repository.transactionContext.PgTx | 145 | tx := repository.transactionContext.PgTx |
| 143 | dividendsIncentivesRuleModel := new(models.DividendsIncentivesRule) | 146 | dividendsIncentivesRuleModel := new(models.DividendsIncentivesRule) |
| @@ -156,6 +159,7 @@ func (repository *DividendsIncentivesRuleRepository) FindOne(queryOptions map[st | @@ -156,6 +159,7 @@ func (repository *DividendsIncentivesRuleRepository) FindOne(queryOptions map[st | ||
| 156 | return transform.TransformToDividendsIncentivesRuleDomainModelFromPgModels(dividendsIncentivesRuleModel) | 159 | return transform.TransformToDividendsIncentivesRuleDomainModelFromPgModels(dividendsIncentivesRuleModel) |
| 157 | } | 160 | } |
| 158 | } | 161 | } |
| 162 | + | ||
| 159 | func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.DividendsIncentivesRule, error) { | 163 | func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.DividendsIncentivesRule, error) { |
| 160 | tx := repository.transactionContext.PgTx | 164 | tx := repository.transactionContext.PgTx |
| 161 | var dividendsIncentivesRuleModels []*models.DividendsIncentivesRule | 165 | var dividendsIncentivesRuleModels []*models.DividendsIncentivesRule |
| @@ -182,6 +186,7 @@ func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[strin | @@ -182,6 +186,7 @@ func (repository *DividendsIncentivesRuleRepository) Find(queryOptions map[strin | ||
| 182 | return int64(count), dividendsIncentivesRules, nil | 186 | return int64(count), dividendsIncentivesRules, nil |
| 183 | } | 187 | } |
| 184 | } | 188 | } |
| 189 | + | ||
| 185 | func NewDividendsIncentivesRuleRepository(transactionContext *pgTransaction.TransactionContext) (*DividendsIncentivesRuleRepository, error) { | 190 | func NewDividendsIncentivesRuleRepository(transactionContext *pgTransaction.TransactionContext) (*DividendsIncentivesRuleRepository, error) { |
| 186 | if transactionContext == nil { | 191 | if transactionContext == nil { |
| 187 | return nil, fmt.Errorf("transactionContext参数不能为nil") | 192 | return nil, fmt.Errorf("transactionContext参数不能为nil") |
| @@ -24,6 +24,7 @@ func (repository *MoneyIncentivesRuleRepository) nextIdentify() (int64, error) { | @@ -24,6 +24,7 @@ func (repository *MoneyIncentivesRuleRepository) nextIdentify() (int64, error) { | ||
| 24 | id, err := IdWorker.NextId() | 24 | id, err := IdWorker.NextId() |
| 25 | return id, err | 25 | return id, err |
| 26 | } | 26 | } |
| 27 | + | ||
| 27 | func (repository *MoneyIncentivesRuleRepository) Save(moneyIncentivesRule *domain.MoneyIncentivesRule) (*domain.MoneyIncentivesRule, error) { | 28 | func (repository *MoneyIncentivesRuleRepository) Save(moneyIncentivesRule *domain.MoneyIncentivesRule) (*domain.MoneyIncentivesRule, error) { |
| 28 | sqlBuildFields := []string{ | 29 | sqlBuildFields := []string{ |
| 29 | "money_incentives_rule_id", | 30 | "money_incentives_rule_id", |
| @@ -129,6 +130,7 @@ func (repository *MoneyIncentivesRuleRepository) Save(moneyIncentivesRule *domai | @@ -129,6 +130,7 @@ func (repository *MoneyIncentivesRuleRepository) Save(moneyIncentivesRule *domai | ||
| 129 | } | 130 | } |
| 130 | return moneyIncentivesRule, nil | 131 | return moneyIncentivesRule, nil |
| 131 | } | 132 | } |
| 133 | + | ||
| 132 | func (repository *MoneyIncentivesRuleRepository) Remove(moneyIncentivesRule *domain.MoneyIncentivesRule) (*domain.MoneyIncentivesRule, error) { | 134 | func (repository *MoneyIncentivesRuleRepository) Remove(moneyIncentivesRule *domain.MoneyIncentivesRule) (*domain.MoneyIncentivesRule, error) { |
| 133 | tx := repository.transactionContext.PgTx | 135 | tx := repository.transactionContext.PgTx |
| 134 | moneyIncentivesRuleModel := new(models.MoneyIncentivesRule) | 136 | moneyIncentivesRuleModel := new(models.MoneyIncentivesRule) |
| @@ -138,6 +140,7 @@ func (repository *MoneyIncentivesRuleRepository) Remove(moneyIncentivesRule *dom | @@ -138,6 +140,7 @@ func (repository *MoneyIncentivesRuleRepository) Remove(moneyIncentivesRule *dom | ||
| 138 | } | 140 | } |
| 139 | return moneyIncentivesRule, nil | 141 | return moneyIncentivesRule, nil |
| 140 | } | 142 | } |
| 143 | + | ||
| 141 | func (repository *MoneyIncentivesRuleRepository) FindOne(queryOptions map[string]interface{}) (*domain.MoneyIncentivesRule, error) { | 144 | func (repository *MoneyIncentivesRuleRepository) FindOne(queryOptions map[string]interface{}) (*domain.MoneyIncentivesRule, error) { |
| 142 | tx := repository.transactionContext.PgTx | 145 | tx := repository.transactionContext.PgTx |
| 143 | moneyIncentivesRuleModel := new(models.MoneyIncentivesRule) | 146 | moneyIncentivesRuleModel := new(models.MoneyIncentivesRule) |
| @@ -156,6 +159,7 @@ func (repository *MoneyIncentivesRuleRepository) FindOne(queryOptions map[string | @@ -156,6 +159,7 @@ func (repository *MoneyIncentivesRuleRepository) FindOne(queryOptions map[string | ||
| 156 | return transform.TransformToMoneyIncentivesRuleDomainModelFromPgModels(moneyIncentivesRuleModel) | 159 | return transform.TransformToMoneyIncentivesRuleDomainModelFromPgModels(moneyIncentivesRuleModel) |
| 157 | } | 160 | } |
| 158 | } | 161 | } |
| 162 | + | ||
| 159 | func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.MoneyIncentivesRule, error) { | 163 | func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]interface{}) (int64, []*domain.MoneyIncentivesRule, error) { |
| 160 | tx := repository.transactionContext.PgTx | 164 | tx := repository.transactionContext.PgTx |
| 161 | var moneyIncentivesRuleModels []*models.MoneyIncentivesRule | 165 | var moneyIncentivesRuleModels []*models.MoneyIncentivesRule |
| @@ -182,6 +186,7 @@ func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]in | @@ -182,6 +186,7 @@ func (repository *MoneyIncentivesRuleRepository) Find(queryOptions map[string]in | ||
| 182 | return int64(count), moneyIncentivesRules, nil | 186 | return int64(count), moneyIncentivesRules, nil |
| 183 | } | 187 | } |
| 184 | } | 188 | } |
| 189 | + | ||
| 185 | func NewMoneyIncentivesRuleRepository(transactionContext *pgTransaction.TransactionContext) (*MoneyIncentivesRuleRepository, error) { | 190 | func NewMoneyIncentivesRuleRepository(transactionContext *pgTransaction.TransactionContext) (*MoneyIncentivesRuleRepository, error) { |
| 186 | if transactionContext == nil { | 191 | if transactionContext == nil { |
| 187 | return nil, fmt.Errorf("transactionContext参数不能为nil") | 192 | return nil, fmt.Errorf("transactionContext参数不能为nil") |
| @@ -10,6 +10,7 @@ type DividendsEstimateController struct { | @@ -10,6 +10,7 @@ type DividendsEstimateController struct { | ||
| 10 | BaseController | 10 | BaseController |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | +// CreateDividendsEstimate 新增分红预算单(预留) | ||
| 13 | func (controller *DividendsEstimateController) CreateDividendsEstimate() { | 14 | func (controller *DividendsEstimateController) CreateDividendsEstimate() { |
| 14 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 15 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 15 | createDividendsEstimateCommand := &command.CreateDividendsEstimateCommand{} | 16 | createDividendsEstimateCommand := &command.CreateDividendsEstimateCommand{} |
| @@ -23,6 +24,7 @@ func (controller *DividendsEstimateController) CreateDividendsEstimate() { | @@ -23,6 +24,7 @@ func (controller *DividendsEstimateController) CreateDividendsEstimate() { | ||
| 23 | controller.Response(data, err) | 24 | controller.Response(data, err) |
| 24 | } | 25 | } |
| 25 | 26 | ||
| 27 | +// UpdateDividendsEstimate 编辑分红预算单(预留) | ||
| 26 | func (controller *DividendsEstimateController) UpdateDividendsEstimate() { | 28 | func (controller *DividendsEstimateController) UpdateDividendsEstimate() { |
| 27 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 29 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 28 | updateDividendsEstimateCommand := &command.UpdateDividendsEstimateCommand{} | 30 | updateDividendsEstimateCommand := &command.UpdateDividendsEstimateCommand{} |
| @@ -38,6 +40,7 @@ func (controller *DividendsEstimateController) UpdateDividendsEstimate() { | @@ -38,6 +40,7 @@ func (controller *DividendsEstimateController) UpdateDividendsEstimate() { | ||
| 38 | controller.Response(data, err) | 40 | controller.Response(data, err) |
| 39 | } | 41 | } |
| 40 | 42 | ||
| 43 | +// GetDividendsEstimate 获取分红预算单详情 | ||
| 41 | func (controller *DividendsEstimateController) GetDividendsEstimate() { | 44 | func (controller *DividendsEstimateController) GetDividendsEstimate() { |
| 42 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 45 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 43 | getDividendsEstimateQuery := &query.GetDividendsEstimateQuery{} | 46 | getDividendsEstimateQuery := &query.GetDividendsEstimateQuery{} |
| @@ -52,6 +55,7 @@ func (controller *DividendsEstimateController) GetDividendsEstimate() { | @@ -52,6 +55,7 @@ func (controller *DividendsEstimateController) GetDividendsEstimate() { | ||
| 52 | controller.Response(data, err) | 55 | controller.Response(data, err) |
| 53 | } | 56 | } |
| 54 | 57 | ||
| 58 | +// RemoveDividendsEstimate 移除分红预算单(预留) | ||
| 55 | func (controller *DividendsEstimateController) RemoveDividendsEstimate() { | 59 | func (controller *DividendsEstimateController) RemoveDividendsEstimate() { |
| 56 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 60 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 57 | removeDividendsEstimateCommand := &command.RemoveDividendsEstimateCommand{} | 61 | removeDividendsEstimateCommand := &command.RemoveDividendsEstimateCommand{} |
| @@ -67,6 +71,7 @@ func (controller *DividendsEstimateController) RemoveDividendsEstimate() { | @@ -67,6 +71,7 @@ func (controller *DividendsEstimateController) RemoveDividendsEstimate() { | ||
| 67 | controller.Response(data, err) | 71 | controller.Response(data, err) |
| 68 | } | 72 | } |
| 69 | 73 | ||
| 74 | +// CancelDividendsEstimate 取消分红预算单 | ||
| 70 | func (controller *DividendsEstimateController) CancelDividendsEstimate() { | 75 | func (controller *DividendsEstimateController) CancelDividendsEstimate() { |
| 71 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 76 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 72 | cancelDividendsEstimateCommand := &command.CancelDividendsEstimateCommand{} | 77 | cancelDividendsEstimateCommand := &command.CancelDividendsEstimateCommand{} |
| @@ -82,6 +87,21 @@ func (controller *DividendsEstimateController) CancelDividendsEstimate() { | @@ -82,6 +87,21 @@ func (controller *DividendsEstimateController) CancelDividendsEstimate() { | ||
| 82 | controller.Response(data, err) | 87 | controller.Response(data, err) |
| 83 | } | 88 | } |
| 84 | 89 | ||
| 90 | +// BatchCancelDividendsEstimate 批量取消分红预算单 | ||
| 91 | +func (controller *DividendsEstimateController) BatchCancelDividendsEstimate() { | ||
| 92 | + dividendsEstimateService := service.NewDividendsEstimateService(nil) | ||
| 93 | + batchCancelDividendsEstimateCommand := &command.BatchCancelDividendsEstimateCommand{} | ||
| 94 | + _ = controller.Unmarshal(batchCancelDividendsEstimateCommand) | ||
| 95 | + header := controller.GetRequestHeader(controller.Ctx) | ||
| 96 | + batchCancelDividendsEstimateCommand.CompanyId = header.CompanyId | ||
| 97 | + batchCancelDividendsEstimateCommand.OrgId = header.OrgId | ||
| 98 | + batchCancelDividendsEstimateCommand.UserId = header.UserId | ||
| 99 | + batchCancelDividendsEstimateCommand.UserBaseId = header.UserBaseId | ||
| 100 | + data, err := dividendsEstimateService.BatchCancelDividendsEstimate(batchCancelDividendsEstimateCommand) | ||
| 101 | + controller.Response(data, err) | ||
| 102 | +} | ||
| 103 | + | ||
| 104 | +// SearchDividendsEstimate 搜索分红预算单 | ||
| 85 | func (controller *DividendsEstimateController) SearchDividendsEstimate() { | 105 | func (controller *DividendsEstimateController) SearchDividendsEstimate() { |
| 86 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 106 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 87 | searchDividendsEstimateQuery := &query.SearchDividendsEstimateQuery{} | 107 | searchDividendsEstimateQuery := &query.SearchDividendsEstimateQuery{} |
| @@ -95,7 +115,8 @@ func (controller *DividendsEstimateController) SearchDividendsEstimate() { | @@ -95,7 +115,8 @@ func (controller *DividendsEstimateController) SearchDividendsEstimate() { | ||
| 95 | controller.Response(data, err) | 115 | controller.Response(data, err) |
| 96 | } | 116 | } |
| 97 | 117 | ||
| 98 | -func (controller *DividendsEstimateController) EstimateDividendsIncentives() { | 118 | +// ConfirmDividendsIncentivesEstimate 确定业绩激励分红预算 |
| 119 | +func (controller *DividendsEstimateController) ConfirmDividendsIncentivesEstimate() { | ||
| 99 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 120 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 100 | estimateDividendsIncentivesCommand := &command.ConfirmDividendsIncentivesEstimateCommand{} | 121 | estimateDividendsIncentivesCommand := &command.ConfirmDividendsIncentivesEstimateCommand{} |
| 101 | _ = controller.Unmarshal(estimateDividendsIncentivesCommand) | 122 | _ = controller.Unmarshal(estimateDividendsIncentivesCommand) |
| @@ -104,48 +125,52 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() { | @@ -104,48 +125,52 @@ func (controller *DividendsEstimateController) EstimateDividendsIncentives() { | ||
| 104 | estimateDividendsIncentivesCommand.OrgId = header.OrgId | 125 | estimateDividendsIncentivesCommand.OrgId = header.OrgId |
| 105 | estimateDividendsIncentivesCommand.UserId = header.UserId | 126 | estimateDividendsIncentivesCommand.UserId = header.UserId |
| 106 | estimateDividendsIncentivesCommand.UserBaseId = header.UserBaseId | 127 | estimateDividendsIncentivesCommand.UserBaseId = header.UserBaseId |
| 107 | - data, err := dividendsEstimateService.EstimateDividendsIncentives(estimateDividendsIncentivesCommand) | 128 | + data, err := dividendsEstimateService.ConfirmDividendsIncentivesEstimate(estimateDividendsIncentivesCommand) |
| 108 | controller.Response(data, err) | 129 | controller.Response(data, err) |
| 109 | } | 130 | } |
| 110 | 131 | ||
| 111 | -func (controller *DividendsEstimateController) EstimateMoneyIncentives() { | 132 | +// ConfirmMoneyIncentivesEstimate 确定金额激励分红预算 |
| 133 | +func (controller *DividendsEstimateController) ConfirmMoneyIncentivesEstimate() { | ||
| 112 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 134 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 113 | - estimateMoneyIncentivesCommand := &command.ConfirmMoneyIncentivesEstimateCommand{} | ||
| 114 | - _ = controller.Unmarshal(estimateMoneyIncentivesCommand) | 135 | + confirmMoneyIncentivesEstimateCommand := &command.ConfirmMoneyIncentivesEstimateCommand{} |
| 136 | + _ = controller.Unmarshal(confirmMoneyIncentivesEstimateCommand) | ||
| 115 | header := controller.GetRequestHeader(controller.Ctx) | 137 | header := controller.GetRequestHeader(controller.Ctx) |
| 116 | - estimateMoneyIncentivesCommand.CompanyId = header.CompanyId | ||
| 117 | - estimateMoneyIncentivesCommand.OrgId = header.OrgId | ||
| 118 | - estimateMoneyIncentivesCommand.UserId = header.UserId | ||
| 119 | - estimateMoneyIncentivesCommand.UserBaseId = header.UserBaseId | ||
| 120 | - data, err := dividendsEstimateService.EstimateMoneyIncentives(estimateMoneyIncentivesCommand) | 138 | + confirmMoneyIncentivesEstimateCommand.CompanyId = header.CompanyId |
| 139 | + confirmMoneyIncentivesEstimateCommand.OrgId = header.OrgId | ||
| 140 | + confirmMoneyIncentivesEstimateCommand.UserId = header.UserId | ||
| 141 | + confirmMoneyIncentivesEstimateCommand.UserBaseId = header.UserBaseId | ||
| 142 | + data, err := dividendsEstimateService.ConfirmMoneyIncentivesEstimate(confirmMoneyIncentivesEstimateCommand) | ||
| 121 | controller.Response(data, err) | 143 | controller.Response(data, err) |
| 122 | } | 144 | } |
| 123 | 145 | ||
| 124 | -func (controller *DividendsEstimateController) ListMoneyIncentives() { | 146 | +// ListMoneyIncentivesEstimate 返回金额激励分红预算信息列表 |
| 147 | +func (controller *DividendsEstimateController) ListMoneyIncentivesEstimate() { | ||
| 125 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 148 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 126 | - listMoneyIncentivesQuery := &query.ListMoneyIncentivesEstimateQuery{} | 149 | + listMoneyIncentivesEstimateQuery := &query.ListMoneyIncentivesEstimateQuery{} |
| 127 | header := controller.GetRequestHeader(controller.Ctx) | 150 | header := controller.GetRequestHeader(controller.Ctx) |
| 128 | - listMoneyIncentivesQuery.CompanyId = header.CompanyId | ||
| 129 | - listMoneyIncentivesQuery.OrgId = header.OrgId | ||
| 130 | - listMoneyIncentivesQuery.UserId = header.UserId | ||
| 131 | - listMoneyIncentivesQuery.UserBaseId = header.UserBaseId | ||
| 132 | - data, err := dividendsEstimateService.ListMoneyIncentives(listMoneyIncentivesQuery) | 151 | + listMoneyIncentivesEstimateQuery.CompanyId = header.CompanyId |
| 152 | + listMoneyIncentivesEstimateQuery.OrgId = header.OrgId | ||
| 153 | + listMoneyIncentivesEstimateQuery.UserId = header.UserId | ||
| 154 | + listMoneyIncentivesEstimateQuery.UserBaseId = header.UserBaseId | ||
| 155 | + data, err := dividendsEstimateService.ListMoneyIncentivesEstimate(listMoneyIncentivesEstimateQuery) | ||
| 133 | controller.Response(data, err) | 156 | controller.Response(data, err) |
| 134 | } | 157 | } |
| 135 | 158 | ||
| 136 | -func (controller *DividendsEstimateController) SearchMoneyIncentives() { | 159 | +// SearchMoneyIncentivesEstimate 搜索金额激励分红预算信息 |
| 160 | +func (controller *DividendsEstimateController) SearchMoneyIncentivesEstimate() { | ||
| 137 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 161 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 138 | - searchMoneyIncentivesQuery := &query.SearchMoneyIncentivesEstimateQuery{} | 162 | + searchMoneyIncentivesEstimateQuery := &query.SearchMoneyIncentivesEstimateQuery{} |
| 139 | header := controller.GetRequestHeader(controller.Ctx) | 163 | header := controller.GetRequestHeader(controller.Ctx) |
| 140 | - searchMoneyIncentivesQuery.CompanyId = header.CompanyId | ||
| 141 | - searchMoneyIncentivesQuery.OrgId = header.OrgId | ||
| 142 | - searchMoneyIncentivesQuery.UserId = header.UserId | ||
| 143 | - searchMoneyIncentivesQuery.UserBaseId = header.UserBaseId | ||
| 144 | - data, err := dividendsEstimateService.SearchMoneyIncentives(searchMoneyIncentivesQuery) | 164 | + searchMoneyIncentivesEstimateQuery.CompanyId = header.CompanyId |
| 165 | + searchMoneyIncentivesEstimateQuery.OrgId = header.OrgId | ||
| 166 | + searchMoneyIncentivesEstimateQuery.UserId = header.UserId | ||
| 167 | + searchMoneyIncentivesEstimateQuery.UserBaseId = header.UserBaseId | ||
| 168 | + data, err := dividendsEstimateService.SearchMoneyIncentivesEstimate(searchMoneyIncentivesEstimateQuery) | ||
| 145 | controller.Response(data, err) | 169 | controller.Response(data, err) |
| 146 | } | 170 | } |
| 147 | 171 | ||
| 148 | -func (controller *DividendsEstimateController) ListDividendsIncentives() { | 172 | +// ListDividendsIncentivesEstimate 返回业绩激励分红预算信息列表 |
| 173 | +func (controller *DividendsEstimateController) ListDividendsIncentivesEstimate() { | ||
| 149 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 174 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 150 | listDividendsIncentivesQuery := &query.ListDividendsIncentivesEstimateQuery{} | 175 | listDividendsIncentivesQuery := &query.ListDividendsIncentivesEstimateQuery{} |
| 151 | header := controller.GetRequestHeader(controller.Ctx) | 176 | header := controller.GetRequestHeader(controller.Ctx) |
| @@ -153,11 +178,12 @@ func (controller *DividendsEstimateController) ListDividendsIncentives() { | @@ -153,11 +178,12 @@ func (controller *DividendsEstimateController) ListDividendsIncentives() { | ||
| 153 | listDividendsIncentivesQuery.OrgId = header.OrgId | 178 | listDividendsIncentivesQuery.OrgId = header.OrgId |
| 154 | listDividendsIncentivesQuery.UserId = header.UserId | 179 | listDividendsIncentivesQuery.UserId = header.UserId |
| 155 | listDividendsIncentivesQuery.UserBaseId = header.UserBaseId | 180 | listDividendsIncentivesQuery.UserBaseId = header.UserBaseId |
| 156 | - data, err := dividendsEstimateService.ListDividendsIncentives(listDividendsIncentivesQuery) | 181 | + data, err := dividendsEstimateService.ListDividendsIncentivesEstimate(listDividendsIncentivesQuery) |
| 157 | controller.Response(data, err) | 182 | controller.Response(data, err) |
| 158 | } | 183 | } |
| 159 | 184 | ||
| 160 | -func (controller *DividendsEstimateController) SearchDividendsIncentives() { | 185 | +// SearchDividendsIncentivesEstimate 搜索业绩激励分红预算信息 |
| 186 | +func (controller *DividendsEstimateController) SearchDividendsIncentivesEstimate() { | ||
| 161 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 187 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 162 | searchDividendsIncentivesQuery := &query.SearchDividendsIncentivesEstimateQuery{} | 188 | searchDividendsIncentivesQuery := &query.SearchDividendsIncentivesEstimateQuery{} |
| 163 | header := controller.GetRequestHeader(controller.Ctx) | 189 | header := controller.GetRequestHeader(controller.Ctx) |
| @@ -165,10 +191,11 @@ func (controller *DividendsEstimateController) SearchDividendsIncentives() { | @@ -165,10 +191,11 @@ func (controller *DividendsEstimateController) SearchDividendsIncentives() { | ||
| 165 | searchDividendsIncentivesQuery.OrgId = header.OrgId | 191 | searchDividendsIncentivesQuery.OrgId = header.OrgId |
| 166 | searchDividendsIncentivesQuery.UserId = header.UserId | 192 | searchDividendsIncentivesQuery.UserId = header.UserId |
| 167 | searchDividendsIncentivesQuery.UserBaseId = header.UserBaseId | 193 | searchDividendsIncentivesQuery.UserBaseId = header.UserBaseId |
| 168 | - data, err := dividendsEstimateService.SearchDividendsIncentives(searchDividendsIncentivesQuery) | 194 | + data, err := dividendsEstimateService.SearchDividendsIncentivesEstimate(searchDividendsIncentivesQuery) |
| 169 | controller.Response(data, err) | 195 | controller.Response(data, err) |
| 170 | } | 196 | } |
| 171 | 197 | ||
| 198 | +// ListDividendsEstimate 返回分红预算单列表 | ||
| 172 | func (controller *DividendsEstimateController) ListDividendsEstimate() { | 199 | func (controller *DividendsEstimateController) ListDividendsEstimate() { |
| 173 | dividendsEstimateService := service.NewDividendsEstimateService(nil) | 200 | dividendsEstimateService := service.NewDividendsEstimateService(nil) |
| 174 | listDividendsEstimateQuery := &query.ListDividendsEstimateQuery{} | 201 | listDividendsEstimateQuery := &query.ListDividendsEstimateQuery{} |
| @@ -6,17 +6,18 @@ import ( | @@ -6,17 +6,18 @@ import ( | ||
| 6 | ) | 6 | ) |
| 7 | 7 | ||
| 8 | func init() { | 8 | func init() { |
| 9 | - web.Router("/dividends-estimates/", &controllers.DividendsEstimateController{}, "Post:CreateDividendsEstimate") | ||
| 10 | - web.Router("/dividends-estimates/:dividendsEstimateId", &controllers.DividendsEstimateController{}, "Put:UpdateDividendsEstimate") | ||
| 11 | - web.Router("/dividends-estimates/:dividendsEstimateId", &controllers.DividendsEstimateController{}, "Get:GetDividendsEstimate") | ||
| 12 | - web.Router("/dividends-estimates/:dividendsEstimateId", &controllers.DividendsEstimateController{}, "Delete:RemoveDividendsEstimate") | ||
| 13 | - web.Router("/dividends-estimates/:dividendsEstimateId/cancel", &controllers.DividendsEstimateController{}, "Post:CancelDividendsEstimate") | ||
| 14 | - web.Router("/dividends-estimates/search", &controllers.DividendsEstimateController{}, "Post:SearchDividendsEstimate") | ||
| 15 | - web.Router("/dividends-estimates/estimate-dividends-incentives", &controllers.DividendsEstimateController{}, "Post:EstimateDividendsIncentives") | ||
| 16 | - web.Router("/dividends-estimates/estimate-money-incentives", &controllers.DividendsEstimateController{}, "Post:EstimateMoneyIncentives") | ||
| 17 | - web.Router("/dividends-estimates/list-money-incentives", &controllers.DividendsEstimateController{}, "Get:ListMoneyIncentives") | ||
| 18 | - web.Router("/dividends-estimates/search-money-incentives", &controllers.DividendsEstimateController{}, "Post:SearchMoneyIncentives") | ||
| 19 | - web.Router("/dividends-estimates/list-dividends-incentives", &controllers.DividendsEstimateController{}, "Get:ListDividendsIncentives") | ||
| 20 | - web.Router("/dividends-estimates/search-dividends-incentives", &controllers.DividendsEstimateController{}, "Post:SearchDividendsIncentives") | ||
| 21 | - web.Router("/dividends-estimates/", &controllers.DividendsEstimateController{}, "Get:ListDividendsEstimate") | 9 | + web.Router("/dividends-estimates/", &controllers.DividendsEstimateController{}, "Post:CreateDividendsEstimate") // 新增分红预算单(预留) |
| 10 | + web.Router("/dividends-estimates/:dividendsEstimateId", &controllers.DividendsEstimateController{}, "Put:UpdateDividendsEstimate") // 编辑分红预算单(预留) | ||
| 11 | + web.Router("/dividends-estimates/:dividendsEstimateId", &controllers.DividendsEstimateController{}, "Get:GetDividendsEstimate") // 返回分红预算单详情 | ||
| 12 | + web.Router("/dividends-estimates/:dividendsEstimateId", &controllers.DividendsEstimateController{}, "Delete:RemoveDividendsEstimate") // 移除分红预算单(预留) | ||
| 13 | + web.Router("/dividends-estimates/:dividendsEstimateId/cancel", &controllers.DividendsEstimateController{}, "Post:CancelDividendsEstimate") // 取消分红预算单 | ||
| 14 | + web.Router("/dividends-estimates/batch-cancel", &controllers.DividendsEstimateController{}, "Post:BatchCancelDividendsEstimate") // 批量取消分红预算单 | ||
| 15 | + web.Router("/dividends-estimates/search", &controllers.DividendsEstimateController{}, "Post:SearchDividendsEstimate") // 搜索分红预算单 | ||
| 16 | + web.Router("/dividends-estimates/estimate-dividends-incentives", &controllers.DividendsEstimateController{}, "Post:ConfirmDividendsIncentivesEstimate") // 确认业绩积累激励分红预算 | ||
| 17 | + web.Router("/dividends-estimates/estimate-money-incentives", &controllers.DividendsEstimateController{}, "Post:ConfirmMoneyIncentivesEstimate") // 确认金额激励分红预算 | ||
| 18 | + web.Router("/dividends-estimates/list-money-incentives", &controllers.DividendsEstimateController{}, "Get:ListMoneyIncentivesEstimate") // 返回金额激励分红预算信息列表 | ||
| 19 | + web.Router("/dividends-estimates/search-money-incentives", &controllers.DividendsEstimateController{}, "Post:SearchMoneyIncentivesEstimate") // 搜索金额激励分红预算信息列表 | ||
| 20 | + web.Router("/dividends-estimates/list-dividends-incentives", &controllers.DividendsEstimateController{}, "Get:ListDividendsIncentivesEstimate") // 返回业绩激励分红预算信息列表 | ||
| 21 | + web.Router("/dividends-estimates/search-dividends-incentives", &controllers.DividendsEstimateController{}, "Post:SearchDividendsIncentivesEstimate") // 搜索业绩激励分红预算信息列表 | ||
| 22 | + web.Router("/dividends-estimates/", &controllers.DividendsEstimateController{}, "Get:ListDividendsEstimate") // 返回分红预算单列表 | ||
| 22 | } | 23 | } |
-
请 注册 或 登录 后发表评论