| | |
| | | package com.panzhihua.grid_app.api; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | 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.EventDetailsVO; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataAreaVO; |
| | | import com.panzhihua.common.model.vos.grid.EventSpecialPopulationVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | import com.panzhihua.common.utlis.ClazzUtils; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | //import com.panzhihua.common.model.vos.IPageVO; |
| | | import com.panzhihua.common.service.grid.GridService; |
| | | |
| | | import javax.annotation.Resource; |
| | | import com.panzhihua.common.model.vos.grid.EventDetailsVO; |
| | | // import com.panzhihua.common.model.vos.IPageVO; |
| | | |
| | | /** |
| | | * |
| | |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/event") |
| | | @Api(tags = {"网格综治事件管理 @chendong", "宣传教育 @chendong","特殊人群上报(开发中..) @chendong"}) |
| | | @Api(tags = {"网格综治事件管理 @chendong", "宣传教育 @chendong", "特殊人群上报(开发中..) @chendong"}) |
| | | public class EventApi extends BaseController { |
| | | |
| | | @Resource |
| | |
| | | |
| | | /** |
| | | * 撤销事件 |
| | | * @param eventRevokeDTO 修改事件传递对象 |
| | | * |
| | | * @param eventRevokeDTO |
| | | * 修改事件传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping("/revoke") |
| | | @ApiOperation(value = "撤销事件", response = R.class) |
| | | R revoke(@Validated @RequestBody EventRevokeDTO eventRevokeDTO){ |
| | | R revoke(@Validated @RequestBody EventRevokeDTO eventRevokeDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(eventRevokeDTO); |
| | | LoginUserInfoVO loginUserInfoVO = getLoginUserInfo(); |
| | | eventRevokeDTO.setUserId(loginUserInfoVO.getUserId()); |
| | |
| | | |
| | | /** |
| | | * 查询事件详细信息 |
| | | * @param id 事件 id |
| | | * |
| | | * @param id |
| | | * 事件 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询事件详细信息") |
| | | R<EventDetailsVO> details(@PathVariable("id") Long id){ |
| | | R<EventDetailsVO> details(@PathVariable("id") Long id) { |
| | | return gridService.eventDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param commonEventDeleteDTO 删除事件传递对象 |
| | | * |
| | | * @param commonEventDeleteDTO |
| | | * 删除事件传递对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping() |
| | | @ApiOperation(value = "删除事件", response = R.class) |
| | | R delete(@Validated @RequestBody CommonEventDeleteDTO commonEventDeleteDTO){ |
| | | R delete(@Validated @RequestBody CommonEventDeleteDTO commonEventDeleteDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(commonEventDeleteDTO); |
| | | return gridService.delete(commonEventDeleteDTO); |
| | | } |
| | | |
| | | /** |
| | | * 重新发布事件 |
| | | * @param commonEventRepublishDTO 重新发布事件传递对象 |
| | | * |
| | | * @param commonEventRepublishDTO |
| | | * 重新发布事件传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping("/republish") |
| | | @ApiOperation(value = "重新发布事件", response = R.class) |
| | | R republish(@Validated @RequestBody CommonEventRepublishDTO commonEventRepublishDTO){ |
| | | R republish(@Validated @RequestBody CommonEventRepublishDTO commonEventRepublishDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(commonEventRepublishDTO); |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | commonEventRepublishDTO.setUserId(loginUserInfoVO.getUserId()); |
| | |
| | | return gridService.republishEvent(commonEventRepublishDTO); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发布草稿 |
| | | * @param commonEventPublicDTO 添加事件传递对象 |
| | | * |
| | | * @param commonEventPublicDTO |
| | | * 添加事件传递对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PutMapping("/draft/release") |
| | | @ApiOperation(value = "发布草稿", response = R.class) |
| | | R release(@Validated @RequestBody CommonEventPublicDTO commonEventPublicDTO){ |
| | | R release(@Validated @RequestBody CommonEventPublicDTO commonEventPublicDTO) { |
| | | ClazzUtils.setIfStringIsEmpty(commonEventPublicDTO); |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | commonEventPublicDTO.setUserId(loginUserInfoVO.getUserId()); |
| | |
| | | |
| | | /** |
| | | * 查询社区列表 |
| | | * |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/actList") |
| | | @ApiOperation(value = "查询社区列表", response = ComActVO.class) |
| | | R actList(){ |
| | | R actList() { |
| | | return gridService.actList(); |
| | | } |
| | | |
| | | /** |
| | | * 查询距离当前事件最近的网格数据 |
| | | * |
| | | * @param pageEventGridNearbyDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/grid/nearby") |
| | | @ApiOperation(value = "查询经纬度所在的网格", response = EventGridDataAreaVO.class) |
| | | R getNearByGrid(@Validated @RequestBody PageEventGridNearbyDTO pageEventGridNearbyDTO){ |
| | | 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){ |
| | | public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO) { |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | specialPopulationDTO.setCommunityId(loginUserInfoVO.getCommunityId()); |
| | | return gridService.specialPopulationList(specialPopulationDTO); |
| | | } |
| | | |
| | | |
| | | } |