|
@ -1,23 +1,33 @@ |
|
|
package com.epmet.modules.partyOrg.service.impl; |
|
|
package com.epmet.modules.partyOrg.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
|
|
import com.epmet.commons.rocketmq.messages.PartyMeetingMessageMQMsg; |
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.modules.partyOrg.dao.IcPartyActDao; |
|
|
|
|
|
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao; |
|
|
|
|
|
import com.epmet.modules.partyOrg.dao.IcScheduleDao; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
import com.epmet.modules.partyOrg.dao.*; |
|
|
import com.epmet.modules.partyOrg.dao.*; |
|
|
import com.epmet.modules.partyOrg.entity.IcPartyActEntity; |
|
|
import com.epmet.modules.partyOrg.entity.IcPartyActEntity; |
|
|
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity; |
|
|
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity; |
|
|
|
|
|
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity; |
|
|
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity; |
|
|
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyActOrgService; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyActOrgService; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyActService; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyActService; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyOrgService; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyOrgService; |
|
|
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
|
|
|
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; |
|
|
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService; |
|
|
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; |
|
@ -36,6 +46,11 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.Calendar; |
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@ -47,7 +62,8 @@ import java.util.stream.Collectors; |
|
|
*/ |
|
|
*/ |
|
|
@Service |
|
|
@Service |
|
|
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupOpenFeignClient resiGroupOpenFeignClient; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IcScheduleDao scheduleDao; |
|
|
private IcScheduleDao scheduleDao; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -262,4 +278,45 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) { |
|
|
public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) { |
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 党建小助手活动触发为用户推送消息 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public void partyMeetingMessage(PartyMeetingMessageMQMsg formDTO) { |
|
|
|
|
|
//1.校验活动数据是否存在
|
|
|
|
|
|
IcPartyActEntity entity = baseDao.selectById(formDTO.getIcPartyActId()); |
|
|
|
|
|
if(null==entity){ |
|
|
|
|
|
String msg = "活动信息不存在,活动Id:" + formDTO.getIcPartyActId(); |
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); |
|
|
|
|
|
} |
|
|
|
|
|
//2.根据不同类型消息触发不同处理逻辑
|
|
|
|
|
|
//2-1.发布活动给居民端涉及党员已经工作端活动发布站推送党建活动消息
|
|
|
|
|
|
if("publish".equals(formDTO.getType())){ |
|
|
|
|
|
//查询活动对应的发布范围信息
|
|
|
|
|
|
LambdaQueryWrapper<IcPartyActOrgEntity> orgWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
orgWrapper.eq(IcPartyActOrgEntity::getDelFlag, NumConstant.ZERO_STR); |
|
|
|
|
|
orgWrapper.eq(IcPartyActOrgEntity::getIcPartyActId, formDTO.getIcPartyActId()); |
|
|
|
|
|
List<IcPartyActOrgEntity> list = icPartyActOrgDao.selectList(orgWrapper); |
|
|
|
|
|
List<String> groupIdList = list.stream().filter(ca -> ca.getOrgType().equals("6")).map(m -> m.getJoinOrgId()).collect(Collectors.toList()); |
|
|
|
|
|
List<String> partyOrgIdList = list.stream().filter(ca -> !ca.getOrgType().equals("6")).map(m -> m.getJoinOrgId()).collect(Collectors.toList()); |
|
|
|
|
|
//分别查询党组织、党小组下的人
|
|
|
|
|
|
List<String> userIdList = new ArrayList<>(); |
|
|
|
|
|
if(!CollectionUtils.isEmpty(groupIdList)){ |
|
|
|
|
|
Result<List<ResiGroupMemberDTO>> result = resiGroupOpenFeignClient.getMemberList(groupIdList); |
|
|
|
|
|
if (!result.success()) { |
|
|
|
|
|
throw new RenException("调用common service查询secret失败"); |
|
|
|
|
|
} |
|
|
|
|
|
userIdList = result.getData().stream().map(ResiGroupMemberDTO::getCustomerUserId).collect(Collectors.toList()); |
|
|
|
|
|
} |
|
|
|
|
|
if(!CollectionUtils.isEmpty(groupIdList)){ |
|
|
|
|
|
//TODO
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//组装消息
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |