From ecde7a30a43e3d45be2f0f9e271d0abf02c7d58e Mon Sep 17 00:00:00 2001
From: 罗元桥 <2376770955@qq.com>
Date: 星期二, 14 十二月 2021 13:58:17 +0800
Subject: [PATCH] Merge branch 'west_bigscreen_dev' into 'master'

---
 springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 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 bddd65e..569e7ea 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
@@ -5,6 +5,7 @@
 
 import javax.annotation.Resource;
 
+import com.panzhihua.common.model.vos.community.screen.event.EventComprehensiveGovernanceStatisticsVO;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -317,7 +318,9 @@
 
         if (eventMapper.insert(eventDO) == 1) {
             // 如果是特殊人群,则新增特殊人群与事件关系
-            if (commonEventAddDTO.getEventType().equals(6)) {
+            if (commonEventAddDTO.getEventType().equals(6)
+                    && commonEventAddDTO.getPopulationIds() != null
+                    && commonEventAddDTO.getPopulationIds().size() > 0) {
                 if (commonEventAddDTO.getPopulationIds() != null && commonEventAddDTO.getPopulationIds().size() > 0) {
                     List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                     commonEventAddDTO.getPopulationIds().forEach(populationId -> {
@@ -397,11 +400,11 @@
 
         if (commonEventEditDTO.getId() == null) {
             // 检查特殊人群上报时参数
-            if (commonEventEditDTO.getEventType().equals(6)) {
-                if (commonEventEditDTO.getPopulationIds().isEmpty()) {
-                    return R.fail("上报人员为空");
-                }
-            }
+//            if (commonEventEditDTO.getEventType().equals(6)) {
+//                if (commonEventEditDTO.getPopulationIds().isEmpty()) {
+//                    return R.fail("上报人员为空");
+//                }
+//            }
 
             EventDO eventDO = new EventDO();
             BeanUtils.copyProperties(commonEventEditDTO, eventDO);
@@ -418,7 +421,8 @@
             if (eventMapper.insert(eventDO) > 0) {
 
                 // 如果是特殊人群,则新增特殊人群与事件关系
-                if (commonEventEditDTO.getEventType().equals(6)) {
+                if (commonEventEditDTO.getEventType().equals(6) && commonEventEditDTO.getPopulationIds() != null
+                        && commonEventEditDTO.getPopulationIds().size() > 0) {
                     List<EventSpecialCrowdRecordDO> crowdRecordList = new ArrayList<>();
                     commonEventEditDTO.getPopulationIds().forEach(populationId -> {
                         EventSpecialCrowdRecordDO specialCrowdRecordDO = new EventSpecialCrowdRecordDO();
@@ -1816,11 +1820,7 @@
                     if (eventDO == null) {
                         throw new ServiceException("id为" + id + "的事件不存在");
                     }
-                    if (eventDO.getEventStatus() != null
-                        && (eventDO.getEventStatus().intValue() == 1 || eventDO.getEventStatus().intValue() == 4)) {// 草稿
-                                                                                                                    // 或者
-                                                                                                                    // 已撤销
-                                                                                                                    // 的事件可以删除
+                    if (eventDO.getEventStatus() != null) {
                         eventDO.setEventStatus(3);// 逻辑删除
                         eventDO.setUpdateBy(userId);
                         int updated = this.getBaseMapper().updateById(eventDO);
@@ -2642,4 +2642,15 @@
     public R gridMemberStatisticsAll(MemberStatisticsAdminDTO statisticsAdminDTO) {
         return R.ok(eventGridMemberRelationMapper.gridMemberStatisticsAll(statisticsAdminDTO));
     }
+
+    /**
+     * 西区大数据分析平台-综合治理栏
+     * @return
+     */
+    @Override
+    public R getComprehensiveGovernanceStatics() {
+        EventComprehensiveGovernanceStatisticsVO governanceStatisticsVO = this.baseMapper.selectComprehensiveGovernanceStatics();
+        governanceStatisticsVO.generateGovernanceTotal();
+        return R.ok(governanceStatisticsVO);
+    }
 }

--
Gitblit v1.7.1