作者 yangfu
正在显示 23 个修改的文件 包含 961 行增加148 行删除
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 {
@@ -198,7 +198,6 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC @@ -198,7 +198,6 @@ func (cooperationContractService *CooperationContractService) SearchCooperationC
198 allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{ 198 allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{
199 CooperationContractName: queryParam.CooperationContractName, 199 CooperationContractName: queryParam.CooperationContractName,
200 SponsorName: queryParam.ContractSponsor, 200 SponsorName: queryParam.ContractSponsor,
201 - UserId: 0,  
202 PageNumber: queryParam.PageNumber, 201 PageNumber: queryParam.PageNumber,
203 PageIndex: queryParam.PageSize, 202 PageIndex: queryParam.PageSize,
204 }) 203 })
  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 dto
  2 +
  3 +//MoneyIncentivesItem 金额激励分红列表
  4 +type MoneyIncentivesItem struct {
  5 +}
  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 + CooperationContractName string `json:"cooperationContractName"` //合约名称
  18 + DepartmentName string `json:"department"`
  19 +}
  20 +
  21 +func (listMoneyIncentivesQuery *ListMoneyIncentivesQuery) Valid(validation *validation.Validation) {
  22 +
  23 +}
  24 +
  25 +func (listMoneyIncentivesQuery *ListMoneyIncentivesQuery) ValidateQuery() error {
  26 + valid := validation.Validation{}
  27 + b, err := valid.Valid(listMoneyIncentivesQuery)
  28 + if err != nil {
  29 + return err
  30 + }
  31 + if !b {
  32 + for _, validErr := range valid.Errors {
  33 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  34 + }
  35 + }
  36 + return nil
  37 +}
  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"`
  17 + PageNumber int `json:"pageNumber"`
  18 + PageSize int `json:"pageSize"`
  19 +}
  20 +
  21 +func (searchDividendsEstimateQuery *SearchDividendsEstimateQuery) Valid(validation *validation.Validation) {
  22 +
  23 +}
  24 +
  25 +func (searchDividendsEstimateQuery *SearchDividendsEstimateQuery) ValidateQuery() error {
  26 + valid := validation.Validation{}
  27 + b, err := valid.Valid(searchDividendsEstimateQuery)
  28 + if err != nil {
  29 + return err
  30 + }
  31 + if !b {
  32 + for _, validErr := range valid.Errors {
  33 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  34 + }
  35 + }
  36 + return nil
  37 +}
  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"`
  15 + // 分红订单号/退货单号
  16 + OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
  17 + PageNumber int `json:"pageNumber"`
  18 + PageSize int `json:"pageSize"`
  19 +}
  20 +
  21 +func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) Valid(validation *validation.Validation) {
  22 +
  23 +}
  24 +
  25 +func (searchDividendsIncentivesQuery *SearchDividendsIncentivesQuery) ValidateQuery() error {
  26 + valid := validation.Validation{}
  27 + b, err := valid.Valid(searchDividendsIncentivesQuery)
  28 + if err != nil {
  29 + return err
  30 + }
  31 + if !b {
  32 + for _, validErr := range valid.Errors {
  33 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  34 + }
  35 + }
  36 + return nil
  37 +}
  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 + PageNumber int `json:"pageNumber"`
  14 + PageSize int `json:"pageSize"`
  15 + //共创合约名称
  16 + CooperationContractName string `json:"cooperationContractName"`
  17 + //发起部门名称
  18 + DepartmentName string `json:"departmentName"`
  19 +}
  20 +
  21 +func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) Valid(validation *validation.Validation) {
  22 +
  23 +}
  24 +
  25 +func (searchMoneyIncentivesQuery *SearchMoneyIncentivesQuery) ValidateQuery() error {
  26 + valid := validation.Validation{}
  27 + b, err := valid.Valid(searchMoneyIncentivesQuery)
  28 + if err != nil {
  29 + return err
  30 + }
  31 + if !b {
  32 + for _, validErr := range valid.Errors {
  33 + return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
  34 + }
  35 + }
  36 + return nil
  37 +}
  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) SearchDividendsEstimate(searchDividendsEstimateQuery *query.SearchDividendsEstimateQuery) (interface{}, error) {
  43 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  44 + searchDividendsEstimateQuery.Operator)
  45 + result, err := creationCooperationGateway.DividendsEstimatesSearch(allied_creation_cooperation.ReqDividendsEstimateSearch{
  46 + //承接人分红预算单号
  47 + DividendsEstimateOrderNumber: searchDividendsEstimateQuery.DividendsEstimateOrderNumber,
  48 + //分红类型,1订单分红,2退货冲销,3金额激励
  49 + DividendsType: searchDividendsEstimateQuery.DividendsType,
  50 + PageNumber: searchDividendsEstimateQuery.PageNumber,
  51 + PageSize: searchDividendsEstimateQuery.PageSize,
  52 + })
  53 + if err != nil {
  54 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  55 + }
  56 + return result, nil
  57 +}
  58 +
  59 +// 查询业绩分红
  60 +func (dividendsEstimateService *DividendsEstimateService) SearchDividendsIncentives(searchDividendsIncentivesQuery *query.SearchDividendsIncentivesQuery) (interface{}, error) {
  61 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  62 + searchDividendsIncentivesQuery.Operator)
  63 + result, err := creationCooperationGateway.DividendsEstimateSearchDividends(
  64 + allied_creation_cooperation.ReqDividendsEstimateSearchDividend{
  65 + PageNumber: searchDividendsIncentivesQuery.PageNumber,
  66 + PageSize: searchDividendsIncentivesQuery.PageSize,
  67 + CooperationContractNumber: searchDividendsIncentivesQuery.CooperationContractNumber,
  68 + OrderOrReturnedOrderNum: searchDividendsIncentivesQuery.OrderOrReturnedOrderNum,
  69 + })
  70 + if err != nil {
  71 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  72 + }
  73 + return result, nil
  74 +}
  75 +
  76 +// 查询金额激励分红
  77 +func (dividendsEmmateService *DividendsEstimateService) SearchMoneyIncentives(searchMoneyIncentivesQuery *query.SearchMoneyIncentivesQuery) (interface{}, error) {
  78 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(
  79 + searchMoneyIncentivesQuery.Operator)
  80 + result, err := creationCooperationGateway.DividendsEstimatesSearchMoney(allied_creation_cooperation.ReqDividendsEstimateSearchMoney{
  81 + PageNumber: searchMoneyIncentivesQuery.PageNumber,
  82 + PageSize: searchMoneyIncentivesQuery.PageSize,
  83 + CooperationContractName: searchMoneyIncentivesQuery.CooperationContractName,
  84 + DepartmentName: searchMoneyIncentivesQuery.DepartmentName,
  85 + })
  86 + if err != nil {
  87 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  88 + }
  89 + return result, nil
  90 +}
  91 +
  92 +func NewDividendsEstimateService(options map[string]interface{}) *DividendsEstimateService {
  93 + newDividendsEstimateService := &DividendsEstimateService{}
  94 + return newDividendsEstimateService
  95 +}
@@ -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"
  1 +package allied_creation_cooperation
  2 +
  3 +import (
  4 + "encoding/json"
  5 + "fmt"
  6 + "strconv"
  7 +
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
  9 +
  10 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway"
  11 +)
  12 +
  13 +// CreditAccountCreate 创建账期结算单
  14 +func (gateway HttplibAlliedCreationCooperation) CreditAccountCreate(param ReqCreditAccountCreate) (*DataCreditAccountCreate, error) {
  15 + url := gateway.baseUrL + "/credit-accounts"
  16 + method := "POST"
  17 + req := gateway.CreateRequest(url, method)
  18 + log.Logger.Debug("向业务模块请求数据:创建账期结算单。", map[string]interface{}{
  19 + "api": method + ":" + url,
  20 + "param": param,
  21 + })
  22 + req, err := req.JSONBody(param)
  23 + if err != nil {
  24 + return nil, fmt.Errorf("请求创建账期结算单失败:%w", err)
  25 + }
  26 +
  27 + byteResult, err := req.Bytes()
  28 + if err != nil {
  29 + return nil, fmt.Errorf("获取创建账期结算单失败:%w", err)
  30 + }
  31 + log.Logger.Debug("获取业务模块请求数据:创建账期结算单。", map[string]interface{}{
  32 + "result": string(byteResult),
  33 + })
  34 + var result service_gateway.GatewayResponse
  35 + err = json.Unmarshal(byteResult, &result)
  36 + if err != nil {
  37 + return nil, fmt.Errorf("解析创建账期结算单:%w", err)
  38 + }
  39 + var data DataCreditAccountCreate
  40 + err = gateway.GetResponseData(result, &data)
  41 + return &data, err
  42 +}
  43 +
  44 +// Credit-accountsPay 支付账期结算
  45 +func (gateway HttplibAlliedCreationCooperation) CreditAccountsPay(param ReqCreditAccountsPay) (*DataCreditAccountsPay, error) {
  46 + url := gateway.baseUrL + "/credit-accounts/pay"
  47 + method := "POST"
  48 + req := gateway.CreateRequest(url, method)
  49 + log.Logger.Debug("向业务模块请求数据:支付账期结算。", map[string]interface{}{
  50 + "api": method + ":" + url,
  51 + "param": param,
  52 + })
  53 + req, err := req.JSONBody(param)
  54 + if err != nil {
  55 + return nil, fmt.Errorf("请求支付账期结算失败:%w", err)
  56 + }
  57 +
  58 + byteResult, err := req.Bytes()
  59 + if err != nil {
  60 + return nil, fmt.Errorf("获取支付账期结算失败:%w", err)
  61 + }
  62 + log.Logger.Debug("获取业务模块请求数据:支付账期结算。", map[string]interface{}{
  63 + "result": string(byteResult),
  64 + })
  65 + var result service_gateway.GatewayResponse
  66 + err = json.Unmarshal(byteResult, &result)
  67 + if err != nil {
  68 + return nil, fmt.Errorf("解析支付账期结算:%w", err)
  69 + }
  70 + var data DataCreditAccountsPay
  71 + err = gateway.GetResponseData(result, &data)
  72 + return &data, err
  73 +}
  74 +
  75 +// Credit-accounts[creditAccountId} 更新账期结算单
  76 +func (gateway HttplibAlliedCreationCooperation) CreditAccountUpdate(param ReqCreditAccountUpdate) (*DataCreditAccountUpdate, error) {
  77 + url := gateway.baseUrL + "/credit-accounts/{creditAccountId}"
  78 + method := "PUT"
  79 + req := gateway.CreateRequest(url, method)
  80 + log.Logger.Debug("向业务模块请求数据:更新账期结算单。", map[string]interface{}{
  81 + "api": method + ":" + url,
  82 + "param": param,
  83 + })
  84 + req, err := req.JSONBody(param)
  85 + if err != nil {
  86 + return nil, fmt.Errorf("请求更新账期结算单失败:%w", err)
  87 + }
  88 +
  89 + byteResult, err := req.Bytes()
  90 + if err != nil {
  91 + return nil, fmt.Errorf("获取更新账期结算单失败:%w", err)
  92 + }
  93 + log.Logger.Debug("获取业务模块请求数据:更新账期结算单。", map[string]interface{}{
  94 + "result": string(byteResult),
  95 + })
  96 + var result service_gateway.GatewayResponse
  97 + err = json.Unmarshal(byteResult, &result)
  98 + if err != nil {
  99 + return nil, fmt.Errorf("解析更新账期结算单:%w", err)
  100 + }
  101 + var data DataCreditAccountUpdate
  102 + err = gateway.GetResponseData(result, &data)
  103 + return &data, err
  104 +}
  105 +
  106 +// Credit-accountsSearch 查询账期结算单
  107 +func (gateway HttplibAlliedCreationCooperation) CreditAccountsSearch(param ReqCreditAccountsSearch) (*DataCreditAccountsSearch, error) {
  108 + url := gateway.baseUrL + "/credit-accounts/search"
  109 + method := "POST"
  110 + req := gateway.CreateRequest(url, method)
  111 + log.Logger.Debug("向业务模块请求数据:查询账期结算单。", map[string]interface{}{
  112 + "api": method + ":" + url,
  113 + "param": param,
  114 + })
  115 + req, err := req.JSONBody(param)
  116 + if err != nil {
  117 + return nil, fmt.Errorf("请求查询账期结算单失败:%w", err)
  118 + }
  119 +
  120 + byteResult, err := req.Bytes()
  121 + if err != nil {
  122 + return nil, fmt.Errorf("获取查询账期结算单失败:%w", err)
  123 + }
  124 + log.Logger.Debug("获取业务模块请求数据:查询账期结算单。", map[string]interface{}{
  125 + "result": string(byteResult),
  126 + })
  127 + var result service_gateway.GatewayResponse
  128 + err = json.Unmarshal(byteResult, &result)
  129 + if err != nil {
  130 + return nil, fmt.Errorf("解析查询账期结算单:%w", err)
  131 + }
  132 + var data DataCreditAccountsSearch
  133 + err = gateway.GetResponseData(result, &data)
  134 + return &data, err
  135 +}
  136 +
  137 +// CreditAccountRemove 移除账期结算单
  138 +func (gateway HttplibAlliedCreationCooperation) CreditAccountRemove(param ReqCreditAccountRemove) (*DataCreditAccountRemove, error) {
  139 + url := gateway.baseUrL + "/credit-accounts/" + strconv.Itoa(param.CreditAccountId)
  140 + method := "DELETE"
  141 + req := gateway.CreateRequest(url, method)
  142 + log.Logger.Debug("向业务模块请求数据:移除账期结算单。", map[string]interface{}{
  143 + "api": method + ":" + url,
  144 + "param": param,
  145 + })
  146 + req, err := req.JSONBody(param)
  147 + if err != nil {
  148 + return nil, fmt.Errorf("请求移除账期结算单失败:%w", err)
  149 + }
  150 +
  151 + byteResult, err := req.Bytes()
  152 + if err != nil {
  153 + return nil, fmt.Errorf("获取移除账期结算单失败:%w", err)
  154 + }
  155 + log.Logger.Debug("获取业务模块请求数据:移除账期结算单。", map[string]interface{}{
  156 + "result": string(byteResult),
  157 + })
  158 + var result service_gateway.GatewayResponse
  159 + err = json.Unmarshal(byteResult, &result)
  160 + if err != nil {
  161 + return nil, fmt.Errorf("解析移除账期结算单:%w", err)
  162 + }
  163 + var data DataCreditAccountRemove
  164 + err = gateway.GetResponseData(result, &data)
  165 + return &data, err
  166 +}
  167 +
  168 +// CreditAccountList 返回账期结算单列表
  169 +func (gateway HttplibAlliedCreationCooperation) CreditAccountList(param ReqCreditAccountList) (*DataCreditAccountList, error) {
  170 + url := gateway.baseUrL + "/credit-accounts"
  171 + method := "GET"
  172 + req := gateway.CreateRequest(url, method)
  173 + log.Logger.Debug("向业务模块请求数据:返回账期结算单列表。", map[string]interface{}{
  174 + "api": method + ":" + url,
  175 + "param": param,
  176 + })
  177 + req, err := req.JSONBody(param)
  178 + if err != nil {
  179 + return nil, fmt.Errorf("请求返回账期结算单列表失败:%w", err)
  180 + }
  181 +
  182 + byteResult, err := req.Bytes()
  183 + if err != nil {
  184 + return nil, fmt.Errorf("获取返回账期结算单列表失败:%w", err)
  185 + }
  186 + log.Logger.Debug("获取业务模块请求数据:返回账期结算单列表。", map[string]interface{}{
  187 + "result": string(byteResult),
  188 + })
  189 + var result service_gateway.GatewayResponse
  190 + err = json.Unmarshal(byteResult, &result)
  191 + if err != nil {
  192 + return nil, fmt.Errorf("解析返回账期结算单列表:%w", err)
  193 + }
  194 + var data DataCreditAccountList
  195 + err = gateway.GetResponseData(result, &data)
  196 + return &data, err
  197 +}
  198 +
  199 +// CreditAccountGet 返回账期结算单详情
  200 +func (gateway HttplibAlliedCreationCooperation) CreditAccountGet(param ReqCreditAccountGet) (*DataCreditAccountGet, error) {
  201 + url := gateway.baseUrL + "/credit-accounts/" + strconv.Itoa(param.CreditAccountId)
  202 + method := "GET"
  203 + req := gateway.CreateRequest(url, method)
  204 + log.Logger.Debug("向业务模块请求数据:返回账期结算单详情。", map[string]interface{}{
  205 + "api": method + ":" + url,
  206 + "param": param,
  207 + })
  208 + req, err := req.JSONBody(param)
  209 + if err != nil {
  210 + return nil, fmt.Errorf("请求返回账期结算单详情失败:%w", err)
  211 + }
  212 +
  213 + byteResult, err := req.Bytes()
  214 + if err != nil {
  215 + return nil, fmt.Errorf("获取返回账期结算单详情失败:%w", err)
  216 + }
  217 + log.Logger.Debug("获取业务模块请求数据:返回账期结算单详情。", map[string]interface{}{
  218 + "result": string(byteResult),
  219 + })
  220 + var result service_gateway.GatewayResponse
  221 + err = json.Unmarshal(byteResult, &result)
  222 + if err != nil {
  223 + return nil, fmt.Errorf("解析返回账期结算单详情:%w", err)
  224 + }
  225 + var data DataCreditAccountGet
  226 + err = gateway.GetResponseData(result, &data)
  227 + return &data, err
  228 +}
@@ -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) {
@@ -226,38 +195,6 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys @@ -226,38 +195,6 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesEstimateMoneys
226 return &data, err 195 return &data, err
227 } 196 }
228 197
229 -// DividendAestimatesdivDidendsEstimat 移除分红预算  
230 -func (gateway HttplibAlliedCreationCooperation) DividendAestimatesdivDidendsEstimat(param ReqDividendsEstimateRemove) (  
231 - *DataDividendsEstimateRemove, error) {  
232 - url := gateway.baseUrL + "/dividends-estimates/" + strconv.Itoa(param.DividendsEstimateId)  
233 - method := "DELETE"  
234 - req := gateway.CreateRequest(url, method)  
235 - log.Logger.Debug("向业务模块请求数据:移除分红预算。", map[string]interface{}{  
236 - "api": method + ":" + url,  
237 - "param": param,  
238 - })  
239 - req, err := req.JSONBody(param)  
240 - if err != nil {  
241 - return nil, fmt.Errorf("请求移除分红预算失败:%w", err)  
242 - }  
243 -  
244 - byteResult, err := req.Bytes()  
245 - if err != nil {  
246 - return nil, fmt.Errorf("获取移除分红预算失败:%w", err)  
247 - }  
248 - log.Logger.Debug("获取业务模块请求数据:移除分红预算。", map[string]interface{}{  
249 - "result": string(byteResult),  
250 - })  
251 - var result service_gateway.GatewayResponse  
252 - err = json.Unmarshal(byteResult, &result)  
253 - if err != nil {  
254 - return nil, fmt.Errorf("解析移除分红预算:%w", err)  
255 - }  
256 - var data DataDividendsEstimateRemove  
257 - err = gateway.GetResponseData(result, &data)  
258 - return &data, err  
259 -}  
260 -  
261 // DividendsEstimateListDividend 返回业绩激励分红详情 198 // DividendsEstimateListDividend 返回业绩激励分红详情
262 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateListDividend(param ReqDividendsEstimateListDividend) (*DataDividendsEstimateListDividend, error) { 199 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateListDividend(param ReqDividendsEstimateListDividend) (*DataDividendsEstimateListDividend, error) {
263 url := gateway.baseUrL + "/dividends-estimates/list-dividends-incentives" 200 url := gateway.baseUrL + "/dividends-estimates/list-dividends-incentives"
@@ -381,3 +318,34 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesListMoney(para @@ -381,3 +318,34 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesListMoney(para
381 err = gateway.GetResponseData(result, &data) 318 err = gateway.GetResponseData(result, &data)
382 return &data, err 319 return &data, err
383 } 320 }
  321 +
  322 +// DividendsEstimatesBatchCancel 批量取消分红预算
  323 +func (gateway HttplibAlliedCreationCooperation) DividendsEstimatesBatchCancel(param ReqDividendsEstimateBatchCancel) (*DataDividendsEstimateBatchCancel, error) {
  324 + url := gateway.baseUrL + "/dividends-estimates/batch-cancel"
  325 + method := "POST"
  326 + req := gateway.CreateRequest(url, method)
  327 + log.Logger.Debug("向业务模块请求数据:批量取消分红预算。", map[string]interface{}{
  328 + "api": method + ":" + url,
  329 + "param": param,
  330 + })
  331 + req, err := req.JSONBody(param)
  332 + if err != nil {
  333 + return nil, fmt.Errorf("请求批量取消分红预算失败:%w", err)
  334 + }
  335 +
  336 + byteResult, err := req.Bytes()
  337 + if err != nil {
  338 + return nil, fmt.Errorf("获取批量取消分红预算失败:%w", err)
  339 + }
  340 + log.Logger.Debug("获取业务模块请求数据:批量取消分红预算。", map[string]interface{}{
  341 + "result": string(byteResult),
  342 + })
  343 + var result service_gateway.GatewayResponse
  344 + err = json.Unmarshal(byteResult, &result)
  345 + if err != nil {
  346 + return nil, fmt.Errorf("解析批量取消分红预算:%w", err)
  347 + }
  348 + var data DataDividendsEstimateBatchCancel
  349 + err = gateway.GetResponseData(result, &data)
  350 + return &data, err
  351 +}
@@ -215,7 +215,6 @@ type ( @@ -215,7 +215,6 @@ type (
215 ReqCooperationContractSearchByUndertaker struct { 215 ReqCooperationContractSearchByUndertaker struct {
216 CooperationContractName string `json:"cooperationContractName"` //合约名称 216 CooperationContractName string `json:"cooperationContractName"` //合约名称
217 SponsorName string `json:"sponsorName"` //项目发起人姓名 217 SponsorName string `json:"sponsorName"` //项目发起人姓名
218 - UserId int `json:"userId"` //合约发起人  
219 PageNumber int `json:"pageNumber"` 218 PageNumber int `json:"pageNumber"`
220 PageIndex int `json:"pageIndex"` 219 PageIndex int `json:"pageIndex"`
221 } 220 }
  1 +package allied_creation_cooperation
  2 +
  3 +//创建账期结算单
  4 +type (
  5 + ReqCreditAccountCreate struct {
  6 + }
  7 +
  8 + DataCreditAccountCreate struct {
  9 + }
  10 +)
  11 +
  12 +//支付账期结算
  13 +type (
  14 + ReqCreditAccountsPay struct {
  15 + }
  16 +
  17 + DataCreditAccountsPay struct {
  18 + }
  19 +)
  20 +
  21 +//更新账期结算单
  22 +type (
  23 + ReqCreditAccountUpdate struct {
  24 + }
  25 +
  26 + DataCreditAccountUpdate struct {
  27 + }
  28 +)
  29 +
  30 +//查询账期结算单
  31 +type (
  32 + ReqCreditAccountsSearch struct {
  33 + }
  34 +
  35 + DataCreditAccountsSearch struct {
  36 + }
  37 +)
  38 +
  39 +//移除账期结算单
  40 +type (
  41 + ReqCreditAccountRemove struct {
  42 + CreditAccountId int
  43 + }
  44 +
  45 + DataCreditAccountRemove struct {
  46 + }
  47 +)
  48 +
  49 +//返回账期结算单列表
  50 +type (
  51 + ReqCreditAccountList struct {
  52 + }
  53 +
  54 + DataCreditAccountList struct {
  55 + }
  56 +)
  57 +
  58 +//返回账期结算单详情
  59 +type (
  60 + ReqCreditAccountGet struct {
  61 + CreditAccountId int
  62 + }
  63 +
  64 + DataCreditAccountGet struct {
  65 + }
  66 +)
@@ -2,91 +2,115 @@ package allied_creation_cooperation @@ -2,91 +2,115 @@ 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 {
  17 + Grid struct {
  18 + Total int `json:"total"`
  19 + List []struct{} `json:"list"`
  20 + } `json:"grid"`
33 } 21 }
34 ) 22 )
35 23
36 //查询分红预算单 24 //查询分红预算单
37 type ( 25 type (
38 ReqDividendsEstimateSearch struct { 26 ReqDividendsEstimateSearch struct {
39 - PageNumber int `json:"pageNumber"`  
40 - PageSize int `json:"pageSize"` 27 + //承接人分红预算单号
  28 + DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
  29 + //分红类型,1订单分红,2退货冲销,3金额激励
  30 + DividendsType int `json:"dividendsType"`
  31 + PageNumber int `json:"pageNumber"`
  32 + PageSize int `json:"pageSize"`
41 } 33 }
42 34
43 DataDividendsEstimateSearch struct { 35 DataDividendsEstimateSearch struct {
44 Grid struct { 36 Grid struct {
45 - Total int 37 + Total int `json:"total"`
46 List []struct { 38 List []struct {
47 - DividendsEstimateId int64 `json:"dividendsEstimateId,string"` // 承接人分红预算记录ID  
48 - DividendsAccountStatus int32 `json:"dividendsAccountStatus"` // 分红结算状态 39 + DividendsEstimateId int `json:"dividendsEstimateId,string,"` // 承接人分红预算记录ID
  40 + DividendsAccountStatus int `json:"dividendsAccountStatus"` // 分红结算状态
49 DividendsAmount float64 `json:"dividendsAmount"` // 分红金额 41 DividendsAmount float64 `json:"dividendsAmount"` // 分红金额
50 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` // 承接人分红预算单号 42 DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"` // 承接人分红预算单号
51 DividendsEstimateTime time.Time `json:"dividendsEstimateTime"` // 分红预算时间 43 DividendsEstimateTime time.Time `json:"dividendsEstimateTime"` // 分红预算时间
52 - DividendsParticipateType int32 `json:"dividendsParticipateType"` // 参与分红类型,1承接人,2推荐人,3关联业务员  
53 - DividendsType int32 `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励 44 + DividendsParticipateType int `json:"dividendsParticipateType"` // 参与分红类型,1承接人,2推荐人,3关联业务员
  45 + DividendsType int `json:"dividendsType"` // 分红类型,1订单分红,2退货冲销,3金额激励
54 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号 46 OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"` // 分红订单号或退货单号
55 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号, 47 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号,
56 DividendsUser struct { 48 DividendsUser struct {
57 - UserId int64 `json:"userId,string"` // 用户ID,  
58 - UserBaseId int64 `json:"userBaseId,string"` // 用户基本id  
59 - UserType int32 `json:"userType"` // 用户类型 49 + UserId int `json:"userId,string,"` // 用户ID,
  50 + UserBaseId int `json:"userBaseId,string,"` // 用户基本id
  51 + UserType int `json:"userType"` // 用户类型
60 } `json:"dividendsUser"` // 分红用户 52 } `json:"dividendsUser"` // 分红用户
61 Org struct { 53 Org struct {
62 - OrgId int64 `json:"orgId,string"` // 组织机构ID  
63 - OrgName string `json:"orgName"` // 组织名称 54 + OrgId int `json:"orgId,string,"` // 组织机构ID
  55 + OrgName string `json:"orgName"` // 组织名称
64 } `json:"org"` // 数据所属组织机构 56 } `json:"org"` // 数据所属组织机构
65 Company struct { 57 Company struct {
66 - CompanyId int64 `json:"companyId,string"` // 公司ID,  
67 - CompanyLogo string `json:"companyLogo"` // 公司logo  
68 - CompanyName string `json:"companyName"` // 公司名称 58 + CompanyId int `json:"companyId,string,"` // 公司ID,
  59 + CompanyLogo string `json:"companyLogo"` // 公司logo
  60 + CompanyName string `json:"companyName"` // 公司名称
69 } `json:"company"` // 公司 61 } `json:"company"` // 公司
70 CreatedAt time.Time `json:"createdAt"` // 创建时间 62 CreatedAt time.Time `json:"createdAt"` // 创建时间
71 UpdatedAt time.Time `json:"updatedAt"` // 更新时间 63 UpdatedAt time.Time `json:"updatedAt"` // 更新时间
72 - }  
73 - } 64 + } `json:"list"`
  65 + } `json:"grid"`
74 } 66 }
75 ) 67 )
76 68
77 //查询金额激励分红 69 //查询金额激励分红
78 type ( 70 type (
79 ReqDividendsEstimateSearchMoney struct { 71 ReqDividendsEstimateSearchMoney struct {
  72 + PageNumber int `json:"pageNumber"`
  73 + PageSize int `json:"pageSize"`
  74 + //共创合约名称
  75 + CooperationContractName string `json:"cooperationContractName"`
  76 + //发起部门名称
  77 + DepartmentName string `json:"departmentName"`
80 } 78 }
81 79
82 DataDividendsEstimateSearchMoney struct { 80 DataDividendsEstimateSearchMoney struct {
  81 + Grid struct {
  82 + Total int `json:"total"`
  83 + List []struct {
  84 + CooperationContractName string `json:"cooperationContractName"` //合约名称
  85 + CooperationContractNumber string `json:"cooperationContractNumber"` //合约编码
  86 + CooperationMode struct {
  87 + CooperationModeId int `json:"cooperationModeId"`
  88 + CooperationModeName string `json:"cooperationModeName"`
  89 + CooperationModeNumber string `json:"cooperationModeNumber"`
  90 + } `json:"cooperationMode"` //共创模式
  91 + CreatedAt time.Time `json:"createdAt"` //合约建立时间
  92 + Department struct {
  93 + DepartmentId int `json:"departmentId"`
  94 + DepartmentName string `json:"departmentName"`
  95 + } `json:"department"` //发起部门
  96 + CooperationContractSponsor struct {
  97 + UserId int `json:"userId"`
  98 + UserInfo struct {
  99 + UsersName string `json:"userName"`
  100 + Phone string `json:"phone"`
  101 + UsersId int `json:"userId,string"`
  102 + UserCode string `json:"userCode"`
  103 + } `json:"userInfo"`
  104 + } `json:"cooperationContractSponsor"` //合约发起人
  105 + } `json:"list"`
  106 + } `json:"grid"`
83 } 107 }
84 ) 108 )
85 109
86 //取消分红预算 110 //取消分红预算
87 type ( 111 type (
88 ReqDividendsEstimateCancel struct { 112 ReqDividendsEstimateCancel struct {
89 - DividendsEstimateId int 113 + DividendsEstimateId int `json:"dividendsEstimateId"`
90 } 114 }
91 115
92 DataDividendsEstimateCancel struct { 116 DataDividendsEstimateCancel struct {
@@ -96,22 +120,15 @@ type ( @@ -96,22 +120,15 @@ type (
96 //确定预算金额激励分红 120 //确定预算金额激励分红
97 type ( 121 type (
98 ReqDividendsEstimateMoneyIncentives struct { 122 ReqDividendsEstimateMoneyIncentives struct {
  123 + //合约编码
  124 + CooperationContractNumber string
  125 + //
99 } 126 }
100 127
101 DataDividendsEstimateMoneyIncentives struct { 128 DataDividendsEstimateMoneyIncentives struct {
102 } 129 }
103 ) 130 )
104 131
105 -//移除分红预算  
106 -type (  
107 - ReqDividendsEstimateRemove struct {  
108 - DividendsEstimateId int  
109 - }  
110 -  
111 - DataDividendsEstimateRemove struct {  
112 - }  
113 -)  
114 -  
115 //返回业绩激励分红详情 132 //返回业绩激励分红详情
116 type ( 133 type (
117 ReqDividendsEstimateListDividend struct { 134 ReqDividendsEstimateListDividend struct {
@@ -127,13 +144,17 @@ type ( @@ -127,13 +144,17 @@ type (
127 } 144 }
128 145
129 DataDividendsEstimateList struct { 146 DataDividendsEstimateList struct {
  147 + Grid struct {
  148 + Total int
  149 + List []struct{}
  150 + }
130 } 151 }
131 ) 152 )
132 153
133 //返回分红预算详情 154 //返回分红预算详情
134 type ( 155 type (
135 ReqDividendsEstimateGet struct { 156 ReqDividendsEstimateGet struct {
136 - DividendsEstimateId int 157 + DividendsEstimateId int `json:"dividendsEstimateId"`
137 } 158 }
138 159
139 DataDividendsEstimateGet struct { 160 DataDividendsEstimateGet struct {
@@ -171,5 +192,19 @@ type ( @@ -171,5 +192,19 @@ type (
171 } 192 }
172 193
173 DataDividendsEstimatesListMoney struct { 194 DataDividendsEstimatesListMoney struct {
  195 + Grid struct {
  196 + Total int `json:"total"`
  197 + List []struct{} `json:"list"`
  198 + } `json:"grid"`
  199 + }
  200 +)
  201 +
  202 +//取消分红预算
  203 +type (
  204 + ReqDividendsEstimateBatchCancel struct {
  205 + DividendsEstimateIds []string `json:"dividendsEstimateIds"`
  206 + }
  207 +
  208 + DataDividendsEstimateBatchCancel struct {
174 } 209 }
175 ) 210 )