huanghongfa
2021-06-23 b057f9985a360fcfeb3aa6e96eae99deccffa1d2
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_grid.service.impl;
import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -54,6 +55,8 @@
    private EventGridMemberRelationMapper eventGridMemberRelationMapper;
    @Resource
    private EventSpecialCrowdRecordService eventSpecialCrowdRecordService;
    @Resource
    private EventSpecialCrowdRecordMapper eventSpecialCrowdRecordMapper;
    /**
     * 分页查找事件
@@ -246,6 +249,16 @@
                eventDetailsVO.setCreator(createUser.get("name") == null ? "" : createUser.get("name").toString());
            }
            //当事件为特殊人群上报时,需要查询事件与人口关联关系
            if(eventDetailsVO.getEventType().equals(6)){
                List<EventSpecialPopulationDetailsVO> specialPopulationList = eventSpecialCrowdRecordMapper.getSpecialPopulationIds(eventDetailsVO.getId());
                if(!specialPopulationList.isEmpty()){
                    specialPopulationList.forEach(special -> {
                        special.setAge(IdcardUtil.getAgeByIdCard(special.getIdCard()));
                    });
                }
                eventDetailsVO.setPopulationList(specialPopulationList);
            }
            return R.ok(eventDetailsVO);
        }
        return R.fail("事件不存在");
@@ -269,7 +282,7 @@
        //检查特殊人群上报时参数
        if(commonEventAddDTO.getEventType().equals(6)){
            if(commonEventAddDTO.getPopulationIds().isEmpty()){
            if(commonEventAddDTO.getPopulationIds() == null || commonEventAddDTO.getPopulationIds().size() <= 0){
                return R.fail("上报人员为空");
            }
        }