From db31c68b10e3a58bce17e3bbf880db05b6f341fe Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 16 七月 2021 16:39:56 +0800
Subject: [PATCH] 修改bug

---
 springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java |   40 +++++++++++++++++++++++-----------------
 1 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
index ed84092..8f0aefd 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -297,11 +297,11 @@
         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发布
@@ -315,19 +315,20 @@
         eventDO.setOrderSn(getEventOrderSn(eventDO.getEventType()));
 
         if (eventMapper.insert(eventDO) == 1) {
-
             //如果是特殊人群,则新增特殊人群与事件关系
             if(commonEventAddDTO.getEventType().equals(6)){
-                List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
-                commonEventAddDTO.getPopulationIds().forEach(populationId -> {
-                    EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
-                    specialCrowdRecordDO.setEventId(eventDO.getId());
-                    specialCrowdRecordDO.setPopulationId(populationId);
-                    specialCrowdRecordDO.setCreateAt(new Date());
-                    crowdRecordList.add(specialCrowdRecordDO);
-                });
-                //添加特殊人群上报事件与人口关系
-                eventSpecialCrowdRecordService.saveBatch(crowdRecordList);
+                if(commonEventAddDTO.getPopulationIds() != null && commonEventAddDTO.getPopulationIds().size() > 0){
+                    List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
+                    commonEventAddDTO.getPopulationIds().forEach(populationId -> {
+                        EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
+                        specialCrowdRecordDO.setEventId(eventDO.getId());
+                        specialCrowdRecordDO.setPopulationId(populationId);
+                        specialCrowdRecordDO.setCreateAt(new Date());
+                        crowdRecordList.add(specialCrowdRecordDO);
+                    });
+                    //添加特殊人群上报事件与人口关系
+                    eventSpecialCrowdRecordService.saveBatch(crowdRecordList);
+                }
             }
 
             //添加音频
@@ -1922,7 +1923,12 @@
      */
     @Override
     public R getGridEventStatisticsByApp(Long gridId){
-        return R.ok(this.baseMapper.getGridEventStatisticsByApp(gridId));
+        GridEventStatisticsVO result = this.baseMapper.getGridEventStatisticsByApp(gridId);
+        if(result != null){
+            result.setTodayNum(result.getTodayNum() + result.getZfTodayNum());
+            result.setMonthNum(result.getMonthNum() + result.getZfMonthNum());
+        }
+        return R.ok(result);
     }
 
     /**

--
Gitblit v1.7.1