作者 陈志颖

fix:修复合约承接对象判断

... ... @@ -159,8 +159,12 @@ func (cooperationContractService *CooperationContractService) CreateCooperationC
}
// 校验承接人是否属于承接对象,1员工,2共创用户,4公开
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 4) {
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, undertakerDomain.UserType) {
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, 3) {
var userType int32
if undertakerDomain.UserType > 1024 {
userType = undertakerDomain.UserType - 1024
}
if !utils.IsContain(createCooperationContractCommand.CooperationContractUndertakerTypes, userType) {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "承接人"+undertakerDomain.UserName+"不属于承接对象")
}
}
... ... @@ -1020,8 +1024,12 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationC
}
// 校验:判断用户类型是否属于承接对象
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 4) { // 非公开类型校验
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, undertakerDomain.UserType) {
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, 3) { // 非公开类型校验
var userType int32
if undertakerDomain.UserType > 1024 {
userType = undertakerDomain.UserType - 1024
}
if !utils.IsContain(cooperationContract.CooperationContractUndertakerTypes, userType) {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "抱歉,您不属于当前项目的承接对象")
}
}
... ...