|
@@ -159,11 +159,15 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
@@ -159,11 +159,15 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
159
|
}
|
159
|
}
|
160
|
|
160
|
|
161
|
// 校验承接人是否属于承接对象,1员工,2共创用户,4公开
|
161
|
// 校验承接人是否属于承接对象,1员工,2共创用户,4公开
|
|
|
162
|
+ typeExist := false
|
162
|
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) {
|
163
|
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) {
|
163
|
for _, userType := range createCooperationContractCommand.CooperationContractUndertakerTypes {
|
164
|
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
|
+ if utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
|
|
|
166
|
+ typeExist = true
|
|
|
167
|
+ }
|
166
|
}
|
168
|
}
|
|
|
169
|
+ if !typeExist {
|
|
|
170
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
167
|
}
|
171
|
}
|
168
|
}
|
172
|
}
|
169
|
|
173
|
|
|
@@ -1027,11 +1031,15 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
@@ -1027,11 +1031,15 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
1027
|
}
|
1031
|
}
|
1028
|
|
1032
|
|
1029
|
// 校验:判断用户类型是否属于承接对象
|
1033
|
// 校验:判断用户类型是否属于承接对象
|
|
|
1034
|
+ typeExist := false
|
1030
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
|
1035
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
|
1031
|
for _, userType := range cooperationContract.CooperationContractUndertakerTypes {
|
1036
|
for _, userType := range cooperationContract.CooperationContractUndertakerTypes {
|
1032
|
- if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
|
|
|
1033
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
1037
|
+ if utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType&userType) {
|
|
|
1038
|
+ typeExist = true
|
|
|
1039
|
+ }
|
1034
|
}
|
1040
|
}
|
|
|
1041
|
+ if !typeExist {
|
|
|
1042
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
1035
|
}
|
1043
|
}
|
1036
|
}
|
1044
|
}
|
1037
|
|
1045
|
|