Răsfoiți Sursa

fix: 修复列名中英文映射

weijianghai 2 ani în urmă
părinte
comite
1e070d09ce
2 a modificat fișierele cu 24 adăugiri și 9 ștergeri
  1. 18 6
      pom.xml
  2. 6 3
      src/main/java/com/nokia/hb/utils/DbUtil.java

+ 18 - 6
pom.xml

@@ -54,14 +54,12 @@
 		<dependency>
 			<groupId>org.postgresql</groupId>
 			<artifactId>postgresql</artifactId>
-			<version>42.3.5</version>
+			<scope>runtime</scope>
 		</dependency>
-		<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
 		<dependency>
 			<groupId>org.projectlombok</groupId>
 			<artifactId>lombok</artifactId>
-			<version>1.18.24</version>
-			<scope>provided</scope>
+			<optional>true</optional>
 		</dependency>
 		<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
 		<dependency>
@@ -91,14 +89,28 @@
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-resources-plugin</artifactId>
-				<version>2.7</version>
+				<version>3.3.0</version>
 			</plugin>
 			<plugin>
 				<groupId>org.springframework.boot</groupId>
 				<artifactId>spring-boot-maven-plugin</artifactId>
-				<version>2.5.4</version>
+				<version>${project.parent.version}</version>
+				<executions>
+					<execution>
+						<id>repackage</id>
+						<goals>
+							<goal>repackage</goal>
+						</goals>
+					</execution>
+				</executions>
 				<configuration>
 					<fork>true</fork>
+					<excludes>
+						<exclude>
+							<groupId>org.projectlombok</groupId>
+							<artifactId>lombok</artifactId>
+						</exclude>
+					</excludes>
 				</configuration>
 			</plugin>
 		</plugins>

+ 6 - 3
src/main/java/com/nokia/hb/utils/DbUtil.java

@@ -94,7 +94,7 @@ public class DbUtil {
             for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                 columnName = rsmd.getColumnName(i);
                 heads.add(columnName);
-                cols.add(new Col(columnName, (String) ezMap.get(columnName)));
+                cols.add(new Col(columnName, ezMap.get(columnName)));
             }
             while (rs.next()) {
                 Map<String, String> m = new HashMap<>();
@@ -117,6 +117,7 @@ public class DbUtil {
         log.debug("quxians: {}", quxians);
         log.debug("ttype: {}", ttype);
         log.debug("sdate: {}", sdate);
+        Map<String, String> ezMap = initZnEnMap();
         // 获取城市数组
         String[] cityArray = StringUtils.delete(citys, "'").split(",");
         // 获取拥有的城市权限
@@ -135,7 +136,9 @@ public class DbUtil {
         String startTime = timeArray[0];
         String endTime = timeArray[1];
 
-        String sql = "select b.* from (select eci from pm_parse.per_cfg_cell where quxian in (" + quxians + ")) a"
+        String sql = "select a.cellname, a.city, a.quxian, a.vendor, b.*"
+                + " from (select eci, cellname, city, quxian, vendor from pm_parse.per_cfg_cell"
+                    + " where quxian in (" + quxians + ")) a"
                 + " inner join (select " + indicators + " from pm_parse.pm_4g_" + ttype
                 + " where sdate >= '" + startTime
                 + "' and sdate <= '" + endTime + "') b"
@@ -154,7 +157,7 @@ public class DbUtil {
             for (int i = 1; i <= rsmd.getColumnCount(); i++) {
                 String columnName = rsmd.getColumnName(i);
                 heads.add(columnName);
-                cols.add(new Col(columnName, columnName));
+                cols.add(new Col(columnName, ezMap.get(columnName)));
             }
             while (rs.next()) {
                 Map<String, String> m = new HashMap<>();