|
@@ -2,6 +2,7 @@ package com.pig4cloud.pig.marketing.service.impl;
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.pig4cloud.pig.marketing.api.dto.MktMgmtPushRecordSaveDTO;
|
|
|
import com.pig4cloud.pig.marketing.api.dto.mongo.PageDeviceInfoDTO;
|
|
|
import com.pig4cloud.pig.marketing.api.dto.mongo.PageMessageDTO;
|
|
|
import com.pig4cloud.pig.marketing.api.dto.mongo.SaveDeviceInfoDTO;
|
|
@@ -12,11 +13,13 @@ import com.pig4cloud.pig.marketing.api.vo.mongo.PageDeviceInfoVO;
|
|
|
import com.pig4cloud.pig.marketing.api.vo.mongo.UserStatisticsVO;
|
|
|
import com.pig4cloud.pig.marketing.config.UserStatisticsConfig;
|
|
|
import com.pig4cloud.pig.marketing.repository.MessageRepository;
|
|
|
+import com.pig4cloud.pig.marketing.service.MktMgmtPushRecordService;
|
|
|
import com.pig4cloud.pig.marketing.service.TcpDataService;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.domain.Sort;
|
|
@@ -49,6 +52,9 @@ import java.util.Objects;
|
|
|
|
|
|
private final UserStatisticsConfig userStatisticsConfig;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MktMgmtPushRecordService mktMgmtPushRecordService;
|
|
|
+
|
|
|
// 定义时间格式器
|
|
|
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
@@ -194,6 +200,14 @@ import java.util.Objects;
|
|
|
message.setMsgData(reqDto.getMsgData());
|
|
|
message.setReportTime(LocalDateTime.now().format(DATE_TIME_FORMATTER));
|
|
|
Message save = messageRepository.save(message);
|
|
|
+ if (save.getId() != null) {
|
|
|
+ MktMgmtPushRecordSaveDTO saveRecordDTO = new MktMgmtPushRecordSaveDTO();
|
|
|
+ saveRecordDTO.setPushContent(reqDto.getMsgData());
|
|
|
+ saveRecordDTO.setPushIP(reqDto.getClientIP());
|
|
|
+ saveRecordDTO.setPushDomain(reqDto.getClientDomain());
|
|
|
+ String s = mktMgmtPushRecordService.saveRecord(saveRecordDTO);
|
|
|
+ log.info("保存推送记录:{}", s);
|
|
|
+ }
|
|
|
return save.getId();
|
|
|
}
|
|
|
|