lidongdong
2023-09-01 5da6b2e80f6c54d07ce60b228bf668a1e6ec6be6
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -98,7 +98,7 @@
        Boolean isExpertCheck=false;
        Long expertId=null;
        Boolean isStretAccount = isStreetAccount(loginUserInfoVO);
//        comEvent.setAppId(loginUserInfoVO.getAppId());
        comEvent.setAppId(loginUserInfoVO.getAppId());
        if (nonNull(comEvent.getUserType())){
            if (comEvent.getUserType().equals(1)){
                //个人账号权限
@@ -146,13 +146,14 @@
        IPage<ComEvent> list=null;
        //是否为专家查看自己发布的事件
        if (isExpertCheck && comEvent.getUserType()!=1){
            if (nonNull(comEventMapper.listEventIds(expertId))){
                list = comEventMapper.pageByComEventExpert(comEventMapper.listEventIds(expertId), comEvent, pagination);
            List<Long> ids=comEventMapper.listEventIds(expertId);
            if (ids!=null && ids.size()>0 ){
                list = comEventMapper.pageByComEventExpert(ids, comEvent, pagination);
            }
        }else{
            list = baseMapper.pageByComEvent(comEvent, pagination);
        }
        if (list.getRecords().size() < 1) {
        if (list==null || list.getRecords().size() < 1) {
            return R.ok(Collections.emptyList());
        }
        list.getRecords().forEach(comEvent1 -> {
@@ -927,15 +928,37 @@
        return map;
    }
    public String getPhone(ComEvent comEvent){
    public String getPhone(ComEvent comEvent)
    {
        if(comEvent==null)
        {
            return  "";
        }
        if (isNull(comEvent.getRequestUserCommunity())){
            return comSanShuoIndustryCenterService.getById(comEvent.getCenterId()).getPhone();
        }else {
            String contactsPhone = comActDAO.selectById(comEvent.getRequestUserCommunity()).getContactsPhone();
            if (isNull(contactsPhone)){
                return null;
            ComSanshuoIndustryCenter sanshuoIndustryCenter=comSanShuoIndustryCenterService.getById(comEvent.getCenterId());
            if(sanshuoIndustryCenter==null)
            {
                return "";
            }
            return contactsPhone;
            else
            {
                return sanshuoIndustryCenter.getPhone();
            }
        }else {
            ComActDO comActDO=comActDAO.selectById(comEvent.getRequestUserCommunity());
            if(comActDO!=null)
            {
                String contactsPhone = comActDO.getContactsPhone();
                if (isNull(contactsPhone)){
                    return "";
                }
                else
                {
                    return contactsPhone;
                }
            }
            return "";
        }
    }
@@ -1014,8 +1037,9 @@
                comEvent.setCommunityIds(cids);
         }
        if (isExpertCheck){
            if(nonNull(comEventMapper.listEventIds(expertId))){
                List<Long> eventIds = comEventMapper.listEventIds(expertId);
            List<Long> eventIds = comEventMapper.listEventIds(expertId);
            if(eventIds!=null && eventIds.size()>0){
                //获取该专家的所有事件
                comEvent.setEventIds(eventIds);
            }