Commit 3e4cb4ec by jinfeng.wang

fix

parent 8c28a4e4
...@@ -3,6 +3,7 @@ package com.mobvista.apptag.utils; ...@@ -3,6 +3,7 @@ package com.mobvista.apptag.utils;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import org.apache.commons.lang3.StringUtils;
import java.sql.*; import java.sql.*;
import java.text.DecimalFormat; import java.text.DecimalFormat;
...@@ -154,10 +155,13 @@ public class StorageTag { ...@@ -154,10 +155,13 @@ public class StorageTag {
while (resultSet.next()) { while (resultSet.next()) {
String packageName = resultSet.getString("package_name"); String packageName = resultSet.getString("package_name");
String appName = resultSet.getString("app_name"); String appName = resultSet.getString("app_name");
if (StringUtils.isNotBlank(appName)) {
appName = appName.replaceAll("'", "\'");
}
String platform = resultSet.getString("platform"); String platform = resultSet.getString("platform");
String tag = resultSet.getString("tag"); String tag = resultSet.getString("tag");
insertSql.append("('").append(packageName).append("','").append(appName.replaceAll("'", "\'")).append("','").append(platform).append("','").append(tag) insertSql.append("('").append(packageName).append("','").append(appName).append("','").append(platform).append("','").append(tag)
.append("','").append(sdf.format(new Date())).append("'),"); .append("','").append(sdf.format(new Date())).append("'),");
packageSet.add(packageName); packageSet.add(packageName);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment