huanghongfa
2021-09-02 177249c76aeea0b4bf8d8816d4994e3b445b45ce
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/EventApi.java
@@ -1,5 +1,10 @@
package com.panzhihua.service_grid.api;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.model.dtos.grid.*;
@@ -8,11 +13,8 @@
import com.panzhihua.common.model.vos.grid.EventDetailsVO;
import com.panzhihua.common.model.vos.grid.EventVO;
import com.panzhihua.service_grid.service.EventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
 *
@@ -20,11 +22,11 @@
 * @version 1.0
 * @since 1.0
 * @date 2021-05-26
 * */
 */
@Slf4j
@RestController
@RequestMapping("/event")
public class EventApi{
public class EventApi {
    @Resource
    private EventService eventService;
@@ -37,107 +39,123 @@
     * @date 2021/6/10 17:00
     */
    @GetMapping("/getUnUploadEvent")
    List<EventDetailsVO> getUnUploadEvent(){
    List<EventDetailsVO> getUnUploadEvent() {
        return eventService.getUnUploadEvent();
    }
    /**
     * description 更新上传是否成功标识
     * @param id 事件主键ID
     *
     * @param id
     *            事件主键ID
     * @return Boolean 上传是否成功
     * @author manailin
     * @date 2021/6/10 17:00
     */
    @GetMapping("/updateLcUploadFlag")
    Boolean updateLcUploadFlag(Long id){
    Boolean updateLcUploadFlag(Long id) {
        return eventService.updateLcUploadFlag(id);
    }
    /**
     * 分页查找事件
     *
     * @param pageEventDTO
     * @return 维护结果
     */
    @PostMapping("/page")
    R<IPage<EventVO>> query(@RequestBody PageEventDTO pageEventDTO){
    R<IPage<EventVO>> query(@RequestBody PageEventDTO pageEventDTO) {
        return eventService.query(pageEventDTO);
    };
    }
    /**
     * 删除事件
     *
     * @param commonEventDeleteDTO
     * @return 平台用户信息
     */
    @PostMapping("/delete")
    R delete(@RequestBody CommonEventDeleteDTO commonEventDeleteDTO){
    R delete(@RequestBody CommonEventDeleteDTO commonEventDeleteDTO) {
        return eventService.delete(commonEventDeleteDTO);
    }
    /**
     * 批量删除
     *
     * @param eventDeleteDTO
     * @return
     */
    @PostMapping("/deleteEventBatch")
    R deleteEventBatch(@RequestBody EventDeleteDTO eventDeleteDTO){
        return  eventService.deleteEventBatch(eventDeleteDTO);
    R deleteEventBatch(@RequestBody EventDeleteDTO eventDeleteDTO) {
        return eventService.deleteEventBatch(eventDeleteDTO);
    }
    /**
     * 查询事件详细信息
     * @param id 事件 id
     *
     * @param id
     *            事件 id
     * @return 查找结果
     */
    @PostMapping("/{id}")
    R<EventDetailsVO> eventDetails(@PathVariable("id") Long id){
    R<EventDetailsVO> eventDetails(@PathVariable("id") Long id) {
        return eventService.eventDetails(id);
    }
    /**
     * 添加突发事件
     *
     * @param commonEventAddDTO
     * @return 新增结果
     */
    @PostMapping("/addCommon")
    R addCommon(@RequestBody CommonEventAddDTO commonEventAddDTO){
    R addCommon(@RequestBody CommonEventAddDTO commonEventAddDTO) {
        return eventService.addCommon(commonEventAddDTO);
    }
    /**
     * 保存草稿
     * @param {classNameFirstLower}AddDTO 添加事件传递对象
     *
     * @param {classNameFirstLower}AddDTO
     *            添加事件传递对象
     * @return 新增结果
     */
    @PostMapping("/saveDraft")
    R saveDraft(@RequestBody CommonEventEditDTO commonEventEditDTO){
    R saveDraft(@RequestBody CommonEventEditDTO commonEventEditDTO) {
        return eventService.saveDraft(commonEventEditDTO);
    }
    /**
     * 事件上报社区
     *
     * @param commonEventReportDTO
     * @return
     */
    @PostMapping("/report")
    R report(@RequestBody CommonEventReportDTO commonEventReportDTO){
    R report(@RequestBody CommonEventReportDTO commonEventReportDTO) {
        return eventService.report(commonEventReportDTO);
    }
    /**
     * 事件撤销
     *
     * @param eventRevokeDTO
     * @return
     */
    @PostMapping("/emergenciesRevoke")
    R emergenciesRevoke(@RequestBody EventRevokeDTO eventRevokeDTO){
    R emergenciesRevoke(@RequestBody EventRevokeDTO eventRevokeDTO) {
        return eventService.emergenciesRevoke(eventRevokeDTO);
    }
    /**
     * 处理事件
     *
     * @param commonEventDealDTO
     * @return
     */
    @PostMapping("/dealEvent")
    R dealEvent(@RequestBody CommonEventDealDTO commonEventDealDTO){
        switch (commonEventDealDTO.getOperateType()){
    R dealEvent(@RequestBody CommonEventDealDTO commonEventDealDTO) {
        switch (commonEventDealDTO.getOperateType()) {
            case 1:
                return eventService.communityDealEvent(commonEventDealDTO);
            case 0:
@@ -149,189 +167,214 @@
    /**
     * 处理事件
     *
     * @param commonEventVerifyDTO
     * @return
     */
    @PostMapping("/verify")
    R verifyEvent(@RequestBody CommonEventVerifyDTO commonEventVerifyDTO){
    R verifyEvent(@RequestBody CommonEventVerifyDTO commonEventVerifyDTO) {
        return eventService.verifyEvent(commonEventVerifyDTO);
    }
    /**
     * 重新发布事件
     *
     * @param commonEventRepublishDTO
     * @return
     */
    @PostMapping("/republish")
    R republishEvent(@RequestBody CommonEventRepublishDTO commonEventRepublishDTO){
    R republishEvent(@RequestBody CommonEventRepublishDTO commonEventRepublishDTO) {
        return eventService.republishEvent(commonEventRepublishDTO);
    }
    /**
     * 批量发布事件
     *
     * @param commonEventBatchRepublishDTO
     * @return
     */
    @PostMapping("/batchRepublishEvent")
    R batchRepublishEvent(@RequestBody CommonEventBatchRepublishDTO commonEventBatchRepublishDTO){
    R batchRepublishEvent(@RequestBody CommonEventBatchRepublishDTO commonEventBatchRepublishDTO) {
        return eventService.batchRepublishEvent(commonEventBatchRepublishDTO);
    }
    /**
     * 草稿发布
     *
     * @param commonEventPublicDTO
     * @return
     */
    @PostMapping("/draftRelease")
    R draftRelease(@RequestBody CommonEventPublicDTO commonEventPublicDTO){
    R draftRelease(@RequestBody CommonEventPublicDTO commonEventPublicDTO) {
        return eventService.draftRelease(commonEventPublicDTO);
    }
    /**
     * 保存殊人群事件上报草稿
     *
     * @param specialEventEditDTO
     * @return
     */
    @PostMapping("/saveSpecialDraft")
    R saveSpecialDraft(@RequestBody SpecialEventEditDTO specialEventEditDTO){
    R saveSpecialDraft(@RequestBody SpecialEventEditDTO specialEventEditDTO) {
        return eventService.saveSpecialDraft(specialEventEditDTO);
    }
    /**
     * 特殊人员信息上报
     *
     * @param specialEventAddDTO
     * @return
     */
    @PostMapping("/addSpecial")
    R addSpecial(@RequestBody SpecialEventAddDTO specialEventAddDTO){
    R addSpecial(@RequestBody SpecialEventAddDTO specialEventAddDTO) {
        return eventService.addSpecial(specialEventAddDTO);
    }
    /**
     * 获取指定特殊人员信息
     *
     * @param idCard
     * @return
     */
    @PostMapping("/getSpecialPopulation")
    R getSpecialPopulation(@RequestBody String idCard){
    R getSpecialPopulation(@RequestBody String idCard) {
        return eventService.getSpecialPopulation(idCard);
    }
    /**
     * 添加发布宣传教育事件
     * @param publicityEventAddDTO   请求参数
     * @return  上报结果
     *
     * @param publicityEventAddDTO
     *            请求参数
     * @return 上报结果
     */
    @PostMapping("/addPublicity")
    R addPublicity(@RequestBody PublicityEventAddDTO publicityEventAddDTO){
    R addPublicity(@RequestBody PublicityEventAddDTO publicityEventAddDTO) {
        return eventService.addPublicity(publicityEventAddDTO);
    }
    /**
     * 保存宣传教育事件草稿
     * @param publicityEventEditDTO   请求参数
     * @return  保存结果
     *
     * @param publicityEventEditDTO
     *            请求参数
     * @return 保存结果
     */
    @PostMapping("/savePublicityDraft")
    R savePublicityDraft(@RequestBody PublicityEventEditDTO publicityEventEditDTO) {
        return eventService.savePublicityDraft(publicityEventEditDTO);
    }
    /**
     * 分页查询宣传教育事件
     * @param pagePublicityEventDTO   请求参数
     * @return  结果
     *
     * @param pagePublicityEventDTO
     *            请求参数
     * @return 结果
     */
    @PostMapping("/queryPublicity")
    R queryPublicity(@RequestBody PagePublicityEventDTO pagePublicityEventDTO){
    R queryPublicity(@RequestBody PagePublicityEventDTO pagePublicityEventDTO) {
        return eventService.selectPublicity(pagePublicityEventDTO);
    }
    /**
     * 分页查询宣传教育事件
     * @param pagePublicityEventDTO   请求参数
     * @return  结果
     *
     * @param pagePublicityEventDTO
     *            请求参数
     * @return 结果
     */
    @PostMapping("/queryPublicityCommunity")
    R queryPublicityCommunity(@RequestBody PagePublicityEventCommunityDTO pagePublicityEventDTO){
    R queryPublicityCommunity(@RequestBody PagePublicityEventCommunityDTO pagePublicityEventDTO) {
        return eventService.selectCommunityPublicity(pagePublicityEventDTO);
    }
    /**
     * 分页查询宣传教育事件
     * @return  结果
     *
     * @return 结果
     */
    @PostMapping("/actList")
    R<ComActVO> actList(){
    R<ComActVO> actList() {
        return eventService.actList();
    }
    /**
     * 查询管理事件
     *
     * @param pageEventManageDTO
     * @return
     */
    @PostMapping("/manage/list")
    R queryEventToManage(@RequestBody PageEventManageDTO pageEventManageDTO){
    R queryEventToManage(@RequestBody PageEventManageDTO pageEventManageDTO) {
        return eventService.eventToManage(pageEventManageDTO);
    }
    /**
     * 社区网格后台标记事件无效
     *
     * @param eventRevokeDTO
     * @return
     */
    @PostMapping("/markInvalid")
    R markEventInvalid(@RequestBody EventRevokeDTO eventRevokeDTO){
    R markEventInvalid(@RequestBody EventRevokeDTO eventRevokeDTO) {
        return eventService.markEventInvalid(eventRevokeDTO);
    }
    /**
     * 批量事件标为无效
     *
     * @param eventBatchRevokeDTO
     * @return
     */
    @PostMapping("/batchMarkInvalid")
    R batchMarkEventInvalid(@RequestBody EventBatchRevokeDTO eventBatchRevokeDTO){
    R batchMarkEventInvalid(@RequestBody EventBatchRevokeDTO eventBatchRevokeDTO) {
        return eventService.batchMarkEventInvalid(eventBatchRevokeDTO);
    }
    /**
     * 社区网格后台重新发布已标记无效的事件
     *
     * @param commonEventRepublishDTO
     * @return
     */
    @PostMapping("/republishInvalid")
    R republishInvalidEvent(@RequestBody CommonEventRepublishDTO commonEventRepublishDTO){
    R republishInvalidEvent(@RequestBody CommonEventRepublishDTO commonEventRepublishDTO) {
        return eventService.republishInvalidEvent(commonEventRepublishDTO);
    }
    /**
     * 查询距离当前事件最近的网格数据
     *
     * @param pageEventGridNearbyDTO
     * @return
     */
    @PostMapping("/grid/nearby")
    R getNearByGrid(@RequestBody PageEventGridNearbyDTO pageEventGridNearbyDTO){
    R getNearByGrid(@RequestBody PageEventGridNearbyDTO pageEventGridNearbyDTO) {
        return eventService.getNearByGrid(pageEventGridNearbyDTO);
    }
    /**
     * 直接上报社区
     *
     * @param commonEventDirectReportDTO
     * @return
     */
    @PostMapping("/reportDirect")
    R reportDirect(@RequestBody CommonEventDirectReportDTO commonEventDirectReportDTO){
    R reportDirect(@RequestBody CommonEventDirectReportDTO commonEventDirectReportDTO) {
        return eventService.reportDirect(commonEventDirectReportDTO);
    }
    /**
     * 特殊人群上报-社区人口数据列表
     * @param specialPopulationDTO   请求参数
     * @return  社区人口数据列表
     *
     * @param specialPopulationDTO
     *            请求参数
     * @return 社区人口数据列表
     */
    @PostMapping("/special/population/list")
    public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO){
    public R specialPopulationList(@RequestBody PageEventSpecialPopulationDTO specialPopulationDTO) {
        return eventService.specialPopulationList(specialPopulationDTO);
    }
}