From 34e50f2c23ff7cc7f0dbf2a40e3d038b30aec12f Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期六, 24 七月 2021 13:47:30 +0800
Subject: [PATCH] 测试社区动态
---
springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/EventApi.java | 225 ++++++++++++++------------------------------------------
1 files changed, 56 insertions(+), 169 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/EventApi.java b/springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/EventApi.java
index 376fd6b..92eb4b4 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/EventApi.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/grid_app/src/main/java/com/panzhihua/grid_app/api/EventApi.java
@@ -5,8 +5,10 @@
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.model.vos.community.ComActVO;
+import com.panzhihua.common.model.vos.grid.EventGridDataAreaVO;
+import com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO;
import com.panzhihua.common.utlis.ClazzUtils;
-import com.panzhihua.common.utlis.IdCardUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -17,7 +19,6 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.vos.grid.EventDetailsVO;
-import com.panzhihua.common.model.vos.grid.EventVO;
/**
*
@@ -29,92 +30,11 @@
@Slf4j
@RestController
@RequestMapping("/event")
-@Api(tags = {"事件-突发/矛盾纠纷事件/治安隐患/不稳定因素/公共服务 @陈东"})
+@Api(tags = {"网格综治事件管理 @chendong", "宣传教育 @chendong","特殊人群上报(开发中..) @chendong"})
public class EventApi extends BaseController {
-
@Resource
private GridService gridService;
-
- private boolean isDefaultType(Integer eventType){
- if(eventType==null){
- return false;
- }
- boolean inType = eventType==1 | eventType==2 |eventType==3| eventType==4| eventType==5;
- return inType;
- }
-
- /**
- * 事件列表
- * @param pageEventDTO 查找事件
- * @return 查找结果
- */
- @GetMapping("/usersList")
- @ApiOperation(value = "事件列表", response= EventVO.class)
- R usersList(@Validated @ModelAttribute PageEventDTO pageEventDTO){
- ClazzUtils.setIfStringIsEmpty(pageEventDTO);
- if(!isDefaultType(pageEventDTO.getEventType())){
- return R.fail(400, "事件类型错误");
- }
- LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- pageEventDTO.setUserId(loginUserInfoVO.getUserId());
- return gridService.query(pageEventDTO);
- }
-
- /**
- * 新增事件
- * @param {classNameFirstLower}AddDTO 添加事件传递对象
- * @return 新增结果
- */
- @PostMapping("/release")
- @ApiOperation(value = "发布事件(直接)", response = R.class)
- R add(@Validated @RequestBody CommonEventAddDTO commonEventAddDTO){
- ClazzUtils.setIfStringIsEmpty(commonEventAddDTO);
- if(!isDefaultType(commonEventAddDTO.getEventType())){
- return R.fail(400, "事件类型错误");
- }
- LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- commonEventAddDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventAddDTO.setUserName(loginUserInfoVO.getName());
- commonEventAddDTO.setPhone(loginUserInfoVO.getPhone());
- return gridService.addCommon(commonEventAddDTO);
- }
-
- /**
- * 保存草稿
- * @param commonEventEditDTO 保存草稿传递对象
- * @return 新增结果
- */
- @PostMapping("/draft")
- @ApiOperation(value = "保存草稿", response = R.class)
- R saveDraft(@Validated @RequestBody CommonEventEditDTO commonEventEditDTO){
- ClazzUtils.setIfStringIsEmpty(commonEventEditDTO);
- ClazzUtils.setIfStringIsEmpty(commonEventEditDTO);
- if(!isDefaultType(commonEventEditDTO.getEventType())){
- return R.fail(400, "事件类型错误");
- }
- LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- commonEventEditDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventEditDTO.setUserName(loginUserInfoVO.getName());
- commonEventEditDTO.setPhone(loginUserInfoVO.getPhone());
- return gridService.saveDraft(commonEventEditDTO);
- }
-
- /**
- * 上报社区
- * @param commonEventReportDTO 上报社区传递对象
- * @return 上报结果
- */
- @PutMapping("/report")
- @ApiOperation(value = "上报社区", response = R.class)
- R report(@Validated @RequestBody CommonEventReportDTO commonEventReportDTO){
- LoginUserInfoVO loginUserInfoVO = getLoginUserInfo();
- ClazzUtils.setIfStringIsEmpty(commonEventReportDTO);
- commonEventReportDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventReportDTO.setUserName(loginUserInfoVO.getName());
- return gridService.report(commonEventReportDTO);
- }
-
/**
* 撤销事件
@@ -125,53 +45,12 @@
@ApiOperation(value = "撤销事件", response = R.class)
R revoke(@Validated @RequestBody EventRevokeDTO eventRevokeDTO){
ClazzUtils.setIfStringIsEmpty(eventRevokeDTO);
- eventRevokeDTO.setUserId(getUserId());
+ LoginUserInfoVO loginUserInfoVO = getLoginUserInfo();
+ eventRevokeDTO.setUserId(loginUserInfoVO.getUserId());
+ eventRevokeDTO.setUserName(loginUserInfoVO.getNickName());
+ eventRevokeDTO.setRevokeType(1);
+ eventRevokeDTO.setRevokeId(loginUserInfoVO.getUserId());
return gridService.emergenciesRevoke(eventRevokeDTO);
- }
-
- /**
- * 处理事件
- * @param commonEventDealDTO 修改事件传递对象
- * @return 处理结果
- */
- @PutMapping("/deal")
- @ApiOperation(value = "处理事件", response = R.class)
- R deal(@Validated @RequestBody CommonEventDealDTO commonEventDealDTO){
- ClazzUtils.setIfStringIsEmpty(commonEventDealDTO);
- LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO();
- commonEventDealDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventDealDTO.setUserName(loginUserInfoVO.getName());
- return gridService.dealEvent(commonEventDealDTO);
- }
-
- /**
- * 验证事件
- * @param commonEventVerifyDTO 验证事件传递对象
- * @return 验证结果
- */
- @PutMapping("/verify")
- @ApiOperation(value = "验证事件", response = R.class)
- R verify(@Validated @RequestBody CommonEventVerifyDTO commonEventVerifyDTO){
- ClazzUtils.setIfStringIsEmpty(commonEventVerifyDTO);
- LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- commonEventVerifyDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventVerifyDTO.setUserName(loginUserInfoVO.getName());
- return gridService.verifyEvent(commonEventVerifyDTO);
- }
-
- /**
- * 重新发布事件
- * @param commonEventRepublicDTO 重新发布事件传递对象
- * @return 修改结果
- */
- @PutMapping("/republish")
- @ApiOperation(value = "重新发布事件", response = R.class)
- R republish(@Validated @RequestBody CommonEventRepublicDTO commonEventRepublicDTO){
- ClazzUtils.setIfStringIsEmpty(commonEventRepublicDTO);
- LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- commonEventRepublicDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventRepublicDTO.setUserName(loginUserInfoVO.getName());
- return gridService.republishEvent(commonEventRepublicDTO);
}
/**
@@ -186,6 +65,33 @@
}
/**
+ * 删除
+ * @param commonEventDeleteDTO 删除事件传递对象
+ * @return 删除结果
+ */
+ @DeleteMapping()
+ @ApiOperation(value = "删除事件", response = R.class)
+ R delete(@Validated @RequestBody CommonEventDeleteDTO commonEventDeleteDTO){
+ ClazzUtils.setIfStringIsEmpty(commonEventDeleteDTO);
+ return gridService.delete(commonEventDeleteDTO);
+ }
+ /**
+ * 重新发布事件
+ * @param commonEventRepublishDTO 重新发布事件传递对象
+ * @return 修改结果
+ */
+ @PutMapping("/republish")
+ @ApiOperation(value = "重新发布事件", response = R.class)
+ R republish(@Validated @RequestBody CommonEventRepublishDTO commonEventRepublishDTO){
+ ClazzUtils.setIfStringIsEmpty(commonEventRepublishDTO);
+ LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
+ commonEventRepublishDTO.setUserId(loginUserInfoVO.getUserId());
+ commonEventRepublishDTO.setUserName(loginUserInfoVO.getNickName());
+ return gridService.republishEvent(commonEventRepublishDTO);
+ }
+
+
+ /**
* 发布草稿
* @param commonEventPublicDTO 添加事件传递对象
* @return 新增结果
@@ -196,57 +102,38 @@
ClazzUtils.setIfStringIsEmpty(commonEventPublicDTO);
LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
commonEventPublicDTO.setUserId(loginUserInfoVO.getUserId());
- commonEventPublicDTO.setUserName(loginUserInfoVO.getName());
+ commonEventPublicDTO.setUserName(loginUserInfoVO.getNickName());
return gridService.draftRelease(commonEventPublicDTO);
}
- //---
- //---
-
/**
- * 添加特殊人群
- * @param specialEventAddDTO 特殊人群信息
+ * 查询社区列表
* @return 查找结果
*/
- @PostMapping("/special")
- @ApiOperation(value = "添加特殊人群")
- R addSpecial(@Validated @RequestBody SpecialEventAddDTO specialEventAddDTO){
- ClazzUtils.setIfStringIsEmpty(specialEventAddDTO);
- LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- specialEventAddDTO.setUserId(loginUserInfoVO.getUserId());
- specialEventAddDTO.setUserName(loginUserInfoVO.getName());
- specialEventAddDTO.setPhone(loginUserInfoVO.getPhone());
- return gridService.addSpecial(specialEventAddDTO);
+ @GetMapping("/actList")
+ @ApiOperation(value = "查询社区列表", response = ComActVO.class)
+ R actList(){
+ return gridService.actList();
}
/**
- * 保存特殊人群草稿
- * @param specialEventEditDTO 保存草稿传递对象
- * @return 新增结果
+ * 查询距离当前事件最近的网格数据
+ * @param pageEventGridNearbyDTO
+ * @return
*/
- @PostMapping("/special/draft")
- @ApiOperation(value = "保存特殊人群草稿", response = R.class)
- R saveSpecialDraft(@Validated @RequestBody SpecialEventEditDTO specialEventEditDTO){
- ClazzUtils.setIfStringIsEmpty(specialEventEditDTO);
+ @PostMapping("/grid/nearby")
+ @ApiOperation(value = "查询经纬度所在的网格", response = EventGridDataAreaVO.class)
+ R getNearByGrid(@Validated @RequestBody PageEventGridNearbyDTO pageEventGridNearbyDTO){
+ return gridService.getNearByGrid(pageEventGridNearbyDTO);
+ }
+
+ @ApiOperation(value = "查询社区特殊人群列表", response = EventSpecialPopulationVO.class)
+ @PostMapping("/special/population/list")
+ public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO){
LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo();
- specialEventEditDTO.setUserId(loginUserInfoVO.getUserId());
- specialEventEditDTO.setUserName(loginUserInfoVO.getName());
- specialEventEditDTO.setPhone(loginUserInfoVO.getPhone());
- return gridService.saveSpecialDraft(specialEventEditDTO);
+ specialPopulationDTO.setCommunityId(loginUserInfoVO.getCommunityId());
+ return gridService.specialPopulationList(specialPopulationDTO);
}
-
- @GetMapping("/special/{idCard}")
- @ApiOperation(value = "查询特殊人群信息")
- R getSpecialByIdCard(@PathVariable String idCard){
- if(idCard!=null){
- boolean verified = IdCardUtil.strongVerifyIdNumber(idCard);
- if(!verified){
- return R.fail("身份证格式错误");
- }
- return gridService.getSpecialPopulation(idCard);
- }
- return R.fail();
- }
}
\ No newline at end of file
--
Gitblit v1.7.1