记得上下班打卡 | git大法好,push需谨慎

Commit f46e651e authored by 张国柄's avatar 张国柄

dm;

parent b7d6d5f7
...@@ -16,6 +16,8 @@ import org.springframework.validation.annotation.Validated; ...@@ -16,6 +16,8 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.sql.Connection;
import java.sql.SQLException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.temporal.ChronoField; import java.time.temporal.ChronoField;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
...@@ -74,20 +76,28 @@ public class PlatformDMController { ...@@ -74,20 +76,28 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
Connection connection = dmUserInformationProcessor.getConnection();
log.info("===dG:{},incrDt:{},flg:{},flu:{}", dG, incrDt, flg, flu); log.info("===dG:{},incrDt:{},flg:{},flu:{}", dG, incrDt, flg, flu);
if (null != dG) { try {
ExecutorService exec = Executors.newFixedThreadPool(dG); if (null != dG) {
for (int i = 0; i < dG; i++) { ExecutorService exec = Executors.newFixedThreadPool(dG);
final int k = i; for (int i = 0; i < dG; i++) {
exec.execute(() -> { final int k = i;
log.info("==================" + k); exec.execute(() -> {
dmUserInformationProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); log.info("==================" + k);
}); dmUserInformationProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} });
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmUserInformationProcessor.dataProcessing(connection,null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmUserInformationProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -103,19 +113,27 @@ public class PlatformDMController { ...@@ -103,19 +113,27 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
if (null != dG) { Connection connection = dmUserInformationProcessor.getConnection();
ExecutorService exec = Executors.newFixedThreadPool(dG); try {
for (int i = 0; i < dG; i++) { if (null != dG) {
final int k = i; ExecutorService exec = Executors.newFixedThreadPool(dG);
exec.execute(() -> { for (int i = 0; i < dG; i++) {
log.info("==================" + k); final int k = i;
dmThirdPartsProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); exec.execute(() -> {
}); log.info("==================" + k);
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} dmThirdPartsProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
});
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmThirdPartsProcessor.dataProcessing(connection,null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmThirdPartsProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -131,19 +149,27 @@ public class PlatformDMController { ...@@ -131,19 +149,27 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
if (null != dG) { Connection connection = dmUserInformationProcessor.getConnection();
ExecutorService exec = Executors.newFixedThreadPool(dG); try {
for (int i = 0; i < dG; i++) { if (null != dG) {
final int k = i; ExecutorService exec = Executors.newFixedThreadPool(dG);
exec.execute(() -> { for (int i = 0; i < dG; i++) {
log.info("==================" + k); final int k = i;
dmRealNameProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); exec.execute(() -> {
}); log.info("==================" + k);
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} dmRealNameProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
});
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmRealNameProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmRealNameProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -159,19 +185,27 @@ public class PlatformDMController { ...@@ -159,19 +185,27 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
if (null != dG) { Connection connection = dmUserInformationProcessor.getConnection();
ExecutorService exec = Executors.newFixedThreadPool(dG); try {
for (int i = 0; i < dG; i++) { if (null != dG) {
final int k = i; ExecutorService exec = Executors.newFixedThreadPool(dG);
exec.execute(() -> { for (int i = 0; i < dG; i++) {
log.info("==================" + k); final int k = i;
dmCollectionProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); exec.execute(() -> {
}); log.info("==================" + k);
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} dmCollectionProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
});
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmCollectionProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmCollectionProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -187,19 +221,27 @@ public class PlatformDMController { ...@@ -187,19 +221,27 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
if (null != dG) { Connection connection = dmUserInformationProcessor.getConnection();
ExecutorService exec = Executors.newFixedThreadPool(dG); try {
for (int i = 0; i < dG; i++) { if (null != dG) {
final int k = i; ExecutorService exec = Executors.newFixedThreadPool(dG);
exec.execute(() -> { for (int i = 0; i < dG; i++) {
log.info("==================" + k); final int k = i;
dmEntersProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); exec.execute(() -> {
}); log.info("==================" + k);
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} dmEntersProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
});
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmEntersProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmEntersProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -215,19 +257,27 @@ public class PlatformDMController { ...@@ -215,19 +257,27 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
if (null != dG) { Connection connection = dmUserInformationProcessor.getConnection();
ExecutorService exec = Executors.newFixedThreadPool(dG); try {
for (int i = 0; i < dG; i++) { if (null != dG) {
final int k = i; ExecutorService exec = Executors.newFixedThreadPool(dG);
exec.execute(() -> { for (int i = 0; i < dG; i++) {
log.info("==================" + k); final int k = i;
dmAddressesProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); exec.execute(() -> {
}); log.info("==================" + k);
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} dmAddressesProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
});
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmAddressesProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmAddressesProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -243,19 +293,27 @@ public class PlatformDMController { ...@@ -243,19 +293,27 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
if (null != dG) { Connection connection = dmUserInformationProcessor.getConnection();
ExecutorService exec = Executors.newFixedThreadPool(dG); try {
for (int i = 0; i < dG; i++) { if (null != dG) {
final int k = i; ExecutorService exec = Executors.newFixedThreadPool(dG);
exec.execute(() -> { for (int i = 0; i < dG; i++) {
log.info("==================" + k); final int k = i;
dmUserMemberProcessor.dataProcessing(k, dG, null, null, k == 0 ? "1" : ""); exec.execute(() -> {
}); log.info("==================" + k);
try { Thread.sleep(100L); } catch (InterruptedException ignored) {} dmUserMemberProcessor.dataProcessing(connection, k, dG, null, null, k == 0 ? "1" : "");
});
try { Thread.sleep(100L); } catch (InterruptedException ignored) {}
}
exec.shutdown();
} else {
dmUserMemberProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
}
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
} }
exec.shutdown();
} else {
dmUserMemberProcessor.dataProcessing(null, null, incrDt, flg, flu);
} }
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -268,7 +326,15 @@ public class PlatformDMController { ...@@ -268,7 +326,15 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
dmMemberOrderProcessor.dataProcessing(null, null, incrDt, flg, flu); Connection connection = dmUserInformationProcessor.getConnection();
try {
dmMemberOrderProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
}
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -280,7 +346,15 @@ public class PlatformDMController { ...@@ -280,7 +346,15 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
dmMemberCodeProcessor.dataProcessing(null, null, incrDt, flg, flu); Connection connection = dmUserInformationProcessor.getConnection();
try {
dmMemberCodeProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
}
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
...@@ -292,7 +366,15 @@ public class PlatformDMController { ...@@ -292,7 +366,15 @@ public class PlatformDMController {
@RequestParam(required = false) String flg, @RequestParam(required = false) String flg,
@RequestParam(required = false) String flu @RequestParam(required = false) String flu
) { ) {
dmTracesInfoProcessor.dataProcessing(null, null, incrDt, flg, flu); Connection connection = dmUserInformationProcessor.getConnection();
try {
dmTracesInfoProcessor.dataProcessing(connection, null, null, incrDt, flg, flu);
} finally {
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
}
return ResponseDto.success(dG); return ResponseDto.success(dG);
} }
} }
package com.liquidnet.service.platform.service.impl.adam.dm; package com.liquidnet.service.platform.service.impl.adam.dm;
import com.liquidnet.service.adam.mapper.AdamUserMapper; import com.liquidnet.service.adam.mapper.AdamUserMapper;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -36,5 +40,11 @@ public abstract class DataMigrationProcessorService { ...@@ -36,5 +40,11 @@ public abstract class DataMigrationProcessorService {
@Autowired @Autowired
public AdamUserMapper userMapper; public AdamUserMapper userMapper;
protected abstract void dataProcessing(Integer dg, Integer lS, String incrDt, String flg, String flu); @SneakyThrows
public Connection getConnection() {
Class.forName(DB_DRIVER);
return DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD);
}
protected abstract void dataProcessing(Connection connection, Integer dg, Integer lS, String incrDt, String flg, String flu);
} }
...@@ -28,7 +28,7 @@ public class DMAddressesProcessor extends DataMigrationProcessorService { ...@@ -28,7 +28,7 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.addresses:{}", userMapper.executeForDM("adam_addresses")); log.info("DM.flush.addresses:{}", userMapper.executeForDM("adam_addresses"));
// log.info("DM.flush.AdamAddressesVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamAddressesVo.class.getSimpleName()).getDeletedCount()); // log.info("DM.flush.AdamAddressesVo:{}", mongoTemplate.remove(Query.query(Criteria.where("_id").exists(true)), AdamAddressesVo.class.getSimpleName()).getDeletedCount());
...@@ -48,12 +48,12 @@ public class DMAddressesProcessor extends DataMigrationProcessorService { ...@@ -48,12 +48,12 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
} }
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -128,9 +128,9 @@ public class DMAddressesProcessor extends DataMigrationProcessorService { ...@@ -128,9 +128,9 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -28,7 +28,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService { ...@@ -28,7 +28,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.collection:{}", userMapper.executeForDM("adam_collection")); log.info("DM.flush.collection:{}", userMapper.executeForDM("adam_collection"));
...@@ -49,12 +49,12 @@ public class DMCollectionProcessor extends DataMigrationProcessorService { ...@@ -49,12 +49,12 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
} }
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -119,9 +119,9 @@ public class DMCollectionProcessor extends DataMigrationProcessorService { ...@@ -119,9 +119,9 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -28,7 +28,7 @@ public class DMEntersProcessor extends DataMigrationProcessorService { ...@@ -28,7 +28,7 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.enters:{}", userMapper.executeForDM("adam_enters")); log.info("DM.flush.enters:{}", userMapper.executeForDM("adam_enters"));
...@@ -51,12 +51,12 @@ public class DMEntersProcessor extends DataMigrationProcessorService { ...@@ -51,12 +51,12 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
} }
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -132,9 +132,9 @@ public class DMEntersProcessor extends DataMigrationProcessorService { ...@@ -132,9 +132,9 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -182,7 +182,7 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService { ...@@ -182,7 +182,7 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.member_code:{}", userMapper.executeForDM("adam_member_code")); log.info("DM.flush.member_code:{}", userMapper.executeForDM("adam_member_code"));
...@@ -199,12 +199,12 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService { ...@@ -199,12 +199,12 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
String sql = sqlCount.replace("count(1)", field); String sql = sqlCount.replace("count(1)", field);
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -283,9 +283,9 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService { ...@@ -283,9 +283,9 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -52,7 +52,7 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService { ...@@ -52,7 +52,7 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.member_order:{}", userMapper.executeForDM("adam_member_order")); log.info("DM.flush.member_order:{}", userMapper.executeForDM("adam_member_order"));
...@@ -74,12 +74,12 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService { ...@@ -74,12 +74,12 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
} }
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -164,9 +164,9 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService { ...@@ -164,9 +164,9 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -28,7 +28,7 @@ public class DMRealNameProcessor extends DataMigrationProcessorService { ...@@ -28,7 +28,7 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.real_name:{}", userMapper.executeForDM("adam_real_name")); log.info("DM.flush.real_name:{}", userMapper.executeForDM("adam_real_name"));
...@@ -49,12 +49,12 @@ public class DMRealNameProcessor extends DataMigrationProcessorService { ...@@ -49,12 +49,12 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
} }
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -131,9 +131,9 @@ public class DMRealNameProcessor extends DataMigrationProcessorService { ...@@ -131,9 +131,9 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -30,7 +30,7 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService { ...@@ -30,7 +30,7 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.third_party:{}", userMapper.executeForDM("adam_third_party")); log.info("DM.flush.third_party:{}", userMapper.executeForDM("adam_third_party"));
...@@ -54,12 +54,12 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService { ...@@ -54,12 +54,12 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
LocalDateTime currentYear = DateUtil.Formatter.yyyyMMddHHmmss.parse("2021-01-01 00:00:00"); LocalDateTime currentYear = DateUtil.Formatter.yyyyMMddHHmmss.parse("2021-01-01 00:00:00");
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -140,9 +140,9 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService { ...@@ -140,9 +140,9 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -32,7 +32,7 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService { ...@@ -32,7 +32,7 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
AdamMemberPriceMapper memberPriceMapper; AdamMemberPriceMapper memberPriceMapper;
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.member:{}", userMapper.executeForDM("adam_member")); log.info("DM.flush.member:{}", userMapper.executeForDM("adam_member"));
log.info("DM.flush.member_price:{}", userMapper.executeForDM("adam_member_price")); log.info("DM.flush.member_price:{}", userMapper.executeForDM("adam_member_price"));
...@@ -106,10 +106,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService { ...@@ -106,10 +106,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
@SneakyThrows @SneakyThrows
...@@ -165,10 +165,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService { ...@@ -165,10 +165,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
@SneakyThrows @SneakyThrows
...@@ -207,10 +207,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService { ...@@ -207,10 +207,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
private void setRdsCache() { private void setRdsCache() {
......
...@@ -47,7 +47,7 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService { ...@@ -47,7 +47,7 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.user:{}", userMapper.executeForDM("adam_user")); log.info("DM.flush.user:{}", userMapper.executeForDM("adam_user"));
log.info("DM.flush.user_info:{}", userMapper.executeForDM("adam_user_info")); log.info("DM.flush.user_info:{}", userMapper.executeForDM("adam_user_info"));
...@@ -71,12 +71,12 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService { ...@@ -71,12 +71,12 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
sql += " order by uid limit ?,?"; sql += " order by uid limit ?,?";
LocalDateTime currentYear = DateUtil.Formatter.yyyyMMddHHmmss.parse("2021-01-01 00:00:00"); LocalDateTime currentYear = DateUtil.Formatter.yyyyMMddHHmmss.parse("2021-01-01 00:00:00");
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -180,9 +180,9 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService { ...@@ -180,9 +180,9 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
...@@ -28,7 +28,7 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService { ...@@ -28,7 +28,7 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
@SneakyThrows @SneakyThrows
@Override @Override
public void dataProcessing(Integer dg, Integer dG, String incrDt, String flg, String flu) { public void dataProcessing(Connection connection, Integer dg, Integer dG, String incrDt, String flg, String flu) {
if (StringUtils.isNotEmpty(flu)) { if (StringUtils.isNotEmpty(flu)) {
log.info("DM.flush.user_member:{}", userMapper.executeForDM("adam_user_member")); log.info("DM.flush.user_member:{}", userMapper.executeForDM("adam_user_member"));
...@@ -49,12 +49,12 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService { ...@@ -49,12 +49,12 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
} }
sql += " order by id limit ?,?"; sql += " order by id limit ?,?";
Connection connection = null; // Connection connection = null;
PreparedStatement statement = null; PreparedStatement statement = null;
ResultSetImpl row = null; ResultSetImpl row = null;
try { try {
Class.forName(DB_DRIVER); // Class.forName(DB_DRIVER);
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD); // connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement = connection.prepareStatement(sqlCount); statement = connection.prepareStatement(sqlCount);
row = (ResultSetImpl) statement.executeQuery(); row = (ResultSetImpl) statement.executeQuery();
row.first(); row.first();
...@@ -137,9 +137,9 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService { ...@@ -137,9 +137,9 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close(); if (null != statement) statement.close();
} catch (SQLException ignored) { } catch (SQLException ignored) {
} }
try { // try {
if (null != connection) connection.close(); // if (null != connection) connection.close();
} catch (SQLException ignored) { // } catch (SQLException ignored) {
} // }
} }
} }
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