kongzy
2024-07-05 14821e28286d773ad5ff2c13510e39c5eb117daf
exam-system/src/main/java/com/gkhy/exam/system/service/impl/ExCourseChapterPeriodServiceImpl.java
@@ -39,6 +39,9 @@
        if(!checkNameUnique(period)){
            throw new ApiException("学时名称已存在");
        }
        SysUser user= SecurityUtils.getLoginUser().getUser();
        Long companyId=!user.getUserType().equals(UserTypeEnum.SYSTEM_USER)?user.getCompanyId():null;
        period.setCompanyId(companyId);
        int row=baseMapper.insert(period);
        if(row<1){
            throw new ApiException("学时保存失败");
@@ -52,6 +55,7 @@
        if(!checkNameUnique(period)){
            throw new ApiException("学时名称已存在");
        }
        period.setUpdateBy(SecurityUtils.getUsername());
        int row=baseMapper.updateById(period);
        if(row<1){
            throw new ApiException("更新学时失败");