Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
platform
/
finance_serv
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 741685d5
authored
6 years ago
by
王军业
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
12415421452
1 parent
e50059d0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
code/finance_serv/src/main/java/com/vion/financial/handler/ImportExcel.java
code/finance_serv/src/main/java/com/vion/financial/service/imp/ContractServiceImpl.java
code/finance_serv/src/main/java/com/vion/financial/handler/ImportExcel.java
View file @
741685d
...
@@ -18,7 +18,7 @@ import cn.afterturn.easypoi.handler.inter.IExcelDataHandler;
...
@@ -18,7 +18,7 @@ import cn.afterturn.easypoi.handler.inter.IExcelDataHandler;
public
class
ImportExcel
{
public
class
ImportExcel
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ImportExcel
.
class
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
ImportExcel
.
class
);
public
Boolean
flag
=
true
;
public
Boolean
flag
=
true
;
public
List
<
ImportModel
>
Import
(
MultipartFile
file
)
throws
IOException
,
Exception
{
public
List
<
List
<
ImportModel
>
>
Import
(
MultipartFile
file
)
throws
IOException
,
Exception
{
ImportParams
importParams
=
new
ImportParams
();
ImportParams
importParams
=
new
ImportParams
();
IExcelDataHandler
<
ImportModel
>
handle
=
new
ImportHandle
();
IExcelDataHandler
<
ImportModel
>
handle
=
new
ImportHandle
();
handle
.
setNeedHandlerFields
(
new
String
[]
{
"合同编号"
});
handle
.
setNeedHandlerFields
(
new
String
[]
{
"合同编号"
});
...
@@ -28,6 +28,11 @@ public class ImportExcel {
...
@@ -28,6 +28,11 @@ public class ImportExcel {
List
<
ImportModel
>
successList
=
result
.
getList
();
List
<
ImportModel
>
successList
=
result
.
getList
();
List
<
ImportModel
>
failList
=
result
.
getFailList
();
List
<
ImportModel
>
failList
=
result
.
getFailList
();
List
<
List
<
ImportModel
>>
list
=
new
ArrayList
<
List
<
ImportModel
>>();
list
.
add
(
successList
);
list
.
add
(
failList
);
log
.
info
(
list
.
get
(
0
).
size
()+
""
);
log
.
info
(
"是否存在验证未通过的数据:"
+
result
.
isVerfiyFail
());
log
.
info
(
"是否存在验证未通过的数据:"
+
result
.
isVerfiyFail
());
log
.
info
(
"验证通过的数量:"
+
successList
.
size
());
log
.
info
(
"验证通过的数量:"
+
successList
.
size
());
log
.
info
(
"验证未通过的数量"
+
failList
.
size
());
log
.
info
(
"验证未通过的数量"
+
failList
.
size
());
...
@@ -48,6 +53,6 @@ public class ImportExcel {
...
@@ -48,6 +53,6 @@ public class ImportExcel {
ImportModel flag=new ImportModel();
ImportModel flag=new ImportModel();
flag.setContract_unid("数据格式出错");
flag.setContract_unid("数据格式出错");
successList.add(flag);*/
successList.add(flag);*/
return
successL
ist
;
return
l
ist
;
}
}
}
}
This diff is collapsed.
Click to expand it.
code/finance_serv/src/main/java/com/vion/financial/service/imp/ContractServiceImpl.java
View file @
741685d
...
@@ -576,6 +576,9 @@ public class ContractServiceImpl implements ContractService {
...
@@ -576,6 +576,9 @@ public class ContractServiceImpl implements ContractService {
@Override
@Override
public
Object
importExcel
(
MultipartFile
file
)
{
public
Object
importExcel
(
MultipartFile
file
)
{
logger
.
info
(
"========================导入合同Excel表格==========================="
);
//ImportExcel importExcel = new ImportExcel();
//ImportExcel importExcel = new ImportExcel();
try
{
try
{
/* ImportParams importParams = new ImportParams();
/* ImportParams importParams = new ImportParams();
...
@@ -600,7 +603,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -600,7 +603,7 @@ public class ContractServiceImpl implements ContractService {
/* List<ImportModel> successList=importExcel.Import(file);
/* List<ImportModel> successList=importExcel.Import(file);
ImportModel impor=null;*/
ImportModel impor=null;*/
ImportExcel
importExcel
=
new
ImportExcel
();
ImportExcel
importExcel
=
new
ImportExcel
();
List
<
ImportModel
>
successL
ist
=
importExcel
.
Import
(
file
);
List
<
List
<
ImportModel
>>
l
ist
=
importExcel
.
Import
(
file
);
/* Boolean flag=true;
/* Boolean flag=true;
if(importExcel.flag) {
if(importExcel.flag) {
flag=false;
flag=false;
...
@@ -617,7 +620,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -617,7 +620,7 @@ public class ContractServiceImpl implements ContractService {
s
=
s
+
"!"
;
s
=
s
+
"!"
;
logger
.
info
(
s
);
logger
.
info
(
s
);
}
}
if
(
importExcel
.
flag
)
{
if
(
list
.
get
(
1
).
size
()==
0
)
{
ContractVo
contractVo
=
null
;
ContractVo
contractVo
=
null
;
ReturnInfo
returnInfo
=
null
;
ReturnInfo
returnInfo
=
null
;
Receipt
receipt
=
null
;
Receipt
receipt
=
null
;
...
@@ -630,7 +633,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -630,7 +633,7 @@ public class ContractServiceImpl implements ContractService {
PaymentAgree
acceptanc_aymentAgree
=
null
;
PaymentAgree
acceptanc_aymentAgree
=
null
;
PaymentAgree
mainten_aymentAgree
=
null
;
PaymentAgree
mainten_aymentAgree
=
null
;
DeliverGoods
deliverGoods
=
null
;
DeliverGoods
deliverGoods
=
null
;
for
(
ImportModel
importModel:
successList
)
{
for
(
ImportModel
importModel:
list
.
get
(
0
)
)
{
/*if(contractMapper.queryOne(importModel.getContract_unid())!=null) {
/*if(contractMapper.queryOne(importModel.getContract_unid())!=null) {
contractMapper.actualDeleteOne(importModel.getContract_unid());
contractMapper.actualDeleteOne(importModel.getContract_unid());
}*/
}*/
...
@@ -903,7 +906,7 @@ public class ContractServiceImpl implements ContractService {
...
@@ -903,7 +906,7 @@ public class ContractServiceImpl implements ContractService {
}
}
return
successCode
;
return
successCode
;
}
}
return
successList
;
return
list
.
get
(
1
)
;
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment