15cd555c by chentao

no message

1 parent 7429fc8b
...@@ -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
......
...@@ -61,6 +61,6 @@ public class Entirety extends BaseEntity { ...@@ -61,6 +61,6 @@ public class Entirety extends BaseEntity {
61 /** 61 /**
62 * 是否可见 62 * 是否可见
63 */ 63 */
64 private boolean isVisible; 64 private boolean visible;
65 65
66 } 66 }
......
...@@ -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
......
...@@ -48,5 +48,5 @@ public class EntiretyBo extends BaseBO { ...@@ -48,5 +48,5 @@ public class EntiretyBo extends BaseBO {
48 /** 48 /**
49 * 是否可见 49 * 是否可见
50 */ 50 */
51 private boolean isVisible; 51 private boolean visible;
52 } 52 }
......
...@@ -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
......
...@@ -58,5 +58,10 @@ public class EntiretyVo { ...@@ -58,5 +58,10 @@ public class EntiretyVo {
58 /** 58 /**
59 * 是否可见 59 * 是否可见
60 */ 60 */
61 private boolean isVisible; 61 private boolean visible;
62
63 /**
64 * 是否可见
65 */
66 private String display;
62 } 67 }
......
...@@ -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 {
302 CourseVo courseVo = baseMapper.selectVoById(id); 309 if(courseIds==null)
303 courseVo.setVisible(true); 310 System.out.println("=============1==========");
304 Course course = BeanUtil.toBean(courseVo, Course.class); 311 else
305 return baseMapper.updateById(course) > 0; 312 System.out.println("========================"+Arrays.asList(courseIds));
313 for (String id : courseIds) {
314 CourseVo courseVo = baseMapper.selectVoById(id);
315 courseVo.setVisible(true);
316 Course course = BeanUtil.toBean(courseVo, Course.class);
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 {
318 CourseVo courseVo = baseMapper.selectVoById(id); 332 for (String id : courseIds) {
319 courseVo.setVisible(false); 333 CourseVo courseVo = baseMapper.selectVoById(id);
320 Course course = BeanUtil.toBean(courseVo, Course.class); 334 courseVo.setVisible(false);
321 return baseMapper.updateById(course) > 0; 335 Course course = BeanUtil.toBean(courseVo, Course.class);
336 baseMapper.updateById(course);
337 }
338 return true;
322 } 339 }
323 340
324 /** 341 /**
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!