作者 tangxuhui

更新

@@ -10,4 +10,5 @@ require ( @@ -10,4 +10,5 @@ require (
10 github.com/go-redis/redis v6.14.2+incompatible 10 github.com/go-redis/redis v6.14.2+incompatible
11 github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6 11 github.com/linmadan/egglib-go v0.0.0-20210527091316-06b0732fb5f6
12 github.com/sony/sonyflake v1.0.0 12 github.com/sony/sonyflake v1.0.0
  13 +
13 ) 14 )
@@ -4,84 +4,14 @@ import ( @@ -4,84 +4,14 @@ import (
4 "fmt" 4 "fmt"
5 5
6 "github.com/beego/beego/v2/core/validation" 6 "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
7 ) 9 )
8 10
9 type CreateCooperationContractCommand struct { 11 type CreateCooperationContractCommand struct {
10 - CooperationContract struct {  
11 - CooperationContractId int `json:"cooperationContractId,string"`  
12 - // 共创合约描述  
13 - Description string `json:"Description"`  
14 - // 共创合约编号  
15 - CooperationContractNumber string `json:"cooperationContractNumber"`  
16 - // 共创项目编号,  
17 - CooperationProjectNumber string `json:"cooperationProjectNumber"`  
18 - // 共创合约发起部门编码  
19 - DepartmentId string `json:"departmentId"`  
20 - // 共创合约承接对象,1员工,2共创用户,3公开  
21 - CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`  
22 - // 共创合约名称  
23 - CooperationContractName string `json:"cooperationContractName"`  
24 - // 共创模式编码,手动输入,唯一确定  
25 - CooperationModeNumber string `json:"cooperationModeNumber"`  
26 - // 共创合约发起人uid  
27 - SponsorUserId string `json:"sponsorUserId"`  
28 - } `json:"cooperationContract"`  
29 -  
30 - // 业绩分红激励规则列表  
31 - DividendsIncentivesRules []struct {  
32 - // 关联的项目合约编号  
33 - CooperationContractNumber string `json:"cooperationContractNumber"`  
34 - // 推荐人抽成比例  
35 - ReferrerPercentage float64 `json:"referrerPercentage"`  
36 - // 业务员抽成比例  
37 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
38 - // 分红规则激励百分点  
39 - DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`  
40 - // 分红规则激励阶段,  
41 - DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`  
42 - // 分红规则激励阶段结束  
43 - DividendsIncentivesStageEnd int `json:"dividendsIncentivesStageEnd"`  
44 - // 分红规则激励阶段开始  
45 - DividendsIncentivesStageStart int `json:"dividendsIncentivesStageStart"`  
46 - } `json:"dividendsIncentivesRules"`  
47 - // 金额激励规则列表  
48 - MoneyIncentivesRules []struct {  
49 - // 金额激励规则ID  
50 - MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`  
51 - // 关联的共创合约编号  
52 - CooperationContractNumber string `json:"cooperationContractNumber"`  
53 - // 激励金额  
54 - MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`  
55 - // 金额激励阶段,  
56 - MoneyIncentivesStage int64 `json:"moneyIncentivesStage,string,"`  
57 - // 金额激励规则时间  
58 - MoneyIncentivesTime int `json:"moneyIncentivesTime"`  
59 - // 推荐人抽成比例  
60 - ReferrerPercentage float64 `json:"referrerPercentage"`  
61 - // 业务员抽成比例  
62 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
63 - } `json:"moneyIncentivesRules"`  
64 -  
65 - // 关联用户id  
66 - RelationUser []int `json:"relationUser"`  
67 - //承接人列表  
68 - ContractUndertaker []struct {  
69 - HasReferrer bool `json:"hasReferrer"`  
70 - HasSalesman bool `json:"hasSalesman"`  
71 - UsersId int `json:"usersId,string,"`  
72 - ReferrerUser struct {  
73 - UserId int `json:"userId,string,"`  
74 - } `json:"referrerUser"`  
75 - SalesmanUser struct {  
76 - UserId int `json:"userId"`  
77 - } `json:"salesmanUser"`  
78 - Attachment []struct {  
79 - Name string `json:"name"`  
80 - Type string `json:"type"`  
81 - Url string `json:"url"`  
82 - FileSize int `json:"fileSize"`  
83 - } `json:"attachment"`  
84 - } `json:"contractUndertaker"` 12 + //操作人
  13 + Operator domain.Operator `json:"-"`
  14 + allied_creation_cooperation.ReqCooperationContractAdd
85 } 15 }
86 16
87 func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) { 17 func (createCooperationContractCommand *CreateCooperationContractCommand) Valid(validation *validation.Validation) {
@@ -4,9 +4,12 @@ import ( @@ -4,9 +4,12 @@ import (
4 "fmt" 4 "fmt"
5 5
6 "github.com/beego/beego/v2/core/validation" 6 "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
7 ) 8 )
8 9
9 type EnableCooperationContractCommand struct { 10 type EnableCooperationContractCommand struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
10 // 共创合约ID 13 // 共创合约ID
11 CooperationContractId []string `json:"cooperationContractId" valid:"Required"` 14 CooperationContractId []string `json:"cooperationContractId" valid:"Required"`
12 // 暂停和恢复的状态 15 // 暂停和恢复的状态
@@ -2,87 +2,16 @@ package command @@ -2,87 +2,16 @@ package command
2 2
3 import ( 3 import (
4 "fmt" 4 "fmt"
5 - "time"  
6 5
7 "github.com/beego/beego/v2/core/validation" 6 "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  8 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
8 ) 9 )
9 10
10 type UpdateCooperationContractCommand struct { 11 type UpdateCooperationContractCommand struct {
11 - CooperationContract struct {  
12 - CooperationContractId int `json:"cooperationContractId,string"`  
13 - // 共创合约描述  
14 - Description string `json:"Description"`  
15 - // 共创合约编号  
16 - CooperationContractNumber string `json:"cooperationContractNumber"`  
17 - // 共创项目编号,  
18 - CooperationProjectNumber string `json:"cooperationProjectNumber"`  
19 - // 共创合约发起部门编码  
20 - DepartmentId string `json:"departmentId"`  
21 - // 共创合约承接对象,1员工,2共创用户,3公开  
22 - CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`  
23 - // 共创合约名称  
24 - CooperationContractName string `json:"cooperationContractName"`  
25 - // 共创模式编码,手动输入,唯一确定  
26 - CooperationModeNumber string `json:"cooperationModeNumber"`  
27 - // 共创合约发起人uid  
28 - SponsorUserId string `json:"sponsorUserId"`  
29 - } `json:"cooperationContract"`  
30 -  
31 - // 业绩分红激励规则列表  
32 - DividendsIncentivesRules []struct {  
33 - // 关联的项目合约编号  
34 - CooperationContractNumber string `json:"cooperationContractNumber"`  
35 - // 推荐人抽成比例  
36 - ReferrerPercentage float64 `json:"referrerPercentage"`  
37 - // 业务员抽成比例  
38 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
39 - // 分红规则激励百分点  
40 - DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`  
41 - // 分红规则激励阶段,  
42 - DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"`  
43 - // 分红规则激励阶段结束  
44 - DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`  
45 - // 分红规则激励阶段开始  
46 - DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"`  
47 - } `json:"dividendsIncentivesRules"`  
48 - // 金额激励规则列表  
49 - MoneyIncentivesRules []struct {  
50 - // 金额激励规则ID  
51 - MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string,"`  
52 - // 关联的共创合约编号  
53 - CooperationContractNumber string `json:"cooperationContractNumber"`  
54 - // 激励金额  
55 - MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`  
56 - // 金额激励阶段,  
57 - MoneyIncentivesStage int64 `json:"moneyIncentivesStage,string,"`  
58 - // 金额激励规则时间  
59 - MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"`  
60 - // 推荐人抽成比例  
61 - ReferrerPercentage float64 `json:"referrerPercentage"`  
62 - // 业务员抽成比例  
63 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
64 - } `json:"moneyIncentivesRules"`  
65 -  
66 - // 关联用户id  
67 - RelationUser []int `json:"relationUser"`  
68 - //承接人列表  
69 - ContractUndertaker []struct {  
70 - HasReferrer bool `json:"hasReferrer"`  
71 - HasSalesman bool `json:"hasSalesman"`  
72 - UsersId int `json:"usersId,string,"`  
73 - ReferrerUser struct {  
74 - UserId int `json:"userId,string,"`  
75 - } `json:"referrerUser"`  
76 - SalesmanUser struct {  
77 - UserId int `json:"userId"`  
78 - } `json:"salesmanUser"`  
79 - Attachment []struct {  
80 - Name string `json:"name"`  
81 - Type string `json:"type"`  
82 - Url string `json:"url"`  
83 - FileSize int `json:"fileSize"`  
84 - } `json:"attachment"`  
85 - } `json:"contractUndertaker"` 12 + //操作人
  13 + Operator domain.Operator `json:"-"`
  14 + allied_creation_cooperation.ReqCooperationContractUpdate
86 } 15 }
87 16
88 func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) { 17 func (updateCooperationContractCommand *UpdateCooperationContractCommand) Valid(validation *validation.Validation) {
@@ -4,11 +4,14 @@ import ( @@ -4,11 +4,14 @@ import (
4 "fmt" 4 "fmt"
5 5
6 "github.com/beego/beego/v2/core/validation" 6 "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
7 ) 8 )
8 9
9 type GetCooperationContractQuery struct { 10 type GetCooperationContractQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
10 // 共创合约ID 13 // 共创合约ID
11 - CooperationContractId int `json:"cooperationContractId" valid:"Required"` 14 + CooperationContractId int `json:"cooperationContractId,string" valid:"Required"`
12 } 15 }
13 16
14 func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) { 17 func (getCooperationContractQuery *GetCooperationContractQuery) Valid(validation *validation.Validation) {
@@ -4,9 +4,12 @@ import ( @@ -4,9 +4,12 @@ import (
4 "fmt" 4 "fmt"
5 5
6 "github.com/beego/beego/v2/core/validation" 6 "github.com/beego/beego/v2/core/validation"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
7 ) 8 )
8 9
9 type ListCooperationContractQuery struct { 10 type ListCooperationContractQuery struct {
  11 + //操作人
  12 + Operator domain.Operator `json:"-"`
10 // 查询偏离量 13 // 查询偏离量
11 PageNumber int `json:"pageNumber"` 14 PageNumber int `json:"pageNumber"`
12 // 查询限制 15 // 查询限制
@@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
4 "github.com/linmadan/egglib-go/core/application" 4 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/command" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/command"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/query" 6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/cooperationContract/query"
  7 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
7 ) 8 )
8 9
9 // 共创合约管理 10 // 共创合约管理
@@ -15,7 +16,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC @@ -15,7 +16,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
15 if err := createCooperationContractCommand.ValidateCommand(); err != nil { 16 if err := createCooperationContractCommand.ValidateCommand(); err != nil {
16 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 17 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
17 } 18 }
18 - return nil, nil 19 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(createCooperationContractCommand.Operator)
  20 + _, err := creationCooperationGateway.CooperationContractAdd(createCooperationContractCommand.ReqCooperationContractAdd)
  21 + if err != nil {
  22 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  23 + }
  24 + return nil, err
19 } 25 }
20 26
21 // 暂停恢复共创合约 27 // 暂停恢复共创合约
@@ -32,7 +38,14 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont @@ -32,7 +38,14 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont
32 if err := getCooperationContractQuery.ValidateQuery(); err != nil { 38 if err := getCooperationContractQuery.ValidateQuery(); err != nil {
33 return nil, application.ThrowError(application.ARG_ERROR, err.Error()) 39 return nil, application.ThrowError(application.ARG_ERROR, err.Error())
34 } 40 }
35 - return nil, nil 41 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(getCooperationContractQuery.Operator)
  42 + result, err := creationCooperationGateway.CooperationContractGet(allied_creation_cooperation.ReqCooperationContractGet{
  43 + CooperationContractId: getCooperationContractQuery.CooperationContractId,
  44 + })
  45 + if err != nil {
  46 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  47 + }
  48 + return result, nil
36 } 49 }
37 50
38 // 返回共创合约管理列表 51 // 返回共创合约管理列表
@@ -2,11 +2,10 @@ package command @@ -2,11 +2,10 @@ package command
2 2
3 import ( 3 import (
4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" 4 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
5 - "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"  
6 ) 5 )
7 6
8 type RemoveDividendsReturnedOrderCommand struct { 7 type RemoveDividendsReturnedOrderCommand struct {
9 //操作人 8 //操作人
10 - Operator domain.Operator `json:"-"`  
11 - allied_creation_cooperation.ReqDividendsReturnedOrderRemove 9 + Operator domain.Operator `json:"-"`
  10 + DividendsReturnedOrderID []string `json:"dividendsReturnedOrderId"` //分红退货单记录id
12 } 11 }
1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "strconv"
  5 +
4 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command" 7 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
6 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query" 8 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
@@ -37,7 +39,14 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends @@ -37,7 +39,14 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
37 // 移除分红退货单服务 39 // 移除分红退货单服务
38 func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) { 40 func (dividendsReturnedOrderService *DividendsReturnedOrderService) RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand *command.RemoveDividendsReturnedOrderCommand) (interface{}, error) {
39 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator) 41 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(removeDividendsReturnedOrderCommand.Operator)
40 - _, err := creationCooperationGateway.DividendsReturnedOrderRemove(removeDividendsReturnedOrderCommand.ReqDividendsReturnedOrderRemove) 42 + ids := []int{}
  43 + for _, v := range removeDividendsReturnedOrderCommand.DividendsReturnedOrderID {
  44 + id, _ := strconv.Atoi(v)
  45 + ids = append(ids, id)
  46 + }
  47 + _, err := creationCooperationGateway.DividendsReturnedOrderBatchRemove(allied_creation_cooperation.ReqDividendsReturnedOrderBatchRemove{
  48 + DividendsReturnedOrderIDs: ids,
  49 + })
41 if err != nil { 50 if err != nil {
42 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 51 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
43 } 52 }
@@ -40,37 +40,6 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimateIncentive(param @@ -40,37 +40,6 @@ func (gateway HttplibAlliedCreationCooperation) DividendsEstimateIncentive(param
40 return &data, err 40 return &data, err
41 } 41 }
42 42
43 -// DividendsEstimateAdd 创建分红预算  
44 -func (gateway HttplibAlliedCreationCooperation) DividendsEstimateAdd(param ReqDividendsEstimateAdd) (*DataDividendsEstimateAdd, error) {  
45 - url := gateway.baseUrL + "/dividends-estimates"  
46 - method := "POST"  
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 - }  
56 -  
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 DataDividendsEstimateAdd  
70 - err = gateway.GetResponseData(result, &data)  
71 - return &data, err  
72 -}  
73 -  
74 // DividendsEstimateUpdate 更新分红预算 43 // DividendsEstimateUpdate 更新分红预算
75 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateUpdate(param ReqDividendsEstimateUpdate) (*DataDividendsEstimateUpdate, error) { 44 func (gateway HttplibAlliedCreationCooperation) DividendsEstimateUpdate(param ReqDividendsEstimateUpdate) (*DataDividendsEstimateUpdate, error) {
76 url := gateway.baseUrL + "/dividends-estimates/{dividendsEstimateId}" 45 url := gateway.baseUrL + "/dividends-estimates/{dividendsEstimateId}"
@@ -198,8 +198,8 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param @@ -198,8 +198,8 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderGet(param
198 } 198 }
199 199
200 // DividendsReturnedOrderBatchRemove 批量移除分红退货单 200 // DividendsReturnedOrderBatchRemove 批量移除分红退货单
201 -func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderBatchRemove(param ReqDividendsReturnedOrderRemove) (  
202 - *DataDividendsReturnedOrderRemove, error) { 201 +func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderBatchRemove(param ReqDividendsReturnedOrderBatchRemove) (
  202 + *DataDividendsReturnedOrderBatchRemove, error) {
203 url := gateway.baseUrL + "/dividends-returned-orders/batch-remove" 203 url := gateway.baseUrL + "/dividends-returned-orders/batch-remove"
204 method := "POST" 204 method := "POST"
205 req := gateway.CreateRequest(url, method) 205 req := gateway.CreateRequest(url, method)
@@ -224,7 +224,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderBatchRemov @@ -224,7 +224,7 @@ func (gateway HttplibAlliedCreationCooperation) DividendsReturnedOrderBatchRemov
224 if err != nil { 224 if err != nil {
225 return nil, fmt.Errorf("解析移除分红退货单:%w", err) 225 return nil, fmt.Errorf("解析移除分红退货单:%w", err)
226 } 226 }
227 - var data DataDividendsReturnedOrderRemove 227 + var data DataDividendsReturnedOrderBatchRemove
228 err = gateway.GetResponseData(result, &data) 228 err = gateway.GetResponseData(result, &data)
229 return &data, err 229 return &data, err
230 } 230 }
1 package allied_creation_cooperation 1 package allied_creation_cooperation
2 2
3 -import "time" 3 +import (
  4 + "time"
  5 +
  6 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  7 +)
4 8
5 //创建共创合约 9 //创建共创合约
6 type ( 10 type (
  11 + //分红激励规则
  12 + DividendsIncentivesRule struct {
  13 + // 关联的项目合约编号
  14 + CooperationContractNumber string `json:"cooperationContractNumber"`
  15 + // 推荐人抽成比例
  16 + ReferrerPercentage float64 `json:"referrerPercentage"`
  17 + // 业务员抽成比例
  18 + SalesmanPercentage float64 `json:"salesmanPercentage"`
  19 + // 分红规则激励百分点
  20 + DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
  21 + // 分红规则激励阶段,
  22 + DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
  23 + // 分红规则激励阶段结束
  24 + DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`
  25 + // 分红规则激励阶段开始
  26 + DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"`
  27 + }
  28 + //金额激励规则
  29 + MoneyIncentivesRule struct {
  30 + // 金额激励规则ID
  31 + MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`
  32 + // 关联的共创合约编号
  33 + CooperationContractNumber string `json:"cooperationContractNumber"`
  34 + // 激励金额
  35 + MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`
  36 + // 金额激励阶段
  37 + MoneyIncentivesStage int `json:"moneyIncentivesStage"`
  38 + // 金额激励规则时间
  39 + MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"`
  40 + // 推荐人抽成比例
  41 + ReferrerPercentage float64 `json:"referrerPercentage"`
  42 + // 业务员抽成比例
  43 + SalesmanPercentage float64 `json:"salesmanPercentage"`
  44 + }
  45 +
  46 + //合约承接方
  47 + Undertaker struct {
  48 + UndertakerId string `json:"undertakerId"` //承接人用户id
  49 + RerferrerId string `json:"rerferrerId"` //推荐人用户id
  50 + SalesmanId string `json:"salesmanId"` //关联业务员id
  51 + Attachment domain.Attachment `json:"attachment"`
  52 + }
  53 +
7 ReqCooperationContractAdd struct { 54 ReqCooperationContractAdd struct {
8 // 共创合约描述 55 // 共创合约描述
9 - CooperationContractDescription string ` json:"cooperationContractDescription"` 56 + CooperationContractDescription string `json:"cooperationContractDescription"`
10 // 共创合约编号 57 // 共创合约编号
11 - CooperationContractNumber string ` json:"cooperationContractNumber"` 58 + CooperationContractNumber string `json:"cooperationContractNumber"`
12 // 共创项目编号, 59 // 共创项目编号,
13 - CooperationProjectNumber string `json:"cooperationProjectNumber" `  
14 - // 共创合约发起部门编码  
15 - DepartmentNumber string `json:"departmentNumber"` 60 + CooperationProjectNumber string `json:"cooperationProjectNumber"`
  61 + // 共创合约发起部门id
  62 + DepartmentId string `json:"departmentId"`
16 // 共创合约承接对象,1员工,2共创用户,3公开 63 // 共创合约承接对象,1员工,2共创用户,3公开
17 - CooperationContractUndertakerType []int ` json:"cooperationContractUndertakerType"` 64 + CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
18 // 共创合约名称 65 // 共创合约名称
19 CooperationContractName string `json:"cooperationContractName"` 66 CooperationContractName string `json:"cooperationContractName"`
20 - // 共创模式编码,手动输入,唯一确定  
21 - CooperationModeNumber string ` json:"cooperationModeNumber"` 67 + // 共创模式编码,
  68 + CooperationModeNumber string `json:"cooperationModeNumber"`
22 // 共创合约发起人uid 69 // 共创合约发起人uid
23 - SponsorUid string `json:"sponsorUid,omitempty"` 70 + SponsorUid string `json:"sponsorUid"`
24 // 业绩分红激励规则列表 71 // 业绩分红激励规则列表
25 - DividendsIncentivesRules []struct {  
26 - // 关联的项目合约编号  
27 - CooperationContractNumber string `json:"cooperationContractNumber"`  
28 - // 推荐人抽成比例  
29 - ReferrerPercentage float64 `json:"referrerPercentage"`  
30 - // 业务员抽成比例  
31 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
32 - // 分红规则激励百分点  
33 - DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`  
34 - // 分红规则激励阶段,阶段返回时需要转换为中文数字  
35 - DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`  
36 - // 分红规则激励阶段结束  
37 - DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`  
38 - // 分红规则激励阶段开始  
39 - DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"`  
40 - } `json:"dividendsIncentivesRules"` 72 + DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"`
41 // 金额激励规则列表 73 // 金额激励规则列表
42 - MoneyIncentivesRules []struct {  
43 - // 金额激励规则ID  
44 - MoneyIncentivesRuleId int64 `json:"moneyIncentivesRuleId,string"`  
45 - // 关联的共创合约编号  
46 - CooperationContractNumber string `json:"cooperationContractNumber"`  
47 - // 激励金额  
48 - MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"`  
49 - // 金额激励阶段,阶段返回时需要转换为中文数字  
50 - MoneyIncentivesStage int64 `json:"moneyIncentivesStage,string"`  
51 - // 金额激励阶段有效期结束  
52 - MoneyIncentivesStageEnd time.Time `json:"moneyIncentivesStageEnd"`  
53 - // 金额激励阶段有效期开始  
54 - MoneyIncentivesStageStart time.Time `json:"moneyIncentivesStageStart"`  
55 - // 金额激励规则时间  
56 - MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"`  
57 - // 推荐人抽成比例  
58 - ReferrerPercentage float64 `json:"referrerPercentage"`  
59 - // 业务员抽成比例  
60 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
61 - } `json:"moneyIncentivesRules"` 74 + MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
62 // 承接方列表 75 // 承接方列表
63 - Undertakers []struct {  
64 - UserId int64 `json:"userId,string"`  
65 - // 用户基本id  
66 - UserBaseId int64 `json:"userBaseId,string"`  
67 - // 用户所属组织机构  
68 - Org struct {  
69 - // 组织机构ID  
70 - OrgId int64 `json:"orgId,string"`  
71 - // 组织名称  
72 - OrgName string `json:"orgName"`  
73 - }  
74 - } `json:"undertakers"` 76 + Undertakers []Undertaker `json:"undertakers"`
  77 + //关联业务员
  78 + RelevantIds []string `json:"relevantIds"`
75 } 79 }
76 80
77 DataCooperationContractAdd struct { 81 DataCooperationContractAdd struct {
@@ -81,7 +85,31 @@ type ( @@ -81,7 +85,31 @@ type (
81 //更新共创合约 85 //更新共创合约
82 type ( 86 type (
83 ReqCooperationContractUpdate struct { 87 ReqCooperationContractUpdate struct {
84 - CooperationContractId int 88 + CooperationContractId int `json:"cooperationContractId"`
  89 + // 共创合约描述
  90 + CooperationContractDescription string `json:"cooperationContractDescription"`
  91 + // 共创合约编号
  92 + CooperationContractNumber string `json:"cooperationContractNumber"`
  93 + // 共创项目编号,
  94 + CooperationProjectNumber string `json:"cooperationProjectNumber"`
  95 + // 共创合约发起部门id
  96 + DepartmentId string `json:"departmentId"`
  97 + // 共创合约承接对象,1员工,2共创用户,3公开
  98 + CooperationContractUndertakerType []int `json:"cooperationContractUndertakerType"`
  99 + // 共创合约名称
  100 + CooperationContractName string `json:"cooperationContractName"`
  101 + // 共创模式编码,
  102 + CooperationModeNumber string `json:"cooperationModeNumber"`
  103 + // 共创合约发起人uid
  104 + SponsorUid string `json:"sponsorUid,omitempty,"`
  105 + // 业绩分红激励规则列表
  106 + DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"`
  107 + // 金额激励规则列表
  108 + MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
  109 + // 承接方列表
  110 + Undertakers []Undertaker `json:"undertakers"`
  111 + //关联业务员
  112 + RelevantIds []string `json:"relevantIds"`
85 } 113 }
86 114
87 DataCooperationContractUpdate struct { 115 DataCooperationContractUpdate struct {
@@ -100,6 +128,11 @@ type ( @@ -100,6 +128,11 @@ type (
100 //根据承接人查询并返回共创项目合约 128 //根据承接人查询并返回共创项目合约
101 type ( 129 type (
102 ReqCooperationContractSearchByUndertaker struct { 130 ReqCooperationContractSearchByUndertaker struct {
  131 + CooperationContractName string //合约名称
  132 + SponsorName string //项目发起人姓名
  133 + UserId int //合约发起人
  134 + PageNumber int
  135 + PageIndex int
103 } 136 }
104 137
105 DataCooperationContractSearchByUndertaker struct { 138 DataCooperationContractSearchByUndertaker struct {
@@ -9,15 +9,6 @@ type ( @@ -9,15 +9,6 @@ type (
9 } 9 }
10 ) 10 )
11 11
12 -//创建分红预算  
13 -type (  
14 - ReqDividendsEstimateAdd struct {  
15 - }  
16 -  
17 - DataDividendsEstimateAdd struct {  
18 - }  
19 -)  
20 -  
21 //更新分红预算 12 //更新分红预算
22 type ( 13 type (
23 ReqDividendsEstimateUpdate struct { 14 ReqDividendsEstimateUpdate struct {
@@ -39,6 +30,10 @@ type ( @@ -39,6 +30,10 @@ type (
39 //查询分红预算单 30 //查询分红预算单
40 type ( 31 type (
41 ReqDividendsEstimateSearch struct { 32 ReqDividendsEstimateSearch struct {
  33 + DividendsType int `json:"dividendsType"`
  34 + DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
  35 + PageNumber int `json:"pageNumber"`
  36 + PageSize int `json:"pageSize"`
42 } 37 }
43 38
44 DataDividendsEstimateSearch struct { 39 DataDividendsEstimateSearch struct {
@@ -110,6 +110,16 @@ type ( @@ -110,6 +110,16 @@ type (
110 } 110 }
111 ) 111 )
112 112
  113 +//批量移除分红退货单
  114 +type (
  115 + ReqDividendsReturnedOrderBatchRemove struct {
  116 + DividendsReturnedOrderIDs []int `json:"dividendsReturnedOrderIds"` //分红退货单记录id
  117 + }
  118 +
  119 + DataDividendsReturnedOrderBatchRemove struct {
  120 + }
  121 +)
  122 +
113 //返回分红退货单列表 123 //返回分红退货单列表
114 type ( 124 type (
115 ReqDividendsReturnedOrderList struct { 125 ReqDividendsReturnedOrderList struct {
@@ -24,7 +24,7 @@ func (controller *CooperationContractController) UpdateCooperationContract() { @@ -24,7 +24,7 @@ func (controller *CooperationContractController) UpdateCooperationContract() {
24 updateCooperationContractCommand := &command.UpdateCooperationContractCommand{} 24 updateCooperationContractCommand := &command.UpdateCooperationContractCommand{}
25 controller.Unmarshal(updateCooperationContractCommand) 25 controller.Unmarshal(updateCooperationContractCommand)
26 contractId, _ := controller.GetInt(":contractId") 26 contractId, _ := controller.GetInt(":contractId")
27 - updateCooperationContractCommand.CooperationContract.CooperationContractId = contractId 27 + updateCooperationContractCommand.CooperationContractId = contractId
28 data, err := cooperationContractService.UpdateCooperationContract(updateCooperationContractCommand) 28 data, err := cooperationContractService.UpdateCooperationContract(updateCooperationContractCommand)
29 controller.Response(data, err) 29 controller.Response(data, err)
30 } 30 }
@@ -44,8 +44,6 @@ func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder @@ -44,8 +44,6 @@ func (controller *DividendsReturnedOrderController) RemoveDividendsReturnedOrder
44 if err != nil { 44 if err != nil {
45 log.Logger.Debug("json err:" + err.Error()) 45 log.Logger.Debug("json err:" + err.Error())
46 } 46 }
47 - projectId, _ := controller.GetInt(":projectId")  
48 - removeDividendsReturnedOrderCommand.DividendsReturnedOrderID = projectId  
49 removeDividendsReturnedOrderCommand.Operator = controller.GetOperator() 47 removeDividendsReturnedOrderCommand.Operator = controller.GetOperator()
50 data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand) 48 data, err := dividendsReturnedOrderService.RemoveDividendsReturnedOrder(removeDividendsReturnedOrderCommand)
51 controller.Response(data, err) 49 controller.Response(data, err)