记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
ddeed243
Commit
ddeed243
authored
Jul 31, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into test
parents
57a0a339
72111c05
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
346 additions
and
190 deletions
+346
-190
PlatformDMController.java
...ervice/platform/controller/adam/PlatformDMController.java
+169
-87
DataMigrationProcessorService.java
...m/service/impl/adam/dm/DataMigrationProcessorService.java
+11
-1
DMAddressesProcessor.java
.../service/impl/adam/dm/processor/DMAddressesProcessor.java
+8
-8
DMCollectionProcessor.java
...service/impl/adam/dm/processor/DMCollectionProcessor.java
+8
-8
DMEntersProcessor.java
...orm/service/impl/adam/dm/processor/DMEntersProcessor.java
+8
-8
DMMemberCodeProcessor.java
...service/impl/adam/dm/processor/DMMemberCodeProcessor.java
+8
-8
DMMemberOrderProcessor.java
...ervice/impl/adam/dm/processor/DMMemberOrderProcessor.java
+8
-8
DMRealNameProcessor.java
...m/service/impl/adam/dm/processor/DMRealNameProcessor.java
+8
-8
DMThirdPartsProcessor.java
...service/impl/adam/dm/processor/DMThirdPartsProcessor.java
+8
-8
DMTracesInfoProcessor.java
...service/impl/adam/dm/processor/DMTracesInfoProcessor.java
+13
-13
DMUserInformationProcessor.java
...ce/impl/adam/dm/processor/DMUserInformationProcessor.java
+7
-7
DMUserMemberProcessor.java
...service/impl/adam/dm/processor/DMUserMemberProcessor.java
+8
-8
pom.xml
liquidnet-bus-service/liquidnet-service-sweet/pom.xml
+1
-1
SweetWechatActionCallbackController.java
...sweet/controller/SweetWechatActionCallbackController.java
+24
-4
SweetWechatLoginController.java
.../service/sweet/controller/SweetWechatLoginController.java
+2
-2
SweetWechatTemplateController.java
...rvice/sweet/controller/SweetWechatTemplateController.java
+2
-2
SweetWechatCallbackServiceImpl.java
...ce/sweet/service/impl/SweetWechatCallbackServiceImpl.java
+45
-0
SweetWechatLoginServiceImpl.java
...rvice/sweet/service/impl/SweetWechatLoginServiceImpl.java
+1
-1
SweetWechatTemplateServiceImpl.java
...ce/sweet/service/impl/SweetWechatTemplateServiceImpl.java
+3
-7
WechatSignUtils.java
...va/com/liquidnet/service/sweet/utils/WechatSignUtils.java
+4
-1
No files found.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/adam/PlatformDMController.java
View file @
ddeed243
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/DataMigrationProcessorService.java
View file @
ddeed243
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
;
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
);
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMAddressesProcessor.java
View file @
ddeed243
...
...
@@ -28,7 +28,7 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
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());
...
...
@@ -48,12 +48,12 @@ public class DMAddressesProcessor extends DataMigrationProcessorService {
}
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
Connection connection = null;
PreparedStatement
statement
=
null
;
ResultSetImpl
row
=
null
;
try
{
Class
.
forName
(
DB_DRIVER
);
connection
=
DriverManager
.
getConnection
(
DB_URL
+
DB_NAME_MALL
,
DB_USER
,
DB_PWD
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMCollectionProcessor.java
View file @
ddeed243
...
...
@@ -28,7 +28,7 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.collection:{}"
,
userMapper
.
executeForDM
(
"adam_collection"
));
...
...
@@ -49,12 +49,12 @@ public class DMCollectionProcessor extends DataMigrationProcessorService {
}
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
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
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMEntersProcessor.java
View file @
ddeed243
...
...
@@ -28,7 +28,7 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.enters:{}"
,
userMapper
.
executeForDM
(
"adam_enters"
));
...
...
@@ -51,12 +51,12 @@ public class DMEntersProcessor extends DataMigrationProcessorService {
}
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
Connection connection = null;
PreparedStatement
statement
=
null
;
ResultSetImpl
row
=
null
;
try
{
Class
.
forName
(
DB_DRIVER
);
connection
=
DriverManager
.
getConnection
(
DB_URL
+
DB_NAME_MALL
,
DB_USER
,
DB_PWD
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_MALL, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMMemberCodeProcessor.java
View file @
ddeed243
...
...
@@ -182,7 +182,7 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.member_code:{}"
,
userMapper
.
executeForDM
(
"adam_member_code"
));
...
...
@@ -199,12 +199,12 @@ public class DMMemberCodeProcessor extends DataMigrationProcessorService {
String
sql
=
sqlCount
.
replace
(
"count(1)"
,
field
);
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
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
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMMemberOrderProcessor.java
View file @
ddeed243
...
...
@@ -52,7 +52,7 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.member_order:{}"
,
userMapper
.
executeForDM
(
"adam_member_order"
));
...
...
@@ -74,12 +74,12 @@ public class DMMemberOrderProcessor extends DataMigrationProcessorService {
}
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
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
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMRealNameProcessor.java
View file @
ddeed243
...
...
@@ -28,7 +28,7 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.real_name:{}"
,
userMapper
.
executeForDM
(
"adam_real_name"
));
...
...
@@ -49,12 +49,12 @@ public class DMRealNameProcessor extends DataMigrationProcessorService {
}
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
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
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMThirdPartsProcessor.java
View file @
ddeed243
...
...
@@ -30,7 +30,7 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.third_party:{}"
,
userMapper
.
executeForDM
(
"adam_third_party"
));
...
...
@@ -54,12 +54,12 @@ public class DMThirdPartsProcessor extends DataMigrationProcessorService {
sql
+=
" order by id limit ?,?"
;
LocalDateTime
currentYear
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
parse
(
"2021-01-01 00:00:00"
);
Connection
connection
=
null
;
//
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
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMTracesInfoProcessor.java
View file @
ddeed243
...
...
@@ -32,7 +32,7 @@ public class DMTracesInfoProcessor extends DataMigrationProcessorService {
AdamMemberPriceMapper
memberPriceMapper
;
@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
))
{
log
.
info
(
"DM.flush.member:{}"
,
userMapper
.
executeForDM
(
"adam_member"
));
log
.
info
(
"DM.flush.member_price:{}"
,
userMapper
.
executeForDM
(
"adam_member_price"
));
...
...
@@ -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
()
{
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMUserInformationProcessor.java
View file @
ddeed243
...
...
@@ -47,7 +47,7 @@ public class DMUserInformationProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.user:{}"
,
userMapper
.
executeForDM
(
"adam_user"
));
log
.
info
(
"DM.flush.user_info:{}"
,
userMapper
.
executeForDM
(
"adam_user_info"
));
...
...
@@ -71,12 +71,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
;
//
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
();
...
...
@@ -180,9 +180,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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/service/impl/adam/dm/processor/DMUserMemberProcessor.java
View file @
ddeed243
...
...
@@ -28,7 +28,7 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
@SneakyThrows
@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
))
{
log
.
info
(
"DM.flush.user_member:{}"
,
userMapper
.
executeForDM
(
"adam_user_member"
));
...
...
@@ -49,12 +49,12 @@ public class DMUserMemberProcessor extends DataMigrationProcessorService {
}
sql
+=
" order by id limit ?,?"
;
Connection
connection
=
null
;
//
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
);
//
Class.forName(DB_DRIVER);
//
connection = DriverManager.getConnection(DB_URL + DB_NAME_PASSPORT, DB_USER, DB_PWD);
statement
=
connection
.
prepareStatement
(
sqlCount
);
row
=
(
ResultSetImpl
)
statement
.
executeQuery
();
row
.
first
();
...
...
@@ -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) {
//
}
}
}
liquidnet-bus-service/liquidnet-service-sweet/pom.xml
View file @
ddeed243
...
...
@@ -55,7 +55,7 @@
</dependency>
<dependency>
<groupId>
com.liquidnet
</groupId>
<artifactId>
liquidnet-
api-feign-kylin
</artifactId>
<artifactId>
liquidnet-
service-kylin-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<scope>
compile
</scope>
</dependency>
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetWechatActionCallbackController.java
View file @
ddeed243
package
com
.
liquidnet
.
service
.
sweet
.
controller
;
import
com.liquidnet.service.sweet.service.impl.SweetWechatCallbackServiceImpl
;
import
com.liquidnet.service.sweet.utils.WechatSignUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -15,6 +17,9 @@ import java.io.PrintWriter;
@Slf4j
public
class
SweetWechatActionCallbackController
{
@Autowired
private
SweetWechatCallbackServiceImpl
sweetWechatCallbackService
;
@GetMapping
(
"record"
)
@ApiOperation
(
"get"
)
public
void
record
(
...
...
@@ -26,12 +31,12 @@ public class SweetWechatActionCallbackController {
)
{
try
{
if
(
WechatSignUtils
.
checkSignature
(
signature
,
timestamp
,
nonce
))
{
log
.
info
(
"
ssssssss
"
);
log
.
info
(
"
验签通过
"
);
PrintWriter
out
=
response
.
getWriter
();
out
.
print
(
echostr
);
out
.
close
();
}
else
{
log
.
info
(
"
这里存在非法请求
"
);
log
.
info
(
"
验签未通过
"
);
}
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
());
...
...
@@ -40,7 +45,22 @@ public class SweetWechatActionCallbackController {
@PostMapping
(
"record"
)
@ApiOperation
(
"post"
)
public
void
record
()
{
log
.
info
(
"111111"
);
public
String
record
(
@RequestBody
String
requestBody
,
@RequestParam
(
"signature"
)
String
signature
,
@RequestParam
(
"timestamp"
)
String
timestamp
,
@RequestParam
(
"nonce"
)
String
nonce
,
@RequestParam
(
"openid"
)
String
openid
,
@RequestParam
(
name
=
"encrypt_type"
,
required
=
false
)
String
encType
,
@RequestParam
(
name
=
"msg_signature"
,
required
=
false
)
String
msgSignature
)
{
log
.
info
(
"\n接收微信请求:[openid=[{}], [signature=[{}], encType=[{}], msgSignature=[{}],"
+
" timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] "
,
openid
,
signature
,
encType
,
msgSignature
,
timestamp
,
nonce
,
requestBody
);
if
(!
WechatSignUtils
.
checkSignature
(
signature
,
timestamp
,
nonce
))
{
log
.
info
(
"验签未通过,非法请求,可能属于伪造的请求!"
);
return
""
;
}
return
sweetWechatCallbackService
.
record
(
requestBody
,
timestamp
,
nonce
,
encType
,
msgSignature
);
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetWechatLoginController.java
View file @
ddeed243
package
com
.
liquidnet
.
service
.
sweet
.
controller
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.service.impl.SweetLoginServiceImpl
;
import
com.liquidnet.service.sweet.service.impl.Sweet
Wechat
LoginServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
public
class
SweetWechatLoginController
{
@Autowired
private
SweetLoginServiceImpl
sweetLoginService
;
private
Sweet
Wechat
LoginServiceImpl
sweetLoginService
;
@GetMapping
(
"userInfo"
)
@ApiOperation
(
"code获取用户信息"
)
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/controller/SweetWechatTemplateController.java
View file @
ddeed243
package
com
.
liquidnet
.
service
.
sweet
.
controller
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.sweet.service.impl.SweetTemplateServiceImpl
;
import
com.liquidnet.service.sweet.service.impl.Sweet
Wechat
TemplateServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
public
class
SweetWechatTemplateController
{
@Autowired
private
SweetTemplateServiceImpl
sweetTemplateService
;
private
Sweet
Wechat
TemplateServiceImpl
sweetTemplateService
;
@GetMapping
(
"send"
)
@ApiOperation
(
"发送模版消息"
)
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetWechatCallbackServiceImpl.java
0 → 100644
View file @
ddeed243
package
com
.
liquidnet
.
service
.
sweet
.
service
.
impl
;
import
lombok.extern.slf4j.Slf4j
;
import
me.chanjar.weixin.mp.api.WxMpMessageRouter
;
import
me.chanjar.weixin.mp.api.WxMpService
;
import
me.chanjar.weixin.mp.api.impl.WxMpServiceImpl
;
import
me.chanjar.weixin.mp.bean.message.WxMpXmlMessage
;
import
me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage
;
import
me.chanjar.weixin.mp.config.WxMpConfigStorage
;
import
me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 公众号动作回调 服务实现类
* </p>
*
* @author liquidnet
* @since 2021-07-31
*/
@Service
@Slf4j
public
class
SweetWechatCallbackServiceImpl
{
/*@Autowired
private WxMpMessageRouter wxMpMessageRouter;*/
public
String
record
(
String
requestBody
,
String
timestamp
,
String
nonce
,
String
encType
,
String
msgSignature
)
{
/*String out = null;
if (encType == null) {
// 明文传输的消息
WxMpXmlMessage inMessage = WxMpXmlMessage.fromXml(requestBody);
WxMpXmlOutMessage outMessage = wxMpMessageRouter.route(inMessage);
if (outMessage == null) {
return "";
}
out = outMessage.toXml();
}
log.info("\n组装回复信息:[{}]", out);
return out;*/
return
""
;
}
}
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetLoginServiceImpl.java
→
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/Sweet
Wechat
LoginServiceImpl.java
View file @
ddeed243
...
...
@@ -24,7 +24,7 @@ import java.util.Objects;
* @since 2021-07-27
*/
@Service
public
class
SweetLoginServiceImpl
{
public
class
Sweet
Wechat
LoginServiceImpl
{
@Value
(
"${liquidnet.wechat.applet.strawberry.appid}"
)
private
String
strawberryAppid
;
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/SweetTemplateServiceImpl.java
→
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/service/impl/Sweet
Wechat
TemplateServiceImpl.java
View file @
ddeed243
...
...
@@ -2,7 +2,7 @@ package com.liquidnet.service.sweet.service.impl;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.
feign.kylin.api.FeignKylinPerformanceClien
t
;
import
com.liquidnet.service.
kylin.constant.KylinRedisCons
t
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
com.liquidnet.service.sweet.constant.SweetConstant
;
import
com.liquidnet.service.sweet.utils.RedisDataUtils
;
...
...
@@ -31,7 +31,7 @@ import java.util.Set;
* @since 2021-07-27
*/
@Service
public
class
SweetTemplateServiceImpl
{
public
class
Sweet
Wechat
TemplateServiceImpl
{
@Value
(
"${liquidnet.wechat.zhengzai.service.appid}"
)
private
String
appid
;
...
...
@@ -45,9 +45,6 @@ public class SweetTemplateServiceImpl {
@Autowired
private
RedisUtil
redisUtil
;
@Autowired
private
FeignKylinPerformanceClient
feignKylinPerformanceClient
;
public
ResponseDto
send
(
String
templateId
)
{
String
redisKey
=
SweetConstant
.
REDIS_KEY_SWEET_REMIND_ALL
;
Set
<
String
>
keys
=
redisTemplate
.
keys
(
redisKey
);
...
...
@@ -103,8 +100,7 @@ public class SweetTemplateServiceImpl {
}
public
ResponseDto
remind
(
String
openId
,
String
unionId
,
String
performancesId
)
{
ResponseDto
<
KylinPerformanceVo
>
performanceVo
=
feignKylinPerformanceClient
.
detail
(
performancesId
);
KylinPerformanceVo
performanceInfo
=
performanceVo
.
getData
();
KylinPerformanceVo
performanceInfo
=
(
KylinPerformanceVo
)
redisUtil
.
get
(
KylinRedisConst
.
PERFORMANCES
);
redisDataUtils
.
setSweetRemind
(
openId
,
unionId
,
performancesId
,
performanceInfo
);
return
ResponseDto
.
success
();
}
...
...
liquidnet-bus-service/liquidnet-service-sweet/src/main/java/com/liquidnet/service/sweet/utils/WechatSignUtils.java
View file @
ddeed243
package
com
.
liquidnet
.
service
.
sweet
.
utils
;
import
org.springframework.beans.factory.annotation.Value
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Arrays
;
...
...
@@ -15,7 +17,8 @@ import java.util.Arrays;
public
class
WechatSignUtils
{
// 与接口配置信息中的 Token 要一致
private
static
String
token
=
"tftipg1427706847"
;
@Value
(
"${liquidnet.wechat.zhengzai.service.token}"
)
private
static
String
token
;
/**
* 验证签名
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment