|
@@ -13,6 +13,7 @@ import com.pig4cloud.pig.marketing.api.entity.mongo.Message;
|
|
import com.pig4cloud.pig.marketing.api.service.MktMgmtHandPushService;
|
|
import com.pig4cloud.pig.marketing.api.service.MktMgmtHandPushService;
|
|
import com.pig4cloud.pig.marketing.api.vo.mongo.*;
|
|
import com.pig4cloud.pig.marketing.api.vo.mongo.*;
|
|
import com.pig4cloud.pig.marketing.config.UserStatisticsConfig;
|
|
import com.pig4cloud.pig.marketing.config.UserStatisticsConfig;
|
|
|
|
+import com.pig4cloud.pig.marketing.mapper.MarketingAppsMapper;
|
|
import com.pig4cloud.pig.marketing.repository.MessageRepository;
|
|
import com.pig4cloud.pig.marketing.repository.MessageRepository;
|
|
import com.pig4cloud.pig.marketing.service.MktMgmtPushRecordService;
|
|
import com.pig4cloud.pig.marketing.service.MktMgmtPushRecordService;
|
|
import com.pig4cloud.pig.marketing.service.TcpDataService;
|
|
import com.pig4cloud.pig.marketing.service.TcpDataService;
|
|
@@ -64,6 +65,8 @@ import java.util.stream.Collectors;
|
|
@Autowired
|
|
@Autowired
|
|
private MktMgmtHandPushService mktMgmtHandPushService;
|
|
private MktMgmtHandPushService mktMgmtHandPushService;
|
|
|
|
|
|
|
|
+ private final MarketingAppsMapper appsMapper;
|
|
|
|
+
|
|
private final RemoteStatUserDataService remoteStatUserDataService;
|
|
private final RemoteStatUserDataService remoteStatUserDataService;
|
|
|
|
|
|
// 添加 RedisTemplate 依赖
|
|
// 添加 RedisTemplate 依赖
|
|
@@ -159,7 +162,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
// 从JSON对象中提取需要的字段
|
|
// 从JSON对象中提取需要的字段
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
- String appId = extractStringFromJson(deviceInfoJson, "appId", bundle);
|
|
|
|
|
|
+ String appId = extractStringFromJson(deviceInfoJson, "appid", bundle);
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
|
|
|
|
@@ -172,8 +175,9 @@ import java.util.stream.Collectors;
|
|
activeUser.setVersion(version);
|
|
activeUser.setVersion(version);
|
|
activeUser.setStatDate(LocalDateTime.now());
|
|
activeUser.setStatDate(LocalDateTime.now());
|
|
|
|
|
|
- R<Boolean> result = remoteStatUserDataService.updateMktStatActiveUser(activeUser);
|
|
|
|
- if (result.getData() == null || !result.getData()) {
|
|
|
|
|
|
+// R<Boolean> result = remoteStatUserDataService.updateMktStatActiveUser(activeUser);
|
|
|
|
+ int result = appsMapper.updateMktStatActiveUser(activeUser);
|
|
|
|
+ if (result > 0) {
|
|
log.error("update活跃用户记录失败:clientID = {}", clientID);
|
|
log.error("update活跃用户记录失败:clientID = {}", clientID);
|
|
} else {
|
|
} else {
|
|
log.debug("update活跃用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
log.debug("update活跃用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
@@ -201,7 +205,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
// 从JSON对象中提取需要的字段
|
|
// 从JSON对象中提取需要的字段
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
- String appId = extractStringFromJson(deviceInfoJson, "appId", bundle);
|
|
|
|
|
|
+ String appId = extractStringFromJson(deviceInfoJson, "appid", bundle);
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
String oldVersion = extractStringFromJson(deviceInfoJson, "oldVersion", "");
|
|
String oldVersion = extractStringFromJson(deviceInfoJson, "oldVersion", "");
|
|
@@ -216,8 +220,10 @@ import java.util.stream.Collectors;
|
|
mktStatNewUser.setOldVersion(oldVersion);
|
|
mktStatNewUser.setOldVersion(oldVersion);
|
|
mktStatNewUser.setStatDate(LocalDateTime.now());
|
|
mktStatNewUser.setStatDate(LocalDateTime.now());
|
|
|
|
|
|
- R<Boolean> result = remoteStatUserDataService.updateMktStatNewUser(mktStatNewUser);
|
|
|
|
- if (result.getData() == null || !result.getData()) {
|
|
|
|
|
|
+// R<Boolean> result = remoteStatUserDataService.updateMktStatNewUser(mktStatNewUser);
|
|
|
|
+ int result = appsMapper.updateMktStatNewUser(mktStatNewUser);
|
|
|
|
+
|
|
|
|
+ if (result > 0) {
|
|
log.error("update新增用户记录失败:clientID = {}", clientID);
|
|
log.error("update新增用户记录失败:clientID = {}", clientID);
|
|
} else {
|
|
} else {
|
|
log.debug("update新增用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
log.debug("update新增用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
@@ -246,7 +252,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
// 从JSON对象中提取需要的字段
|
|
// 从JSON对象中提取需要的字段
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
- String appId = extractStringFromJson(deviceInfoJson, "appId", bundle);
|
|
|
|
|
|
+ String appId = extractStringFromJson(deviceInfoJson, "appid", bundle);
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
|
|
|
|
@@ -259,8 +265,10 @@ import java.util.stream.Collectors;
|
|
activeUser.setVersion(version);
|
|
activeUser.setVersion(version);
|
|
activeUser.setStatDate(LocalDateTime.now());
|
|
activeUser.setStatDate(LocalDateTime.now());
|
|
|
|
|
|
- R<Boolean> result = remoteStatUserDataService.saveMktStatActiveUser(activeUser);
|
|
|
|
- if (result.getData() == null || !result.getData()) {
|
|
|
|
|
|
+// R<Boolean> result = remoteStatUserDataService.saveMktStatActiveUser(activeUser);
|
|
|
|
+ int result = appsMapper.saveMktStatActiveUser(activeUser);
|
|
|
|
+
|
|
|
|
+ if (result > 0) {
|
|
log.error("add活跃用户记录失败:clientID = {}", clientID);
|
|
log.error("add活跃用户记录失败:clientID = {}", clientID);
|
|
} else {
|
|
} else {
|
|
log.debug("add活跃用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
log.debug("add活跃用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
@@ -288,7 +296,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
// 从JSON对象中提取需要的字段
|
|
// 从JSON对象中提取需要的字段
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
|
|
- String appId = extractStringFromJson(deviceInfoJson, "appId", bundle);
|
|
|
|
|
|
+ String appId = extractStringFromJson(deviceInfoJson, "appid", bundle);
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
|
|
String oldVersion = extractStringFromJson(deviceInfoJson, "oldVersion", "");
|
|
String oldVersion = extractStringFromJson(deviceInfoJson, "oldVersion", "");
|
|
@@ -303,8 +311,10 @@ import java.util.stream.Collectors;
|
|
mktStatNewUser.setOldVersion(oldVersion);
|
|
mktStatNewUser.setOldVersion(oldVersion);
|
|
mktStatNewUser.setStatDate(LocalDateTime.now());
|
|
mktStatNewUser.setStatDate(LocalDateTime.now());
|
|
|
|
|
|
- R<Boolean> result = remoteStatUserDataService.saveMktStatNewUser(mktStatNewUser);
|
|
|
|
- if (result.getData() == null || !result.getData()) {
|
|
|
|
|
|
+// R<Boolean> result = remoteStatUserDataService.saveMktStatNewUser(mktStatNewUser);
|
|
|
|
+ int result = appsMapper.saveMktStatNewUser(mktStatNewUser);
|
|
|
|
+
|
|
|
|
+ if (result > 0) {
|
|
log.error("add新增用户记录失败:clientID = {}", clientID);
|
|
log.error("add新增用户记录失败:clientID = {}", clientID);
|
|
} else {
|
|
} else {
|
|
log.debug("add新增用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
log.debug("add新增用户记录成功:clientID = {}, appId = {}, channel = {}", clientID, appId, channel);
|
|
@@ -448,9 +458,6 @@ import java.util.stream.Collectors;
|
|
saveRecordDTO.setPushDomain(reqDto.getClientDomain());
|
|
saveRecordDTO.setPushDomain(reqDto.getClientDomain());
|
|
saveRecordDTO.setClientId(reqDto.getClientID());
|
|
saveRecordDTO.setClientId(reqDto.getClientID());
|
|
|
|
|
|
- s = mktMgmtPushRecordService.saveRecord(saveRecordDTO);
|
|
|
|
- hand = mktMgmtHandPushService.handPush(saveRecordDTO);
|
|
|
|
-
|
|
|
|
// 根据客户端ID查询设备信息
|
|
// 根据客户端ID查询设备信息
|
|
Query query = new Query(Criteria.where("clientID").is(reqDto.getClientID()));
|
|
Query query = new Query(Criteria.where("clientID").is(reqDto.getClientID()));
|
|
Device device = mongoTemplate.findOne(query, Device.class);
|
|
Device device = mongoTemplate.findOne(query, Device.class);
|
|
@@ -458,6 +465,9 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
// 添加用户统计逻辑
|
|
// 添加用户统计逻辑
|
|
updateUserStatistics(reqDto.getClientID());
|
|
updateUserStatistics(reqDto.getClientID());
|
|
|
|
+
|
|
|
|
+ s = mktMgmtPushRecordService.saveRecord(saveRecordDTO);
|
|
|
|
+ hand = mktMgmtHandPushService.handPush(saveRecordDTO);
|
|
}
|
|
}
|
|
|
|
|
|
log.info("保存推送记录:{}--{}", s,hand);
|
|
log.info("保存推送记录:{}--{}", s,hand);
|