|
@@ -5,6 +5,7 @@ import com.dayou.common.BaseEntity;
|
|
|
import com.dayou.entity.BusinessReply;
|
|
|
import com.dayou.entity.Message;
|
|
|
import com.dayou.mapper.MessageMapper;
|
|
|
+import com.dayou.message.MessageTypeEnum;
|
|
|
import com.dayou.message.bo.BusinessMessageBO;
|
|
|
import com.dayou.message.bo.SystemMessageBO;
|
|
|
import com.dayou.message.handler.BusinessMessageHandler;
|
|
@@ -12,6 +13,7 @@ import com.dayou.message.handler.SystemMessageHandler;
|
|
|
import com.dayou.service.IMessageService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.dayou.utils.LoginContext;
|
|
|
+import com.dayou.vo.ItemVO;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -40,6 +42,7 @@ import com.dayou.enums.BatchTaskTypeEnum;
|
|
|
import static com.dayou.enums.BusinessReplyEnum.MARKET_LOG_REPLY;
|
|
|
import static com.dayou.enums.BusinessReplyEnum.MARKET_VISIT_REPLY;
|
|
|
import static com.dayou.message.MessageTitle.*;
|
|
|
+import static com.dayou.message.MessageTypeEnum.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -64,8 +67,10 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
messageBO.setReceiver(originalBO.getReceiverId());
|
|
|
String bizType = originalBO.getBizType().equals(MARKET_VISIT_REPLY.name())?MARKET_VISIT_REPLY.getName(): MARKET_LOG_REPLY.getName();
|
|
|
messageBO.setTitle(BUSINESS_MESSAGE_TITLE.replace("x", bizType));
|
|
|
- messageBO.setMessage(JSON.toJSONString(originalBO));
|
|
|
+ messageBO.setMessage(originalBO.getContent());
|
|
|
+ messageBO.setParams(JSON.toJSONString(originalBO));
|
|
|
messageBO.setSender(originalBO.getReplierId());
|
|
|
+ messageBO.setType(BUSINESS.name());
|
|
|
return businessMessageHandler.sendMessage(messageBO);
|
|
|
}
|
|
|
|
|
@@ -73,9 +78,10 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
public Boolean packagingSettleMessage(Set<Long> userIds) {
|
|
|
Set<SystemMessageBO> settleMessages = userIds.stream().map(x -> {
|
|
|
SystemMessageBO systemMessageBO = new SystemMessageBO();
|
|
|
- systemMessageBO.setTitle(SYSTEM_MESSAGE_TITLE.replace("x", SETTLE_MESSAGE_TITLE));
|
|
|
+ systemMessageBO.setTitle(SYSTEM_MESSAGE_TITLE.replace("x", SETTLE.getName()));
|
|
|
systemMessageBO.setMessage(SETTLE_MESSAGE_CONTENT);
|
|
|
systemMessageBO.setReceiver(x);
|
|
|
+ systemMessageBO.setType(SETTLE.name());
|
|
|
return systemMessageBO;
|
|
|
}).collect(Collectors.toSet());
|
|
|
if (CollectionUtils.isNotEmpty(settleMessages)){
|
|
@@ -96,4 +102,18 @@ public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> impl
|
|
|
public Boolean updateRead(Long id) {
|
|
|
return this.update(new LambdaUpdateWrapper<Message>().eq(BaseEntity::getId,id).set(Message::getIsRead,Boolean.TRUE));
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void packagingEvaluateRemind(List<ItemVO> completedNotEvaluateItem) {
|
|
|
+ Set<SystemMessageBO> collect = completedNotEvaluateItem.stream().map(x -> {
|
|
|
+ SystemMessageBO systemMessageBO = new SystemMessageBO();
|
|
|
+ systemMessageBO.setType(EVALUATE_REMIND.name());
|
|
|
+ systemMessageBO.setTitle(SYSTEM_MESSAGE_TITLE.replace("x", EVALUATE_REMIND.getName()));
|
|
|
+ systemMessageBO.setMessage(EVALUATE_REMIND_CONTENT.replace("x", x.getName()));
|
|
|
+ systemMessageBO.setParams(JSON.toJSONString(x));
|
|
|
+ systemMessageBO.setReceiver(x.getUserId());
|
|
|
+ return systemMessageBO;
|
|
|
+ }).collect(Collectors.toSet());
|
|
|
+ systemMessageHandler.sendMessage(collect);
|
|
|
+ }
|
|
|
}
|