From ef33d631ccf7e71624cad06293640e96577b58f9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Aug 2022 17:01:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E7=AD=BE=E5=88=B0=E6=8E=A8?= =?UTF-8?q?=E9=80=81mq=E5=8F=91=E6=94=BE=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/IcMessageDao.xml | 1 + .../partyOrg/form/PartyActSignFormDTO.java | 5 ++ .../IcPartyActSignInRecordServiceImpl.java | 57 +++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml index 63ed7b1564..aa20ac5071 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/IcMessageDao.xml @@ -41,6 +41,7 @@ ic_message WHERE del_flag = '0' + AND read_flag = 'unread' AND user_id = #{userId} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActSignFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActSignFormDTO.java index 45726dab7f..9d6de8fef7 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActSignFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/PartyActSignFormDTO.java @@ -15,6 +15,11 @@ public class PartyActSignFormDTO implements Serializable { */ @NotBlank(message = "活动Id不能为空",groups = {UpdateGroup.class}) private String icPartyActId; + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空",groups = {UpdateGroup.class}) + private String gridId; /** * 签到地点 */ diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java index 1ae62b0476..9e940c6f8c 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActSignInRecordServiceImpl.java @@ -4,29 +4,46 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.rocketmq.constants.TopicConstants; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +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.redis.common.CustomerOrgRedis; +import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SystemMessageType; import com.epmet.dto.IcMessageDTO; +import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.IcMessageListFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.dto.result.CommonDataFilterResultDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.modules.partyOrg.dao.IcPartyActSignInRecordDao; +import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.entity.IcPartyActSignInRecordEntity; +import com.epmet.modules.partyOrg.service.IcPartyActService; import com.epmet.modules.partyOrg.service.IcPartyActSignInRecordService; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; import com.epmet.resi.partymember.dto.IcPartyActSignInRecordDTO; import com.epmet.resi.partymember.dto.partyOrg.form.PartyActSignFormDTO; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestBody; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -38,9 +55,14 @@ import java.util.Map; * @since v1.0.0 2022-08-18 */ @Service +@Slf4j public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl implements IcPartyActSignInRecordService { @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private IcPartyActService icPartyActService; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; @Override @@ -121,6 +143,41 @@ public class IcPartyActSignInRecordServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setOpAgencyId(gridInfo.getPid()); + pointEventMsg.setOperatorId(formDTO.getUserId()); + pointEventMsg.setAgencyId(gridInfo.getPid()); + pointEventMsg.setCustomerId(formDTO.getCustomerId()); + pointEventMsg.setGridId(gridInfo.getId()); + pointEventMsg.setUserId(formDTO.getUserId()); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setSourceType(actType); + pointEventMsg.setSourceId(formDTO.getIcPartyActId()); + pointEventMsgList.add(pointEventMsg); + + SystemMsgFormDTO msgFormDTO = new SystemMsgFormDTO(); + msgFormDTO.setMessageType(eventTag); + msgFormDTO.setContent(pointEventMsgList); + Result sendMsgResult = epmetMessageOpenFeignClient.sendSystemMsgByMQ(msgFormDTO); + if (!sendMsgResult.success()) { + log.error("党建活动签到发送积分失败,活动Id->" + formDTO.getIcPartyActId() + " 用户->" + formDTO.getUserId()); + } } } \ No newline at end of file