正在显示
1 个修改的文件
包含
12 行增加
和
4 行删除
@@ -159,8 +159,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC | @@ -159,8 +159,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC | ||
159 | } | 159 | } |
160 | 160 | ||
161 | // 校验承接人是否属于承接对象,1员工,2共创用户,4公开 | 161 | // 校验承接人是否属于承接对象,1员工,2共创用户,4公开 |
162 | - if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 4) { | ||
163 | - if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, undertakerDomain.UserType) { | 162 | + if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) { |
163 | + var userType int32 | ||
164 | + if undertakerDomain.UserType > 1024 { | ||
165 | + userType = undertakerDomain.UserType - 1024 | ||
166 | + } | ||
167 | + if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, userType) { | ||
164 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象") | 168 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象") |
165 | } | 169 | } |
166 | } | 170 | } |
@@ -1020,8 +1024,12 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | @@ -1020,8 +1024,12 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC | ||
1020 | } | 1024 | } |
1021 | 1025 | ||
1022 | // 校验:判断用户类型是否属于承接对象 | 1026 | // 校验:判断用户类型是否属于承接对象 |
1023 | - if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 4) { // 非公开类型校验 | ||
1024 | - if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType) { | 1027 | + if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验 |
1028 | + var userType int32 | ||
1029 | + if undertakerDomain.UserType > 1024 { | ||
1030 | + userType = undertakerDomain.UserType - 1024 | ||
1031 | + } | ||
1032 | + if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, userType) { | ||
1025 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象") | 1033 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象") |
1026 | } | 1034 | } |
1027 | } | 1035 | } |
-
请 注册 或 登录 后发表评论