|
@ -3,6 +3,7 @@ package com.epmet.modules.partyOrg.service.impl; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
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.rocketmq.messages.PartyMeetingMessageMQMsg; |
|
|
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
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; |
|
@ -14,6 +15,12 @@ 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.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
|
|
import com.epmet.dto.form.UserMessageFormDTO; |
|
|
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
|
|
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; |
|
@ -35,6 +42,7 @@ import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; |
|
|
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; |
|
|
import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; |
|
|
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; |
|
|
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; |
|
|
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; |
|
|
import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -51,6 +59,7 @@ import java.util.stream.Collectors; |
|
|
* @author generator generator@elink-cn.com |
|
|
* @author generator generator@elink-cn.com |
|
|
* @since v1.0.0 2022-08-18 |
|
|
* @since v1.0.0 2022-08-18 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
@Slf4j |
|
|
@Service |
|
|
@Service |
|
|
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
@Autowired |
|
|
@Autowired |
|
@ -65,6 +74,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
private IcPartyOrgDao partyOrgDao; |
|
|
private IcPartyOrgDao partyOrgDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao; |
|
|
private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpmetMessageOpenFeignClient messageOpenFeignClient; |
|
|
/** |
|
|
/** |
|
|
* 活动类型列表 |
|
|
* 活动类型列表 |
|
|
* |
|
|
* |
|
@ -313,20 +324,6 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static List<ActAndScheduleListResultDTO> constructHomeSearchData(String startDate,String endDate){ |
|
|
|
|
|
List<ActAndScheduleListResultDTO> result = new ArrayList<>(); |
|
|
|
|
|
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){ |
|
|
|
|
|
List<String> days = DateUtils.getDaysBetween(startDate, endDate); |
|
|
|
|
|
days.forEach(d -> { |
|
|
|
|
|
ActAndScheduleListResultDTO dto = new ActAndScheduleListResultDTO(); |
|
|
|
|
|
dto.setDateId(d); |
|
|
|
|
|
result.add(dto); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return result; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 党建小助手活动触发为用户推送消息 |
|
|
* 党建小助手活动触发为用户推送消息 |
|
|
*/ |
|
|
*/ |
|
@ -338,6 +335,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
String msg = "活动信息不存在,活动Id:" + formDTO.getIcPartyActId(); |
|
|
String msg = "活动信息不存在,活动Id:" + formDTO.getIcPartyActId(); |
|
|
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); |
|
|
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), msg, msg); |
|
|
} |
|
|
} |
|
|
|
|
|
List<UserMessageFormDTO> msgList = new ArrayList<>(); |
|
|
//2.根据不同类型消息触发不同处理逻辑
|
|
|
//2.根据不同类型消息触发不同处理逻辑
|
|
|
//2-1.发布活动给居民端涉及党员已经工作端活动发布站推送党建活动消息
|
|
|
//2-1.发布活动给居民端涉及党员已经工作端活动发布站推送党建活动消息
|
|
|
if("publish".equals(formDTO.getType())){ |
|
|
if("publish".equals(formDTO.getType())){ |
|
@ -351,7 +349,7 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
//分别查询党组织、党小组下的人
|
|
|
//分别查询党组织、党小组下的人
|
|
|
List<String> userIdList = new ArrayList<>(); |
|
|
List<String> userIdList = new ArrayList<>(); |
|
|
if(!CollectionUtils.isEmpty(groupIdList)){ |
|
|
if(!CollectionUtils.isEmpty(groupIdList)){ |
|
|
Result<List<ResiGroupMemberDTO>> result = resiGroupOpenFeignClient.getMemberList(groupIdList); |
|
|
Result<List<ResiGroupMemberDTO>> result = resiGroupOpenFeignClient.groupMemberList(groupIdList); |
|
|
if (!result.success()) { |
|
|
if (!result.success()) { |
|
|
throw new RenException("调用common service查询secret失败"); |
|
|
throw new RenException("调用common service查询secret失败"); |
|
|
} |
|
|
} |
|
@ -362,9 +360,38 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//组装消息
|
|
|
//组装消息
|
|
|
|
|
|
userIdList.forEach(id->{ |
|
|
|
|
|
UserMessageFormDTO msg = new UserMessageFormDTO(); |
|
|
|
|
|
msg.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
msg.setApp(AppClientConstant.APP_RESI); |
|
|
|
|
|
msg.setTitle("您收到一个新的活动通知"); |
|
|
|
|
|
msg.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
|
|
StringBuffer str = new StringBuffer(); |
|
|
|
|
|
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress()); |
|
|
|
|
|
msg.setMessageContent(str.toString()); |
|
|
|
|
|
msg.setMessageType("party"); |
|
|
|
|
|
msg.setTargetId(formDTO.getIcPartyActId()); |
|
|
|
|
|
msg.setUserId(id); |
|
|
|
|
|
msgList.add(msg); |
|
|
|
|
|
}); |
|
|
|
|
|
//工作人员
|
|
|
|
|
|
UserMessageFormDTO msg = new UserMessageFormDTO(); |
|
|
|
|
|
msg.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
msg.setApp(AppClientConstant.APP_GOV); |
|
|
|
|
|
msg.setTitle("您有一个活动已经发布"); |
|
|
|
|
|
msg.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
|
|
StringBuffer str = new StringBuffer(); |
|
|
|
|
|
str.append("主题:").append(entity.getTopic()).append("\n").append("时间:").append(entity.getHoldTime()).append("\n").append("地点:").append(entity.getAddress()); |
|
|
|
|
|
msg.setMessageContent(str.toString()); |
|
|
|
|
|
msg.setMessageType("party"); |
|
|
|
|
|
msg.setTargetId(formDTO.getIcPartyActId()); |
|
|
|
|
|
msg.setUserId(entity.getPublishStaffId()); |
|
|
|
|
|
msgList.add(msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//推送消息
|
|
|
|
|
|
Result sendMessageRes = messageOpenFeignClient.saveIcMessageList(msgList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |