param_dividends_estimate.go 11.5 KB
package allied_creation_cooperation

import "time"

//查询业绩分红
type (
	ReqDividendsEstimateSearchDividend struct {
		PageNumber                int    `json:"pageNumber"`
		PageSize                  int    `json:"pageSize"`
		CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
		OrderOrReturnedOrderNum   string `json:"orderOrReturnedOrderNum"`   //分红订单号/退货单号
	}

	DataDividendsEstimateSearchDividend struct {
		Total int `json:"total"`
		List  []struct {
			//	分红订单产品ID
			OrderGoodId int `json:"orderGoodId,string"`
			//	共创合约编号
			CooperationContractNumber string `json:"cooperationContractNumber"`
			//	分红订单号或退货单号
			OrderNumber string `json:"orderNumber"`
			//	来源单号
			OriginalOrderNum string `json:"originalOrderNum"`
			//	客户名称
			CustomerName string `json:"customerName"`
			//	订单区域
			RegionName string `json:"region"`
			//  货品名称
			OrderGoodName string `json:"orderGoodName"`
			//	订单金额
			OrderAmount float64 `json:"orderAmount"`
			//	订单/退货单日期
			OrderDate time.Time `json:"orderDate"`
			OrgId     int       `json:"orgId"`
		} `json:"list"`
	}
)

//查询分红预算单
type (
	ReqDividendsEstimateSearch struct {
		DividendsEstimateOrderNumber string  `json:"dividendsEstimateOrderNumber"` //承接人分红预算单号
		CooperationContractNumber    string  `json:"orderOrReturnedOrderNum"`      //合约编号
		DividendsType                int     `json:"dividendsType"`                //分红类型,1订单分红,2退货冲销,3金额激励
		PageNumber                   int     `json:"pageNumber"`
		PageSize                     int     `json:"pageSize"`
		CompanyId                    int64   `json:"companyId"`   // 公司ID,通过集成REST上下文获取
		OrgId                        int64   `json:"orgId"`       // 组织机构ID
		OrgIds                       []int64 `json:"orgIds"`      //用户关联的组织
		UserId                       int64   `json:"userId"`      // 用户ID,
		UserBaseId                   int64   ` json:"userBaseId"` // 用户基础数据id
	}

	DataDividendsEstimateSearch struct {
		Grid struct {
			Total int `json:"total"`
			List  []struct {
				DividendsEstimateId          int       `json:"dividendsEstimateId,string,"`  // 承接人分红预算记录ID
				DividendsAccountStatus       int       `json:"dividendsAccountStatus"`       // 分红结算状态
				DividendsAmount              float64   `json:"dividendsAmount"`              // 分红金额
				DividendsEstimateOrderNumber string    `json:"dividendsEstimateOrderNumber"` // 承接人分红预算单号
				DividendsEstimateTime        time.Time `json:"dividendsEstimateTime"`        // 分红预算时间
				DividendsParticipateType     int       `json:"dividendsParticipateType"`     // 参与分红类型,1承接人,2推荐人,3关联业务员
				DividendsType                int       `json:"dividendsType"`                // 分红类型,1订单分红,2退货冲销,3金额激励
				OrderOrReturnedOrderNum      string    `json:"orderOrReturnedOrderNum"`      // 分红订单号或退货单号
				CooperationProjectNumber     string    `json:"cooperationProjectNumber"`     // 共创项目编号,
				CooperationContractNumber    string    `json:"cooperationContractNumber"`    // 共创项目合约编号,
				DividendsStage               int       `json:"DividendsStage"`               // 分红阶段
				IsCanceled                   bool      `json:"isCanceled"`                   // 取消状态
				DividendsUser                struct {
					UserId     int `json:"userId,string,"`     // 用户ID,
					UserBaseId int `json:"userBaseId,string,"` // 用户基本id
					UserType   int `json:"userType"`           // 用户类型
					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,omitempty"`
				} `json:"dividendsUser"` // 分红用户
				Org struct {
					OrgId   int    `json:"orgId,string,"` // 组织机构ID
					OrgName string `json:"orgName"`       // 组织名称
				} `json:"org"` // 数据所属组织机构
				Company struct {
					CompanyId   int    `json:"companyId,string,"` // 公司ID,
					CompanyLogo string `json:"companyLogo"`       // 公司logo
					CompanyName string `json:"companyName"`       // 公司名称
				} `json:"company"` // 公司
				CreatedAt time.Time `json:"createdAt"` // 创建时间
				UpdatedAt time.Time `json:"updatedAt"` // 更新时间
			} `json:"list"`
		} `json:"grid"`
	}
)

//查询金额激励分红
type (
	ReqDividendsEstimateSearchMoney struct {
		PageNumber int `json:"pageNumber"`
		PageSize   int `json:"pageSize"`
		//共创合约名称
		CooperationContractName string `json:"cooperationContractName"`
		//发起部门名称
		DepartmentName string `json:"departmentName"`
	}

	DataDividendsEstimateSearchMoney struct {
		Grid struct {
			Total int `json:"total"`
			List  []struct {
				CooperationContractId     int       `json:"cooperationContractId,string"` // 共创合约ID
				CooperationContractName   string    `json:"cooperationContractName"`      //合约名称
				CooperationContractNumber string    `json:"cooperationContractNumber"`    //合约编码
				CooperationModeName       string    `json:"cooperationMode"`
				CreatedAt                 time.Time `json:"createdAt"` //合约建立时间
				Department                struct {
					DepartmentId   int    `json:"departmentId,string"`
					DepartmentName string `json:"departmentName"`
				} `json:"department"` //发起部门
				// 共创合约发起人
				CooperationContractSponsorName string `json:"cooperationContractSponsor"`
				StageAndUndertaker             []struct {
					Stage       int `json:"stage"` // 分红阶段
					Undertakers []struct {
						UndertakerId int `json:"undertakerId,string"` // 承接人id
						UserInfo     struct {
							UserName  string `json:"userName"`  // 共创人员姓名
							UserPhone string `json:"userPhone"` // 用户手机号
						} `json:"userInfo"`
					} `json:"undertakers"` // 共创承接人
				}
			} `json:"list"`
		} `json:"grid"`
	}
)

//取消分红预算
type (
	ReqDividendsEstimateCancel struct {
		DividendsEstimateId int `json:"dividendsEstimateId"`
	}

	DataDividendsEstimateCancel struct {
	}
)

//确定预算金额激励分红
type (
	ReqDividendsEstimateMoneyIncentives struct {
		// 共创合约ID
		CooperationContractId string `json:"cooperationContractId"` //cname:"共创合约ID"
		// 分红阶段
		DividendsIncentivesStage int `json:"dividendsIncentivesStage"` //cname:"分红阶段"
		// 承接人UID
		UndertakerUids []string `json:"undertakerUids"` //cname:"承接人UID列表"
		//action [1:获取预算结果] [2:确认结果保存数据]
		Action int `json:"action"`
	}

	DataDividendsEstimateMoneyIncentives []struct {
		// 承接人分红预算记录ID
		DividendsEstimateId int64 `json:"dividendsEstimateId,string"`
		// 分红结算状态,1待结算,2已结算
		DividendsAccountStatus int32 `json:"dividendsAccountStatus"`
		// 分红金额
		DividendsAmount float64 `json:"dividendsAmount"`
		// 承接人分红预算单号
		DividendsEstimateOrderNumber string `json:"dividendsEstimateOrderNumber"`
		// 分红预算时间
		DividendsEstimateTime time.Time `json:"dividendsEstimateTime"`
		// 参与分红类型,1承接人,2推荐人,3关联业务员
		DividendsParticipateType int32 `json:"dividendsParticipateType"`
		// 分红类型,1订单分红,2退货冲销,3金额激励
		DividendsType int32 `json:"dividendsType"`
		// 分红类型名称
		DividendsTypeName string `json:"dividendsTypeName"`
		// 分红订单号或退货单号
		OrderOrReturnedOrderNum string `json:"orderOrReturnedOrderNum"`
		// 共创项目合约编号,自生成,生成规则:XM+6位年月日+#+3位流水,例XM210601#001
		CooperationContractNumber string `json:"cooperationContractNumber"`
		// 分红用户(共创参与)
		DividendsUser struct {
			// 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
			UserId int64 `json:"userId,string"`
			// 用户基本id
			UserBaseId int64 `json:"userBaseId,string"`
			// 用户类型
			UserType int32 `json:"userType"`
			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,omitempty"`
		} `json:"dividendsUser"`
		// 分红阶段
		DividendsStage int32 `json:"dividendsStage"`
		// 操作时间
		OperateTime time.Time `json:"operateTime"`
		// 取消状态
		IsCanceled bool `json:"isCanceled"`
	}
)

//返回分红预算详情
type (
	ReqDividendsEstimateGet struct {
		DividendsEstimateId int `json:"dividendsEstimateId"`
	}

	DataDividendsEstimateGet struct {
		DividendsEstimateId          int64     `json:"dividendsEstimateId,string"`   // 承接人分红预算记录ID
		DividendsAccountStatus       int32     `json:"dividendsAccountStatus"`       // 分红结算状态
		DividendsAmount              float64   `json:"dividendsAmount"`              // 分红金额
		DividendsEstimateOrderNumber string    `json:"dividendsEstimateOrderNumber"` // 承接人分红预算单号
		DividendsEstimateTime        time.Time `json:"dividendsEstimateTime"`        // 分红预算时间
		DividendsParticipateType     int32     `json:"dividendsParticipateType"`     // 参与分红类型,1承接人,2推荐人,3关联业务员
		DividendsType                int32     `json:"dividendsType"`                // 分红类型,1订单分红,2退货冲销,3金额激励
		OrderOrReturnedOrderNum      string    `json:"orderOrReturnedOrderNum"`      // 分红订单号或退货单号
		CooperationProjectNumber     string    `json:"cooperationProjectNumber"`     // 共创项目编号,
		DividendsUser                struct {
			UserId     int64 `json:"userId,string"`     // 用户ID,
			UserBaseId int64 `json:"userBaseId,string"` // 用户基本id
			UserType   int32 `json:"userType"`          // 用户类型
		} `json:"dividendsUser"` // 分红用户
		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"` // 公司
		CreatedAt time.Time `json:"createdAt"` // 创建时间
		UpdatedAt time.Time `json:"updatedAt"` // 更新时间
	}
)

//批量取消分红预算
type (
	ReqDividendsEstimateBatchCancel struct {
		DividendsEstimateIds []string `json:"dividendsEstimateIds"`
	}

	DataDividendsEstimateBatchCancel []struct {
	}
)

// DividendsEstimateDividendsIncentives
//确定业绩分红激励
type (
	ReqDividendsEstimateDividendsIncentives struct {
		OrderGoodIds []string `json:"orderGoodIds"`
	}

	DataDividendsEstimateDividendsIncentives struct {
		Report string `json:"report"`
	}
)