he2802 3 лет назад
Родитель
Сommit
b526d36de8

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/mapper/UserPeriodMapper.java

@@ -21,7 +21,7 @@ public interface UserPeriodMapper extends BaseMapper<UserPeriod> {
 
     Long selectCountPeriod(@Param("userId") Long userId, @Param("id") Long id);
 
-    Long selectCountConfirmPeriod(@Param("userId") Long userId, @Param("id") Long id);
+    Long selectCountConfirmPeriod(@Param("userId") Long userId, @Param("goodsId") Long goodsId);
 
     Long todayStudySectionNum(UserPeriodQueryBo bo);
 }

+ 2 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -296,7 +296,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         LoginUser loginUser = SecurityUtils.getLoginUser();
         //查询此人学时审核是否有权限
         if (!loginUser.getUser().isAdmin()) {
-            if (baseMapper.selectCountConfirmPeriod(loginUser.getUser().getUserId(), bo.getId()) < 1) {
+            if (baseMapper.selectCountConfirmPeriod(loginUser.getUser().getUserId(), bo.getGoodsId()) < 1) {
                 throw new CustomException("您没有确认审核权限");
             }
         }
@@ -354,10 +354,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             throw new CustomException("非审核中状态无法打回操作");
         }
         LoginUser loginUser = SecurityUtils.getLoginUser();
-        Long upId = bo.getIds().get(0);
         //查询此人学时审核是否有权限
         if (!loginUser.getUser().isAdmin()) {
-            if (baseMapper.selectCountConfirmPeriod(loginUser.getUser().getUserId(), upId) < 1) {
+            if (baseMapper.selectCountConfirmPeriod(loginUser.getUser().getUserId(), bo.getGoodsId()) < 1) {
                 throw new CustomException("您没有确认审核权限");
             }
         }

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/grade/UserPeriodMapper.xml

@@ -104,10 +104,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
             COUNT(1)
         FROM
-            user_period_status ups  JOIN user_period up on ups.period_id = up.id JOIN goods g on g.goods_id = up.goods_id JOIN course_business b on g.business_id = b.id
+             goods g on g.goods_id  JOIN course_business b on g.business_id = b.id
         WHERE
             1 = 1
-          AND ups.id = #{id}
+          AND g.goods_id = #{goodsId}
           and FIND_IN_SET(#{userId},b.period_confirm_user_ids)
     </select>