作者 tangxuhui

分红预算 更新

1 -{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628752601441259500}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628818869330120900}
@@ -112,7 +112,6 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon @@ -112,7 +112,6 @@ func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationCon
112 DepartmentName: v.Department.DepartmentName, 112 DepartmentName: v.Department.DepartmentName,
113 }} 113 }}
114 relevants = append(relevants, r) 114 relevants = append(relevants, r)
115 -  
116 } 115 }
117 116
118 for _, v := range param.DividendsIncentivesRules { 117 for _, v := range param.DividendsIncentivesRules {
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type CancelDividendsEstimateCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + DividendsEstimateId []string `json:"dividendsEstimateId"`
  14 +}
  15 +
  16 +func (cancelDividendsEstimateCommand *CancelDividendsEstimateCommand) Valid(validation *validation.Validation) {
  17 +
  18 +}
  19 +
  20 +func (cancelDividendsEstimateCommand *CancelDividendsEstimateCommand) ValidateCommand() error {
  21 + valid := validation.Validation{}
  22 + b, err := valid.Valid(cancelDividendsEstimateCommand)
  23 + if err != nil {
  24 + return err
  25 + }
  26 + if !b {
  27 + for _, validErr := range valid.Errors {
  28 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  29 + }
  30 + }
  31 + return nil
  32 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type EstimateDividendsIncentivesCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 分红订单号/退货单号
  14 + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum" valid:"Required"`
  15 + // 合约编号
  16 + CooperationContractNumber string `json:"cooperationContractNumber" valid:"Required"`
  17 +}
  18 +
  19 +func (estimateDividendsIncentivesCommand *EstimateDividendsIncentivesCommand) Valid(validation *validation.Validation) {
  20 + validation.SetError("CustomValid", "未实现的自定义认证")
  21 +}
  22 +
  23 +func (estimateDividendsIncentivesCommand *EstimateDividendsIncentivesCommand) ValidateCommand() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(estimateDividendsIncentivesCommand)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type EstimateMoneyIncentivesCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 共创项目合约编号
  14 + CooperationContractNumber string `json:"cooperationContractNumber" valid:"Required"`
  15 + // 承接人UID
  16 + UndertakerUid string `json:"undertakerUid,omitempty"`
  17 +}
  18 +
  19 +func (estimateMoneyIncentivesCommand *EstimateMoneyIncentivesCommand) Valid(validation *validation.Validation) {
  20 + validation.SetError("CustomValid", "未实现的自定义认证")
  21 +}
  22 +
  23 +func (estimateMoneyIncentivesCommand *EstimateMoneyIncentivesCommand) ValidateCommand() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(estimateMoneyIncentivesCommand)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type RemoveDividendsEstimateCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 承接人分红预算记录ID
  14 + DividendsEstimateId int64 `json:"dividendsEstimateId" valid:"Required"`
  15 +}
  16 +
  17 +func (removeDividendsEstimateCommand *RemoveDividendsEstimateCommand) Valid(validation *validation.Validation) {
  18 + validation.SetError("CustomValid", "未实现的自定义认证")
  19 +}
  20 +
  21 +func (removeDividendsEstimateCommand *RemoveDividendsEstimateCommand) ValidateCommand() error {
  22 + valid := validation.Validation{}
  23 + b, err := valid.Valid(removeDividendsEstimateCommand)
  24 + if err != nil {
  25 + return err
  26 + }
  27 + if !b {
  28 + for _, validErr := range valid.Errors {
  29 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  30 + }
  31 + }
  32 + return nil
  33 +}
  1 +package command
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type UpdateDividendsEstimateCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 承接人分红预算记录ID
  14 + DividendsEstimateId int64 `json:"dividendsEstimateId" valid:"Required"`
  15 +}
  16 +
  17 +func (updateDividendsEstimateCommand *UpdateDividendsEstimateCommand) Valid(validation *validation.Validation) {
  18 + validation.SetError("CustomValid", "未实现的自定义认证")
  19 +}
  20 +
  21 +func (updateDividendsEstimateCommand *UpdateDividendsEstimateCommand) ValidateCommand() error {
  22 + valid := validation.Validation{}
  23 + b, err := valid.Valid(updateDividendsEstimateCommand)
  24 + if err != nil {
  25 + return err
  26 + }
  27 + if !b {
  28 + for _, validErr := range valid.Errors {
  29 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  30 + }
  31 + }
  32 + return nil
  33 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type GetDividendsEstimateQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 承接人分红预算记录ID
  14 + DividendsEstimateId int64 `json:"dividendsEstimateId" valid:"Required"`
  15 +}
  16 +
  17 +func (getDividendsEstimateQuery *GetDividendsEstimateQuery) Valid(validation *validation.Validation) {
  18 + validation.SetError("CustomValid", "未实现的自定义认证")
  19 +}
  20 +
  21 +func (getDividendsEstimateQuery *GetDividendsEstimateQuery) ValidateQuery() error {
  22 + valid := validation.Validation{}
  23 + b, err := valid.Valid(getDividendsEstimateQuery)
  24 + if err != nil {
  25 + return err
  26 + }
  27 + if !b {
  28 + for _, validErr := range valid.Errors {
  29 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  30 + }
  31 + }
  32 + return nil
  33 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type ListDividendsEstimateQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 查询偏离量
  14 + PageNumber int `json:"pageNumber" `
  15 + // 查询限制
  16 + PageSize int `json:"pageSize"`
  17 +}
  18 +
  19 +func (listDividendsEstimateQuery *ListDividendsEstimateQuery) Valid(validation *validation.Validation) {
  20 +
  21 +}
  22 +
  23 +func (listDividendsEstimateQuery *ListDividendsEstimateQuery) ValidateQuery() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(listDividendsEstimateQuery)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type ListDividendsIncentivesQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 查询偏离量
  14 + PageNumber int `json:"pageNumber" `
  15 + // 查询限制
  16 + PageSize int `json:"pageSize" `
  17 +}
  18 +
  19 +func (listDividendsIncentivesQuery *ListDividendsIncentivesQuery) Valid(validation *validation.Validation) {
  20 +
  21 +}
  22 +
  23 +func (listDividendsIncentivesQuery *ListDividendsIncentivesQuery) ValidateQuery() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(listDividendsIncentivesQuery)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type ListMoneyIncentivesQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 查询偏离量
  14 + PageNumber int `json:"pageNumber" valid:"Required"`
  15 + // 查询限制
  16 + PageSize int `json:"pageSize" valid:"Required"`
  17 +}
  18 +
  19 +func (listMoneyIncentivesQuery *ListMoneyIncentivesQuery) Valid(validation *validation.Validation) {
  20 +
  21 +}
  22 +
  23 +func (listMoneyIncentivesQuery *ListMoneyIncentivesQuery) ValidateQuery() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(listMoneyIncentivesQuery)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type SearchDividendsEstimateQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 承接人分红预算单号
  14 + DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
  15 + // 分红类型,1订单分红,2退货冲销,3金额激励
  16 + DividendsType int `json:"dividendsType" valid:"Required"`
  17 +}
  18 +
  19 +func (searchDividendsEstimateQuery *SearchDividendsEstimateQuery) Valid(validation *validation.Validation) {
  20 +
  21 +}
  22 +
  23 +func (searchDividendsEstimateQuery *SearchDividendsEstimateQuery) ValidateQuery() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(searchDividendsEstimateQuery)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type SearchDividendsIncentivesQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 合约编号
  14 + CooperationContractNumber string `json:"cooperationContractNumber,omitempty"`
  15 + // 分红订单号/退货单号
  16 + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum,omitempty"`
  17 +}
  18 +
  19 +func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) Valid(validation *validation.Validation) {
  20 + validation.SetError("CustomValid", "未实现的自定义认证")
  21 +}
  22 +
  23 +func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) ValidateQuery() error {
  24 + valid := validation.Validation{}
  25 + b, err := valid.Valid(searchDividendsIncentivesQuery)
  26 + if err != nil {
  27 + return err
  28 + }
  29 + if !b {
  30 + for _, validErr := range valid.Errors {
  31 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  32 + }
  33 + }
  34 + return nil
  35 +}
  1 +package query
  2 +
  3 +import (
  4 + "fmt"
  5 +
  6 + "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 +)
  9 +
  10 +type SearchMoneyIncentivesQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
  13 + // 共创合约名称
  14 + CooperationContractName string `json:"cooperationContractName,omitempty"`
  15 +}
  16 +
  17 +func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) Valid(validation *validation.Validation) {
  18 + validation.SetError("CustomValid", "未实现的自定义认证")
  19 +}
  20 +
  21 +func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) ValidateQuery() error {
  22 + valid := validation.Validation{}
  23 + b, err := valid.Valid(searchMoneyIncentivesQuery)
  24 + if err != nil {
  25 + return err
  26 + }
  27 + if !b {
  28 + for _, validErr := range valid.Errors {
  29 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  30 + }
  31 + }
  32 + return nil
  33 +}
  1 +package service
  2 +
  3 +import (
  4 + "github.com/linmadan/egglib-go/core/application"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/command"
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsEstimate/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  8 +)
  9 +
  10 +// 分红预算管理
  11 +type DividendsEstimateService struct {
  12 +}
  13 +
  14 +//piliao 取消分红预算
  15 +func (dividendsEstimateService *DividendsEstimateService) CancelDividendsEstimate(cancelDividendsEstimateCommand *command.CancelDividendsEstimateCommand) (interface{}, error) {
  16 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(cancelDividendsEstimateCommand.Operator)
  17 + _, err := creationCooperationGateway.DividendsEstimatesBatchCancel(allied_creation_cooperation.ReqDividendsEstimateBatchCancel{
  18 + DividendsEstimateIds: cancelDividendsEstimateCommand.DividendsEstimateId,
  19 + })
  20 + if err != nil {
  21 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  22 + }
  23 + return cancelDividendsEstimateCommand, nil
  24 +}
  25 +
  26 +// 确定预算分红激励
  27 +func (dividendsEstimateService *DividendsEstimateService) EstimateDividendsIncentives(estimateDividendsIncentivesCommand *command.EstimateDividendsIncentivesCommand) (interface{}, error) {
  28 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  29 + // estimateDividendsIncentivesCommand.Operator)
  30 +
  31 + return nil, nil
  32 +}
  33 +
  34 +// 确定预算金额激励分红
  35 +func (dividendsEstimateService *DividendsEstimateService) EstimateMoneyIncentives(estimateMoneyIncentivesCommand *command.EstimateMoneyIncentivesCommand) (interface{}, error) {
  36 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  37 + // estimateMoneyIncentivesCommand.Operator)
  38 + return nil, nil
  39 +}
  40 +
  41 +// 返回分红预算服务
  42 +func (dividendsEstimateService *DividendsEstimateService) GetDividendsEstimate(getDividendsEstimateQuery *query.GetDividendsEstimateQuery) (interface{}, error) {
  43 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  44 + // getDividendsEstimateQuery.Operator)
  45 + return nil, nil
  46 +
  47 +}
  48 +
  49 +// 返回分红预算服务列表
  50 +func (dividendsEstimateService *DividendsEstimateService) ListDividendsEstimate(listDividendsEstimateQuery *query.ListDividendsEstimateQuery) (interface{}, error) {
  51 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  52 + // listDividendsEstimateQuery.Operator)
  53 + return nil, nil
  54 +}
  55 +
  56 +// 返回业绩激励分红
  57 +func (dividendsEstimateService *DividendsEstimateService) ListDividendsIncentives(listDividendsIncentivesQuery *query.ListDividendsIncentivesQuery) (interface{}, error) {
  58 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  59 + // listDividendsIncentivesQuery.Operator)
  60 + return nil, nil
  61 +}
  62 +
  63 +// 返回金额激励分红
  64 +func (dividendsEstimateService *DividendsEstimateService) ListMoneyIncentives(listMoneyIncentivesQue *query.ListMoneyIncentivesQuery) (interface{}, error) {
  65 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  66 + // listMoneyIncentivesQue.Operator)
  67 + return nil, nil
  68 +}
  69 +
  70 +// 移除分红预算服务
  71 +func (dividendsEstimateService *DividendsEstimateService) RemoveDividendsEstimate(removeDividendsEstimateCommand *command.RemoveDividendsEstimateCommand) (interface{}, error) {
  72 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  73 + // removeDividendsEstimateCommand.Operator)
  74 + return nil, nil
  75 +}
  76 +
  77 +// 查询分红预算单
  78 +func (dividendsEstimateService *DividendsEstimateService) SearchDividendsEstimate(searchDividendsEstimateQuery *query.SearchDividendsEstimateQuery) (interface{}, error) {
  79 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  80 + // searchDividendsEstimateQuery.Operator)
  81 + return nil, nil
  82 +}
  83 +
  84 +// 查询业绩分红
  85 +func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentives(searchDividendsIncentivesQuery *query.SearchDividendsIncentivesQuery) (interface{}, error) {
  86 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  87 + // searchDividendsIncentivesQuery.Operator)
  88 + return nil, nil
  89 +}
  90 +
  91 +// 查询金额激励分红
  92 +func (dividendsEmmateService *DividendsEstimateService) SearchMoneyIncentives(searchMoneyIncentivesQuery *query.SearchMoneyIncentivesQuery) (interface{}, error) {
  93 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  94 + // searchMoneyIncentivesQuery.Operator)
  95 + return nil, nil
  96 +}
  97 +
  98 +// 更新分红预算服务
  99 +func (dividendsEstimateService *DividendsEstimateService) UpdateDividendsEstimate(updateDividendsEstimateCommand *command.UpdateDividendsEstimateCommand) (interface{}, error) {
  100 + // creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  101 + // updateDividendsEstimateCommand.Operator)
  102 + return nil, nil
  103 +}
  104 +
  105 +func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstimateService {
  106 + newDividendsEstimateService := &DividendsEstimateService{}
  107 + return newDividendsEstimateService
  108 +}
@@ -15,10 +15,10 @@ var HTTP_PORT int = 8083 @@ -15,10 +15,10 @@ var HTTP_PORT int = 8083
15 var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080" 15 var ALLIED_CREATION_BASIC_HOST = "http://localhost:8080"
16 16
17 //天联共创用户模块 17 //天联共创用户模块
18 -var ALLIED_CREATION_USER_HOST = "http://localhost:8081" 18 +var ALLIED_CREATION_USER_HOST = "http://allied-creation-user-dev.fjmaimaimai.com"
19 19
20 //天联共创业务模块 20 //天联共创业务模块
21 -var ALLIED_CREATION_COOPERATION_HOST = "http://localhost:8082" 21 +var ALLIED_CREATION_COOPERATION_HOST = "http://allied-creation-cooperation-dev.fjmaimaimai.com"
22 22
23 //通用模块短信服务 23 //通用模块短信服务
24 var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897" 24 var SMS_SERVE_HOST = "https://sms.fjmaimaimai.com:9897"
@@ -9,67 +9,36 @@ import ( @@ -9,67 +9,36 @@ import (
9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log" 9 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
10 ) 10 )
11 11
12 -// DividendsEstimateIncentive 确定预算分红激励  
13 -func (gateway HttplibAlliedCreationCooperation) DividendsEstimateIncentive(param ReqDividendsEstimateIncentive) (*DataDividendsEstimateIncentive, error) {  
14 - url := gateway.baseUrL + "/dividends-estimates/estimate-dividends-incentives"  
15 - method := "POST"  
16 - req := gateway.CreateRequest(url, method)  
17 - log.Logger.Debug("向业务模块请求数据:确定预算分红激励。", map[string]interface{}{  
18 - "api": method + ":" + url,  
19 - "param": param,  
20 - })  
21 - req, err := req.JSONBody(param)  
22 - if err != nil {  
23 - return nil, fmt.Errorf("请求确定预算分红激励失败:%w", err)  
24 - }  
25 -  
26 - byteResult, err := req.Bytes()  
27 - if err != nil {  
28 - return nil, fmt.Errorf("获取确定预算分红激励失败:%w", err)  
29 - }  
30 - log.Logger.Debug("获取业务模块请求数据:确定预算分红激励。", map[string]interface{}{  
31 - "result": string(byteResult),  
32 - })  
33 - var result service_gateway.GatewayResponse  
34 - err = json.Unmarshal(byteResult, &result)  
35 - if err != nil {  
36 - return nil, fmt.Errorf("解析确定预算分红激励:%w", err)  
37 - }  
38 - var data DataDividendsEstimateIncentive  
39 - err = gateway.GetResponseData(result, &data)  
40 - return &data, err  
41 -}  
42 -  
43 // DividendsEstimateUpdate 更新分红预算 12 // DividendsEstimateUpdate 更新分红预算
44 -func (gateway HttplibAlliedCreationCooperation) DividendsEstimateUpdate(param ReqDividendsEstimateUpdate) (*DataDividendsEstimateUpdate, error) {  
45 - url := gateway.baseUrL + "/dividends-estimates/{dividendsEstimateId}"  
46 - method := "PUT"  
47 - req := gateway.CreateRequest(url, method)  
48 - log.Logger.Debug("向业务模块请求数据:更新分红预算。", map[string]interface{}{  
49 - "api": method + ":" + url,  
50 - "param": param,  
51 - })  
52 - req, err := req.JSONBody(param)  
53 - if err != nil {  
54 - return nil, fmt.Errorf("请求更新分红预算失败:%w", err)  
55 - } 13 +// func (gateway HttplibAlliedCreationCooperation) DividendsEstimateUpdate(param ReqDividendsEstimateUpdate) (*DataDividendsEstimateUpdate, error) {
  14 +// url := gateway.baseUrL + "/dividends-estimates/{dividendsEstimateId}"
  15 +// method := "PUT"
  16 +// req := gateway.CreateRequest(url, method)
  17 +// log.Logger.Debug("向业务模块请求数据:更新分红预算。", map[string]interface{}{
  18 +// "api": method + ":" + url,
  19 +// "param": param,
  20 +// })
  21 +// req, err := req.JSONBody(param)
  22 +// if err != nil {
  23 +// return nil, fmt.Errorf("请求更新分红预算失败:%w", err)
  24 +// }
56 25
57 - byteResult, err := req.Bytes()  
58 - if err != nil {  
59 - return nil, fmt.Errorf("获取更新分红预算失败:%w", err)  
60 - }  
61 - log.Logger.Debug("获取业务模块请求数据:更新分红预算。", map[string]interface{}{  
62 - "result": string(byteResult),  
63 - })  
64 - var result service_gateway.GatewayResponse  
65 - err = json.Unmarshal(byteResult, &result)  
66 - if err != nil {  
67 - return nil, fmt.Errorf("解析更新分红预算:%w", err)  
68 - }  
69 - var data DataDividendsEstimateUpdate  
70 - err = gateway.GetResponseData(result, &data)  
71 - return &data, err  
72 -} 26 +// byteResult, err := req.Bytes()
  27 +// if err != nil {
  28 +// return nil, fmt.Errorf("获取更新分红预算失败:%w", err)
  29 +// }
  30 +// log.Logger.Debug("获取业务模块请求数据:更新分红预算。", map[string]interface{}{
  31 +// "result": string(byteResult),
  32 +// })
  33 +// var result service_gateway.GatewayResponse
  34 +// err = json.Unmarshal(byteResult, &result)
  35 +// if err != nil {
  36 +// return nil, fmt.Errorf("解析更新分红预算:%w", err)
  37 +// }
  38 +// var data DataDividendsEstimateUpdate
  39 +// err = gateway.GetResponseData(result, &data)
  40 +// return &data, err
  41 +// }
73 42
74 // Dividends-estimatesSearch-dividends-incentives 查询业绩分红 43 // Dividends-estimatesSearch-dividends-incentives 查询业绩分红
75 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateSearchDividends(param ReqDividendsEstimateSearchDividend) (*DataDividendsEstimateSearchDividend, error) { 44 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateSearchDividends(param ReqDividendsEstimateSearchDividend) (*DataDividendsEstimateSearchDividend, error) {
@@ -381,3 +350,34 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesListMoney(para @@ -381,3 +350,34 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesListMoney(para
381 err = gateway.GetResponseData(result, &data) 350 err = gateway.GetResponseData(result, &data)
382 return &data, err 351 return &data, err
383 } 352 }
  353 +
  354 +// DividendsEstimatesBatchCancel 取消分红预算
  355 +func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesBatchCancel(param ReqDividendsEstimateBatchCancel) (*DataDividendsEstimateBatchCancel, error) {
  356 + url := gateway.baseUrL + "/dividends-estimates/batch-cancel"
  357 + method := "POST"
  358 + req := gateway.CreateRequest(url, method)
  359 + log.Logger.Debug("向业务模块请求数据:批量取消分红预算。", map[string]interface{}{
  360 + "api": method + ":" + url,
  361 + "param": param,
  362 + })
  363 + req, err := req.JSONBody(param)
  364 + if err != nil {
  365 + return nil, fmt.Errorf("请求批量取消分红预算失败:%w", err)
  366 + }
  367 +
  368 + byteResult, err := req.Bytes()
  369 + if err != nil {
  370 + return nil, fmt.Errorf("获取批量取消分红预算失败:%w", err)
  371 + }
  372 + log.Logger.Debug("获取业务模块请求数据:批量取消分红预算。", map[string]interface{}{
  373 + "result": string(byteResult),
  374 + })
  375 + var result service_gateway.GatewayResponse
  376 + err = json.Unmarshal(byteResult, &result)
  377 + if err != nil {
  378 + return nil, fmt.Errorf("解析批量取消分红预算:%w", err)
  379 + }
  380 + var data DataDividendsEstimateBatchCancel
  381 + err = gateway.GetResponseData(result, &data)
  382 + return &data, err
  383 +}
@@ -2,31 +2,15 @@ package allied_creation_cooperation @@ -2,31 +2,15 @@ package allied_creation_cooperation
2 2
3 import "time" 3 import "time"
4 4
5 -  
6 -  
7 -//确定预算分红激励  
8 -type (  
9 - ReqDividendsEstimateIncentive struct {  
10 - CooperationContractNumber string //合约编号  
11 - OrderOrReturnedOrderNum string //分红订单号/退货单号  
12 - }  
13 -  
14 - DataDividendsEstimateIncentive struct {  
15 - }  
16 -)  
17 -  
18 -//更新分红预算  
19 -type (  
20 - ReqDividendsEstimateUpdate struct {  
21 - }  
22 -  
23 - DataDividendsEstimateUpdate struct {  
24 - }  
25 -)  
26 -  
27 //查询业绩分红 5 //查询业绩分红
28 type ( 6 type (
29 ReqDividendsEstimateSearchDividend struct { 7 ReqDividendsEstimateSearchDividend struct {
  8 + PageNumber int `json:"pageNumber"`
  9 + PageSize int `json:"pageSize"`
  10 + //合约编号
  11 + CooperationContractNumber string `json:"cooperationContractNumber"`
  12 + //分红订单号/退货单号
  13 + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
30 } 14 }
31 15
32 DataDividendsEstimateSearchDividend struct { 16 DataDividendsEstimateSearchDividend struct {
@@ -36,57 +20,72 @@ type ( @@ -36,57 +20,72 @@ type (
36 //查询分红预算单 20 //查询分红预算单
37 type ( 21 type (
38 ReqDividendsEstimateSearch struct { 22 ReqDividendsEstimateSearch struct {
  23 + //承接人分红预算单号
  24 + DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
  25 + //分红类型,1订单分红,2退货冲销,3金额激励
  26 + DividendsType int `json:"dividendsType"`
39 PageNumber int `json:"pageNumber"` 27 PageNumber int `json:"pageNumber"`
40 PageSize int `json:"pageSize"` 28 PageSize int `json:"pageSize"`
41 } 29 }
42 30
43 DataDividendsEstimateSearch struct { 31 DataDividendsEstimateSearch struct {
44 Grid struct { 32 Grid struct {
45 - Total int 33 + Total int `json:"total"`
46 List []struct { 34 List []struct {
47 - DividendsEstimateId int64 `json:"dividendsEstimateId,string"` // 承接人分红预算记录ID  
48 - DividendsAccountStatus int32 `json:"dividendsAccountStatus"` // 分红结算状态 35 + DividendsEstimateId int `json:"dividendsEstimateId,string,"` // 承接人分红预算记录ID
  36 + DividendsAccountStatus int `json:"dividendsAccountStatus"` // 分红结算状态
49 DividendsAmount float64 `json:"dividendsAmount"` // 分红金额 37 DividendsAmount float64 `json:"dividendsAmount"` // 分红金额
50 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` // 承接人分红预算单号 38 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` // 承接人分红预算单号
51 DividendsEstimateTime time.Time `json:"dividendsEstimateTime"` // 分红预算时间 39 DividendsEstimateTime time.Time `json:"dividendsEstimateTime"` // 分红预算时间
52 - DividendsParticipateType int32 `json:"dividendsParticipateType"` // 参与分红类型,1承接人,2推荐人,3关联业务员  
53 - DividendsType int32 `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励 40 + DividendsParticipateType int `json:"dividendsParticipateType"` // 参与分红类型,1承接人,2推荐人,3关联业务员
  41 + DividendsType int `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励
54 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号 42 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号
55 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号, 43 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
56 DividendsUser struct { 44 DividendsUser struct {
57 - UserId int64 `json:"userId,string"` // 用户ID,  
58 - UserBaseId int64 `json:"userBaseId,string"` // 用户基本id  
59 - UserType int32 `json:"userType"` // 用户类型 45 + UserId int `json:"userId,string,"` // 用户ID,
  46 + UserBaseId int `json:"userBaseId,string,"` // 用户基本id
  47 + UserType int `json:"userType"` // 用户类型
60 } `json:"dividendsUser"` // 分红用户 48 } `json:"dividendsUser"` // 分红用户
61 Org struct { 49 Org struct {
62 - OrgId int64 `json:"orgId,string"` // 组织机构ID 50 + OrgId int `json:"orgId,string,"` // 组织机构ID
63 OrgName string `json:"orgName"` // 组织名称 51 OrgName string `json:"orgName"` // 组织名称
64 } `json:"org"` // 数据所属组织机构 52 } `json:"org"` // 数据所属组织机构
65 Company struct { 53 Company struct {
66 - CompanyId int64 `json:"companyId,string"` // 公司ID, 54 + CompanyId int `json:"companyId,string,"` // 公司ID,
67 CompanyLogo string `json:"companyLogo"` // 公司logo 55 CompanyLogo string `json:"companyLogo"` // 公司logo
68 CompanyName string `json:"companyName"` // 公司名称 56 CompanyName string `json:"companyName"` // 公司名称
69 } `json:"company"` // 公司 57 } `json:"company"` // 公司
70 CreatedAt time.Time `json:"createdAt"` // 创建时间 58 CreatedAt time.Time `json:"createdAt"` // 创建时间
71 UpdatedAt time.Time `json:"updatedAt"` // 更新时间 59 UpdatedAt time.Time `json:"updatedAt"` // 更新时间
72 - }  
73 - } 60 + } `json:"list"`
  61 + } `json:"grid"`
74 } 62 }
75 ) 63 )
76 64
77 //查询金额激励分红 65 //查询金额激励分红
78 type ( 66 type (
79 ReqDividendsEstimateSearchMoney struct { 67 ReqDividendsEstimateSearchMoney struct {
  68 + PageNumber int `json:"pageNumber"`
  69 + PageSize int `json:"pageSize"`
  70 + //共创合约名称
  71 + CooperationContractName string `json:"cooperationContractName"`
  72 + //发起部门名称
  73 + DepartmentName string `json:"departmentName"`
80 } 74 }
81 75
82 DataDividendsEstimateSearchMoney struct { 76 DataDividendsEstimateSearchMoney struct {
  77 + Grid struct {
  78 + Total int
  79 + List []struct {
  80 + }
  81 + }
83 } 82 }
84 ) 83 )
85 84
86 //取消分红预算 85 //取消分红预算
87 type ( 86 type (
88 ReqDividendsEstimateCancel struct { 87 ReqDividendsEstimateCancel struct {
89 - DividendsEstimateId int 88 + DividendsEstimateId int `json:"dividendsEstimateId"`
90 } 89 }
91 90
92 DataDividendsEstimateCancel struct { 91 DataDividendsEstimateCancel struct {
@@ -105,7 +104,7 @@ type ( @@ -105,7 +104,7 @@ type (
105 //移除分红预算 104 //移除分红预算
106 type ( 105 type (
107 ReqDividendsEstimateRemove struct { 106 ReqDividendsEstimateRemove struct {
108 - DividendsEstimateId int 107 + DividendsEstimateId int `json:"dividendsEstimateId"`
109 } 108 }
110 109
111 DataDividendsEstimateRemove struct { 110 DataDividendsEstimateRemove struct {
@@ -133,7 +132,7 @@ type ( @@ -133,7 +132,7 @@ type (
133 //返回分红预算详情 132 //返回分红预算详情
134 type ( 133 type (
135 ReqDividendsEstimateGet struct { 134 ReqDividendsEstimateGet struct {
136 - DividendsEstimateId int 135 + DividendsEstimateId int `json:"dividendsEstimateId"`
137 } 136 }
138 137
139 DataDividendsEstimateGet struct { 138 DataDividendsEstimateGet struct {
@@ -173,3 +172,13 @@ type ( @@ -173,3 +172,13 @@ type (
173 DataDividendsEstimatesListMoney struct { 172 DataDividendsEstimatesListMoney struct {
174 } 173 }
175 ) 174 )
  175 +
  176 +//取消分红预算
  177 +type (
  178 + ReqDividendsEstimateBatchCancel struct {
  179 + DividendsEstimateIds []string `json:"dividendsEstimateIds"`
  180 + }
  181 +
  182 + DataDividendsEstimateBatchCancel struct {
  183 + }
  184 +)