yangdamao 2 년 전
부모
커밋
0441abc950
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseFileServiceImpl.java

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseFileServiceImpl.java

@@ -125,14 +125,14 @@ public class CourseFileServiceImpl extends ServiceImpl<CourseFileMapper, CourseF
 
     @Override
     public boolean editHandouts(CourseHandoutsEditBo bo) {
-        if (ObjectUtils.isNotNull(bo.getStatus()) && bo.getStatus() == -1){
+        if (ObjectUtils.isNotNull(bo.getStatus()) && bo.getStatus() == -1 && bo.getStatus() == 0){
             //删除校验
             int count = iGoodsService
                     .count(new LambdaQueryWrapper<Goods>()
                     .eq(Goods::getHandoutsId, bo.getHandoutsId())
                     .eq(Goods::getStatus, 1));
             if (count > 0){
-                throw new CustomException("已有商品关联此讲义,不能删除!");
+                throw new CustomException("已有商品关联此讲义,不能改动!");
             }
         }
         iCourseHandoutsService.update(new LambdaUpdateWrapper<CourseHandouts>().set(CourseHandouts::getUpdateStatus,0).eq(CourseHandouts::getHandoutsId,bo.getHandoutsId()));