Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qg-bl-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
qg-bl-service
Commits
08d9d4e6
Commit
08d9d4e6
authored
Apr 28, 2020
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
原因code码表修改,结果表数据修改
parent
e60adb61
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
224 additions
and
11 deletions
+224
-11
BlackGreyListResult.java
...ository/mybatis/entity/blacklist/BlackGreyListResult.java
+2
-0
BlackListToolsManagerServiceImpl.java
...ervice/service/impl/BlackListToolsManagerServiceImpl.java
+149
-9
JdbcExecuters.java
...a/cn/quantgroup/qgblservice/utils/jdbc/JdbcExecuters.java
+73
-2
No files found.
src/main/java/cn/quantgroup/qgblservice/repository/mybatis/entity/blacklist/BlackGreyListResult.java
View file @
08d9d4e6
...
@@ -43,6 +43,8 @@ public class BlackGreyListResult implements Serializable {
...
@@ -43,6 +43,8 @@ public class BlackGreyListResult implements Serializable {
@JsonIgnore
@JsonIgnore
private
Timestamp
updatedAt
;
private
Timestamp
updatedAt
;
private
Long
Id
;
public
static
Set
<
String
>
typesToSet
(
String
oldTypesStr
,
String
newType
){
public
static
Set
<
String
>
typesToSet
(
String
oldTypesStr
,
String
newType
){
...
...
src/main/java/cn/quantgroup/qgblservice/service/impl/BlackListToolsManagerServiceImpl.java
View file @
08d9d4e6
This diff is collapsed.
Click to expand it.
src/main/java/cn/quantgroup/qgblservice/utils/jdbc/JdbcExecuters.java
View file @
08d9d4e6
package
cn
.
quantgroup
.
qgblservice
.
utils
.
jdbc
;
package
cn
.
quantgroup
.
qgblservice
.
utils
.
jdbc
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.blacklist.BlackGreyListDetails
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.blacklist.BlackGreyListDetails
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.blacklist.BlackGreyListResult
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.BlackListQueryTidbVo0
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.BlackListQueryTidbVo0
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.TmpBlackGreyList
;
import
cn.quantgroup.qgblservice.repository.mybatis.entity.tidb.TmpBlackGreyList
;
import
cn.quantgroup.qgblservice.utils.MD5Util
;
import
cn.quantgroup.qgblservice.utils.MD5Util
;
...
@@ -256,8 +257,18 @@ public class JdbcExecuters {
...
@@ -256,8 +257,18 @@ public class JdbcExecuters {
return
atomicInteger
.
get
();
return
atomicInteger
.
get
();
}
}
//批量修改灰名单详情表
/**
public
static
int
updateBatchExecute
(
List
<
BlackGreyListDetails
>
detailsList
,
JdbcTemplate
jdbcTemplate
,
String
type
)
{
* -----------------------------------------------------------------------------<br>
* 描 述: 批量修改灰名单详情表 <br>
* 创建人: yanhui.Hao <br>
* 创建时间: 2020.04.28 10:37 <br>
* 最后修改人: <br>
* 最后修改时间: 2020.04.28 10:37 <br>
* 入参说明: <br>
* 出参说明: <br>
* -----------------------------------------------------------------------------
*/
public
static
int
updateBatchDetailExecute
(
List
<
BlackGreyListDetails
>
detailsList
,
JdbcTemplate
jdbcTemplate
,
String
type
)
{
Connection
conn
=
null
;
Connection
conn
=
null
;
PreparedStatement
ps
=
null
;
PreparedStatement
ps
=
null
;
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
...
@@ -307,6 +318,66 @@ public class JdbcExecuters {
...
@@ -307,6 +318,66 @@ public class JdbcExecuters {
return
atomicInteger
.
get
();
return
atomicInteger
.
get
();
}
}
/**
* -----------------------------------------------------------------------------<br>
* 描 述: 批量修改灰名单-结果表 <br>
* 创建人: yanhui.Hao <br>
* 创建时间: 2020.04.28 10:37 <br>
* 最后修改人: <br>
* 最后修改时间: 2020.04.28 10:37 <br>
* 入参说明: <br>
* 出参说明: <br>
* -----------------------------------------------------------------------------
*/
public
static
int
updateBatchResultExecute
(
List
<
BlackGreyListResult
>
resultList
,
JdbcTemplate
jdbcTemplate
,
String
type
)
{
Connection
conn
=
null
;
PreparedStatement
ps
=
null
;
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
String
sql_updat_result_reasons
=
"update black_grey_list_result r set r.reasons=? where r.id=? "
;
String
sql_run
=
""
;
if
(
"updat_result_reasons"
.
equals
(
type
)){
sql_run
=
sql_updat_result_reasons
;
}
else
{
new
SQLException
(
"参数错误,必须传!"
);
}
try
{
conn
=
jdbcTemplate
.
getDataSource
().
getConnection
();
ps
=
conn
.
prepareStatement
(
sql_run
);
conn
.
setAutoCommit
(
false
);
for
(
int
i
=
0
;
i
<
resultList
.
size
();
i
++)
{
if
(
"updat_result_reasons"
.
equals
(
type
)){
BlackGreyListResult
bean
=
resultList
.
get
(
i
);
ps
.
setString
(
1
,
bean
.
getReasons
());
ps
.
setLong
(
2
,
bean
.
getId
());
}
else
{
new
SQLException
(
"参数错误,必须传!"
);
}
ps
.
addBatch
();
atomicInteger
.
getAndIncrement
();
if
(
i
>
0
&&
i
%
500
==
0
)
{
ps
.
executeBatch
();
conn
.
commit
();
ps
.
clearBatch
();
}
}
ps
.
executeBatch
();
conn
.
commit
();
}
catch
(
Exception
e
)
{
log
.
error
(
"方法updateBatchExecute批量修改数据异常, type: {} "
,
type
,
e
);
return
0
;
}
finally
{
close
(
conn
,
ps
,
null
);
}
return
atomicInteger
.
get
();
}
/**
/**
* 关闭资源
* 关闭资源
...
...
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