作者 yangfu
{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628731667364868600}
\ No newline at end of file
{"D:\\workspaceGo\\src\\allied-creation-gateway\\pkg\\port\\beego\\routers":1628752601441259500}
\ No newline at end of file
... ...
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type CooperationContractItem struct {
CooperationContractId int `json:"cooperationContractId,string,"`
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationContractName string `json:"CooperationContractName"` //合约名称
Status int `json:"status"` //合约状态
CreateTtime int `json:"createTtime"`
Department struct {
DepartmentId int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
} `json:"department"`
IncentivesType string `json:"incentivesType"` //Incentives激励方式
CooperationContractId int `json:"cooperationContractId,string,"`
CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
CooperationProjectNumber string `json:"cooperationProjectNumber"` //项目编号
CooperationContractName string `json:"CooperationContractName"` //合约名称
Status int `json:"status"` //合约状态
CreateTtime int `json:"createTtime"`
Department domain.Department `json:"department"`
IncentivesType string `json:"incentivesType"` //Incentives激励方式
CooperationContractSponsor struct {
UserId int `json:"userId,string,"`
UserName string `json:"userName"`
} `json:"cooperationContractSponsor"` //共创发起人
CooperationMode struct {
CooperationModeId int `json:"cooperationModeId,string,"` // 共创模式ID
CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码,
CooperationModeName string `json:"cooperationModeName"` // 模式名称,
} `json:"cooperationMode"` //共创模式
Org struct {
OrgId int `json:"orgId"` // id
OrgName string `json:"orgName"` //
} `json:"org"` //组织结构
CooperationMode domain.CooperationMode `json:"cooperationMode"` //共创模式
Org domain.Org `json:"org"` //组织结构
}
func ToCooperationContractItem(param *allied_creation_cooperation.CooperationContract) *CooperationContractItem {
// relevantPeople := []int{}
data := CooperationContractItem{
CooperationContractId: param.CooperationContractId,
CooperationProjectNumber: param.CooperationContractNumber,
... ... @@ -45,14 +35,149 @@ func ToCooperationContractItem(param *allied_creation_cooperation.CooperationCon
data.CooperationContractSponsor.UserName = param.CooperationContractSponsor.UserInfo.UserName
data.Department.DepartmentId = param.Department.DepartmentId
data.Department.DepartmentName = param.Department.DepartmentName
data.Org.OrgId = int(param.Org.OrgId)
data.Org.OrgID = int(param.Org.OrgId)
data.Org.OrgName = param.Org.OrgName
data.CooperationMode.CooperationModeId = param.CooperationMode.CooperationModeId
data.CooperationMode.CooperationModeName = param.CooperationMode.CooperationModeName
data.CooperationMode.CooperationModeNumber = param.CooperationMode.CooperationModeNumber
if len(param.DividendsIncentivesRules) > 0 {
data.IncentivesType = "业绩分红"
} else if len(param.MoneyIncentivesRules) > 0 {
data.IncentivesType = "金额激励"
}
return nil
}
type MoneyIncentivesRule struct {
MoneyIncentivesRuleId int `json:"moneyIncentivesRuleId"`
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的共创合约编号
MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"` // 激励金额
MoneyIncentivesStage int `json:"moneyIncentivesStage"` // 金额激励阶段
MoneyIncentivesTime int64 `json:"moneyIncentivesTime"` // 金额激励规则时间
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
}
type DividendsIncentivesRule struct {
DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId"`
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` // 分红规则激励百分点
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"` // 分红规则激励阶段,
DividendsIncentivesStageEnd int64 `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束
DividendsIncentivesStageStart int64 `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始
}
type Relevant struct {
UserId int `json:"userId"`
UserInfo domain.UserInfo `json:"userInfo"`
Department domain.Department `json:"department"`
}
type ContractUndertaker struct {
Attachment []domain.Attachment `json:"attachment"`
Department domain.Department `json:"department"`
HasReferrer bool `json:"hasReferrer"`
HasSalesman bool `json:"hasSalesman"`
ReferrerUser domain.UserInfo `json:"referrerUser"`
SalesmanUser domain.UserInfo `json:"salesmanUser"`
UserInfo domain.UserInfo `json:"userInfo"`
}
type CooperationContractInfo struct {
CooperationContract CooperationContractItem `json:"cooperationContract"`
Relevant []Relevant `json:"relevant"`
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"`
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"`
ContractUndertaker []ContractUndertaker `json:"contractUndertaker"`
}
func ToCooperationContractInfo(param *allied_creation_cooperation.CooperationContract) *CooperationContractInfo {
relevants := []Relevant{}
dividendsIncentivesRules := []DividendsIncentivesRule{}
moneyIncentivesRules := []MoneyIncentivesRule{}
contractUndertaker := []ContractUndertaker{}
for _, v := range param.RelevantPeople {
r := Relevant{
UserId: int(v.UserId),
UserInfo: domain.UserInfo{
UsersName: v.UserInfo.UsersName,
UsersId: v.UserInfo.UsersId,
UserCode: v.UserInfo.UserCode,
},
Department: domain.Department{
DepartmentNumber: v.Department.DepartmentNumber,
DepartmentId: int(v.Department.DepartmentId),
DepartmentName: v.Department.DepartmentName,
}}
relevants = append(relevants, r)
}
for _, v := range param.DividendsIncentivesRules {
r := DividendsIncentivesRule{
DividendsIncentivesRuleId: v.DividendsIncentivesRuleId,
CooperationContractNumber: v.CooperationContractNumber,
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
DividendsIncentivesPercentage: v.DividendsIncentivesPercentage,
DividendsIncentivesStage: v.DividendsIncentivesStage,
DividendsIncentivesStageEnd: v.DividendsIncentivesStageEnd.Unix(),
DividendsIncentivesStageStart: v.DividendsIncentivesStageStart.Unix(),
}
dividendsIncentivesRules = append(dividendsIncentivesRules, r)
}
for _, v := range param.MoneyIncentivesRules {
r := MoneyIncentivesRule{
MoneyIncentivesRuleId: v.MoneyIncentivesRuleId,
CooperationContractNumber: v.CooperationContractNumber,
MoneyIncentivesAmount: v.MoneyIncentivesAmount,
MoneyIncentivesStage: v.MoneyIncentivesStage,
MoneyIncentivesTime: v.MoneyIncentivesTime.Unix(),
ReferrerPercentage: v.ReferrerPercentage,
SalesmanPercentage: v.SalesmanPercentage,
}
moneyIncentivesRules = append(moneyIncentivesRules, r)
}
for _, v := range param.Undertakers {
u := ContractUndertaker{
Attachment: v.ContractAttachment,
Department: domain.Department{
DepartmentNumber: v.Department.DepartmentNumber,
DepartmentId: int(v.Department.DepartmentId),
DepartmentName: v.Department.DepartmentName,
},
HasReferrer: v.Referrer.UserId > 0,
HasSalesman: v.Salesman.UserId > 0,
ReferrerUser: domain.UserInfo{
UsersName: v.Referrer.UserInfo.UserName,
Phone: v.Referrer.UserInfo.UserPhone,
UsersId: v.Referrer.UserId,
// UserCode :v.
},
SalesmanUser: domain.UserInfo{
UsersName: v.Salesman.UserInfo.UserName,
UsersId: v.Salesman.UserId,
Phone: v.Salesman.UserInfo.UserPhone,
},
UserInfo: domain.UserInfo{
UsersName: v.UserInfo.UserName,
UsersId: v.UserId,
Phone: v.UserInfo.UserPhone,
},
}
contractUndertaker = append(contractUndertaker, u)
}
data := CooperationContractInfo{
CooperationContract: *ToCooperationContractItem(param),
Relevant: relevants,
DividendsIncentivesRules: dividendsIncentivesRules,
MoneyIncentivesRules: moneyIncentivesRules,
ContractUndertaker: contractUndertaker,
}
return &data
}
... ...
package query
import "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
type SearchCooperationContractsByUndertake struct {
//操作人
Operator domain.Operator `json:"-"`
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
// 项目合约名称
CooperationContractName string `json:"cooperationContractName"`
//发起人
ContractSponsor string `json:"contractSponsor"`
}
... ...
... ... @@ -97,7 +97,8 @@ func (cooperationContractService *CooperationContractService) GetCooperationCont
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
return dto.ToCooperationContractInfo(&result.CooperationContract), nil
}
// 返回共创合约管理列表
... ... @@ -107,13 +108,14 @@ func (cooperationContractService *CooperationContractService) ListCooperationCon
return 0, nil, application.ThrowError(application.ARG_ERROR, err.Error())
}
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(listCooperationContractQuery.Operator)
result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{})
result, err := creationCooperationGateway.CooperationContractSearch(allied_creation_cooperation.ReqCooperationContractSearch{
PageNumber: listCooperationContractQuery.PageNumber,
PageSize: listCooperationContractQuery.PageSize,
})
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
data := []dto.CooperationContractItem{}
for i := range result.Grid.List {
item := dto.ToCooperationContractItem(&result.Grid.List[i])
data = append(data, *item)
... ... @@ -189,3 +191,16 @@ func NewCooperationContractService(options map[string]interface{}) *CooperationC
newCooperationContractService := &CooperationContractService{}
return newCooperationContractService
}
func (cooperationContractService *CooperationContractService) SearchCooperationContractsByUndertake(queryParam query.SearchCooperationContractsByUndertake) (interface{}, error) {
creationCooperationGateway := allied_creation_cooperation.NewHttplibAlliedCreationCooperation(queryParam.Operator)
result, err := creationCooperationGateway.CooperationContractsSearchByUndertaker(
allied_creation_cooperation.ReqCooperationContractSearchByUndertaker{
CooperationContractName: queryParam.CooperationContractName,
SponsorName: queryParam.ContractSponsor,
UserId: 0,
PageNumber: queryParam.PageNumber,
PageIndex: queryParam.PageSize,
})
return result, err
}
... ...
... ... @@ -99,7 +99,6 @@ func ToCooperationApplicationItem(param *allied_creation_cooperation.Cooperation
CooperationApplicationAttachment: param.CooperationApplicationAttachment,
}
data.CooperationApplicationApplicant.Company.CompanyID = param.CooperationApplicationApplicant.Company.CompanyID
// data.CooperationApplicationApplicant.Company.CompanyLogo = param.CooperationApplicationApplicant.Company.CompanyLogo
data.CooperationApplicationApplicant.Company.CompanyName = param.CooperationApplicationApplicant.Company.CompanyName
data.CooperationApplicationApplicant.Department.DepartmentId = param.CooperationApplicationApplicant.Department.DepartmentID
data.CooperationApplicationApplicant.Department.DepartmentName = param.CooperationApplicationApplicant.Department.DepartmentName
... ...
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type DividendsOrder struct {
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CustomerName string `json:"customerName"` //客户名字
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime int64 `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
DepartmentNumber string `json:"departmentNumber"`
IsOrganization bool `json:"isOrganization"`
} `json:"department"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
UserBaseID int `json:"userBaseId"`
UserID int `json:"userId"`
UserInfo struct {
UserAccount string `json:"userAccount"`
UserAvatar string `json:"userAvatar"`
UserEmail string `json:"userEmail"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"orderSalesman"`
OrderTime int64 `json:"orderTime"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
} `json:"org"`
Region struct {
RegionName string `json:"regionName"`
RegionNumber string `json:"regionNumber"`
}
}
func ToDividendsOrder(param *allied_creation_cooperation.DividendsOrder) *DividendsOrder {
data := DividendsOrder{
Company: param.Company,
CustomerName: param.CustomerName,
DividendStatus: param.DividendStatus,
DividendTime: param.DividendTime.Unix(),
DividendsOrderAmount: param.DividendsOrderAmount,
DividendsOrderID: param.DividendsOrderID,
DividendsOrderNumber: param.DividendsOrderNumber,
DividendsOriginalOrderNum: param.DividendsOriginalOrderNum,
OrderSalesman: param.OrderSalesman,
OrderTime: param.OrderTime.Unix(),
Org: param.Org,
Region: param.Region,
}
return &data
}
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsOrder/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -68,7 +69,7 @@ func (dividendsOrderService *DividendsOrderService) GetDividendsOrder(getDividen
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
return dto.ToDividendsOrder(&result.DividendsOrder), nil
}
// 移除分红订单实体对象
... ... @@ -102,8 +103,12 @@ func (dividendsOrderService *DividendsOrderService) SearchDividendsOrder(searchD
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result.Gride.Total, result.Gride.List, nil
var dataList []dto.DividendsOrder
for i := range result.Gride.List {
item := dto.ToDividendsOrder(&result.Gride.List[i])
dataList = append(dataList, *item)
}
return result.Gride.Total, dataList, nil
}
// 更新分红订单实体对象
... ...
package dto
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
type DividendsReturnedOrderInfo struct {
// 公司
Company struct {
CompanyID int `json:"companyId"`
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CreatedAt int64 `json:"createdAt"`
DividendStatus int `json:"dividendStatus"` // 分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime int64 `json:"dividendTime"` //分红订单分红时间
DividendsOrderNumber int `json:"dividendsOrderNumber"` //关联分红订单号
DividendsReturnedCustomerName string `json:"dividendsReturnedCustomerName"` //退货客户姓名
DividendsReturnedDate int64 `json:"dividendsReturnedDate"` //退货日期
DividendsReturnedOrderID string `json:"dividendsReturnedOrderId"` //分红退货单记录id
DividendsReturnedOrderNumber string `json:"dividendsReturnedOrderNumber"` //分红退货单号
DividendsReturnedOrderRefund float64 `json:"dividendsReturnedOrderRefund"` //退货金额
OriginalOrderNum string `json:"originalOrderNum"` //源单号(原始订单号)
Remarks string `json:"remarks"` //备注
//更新时间
Org struct {
OrgID int `json:"orgId"` //
OrgName string `json:"orgName"` //
} `json:"org"` //归属组织机构
Region struct {
RegionName string `json:"regionName"`
RegionNumber string `json:"regionNumber"` //区域编码
} `json:"region"` //区域信息
Goods []allied_creation_cooperation.DividendsReturnedOrderGoods `json:"goods"` //货品
}
func ToDividendsReturnedOrderInfo(param *allied_creation_cooperation.DividendsReturnedOrder) *DividendsReturnedOrderInfo {
data := DividendsReturnedOrderInfo{
Goods: param.Goods,
Org: param.Org,
Region: param.Region,
Company: param.Company,
CreatedAt: param.CreatedAt.Unix(),
DividendStatus: param.DividendStatus,
DividendTime: param.DividendTime.Unix(),
DividendsOrderNumber: param.DividendsOrderNumber,
DividendsReturnedCustomerName: param.DividendsReturnedCustomerName,
DividendsReturnedDate: param.DividendsReturnedDate.Unix(),
DividendsReturnedOrderID: param.DividendsReturnedOrderID,
DividendsReturnedOrderNumber: param.DividendsReturnedOrderNumber,
DividendsReturnedOrderRefund: param.DividendsReturnedOrderRefund,
OriginalOrderNum: param.OriginalOrderNum,
Remarks: param.Remarks,
}
return &data
}
... ...
... ... @@ -5,6 +5,7 @@ import (
"github.com/linmadan/egglib-go/core/application"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/command"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/dto"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/application/web/dividendsReturnedOrder/query"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/infrastructure/service_gateway/allied_creation_cooperation"
)
... ... @@ -33,7 +34,7 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) GetDividends
if err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result, nil
return dto.ToDividendsReturnedOrderInfo(&result.DividendsReturnedOrder), nil
}
// 移除分红退货单服务
... ... @@ -65,7 +66,12 @@ func (dividendsReturnedOrderService *DividendsReturnedOrderService) SearchDivide
if err != nil {
return 0, nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return result.Total, result.List, nil
dataList := []dto.DividendsReturnedOrderInfo{}
for i := range result.List {
item := dto.ToDividendsReturnedOrderInfo(&result.List[i])
dataList = append(dataList, *item)
}
return result.Total, dataList, nil
}
// 更新分红退货单服务
... ...
... ... @@ -104,7 +104,8 @@ func (gateway HttplibAlliedCreationCooperation) CooperationContractSearch(param
}
// CooperationContractsSearchByUndertaker 根据承接人查询并返回共创项目合约
func (gateway HttplibAlliedCreationCooperation) CooperationContractsSearchByUndertaker(param ReqCooperationContractSearchByUndertaker) (*DataCooperationContractSearchByUndertaker, error) {
func (gateway HttplibAlliedCreationCooperation) CooperationContractsSearchByUndertaker(
param ReqCooperationContractSearchByUndertaker) (*DataCooperationContractSearchByUndertaker, error) {
url := gateway.baseUrL + "/cooperation-contracts/search-by-undertaker"
method := "POST"
req := gateway.CreateRequest(url, method)
... ...
... ... @@ -7,7 +7,7 @@ import (
)
type CooperationContract struct {
CooperationContractId int `json:"cooperationContractId,string"` // 共创合约ID
CooperationContractId int `json:"cooperationContractId,string,"` // 共创合约ID
CooperationContractDescription string `json:"cooperationContractDescription"` // 共创合约描述
CooperationContractName string `json:"cooperationContractName"` // 共创合约名称
CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
... ... @@ -16,7 +16,7 @@ type CooperationContract struct {
Department struct {
DepartmentId int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
} `jsopn:"department"` //发起部门
} `jsopn:"department" json:"department"` //发起部门
CooperationContractSponsor struct {
UserId int `json:"userId"` //id
UserInfo struct {
... ... @@ -27,13 +27,13 @@ type CooperationContract struct {
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
} `json:"userInfo"`
Department struct {
DepartmentId int64 `json:"departmentId,string"` // 部门ID,通过REST集成上下文获取
DepartmentName string `json:"departmentName"` // 部门名称
DepartmentNumber string `json:"departmentNumber"` // 部门编码
DepartmentId int64 `json:"departmentId,string,"` // 部门ID,通过REST集成上下文获取
DepartmentName string `json:"departmentName"` // 部门名称
DepartmentNumber string `json:"departmentNumber"` // 部门编码
} `json:"department"` //申请人部门
Org struct {
OrgId int64 `json:"orgId,string"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
OrgId int64 `json:"orgId,string,"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
} `json:"org"`
UserType int `json:"userType"`
UserName string `json:"userName"`
... ... @@ -42,19 +42,20 @@ type CooperationContract struct {
CooperationMode domain.CooperationMode `json:"cooperationMode"` // 共创模式或者合伙模式
Status int `json:"status"` // 合约状态,1启用,2禁用
Org struct {
OrgId int64 `json:"orgId,string"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
OrgId int64 `json:"orgId,string,"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
} `json:"org"` // 数据所属组织机构
Company struct {
CompanyId int64 `json:"companyId,string"` // 公司ID
CompanyLogo string `json:"companyLogo"` // 公司logo
CompanyName string `json:"companyName"` // 公司名称
CompanyId int64 `json:"companyId,string,"` // 公司ID
CompanyLogo string `json:"companyLogo"` // 公司logo
CompanyName string `json:"companyName"` // 公司名称
} `json:"company"` // 公司
DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 分红激励规则
MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则
Undertakers []struct {
UserId int `json:"userId"`
UserInfo struct {
ContractAttachment []domain.Attachment `json:"contractAttachment"`
UserId int `json:"userId"`
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
... ... @@ -62,32 +63,52 @@ type CooperationContract struct {
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
} `json:"userInfo"`
Department struct {
DepartmentId int64 `json:"departmentId,string"` // 部门ID
DepartmentName string `json:"departmentName"` // 部门名称
DepartmentNumber string `json:"departmentNumber"` // 部门编码
DepartmentId int64 `json:"departmentId,string,"` // 部门ID
DepartmentName string `json:"departmentName"` // 部门名称
DepartmentNumber string `json:"departmentNumber"` // 部门编码
} `json:"department"` //申请人部门
Org struct {
OrgId int64 `json:"orgId,string"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
OrgId int64 `json:"orgId,string,"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
} `json:"org"`
UserType int `json:"userType"`
UserName string `json:"userName"`
UserPhone string `json:"userPhone"`
Referrer struct {
UserId int `json:"userId"`
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
} `json:"userInfo"`
} `json:"referrer"`
Salesman struct {
UserId int `json:"userId"`
UserInfo struct {
UserAvatar string `json:"userAvatar"` // 用户头像
UserEmail string `json:"userEmail"` // 用户邮箱
UserName string `json:"userName"` // 共创人员姓名
UserPhone string `json:"userPhone"` // 用户手机号
UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
} `json:"userInfo"`
} `json:"salesman"`
} `json:"undertakers"` // 共创承接人列表
RelevantPeople []struct {
RelevantId int `json:"relevantId,string"`
RelevantId int `json:"relevantId,string,"`
CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
UserId int64 `json:"userId,string"`
UserBaseId int `json:"userBaseId,string"`
UserId int64 `json:"userId,string,"`
UserBaseId int `json:"userBaseId,string,"`
Org struct {
OrgId int64 `json:"orgId,string"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
OrgId int64 `json:"orgId,string,"` // 组织机构ID
OrgName string `json:"orgName"` // 组织名称
} `json:"org"`
UserInfo domain.UserInfo `json:"userInfo"`
Department struct {
DepartmentId int64 `json:"departmentId,string"` // 部门ID
DepartmentName string `json:"departmentName"` // 部门名称
DepartmentNumber string `json:"departmentNumber"` // 部门编码
DepartmentId int64 `json:"departmentId,string,"` // 部门ID
DepartmentName string `json:"departmentName"` // 部门名称
DepartmentNumber string `json:"departmentNumber"` // 部门编码
} `json:"department"` //申请人部门
} `json:"relevantPeople"` // 共创合约相关人列表
OperateTime time.Time `json:"operateTime"` // 操作时间
... ... @@ -99,20 +120,14 @@ type CooperationContract struct {
type (
//分红激励规则
DividendsIncentivesRule struct {
// 关联的项目合约编号
CooperationContractNumber string `json:"cooperationContractNumber"`
// 推荐人抽成比例
ReferrerPercentage float64 `json:"referrerPercentage"`
// 业务员抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"`
// 分红规则激励百分点
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"`
// 分红规则激励阶段,
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string"`
// 分红规则激励阶段结束
DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"`
// 分红规则激励阶段开始
DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"`
DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId"`
CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号
ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例
SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例
DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` // 分红规则激励百分点
DividendsIncentivesStage int64 `json:"dividendsIncentivesStage,string,"` // 分红规则激励阶段,
DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束
DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始
}
//金额激励规则
MoneyIncentivesRule struct {
... ... @@ -184,7 +199,7 @@ type (
// 查询偏离量
PageNumber int `json:"pageNumber"`
// 查询限制
PageSize int `json:"pageSize" valid:"Required"`
PageSize int `json:"pageSize"`
}
DataCooperationContractSearch struct {
... ...
... ... @@ -10,14 +10,14 @@ type DividendsOrder struct {
CompanyLogo string `json:"companyLogo"`
CompanyName string `json:"companyName"`
} `json:"company"`
CustomerName string `json:"customerName"` //客户名字
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime string `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
CustomerName string `json:"customerName"` //客户名字
DividendStatus int `json:"dividendStatus"` //分红订单分红状态,1待分红,2已分红,3部分分红
DividendTime time.Time `json:"dividendTime"` //分红订单分红时间
DividendsOrderAmount float64 `json:"dividendsOrderAmount"` //分红订单金额
DividendsOrderID int `json:"dividendsOrderId"` //分红订单
DividendsOrderNumber int `json:"dividendsOrderNumber"` //分红订单号
DividendsOriginalOrderNum string `json:"dividendsOriginalOrderNum"` //分红订单原单号
OrderSalesman struct { //订单业务员
Department struct {
DepartmentID int `json:"departmentId"`
DepartmentName string `json:"departmentName"`
... ... @@ -39,7 +39,7 @@ type DividendsOrder struct {
} `json:"userInfo"`
UserType int `json:"userType"`
} `json:"orderSalesman"`
OrderTime string `json:"orderTime"`
OrderTime time.Time `json:"orderTime"`
Org struct {
OrgID int `json:"orgId"`
OrgName string `json:"orgName"`
... ...
... ... @@ -7,6 +7,6 @@ import (
func init() {
web.Router("/v1/web/cooperation-applications/:applicationId", &web_client.CooperationApplicationController{}, "Get:GetCooperationApplication")
web.Router("/v1/web/cooperation-applications/search", &web_client.CooperationApplicationController{}, "Get:ListCooperationApplication")
web.Router("/v1/web/cooperation-applications/search", &web_client.CooperationApplicationController{}, "Post:ListCooperationApplication")
web.Router("/v1/web/cooperation-applications/audit", &web_client.CooperationApplicationController{}, "Put:AuditCooperationApplication")
}
... ...
package routers
import (
"github.com/beego/beego/v2/server/web"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/controllers/web_client"
)
func init() {
web.Router("/v1/web/cooperation-contracts/", &web_client.CooperationContractController{}, "Post:CreateCooperationContract")
web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Put:UpdateCooperationContract")
web.Router("/v1/web/cooperation-contracts/:contractId", &web_client.CooperationContractController{}, "Get:GetCooperationContract")
web.Router("/v1/web/cooperation-contracts/search", &web_client.CooperationContractController{}, "Post:ListCooperationContract")
web.Router("/v1/web/cooperation-contracts/enable", &web_client.CooperationContractController{}, "Put:EnableCooperationContract")
}
... ...