package allied_creation_cooperation import ( "time" "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain" ) type CooperationContract struct { CooperationContractId int `json:"cooperationContractId,string,"` // 共创合约ID CooperationContractDescription string `json:"cooperationContractDescription"` // 共创合约描述 CooperationContractName string `json:"cooperationContractName"` // 共创合约名称 CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号 CooperationProjectNumber string `json:"cooperationProjectNumber"` CooperationContractUndertakerTypes []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开 Department struct { DepartmentId int `json:"departmentId,string"` DepartmentName string `json:"departmentName"` DepartmentNumber string `json:"departmentNumber"` } `jsopn:"department"` //发起部门 CooperationContractSponsor struct { UserId int `json:"userId,string"` //id UserInfo struct { UserAvatar string `json:"userAvatar"` // 用户头像 UserEmail string `json:"userEmail"` // 用户邮箱 UserName string `json:"userName"` // 共创人员姓名 UserPhone string `json:"userPhone"` // 用户手机号 UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段 } `json:"userInfo"` Department struct { 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"` // 组织名称 } `json:"org"` UserType int `json:"userType"` UserName string `json:"userName"` UserPhone string `json:"userPhone"` } `json:"cooperationContractSponsor"` // 共创合约发起人 CooperationMode domain.CooperationMode `json:"cooperationMode"` // 共创模式或者合伙模式 Status int `json:"status"` // 合约状态,1启用,2禁用 Org struct { 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"` // 公司名称 } `json:"company"` // 公司 DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 分红激励规则 MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则 Undertakers []struct { ContractAttachment []domain.Attachment `json:"contractAttachment"` UserId int `json:"userId,string"` UndertakerId int `json:"undertakerId,string"` UserInfo struct { UserAvatar string `json:"userAvatar"` // 用户头像 UserEmail string `json:"userEmail"` // 用户邮箱 UserName string `json:"userName"` // 共创人员姓名 UserPhone string `json:"userPhone"` // 用户手机号 UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段 UserCode string `json:"userCode"` } `json:"userInfo"` Department struct { 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"` // 组织名称 } `json:"org"` UserType int `json:"userType"` UserName string `json:"userName"` UserPhone string `json:"userPhone"` Referrer struct { UserId int `json:"userId,string"` UserType int32 `json:"userType"` // 用户类型,1员工,2共创用户,3公开 UserName string `json:"userName"` // 用户姓名 UserPhone string `json:"userPhone"` // 用户手机号 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,string"` UserType int32 `json:"userType"` // 用户类型,1员工,2共创用户,3公开 UserName string `json:"userName"` // 用户姓名 UserPhone string `json:"userPhone"` // 用户手机号 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,"` CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号 UserId int64 `json:"userId,string,"` UserBaseId int `json:"userBaseId,string,"` Org struct { OrgId int64 `json:"orgId,string,"` // 组织机构ID OrgName string `json:"orgName"` // 组织名称 } `json:"org"` UserInfo struct { UserAvatar string `json:"userAvatar"` UserEmail string `json:"userEmail"` UserName string `json:"userName"` UserPhone string `json:"userPhone"` UserAccount string `json:"userAccount"` UserCode string `json:"userCode"` } `json:"userInfo"` Department struct { DepartmentId int64 `json:"departmentId,string,"` // 部门ID DepartmentName string `json:"departmentName"` // 部门名称 DepartmentNumber string `json:"departmentNumber"` // 部门编码 } `json:"department"` //申请人部门 } `json:"relevantPeople"` // 共创合约相关人列表 OperateTime time.Time `json:"operateTime"` // 操作时间 CreatedAt time.Time `json:"createdAt"` // 创建时间 UpdatedAt time.Time `json:"updatedAt"` // 更新时间 UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"` } //创建共创合约 type ( //分红激励规则 DividendsIncentivesRule struct { DividendsIncentivesRuleId int `json:"dividendsIncentivesRuleId,string"` CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的项目合约编号 ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例 SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例 DividendsIncentivesPercentage float64 `json:"dividendsIncentivesPercentage"` // 分红规则激励百分点 DividendsIncentivesStage int `json:"dividendsIncentivesStage"` // 分红规则激励阶段, DividendsIncentivesStageEnd time.Time `json:"dividendsIncentivesStageEnd"` // 分红规则激励阶段结束 DividendsIncentivesStageStart time.Time `json:"dividendsIncentivesStageStart"` // 分红规则激励阶段开始 Remarks string `json:"remarks"` } //金额激励规则 MoneyIncentivesRule struct { MoneyIncentivesRuleId int `json:"moneyIncentivesRuleId,string"` // 金额激励规则ID CooperationContractNumber string `json:"cooperationContractNumber"` // 关联的共创合约编号 MoneyIncentivesAmount float64 `json:"moneyIncentivesAmount"` // 激励金额 MoneyIncentivesStage int `json:"moneyIncentivesStage"` // 金额激励阶段 MoneyIncentivesTime time.Time `json:"moneyIncentivesTime"` // 金额激励规则时间 ReferrerPercentage float64 `json:"referrerPercentage"` // 推荐人抽成比例 SalesmanPercentage float64 `json:"salesmanPercentage"` // 业务员抽成比例 Remarks string `json:"remarks"` } //合约承接方 Undertaker struct { UndertakerId int `json:"undertakerId,string"` UserId int `json:"userId,string"` //承接人用户id ReferrerId int `json:"referrerId,string"` //推荐人用户id SalesmanId int `json:"salesmanId,string"` //关联业务员id ContractAttachment []domain.Attachment `json:"contractAttachment"` } ReqCooperationContractAdd struct { CooperationContractDescription string `json:"cooperationContractDescription"` // 共创合约描述 // CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号, DepartmentId string `json:"departmentId"` // 共创合约发起部门id CooperationContractUndertakerType []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开 CooperationContractName string `json:"cooperationContractName"` // 共创合约名称 CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码, SponsorUid string `json:"sponsorUid"` // 共创合约发起人uid DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 业绩分红激励规则列表 MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` // 金额激励规则列表 Undertakers []Undertaker `json:"undertakers"` // 承接方列表 RelevantIds []string `json:"relevantIds"` //关联业务员 CompanyId int `json:"-"` OrgId int `json:"-"` // 组织机构ID UserId int `json:"-"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 UserBaseId int `json:"-" ` // 用户基础数据id } DataCooperationContractAdd struct { CooperationContract } ) //更新共创合约 type ( ReqCooperationContractUpdate struct { CooperationContractId int `json:"cooperationContractId,string"` // 共创合约id CooperationContractDescription string `json:"cooperationContractDescription"` //共创 // CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号 CooperationProjectNumber string `json:"cooperationProjectNumber"` // 共创项目编号, DepartmentId string `json:"departmentId"` // 共创合约发起部门id CooperationContractUndertakerType []int `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开 CooperationContractName string `json:"cooperationContractName"` // 共创合约名称 CooperationModeNumber string `json:"cooperationModeNumber"` // 共创模式编码, SponsorUid string `json:"sponsorUid,omitempty,"` // 共创合约发起人uid DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 金额激励规则列表 MoneyIncentivesRules []MoneyIncentivesRule `json:"moneyIncentivesRules"` Undertakers []Undertaker `json:"undertakers"` // 承接方列表 // 业绩分红激励规则列表 RelevantIds []string `json:"relevantIds"` //关联业务员 CompanyId int `json:"-"` OrgId int `json:"-"` // 组织机构ID UserId int ` json:"-"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员 UserBaseId int `json:"-" ` // 用户基础数据id } DataCooperationContractUpdate struct { CooperationContract } ) //查询共创合约 type ( ReqCooperationContractSearch struct { // 查询偏离量 PageNumber int `json:"pageNumber"` // 查询限制 PageSize int `json:"pageSize"` CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号 SponsorName string `json:"sponsorName"` //发起人名字 Status int `json:"status"` // 公司ID,通过集成REST上下文获取 CompanyId int64 ` json:"companyId"` // 组织机构ID OrgId int64 ` json:"orgId"` // 用户基础数据id UserBaseId int64 `json:"userBaseId"` // 组织机构ID OrgIds []int64 ` json:"orgIds"` IncentivesType int `json:"incentivesType"` //作为合约激励方式的判断,1业绩分红激励,2金额激励 } DataCooperationContractSearch struct { Grid struct { Total int `json:"total"` List []CooperationContract `json:"list"` } `json:"grid"` } ) //根据承接人查询并返回共创项目合约 type ( ReqCooperationContractSearchByUndertaker struct { CooperationContractName string `json:"cooperationContractName"` //合约名称 SponsorName string `json:"sponsorName"` //项目发起人姓名 PageNumber int `json:"pageNumber"` PageSize int `json:"pageSize"` CompanyId int64 ` json:"companyId"` OrgId int64 ` json:"orgId"` UserBaseId int64 `json:"userBaseId"` OrgIds []int64 ` json:"orgIds"` } DataCooperationContractSearchByUndertaker struct { Grid struct { Total int List []struct { UndertakerId int64 `json:"undertakerId,string"` // 承接人ID UndertakerCode string `json:"undertakerCode"` // 承接人编号 UndertakerName string `json:"undertakerName"` // 承接人姓名 UndertakerPhone string `json:"undertakerPhone"` // 承接人电话 CooperationContractNumber string `json:"cooperationContractNumber"` // 项目合约编号 CooperationContractName string `json:"cooperationContractName"` // 项目合约名称 Attachment []domain.Attachment `json:"attachment"` // 合同附件 SponsorName string `json:"sponsorName"` // 发起人姓名 DepartmentName string `json:"departmentName"` // 发起部门名称 CooperationModeName string `json:"cooperationModeName"` // 共创模式名称 OrgName string `json:"orgName"` // 组织机构名称 CooperationContractStatus int32 `json:"cooperationContractStatus"` // 项目合约状态 CooperationContractDescription string `json:"cooperationContractDescription"` // 共创描述 } } } ) //移除共创合约 type ( ReqCooperationContractRemove struct { CooperationContractId int `json:"cooperationContractId"` } DataCooperationContractRemove struct { CooperationContract } ) //移除共创合约 type ( ReqCooperationContractBatchRemove struct { CooperationContractIds []string `json:"cooperationContractIds"` } DataCooperationContractBatchRemove []struct { } ) //返回共创合约列表 type ( ReqCooperationContractList struct { } DataCooperationContractList struct { } ) //返回共创合约详情 type ( ReqCooperationContractGet struct { CooperationContractId int `json:"cooperationContractId"` } DataCooperationContractGet struct { CooperationContract // 可以去除勾选的共创项目承接对象列表 UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"` } ) //批量恢复或暂停合约 type ( ReqCooperationContractsBatchOperate struct { CooperationContractIds []string `json:"cooperationContractIds"` Action int `json:"action"` //暂停或恢复合约动作,1恢复,2暂停 } DataCooperationContractsBatchOperate []interface{} )