|
@@ -160,10 +160,7 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC |
|
@@ -160,10 +160,7 @@ 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
|
- var userType int32
|
|
|
|
164
|
- if undertakerDomain.UserType > 1024 {
|
|
|
|
165
|
- userType = undertakerDomain.UserType - 1024
|
|
|
|
166
|
- }
|
163
|
+ userType := undertakerDomain.UserType ^ 1024
|
|
167
|
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, userType) {
|
164
|
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, userType) {
|
|
168
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
165
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
|
|
169
|
}
|
166
|
}
|
|
@@ -1027,10 +1024,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
@@ -1027,10 +1024,7 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC |
|
1027
|
|
1024
|
|
|
1028
|
// 校验:判断用户类型是否属于承接对象
|
1025
|
// 校验:判断用户类型是否属于承接对象
|
|
1029
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
|
1026
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
|
|
1030
|
- var userType int32
|
|
|
|
1031
|
- if undertakerDomain.UserType > 1024 {
|
|
|
|
1032
|
- userType = undertakerDomain.UserType - 1024
|
|
|
|
1033
|
- }
|
1027
|
+ userType := undertakerDomain.UserType ^ 1024
|
|
1034
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, userType) {
|
1028
|
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, userType) {
|
|
1035
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象")
|
1029
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象")
|
|
1036
|
}
|
1030
|
}
|