审查视图

pkg/infrastructure/service_gateway/allied_creation_cooperation/param_cooperation_contract.go 17.6 KB
1 2
package allied_creation_cooperation
tangxuhui authored
3 4 5 6 7
import (
	"time"

	"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/domain"
)
tangxuhui authored
8
tangxuhui authored
9
type CooperationContract struct {
tangxuhui authored
10
	CooperationContractId              int    `json:"cooperationContractId,string,"`  // 共创合约ID
tangxuhui authored
11 12 13 14
	CooperationContractDescription     string `json:"cooperationContractDescription"` // 共创合约描述
	CooperationContractName            string `json:"cooperationContractName"`        // 共创合约名称
	CooperationContractNumber          string `json:"cooperationContractNumber"`      // 共创合约编号
	CooperationProjectNumber           string `json:"cooperationProjectNumber"`
tangxuhui authored
15
	CooperationContractUndertakerTypes []int  `json:"cooperationContractUndertakerTypes"` // 共创合约承接对象,1员工,2共创用户,3公开
tangxuhui authored
16
	Department                         struct {
tangxuhui authored
17 18 19
		DepartmentId     int    `json:"departmentId,string"`
		DepartmentName   string `json:"departmentName"`
		DepartmentNumber string `json:"departmentNumber"`
Your Name authored
20
	} `jsopn:"department"` //发起部门
tangxuhui authored
21
	CooperationContractSponsor struct {
tangxuhui authored
22
		UserId   int `json:"userId,string"` //id
tangxuhui authored
23 24 25 26 27 28 29 30
		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 {
tangxuhui authored
31 32 33
			DepartmentId     int64  `json:"departmentId,string,"` // 部门ID,通过REST集成上下文获取
			DepartmentName   string `json:"departmentName"`       // 部门名称
			DepartmentNumber string `json:"departmentNumber"`     // 部门编码
tangxuhui authored
34 35
		} `json:"department"` //申请人部门
		Org struct {
tangxuhui authored
36 37
			OrgId   int64  `json:"orgId,string,"` // 组织机构ID
			OrgName string `json:"orgName"`       // 组织名称
tangxuhui authored
38 39 40 41 42 43 44 45
		} `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 {
tangxuhui authored
46 47
		OrgId   int64  `json:"orgId,string,"` // 组织机构ID
		OrgName string `json:"orgName"`       // 组织名称
tangxuhui authored
48 49
	} `json:"org"` // 数据所属组织机构
	Company struct {
tangxuhui authored
50 51 52
		CompanyId   int64  `json:"companyId,string,"` // 公司ID
		CompanyLogo string `json:"companyLogo"`       // 公司logo
		CompanyName string `json:"companyName"`       // 公司名称
tangxuhui authored
53 54 55 56
	} `json:"company"` // 公司
	DividendsIncentivesRules []DividendsIncentivesRule `json:"dividendsIncentivesRules"` // 分红激励规则
	MoneyIncentivesRules     []MoneyIncentivesRule     `json:"moneyIncentivesRules"`     // 金额激励规则
	Undertakers              []struct {
tangxuhui authored
57
		ContractAttachment []domain.Attachment `json:"contractAttachment"`
tangxuhui authored
58
		UserId             int                 `json:"userId,string"`
tangxuhui authored
59
		UndertakerId       int                 `json:"undertakerId,string"`
tangxuhui authored
60
		UserInfo           struct {
tangxuhui authored
61 62 63 64 65
			UserAvatar  string `json:"userAvatar"`  // 用户头像
			UserEmail   string `json:"userEmail"`   // 用户邮箱
			UserName    string `json:"userName"`    // 共创人员姓名
			UserPhone   string `json:"userPhone"`   // 用户手机号
			UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
tangxuhui authored
66
			UserCode    string `json:"userCode"`
tangxuhui authored
67 68
		} `json:"userInfo"`
		Department struct {
tangxuhui authored
69 70 71
			DepartmentId     int64  `json:"departmentId,string,"` // 部门ID
			DepartmentName   string `json:"departmentName"`       // 部门名称
			DepartmentNumber string `json:"departmentNumber"`     // 部门编码
tangxuhui authored
72 73
		} `json:"department"` //申请人部门
		Org struct {
tangxuhui authored
74 75
			OrgId   int64  `json:"orgId,string,"` // 组织机构ID
			OrgName string `json:"orgName"`       // 组织名称
tangxuhui authored
76 77 78 79
		} `json:"org"`
		UserType  int    `json:"userType"`
		UserName  string `json:"userName"`
		UserPhone string `json:"userPhone"`
tangxuhui authored
80
		Referrer  struct {
tangxuhui authored
81 82 83 84 85
			UserId    int    `json:"userId,string"`
			UserType  int32  `json:"userType"`  // 用户类型,1员工,2共创用户,3公开
			UserName  string `json:"userName"`  // 用户姓名
			UserPhone string `json:"userPhone"` // 用户手机号
			UserInfo  struct {
tangxuhui authored
86 87 88 89 90 91 92 93
				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 {
tangxuhui authored
94 95 96 97 98
			UserId    int    `json:"userId,string"`
			UserType  int32  `json:"userType"`  // 用户类型,1员工,2共创用户,3公开
			UserName  string `json:"userName"`  // 用户姓名
			UserPhone string `json:"userPhone"` // 用户手机号
			UserInfo  struct {
tangxuhui authored
99 100 101 102 103 104 105
				UserAvatar  string `json:"userAvatar"`  // 用户头像
				UserEmail   string `json:"userEmail"`   // 用户邮箱
				UserName    string `json:"userName"`    // 共创人员姓名
				UserPhone   string `json:"userPhone"`   // 用户手机号
				UserAccount string `json:"userAccount"` // 用户账号,区别于手机号,冗余字段
			} `json:"userInfo"`
		} `json:"salesman"`
tangxuhui authored
106 107
	} `json:"undertakers"` // 共创承接人列表
	RelevantPeople []struct {
tangxuhui authored
108
		RelevantId                int    `json:"relevantId,string,"`
tangxuhui authored
109
		CooperationContractNumber string `json:"cooperationContractNumber"` // 共创合约编号
tangxuhui authored
110 111
		UserId                    int64  `json:"userId,string,"`
		UserBaseId                int    `json:"userBaseId,string,"`
tangxuhui authored
112
		Org                       struct {
tangxuhui authored
113 114
			OrgId   int64  `json:"orgId,string,"` // 组织机构ID
			OrgName string `json:"orgName"`       // 组织名称
tangxuhui authored
115
		} `json:"org"`
tangxuhui authored
116 117 118 119 120 121 122 123
		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"`
tangxuhui authored
124
		Department struct {
tangxuhui authored
125 126 127
			DepartmentId     int64  `json:"departmentId,string,"` // 部门ID
			DepartmentName   string `json:"departmentName"`       // 部门名称
			DepartmentNumber string `json:"departmentNumber"`     // 部门编码
tangxuhui authored
128 129
		} `json:"department"` //申请人部门
	} `json:"relevantPeople"` // 共创合约相关人列表
tangxuhui authored
130 131 132 133
	OperateTime                       time.Time `json:"operateTime"` // 操作时间
	CreatedAt                         time.Time `json:"createdAt"`   // 创建时间
	UpdatedAt                         time.Time `json:"updatedAt"`   // 更新时间
	UndertakerTypesUncheckedAvailable []int     `json:"undertakerTypesUncheckedAvailable"`
tangxuhui authored
134 135
}
136 137
//创建共创合约
type (
tangxuhui authored
138 139
	//分红激励规则
	DividendsIncentivesRule struct {
tangxuhui authored
140 141 142 143 144 145 146 147
		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"` // 分红规则激励阶段开始
tangxuhui authored
148
		Remarks                       string    `json:"remarks"`
tangxuhui authored
149 150 151
	}
	//金额激励规则
	MoneyIncentivesRule struct {
tangxuhui authored
152 153 154 155 156 157 158
		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"`           // 业务员抽成比例
tangxuhui authored
159
		Remarks                   string    `json:"remarks"`
tangxuhui authored
160 161 162 163
	}

	//合约承接方
	Undertaker struct {
tangxuhui authored
164 165 166 167 168
		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"`
tangxuhui authored
169 170
	}
171
	ReqCooperationContractAdd struct {
tangxuhui authored
172 173
		CooperationContractDescription string `json:"cooperationContractDescription"` // 共创合约描述
		// CooperationContractNumber         string                    `json:"cooperationContractNumber"`          // 共创合约编号
tangxuhui authored
174 175 176 177 178 179 180 181 182 183
		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"`                        //关联业务员
tangxuhui authored
184 185 186 187
		CompanyId                         int                       `json:"-"`
		OrgId                             int                       `json:"-"`  // 组织机构ID
		UserId                            int                       `json:"-"`  // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
		UserBaseId                        int                       `json:"-" ` // 用户基础数据id
188 189 190
	}

	DataCooperationContractAdd struct {
tangxuhui authored
191
		CooperationContract
192 193 194 195 196 197
	}
)

//更新共创合约
type (
	ReqCooperationContractUpdate struct {
tangxuhui authored
198 199 200
		CooperationContractId          int    `json:"cooperationContractId,string"`   // 共创合约id
		CooperationContractDescription string `json:"cooperationContractDescription"` //共创
		// CooperationContractNumber         string                    `json:"cooperationContractNumber"`          // 共创合约编号
tangxuhui authored
201 202 203 204 205 206 207
		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"`           // 金额激励规则列表
tangxuhui authored
208
		MoneyIncentivesRules              []MoneyIncentivesRule     `json:"moneyIncentivesRules"`
tangxuhui authored
209 210
		Undertakers                       []Undertaker              `json:"undertakers"` // 承接方列表		// 业绩分红激励规则列表
		RelevantIds                       []string                  `json:"relevantIds"` //关联业务员
tangxuhui authored
211 212 213 214
		CompanyId                         int                       `json:"-"`
		OrgId                             int                       `json:"-"`  // 组织机构ID
		UserId                            int                       ` json:"-"` // 用户ID,通过集成REST上下文获取,可翻译成发起人、承接人、推荐人、业务员
		UserBaseId                        int                       `json:"-" ` // 用户基础数据id
215 216 217
	}

	DataCooperationContractUpdate struct {
tangxuhui authored
218
		CooperationContract
219 220 221 222 223 224
	}
)

//查询共创合约
type (
	ReqCooperationContractSearch struct {
tangxuhui authored
225 226 227
		// 查询偏离量
		PageNumber int `json:"pageNumber"`
		// 查询限制
tangxuhui authored
228 229 230
		PageSize                  int    `json:"pageSize"`
		CooperationContractNumber string `json:"cooperationContractNumber"` //合约编号
		SponsorName               string `json:"sponsorName"`               //发起人名字
yangfu authored
231 232
		Status                    int    `json:"status"`
		// 公司ID,通过集成REST上下文获取
tangxuhui authored
233
		CompanyId int64 ` json:"companyId"`
yangfu authored
234
		// 组织机构ID
tangxuhui authored
235
		OrgId int64 ` json:"orgId"`
yangfu authored
236
		// 用户基础数据id
tangxuhui authored
237
		UserBaseId int64 `json:"userBaseId"`
tangxuhui authored
238
		// 组织机构ID
239 240
		OrgIds         []int64 ` json:"orgIds"`
		IncentivesType int     `json:"incentivesType"` //作为合约激励方式的判断,1业绩分红激励,2金额激励
241 242 243
	}

	DataCooperationContractSearch struct {
tangxuhui authored
244 245 246 247
		Grid struct {
			Total int                   `json:"total"`
			List  []CooperationContract `json:"list"`
		} `json:"grid"`
248 249 250 251 252 253
	}
)

//根据承接人查询并返回共创项目合约
type (
	ReqCooperationContractSearchByUndertaker struct {
tangxuhui authored
254 255 256
		CooperationContractName string  `json:"cooperationContractName"` //合约名称
		SponsorName             string  `json:"sponsorName"`             //项目发起人姓名
		PageNumber              int     `json:"pageNumber"`
Your Name authored
257
		PageSize                int     `json:"pageSize"`
tangxuhui authored
258 259 260 261
		CompanyId               int64   ` json:"companyId"`
		OrgId                   int64   ` json:"orgId"`
		UserBaseId              int64   `json:"userBaseId"`
		OrgIds                  []int64 ` json:"orgIds"`
262 263 264
	}

	DataCooperationContractSearchByUndertaker struct {
tangxuhui authored
265 266 267
		Grid struct {
			Total int
			List  []struct {
268 269 270 271 272 273 274 275 276 277 278 279 280
				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"` // 共创描述
tangxuhui authored
281 282
			}
		}
283 284 285 286 287 288
	}
)

//移除共创合约
type (
	ReqCooperationContractRemove struct {
tangxuhui authored
289
		CooperationContractId int `json:"cooperationContractId"`
290 291 292
	}

	DataCooperationContractRemove struct {
tangxuhui authored
293
		CooperationContract
294 295 296
	}
)
tangxuhui authored
297 298 299 300 301 302
//移除共创合约
type (
	ReqCooperationContractBatchRemove struct {
		CooperationContractIds []string `json:"cooperationContractIds"`
	}
tangxuhui authored
303
	DataCooperationContractBatchRemove []struct {
tangxuhui authored
304 305 306
	}
)
307 308 309 310 311 312 313 314 315 316 317 318
//返回共创合约列表
type (
	ReqCooperationContractList struct {
	}

	DataCooperationContractList struct {
	}
)

//返回共创合约详情
type (
	ReqCooperationContractGet struct {
tangxuhui authored
319
		CooperationContractId int `json:"cooperationContractId"`
320 321 322
	}

	DataCooperationContractGet struct {
tangxuhui authored
323
		CooperationContract
tangxuhui authored
324 325
		// 可以去除勾选的共创项目承接对象列表
		UndertakerTypesUncheckedAvailable []int `json:"undertakerTypesUncheckedAvailable"`
326 327
	}
)
tangxuhui authored
328 329 330 331 332 333 334 335 336

//批量恢复或暂停合约
type (
	ReqCooperationContractsBatchOperate struct {
		CooperationContractIds []string `json:"cooperationContractIds"`
		Action                 int      `json:"action"` //暂停或恢复合约动作,1恢复,2暂停
	}
	DataCooperationContractsBatchOperate []interface{}
)