“djh”
2 天以前 cf1fc0bcd00d62c0eed7934a21949edcab8849fb
multi-system/src/main/java/com/gkhy/exam/system/service/impl/InternalAuditEvaluateServiceImpl.java
@@ -4,6 +4,7 @@
import com.gkhy.exam.common.api.CommonPage;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.domain.entity.SysUser;
import com.gkhy.exam.common.enums.UserTypeEnum;
import com.gkhy.exam.common.exception.ApiException;
import com.gkhy.exam.common.utils.PageUtils;
import com.gkhy.exam.common.utils.SecurityUtils;
@@ -45,12 +46,14 @@
    @Override
    public CommonResult insertEvaluate(InternalAuditEvaluate evaluate) {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        if (!user.getUserType().equals(0)&&!user.getUserType().equals(1)){
        if (!user.getUserType().equals(UserTypeEnum.SYSTEM_USER.getCode())&&!user.getUserType().equals(UserTypeEnum.COMPANY_USER.getCode())&&!user.getUserType().equals(UserTypeEnum.COMPANY_ADMIN.getCode())){
            throw new ApiException("普通用户无法添加相关数据");
        }
        ExStudent exStudent = exStudentMapper.selectStudentById(Long.valueOf(evaluate.getPersonId()));
        if (user.getDeptId().equals(exStudent.getDeptId())){
            throw new ApiException("请勿选择本部门成员");
        if ( user.getDeptId()!=null){
            if ( user.getDeptId().equals(exStudent.getDeptId())) {
                throw new ApiException("请勿选择本部门成员");
            }
        }
        evaluate.setCreateBy(SecurityUtils.getUsername());
        evaluate.setCreateTime(LocalDateTime.now());