no message
Showing
9 changed files
with
55 additions
and
14 deletions
| ... | @@ -28,6 +28,7 @@ import javax.validation.Valid; | ... | @@ -28,6 +28,7 @@ import javax.validation.Valid; |
| 28 | import java.io.ByteArrayOutputStream; | 28 | import java.io.ByteArrayOutputStream; |
| 29 | import java.io.InputStream; | 29 | import java.io.InputStream; |
| 30 | import java.rmi.ServerException; | 30 | import java.rmi.ServerException; |
| 31 | import java.util.Arrays; | ||
| 31 | import java.util.List; | 32 | import java.util.List; |
| 32 | import java.util.Objects; | 33 | import java.util.Objects; |
| 33 | 34 | ||
| ... | @@ -864,8 +865,20 @@ public class CourseController extends BaseController { | ... | @@ -864,8 +865,20 @@ public class CourseController extends BaseController { |
| 864 | } | 865 | } |
| 865 | 866 | ||
| 866 | @RepeatSubmit() | 867 | @RepeatSubmit() |
| 868 | @PutMapping("/batch/display/{courseIds}") | ||
| 869 | public R<Void> batchDisplay(@PathVariable String[] courseIds) throws ServerException { | ||
| 870 | return toAjax(service.batchDisplay(courseIds)); | ||
| 871 | } | ||
| 872 | |||
| 873 | @RepeatSubmit() | ||
| 867 | @PutMapping("/hide/{id}") | 874 | @PutMapping("/hide/{id}") |
| 868 | public R<Void> hide(@PathVariable String id) throws ServerException { | 875 | public R<Void> hide(@PathVariable String id) throws ServerException { |
| 869 | return toAjax(service.hide(id)); | 876 | return toAjax(service.hide(id)); |
| 870 | } | 877 | } |
| 878 | |||
| 879 | @RepeatSubmit() | ||
| 880 | @PutMapping("/batch/hide/{courseIds}") | ||
| 881 | public R<Void> batchHide(@PathVariable String[] courseIds) throws ServerException { | ||
| 882 | return toAjax(service.batchHide(courseIds)); | ||
| 883 | } | ||
| 871 | } | 884 | } | ... | ... |
| ... | @@ -136,6 +136,6 @@ public class Course extends BaseEntity { | ... | @@ -136,6 +136,6 @@ public class Course extends BaseEntity { |
| 136 | /** | 136 | /** |
| 137 | * 是否可见 | 137 | * 是否可见 |
| 138 | */ | 138 | */ |
| 139 | private boolean isVisible; | 139 | private boolean visible; |
| 140 | 140 | ||
| 141 | } | 141 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -108,5 +108,5 @@ public class CourseBo extends BaseBO { | ... | @@ -108,5 +108,5 @@ public class CourseBo extends BaseBO { |
| 108 | /** | 108 | /** |
| 109 | * 是否可见 | 109 | * 是否可见 |
| 110 | */ | 110 | */ |
| 111 | private boolean isVisible; | 111 | private boolean visible; |
| 112 | } | 112 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -164,5 +164,10 @@ public class CourseVo { | ... | @@ -164,5 +164,10 @@ public class CourseVo { |
| 164 | /** | 164 | /** |
| 165 | * 是否可见 | 165 | * 是否可见 |
| 166 | */ | 166 | */ |
| 167 | private boolean isVisible; | 167 | private boolean visible; |
| 168 | |||
| 169 | /** | ||
| 170 | * 是否可见 | ||
| 171 | */ | ||
| 172 | private String display; | ||
| 168 | } | 173 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -80,14 +80,15 @@ public interface ICourseService { | ... | @@ -80,14 +80,15 @@ public interface ICourseService { |
| 80 | * @throws ServerException | 80 | * @throws ServerException |
| 81 | */ | 81 | */ |
| 82 | boolean hide(String id) throws ServerException; | 82 | boolean hide(String id) throws ServerException; |
| 83 | |||
| 83 | /** | 84 | /** |
| 84 | * 批量隐藏 | 85 | * 批量隐藏 |
| 85 | * | 86 | * |
| 86 | * @param ids | 87 | * @param courseIds |
| 87 | * @return | 88 | * @return |
| 88 | * @throws ServerException | 89 | * @throws ServerException |
| 89 | */ | 90 | */ |
| 90 | boolean batchHide(List<String> ids) throws ServerException; | 91 | boolean batchHide(String[] courseIds) throws ServerException; |
| 91 | /** | 92 | /** |
| 92 | * 显示 | 93 | * 显示 |
| 93 | * | 94 | * |
| ... | @@ -100,10 +101,10 @@ public interface ICourseService { | ... | @@ -100,10 +101,10 @@ public interface ICourseService { |
| 100 | /** | 101 | /** |
| 101 | * 批量显示 | 102 | * 批量显示 |
| 102 | * | 103 | * |
| 103 | * @param ids | 104 | * @param courseIds |
| 104 | * @return | 105 | * @return |
| 105 | * @throws ServerException | 106 | * @throws ServerException |
| 106 | */ | 107 | */ |
| 107 | boolean batchDisplay(List<String> ids) throws ServerException; | 108 | boolean batchDisplay(String[] courseIds) throws ServerException; |
| 108 | } | 109 | } |
| 109 | 110 | ... | ... |
| ... | @@ -30,6 +30,7 @@ import lombok.RequiredArgsConstructor; | ... | @@ -30,6 +30,7 @@ import lombok.RequiredArgsConstructor; |
| 30 | import org.springframework.stereotype.Service; | 30 | import org.springframework.stereotype.Service; |
| 31 | 31 | ||
| 32 | import java.rmi.ServerException; | 32 | import java.rmi.ServerException; |
| 33 | import java.util.Arrays; | ||
| 33 | import java.util.List; | 34 | import java.util.List; |
| 34 | import java.util.Map; | 35 | import java.util.Map; |
| 35 | import java.util.Set; | 36 | import java.util.Set; |
| ... | @@ -94,6 +95,12 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -94,6 +95,12 @@ public class CourseServiceImpl implements ICourseService { |
| 94 | if(StrUtil.isNotBlank(vo.getPptOssId())){ | 95 | if(StrUtil.isNotBlank(vo.getPptOssId())){ |
| 95 | vo.setPptOssUrl(ossUrlService.selectUrlByIds(vo.getPptOssId())); | 96 | vo.setPptOssUrl(ossUrlService.selectUrlByIds(vo.getPptOssId())); |
| 96 | } | 97 | } |
| 98 | if(vo.isVisible()){ | ||
| 99 | vo.setDisplay("已显示"); | ||
| 100 | } | ||
| 101 | else{ | ||
| 102 | vo.setDisplay("已隐藏"); | ||
| 103 | } | ||
| 97 | } | 104 | } |
| 98 | } | 105 | } |
| 99 | return TableDataInfo.build(page); | 106 | return TableDataInfo.build(page); |
| ... | @@ -298,11 +305,18 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -298,11 +305,18 @@ public class CourseServiceImpl implements ICourseService { |
| 298 | } | 305 | } |
| 299 | 306 | ||
| 300 | @Override | 307 | @Override |
| 301 | public boolean batchDisplay(List<String> ids) throws ServerException { | 308 | public boolean batchDisplay(String[] courseIds) throws ServerException { |
| 309 | if(courseIds==null) | ||
| 310 | System.out.println("=============1=========="); | ||
| 311 | else | ||
| 312 | System.out.println("========================"+Arrays.asList(courseIds)); | ||
| 313 | for (String id : courseIds) { | ||
| 302 | CourseVo courseVo = baseMapper.selectVoById(id); | 314 | CourseVo courseVo = baseMapper.selectVoById(id); |
| 303 | courseVo.setVisible(true); | 315 | courseVo.setVisible(true); |
| 304 | Course course = BeanUtil.toBean(courseVo, Course.class); | 316 | Course course = BeanUtil.toBean(courseVo, Course.class); |
| 305 | return baseMapper.updateById(course) > 0; | 317 | baseMapper.updateById(course); |
| 318 | } | ||
| 319 | return true; | ||
| 306 | } | 320 | } |
| 307 | 321 | ||
| 308 | @Override | 322 | @Override |
| ... | @@ -314,11 +328,14 @@ public class CourseServiceImpl implements ICourseService { | ... | @@ -314,11 +328,14 @@ public class CourseServiceImpl implements ICourseService { |
| 314 | } | 328 | } |
| 315 | 329 | ||
| 316 | @Override | 330 | @Override |
| 317 | public boolean batchHide(List<String> ids) throws ServerException { | 331 | public boolean batchHide(String[] courseIds) throws ServerException { |
| 332 | for (String id : courseIds) { | ||
| 318 | CourseVo courseVo = baseMapper.selectVoById(id); | 333 | CourseVo courseVo = baseMapper.selectVoById(id); |
| 319 | courseVo.setVisible(false); | 334 | courseVo.setVisible(false); |
| 320 | Course course = BeanUtil.toBean(courseVo, Course.class); | 335 | Course course = BeanUtil.toBean(courseVo, Course.class); |
| 321 | return baseMapper.updateById(course) > 0; | 336 | baseMapper.updateById(course); |
| 337 | } | ||
| 338 | return true; | ||
| 322 | } | 339 | } |
| 323 | 340 | ||
| 324 | /** | 341 | /** | ... | ... |
-
Please register or sign in to post a comment