From a5ac35810343c19d1822b119e1dba427f1f95de3 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 08 十月 2021 17:31:16 +0800
Subject: [PATCH] bug修复

---
 springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 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 d6b0c01..48cf622 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
@@ -399,11 +399,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);
@@ -420,7 +420,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();
@@ -1818,11 +1819,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);

--
Gitblit v1.7.1