From 2b278a1aa078b39d891f3eb00aac729ed2c1c5b3 Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期一, 25 七月 2022 17:28:58 +0800
Subject: [PATCH] 报案人查询分页处理,处理案件早发时间 修改问题
---
src/main/java/com/example/jz/controller/CommonQuestionController.java | 45 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 39 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/example/jz/controller/CommonQuestionController.java b/src/main/java/com/example/jz/controller/CommonQuestionController.java
index eca49b5..6445380 100644
--- a/src/main/java/com/example/jz/controller/CommonQuestionController.java
+++ b/src/main/java/com/example/jz/controller/CommonQuestionController.java
@@ -14,7 +14,7 @@
import javax.annotation.Resource;
import java.io.Serializable;
-import java.util.List;
+import java.util.Date;
/**
* 甯歌闂琛�(CommonQuestion)琛ㄦ帶鍒跺眰
@@ -24,7 +24,7 @@
*/
@RestController
@RequestMapping("commonQuestion")
-@Api(tags = "甯歌闂琛�(CommonQuestion)琛ㄦ帴鍙�")
+@Api(tags = "甯歌闂鎺ュ彛")
public class CommonQuestionController extends ApiController {
/**
* 鏈嶅姟瀵硅薄
@@ -66,6 +66,8 @@
@PostMapping
@ApiOperation(value = "鏂板鏁版嵁", notes = "鏂板鏁版嵁")
public R<Boolean> insert(@RequestBody CommonQuestion commonQuestion) {
+ commonQuestion.setStatus(0);
+ commonQuestion.setCtime(new Date());
return R.ok(commonQuestionService.save(commonQuestion));
}
@@ -78,19 +80,50 @@
@PutMapping
@ApiOperation(value = "淇敼鏁版嵁", notes = "淇敼鏁版嵁")
public R<Boolean> update(@RequestBody CommonQuestion commonQuestion) {
+ if (commonQuestion.getId() == 1) {
+ commonQuestion.setReleaseTime(new Date());
+ }
return R.ok(commonQuestionService.updateById(commonQuestion));
}
/**
* 鍒犻櫎鏁版嵁
*
- * @param idList 涓婚敭缁撳悎
+ * @param id 涓婚敭
* @return 鍒犻櫎缁撴灉
*/
@DeleteMapping
@ApiOperation(value = "鍒犻櫎鏁版嵁", notes = "鍒犻櫎鏁版嵁")
- public R<Boolean> delete(@RequestParam("idList") List<Long> idList) {
- return R.ok(commonQuestionService.removeByIds(idList));
+ public R<Boolean> delete(@RequestParam("id") Serializable id) {
+ return R.ok(commonQuestionService.removeById(id));
+ }
+
+ /**
+ * 鍙戝竷
+ *
+ * @param id 涓婚敭
+ * @return 鍙戝竷缁撴灉
+ */
+ @ApiOperation(value = "鍙戝竷", notes = "鍙戝竷")
+ @GetMapping("release/{id}")
+ public R<Boolean> release(@PathVariable Serializable id) {
+ CommonQuestion commonQuestion = commonQuestionService.getById(id);
+ commonQuestion.setReleaseTime(new Date());
+ commonQuestion.setStatus(1);
+ return R.ok(commonQuestionService.updateById(commonQuestion));
+ }
+
+ /**
+ * 涓嬫灦
+ *
+ * @param id 涓婚敭
+ * @return 鍙戝竷缁撴灉
+ */
+ @ApiOperation(value = "涓嬫灦", notes = "涓嬫灦")
+ @GetMapping("offline/{id}")
+ public R<Boolean> offline(@PathVariable Serializable id) {
+ CommonQuestion commonQuestion = commonQuestionService.getById(id);
+ commonQuestion.setStatus(2);
+ return R.ok(commonQuestionService.updateById(commonQuestion));
}
}
-
--
Gitblit v1.8.0