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

Commit 2e00bf93 authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/dev' into dev

parents a81d1cdc ea94bbaa
package com.liquidnet.service.platform.service.impl.adam.dm;
import com.liquidnet.service.adam.mapper.AdamUserMapper;
import lombok.SneakyThrows;
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.Arrays;
import java.util.List;
......@@ -36,5 +40,11 @@ public abstract class DataMigrationProcessorService {
@Autowired
public AdamUserMapper userMapper;
@SneakyThrows
public Connection getConnection() {
Class.forName(DB_DRIVER);
return DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD);
}
protected abstract void dataProcessing(Integer dg, Integer lS, String incrDt, String flg, String flu);
}
......@@ -118,7 +118,7 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -128,9 +128,9 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -109,7 +109,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -119,9 +119,9 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -122,7 +122,7 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -132,9 +132,9 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -273,7 +273,7 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -283,9 +283,9 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -154,7 +154,7 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -164,9 +164,9 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -121,7 +121,7 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -131,9 +131,9 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -130,7 +130,7 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -140,9 +140,9 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -106,10 +106,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
@SneakyThrows
......@@ -165,10 +165,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
@SneakyThrows
......@@ -207,10 +207,10 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
private void setRdsCache() {
......
......@@ -70,13 +70,12 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
}
sql += " order by uid limit ?,?";
LocalDateTime currentYear = DateUtil.Formatter.yyyyMMddHHmmss.parse("2021-01-01 00:00:00");
Connection connection = null;
PreparedStatement statement = null;
ResultSetImpl row = null;
try {
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);
row = (ResultSetImpl) statement.executeQuery();
row.first();
......@@ -170,7 +169,7 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
}
log.info("DM.execute.counts:{}/{},{} ~ {} ----------------------------> end", pl, num, pSize, tl);
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -180,9 +179,9 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -127,7 +127,7 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
dmRdmService.setMaxMemberNo(Integer.parseInt(max.getMemberNo()));
}
} catch (Exception e) {
log.error("ex:getConnection,dG/dg:{}/{},msg:{}", dG, dg, e.getMessage());
log.error("ex:getConnection,dG/dg:{}/{}", dG, dg, e);
}
try {
if (null != row) row.close();
......@@ -137,9 +137,9 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
if (null != statement) statement.close();
} catch (SQLException ignored) {
}
try {
if (null != connection) connection.close();
} catch (SQLException ignored) {
}
// try {
// if (null != connection) connection.close();
// } catch (SQLException ignored) {
// }
}
}
......@@ -85,11 +85,17 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
@Override
public ResponseDto<String> create(String merchantId, String name, String pwd, String mobile) {
try {
int count = checkUserMapper.selectCount(Wrappers.lambdaQuery(KylinCheckUser.class).eq(KylinCheckUser::getMobile,mobile));
if(count>0){
return ResponseDto.failure("手机号已存在");
}
KylinCheckUser checkUser = KylinCheckUser.getNew();
checkUser.setName(name);
checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes()));
checkUser.setMobile(mobile);
checkUser.setCheckUserId(IDGenerator.nextSnowId().toString());
checkUser.setCheckUserId(IDGenerator.nextSnowId());
checkUser.setCreatedAt(LocalDateTime.now());
checkUser.setMerchantId(merchantId);
checkUser.setStatus(1);
......@@ -108,6 +114,11 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
@Override
public ResponseDto<String> change(String merchantId, String checkUserId, String name, String pwd, String mobile) {
try {
KylinCheckUser kylinCheckUser = checkUserMapper.selectOne(Wrappers.lambdaQuery(KylinCheckUser.class).eq(KylinCheckUser::getMobile,mobile));
if(kylinCheckUser!=null && !kylinCheckUser.getCheckUserId().equals(checkUserId)){
return ResponseDto.failure("手机号已存在");
}
KylinCheckUser checkUser = KylinCheckUser.getNew();
checkUser.setName(name);
if (null != pwd) {
......
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