Browse Source

Merge branch 'dev/lh' into dev/lwh

lh 1 week ago
parent
commit
3bbaf51cba

+ 6 - 6
pig-marketing/pig-marketing-biz/src/main/java/com/pig4cloud/pig/marketing/service/impl/TcpDataServiceImpl.java

@@ -114,6 +114,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 				Update update = new Update();
 				if (!StringUtils.isBlank(reqDto.getDeviceInfo())) {
 					update.set("deviceInfo", reqDto.getDeviceInfo());
+
+					syncNewUserData(existingDevice, reqDto.getDeviceInfo());
+					synActiveUserData(existingDevice, reqDto.getDeviceInfo());
 				}
 				if (!StringUtils.isBlank(reqDto.getHeadInfo())) {
 					update.set("headInfo", reqDto.getHeadInfo());
@@ -123,17 +126,14 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 
 				mongoTemplate.updateFirst(query, update, Device.class);
 
-				syncNewUserData(existingDevice, reqDto.getDeviceInfo());
-				synUpdateUserData(existingDevice, reqDto.getDeviceInfo());
-
 				return existingDevice.getId();
 			}
 		}
 		return existingDevice.getId();
 	}
 
-	private void synUpdateUserData(Device device, String deviceInfo) {
-		if (device ==null) {
+	private void synActiveUserData(Device device, String deviceInfo) {
+		if(device ==null) {
 			return;
 		}
 		String clientID = device.getClientID();
@@ -241,7 +241,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 		String bundle = extractStringFromJson(deviceInfoJson, "bundle", "");
 		String appId = extractStringFromJson(deviceInfoJson, "appId", bundle);
 		String channel = extractStringFromJson(deviceInfoJson, "channel", "应用市场");
-		String version = extractStringFromJson(deviceInfoJson, "version", "1.0.0");
+		String version = extractStringFromJson(deviceInfoJson, "version", "0.0.0");
 
 		// 同步新增用户数据 -> mysql
 		// 构建mkt_stat_new_user对象

+ 2 - 0
pig-statistics/pig-statistics-biz/src/main/java/com/pig4cloud/pig/statistics/service/impl/UserAnalyseServiceImpl.java

@@ -1178,6 +1178,7 @@ public class UserAnalyseServiceImpl implements UserAnalyseService {
 		updateWrapper.eq(MktStatNewUser::getVersion, "0.0.0");
 		updateWrapper.eq(MktStatNewUser::getChannel, "应用市场");
 		updateWrapper.set(MktStatNewUser::getAppId, data.getAppId());
+		updateWrapper.set(MktStatNewUser::getVersion, data.getVersion());
 		int update = newUserMapper.update(null, updateWrapper);
 		return update == 1;
 	}
@@ -1189,6 +1190,7 @@ public class UserAnalyseServiceImpl implements UserAnalyseService {
 		updateWrapper.eq(MktStatActiveUser::getVersion, "0.0.0");
 		updateWrapper.eq(MktStatActiveUser::getChannel, "应用市场");
 		updateWrapper.set(MktStatActiveUser::getAppId, data.getAppId());
+		updateWrapper.set(MktStatActiveUser::getVersion, data.getVersion());
 		int update = activeUserMapper.update(null, updateWrapper);
 		return update == 1;
 	}