|
@@ -160,11 +160,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
@@ -160,11 +160,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
160
|
|
160
|
|
|
161
|
// 校验承接人是否属于承接对象,1员工,2共创用户,4公开
|
161
|
// 校验承接人是否属于承接对象,1员工,2共创用户,4公开
|
|
162
|
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) {
|
162
|
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) {
|
|
163
|
- userType := undertakerDomain.UserType ^ 1024
|
|
|
|
164
|
- if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, userType) {
|
163
|
+ for _, userType := range createCooperationContractCommand.CooperationContractUndertakerTypes {
|
|
|
|
164
|
+ if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
|
|
165
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
165
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
|
166
|
}
|
166
|
}
|
|
167
|
}
|
167
|
}
|
|
|
|
168
|
+ }
|
|
168
|
|
169
|
|
|
169
|
// 获取推荐人
|
170
|
// 获取推荐人
|
|
170
|
var referrerDomain *domain.Referrer
|
171
|
var referrerDomain *domain.Referrer
|
|
@@ -1024,9 +1025,10 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
@@ -1024,9 +1025,10 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
1024
|
|
1025
|
|
|
1025
|
// 校验:判断用户类型是否属于承接对象
|
1026
|
// 校验:判断用户类型是否属于承接对象
|
|
1026
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
|
1027
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
|
|
1027
|
- userType := undertakerDomain.UserType ^ 1024
|
|
|
|
1028
|
- if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, userType) {
|
|
|
|
1029
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象")
|
1028
|
+ for _, userType := range cooperationContract.CooperationContractUndertakerTypes {
|
|
|
|
1029
|
+ if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
|
|
|
|
1030
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
|
|
|
1031
|
+ }
|
|
1030
|
}
|
1032
|
}
|
|
1031
|
}
|
1033
|
}
|
|
1032
|
|
1034
|
|