| | |
| | | package com.panzhihua.service_grid.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.panzhihua.service_grid.dao.*; |
| | | import com.panzhihua.service_grid.model.dos.*; |
| | | import com.panzhihua.service_grid.service.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | /** |
| | | * @author cedoo |
| | | * 2021-04-14 15:03:01 |
| | | * 订单表服务实现类 |
| | | * @author cedoo 2021-04-14 15:03:01 订单表服务实现类 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class EventServiceImpl extends ServiceImpl<EventMapper, EventDO> implements EventService { |
| | | |
| | | private final String moth_format_str = "yyyy-MM"; |
| | | private final String[] monthStr = new String[] {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"}; |
| | | @Resource |
| | | private EventMapper eventMapper; |
| | | @Resource |
| | |
| | | @Resource |
| | | private EventResourceMapper eventResourceMapper; |
| | | |
| | | private final String moth_format_str = "yyyy-MM"; |
| | | |
| | | private final String[] monthStr = new String[]{"一","二","三","四","五","六","七","八","九","十","十一","十二"}; |
| | | |
| | | /** |
| | | * 分页查找事件 |
| | | * |
| | |
| | | List<EventVO> eventVOList = ipage.getRecords(); |
| | | eventVOList.forEach(eventVO -> { |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventVO.getId()) |
| | | ); |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventVO.getId())); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | |
| | | eventVO.setPics(picList); |
| | | eventVO.setVideos(videoList); |
| | | |
| | | //查询网格员头像 |
| | | Map<String,String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId()); |
| | | // 查询网格员头像 |
| | | Map<String, String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId()); |
| | | if (StringUtils.isNotEmpty(userMap)) { |
| | | eventVO.setGridMemberName(userMap.get("nick_name")); |
| | | eventVO.setGridMemberImageUrl(userMap.get("image_url")); |
| | |
| | | if (eventDO == null) { |
| | | return R.fail("事件不存在"); |
| | | } |
| | | if (eventDO.getEventStatus() != null && |
| | | (eventDO.getEventStatus().intValue() == 1 || eventDO.getEventStatus().intValue() == 4)) {//草稿 或者 已撤销 的事件可以删除 |
| | | eventDO.setEventStatus(3);//逻辑删除 |
| | | if (eventDO.getEventStatus() != null |
| | | && (eventDO.getEventStatus().intValue() == 1 || eventDO.getEventStatus().intValue() == 4)) {// 草稿 或者 已撤销 |
| | | // 的事件可以删除 |
| | | eventDO.setEventStatus(3);// 逻辑删除 |
| | | eventDO.setUpdateBy(commonEventDeleteDTO.getUserId()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | return updated == 1 ? R.ok() : R.fail(); |
| | |
| | | /** |
| | | * 查询事件详细信息 |
| | | * |
| | | * @param id 事件 id |
| | | * @param id |
| | | * 事件 id |
| | | * @return 查找结果 |
| | | */ |
| | | @Override |
| | |
| | | eventDetailsVO.setCommunityId(eventGridDataDO.getGridCommunityId()); |
| | | } |
| | | |
| | | //查询事件关联附件 |
| | | // 查询事件关联附件 |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, id) |
| | | ); |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, id)); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | |
| | | eventDetailsVO.setPics(picList); |
| | | eventDetailsVO.setVideos(videoList); |
| | | |
| | | |
| | | //查询事件流转记录 |
| | | List<EventTransferRecordDO> eventTransferRecordDOList = eventTransferRecordService.getBaseMapper() |
| | | .selectList(new LambdaQueryWrapper<EventTransferRecordDO>() |
| | | .eq(EventTransferRecordDO::getEventId, id) |
| | | .orderByAsc(EventTransferRecordDO::getCreateAt) |
| | | ); |
| | | // 查询事件流转记录 |
| | | List<EventTransferRecordDO> eventTransferRecordDOList = |
| | | eventTransferRecordService.getBaseMapper().selectList(new LambdaQueryWrapper<EventTransferRecordDO>() |
| | | .eq(EventTransferRecordDO::getEventId, id).orderByAsc(EventTransferRecordDO::getCreateAt)); |
| | | |
| | | List<EventTransferRecordVO> eventTransferRecordVOS = new ArrayList<>(); |
| | | for (EventTransferRecordDO eventTransferRecordDO : eventTransferRecordDOList) { |
| | | EventTransferRecordVO eventTransferRecordVO = new EventTransferRecordVO(); |
| | | BeanUtils.copyProperties(eventTransferRecordDO, eventTransferRecordVO); |
| | | List<EventResourceDO> eventTransferResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 3) |
| | | .eq(EventResourceDO::getRefId, eventTransferRecordDO.getId()) |
| | | ); |
| | | List<EventResourceDO> eventTransferResourceDOList = eventResourceService.getBaseMapper() |
| | | .selectList(new LambdaQueryWrapper<EventResourceDO>().eq(EventResourceDO::getClassification, 3) |
| | | .eq(EventResourceDO::getRefId, eventTransferRecordDO.getId())); |
| | | List<EventResourceVO> transferPicList = new ArrayList<>(); |
| | | List<EventResourceVO> transferAudioList = new ArrayList<>(); |
| | | List<EventResourceVO> transferVideoList = new ArrayList<>(); |
| | |
| | | } |
| | | eventDetailsVO.setTrans(eventTransferRecordVOS); |
| | | |
| | | //查询网格员头像,姓名 |
| | | Map<String,Object> gridMember = eventMapper.getUserBaseInfo(eventDO.getGridMemberId()); |
| | | // 查询网格员头像,姓名 |
| | | Map<String, Object> gridMember = eventMapper.getUserBaseInfo(eventDO.getGridMemberId()); |
| | | if (!CollectionUtils.isEmpty(gridMember)) { |
| | | eventDetailsVO.setGridMemberName(gridMember.get("nick_name") == null ? "" : gridMember.get("nick_name").toString()); |
| | | eventDetailsVO.setGridMemberImageUrl(gridMember.get("image_url") == null ? "" : gridMember.get("image_url").toString()); |
| | | eventDetailsVO.setGridMemberName( |
| | | gridMember.get("nick_name") == null ? "" : gridMember.get("nick_name").toString()); |
| | | eventDetailsVO.setGridMemberImageUrl( |
| | | gridMember.get("image_url") == null ? "" : gridMember.get("image_url").toString()); |
| | | } |
| | | if(Objects.equals(eventDO.getGridMemberId(),eventDO.getCreateBy())){ |
| | | if (Objects.equals(eventDO.getGridMemberId(), eventDO.getCreateBy())) { |
| | | eventDetailsVO.setCreator(eventDetailsVO.getGridMemberName()); |
| | | }else{ |
| | | Map<String,Object> createUser = eventMapper.getUserBaseInfo(eventDO.getCreateBy()); |
| | | eventDetailsVO.setCreator(createUser.get("nick_name") == null ? "" : createUser.get("nick_name").toString()); |
| | | } else { |
| | | Map<String, Object> createUser = eventMapper.getUserBaseInfo(eventDO.getCreateBy()); |
| | | eventDetailsVO |
| | | .setCreator(createUser.get("nick_name") == null ? "" : createUser.get("nick_name").toString()); |
| | | } |
| | | |
| | | //当事件为特殊人群上报时,需要查询事件与人口关联关系 |
| | | if(eventDetailsVO.getEventType() != null && eventDetailsVO.getEventType().equals(6)){ |
| | | List<EventSpecialPopulationDetailsVO> specialPopulationList = eventSpecialCrowdRecordMapper.getSpecialPopulationIds(eventDetailsVO.getId()); |
| | | if(!specialPopulationList.isEmpty()){ |
| | | // 当事件为特殊人群上报时,需要查询事件与人口关联关系 |
| | | if (eventDetailsVO.getEventType() != null && eventDetailsVO.getEventType().equals(6)) { |
| | | List<EventSpecialPopulationDetailsVO> specialPopulationList = |
| | | eventSpecialCrowdRecordMapper.getSpecialPopulationIds(eventDetailsVO.getId()); |
| | | if (!specialPopulationList.isEmpty()) { |
| | | specialPopulationList.forEach(special -> { |
| | | special.setAge(IdcardUtil.getAgeByIdCard(special.getIdCard())); |
| | | }); |
| | |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(commonEventAddDTO, eventDO); |
| | | if (commonEventAddDTO instanceof CommonEventCommunityAddDTO) { |
| | | CommonEventCommunityAddDTO commonEventCommunityAddDTO = (CommonEventCommunityAddDTO) commonEventAddDTO; |
| | | CommonEventCommunityAddDTO commonEventCommunityAddDTO = (CommonEventCommunityAddDTO)commonEventAddDTO; |
| | | eventDO.setGridMemberId(commonEventCommunityAddDTO.getGridMemberId()); |
| | | } else { |
| | | eventDO.setGridMemberId(commonEventAddDTO.getUserId()); |
| | |
| | | eventDO.setGridMemberCommunity(eventGridDataDO.getGridCommunityId()); |
| | | eventDO.setGridMemberStreet(eventGridDataDO.getGridStreetId()); |
| | | |
| | | //检查特殊人群上报时参数 |
| | | // if(commonEventAddDTO.getEventType().equals(6)){ |
| | | // if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){ |
| | | // return R.fail("上报人员为空"); |
| | | // } |
| | | // } |
| | | // 检查特殊人群上报时参数 |
| | | // if(commonEventAddDTO.getEventType().equals(6)){ |
| | | // if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){ |
| | | // return R.fail("上报人员为空"); |
| | | // } |
| | | // } |
| | | |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(2);//事件状态 2发布 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventStatus(2);// 事件状态 2发布 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setEventProcessStatus(1); |
| | | eventDO.setGridMemberName(commonEventAddDTO.getUserName()); |
| | | eventDO.setGridMemberTelephone(commonEventAddDTO.getPhone()); |
| | |
| | | eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); |
| | | |
| | | if (eventMapper.insert(eventDO) == 1) { |
| | | //如果是特殊人群,则新增特殊人群与事件关系 |
| | | if(commonEventAddDTO.getEventType().equals(6)){ |
| | | if(commonEventAddDTO.getPopulationIds() != null && commonEventAddDTO.getPopulationIds().size() > 0){ |
| | | // 如果是特殊人群,则新增特殊人群与事件关系 |
| | | if (commonEventAddDTO.getEventType().equals(6)) { |
| | | if (commonEventAddDTO.getPopulationIds() != null && commonEventAddDTO.getPopulationIds().size() > 0) { |
| | | List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>(); |
| | | commonEventAddDTO.getPopulationIds().forEach(populationId -> { |
| | | EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO(); |
| | |
| | | specialCrowdRecordDO.setCreateAt(new Date()); |
| | | crowdRecordList.add(specialCrowdRecordDO); |
| | | }); |
| | | //添加特殊人群上报事件与人口关系 |
| | | // 添加特殊人群上报事件与人口关系 |
| | | eventSpecialCrowdRecordService.saveBatch(crowdRecordList); |
| | | } |
| | | } |
| | | |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventAddDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | eventResourceDO.setRefId(eventDO.getId()); |
| | | eventResourceDO.setCreateBy(commonEventAddDTO.getUserId()); |
| | | eventResourceDO.setResourceTime(commonEventAddDTO.getAudioTime()); |
| | | eventResourceDO.setResourceName(commonEventAddDTO.getAudio().substring(commonEventAddDTO.getAudio().lastIndexOf("/")+1)); |
| | | eventResourceDO.setResourceName( |
| | | commonEventAddDTO.getAudio().substring(commonEventAddDTO.getAudio().lastIndexOf("/") + 1)); |
| | | int audioAdd = eventResourceService.getBaseMapper().insert(eventResourceDO); |
| | | if (audioAdd != 1) { |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventAddDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | eventResourceDO.setRefId(eventDO.getId()); |
| | | eventResourceDO.setCreateBy(commonEventAddDTO.getUserId()); |
| | | eventResourceDO.setResourceTime(commonEventAddDTO.getVideoTime()); |
| | | eventResourceDO.setResourceName(commonEventAddDTO.getVideo().substring(commonEventAddDTO.getVideo().lastIndexOf("/")+1)); |
| | | eventResourceDO.setResourceName( |
| | | commonEventAddDTO.getVideo().substring(commonEventAddDTO.getVideo().lastIndexOf("/") + 1)); |
| | | int videoAdd = eventResourceService.getBaseMapper().insert(eventResourceDO); |
| | | if (videoAdd != 1) { |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventAddDTO.getPics())) { |
| | | String[] pica = commonEventAddDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | eventResourceDO.setUrl(pica[i]); |
| | | eventResourceDO.setRefId(eventDO.getId()); |
| | | eventResourceDO.setCreateBy(commonEventAddDTO.getUserId()); |
| | | eventResourceDO.setResourceName(pica[i].substring(pica[i].lastIndexOf("/")+1)); |
| | | eventResourceDO.setResourceName(pica[i].substring(pica[i].lastIndexOf("/") + 1)); |
| | | int picAdd = eventResourceService.getBaseMapper().insert(eventResourceDO); |
| | | if (picAdd != 1) { |
| | | throw new ServiceException("添加图片失败"); |
| | |
| | | } |
| | | |
| | | if (commonEventEditDTO.getId() == null) { |
| | | //检查特殊人群上报时参数 |
| | | if(commonEventEditDTO.getEventType().equals(6)){ |
| | | if(commonEventEditDTO.getPopulationIds().isEmpty()){ |
| | | // 检查特殊人群上报时参数 |
| | | if (commonEventEditDTO.getEventType().equals(6)) { |
| | | if (commonEventEditDTO.getPopulationIds().isEmpty()) { |
| | | return R.fail("上报人员为空"); |
| | | } |
| | | } |
| | |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(commonEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(commonEventEditDTO.getUserId()); |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(1);//事件状态 1草稿 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventStatus(1);// 事件状态 1草稿 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setCreateBy(commonEventEditDTO.getUserId()); |
| | | eventDO.setGridMemberId(commonEventEditDTO.getUserId()); |
| | | eventDO.setGridMemberName(commonEventEditDTO.getUserName()); |
| | |
| | | eventDO.setEventDealStatus(5); |
| | | if (eventMapper.insert(eventDO) > 0) { |
| | | |
| | | //如果是特殊人群,则新增特殊人群与事件关系 |
| | | if(commonEventEditDTO.getEventType().equals(6)){ |
| | | // 如果是特殊人群,则新增特殊人群与事件关系 |
| | | if (commonEventEditDTO.getEventType().equals(6)) { |
| | | List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>(); |
| | | commonEventEditDTO.getPopulationIds().forEach(populationId -> { |
| | | EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO(); |
| | |
| | | specialCrowdRecordDO.setCreateAt(new Date()); |
| | | crowdRecordList.add(specialCrowdRecordDO); |
| | | }); |
| | | //添加特殊人群上报事件与人口关系 |
| | | // 添加特殊人群上报事件与人口关系 |
| | | eventSpecialCrowdRecordService.saveBatch(crowdRecordList); |
| | | } |
| | | |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getPics())) { |
| | | String[] pica = commonEventEditDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | } |
| | | return R.fail(); |
| | | } else { |
| | | //编辑原来的 |
| | | // 编辑原来的 |
| | | EventDO eventDO = eventMapper.selectById(commonEventEditDTO.getId()); |
| | | if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 && eventDO.getEventDealStatus() != 6) { |
| | | if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 |
| | | && eventDO.getEventDealStatus() != 6) { |
| | | return R.fail("保存草稿失败,事件不是草稿/已撤销状态"); |
| | | } |
| | | BeanUtils.copyProperties(commonEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(commonEventEditDTO.getUserId()); |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(1);//事件状态 2发布 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventStatus(1);// 事件状态 2发布 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setUpdateBy(commonEventEditDTO.getUserId()); |
| | | eventDO.setEventDealStatus(5); |
| | | if (eventMapper.updateById(eventDO) > 0) { |
| | | int deleted = eventResourceService.getBaseMapper() |
| | | .delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | //添加音频 |
| | | int deleted = eventResourceService.getBaseMapper().delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventEditDTO.getPics())) { |
| | | String[] pica = commonEventEditDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | if (comActVO == null) { |
| | | return R.fail("社区不存在"); |
| | | } |
| | | eventDO.setCommunityProcess(1); //社区处理 |
| | | eventDO.setProcessType(2); //当前处理对象: 社区处理 |
| | | eventDO.setCommunityProcess(1); // 社区处理 |
| | | eventDO.setProcessType(2); // 当前处理对象: 社区处理 |
| | | eventDO.setCommunityProcess(1); |
| | | eventDO.setEventProcessStatus(1); //待处理 |
| | | eventDO.setEventProcessStatus(1); // 待处理 |
| | | eventDO.setUpdateBy(commonEventReportDTO.getUserId()); |
| | | eventDO.setSubmitDate(new Date()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | throw new ServiceException("更新突发事件状态更新失败"); |
| | | } |
| | | addTransferRecord(eventDO.getId(), commonEventReportDTO.getToId(), comActVO.getName(), 2, commonEventReportDTO.getProcessResult(), |
| | | commonEventReportDTO.getUserId(), commonEventReportDTO.getUserName(), 2); |
| | | addTransferRecord(eventDO.getId(), commonEventReportDTO.getToId(), comActVO.getName(), 2, |
| | | commonEventReportDTO.getProcessResult(), commonEventReportDTO.getUserId(), |
| | | commonEventReportDTO.getUserName(), 2); |
| | | return R.ok(); |
| | | |
| | | } |
| | |
| | | if (eventDO == null) { |
| | | return R.fail("事件不存在"); |
| | | } |
| | | boolean canRevoke = eventDO.getEventStatus() == 2; //发布状态 |
| | | boolean canRevoke = eventDO.getEventStatus() == 2; // 发布状态 |
| | | if (!canRevoke) { |
| | | return R.fail("当前事件不允许·"); |
| | | } |
| | | Integer eventProcessStatus = eventDO.getEventProcessStatus() != null ? eventDO.getEventProcessStatus() : -1; |
| | | if (eventProcessStatus == 2 || eventProcessStatus == 3) { //已解决 或者 待验证 不允许撤销 |
| | | if (eventProcessStatus == 2 || eventProcessStatus == 3) { // 已解决 或者 待验证 不允许撤销 |
| | | return R.fail("当前事件不允许撤销"); |
| | | } |
| | | eventDO.setEventStatus(4); |
| | | eventDO.setUpdateBy(eventRevokeDTO.getUserId()); |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setRevokeType(eventRevokeDTO.getRevokeType()); |
| | | eventDO.setRevokeId(eventRevokeDTO.getRevokeId()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated == 1) { |
| | | addTransferRecord(eventDO.getId(), eventRevokeDTO.getUserId(), eventRevokeDTO.getUserName(), |
| | | 1, "撤销成功", eventRevokeDTO.getUserId(), eventRevokeDTO.getUserName(), 7); |
| | | addTransferRecord(eventDO.getId(), eventRevokeDTO.getUserId(), eventRevokeDTO.getUserName(), 1, "撤销成功", |
| | | eventRevokeDTO.getUserId(), eventRevokeDTO.getUserName(), 7); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | if (eventDO == null) { |
| | | return R.fail("事件不存在"); |
| | | } |
| | | boolean canDealByUser = (eventDO.getEventStatus() == 2||eventDO.getEventStatus()==4) && eventDO.getEventProcessStatus() == 1; |
| | | boolean canDealByUser = |
| | | (eventDO.getEventStatus() == 2 || eventDO.getEventStatus() == 4) && eventDO.getEventProcessStatus() == 1; |
| | | if (!canDealByUser) { |
| | | if (eventDO.getEventStatus() != 2 ) { |
| | | if (eventDO.getEventStatus() != 2) { |
| | | return R.fail("事件不是发布/待处理状态"); |
| | | } |
| | | if (eventDO.getEventProcessStatus() != 1) { |
| | |
| | | return R.fail("事件当前不可自处理"); |
| | | } |
| | | |
| | | eventDO.setEventProcessStatus(2);//2已解决 |
| | | eventDO.setEventProcessStatus(2);// 2已解决 |
| | | eventDO.setUpdateBy(commonEventDealDTO.getUserId()); |
| | | |
| | | //更新处理信息 |
| | | // 更新处理信息 |
| | | eventDO.setProcessUserId(commonEventDealDTO.getUserId()); |
| | | eventDO.setProcessUserName(commonEventDealDTO.getUserName()); |
| | | eventDO.setProcessDate(new Date()); |
| | |
| | | processType = 1; |
| | | } |
| | | EventTransferRecordDO transferRecordDO = |
| | | addTransferRecord(eventDO.getId(), commonEventDealDTO.getUserId(), commonEventDealDTO.getUserName(), 1, "网格员自处理完成", commonEventDealDTO.getUserId(), commonEventDealDTO.getUserName(), processType); |
| | | addTransferRecord(eventDO.getId(), commonEventDealDTO.getUserId(), commonEventDealDTO.getUserName(), 1, |
| | | "网格员自处理完成", commonEventDealDTO.getUserId(), commonEventDealDTO.getUserName(), processType); |
| | | if (transferRecordDO != null && transferRecordDO.getId() != null) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventDealDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(3); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventDealDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(3); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventDealDTO.getPics())) { |
| | | String[] pica = commonEventDealDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R verifyEvent(CommonEventVerifyDTO commonEventVerifyDTO) { |
| | | EventDO eventDO = this.getBaseMapper().selectById(commonEventVerifyDTO.getId()); |
| | |
| | | return R.fail("当前处理对象不是网格员"); |
| | | } |
| | | |
| | | eventDO.setEventProcessStatus(2);//2已解决 |
| | | eventDO.setEventProcessStatus(2);// 2已解决 |
| | | eventDO.setUpdateBy(commonEventVerifyDTO.getUserId()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | return R.fail("更新事件状态失败"); |
| | | } |
| | | addTransferRecord(eventDO.getId(), commonEventVerifyDTO.getUserId(), commonEventVerifyDTO.getUserName(), 1, commonEventVerifyDTO.getProcessResult(), |
| | | commonEventVerifyDTO.getUserId(), commonEventVerifyDTO.getUserName(), 6); |
| | | addTransferRecord(eventDO.getId(), commonEventVerifyDTO.getUserId(), commonEventVerifyDTO.getUserName(), 1, |
| | | commonEventVerifyDTO.getProcessResult(), commonEventVerifyDTO.getUserId(), |
| | | commonEventVerifyDTO.getUserName(), 6); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public R republishEvent(CommonEventRepublishDTO commonEventRepublishDTO) { |
| | | EventDO eventDO = this.getBaseMapper().selectById(commonEventRepublishDTO.getId()); |
| | | //boolean canRepublishByUser = eventDO.getEventStatus() == 4 || eventDO.getEventStatus() == 1; |
| | | boolean canRepublishByUser = eventDO.getEventDealStatus() == 6|eventDO.getEventDealStatus() == 5; //已失效状态 |
| | | // boolean canRepublishByUser = eventDO.getEventStatus() == 4 || eventDO.getEventStatus() == 1; |
| | | boolean canRepublishByUser = eventDO.getEventDealStatus() == 6 | eventDO.getEventDealStatus() == 5; // 已失效状态 |
| | | if (!canRepublishByUser) { |
| | | return R.fail("当前不是撤销/草稿状态"); |
| | | } |
| | | |
| | | if(eventDO.getEventCategory().equals(2L)){//宣传教育 |
| | | if (eventDO.getEventCategory().equals(2L)) {// 宣传教育 |
| | | eventDO.setEventDealStatus(8); |
| | | }else{ |
| | | eventDO.setEventProcessStatus(1); //待解决 |
| | | eventDO.setProcessType(1); //网格员处理 |
| | | } else { |
| | | eventDO.setEventProcessStatus(1); // 待解决 |
| | | eventDO.setProcessType(1); // 网格员处理 |
| | | } |
| | | eventDO.setEventStatus(2);//2 发布 |
| | | eventDO.setEventStatus(2);// 2 发布 |
| | | eventDO.setUpdateBy(commonEventRepublishDTO.getUserId()); |
| | | |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | return R.fail("更新事件状态失败"); |
| | | } |
| | | addTransferRecord(eventDO.getId(), commonEventRepublishDTO.getUserId(), commonEventRepublishDTO.getUserName(), 1, |
| | | "重新发布已撤销事件", commonEventRepublishDTO.getUserId(), commonEventRepublishDTO.getUserName(), 8); |
| | | addTransferRecord(eventDO.getId(), commonEventRepublishDTO.getUserId(), commonEventRepublishDTO.getUserName(), |
| | | 1, "重新发布已撤销事件", commonEventRepublishDTO.getUserId(), commonEventRepublishDTO.getUserName(), 8); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | return R.fail("当前不是草稿状态"); |
| | | } |
| | | eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); |
| | | eventDO.setEventStatus(2);//事件状态 2发布 |
| | | eventDO.setProcessType(1);//当前处理对象类型:网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventProcessStatus(1);//待处理 |
| | | eventDO.setEventStatus(2);// 事件状态 2发布 |
| | | eventDO.setProcessType(1);// 当前处理对象类型:网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setEventProcessStatus(1);// 待处理 |
| | | eventDO.setUpdateBy(commonEventPublicDTO.getUserId()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | |
| | | /** |
| | | * 生成服务单号 |
| | | * |
| | | * @param eventType 事件类型,宣传事件默认为20 |
| | | * @param eventType |
| | | * 事件类型,宣传事件默认为20 |
| | | * @return |
| | | */ |
| | | private String getEventOrderSn(Integer eventType) { |
| | |
| | | eventType = 20; |
| | | } |
| | | String pre = String.format(simpleDateFormat.format(new Date()) + "%02d", eventType); |
| | | Integer todayCount = this.getBaseMapper().selectCount(new LambdaQueryWrapper<EventDO>().likeRight(EventDO::getOrderSn, pre)); |
| | | Integer todayCount = |
| | | this.getBaseMapper().selectCount(new LambdaQueryWrapper<EventDO>().likeRight(EventDO::getOrderSn, pre)); |
| | | String orderSn = String.format(pre + "%04d", todayCount + 1); |
| | | return orderSn; |
| | | } |
| | |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(specialEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(specialEventEditDTO.getUserId()); |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventType(EventType.SPECIAL);//特殊人群信息上报-事件分类 |
| | | eventDO.setEventStatus(1);//事件状态 1草稿 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventType(EventType.SPECIAL);// 特殊人群信息上报-事件分类 |
| | | eventDO.setEventStatus(1);// 事件状态 1草稿 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setCreateBy(specialEventEditDTO.getUserId()); |
| | | eventDO.setEventDealStatus(5);//草稿状态 |
| | | eventDO.setEventDealStatus(5);// 草稿状态 |
| | | if (eventMapper.insert(eventDO) > 0) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(specialEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(specialEventEditDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(specialEventEditDTO.getPics())) { |
| | | String[] pica = specialEventEditDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | } |
| | | rtVal = R.fail(); |
| | | } else { |
| | | //编辑原来的 |
| | | // 编辑原来的 |
| | | EventDO eventDO = eventMapper.selectById(specialEventEditDTO.getId()); |
| | | BeanUtils.copyProperties(specialEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(specialEventEditDTO.getUserId()); |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(1);//事件状态 1草稿 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventStatus(1);// 事件状态 1草稿 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setUpdateBy(specialEventEditDTO.getUserId()); |
| | | eventDO.setEventDealStatus(5);//草稿状态 |
| | | eventDO.setEventDealStatus(5);// 草稿状态 |
| | | if (eventMapper.updateById(eventDO) > 0) { |
| | | int deleted = eventResourceService.getBaseMapper() |
| | | .delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | //添加音频 |
| | | int deleted = eventResourceService.getBaseMapper().delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(specialEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(specialEventEditDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(specialEventEditDTO.getPics())) { |
| | | String[] pica = specialEventEditDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | rtVal = R.fail(); |
| | | } |
| | | if (R.isOk(rtVal)) { |
| | | //TODO 处理特殊人群实有人口数据 |
| | | // TODO 处理特殊人群实有人口数据 |
| | | |
| | | } |
| | | return rtVal; |
| | |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(specialEventAddDTO, eventDO); |
| | | eventDO.setGridMemberId(specialEventAddDTO.getUserId()); |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventType(EventType.SPECIAL);//特殊人群信息上报-事件分类 |
| | | eventDO.setEventStatus(2);//事件状态 2发布 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventType(EventType.SPECIAL);// 特殊人群信息上报-事件分类 |
| | | eventDO.setEventStatus(2);// 事件状态 2发布 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setCreateBy(specialEventAddDTO.getUserId()); |
| | | eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); |
| | | if (eventMapper.insert(eventDO) > 0) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(specialEventAddDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(specialEventAddDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(specialEventAddDTO.getPics())) { |
| | | String[] pica = specialEventAddDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | rtVal = R.fail(); |
| | | |
| | | if (R.isOk(rtVal)) { |
| | | //TODO 处理特殊人群实有人口数据 |
| | | // TODO 处理特殊人群实有人口数据 |
| | | |
| | | addReleaseRecord(eventDO.getId(), specialEventAddDTO.getUserId(), specialEventAddDTO.getUserName()); |
| | | return R.ok(); |
| | |
| | | BeanUtils.copyProperties(publicityEventAddDTO, eventDO); |
| | | eventDO.setHappenTime(publicityEventAddDTO.getPropagandaTime()); |
| | | eventDO.setGridMemberId(publicityEventAddDTO.getUserId()); |
| | | eventDO.setEventCategory(2l);//宣传事件 |
| | | eventDO.setEventStatus(2);//事件状态 2发布 |
| | | eventDO.setEventCategory(2l);// 宣传事件 |
| | | eventDO.setEventStatus(2);// 事件状态 2发布 |
| | | eventDO.setEventType(8); |
| | | eventDO.setGridMemberCommunity(eventGridDataDO.getGridCommunityId()); |
| | | eventDO.setGridMemberStreet(eventGridDataDO.getGridStreetId()); |
| | | if(publicityEventAddDTO.getGridMemberId()!=null) { |
| | | if (publicityEventAddDTO.getGridMemberId() != null) { |
| | | eventDO.setGridMemberId(publicityEventAddDTO.getGridMemberId()); |
| | | }else{ |
| | | } else { |
| | | eventDO.setGridMemberId(publicityEventAddDTO.getUserId()); |
| | | } |
| | | eventDO.setGridMemberName(publicityEventAddDTO.getUserName()); |
| | |
| | | eventDO.setCreateBy(publicityEventAddDTO.getUserId()); |
| | | eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); |
| | | if (eventMapper.insert(eventDO) == 1) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(publicityEventAddDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(publicityEventAddDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(publicityEventAddDTO.getPics())) { |
| | | String[] pica = publicityEventAddDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(publicityEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(publicityEventEditDTO.getUserId()); |
| | | eventDO.setEventCategory(2l);//宣传事件 |
| | | eventDO.setEventStatus(1);//事件状态 1草稿 |
| | | eventDO.setEventCategory(2l);// 宣传事件 |
| | | eventDO.setEventStatus(1);// 事件状态 1草稿 |
| | | eventDO.setCreateBy(publicityEventEditDTO.getUserId()); |
| | | eventDO.setGridMemberId(publicityEventEditDTO.getUserId()); |
| | | eventDO.setGridMemberName(publicityEventEditDTO.getUserName()); |
| | | eventDO.setGridMemberTelephone(publicityEventEditDTO.getPhone()); |
| | | eventDO.setEventDealStatus(5);//草稿状态 |
| | | eventDO.setEventDealStatus(5);// 草稿状态 |
| | | eventDO.setEventType(8); |
| | | if (eventMapper.insert(eventDO) > 0) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(publicityEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(publicityEventEditDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(publicityEventEditDTO.getPics())) { |
| | | String[] pica = publicityEventEditDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | } |
| | | return R.fail(); |
| | | } else { |
| | | //编辑原来的 |
| | | // 编辑原来的 |
| | | EventDO eventDO = eventMapper.selectById(publicityEventEditDTO.getId()); |
| | | if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 && eventDO.getEventDealStatus() != 6) { |
| | | if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 |
| | | && eventDO.getEventDealStatus() != 6) { |
| | | return R.fail("保存草稿失败,事件不是草稿/撤销状态"); |
| | | } |
| | | BeanUtils.copyProperties(publicityEventEditDTO, eventDO); |
| | | eventDO.setGridMemberId(publicityEventEditDTO.getUserId()); |
| | | eventDO.setEventCategory(2L);//宣传事件 |
| | | eventDO.setEventStatus(1);//事件状态 1草稿 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventCategory(2L);// 宣传事件 |
| | | eventDO.setEventStatus(1);// 事件状态 1草稿 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setUpdateBy(publicityEventEditDTO.getUserId()); |
| | | eventDO.setEventDealStatus(5);//草稿状态 |
| | | eventDO.setEventDealStatus(5);// 草稿状态 |
| | | if (eventMapper.updateById(eventDO) > 0) { |
| | | int deleted = eventResourceService.getBaseMapper() |
| | | .delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | //添加音频 |
| | | int deleted = eventResourceService.getBaseMapper().delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(publicityEventEditDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(publicityEventEditDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(publicityEventEditDTO.getPics())) { |
| | | String[] pica = publicityEventEditDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | List<EventVO> eventVOList = ipage.getRecords(); |
| | | eventVOList.forEach(eventVO -> { |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventVO.getId()) |
| | | ); |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventVO.getId())); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | |
| | | eventVO.setAudios(audioList); |
| | | eventVO.setPics(picList); |
| | | eventVO.setVideos(videoList); |
| | | //查询网格员头像 |
| | | Map<String,String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId()); |
| | | // 查询网格员头像 |
| | | Map<String, String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId()); |
| | | if (StringUtils.isNotEmpty(userMap)) { |
| | | eventVO.setGridMemberName(userMap.get("nick_name")); |
| | | eventVO.setGridMemberImageUrl(userMap.get("image_url")); |
| | |
| | | |
| | | @Override |
| | | public R eventToManage(PageEventManageDTO pageEventManageDTO) { |
| | | //查询管理事件 |
| | | // 查询管理事件 |
| | | Page page = new Page(1, 10); |
| | | if (pageEventManageDTO.getPageNum() != null) { |
| | | page.setCurrent(pageEventManageDTO.getPageNum()); |
| | |
| | | List<EventVO> eventVOList = ipage.getRecords(); |
| | | eventVOList.forEach(eventVO -> { |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventVO.getId()) |
| | | ); |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventVO.getId())); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | |
| | | eventVO.setPics(picList); |
| | | eventVO.setVideos(videoList); |
| | | |
| | | //查询网格员头像 |
| | | Map<String,String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId()); |
| | | // 查询网格员头像 |
| | | Map<String, String> userMap = eventMapper.getGridMemberImageUrl(eventVO.getGridMemberId()); |
| | | if (StringUtils.isNotEmpty(userMap)) { |
| | | eventVO.setGridMemberName(userMap.get("nick_name")); |
| | | eventVO.setGridMemberImageUrl(userMap.get("image_url")); |
| | |
| | | } |
| | | if (eventDO.getEventCategory() != null) { |
| | | if (eventDO.getEventCategory() == 1) { |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 3; //上报状态 |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 3; // 上报状态 |
| | | if (!canRevoke) { |
| | | return R.fail("当前事件不是上报状态,不允许撤销"); |
| | | } |
| | | } else if (eventDO.getEventCategory() == 2) { |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 8; //发布状态 |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 8; // 发布状态 |
| | | if (!canRevoke) { |
| | | return R.fail("当前事件不是发布状态,不允许撤销"); |
| | | } |
| | |
| | | return R.fail("事件所属错误"); |
| | | } |
| | | eventDO.setInvalid(false); |
| | | //标为无效后, 交给网格员处理 |
| | | // 标为无效后, 交给网格员处理 |
| | | eventDO.setUpdateBy(eventRevokeDTO.getUserId()); |
| | | eventDO.setEventStatus(4);//4、撤销 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventStatus(4);// 4、撤销 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | eventDO.setRevokeId(eventRevokeDTO.getRevokeId()); |
| | | eventDO.setRevokeType(eventRevokeDTO.getRevokeType()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated == 1) { |
| | | addTransferRecord(eventDO.getId(), eventRevokeDTO.getUserId(), eventRevokeDTO.getUserName(), 1, "标为无效", eventRevokeDTO.getCommunityId(), eventRevokeDTO.getCommunityName(), 4); |
| | | addTransferRecord(eventDO.getId(), eventRevokeDTO.getUserId(), eventRevokeDTO.getUserName(), 1, "标为无效", |
| | | eventRevokeDTO.getCommunityId(), eventRevokeDTO.getCommunityName(), 4); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | if (eventDO == null) { |
| | | return R.fail("事件不存在"); |
| | | } |
| | | boolean canRepulish = eventDO.getEventDealStatus() == 7|eventDO.getEventDealStatus() == 5; //已失效状态 |
| | | boolean canRepulish = eventDO.getEventDealStatus() == 7 | eventDO.getEventDealStatus() == 5; // 已失效状态 |
| | | if (!canRepulish) { |
| | | return R.fail("当前事件不是已失效状态/草稿状态,不能重新发布"); |
| | | } |
| | | eventDO.setInvalid(true); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated == 1) { |
| | | addTransferRecord(eventDO.getId(), commonEventRepublishDTO.getUserId(), commonEventRepublishDTO.getUserName(), 1, "重新发布事件成功", |
| | | commonEventRepublishDTO.getUserId(), commonEventRepublishDTO.getUserName(), 9); |
| | | addTransferRecord(eventDO.getId(), commonEventRepublishDTO.getUserId(), |
| | | commonEventRepublishDTO.getUserName(), 1, "重新发布事件成功", commonEventRepublishDTO.getUserId(), |
| | | commonEventRepublishDTO.getUserName(), 9); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | |
| | | return R.fail("事件当前不是上报状态"); |
| | | } |
| | | |
| | | List<EventTransferRecordDO> list = eventTransferRecordService.getBaseMapper().selectList(new LambdaQueryWrapper<EventTransferRecordDO>() |
| | | .eq(EventTransferRecordDO::getEventId, eventDO.getId()) |
| | | .orderByDesc(EventTransferRecordDO::getCreateAt) |
| | | ); |
| | | List<EventTransferRecordDO> list = eventTransferRecordService.getBaseMapper().selectList( |
| | | new LambdaQueryWrapper<EventTransferRecordDO>().eq(EventTransferRecordDO::getEventId, eventDO.getId()) |
| | | .orderByDesc(EventTransferRecordDO::getCreateAt)); |
| | | |
| | | Long reportToInDB = -1L; |
| | | for (int i = 0; i < list.size(); i++) { |
| | |
| | | return R.fail("用户上报的社区不是当前社区"); |
| | | } |
| | | if (commonEventDealDTO.getNeedVerify()) { |
| | | eventDO.setEventProcessStatus(3);//待验证状态 |
| | | eventDO.setProcessType(1);//交给网格员处理-验证 |
| | | eventDO.setEventProcessStatus(3);// 待验证状态 |
| | | eventDO.setProcessType(1);// 交给网格员处理-验证 |
| | | } else { |
| | | eventDO.setEventProcessStatus(2);//2已解决 |
| | | eventDO.setEventProcessStatus(2);// 2已解决 |
| | | } |
| | | eventDO.setUpdateBy(commonEventDealDTO.getUserId()); |
| | | |
| | | //更新处理信息 |
| | | // 更新处理信息 |
| | | eventDO.setProcessUserId(commonEventDealDTO.getUserId()); |
| | | eventDO.setProcessUserName(commonEventDealDTO.getUserName()); |
| | | eventDO.setProcessDate(new Date()); |
| | |
| | | return R.fail("更新事件状态失败"); |
| | | } |
| | | EventTransferRecordDO transferRecordDO = |
| | | addTransferRecord(eventDO.getId(), commonEventDealDTO.getUserId(), commonEventDealDTO.getUserName(), 1, |
| | | "社区处理完成", commonEventDealDTO.getCommunityId(), commonEventDealDTO.getCommunityName(), 3); |
| | | addTransferRecord(eventDO.getId(), commonEventDealDTO.getUserId(), commonEventDealDTO.getUserName(), 1, |
| | | "社区处理完成", commonEventDealDTO.getCommunityId(), commonEventDealDTO.getCommunityName(), 3); |
| | | if (transferRecordDO != null && transferRecordDO.getId() != null) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventDealDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(3); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventDealDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(3); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventDealDTO.getPics())) { |
| | | String[] pica = commonEventDealDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | List<EventVO> eventVOList = ipage.getRecords(); |
| | | eventVOList.forEach(eventVO -> { |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventVO.getId()) |
| | | ); |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventVO.getId())); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | |
| | | /** |
| | | * 添加发布事件流转记录 |
| | | * |
| | | * @param eventId 事件ID |
| | | * @param userId 操作用户ID |
| | | * @param userName 操作用户姓名 |
| | | * @param eventId |
| | | * 事件ID |
| | | * @param userId |
| | | * 操作用户ID |
| | | * @param userName |
| | | * 操作用户姓名 |
| | | * @return 添加成功返回true, 否则返回false |
| | | */ |
| | | private EventTransferRecordDO addReleaseRecord(Long eventId, Long userId, String userName) { |
| | |
| | | eventTransferRecordDO.setProcessDate(new Date()); |
| | | eventTransferRecordDO.setEventId(eventId); |
| | | eventTransferRecordDO.setProcessResult("发布成功"); |
| | | eventTransferRecordDO.setProcessType(0);//初始状态 |
| | | eventTransferRecordDO.setProcessType(0);// 初始状态 |
| | | int inserted = eventTransferRecordService.getBaseMapper().insert(eventTransferRecordDO); |
| | | if (inserted != 1) { |
| | | throw new ServiceException("事件流转记录添加失败"); |
| | |
| | | return eventTransferRecordDO; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询最后的流转记录,并添加事件流转记录 |
| | | * |
| | | * @param eventId 事件ID |
| | | * @param toId 流转到 ID |
| | | * @param toName 流转到 名称 |
| | | * @param toType 发送类型 |
| | | * @param msg 流转消息 |
| | | * @param eventId |
| | | * 事件ID |
| | | * @param toId |
| | | * 流转到 ID |
| | | * @param toName |
| | | * 流转到 名称 |
| | | * @param toType |
| | | * 发送类型 |
| | | * @param msg |
| | | * 流转消息 |
| | | * @return |
| | | */ |
| | | private EventTransferRecordDO addTransferRecord(Long eventId, Long toId, String toName, Integer toType, String msg, Long processBy, String processByName, Integer processType) { |
| | | List<EventTransferRecordDO> list = eventTransferRecordService.getBaseMapper().selectList(new LambdaQueryWrapper<EventTransferRecordDO>() |
| | | .eq(EventTransferRecordDO::getEventId, eventId) |
| | | .orderByDesc(EventTransferRecordDO::getCreateAt) |
| | | ); |
| | | private EventTransferRecordDO addTransferRecord(Long eventId, Long toId, String toName, Integer toType, String msg, |
| | | Long processBy, String processByName, Integer processType) { |
| | | List<EventTransferRecordDO> list = |
| | | eventTransferRecordService.getBaseMapper().selectList(new LambdaQueryWrapper<EventTransferRecordDO>() |
| | | .eq(EventTransferRecordDO::getEventId, eventId).orderByDesc(EventTransferRecordDO::getCreateAt)); |
| | | EventTransferRecordDO eventTransferRecordDO = new EventTransferRecordDO(); |
| | | if (list != null && list.size() > 0) { |
| | | EventTransferRecordDO lastRecord = list.get(0); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询最后的流转记录,并添加事件流转记录 |
| | | * @param eventId 事件ID |
| | | * @param toId 流转到 ID |
| | | * @param toName 流转到 名称 |
| | | * @param toType 发送类型 |
| | | * @param msg 流转消息 |
| | | * |
| | | * @param eventId |
| | | * 事件ID |
| | | * @param toId |
| | | * 流转到 ID |
| | | * @param toName |
| | | * 流转到 名称 |
| | | * @param toType |
| | | * 发送类型 |
| | | * @param msg |
| | | * 流转消息 |
| | | * @return |
| | | */ |
| | | /* private EventTransferRecordDO addTransferRecord(Long eventId, Long toId, String toName, Integer toType, String msg,Integer processType){ |
| | | /* private EventTransferRecordDO addTransferRecord(Long eventId, Long toId, String toName, Integer toType, String msg,Integer processType){ |
| | | return addTransferRecord(eventId, toId, toName, toType, msg, null, null, processType); |
| | | }*/ |
| | | |
| | | /** |
| | | * 根据子状态 查询用户事件处理状态 |
| | | * |
| | | * @param eventId 事件ID |
| | | * @param eventId |
| | | * 事件ID |
| | | */ |
| | | private EventDO updateEventDealStatus(Long eventId) { |
| | | EventDO eventDO = this.getBaseMapper().selectById(eventId); |
| | |
| | | /** |
| | | * 根据子状态 查询用户事件处理状态 |
| | | * |
| | | * @param eventDO 事件 |
| | | * @param eventDO |
| | | * 事件 |
| | | */ |
| | | private Integer getEventDealStatus(EventDO eventDO) { |
| | | //1 待处理、2 待验证、3 已上报、4 已解决、5 草稿箱、6已撤销、7已失效、8已发布 |
| | | // 1 待处理、2 待验证、3 已上报、4 已解决、5 草稿箱、6已撤销、7已失效、8已发布 |
| | | if (eventDO.getEventCategory() != null) { |
| | | if (eventDO.getEventCategory() == 1) { |
| | | Integer event_status = eventDO.getEventStatus() != null ? eventDO.getEventStatus() : -1; |
| | | Integer event_process_status = eventDO.getEventProcessStatus() != null ? eventDO.getEventProcessStatus() : -1; |
| | | Integer event_process_status = |
| | | eventDO.getEventProcessStatus() != null ? eventDO.getEventProcessStatus() : -1; |
| | | Integer process_type = eventDO.getProcessType() != null ? eventDO.getProcessType() : -1; |
| | | Integer community_process = eventDO.getCommunityProcess() != null ? eventDO.getCommunityProcess() : -1; |
| | | |
| | |
| | | }*/ |
| | | if (event_status == 1) { |
| | | eventDealStatus = 5; |
| | | //"草稿箱" |
| | | // "草稿箱" |
| | | } else if (event_status == 4) { |
| | | eventDealStatus = 6; |
| | | //"已撤销" |
| | | // "已撤销" |
| | | } else if (event_status == 2) { |
| | | if (event_process_status == 3) { |
| | | eventDealStatus = 2; |
| | | //"待验证" |
| | | // "待验证" |
| | | } else if (event_process_status == 2) { |
| | | eventDealStatus = 4; |
| | | //"已解决" |
| | | // "已解决" |
| | | } else if (community_process == 1 && process_type == 2) { |
| | | eventDealStatus = 3; |
| | | //"已上报" |
| | | // "已上报" |
| | | } else if (event_process_status == 1 && process_type == 1) { |
| | | eventDealStatus = 1; |
| | | //"待处理" |
| | | // "待处理" |
| | | } |
| | | } |
| | | return eventDealStatus; |
| | |
| | | Integer event_status = eventDO.getEventStatus(); |
| | | if (event_status != null && event_status == 1) { |
| | | return 5; |
| | | //"草稿箱" |
| | | // "草稿箱" |
| | | } else if (event_status != null && event_status == 2) { |
| | | return 8; |
| | | //已发布 |
| | | // 已发布 |
| | | } else if (event_status != null && event_status == 4) { |
| | | return 6; |
| | | //"已撤销" |
| | | // "已撤销" |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 后台管理-统计模块 |
| | | * |
| | | * @param communityId 社区id |
| | | * @param communityId |
| | | * 社区id |
| | | * @return 统计信息 |
| | | */ |
| | | @Override |
| | |
| | | /** |
| | | * 后台管理-网格员统计 |
| | | * |
| | | * @param statisticsAdminDTO 请求参数 |
| | | * @param statisticsAdminDTO |
| | | * 请求参数 |
| | | * @return 网格员统计信息 |
| | | */ |
| | | @Override |
| | | public R gridMemberStatistics(MemberStatisticsAdminDTO statisticsAdminDTO) { |
| | | return R.ok(eventGridMemberRelationMapper.gridMemberStatistics(new Page(statisticsAdminDTO.getPageNum(), statisticsAdminDTO.getPageSize()), statisticsAdminDTO)); |
| | | return R.ok(eventGridMemberRelationMapper.gridMemberStatistics( |
| | | new Page(statisticsAdminDTO.getPageNum(), statisticsAdminDTO.getPageSize()), statisticsAdminDTO)); |
| | | } |
| | | |
| | | @Override |
| | | public R getNearByGrid(PageEventGridNearbyDTO pageEventGridNearbyDTO) { |
| | | Page page = new Page(pageEventGridNearbyDTO.getPageNum(), pageEventGridNearbyDTO.getPageSize()); |
| | | String latLng = pageEventGridNearbyDTO.getHappentLatLng(); |
| | | // if(!latLng.matches("^[\\-\\+]?(0(\\.\\d{1,10})?|([1-9](\\d)?)(\\.\\d{1,10})?|1[0-7]\\d{1}(\\.\\d{1,10})?|180\\.0{1,10}),[\\-\\+]?((0|([1-8]\\d?))(\\.\\d{1,10})?|90(\\.0{1,10})?)$")){ |
| | | // return R.fail("经纬度参数错误"); |
| | | // } |
| | | //经纬度匹配规则:(短(纬度)在前长(经度)在后,不要擅自修改此规则,否则出现问题后果自负) |
| | | // if(!latLng.matches("[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?")){ |
| | | // return R.fail("经纬度参数错误"); |
| | | // } |
| | | String latLngArr[] = latLng.split(","); |
| | | // if(!latLng.matches("^[\\-\\+]?(0(\\.\\d{1,10})?|([1-9](\\d)?)(\\.\\d{1,10})?|1[0-7]\\d{1}(\\.\\d{1,10})?|180\\.0{1,10}),[\\-\\+]?((0|([1-8]\\d?))(\\.\\d{1,10})?|90(\\.0{1,10})?)$")){ |
| | | // return R.fail("经纬度参数错误"); |
| | | // } |
| | | // 经纬度匹配规则:(短(纬度)在前长(经度)在后,不要擅自修改此规则,否则出现问题后果自负) |
| | | // if(!latLng.matches("[1-9][0-9](\\.[0-9]{1,6})?,[1-9][0-9]{2}(\\.[0-9]{1,6})?")){ |
| | | // return R.fail("经纬度参数错误"); |
| | | // } |
| | | String[] latLngArr = latLng.split(","); |
| | | try { |
| | | Double lat = Double.valueOf(latLngArr[1]); |
| | | Double lng = Double.valueOf(latLngArr[0]); |
| | | List<EventGridDataAreaVO> gridList = |
| | | eventGridDataMapper.selectGridWithArea(page, pageEventGridNearbyDTO); |
| | | List<EventGridDataAreaVO> gridList = eventGridDataMapper.selectGridWithArea(page, pageEventGridNearbyDTO); |
| | | if (gridList != null && gridList.size() > 0) { |
| | | List<EventGridDataVO> rtEventGridList = new ArrayList<>(); |
| | | for (EventGridDataAreaVO eventGridDataDO : gridList) { |
| | | String data = eventGridDataDO.getData(); |
| | | if(data!=null) { |
| | | if (data != null) { |
| | | List<LatLngVO> latLngList = LngLatUtils.getLatLngFromText(data); |
| | | boolean inGrid = LngLatUtils.isInPolygon(latLngList, lng, lat); |
| | | if (inGrid) { |
| | |
| | | } else { |
| | | return R.ok("未找到社区"); |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | |
| | | if (eventDO == null) { |
| | | throw new ServiceException("id为" + id + "的事件不存在"); |
| | | } |
| | | if (eventDO.getEventStatus() != null && |
| | | (eventDO.getEventStatus().intValue() == 1 || eventDO.getEventStatus().intValue() == 4)) {//草稿 或者 已撤销 的事件可以删除 |
| | | eventDO.setEventStatus(3);//逻辑删除 |
| | | if (eventDO.getEventStatus() != null |
| | | && (eventDO.getEventStatus().intValue() == 1 || eventDO.getEventStatus().intValue() == 4)) {// 草稿 |
| | | // 或者 |
| | | // 已撤销 |
| | | // 的事件可以删除 |
| | | eventDO.setEventStatus(3);// 逻辑删除 |
| | | eventDO.setUpdateBy(userId); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | throw new ServiceException("删除事件失败"); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | throw new ServiceException("事件ID错误,删除失败"); |
| | | } |
| | | } |
| | |
| | | Long eventId = -1L; |
| | | try { |
| | | eventId = Long.parseLong(id); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | throw new ServiceException("事件ID错误,发布失败"); |
| | | } |
| | | EventDO eventDO = this.getBaseMapper().selectById(eventId); |
| | | if (eventDO == null) { |
| | | throw new ServiceException("id为" + id + "的事件不存在"); |
| | | } |
| | | boolean canRepublishByUser = eventDO.getEventDealStatus() != null && |
| | | (eventDO.getEventDealStatus() == 5 || eventDO.getEventDealStatus() == 6); |
| | | boolean canRepublishByUser = eventDO.getEventDealStatus() != null |
| | | && (eventDO.getEventDealStatus() == 5 || eventDO.getEventDealStatus() == 6); |
| | | if (!canRepublishByUser) { |
| | | throw new ServiceException("当前不是撤销/草稿状态"); |
| | | } |
| | | eventDO.setEventStatus(2);//2 发布 |
| | | eventDO.setEventProcessStatus(1); //待解决 |
| | | eventDO.setProcessType(1); //网格员处理 |
| | | eventDO.setEventStatus(2);// 2 发布 |
| | | eventDO.setEventProcessStatus(1); // 待解决 |
| | | eventDO.setProcessType(1); // 网格员处理 |
| | | eventDO.setUpdateBy(userId); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | throw new ServiceException("更新事件状态失败"); |
| | | } |
| | | addTransferRecord(eventDO.getId(), userId, userName, 1, |
| | | "重新发布已撤销事件", userId, userName, 8); |
| | | addTransferRecord(eventDO.getId(), userId, userName, 1, "重新发布已撤销事件", userId, userName, 8); |
| | | } |
| | | return R.ok(); |
| | | } else { |
| | |
| | | Long eventId = -1L; |
| | | try { |
| | | eventId = Long.parseLong(id); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | throw new ServiceException("事件ID错误,不能标记失效"); |
| | | } |
| | | EventDO eventDO = this.getBaseMapper().selectById(eventId); |
| | |
| | | } |
| | | if (eventDO.getEventCategory() != null) { |
| | | if (eventDO.getEventCategory() == 1) {// |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 3; //上报状态 |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 3; // 上报状态 |
| | | if (!canRevoke) { |
| | | throw new ServiceException("当前事件不是上报状态,不允许撤销"); |
| | | } |
| | | } else if (eventDO.getEventCategory() == 2) {//宣传教育 |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 8; //发布状态 |
| | | } else if (eventDO.getEventCategory() == 2) {// 宣传教育 |
| | | boolean canRevoke = eventDO.getEventDealStatus() == 8; // 发布状态 |
| | | if (!canRevoke) { |
| | | throw new ServiceException("当前事件不是发布状态,不允许撤销"); |
| | | } |
| | |
| | | throw new ServiceException("事件所属错误"); |
| | | } |
| | | eventDO.setInvalid(false); |
| | | //标为无效后, 交给网格员处理 |
| | | // 标为无效后, 交给网格员处理 |
| | | eventDO.setUpdateBy(userId); |
| | | eventDO.setEventStatus(4);//4、撤销 |
| | | eventDO.setProcessType(1);//网格员处理 |
| | | eventDO.setCommunityProcess(0);//非 社区处理 |
| | | eventDO.setEventStatus(4);// 4、撤销 |
| | | eventDO.setProcessType(1);// 网格员处理 |
| | | eventDO.setCommunityProcess(0);// 非 社区处理 |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated == 1) { |
| | | addTransferRecord(eventDO.getId(), userId, userName, 1, "标为无效", communityId, communityName, 4); |
| | |
| | | |
| | | /** |
| | | * 根据网格id查询网格统计数据 |
| | | * @param gridId 网格id |
| | | * @return 网格统计数据 |
| | | * |
| | | * @param gridId |
| | | * 网格id |
| | | * @return 网格统计数据 |
| | | */ |
| | | @Override |
| | | public R getGridEventStatisticsByApp(Long gridId,Long userId){ |
| | | public R getGridEventStatisticsByApp(Long gridId, Long userId) { |
| | | GridEventStatisticsVO result = this.baseMapper.getGridEventStatisticsByApp(gridId); |
| | | if(result != null){ |
| | | if (result != null) { |
| | | result.setTodayNum(result.getTodayNum() + result.getZfTodayNum()); |
| | | result.setMonthNum(result.getMonthNum() + result.getZfMonthNum()); |
| | | |
| | | //查询当前网格员下管理的楼栋名称 |
| | | List<Map<String,Object>> buildNameList = this.baseMapper.getMemberBuildName(userId); |
| | | // 查询当前网格员下管理的楼栋名称 |
| | | List<Map<String, Object>> buildNameList = this.baseMapper.getMemberBuildName(userId); |
| | | Integer specialTotal = 0; |
| | | if(!buildNameList.isEmpty()){ |
| | | for (Map<String,Object> buildMap:buildNameList) { |
| | | if (!buildNameList.isEmpty()) { |
| | | for (Map<String, Object> buildMap : buildNameList) { |
| | | String buildName = buildMap.get("name").toString(); |
| | | Long villageId = Long.parseLong(buildMap.get("village_id").toString()); |
| | | Integer num = this.baseMapper.getPopulationByLabelCount(buildName,villageId); |
| | | Integer num = this.baseMapper.getPopulationByLabelCount(buildName, villageId); |
| | | specialTotal += num; |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询网格事件统计数据 |
| | | * @param statisticsDTO 请求参数 |
| | | * @return 网格事件统计数据 |
| | | * |
| | | * @param statisticsDTO |
| | | * 请求参数 |
| | | * @return 网格事件统计数据 |
| | | */ |
| | | @Override |
| | | public R getGridEventDetailStatisticsByApp(GridEventStatisticsDTO statisticsDTO){ |
| | | GridEventStatisticsDetailVO statisticsDetailVO = this.baseMapper.getGridEventDetailStatisticsByApp(statisticsDTO); |
| | | if(statisticsDetailVO == null){ |
| | | public R getGridEventDetailStatisticsByApp(GridEventStatisticsDTO statisticsDTO) { |
| | | GridEventStatisticsDetailVO statisticsDetailVO = |
| | | this.baseMapper.getGridEventDetailStatisticsByApp(statisticsDTO); |
| | | if (statisticsDetailVO == null) { |
| | | statisticsDetailVO = new GridEventStatisticsDetailVO(); |
| | | } |
| | | |
| | | if(statisticsDetailVO.getEventSSPTotal() == null){ |
| | | if (statisticsDetailVO.getEventSSPTotal() == null) { |
| | | statisticsDetailVO.setEventSSPTotal(0); |
| | | } |
| | | if(statisticsDetailVO.getNoEventSSPTotal() == null){ |
| | | if (statisticsDetailVO.getNoEventSSPTotal() == null) { |
| | | statisticsDetailVO.setNoEventSSPTotal(0); |
| | | } |
| | | if(statisticsDetailVO.getEventZFTotal() == null){ |
| | | if (statisticsDetailVO.getEventZFTotal() == null) { |
| | | statisticsDetailVO.setEventZFTotal(0); |
| | | } |
| | | if(statisticsDetailVO.getNoEventZFTotal() == null){ |
| | | if (statisticsDetailVO.getNoEventZFTotal() == null) { |
| | | statisticsDetailVO.setNoEventZFTotal(0); |
| | | } |
| | | |
| | | //查询网格 |
| | | // 查询网格 |
| | | EventGridDataDO gridDataDO = eventGridDataMapper.selectById(statisticsDTO.getGridId()); |
| | | if(gridDataDO != null){ |
| | | Map<String,Long> sspCountMap = this.baseMapper.getSSPEventTotal(gridDataDO.getGridCommunityId()); |
| | | if(!sspCountMap.isEmpty()){ |
| | | statisticsDetailVO.setEventSSPTotal(sspCountMap.get("eventSSPTotal")!=null?sspCountMap.get("eventSSPTotal").intValue():0); |
| | | statisticsDetailVO.setNoEventSSPTotal(sspCountMap.get("noEventSSPTotal")!=null?sspCountMap.get("noEventSSPTotal").intValue():0); |
| | | if (gridDataDO != null) { |
| | | Map<String, Long> sspCountMap = this.baseMapper.getSSPEventTotal(gridDataDO.getGridCommunityId()); |
| | | if (!sspCountMap.isEmpty()) { |
| | | statisticsDetailVO.setEventSSPTotal( |
| | | sspCountMap.get("eventSSPTotal") != null ? sspCountMap.get("eventSSPTotal").intValue() : 0); |
| | | statisticsDetailVO.setNoEventSSPTotal( |
| | | sspCountMap.get("noEventSSPTotal") != null ? sspCountMap.get("noEventSSPTotal").intValue() : 0); |
| | | } |
| | | } |
| | | |
| | | //统计数据 |
| | | Integer sum = statisticsDetailVO.getEventTFTotal() + statisticsDetailVO.getEventMDTotal() + statisticsDetailVO.getEventZATotal() |
| | | + statisticsDetailVO.getEventBWDTotal() + statisticsDetailVO.getEventTSTotal() + statisticsDetailVO.getEventGGTotal() |
| | | + statisticsDetailVO.getEventXCTotal() + statisticsDetailVO.getEventSSPTotal() + statisticsDetailVO.getEventZFTotal(); |
| | | // 统计数据 |
| | | Integer sum = statisticsDetailVO.getEventTFTotal() + statisticsDetailVO.getEventMDTotal() |
| | | + statisticsDetailVO.getEventZATotal() + statisticsDetailVO.getEventBWDTotal() |
| | | + statisticsDetailVO.getEventTSTotal() + statisticsDetailVO.getEventGGTotal() |
| | | + statisticsDetailVO.getEventXCTotal() + statisticsDetailVO.getEventSSPTotal() |
| | | + statisticsDetailVO.getEventZFTotal(); |
| | | statisticsDetailVO.setSum(sum); |
| | | |
| | | Integer noSum = statisticsDetailVO.getNoEventTFTotal() + statisticsDetailVO.getNoEventMDTotal() + statisticsDetailVO.getNoEventZATotal() |
| | | + statisticsDetailVO.getNoEventBWDTotal() + statisticsDetailVO.getNoEventTSTotal() + statisticsDetailVO.getNoEventGGTotal() |
| | | + statisticsDetailVO.getNoEventSSPTotal() + statisticsDetailVO.getNoEventZFTotal(); |
| | | Integer noSum = statisticsDetailVO.getNoEventTFTotal() + statisticsDetailVO.getNoEventMDTotal() |
| | | + statisticsDetailVO.getNoEventZATotal() + statisticsDetailVO.getNoEventBWDTotal() |
| | | + statisticsDetailVO.getNoEventTSTotal() + statisticsDetailVO.getNoEventGGTotal() |
| | | + statisticsDetailVO.getNoEventSSPTotal() + statisticsDetailVO.getNoEventZFTotal(); |
| | | statisticsDetailVO.setNoSum(noSum); |
| | | return R.ok(statisticsDetailVO); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R reportDirect(CommonEventDirectReportDTO commonEventDirectReportDTO) { |
| | | |
| | | if(commonEventDirectReportDTO.getEventId()!=null){ |
| | | //编辑原来的 |
| | | if (commonEventDirectReportDTO.getEventId() != null) { |
| | | // 编辑原来的 |
| | | EventDO eventDO = eventMapper.selectById(commonEventDirectReportDTO.getEventId()); |
| | | if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 && eventDO.getEventDealStatus() != 6) { |
| | | if (eventDO.getEventStatus() != null && eventDO.getEventStatus() != 1 |
| | | && eventDO.getEventDealStatus() != 6) { |
| | | return R.fail("保存草稿失败,事件不是草稿/已撤销状态"); |
| | | } |
| | | BeanUtils.copyProperties(commonEventDirectReportDTO, eventDO); |
| | | eventDO.setGridMemberId(commonEventDirectReportDTO.getUserId()); |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(1);//事件状态 2发布 |
| | | eventDO.setProcessType(2);//社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventStatus(1);// 事件状态 2发布 |
| | | eventDO.setProcessType(2);// 社区处理 |
| | | eventDO.setCommunityProcess(1);// 社区处理 |
| | | eventDO.setUpdateBy(commonEventDirectReportDTO.getUserId()); |
| | | if (eventMapper.updateById(eventDO) > 0) { |
| | | int deleted = eventResourceService.getBaseMapper() |
| | | .delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | //添加音频 |
| | | int deleted = eventResourceService.getBaseMapper().delete(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, eventDO.getId())); |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventDirectReportDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventDirectReportDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventDirectReportDTO.getPics())) { |
| | | String[] pica = commonEventDirectReportDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | return R.fail("社区不存在"); |
| | | } |
| | | EventDO eventDOInDB = this.getBaseMapper().selectById(commonEventDirectReportDTO.getEventId()); |
| | | eventDOInDB.setCommunityProcess(1); //社区处理 |
| | | eventDOInDB.setProcessType(2); //当前处理对象: 社区处理 |
| | | eventDOInDB.setCommunityProcess(1); // 社区处理 |
| | | eventDOInDB.setProcessType(2); // 当前处理对象: 社区处理 |
| | | eventDOInDB.setCommunityProcess(1); |
| | | eventDOInDB.setEventProcessStatus(1); //待处理 |
| | | eventDOInDB.setEventProcessStatus(1); // 待处理 |
| | | eventDOInDB.setUpdateBy(commonEventDirectReportDTO.getUserId()); |
| | | eventDOInDB.setSubmitDate(new Date()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | throw new ServiceException("事件状态更新失败"); |
| | | } |
| | | addTransferRecord(eventDO.getId(), commonEventDirectReportDTO.getToId(), comActVO.getName(), 2, commonEventDirectReportDTO.getProcessResult(), |
| | | commonEventDirectReportDTO.getUserId(), commonEventDirectReportDTO.getUserName(), 2); |
| | | addTransferRecord(eventDO.getId(), commonEventDirectReportDTO.getToId(), comActVO.getName(), 2, |
| | | commonEventDirectReportDTO.getProcessResult(), commonEventDirectReportDTO.getUserId(), |
| | | commonEventDirectReportDTO.getUserName(), 2); |
| | | return R.ok(); |
| | | } |
| | | |
| | | }else{ |
| | | } else { |
| | | EventDO eventDO = new EventDO(); |
| | | BeanUtils.copyProperties(commonEventDirectReportDTO, eventDO); |
| | | eventDO.setGridMemberId(commonEventDirectReportDTO.getUserId()); |
| | |
| | | if (eventGridDataDO == null) { |
| | | return R.fail("网格不存在"); |
| | | } |
| | | eventDO.setEventCategory(1l);//办件事件 |
| | | eventDO.setEventStatus(2);//事件状态 2发布 |
| | | eventDO.setProcessType(2);//社区处理 |
| | | eventDO.setCommunityProcess(1);//社区处理 |
| | | eventDO.setEventCategory(1l);// 办件事件 |
| | | eventDO.setEventStatus(2);// 事件状态 2发布 |
| | | eventDO.setProcessType(2);// 社区处理 |
| | | eventDO.setCommunityProcess(1);// 社区处理 |
| | | eventDO.setEventProcessStatus(1); |
| | | eventDO.setGridMemberName(commonEventDirectReportDTO.getUserName()); |
| | | eventDO.setGridMemberTelephone(commonEventDirectReportDTO.getPhone()); |
| | |
| | | eventDO.setSubmitDate(new Date()); |
| | | eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType())); |
| | | if (eventMapper.insert(eventDO) == 1) { |
| | | //添加音频 |
| | | // 添加音频 |
| | | if (StringUtils.isNotEmpty(commonEventDirectReportDTO.getAudio())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加音频失败"); |
| | | } |
| | | } |
| | | //添加视频 |
| | | // 添加视频 |
| | | if (StringUtils.isNotEmpty(commonEventDirectReportDTO.getVideo())) { |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setClassification(1); |
| | |
| | | throw new ServiceException("添加视频失败"); |
| | | } |
| | | } |
| | | //添加图片 |
| | | // 添加图片 |
| | | if (StringUtils.isNotEmpty(commonEventDirectReportDTO.getPics())) { |
| | | String[] pica = commonEventDirectReportDTO.getPics().split(","); |
| | | for (int i = 0; i < pica.length; i++) { |
| | |
| | | } |
| | | } |
| | | } |
| | | addReleaseRecord(eventDO.getId(), commonEventDirectReportDTO.getUserId(), commonEventDirectReportDTO.getUserName()); |
| | | addReleaseRecord(eventDO.getId(), commonEventDirectReportDTO.getUserId(), |
| | | commonEventDirectReportDTO.getUserName()); |
| | | |
| | | R r = communityService.detailCommunity(commonEventDirectReportDTO.getToId()); |
| | | if (!R.isOk(r)) { |
| | |
| | | return R.fail("社区不存在"); |
| | | } |
| | | EventDO eventDOInDB = this.getBaseMapper().selectById(eventDO.getId()); |
| | | eventDOInDB.setCommunityProcess(1); //社区处理 |
| | | eventDOInDB.setProcessType(2); //当前处理对象: 社区处理 |
| | | eventDOInDB.setCommunityProcess(1); // 社区处理 |
| | | eventDOInDB.setProcessType(2); // 当前处理对象: 社区处理 |
| | | eventDOInDB.setCommunityProcess(1); |
| | | eventDOInDB.setEventProcessStatus(1); //待处理 |
| | | eventDOInDB.setEventProcessStatus(1); // 待处理 |
| | | eventDOInDB.setUpdateBy(commonEventDirectReportDTO.getUserId()); |
| | | eventDOInDB.setSubmitDate(new Date()); |
| | | int updated = this.getBaseMapper().updateById(eventDO); |
| | | if (updated != 1) { |
| | | throw new ServiceException("更新突发事件状态更新失败"); |
| | | } |
| | | addTransferRecord(eventDO.getId(), commonEventDirectReportDTO.getToId(), comActVO.getName(), 2, commonEventDirectReportDTO.getProcessResult(), |
| | | commonEventDirectReportDTO.getUserId(), commonEventDirectReportDTO.getUserName(), 2); |
| | | addTransferRecord(eventDO.getId(), commonEventDirectReportDTO.getToId(), comActVO.getName(), 2, |
| | | commonEventDirectReportDTO.getProcessResult(), commonEventDirectReportDTO.getUserId(), |
| | | commonEventDirectReportDTO.getUserName(), 2); |
| | | return R.ok(eventDO.getId()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 事件大屏查询事件列表 |
| | | * @param eventListDTO 请求参数 |
| | | * @return 事件列表 |
| | | * |
| | | * @param eventListDTO |
| | | * 请求参数 |
| | | * @return 事件列表 |
| | | */ |
| | | @Override |
| | | public R getScreenEventList(ScreenEventListDTO eventListDTO) { |
| | | if (eventListDTO.getEventTypes() != null && !eventListDTO.getEventTypes().isEmpty()) { |
| | | eventListDTO.getEventTypes().forEach(eventType -> { |
| | | if(eventType.equals(ScreenEventListDTO.eventType.xc)){ |
| | | if (eventType.equals(ScreenEventListDTO.eventType.xc)) { |
| | | eventListDTO.setEventCategory(null); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(), eventListDTO.getPageSize()), eventListDTO); |
| | | if(!eventPageList.getRecords().isEmpty()){ |
| | | IPage<EventListVO> eventPageList = this.baseMapper |
| | | .getScreenEventList(new Page(eventListDTO.getPageNum(), eventListDTO.getPageSize()), eventListDTO); |
| | | if (!eventPageList.getRecords().isEmpty()) { |
| | | eventPageList.getRecords().forEach(event -> { |
| | | //查询事件关联附件 |
| | | // 查询事件关联附件 |
| | | List<EventResourceDO> eventResourceDOList = |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1) |
| | | .eq(EventResourceDO::getRefId, event.getId()) |
| | | ); |
| | | eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>() |
| | | .eq(EventResourceDO::getClassification, 1).eq(EventResourceDO::getRefId, event.getId())); |
| | | List<EventResourceVO> picList = new ArrayList<>(); |
| | | List<EventResourceVO> audioList = new ArrayList<>(); |
| | | List<EventResourceVO> videoList = new ArrayList<>(); |
| | |
| | | |
| | | /** |
| | | * 特殊人群上报-社区人口数据列表 |
| | | * @param specialPopulationDTO 请求参数 |
| | | * @return 社区人口数据列表 |
| | | * |
| | | * @param specialPopulationDTO |
| | | * 请求参数 |
| | | * @return 社区人口数据列表 |
| | | */ |
| | | @Override |
| | | public R specialPopulationList(PageEventSpecialPopulationDTO specialPopulationDTO) { |
| | | IPage<EventSpecialPopulationVO> specialPopulationVOIPage = this.baseMapper.specialPopulationList(new Page(specialPopulationDTO.getPageNum(), specialPopulationDTO.getPageSize()), specialPopulationDTO); |
| | | if(!specialPopulationVOIPage.getRecords().isEmpty()){ |
| | | IPage<EventSpecialPopulationVO> specialPopulationVOIPage = this.baseMapper.specialPopulationList( |
| | | new Page(specialPopulationDTO.getPageNum(), specialPopulationDTO.getPageSize()), specialPopulationDTO); |
| | | if (!specialPopulationVOIPage.getRecords().isEmpty()) { |
| | | specialPopulationVOIPage.getRecords().forEach(specialPopulation -> { |
| | | try { |
| | | Integer age = IdcardUtil.getAgeByIdCard(specialPopulation.getIdCard()); |
| | | specialPopulation.setAge(age); |
| | | }catch (Exception e){ |
| | | } catch (Exception e) { |
| | | log.error("身份证号码转换年龄失败,人员id:" + specialPopulation.getId()); |
| | | } |
| | | }); |
| | | } |
| | | return R.ok(specialPopulationVOIPage); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<EventDetailsVO> getUnUploadEvent() { |
| | | List<EventDetailsVO> eventDetailsVOList =new ArrayList<>(); |
| | | List<EventDO> unEventList = baseMapper.selectList( |
| | | new QueryWrapper<EventDO>() |
| | | .eq("upload", false) |
| | | .eq("event_process_status", 2) |
| | | ); |
| | | List<EventDetailsVO> eventDetailsVOList = new ArrayList<>(); |
| | | List<EventDO> unEventList = |
| | | baseMapper.selectList(new QueryWrapper<EventDO>().eq("upload", false).eq("event_process_status", 2)); |
| | | unEventList.forEach(eventDO -> { |
| | | eventDetailsVOList.add(eventDetails(eventDO.getId()).getData()); |
| | | }); |
| | |
| | | EventDO event = baseMapper.selectById(id); |
| | | event.setUpload(true); |
| | | baseMapper.updateById(event); |
| | | EventResourceDO eventResourceDO =new EventResourceDO(); |
| | | EventResourceDO eventResourceDO = new EventResourceDO(); |
| | | eventResourceDO.setUpload(true); |
| | | int flag = eventResourceMapper.update(eventResourceDO, new QueryWrapper<EventResourceDO>() |
| | | .eq("ref_id", id)); |
| | | if(flag>0){ |
| | | return true; |
| | | } |
| | | return false; |
| | | int flag = eventResourceMapper.update(eventResourceDO, new QueryWrapper<EventResourceDO>().eq("ref_id", id)); |
| | | return flag > 0; |
| | | } |
| | | |
| | | @Override |
| | | public R eventWork(Long communityId){ |
| | | public R eventWork(Long communityId) { |
| | | EventWorkScreenVO workScreenVO = new EventWorkScreenVO(); |
| | | String date = DateUtils.getDateFormatString(new Date(),moth_format_str); |
| | | Map<String,Long> countMap = this.eventMapper.countByCommunityId(communityId,date); |
| | | if(!countMap.isEmpty()){ |
| | | workScreenVO.setResolvedNum(countMap.get("resolvedNum")== null ? 0L : Long.valueOf(countMap.get("resolvedNum").toString())); |
| | | workScreenVO.setPendingNum(countMap.get("pendingNum")== null ? 0L : Long.valueOf(countMap.get("pendingNum").toString())); |
| | | workScreenVO.setPropagandaNum(countMap.get("propagandaNum")== null ? 13L : Long.valueOf(countMap.get("propagandaNum").toString())); |
| | | String date = DateUtils.getDateFormatString(new Date(), moth_format_str); |
| | | Map<String, Long> countMap = this.eventMapper.countByCommunityId(communityId, date); |
| | | if (!countMap.isEmpty()) { |
| | | workScreenVO.setResolvedNum( |
| | | countMap.get("resolvedNum") == null ? 0L : Long.valueOf(countMap.get("resolvedNum").toString())); |
| | | workScreenVO.setPendingNum( |
| | | countMap.get("pendingNum") == null ? 0L : Long.valueOf(countMap.get("pendingNum").toString())); |
| | | workScreenVO.setPropagandaNum( |
| | | countMap.get("propagandaNum") == null ? 13L : Long.valueOf(countMap.get("propagandaNum").toString())); |
| | | workScreenVO.setCurrentNum(countMap.get("sspCurrentNum") + countMap.get("currentNum")); |
| | | } |
| | | |
| | | //计算处理时间消耗的时间 |
| | | // 计算处理时间消耗的时间 |
| | | DateScreenVO countAvg = this.eventMapper.countByAvgCommunityId(communityId); |
| | | if(countAvg != null){ |
| | | int second = (int) (countAvg.getEndTime().getTime() - countAvg.getStartTime().getTime())/1000; |
| | | if(second > 0){ |
| | | second = second/workScreenVO.getResolvedNum().intValue(); |
| | | if (countAvg != null) { |
| | | int second = (int)(countAvg.getEndTime().getTime() - countAvg.getStartTime().getTime()) / 1000; |
| | | if (second > 0) { |
| | | second = second / workScreenVO.getResolvedNum().intValue(); |
| | | workScreenVO.setAvgCost(second); |
| | | } |
| | | } |
| | | //查询最新事件轮播列表 |
| | | // 查询最新事件轮播列表 |
| | | List<EventDetailWorkVO> eventList = this.eventMapper.getWorkScreenEventList(communityId); |
| | | if(!eventList.isEmpty()){ |
| | | if (!eventList.isEmpty()) { |
| | | workScreenVO.setEventList(eventList); |
| | | } |
| | | |
| | | //统计近半年数据 |
| | | // 统计近半年数据 |
| | | List<EventWorkVO> list = new ArrayList<>(); |
| | | for(EventWorkVO eventWorkVO: listHalfYearByDyn()){ |
| | | EventWorkVO result = this.eventMapper.countByTime(eventWorkVO.getStart(),eventWorkVO.getEnd(),communityId); |
| | | for (EventWorkVO eventWorkVO : listHalfYearByDyn()) { |
| | | EventWorkVO result = |
| | | this.eventMapper.countByTime(eventWorkVO.getStart(), eventWorkVO.getEnd(), communityId); |
| | | result.setEventTotal(result.getEventTotal() + result.getSspTotal()); |
| | | result.setEventAdd(result.getEventAdd() + result.getSspAdd()); |
| | | result.setEventSolve(result.getEventSolve() + result.getSspSolve()); |
| | |
| | | } |
| | | workScreenVO.setList(list); |
| | | |
| | | //查询完成事件统计 |
| | | // 查询完成事件统计 |
| | | EventTypeWorkVO complete = this.eventMapper.getComplete(communityId); |
| | | if(complete != null){ |
| | | if (complete != null) { |
| | | workScreenVO.setComplete(complete); |
| | | } |
| | | //查询未完成事件统计 |
| | | // 查询未完成事件统计 |
| | | EventTypeWorkVO noComplete = this.eventMapper.getNoComplete(communityId); |
| | | if(complete != null){ |
| | | if (complete != null) { |
| | | workScreenVO.setNoComplete(noComplete); |
| | | } |
| | | return R.ok(workScreenVO); |
| | |
| | | |
| | | private List<EventWorkVO> listHalfYearByDyn() { |
| | | List<EventWorkVO> dateList = new ArrayList<>(); |
| | | Date now = new Date(); |
| | | for(int i= 6;i>=1;i--){ |
| | | Date date = DateUtils.getDateM(now,-(i-1)); |
| | | Date now = new Date(); |
| | | for (int i = 6; i >= 1; i--) { |
| | | Date date = DateUtils.getDateM(now, -(i - 1)); |
| | | DateTime endDay = DateUtil.endOfMonth(date); |
| | | |
| | | int m = DateUtil.month(endDay); |
| | | // m++; |
| | | if(m == 12){ |
| | | // m++; |
| | | if (m == 12) { |
| | | m = 0; |
| | | } |
| | | int day = DateUtil.dayOfMonth(endDay); |
| | | int half = day/2; |
| | | String month = DateUtil.format(date,moth_format_str); |
| | | int half = day / 2; |
| | | String month = DateUtil.format(date, moth_format_str); |
| | | EventWorkVO eventWorkVO = new EventWorkVO(); |
| | | eventWorkVO.setMonth(monthStr[m]+"月上旬"); |
| | | eventWorkVO.setStart(month+ "-01 00:00:00"); |
| | | eventWorkVO.setEnd(month+ "-"+half+" 23:59:59"); |
| | | eventWorkVO.setMonth(monthStr[m] + "月上旬"); |
| | | eventWorkVO.setStart(month + "-01 00:00:00"); |
| | | eventWorkVO.setEnd(month + "-" + half + " 23:59:59"); |
| | | dateList.add(eventWorkVO); |
| | | EventWorkVO eventWorkVO1 = new EventWorkVO(); |
| | | eventWorkVO1.setMonth(monthStr[m]+"月下旬"); |
| | | eventWorkVO1.setStart(month+ "-"+half+" 23:59:59"); |
| | | eventWorkVO1.setEnd(DateUtils.getDateFormatString(endDay,"yyyy-MM-dd HH:mm:ss")); |
| | | eventWorkVO1.setMonth(monthStr[m] + "月下旬"); |
| | | eventWorkVO1.setStart(month + "-" + half + " 23:59:59"); |
| | | eventWorkVO1.setEnd(DateUtils.getDateFormatString(endDay, "yyyy-MM-dd HH:mm:ss")); |
| | | dateList.add(eventWorkVO1); |
| | | } |
| | | return dateList; |
| | |
| | | |
| | | /** |
| | | * 绘制多边形统计数据 |
| | | * @param eventListDTO 请求参数 |
| | | * @return 统计数据 |
| | | * |
| | | * @param eventListDTO |
| | | * 请求参数 |
| | | * @return 统计数据 |
| | | */ |
| | | @Override |
| | | public R getCivilDrawList(ScreenDrawEventListDTO eventListDTO){ |
| | | public R getCivilDrawList(ScreenDrawEventListDTO eventListDTO) { |
| | | |
| | | ScreenDrawEventVO drawEventVO = new ScreenDrawEventVO(); |
| | | //返回事件列表结果集 |
| | | // 返回事件列表结果集 |
| | | List<EventGridIncidentStatisticsVO> eventResultList = new ArrayList<>(); |
| | | //返回小区列表结果集 |
| | | // 返回小区列表结果集 |
| | | List<CivilVillageStatisticsVO> villageResultList = new ArrayList<>(); |
| | | //返回事件统计 |
| | | // 返回事件统计 |
| | | EventLeftDownStatisticsVO leftDownStatisticsVO = new EventLeftDownStatisticsVO(); |
| | | //返回人口统计 |
| | | // 返回人口统计 |
| | | ScreenDrawEventPopulationTotalVO drawEventPopulationTotalVO = new ScreenDrawEventPopulationTotalVO(); |
| | | //查询所有事件 |
| | | List<EventGridIncidentStatisticsVO> gridIncidentList = this.baseMapper.getEventListByCommunityId(eventListDTO.getCommunityId()); |
| | | if(!gridIncidentList.isEmpty()){ |
| | | // 查询所有事件 |
| | | List<EventGridIncidentStatisticsVO> gridIncidentList = |
| | | this.baseMapper.getEventListByCommunityId(eventListDTO.getCommunityId()); |
| | | if (!gridIncidentList.isEmpty()) { |
| | | gridIncidentList.forEach(gridIncident -> { |
| | | //拆分事件经纬度 |
| | | Double lng = 0.0;//经度 |
| | | Double lat = 0.0;//纬度 |
| | | String []lngLatString = gridIncident.getLatLng().split(","); |
| | | if(!gridIncident.getType().equals(7)){ |
| | | // 拆分事件经纬度 |
| | | Double lng = 0.0;// 经度 |
| | | Double lat = 0.0;// 纬度 |
| | | String[] lngLatString = gridIncident.getLatLng().split(","); |
| | | if (!gridIncident.getType().equals(7)) { |
| | | lat = Double.parseDouble(lngLatString[0]); |
| | | lng = Double.parseDouble(lngLatString[1]); |
| | | }else { |
| | | } else { |
| | | lat = Double.parseDouble(lngLatString[1]); |
| | | lng = Double.parseDouble(lngLatString[0]); |
| | | } |
| | | |
| | | //判断绘制的图形类型 |
| | | if(eventListDTO.getType().equals(ScreenDrawEventListDTO.type.yx)){ |
| | | //判断这个点是否在圆形范围内 |
| | | if(GisPointUtil.isInCircle(eventListDTO.getCenterLng(),eventListDTO.getCenterLat(),lng,lat,eventListDTO.getRadius())){ |
| | | if(eventResultList.size() <= eventListDTO.getCount()){ |
| | | // 判断绘制的图形类型 |
| | | if (eventListDTO.getType().equals(ScreenDrawEventListDTO.type.yx)) { |
| | | // 判断这个点是否在圆形范围内 |
| | | if (GisPointUtil.isInCircle(eventListDTO.getCenterLng(), eventListDTO.getCenterLat(), lng, lat, |
| | | eventListDTO.getRadius())) { |
| | | if (eventResultList.size() <= eventListDTO.getCount()) { |
| | | eventResultList.add(gridIncident); |
| | | } |
| | | switch (gridIncident.getType()){ |
| | | switch (gridIncident.getType()) { |
| | | case 1: |
| | | leftDownStatisticsVO.setEventZATotal(leftDownStatisticsVO.getEventZATotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventZATotal(leftDownStatisticsVO.getYesEventZATotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventZATotal(leftDownStatisticsVO.getYesEventZATotal() + 1); |
| | | } |
| | | break; |
| | | case 2: |
| | | leftDownStatisticsVO.setEventGGTotal(leftDownStatisticsVO.getEventGGTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventGGTotal(leftDownStatisticsVO.getYesEventGGTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventGGTotal(leftDownStatisticsVO.getYesEventGGTotal() + 1); |
| | | } |
| | | break; |
| | | case 3: |
| | | leftDownStatisticsVO.setEventMDTotal(leftDownStatisticsVO.getEventMDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventMDTotal(leftDownStatisticsVO.getYesEventMDTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventMDTotal(leftDownStatisticsVO.getYesEventMDTotal() + 1); |
| | | } |
| | | break; |
| | | case 4: |
| | | leftDownStatisticsVO.setEventBWDTotal(leftDownStatisticsVO.getEventBWDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventBWDTotal(leftDownStatisticsVO.getYesEventBWDTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventBWDTotal(leftDownStatisticsVO.getYesEventBWDTotal() + 1); |
| | | } |
| | | break; |
| | | case 5: |
| | | leftDownStatisticsVO.setEventTFTotal(leftDownStatisticsVO.getEventTFTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTFTotal(leftDownStatisticsVO.getYesEventTFTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventTFTotal(leftDownStatisticsVO.getYesEventTFTotal() + 1); |
| | | } |
| | | break; |
| | | case 6: |
| | | leftDownStatisticsVO.setEventTSTotal(leftDownStatisticsVO.getEventTSTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTSTotal(leftDownStatisticsVO.getYesEventTSTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventTSTotal(leftDownStatisticsVO.getYesEventTSTotal() + 1); |
| | | } |
| | | break; |
| | | case 7: |
| | | leftDownStatisticsVO.setEventSSPTotal(leftDownStatisticsVO.getEventSSPTotal() + 1); |
| | | if(gridIncident.getStatus().equals(2)){ |
| | | leftDownStatisticsVO.setYesEventSSPTotal(leftDownStatisticsVO.getYesEventSSPTotal() + 1); |
| | | if (gridIncident.getStatus().equals(2)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventSSPTotal(leftDownStatisticsVO.getYesEventSSPTotal() + 1); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | }else{//多边形类型 |
| | | if(GisPointUtil.isInPolygon(lng,lat,eventListDTO.getLngLatList())){ |
| | | if(eventResultList.size() <= eventListDTO.getCount()){ |
| | | } else {// 多边形类型 |
| | | if (GisPointUtil.isInPolygon(lng, lat, eventListDTO.getLngLatList())) { |
| | | if (eventResultList.size() <= eventListDTO.getCount()) { |
| | | eventResultList.add(gridIncident); |
| | | } |
| | | switch (gridIncident.getType()){ |
| | | switch (gridIncident.getType()) { |
| | | case 1: |
| | | leftDownStatisticsVO.setEventZATotal(leftDownStatisticsVO.getEventZATotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventZATotal(leftDownStatisticsVO.getYesEventZATotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventZATotal(leftDownStatisticsVO.getYesEventZATotal() + 1); |
| | | } |
| | | break; |
| | | case 2: |
| | | leftDownStatisticsVO.setEventGGTotal(leftDownStatisticsVO.getEventGGTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventGGTotal(leftDownStatisticsVO.getYesEventGGTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventGGTotal(leftDownStatisticsVO.getYesEventGGTotal() + 1); |
| | | } |
| | | break; |
| | | case 3: |
| | | leftDownStatisticsVO.setEventMDTotal(leftDownStatisticsVO.getEventMDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventMDTotal(leftDownStatisticsVO.getYesEventMDTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventMDTotal(leftDownStatisticsVO.getYesEventMDTotal() + 1); |
| | | } |
| | | break; |
| | | case 4: |
| | | leftDownStatisticsVO.setEventBWDTotal(leftDownStatisticsVO.getEventBWDTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventBWDTotal(leftDownStatisticsVO.getYesEventBWDTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventBWDTotal(leftDownStatisticsVO.getYesEventBWDTotal() + 1); |
| | | } |
| | | break; |
| | | case 5: |
| | | leftDownStatisticsVO.setEventTFTotal(leftDownStatisticsVO.getEventTFTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTFTotal(leftDownStatisticsVO.getYesEventTFTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventTFTotal(leftDownStatisticsVO.getYesEventTFTotal() + 1); |
| | | } |
| | | break; |
| | | case 6: |
| | | leftDownStatisticsVO.setEventTSTotal(leftDownStatisticsVO.getEventTSTotal() + 1); |
| | | if(gridIncident.getStatus().equals(4)){ |
| | | leftDownStatisticsVO.setYesEventTSTotal(leftDownStatisticsVO.getYesEventTSTotal() + 1); |
| | | if (gridIncident.getStatus().equals(4)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventTSTotal(leftDownStatisticsVO.getYesEventTSTotal() + 1); |
| | | } |
| | | break; |
| | | case 7: |
| | | leftDownStatisticsVO.setEventSSPTotal(leftDownStatisticsVO.getEventSSPTotal() + 1); |
| | | if(gridIncident.getStatus().equals(2)){ |
| | | leftDownStatisticsVO.setYesEventSSPTotal(leftDownStatisticsVO.getYesEventSSPTotal() + 1); |
| | | if (gridIncident.getStatus().equals(2)) { |
| | | leftDownStatisticsVO |
| | | .setYesEventSSPTotal(leftDownStatisticsVO.getYesEventSSPTotal() + 1); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | drawEventVO.setGridIncidentList(eventResultList); |
| | | drawEventVO.setLeftDownStatisticsVO(leftDownStatisticsVO); |
| | | |
| | | //查询所有小区 |
| | | List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(eventListDTO.getCommunityId()); |
| | | if(!villageStatisticsList.isEmpty()){ |
| | | // 查询所有小区 |
| | | List<CivilVillageStatisticsVO> villageStatisticsList = |
| | | this.baseMapper.getCivilScreenVillageList(eventListDTO.getCommunityId()); |
| | | if (!villageStatisticsList.isEmpty()) { |
| | | villageStatisticsList.forEach(village -> { |
| | | //判断绘制的图形类型 |
| | | if(eventListDTO.getType().equals(ScreenDrawEventListDTO.type.yx)){ |
| | | //判断这个点是否在圆形范围内 |
| | | if(GisPointUtil.isInCircle(eventListDTO.getCenterLng(),eventListDTO.getCenterLat(),Double.parseDouble(village.getLng()),Double.parseDouble(village.getLat()),eventListDTO.getRadius())){ |
| | | // 判断绘制的图形类型 |
| | | if (eventListDTO.getType().equals(ScreenDrawEventListDTO.type.yx)) { |
| | | // 判断这个点是否在圆形范围内 |
| | | if (GisPointUtil.isInCircle(eventListDTO.getCenterLng(), eventListDTO.getCenterLat(), |
| | | Double.parseDouble(village.getLng()), Double.parseDouble(village.getLat()), |
| | | eventListDTO.getRadius())) { |
| | | villageResultList.add(village); |
| | | ScreenDrawEventPopulationTotalVO populationTotalVO = this.baseMapper.getVillagePopulationTotal(village.getVillageId()); |
| | | if(populationTotalVO != null){ |
| | | drawEventPopulationTotalVO.setVillageTotal(drawEventPopulationTotalVO.getVillageTotal() + 1); |
| | | drawEventPopulationTotalVO.setPopulationTotal(drawEventPopulationTotalVO.getPopulationTotal() + populationTotalVO.getPopulationTotal()); |
| | | drawEventPopulationTotalVO.setLocalTotal(drawEventPopulationTotalVO.getLocalTotal() + populationTotalVO.getLocalTotal()); |
| | | drawEventPopulationTotalVO.setOutTotal(drawEventPopulationTotalVO.getOutTotal() + populationTotalVO.getOutTotal()); |
| | | drawEventPopulationTotalVO.setSpecialTotal(drawEventPopulationTotalVO.getSpecialTotal() + populationTotalVO.getSpecialTotal()); |
| | | drawEventPopulationTotalVO.setBuildTotal(drawEventPopulationTotalVO.getBuildTotal() + populationTotalVO.getBuildTotal()); |
| | | ScreenDrawEventPopulationTotalVO populationTotalVO = |
| | | this.baseMapper.getVillagePopulationTotal(village.getVillageId()); |
| | | if (populationTotalVO != null) { |
| | | drawEventPopulationTotalVO |
| | | .setVillageTotal(drawEventPopulationTotalVO.getVillageTotal() + 1); |
| | | drawEventPopulationTotalVO |
| | | .setPopulationTotal(drawEventPopulationTotalVO.getPopulationTotal() |
| | | + populationTotalVO.getPopulationTotal()); |
| | | drawEventPopulationTotalVO.setLocalTotal( |
| | | drawEventPopulationTotalVO.getLocalTotal() + populationTotalVO.getLocalTotal()); |
| | | drawEventPopulationTotalVO.setOutTotal( |
| | | drawEventPopulationTotalVO.getOutTotal() + populationTotalVO.getOutTotal()); |
| | | drawEventPopulationTotalVO.setSpecialTotal( |
| | | drawEventPopulationTotalVO.getSpecialTotal() + populationTotalVO.getSpecialTotal()); |
| | | drawEventPopulationTotalVO.setBuildTotal( |
| | | drawEventPopulationTotalVO.getBuildTotal() + populationTotalVO.getBuildTotal()); |
| | | } |
| | | } |
| | | }else {//多边形类型 |
| | | if(GisPointUtil.isInPolygon(Double.parseDouble(village.getLng()),Double.parseDouble(village.getLat()),eventListDTO.getLngLatList())){ |
| | | } else {// 多边形类型 |
| | | if (GisPointUtil.isInPolygon(Double.parseDouble(village.getLng()), |
| | | Double.parseDouble(village.getLat()), eventListDTO.getLngLatList())) { |
| | | villageResultList.add(village); |
| | | ScreenDrawEventPopulationTotalVO populationTotalVO = this.baseMapper.getVillagePopulationTotal(village.getVillageId()); |
| | | if(populationTotalVO != null){ |
| | | drawEventPopulationTotalVO.setVillageTotal(drawEventPopulationTotalVO.getVillageTotal() + 1); |
| | | drawEventPopulationTotalVO.setPopulationTotal(drawEventPopulationTotalVO.getPopulationTotal() + populationTotalVO.getPopulationTotal()); |
| | | drawEventPopulationTotalVO.setLocalTotal(drawEventPopulationTotalVO.getLocalTotal() + populationTotalVO.getLocalTotal()); |
| | | drawEventPopulationTotalVO.setOutTotal(drawEventPopulationTotalVO.getOutTotal() + populationTotalVO.getOutTotal()); |
| | | drawEventPopulationTotalVO.setSpecialTotal(drawEventPopulationTotalVO.getSpecialTotal() + populationTotalVO.getSpecialTotal()); |
| | | drawEventPopulationTotalVO.setBuildTotal(drawEventPopulationTotalVO.getBuildTotal() + populationTotalVO.getBuildTotal()); |
| | | ScreenDrawEventPopulationTotalVO populationTotalVO = |
| | | this.baseMapper.getVillagePopulationTotal(village.getVillageId()); |
| | | if (populationTotalVO != null) { |
| | | drawEventPopulationTotalVO |
| | | .setVillageTotal(drawEventPopulationTotalVO.getVillageTotal() + 1); |
| | | drawEventPopulationTotalVO |
| | | .setPopulationTotal(drawEventPopulationTotalVO.getPopulationTotal() |
| | | + populationTotalVO.getPopulationTotal()); |
| | | drawEventPopulationTotalVO.setLocalTotal( |
| | | drawEventPopulationTotalVO.getLocalTotal() + populationTotalVO.getLocalTotal()); |
| | | drawEventPopulationTotalVO.setOutTotal( |
| | | drawEventPopulationTotalVO.getOutTotal() + populationTotalVO.getOutTotal()); |
| | | drawEventPopulationTotalVO.setSpecialTotal( |
| | | drawEventPopulationTotalVO.getSpecialTotal() + populationTotalVO.getSpecialTotal()); |
| | | drawEventPopulationTotalVO.setBuildTotal( |
| | | drawEventPopulationTotalVO.getBuildTotal() + populationTotalVO.getBuildTotal()); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 大屏-根据小区id查询小区统计人数 |
| | | * @param villageId 小区id |
| | | * @return 小区统计数据 |
| | | * |
| | | * @param villageId |
| | | * 小区id |
| | | * @return 小区统计数据 |
| | | */ |
| | | @Override |
| | | public R civilVillageStatistics(Long villageId){ |
| | | public R civilVillageStatistics(Long villageId) { |
| | | ScreenDrawEventPopulationTotalVO result = this.baseMapper.getVillagePopulationTotal(villageId); |
| | | result.setVillageTotal(1); |
| | | return R.ok(result); |
| | |
| | | |
| | | /** |
| | | * 查询所有网格员工作汇总数据 |
| | | * @param statisticsAdminDTO 请求参数 |
| | | * @return 网格员工作汇总数据 |
| | | * |
| | | * @param statisticsAdminDTO |
| | | * 请求参数 |
| | | * @return 网格员工作汇总数据 |
| | | */ |
| | | @Override |
| | | public R gridMemberStatisticsAll(MemberStatisticsAdminDTO statisticsAdminDTO){ |
| | | public R gridMemberStatisticsAll(MemberStatisticsAdminDTO statisticsAdminDTO) { |
| | | return R.ok(eventGridMemberRelationMapper.gridMemberStatisticsAll(statisticsAdminDTO)); |
| | | } |
| | | } |