作者 tangxuhui

更新 合约

1 -{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628731667364868600}  
  1 +{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628752601441259500}
1 package dto 1 package dto
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/infrastructure/service_gateway/allied_creation_cooperation" 5 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
5 ) 6 )
6 7
7 type CooperationContractItem struct { 8 type CooperationContractItem struct {
8 - CooperationContractId int `json:"cooperationContractId,string,"`  
9 - CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号  
10 - CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号  
11 - CooperationContractName string `json:"CooperationContractName"` //合约名称  
12 - Status int `json:"status"` //合约状态  
13 - CreateTtime int `json:"createTtime"`  
14 - Department struct {  
15 - DepartmentId int `json:"departmentId"`  
16 - DepartmentName string `json:"departmentName"`  
17 - } `json:"department"`  
18 - IncentivesType string `json:"incentivesType"` //Incentives激励方式 9 + CooperationContractId int `json:"cooperationContractId,string,"`
  10 + CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
  11 + CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
  12 + CooperationContractName string `json:"CooperationContractName"` //合约名称
  13 + Status int `json:"status"` //合约状态
  14 + CreateTtime int `json:"createTtime"`
  15 + Department domain.Department `json:"department"`
  16 + IncentivesType string `json:"incentivesType"` //Incentives激励方式
19 CooperationContractSponsor struct { 17 CooperationContractSponsor struct {
20 UserId int `json:"userId,string,"` 18 UserId int `json:"userId,string,"`
21 UserName string `json:"userName"` 19 UserName string `json:"userName"`
22 } `json:"cooperationContractSponsor"` //共创发起人 20 } `json:"cooperationContractSponsor"` //共创发起人
23 - CooperationMode struct {  
24 - CooperationModeId int `json:"cooperationModeId,string,"` // 共创模式ID  
25 - CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,  
26 - CooperationModeName string `json:"cooperationModeName"` // 模式名称,  
27 - } `json:"cooperationMode"` //共创模式  
28 - Org struct {  
29 - OrgId int `json:"orgId"` // id  
30 - OrgName string `json:"orgName"` //  
31 - } `json:"org"` //组织结构 21 + CooperationMode domain.CooperationMode `json:"cooperationMode"` //共创模式
  22 + Org domain.Org `json:"org"` //组织结构
32 } 23 }
33 24
34 func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract) *CooperationContractItem { 25 func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract) *CooperationContractItem {
35 - // relevantPeople := []int{}  
36 data := CooperationContractItem{ 26 data := CooperationContractItem{
37 CooperationContractId: param.CooperationContractId, 27 CooperationContractId: param.CooperationContractId,
38 CooperationProjectNumber: param.CooperationContractNumber, 28 CooperationProjectNumber: param.CooperationContractNumber,
@@ -45,14 +35,149 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon @@ -45,14 +35,149 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon
45 data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName 35 data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName
46 data.Department.DepartmentId = param.Department.DepartmentId 36 data.Department.DepartmentId = param.Department.DepartmentId
47 data.Department.DepartmentName = param.Department.DepartmentName 37 data.Department.DepartmentName = param.Department.DepartmentName
48 - data.Org.OrgId = int(param.Org.OrgId) 38 + data.Org.OrgID = int(param.Org.OrgId)
49 data.Org.OrgName = param.Org.OrgName 39 data.Org.OrgName = param.Org.OrgName
50 data.CooperationMode.CooperationModeId = param.CooperationMode.CooperationModeId 40 data.CooperationMode.CooperationModeId = param.CooperationMode.CooperationModeId
51 data.CooperationMode.CooperationModeName = param.CooperationMode.CooperationModeName 41 data.CooperationMode.CooperationModeName = param.CooperationMode.CooperationModeName
52 data.CooperationMode.CooperationModeNumber = param.CooperationMode.CooperationModeNumber 42 data.CooperationMode.CooperationModeNumber = param.CooperationMode.CooperationModeNumber
53 - 43 + if len(param.DividendsIncentivesRules) > 0 {
  44 + data.IncentivesType = "业绩分红"
  45 + } else if len(param.MoneyIncentivesRules) > 0 {
  46 + data.IncentivesType = "金额激励"
  47 + }
54 return nil 48 return nil
55 } 49 }
56 50
  51 +type MoneyIncentivesRule struct {
  52 + MoneyIncentivesRuleId int `json:"moneyIncentivesRuleId"`
  53 + CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的共创合约编号
  54 + MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"` // 激励金额
  55 + MoneyIncentivesStage int `json:"moneyIncentivesStage"` // 金额激励阶段
  56 + MoneyIncentivesTime int64 `json:"moneyIncentivesTime"` // 金额激励规则时间
  57 + ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
  58 + SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
  59 +}
  60 +
  61 +type DividendsIncentivesRule struct {
  62 + DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId"`
  63 + CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号
  64 + ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
  65 + SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
  66 + DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` // 分红规则激励百分点
  67 + DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"` // 分红规则激励阶段,
  68 + DividendsIncentivesStageEnd int64 `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束
  69 + DividendsIncentivesStageStart int64 `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始
  70 +}
  71 +
  72 +type Relevant struct {
  73 + UserId int `json:"userId"`
  74 + UserInfo domain.UserInfo `json:"userInfo"`
  75 + Department domain.Department `json:"department"`
  76 +}
  77 +
  78 +type ContractUndertaker struct {
  79 + Attachment []domain.Attachment `json:"attachment"`
  80 + Department domain.Department `json:"department"`
  81 + HasReferrer bool `json:"hasReferrer"`
  82 + HasSalesman bool `json:"hasSalesman"`
  83 + ReferrerUser domain.UserInfo `json:"referrerUser"`
  84 + SalesmanUser domain.UserInfo `json:"salesmanUser"`
  85 + UserInfo domain.UserInfo `json:"userInfo"`
  86 +}
57 type CooperationContractInfo struct { 87 type CooperationContractInfo struct {
  88 + CooperationContract CooperationContractItem `json:"cooperationContract"`
  89 + Relevant []Relevant `json:"relevant"`
  90 + DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"`
  91 + MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
  92 + ContractUndertaker []ContractUndertaker `json:"contractUndertaker"`
  93 +}
  94 +
  95 +func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationContract) *CooperationContractInfo {
  96 +
  97 + relevants := []Relevant{}
  98 + dividendsIncentivesRules := []DividendsIncentivesRule{}
  99 + moneyIncentivesRules := []MoneyIncentivesRule{}
  100 + contractUndertaker := []ContractUndertaker{}
  101 + for _, v := range param.RelevantPeople {
  102 + r := Relevant{
  103 + UserId: int(v.UserId),
  104 + UserInfo: domain.UserInfo{
  105 + UsersName: v.UserInfo.UsersName,
  106 + UsersId: v.UserInfo.UsersId,
  107 + UserCode: v.UserInfo.UserCode,
  108 + },
  109 + Department: domain.Department{
  110 + DepartmentNumber: v.Department.DepartmentNumber,
  111 + DepartmentId: int(v.Department.DepartmentId),
  112 + DepartmentName: v.Department.DepartmentName,
  113 + }}
  114 + relevants = append(relevants, r)
  115 +
  116 + }
  117 +
  118 + for _, v := range param.DividendsIncentivesRules {
  119 + r := DividendsIncentivesRule{
  120 + DividendsIncentivesRuleId: v.DividendsIncentivesRuleId,
  121 + CooperationContractNumber: v.CooperationContractNumber,
  122 + ReferrerPercentage: v.ReferrerPercentage,
  123 + SalesmanPercentage: v.SalesmanPercentage,
  124 + DividendsIncentivesPercentage: v.DividendsIncentivesPercentage,
  125 + DividendsIncentivesStage: v.DividendsIncentivesStage,
  126 + DividendsIncentivesStageEnd: v.DividendsIncentivesStageEnd.Unix(),
  127 + DividendsIncentivesStageStart: v.DividendsIncentivesStageStart.Unix(),
  128 + }
  129 + dividendsIncentivesRules = append(dividendsIncentivesRules, r)
  130 + }
  131 +
  132 + for _, v := range param.MoneyIncentivesRules {
  133 + r := MoneyIncentivesRule{
  134 + MoneyIncentivesRuleId: v.MoneyIncentivesRuleId,
  135 + CooperationContractNumber: v.CooperationContractNumber,
  136 + MoneyIncentivesAmount: v.MoneyIncentivesAmount,
  137 + MoneyIncentivesStage: v.MoneyIncentivesStage,
  138 + MoneyIncentivesTime: v.MoneyIncentivesTime.Unix(),
  139 + ReferrerPercentage: v.ReferrerPercentage,
  140 + SalesmanPercentage: v.SalesmanPercentage,
  141 + }
  142 + moneyIncentivesRules = append(moneyIncentivesRules, r)
  143 + }
  144 +
  145 + for _, v := range param.Undertakers {
  146 + u := ContractUndertaker{
  147 + Attachment: v.ContractAttachment,
  148 + Department: domain.Department{
  149 + DepartmentNumber: v.Department.DepartmentNumber,
  150 + DepartmentId: int(v.Department.DepartmentId),
  151 + DepartmentName: v.Department.DepartmentName,
  152 + },
  153 + HasReferrer: v.Referrer.UserId > 0,
  154 + HasSalesman: v.Salesman.UserId > 0,
  155 + ReferrerUser: domain.UserInfo{
  156 + UsersName: v.Referrer.UserInfo.UserName,
  157 + Phone: v.Referrer.UserInfo.UserPhone,
  158 + UsersId: v.Referrer.UserId,
  159 + // UserCode :v.
  160 + },
  161 + SalesmanUser: domain.UserInfo{
  162 + UsersName: v.Salesman.UserInfo.UserName,
  163 + UsersId: v.Salesman.UserId,
  164 + Phone: v.Salesman.UserInfo.UserPhone,
  165 + },
  166 + UserInfo: domain.UserInfo{
  167 + UsersName: v.UserInfo.UserName,
  168 + UsersId: v.UserId,
  169 + Phone: v.UserInfo.UserPhone,
  170 + },
  171 + }
  172 + contractUndertaker = append(contractUndertaker, u)
  173 + }
  174 + data := CooperationContractInfo{
  175 + CooperationContract: *ToCooperationContractItem(param),
  176 + Relevant: relevants,
  177 + DividendsIncentivesRules: dividendsIncentivesRules,
  178 + MoneyIncentivesRules: moneyIncentivesRules,
  179 + ContractUndertaker: contractUndertaker,
  180 + }
  181 + return &data
  182 +
58 } 183 }
  1 +package query
  2 +
  3 +import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
  4 +
  5 +type SearchCooperationContractsByUndertake struct {
  6 + //操作人
  7 + Operator domain.Operator `json:"-"`
  8 + // 查询偏离量
  9 + PageNumber int `json:"pageNumber"`
  10 + // 查询限制
  11 + PageSize int `json:"pageSize" valid:"Required"`
  12 + // 项目合约名称
  13 + CooperationContractName string `json:"cooperationContractName"`
  14 + //发起人
  15 + ContractSponsor string `json:"contractSponsor"`
  16 +}
@@ -97,7 +97,8 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont @@ -97,7 +97,8 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont
97 if err != nil { 97 if err != nil {
98 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 98 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
99 } 99 }
100 - return result, nil 100 +
  101 + return dto.ToCooperationContractInfo(&result.CooperationContract), nil
101 } 102 }
102 103
103 // 返回共创合约管理列表 104 // 返回共创合约管理列表
@@ -107,13 +108,14 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon @@ -107,13 +108,14 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon
107 return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error()) 108 return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
108 } 109 }
109 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator) 110 creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator)
110 - result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{}) 111 + result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
  112 + PageNumber: listCooperationContractQuery.PageNumber,
  113 + PageSize: listCooperationContractQuery.PageSize,
  114 + })
111 if err != nil { 115 if err != nil {
112 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 116 return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
113 } 117 }
114 -  
115 data := []dto.CooperationContractItem{} 118 data := []dto.CooperationContractItem{}
116 -  
117 for i := range result.Grid.List { 119 for i := range result.Grid.List {
118 item := dto.ToCooperationContractItem(&result.Grid.List[i]) 120 item := dto.ToCooperationContractItem(&result.Grid.List[i])
119 data = append(data, *item) 121 data = append(data, *item)
@@ -189,3 +191,16 @@ func NewCooperationContractService(options map[string]interface{}) *CooperationC @@ -189,3 +191,16 @@ func NewCooperationContractService(options map[string]interface{}) *CooperationC
189 newCooperationContractService := &CooperationContractService{} 191 newCooperationContractService := &CooperationContractService{}
190 return newCooperationContractService 192 return newCooperationContractService
191 } 193 }
  194 +
  195 +func (cooperationContractService *CooperationContractService) SearchCooperationContractsByUndertake(queryParam query.SearchCooperationContractsByUndertake) (interface{}, error) {
  196 + creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(queryParam.Operator)
  197 + result, err := creationCooperationGateway.CooperationContractsSearchByUndertaker(
  198 + allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{
  199 + CooperationContractName: queryParam.CooperationContractName,
  200 + SponsorName: queryParam.ContractSponsor,
  201 + UserId: 0,
  202 + PageNumber: queryParam.PageNumber,
  203 + PageIndex: queryParam.PageSize,
  204 + })
  205 + return result, err
  206 +}
  1 +package dto
  2 +
  3 +import (
  4 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
  5 +)
  6 +
  7 +type DividendsReturnedOrderItem struct {
  8 +}
  9 +
  10 +type DividendsReturnedOrderInfo struct {
  11 + // 公司
  12 + Company struct {
  13 + CompanyID int `json:"companyId"`
  14 + CompanyLogo string `json:"companyLogo"`
  15 + CompanyName string `json:"companyName"`
  16 + } `json:"company"`
  17 + CreatedAt int64 `json:"createdAt"`
  18 + DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红
  19 + DividendTime int64 `json:"dividendTime"` //分红订单分红时间
  20 + DividendsOrderNumber int `json:"dividendsOrderNumber"` //关联分红订单号
  21 + DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
  22 + DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
  23 + DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
  24 + DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
  25 + DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
  26 + OperateTime string `json:"operateTime"` //操作时间
  27 + OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
  28 + Remarks string `json:"remarks"` //备注
  29 + //更新时间
  30 + Org struct {
  31 + OrgID int `json:"orgId"` //
  32 + OrgName string `json:"orgName"` //
  33 + } `json:"org"` //归属组织机构
  34 +
  35 + Region struct {
  36 + RegionName string `json:"regionName"`
  37 + RegionNumber string `json:"regionNumber"` //区域编码
  38 + } `json:"region"` //区域信息
  39 + Goods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"goods"` //货品
  40 +}
  41 +
  42 +func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo {
  43 + data := DividendsReturnedOrderInfo{
  44 + Goods: param.Goods,
  45 + Org: param.Org,
  46 + Region: param.Region,
  47 + Company: param.Company,
  48 + CreatedAt: param.CreatedAt.Unix(),
  49 + DividendStatus: param.DividendStatus,
  50 + DividendTime: param.DividendTime.Unix(),
  51 + DividendsOrderNumber: param.DividendsOrderNumber,
  52 + }
  53 + return &data
  54 +}
@@ -104,7 +104,8 @@ func (gateway HttplibAlliedCreationCooperation) CooperationContractSearch(param @@ -104,7 +104,8 @@ func (gateway HttplibAlliedCreationCooperation) CooperationContractSearch(param
104 } 104 }
105 105
106 // CooperationContractsSearchByUndertaker 根据承接人查询并返回共创项目合约 106 // CooperationContractsSearchByUndertaker 根据承接人查询并返回共创项目合约
107 -func (gateway HttplibAlliedCreationCooperation) CooperationContractsSearchByUndertaker(param ReqCooperationContractSearchByUndertaker) (*DataCooperationContractSearchByUndertaker, error) { 107 +func (gateway HttplibAlliedCreationCooperation) CooperationContractsSearchByUndertaker(
  108 + param ReqCooperationContractSearchByUndertaker) (*DataCooperationContractSearchByUndertaker, error) {
108 url := gateway.baseUrL + "/cooperation-contracts/search-by-undertaker" 109 url := gateway.baseUrL + "/cooperation-contracts/search-by-undertaker"
109 method := "POST" 110 method := "POST"
110 req := gateway.CreateRequest(url, method) 111 req := gateway.CreateRequest(url, method)
@@ -7,7 +7,7 @@ import ( @@ -7,7 +7,7 @@ import (
7 ) 7 )
8 8
9 type CooperationContract struct { 9 type CooperationContract struct {
10 - CooperationContractId int `json:"cooperationContractId,string"` // 共创合约ID 10 + CooperationContractId int `json:"cooperationContractId,string,"` // 共创合约ID
11 CooperationContractDescription string `json:"cooperationContractDescription"` // 共创合约描述 11 CooperationContractDescription string `json:"cooperationContractDescription"` // 共创合约描述
12 CooperationContractName string `json:"cooperationContractName"` // 共创合约名称 12 CooperationContractName string `json:"cooperationContractName"` // 共创合约名称
13 CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号 13 CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
@@ -16,7 +16,7 @@ type CooperationContract struct { @@ -16,7 +16,7 @@ type CooperationContract struct {
16 Department struct { 16 Department struct {
17 DepartmentId int `json:"departmentId"` 17 DepartmentId int `json:"departmentId"`
18 DepartmentName string `json:"departmentName"` 18 DepartmentName string `json:"departmentName"`
19 - } `jsopn:"department"` //发起部门 19 + } `jsopn:"department" json:"department"` //发起部门
20 CooperationContractSponsor struct { 20 CooperationContractSponsor struct {
21 UserId int `json:"userId"` //id 21 UserId int `json:"userId"` //id
22 UserInfo struct { 22 UserInfo struct {
@@ -27,13 +27,13 @@ type CooperationContract struct { @@ -27,13 +27,13 @@ type CooperationContract struct {
27 UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段 27 UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
28 } `json:"userInfo"` 28 } `json:"userInfo"`
29 Department struct { 29 Department struct {
30 - DepartmentId int64 `json:"departmentId,string"` // 部门ID,通过REST集成上下文获取  
31 - DepartmentName string `json:"departmentName"` // 部门名称  
32 - DepartmentNumber string `json:"departmentNumber"` // 部门编码 30 + DepartmentId int64 `json:"departmentId,string,"` // 部门ID,通过REST集成上下文获取
  31 + DepartmentName string `json:"departmentName"` // 部门名称
  32 + DepartmentNumber string `json:"departmentNumber"` // 部门编码
33 } `json:"department"` //申请人部门 33 } `json:"department"` //申请人部门
34 Org struct { 34 Org struct {
35 - OrgId int64 `json:"orgId,string"` // 组织机构ID  
36 - OrgName string `json:"orgName"` // 组织名称 35 + OrgId int64 `json:"orgId,string,"` // 组织机构ID
  36 + OrgName string `json:"orgName"` // 组织名称
37 } `json:"org"` 37 } `json:"org"`
38 UserType int `json:"userType"` 38 UserType int `json:"userType"`
39 UserName string `json:"userName"` 39 UserName string `json:"userName"`
@@ -42,19 +42,20 @@ type CooperationContract struct { @@ -42,19 +42,20 @@ type CooperationContract struct {
42 CooperationMode domain.CooperationMode `json:"cooperationMode"` // 共创模式或者合伙模式 42 CooperationMode domain.CooperationMode `json:"cooperationMode"` // 共创模式或者合伙模式
43 Status int `json:"status"` // 合约状态,1启用,2禁用 43 Status int `json:"status"` // 合约状态,1启用,2禁用
44 Org struct { 44 Org struct {
45 - OrgId int64 `json:"orgId,string"` // 组织机构ID  
46 - OrgName string `json:"orgName"` // 组织名称 45 + OrgId int64 `json:"orgId,string,"` // 组织机构ID
  46 + OrgName string `json:"orgName"` // 组织名称
47 } `json:"org"` // 数据所属组织机构 47 } `json:"org"` // 数据所属组织机构
48 Company struct { 48 Company struct {
49 - CompanyId int64 `json:"companyId,string"` // 公司ID  
50 - CompanyLogo string `json:"companyLogo"` // 公司logo  
51 - CompanyName string `json:"companyName"` // 公司名称 49 + CompanyId int64 `json:"companyId,string,"` // 公司ID
  50 + CompanyLogo string `json:"companyLogo"` // 公司logo
  51 + CompanyName string `json:"companyName"` // 公司名称
52 } `json:"company"` // 公司 52 } `json:"company"` // 公司
53 DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 分红激励规则 53 DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 分红激励规则
54 MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则 54 MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则
55 Undertakers []struct { 55 Undertakers []struct {
56 - UserId int `json:"userId"`  
57 - UserInfo struct { 56 + ContractAttachment []domain.Attachment `json:"contractAttachment"`
  57 + UserId int `json:"userId"`
  58 + UserInfo struct {
58 UserAvatar string `json:"userAvatar"` // 用户头像 59 UserAvatar string `json:"userAvatar"` // 用户头像
59 UserEmail string `json:"userEmail"` // 用户邮箱 60 UserEmail string `json:"userEmail"` // 用户邮箱
60 UserName string `json:"userName"` // 共创人员姓名 61 UserName string `json:"userName"` // 共创人员姓名
@@ -62,32 +63,52 @@ type CooperationContract struct { @@ -62,32 +63,52 @@ type CooperationContract struct {
62 UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段 63 UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
63 } `json:"userInfo"` 64 } `json:"userInfo"`
64 Department struct { 65 Department struct {
65 - DepartmentId int64 `json:"departmentId,string"` // 部门ID  
66 - DepartmentName string `json:"departmentName"` // 部门名称  
67 - DepartmentNumber string `json:"departmentNumber"` // 部门编码 66 + DepartmentId int64 `json:"departmentId,string,"` // 部门ID
  67 + DepartmentName string `json:"departmentName"` // 部门名称
  68 + DepartmentNumber string `json:"departmentNumber"` // 部门编码
68 } `json:"department"` //申请人部门 69 } `json:"department"` //申请人部门
69 Org struct { 70 Org struct {
70 - OrgId int64 `json:"orgId,string"` // 组织机构ID  
71 - OrgName string `json:"orgName"` // 组织名称 71 + OrgId int64 `json:"orgId,string,"` // 组织机构ID
  72 + OrgName string `json:"orgName"` // 组织名称
72 } `json:"org"` 73 } `json:"org"`
73 UserType int `json:"userType"` 74 UserType int `json:"userType"`
74 UserName string `json:"userName"` 75 UserName string `json:"userName"`
75 UserPhone string `json:"userPhone"` 76 UserPhone string `json:"userPhone"`
  77 + Referrer struct {
  78 + UserId int `json:"userId"`
  79 + UserInfo struct {
  80 + UserAvatar string `json:"userAvatar"` // 用户头像
  81 + UserEmail string `json:"userEmail"` // 用户邮箱
  82 + UserName string `json:"userName"` // 共创人员姓名
  83 + UserPhone string `json:"userPhone"` // 用户手机号
  84 + UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
  85 + } `json:"userInfo"`
  86 + } `json:"referrer"`
  87 + Salesman struct {
  88 + UserId int `json:"userId"`
  89 + UserInfo struct {
  90 + UserAvatar string `json:"userAvatar"` // 用户头像
  91 + UserEmail string `json:"userEmail"` // 用户邮箱
  92 + UserName string `json:"userName"` // 共创人员姓名
  93 + UserPhone string `json:"userPhone"` // 用户手机号
  94 + UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
  95 + } `json:"userInfo"`
  96 + } `json:"salesman"`
76 } `json:"undertakers"` // 共创承接人列表 97 } `json:"undertakers"` // 共创承接人列表
77 RelevantPeople []struct { 98 RelevantPeople []struct {
78 - RelevantId int `json:"relevantId,string"` 99 + RelevantId int `json:"relevantId,string,"`
79 CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号 100 CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
80 - UserId int64 `json:"userId,string"`  
81 - UserBaseId int `json:"userBaseId,string"` 101 + UserId int64 `json:"userId,string,"`
  102 + UserBaseId int `json:"userBaseId,string,"`
82 Org struct { 103 Org struct {
83 - OrgId int64 `json:"orgId,string"` // 组织机构ID  
84 - OrgName string `json:"orgName"` // 组织名称 104 + OrgId int64 `json:"orgId,string,"` // 组织机构ID
  105 + OrgName string `json:"orgName"` // 组织名称
85 } `json:"org"` 106 } `json:"org"`
86 UserInfo domain.UserInfo `json:"userInfo"` 107 UserInfo domain.UserInfo `json:"userInfo"`
87 Department struct { 108 Department struct {
88 - DepartmentId int64 `json:"departmentId,string"` // 部门ID  
89 - DepartmentName string `json:"departmentName"` // 部门名称  
90 - DepartmentNumber string `json:"departmentNumber"` // 部门编码 109 + DepartmentId int64 `json:"departmentId,string,"` // 部门ID
  110 + DepartmentName string `json:"departmentName"` // 部门名称
  111 + DepartmentNumber string `json:"departmentNumber"` // 部门编码
91 } `json:"department"` //申请人部门 112 } `json:"department"` //申请人部门
92 } `json:"relevantPeople"` // 共创合约相关人列表 113 } `json:"relevantPeople"` // 共创合约相关人列表
93 OperateTime time.Time `json:"operateTime"` // 操作时间 114 OperateTime time.Time `json:"operateTime"` // 操作时间
@@ -99,20 +120,14 @@ type CooperationContract struct { @@ -99,20 +120,14 @@ type CooperationContract struct {
99 type ( 120 type (
100 //分红激励规则 121 //分红激励规则
101 DividendsIncentivesRule struct { 122 DividendsIncentivesRule struct {
102 - // 关联的项目合约编号  
103 - CooperationContractNumber string `json:"cooperationContractNumber"`  
104 - // 推荐人抽成比例  
105 - ReferrerPercentage float64 `json:"referrerPercentage"`  
106 - // 业务员抽成比例  
107 - SalesmanPercentage float64 `json:"salesmanPercentage"`  
108 - // 分红规则激励百分点  
109 - DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`  
110 - // 分红规则激励阶段,  
111 - DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`  
112 - // 分红规则激励阶段结束  
113 - DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`  
114 - // 分红规则激励阶段开始  
115 - DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"` 123 + DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId"`
  124 + CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号
  125 + ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
  126 + SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
  127 + DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` // 分红规则激励百分点
  128 + DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"` // 分红规则激励阶段,
  129 + DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束
  130 + DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始
116 } 131 }
117 //金额激励规则 132 //金额激励规则
118 MoneyIncentivesRule struct { 133 MoneyIncentivesRule struct {
@@ -184,7 +199,7 @@ type ( @@ -184,7 +199,7 @@ type (
184 // 查询偏离量 199 // 查询偏离量
185 PageNumber int `json:"pageNumber"` 200 PageNumber int `json:"pageNumber"`
186 // 查询限制 201 // 查询限制
187 - PageSize int `json:"pageSize" valid:"Required"` 202 + PageSize int `json:"pageSize"`
188 } 203 }
189 204
190 DataCooperationContractSearch struct { 205 DataCooperationContractSearch struct {
  1 +package routers
  2 +
  3 +import (
  4 + "github.com/beego/beego/v2/server/web"
  5 + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
  6 +)
  7 +
  8 +func init() {
  9 + web.Router("/v1/web/cooperation-contracts/", &web_client.CooperationContractController{}, "Post:CreateCooperationContract")
  10 + web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Put:UpdateCooperationContract")
  11 + web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Get:GetCooperationContract")
  12 + web.Router("/v1/web/cooperation-contracts/search", &web_client.CooperationContractController{}, "Post:ListCooperationContract")
  13 + web.Router("/v1/web/cooperation-contracts/enable", &web_client.CooperationContractController{}, "Put:EnableCooperationContract")
  14 +}