Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
manager
Project
Overview
Details
Activity
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
reyun
manager
Commits
1819eaab
Commit
1819eaab
authored
5 years ago
by
kangxiaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合同导入
parent
563457bb
master
…
0727_bugfix
1082_bugfix
1151_bugfix
1209_bugfix
1315_bugfix
1439_bugfix
1608_bugfix
1608_from_1619
1619_bugfix
1990_bugfix
2578_bugfix
2580_fix
649_bugfix
bigfix_20201028
bugfix_1608_new
bugfix_1760
bugfix_master_1760
change_double
liushaowei
master_mv
mobvista_master
month_flow
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
ContractServiceImpl.java
src/main/java/common/service/impl/ContractServiceImpl.java
+26
-8
No files found.
src/main/java/common/service/impl/ContractServiceImpl.java
View file @
1819eaab
...
...
@@ -179,7 +179,6 @@ public class ContractServiceImpl implements ContractService {
TransactionUtils
transactionUtils
;
@Override
public
Map
<
String
,
Object
>
checkAccount
(
String
email
,
String
platfrom
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
...
...
@@ -2124,7 +2123,10 @@ public class ContractServiceImpl implements ContractService {
}
int
row_already
=
titleKey
.
size
();
String
extend_row_sql
=
"platform,product,my_body_code,create_time"
;
String
extend_row_sql
=
"platform,product,my_body_code,create_time,code_num,type,status,ds,"
+
"create_account,create_name,extra_flow,relation_contract,invoice_money,first_back_id"
;
int
extend_size
=
extend_row_sql
.
split
(
","
).
length
;
DataFormatter
formatter
=
new
DataFormatter
();
int
rowNumber
=
sheet
.
getLastRowNum
();
...
...
@@ -2132,8 +2134,9 @@ public class ContractServiceImpl implements ContractService {
for
(
int
j
=
1
;
j
<=
rowNumber
;
j
++)
{
Row
row_data
=
sheet
.
getRow
(
j
);
Object
[]
s_data
=
new
Object
[
titleKey
.
size
()
+
4
];
Object
[]
s_data
=
new
Object
[
titleKey
.
size
()
+
extend_size
];
String
bodyCode
=
null
;
String
ds
=
null
;
for
(
int
w
=
0
;
w
<
titleKey
.
size
();
w
++)
{
String
sheetTitle
=
titleKey
.
get
(
w
);
...
...
@@ -2168,7 +2171,7 @@ public class ContractServiceImpl implements ContractService {
if
(!
CONTRACT_TYPE_NAME
.
containsKey
(
dataSTR
))
{
return
ResultModel
.
ERROR
(
"第"
+
line_num
+
"行[签约类型]错误"
);
}
else
{
s_data
[
w
]
=
salseMap
.
get
(
dataSTR
);
s_data
[
w
]
=
CONTRACT_TYPE_NAME
.
get
(
dataSTR
);
}
}
else
if
(
"price_level"
.
equals
(
sheetTitle
))
{
if
(
packageMap
!=
null
&&
!
packageMap
.
containsKey
(
dataSTR
))
{
...
...
@@ -2185,6 +2188,11 @@ public class ContractServiceImpl implements ContractService {
String
pattern
=
"yyyy/MM/dd"
;
DateTime
dateTime
=
DateTime
.
parse
(
dataSTR
,
DateTimeFormat
.
forPattern
(
pattern
));
s_data
[
w
]
=
dateTime
.
toString
(
"yyyy-MM-dd"
);
if
(
"start_date"
.
equals
(
sheetTitle
)){
ds
=
s_data
[
w
].
toString
();
}
}
catch
(
Exception
e
)
{
return
ResultModel
.
ERROR
(
"第"
+
line_num
+
"行[日期]错误"
);
}
...
...
@@ -2199,6 +2207,17 @@ public class ContractServiceImpl implements ContractService {
s_data
[
row_already
+
1
]
=
platform
;
s_data
[
row_already
+
2
]
=
bodyCode
;
s_data
[
row_already
+
3
]
=
new
Date
();
s_data
[
row_already
+
4
]
=
0
;
s_data
[
row_already
+
5
]
=
"main"
;
s_data
[
row_already
+
6
]
=
"backnone"
;
s_data
[
row_already
+
7
]
=
ds
;
// create_account,create_name,extra_flow,relation_contract,invoice_money,first_back_id
s_data
[
row_already
+
8
]
=
0
;
s_data
[
row_already
+
9
]
=
"导入"
;
s_data
[
row_already
+
10
]
=
0
;
s_data
[
row_already
+
11
]
=
-
1
;
s_data
[
row_already
+
12
]
=
0
;
s_data
[
row_already
+
13
]
=
0
;
//批量添加数据
args_data
.
add
(
s_data
);
}
...
...
@@ -2208,7 +2227,7 @@ public class ContractServiceImpl implements ContractService {
sql
.
append
(
extend_row_sql
);
sql
.
append
(
") values ("
);
for
(
int
ed
=
0
,
s
=
row_already
+
4
;
ed
<
s
;
ed
++)
{
for
(
int
ed
=
0
,
s
=
row_already
+
extend_size
;
ed
<
s
;
ed
++)
{
if
(
ed
==
0
)
{
sql
.
append
(
"?"
);
}
else
{
...
...
@@ -2217,12 +2236,11 @@ public class ContractServiceImpl implements ContractService {
}
sql
.
append
(
")"
);
logger
.
info
(
"sql[{}]"
,
sql
.
toString
());
// TransactionStatus transactionStatus = transactionUtils.begin();
// JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
// jdbcTemplate.batchUpdate(sql.toString(), args_data);
jdbcTemplate
.
batchUpdate
(
sql
.
toString
(),
args_data
);
// transactionUtils.commit(transactionStatus);
jdbcTemplate
.
batchUpdate
(
sql
.
toString
(),
args_data
);
return
ResultModel
.
OK
();
}
...
...
This diff is collapsed.
Click to expand it.
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