New file |
| | |
| | | package com.panzhihua.grid_app.api; |
| | | |
| | | |
| | | 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.ComMngPopulationVO; |
| | | 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; |
| | | 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.grid.EventVO; |
| | | |
| | | /** |
| | | * |
| | | * @author cedoo email:cedoo(a)qq.com |
| | | * @version 1.0 |
| | | * @since 1.0 |
| | | * @date 2021-05-26 |
| | | * */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/event") |
| | | @Api(tags = {"网格综治事件管理 @chendong", "宣传教育 @chendong","特殊人群上报(开发中..) @chendong"}) |
| | | public class EventApi extends BaseController { |
| | | |
| | | |
| | | @Resource |
| | | private GridService gridService; |
| | | |
| | | /** |
| | | * 撤销事件 |
| | | * @param eventRevokeDTO 修改事件传递对象 |
| | | * @return 修改结果 |
| | | */ |
| | | @PutMapping("/revoke") |
| | | @ApiOperation(value = "撤销事件", response = R.class) |
| | | R revoke(@Validated @RequestBody EventRevokeDTO eventRevokeDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventRevokeDTO); |
| | | LoginUserInfoVO loginUserInfoVO = getLoginUserInfo(); |
| | | eventRevokeDTO.setUserId(loginUserInfoVO.getUserId()); |
| | | eventRevokeDTO.setUserName(loginUserInfoVO.getName()); |
| | | return gridService.emergenciesRevoke(eventRevokeDTO); |
| | | } |
| | | |
| | | /** |
| | | * 查询事件详细信息 |
| | | * @param id 事件 id |
| | | * @return 查找结果 |
| | | */ |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "查询事件详细信息") |
| | | R<EventDetailsVO> details(@PathVariable("id") Long id){ |
| | | return gridService.eventDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param eventDeleteDTO 删除事件传递对象 |
| | | * @return 删除结果 |
| | | */ |
| | | @DeleteMapping() |
| | | @ApiOperation(value = "删除事件", response = R.class) |
| | | R delete(@Validated @RequestBody EventDeleteDTO eventDeleteDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(eventDeleteDTO); |
| | | return gridService.delete(eventDeleteDTO); |
| | | } |
| | | /** |
| | | * 重新发布事件 |
| | | * @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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发布草稿 |
| | | * @param commonEventPublicDTO 添加事件传递对象 |
| | | * @return 新增结果 |
| | | */ |
| | | @PutMapping("/draft/release") |
| | | @ApiOperation(value = "发布草稿", response = R.class) |
| | | R release(@Validated @RequestBody CommonEventPublicDTO commonEventPublicDTO){ |
| | | ClazzUtils.setIfStringIsEmpty(commonEventPublicDTO); |
| | | LoginUserInfoVO loginUserInfoVO = this.getLoginUserInfo(); |
| | | commonEventPublicDTO.setUserId(loginUserInfoVO.getUserId()); |
| | | commonEventPublicDTO.setUserName(loginUserInfoVO.getName()); |
| | | return gridService.draftRelease(commonEventPublicDTO); |
| | | } |
| | | |
| | | } |