|
@@ -21,6 +21,7 @@ import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -121,17 +122,28 @@ public class NoticeManagementController {
|
|
|
/**
|
|
|
* 修改状态
|
|
|
*
|
|
|
- * @param id 主键
|
|
|
- * @param releaseState 状态(未发布或已发布)
|
|
|
+ * @param ids 多主键
|
|
|
+ * @param releaseState 状态(未发布或已发布或草稿)
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@PostMapping(value = "/modifiedState")
|
|
|
- public R modifiedState(@RequestParam(value = "id") String id,
|
|
|
+ public R modifiedState(@RequestParam(value = "ids") String ids,
|
|
|
@RequestParam(value = "releaseState") String releaseState) {
|
|
|
- EvaluationNotice evaluationNotice = new EvaluationNotice();
|
|
|
- evaluationNotice.setId(id);
|
|
|
- evaluationNotice.setReleaseState(releaseState);
|
|
|
- boolean b = evaluationNoticeService.updateById(evaluationNotice);
|
|
|
+ boolean b = false;
|
|
|
+ if (ids.length() > 0) {
|
|
|
+ String[] strings = ids.split(",");
|
|
|
+ for (String id : strings) {
|
|
|
+ EvaluationNotice evaluationNotice = new EvaluationNotice();
|
|
|
+ evaluationNotice.setId(id);
|
|
|
+ if ("已发布".equals(releaseState)) {
|
|
|
+ evaluationNotice.setReleaseDate(new Date());
|
|
|
+ } else {
|
|
|
+ evaluationNotice.setReleaseDate(null);
|
|
|
+ }
|
|
|
+ evaluationNotice.setReleaseState(releaseState);
|
|
|
+ b = evaluationNoticeService.updateById(evaluationNotice);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (b) {
|
|
|
return R.ok().data(b);
|
|
|
} else {
|