Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
8de05bb1
Commit
8de05bb1
authored
Feb 15, 2019
by
zhkwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'dev_mysql' of C:\Users\ZhiKai Z Wei\Project\atms with conflicts.
parent
64b25282
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
AssetListServiceImpl.java
...a/pwc/taxtech/atms/service/impl/AssetListServiceImpl.java
+20
-6
generatorConfig.xml
atms-dao/etc/generator-mysql/generatorConfig.xml
+0
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AssetListServiceImpl.java
View file @
8de05bb1
...
@@ -167,7 +167,6 @@ public class AssetListServiceImpl extends BaseService {
...
@@ -167,7 +167,6 @@ public class AssetListServiceImpl extends BaseService {
saveResult
.
setResult
(
false
);
saveResult
.
setResult
(
false
);
return
saveResult
;
return
saveResult
;
}
}
;
//在循环取数据外定义资产类别map,防止map重新定义,不能过滤重复资产类别
//在循环取数据外定义资产类别map,防止map重新定义,不能过滤重复资产类别
Set
assetNameSet
=
new
HashSet
();
Set
assetNameSet
=
new
HashSet
();
...
@@ -176,17 +175,16 @@ public class AssetListServiceImpl extends BaseService {
...
@@ -176,17 +175,16 @@ public class AssetListServiceImpl extends BaseService {
Calendar
now
=
Calendar
.
getInstance
();
Calendar
now
=
Calendar
.
getInstance
();
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
now
.
get
(
Calendar
.
YEAR
));
sb
.
append
(
now
.
get
(
Calendar
.
YEAR
));
if
(
now
.
get
(
Calendar
.
MONTH
)
+
1
<=
9
){
if
(
now
.
get
(
Calendar
.
MONTH
)
+
1
<
10
){
sb
.
append
(
0
);
sb
.
append
(
0
);
}
}
sb
.
append
(
now
.
get
(
Calendar
.
MONTH
)
+
1
);
sb
.
append
(
now
.
get
(
Calendar
.
MONTH
)
+
1
);
//在循环存储新的资产之前先删除原有资产
List
<
CitAssetsList
>
citAssetsLists
=
new
ArrayList
<>();
deleteByExample
(
projectId
);
StringBuilder
errorMsgSb
=
new
StringBuilder
(
"第"
);
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
//通过循环来完成sheet获取每一行每一列数据并进行相关逻辑处理
for
(
int
rowNum
=
sheet
.
getFirstRowNum
()
+
1
;
rowNum
<=
sheet
.
getLastRowNum
();
rowNum
++)
{
for
(
int
rowNum
=
sheet
.
getFirstRowNum
()
+
1
;
rowNum
<=
sheet
.
getLastRowNum
();
rowNum
++)
{
CitAssetsList
citAsset
=
new
CitAssetsList
();
CitAssetsList
citAsset
=
new
CitAssetsList
();
citAsset
.
setId
(
idService
.
nextId
());
citAsset
.
setId
(
idService
.
nextId
());
//赋值projectId
//赋值projectId
citAsset
.
setProjectId
(
projectId
);
citAsset
.
setProjectId
(
projectId
);
...
@@ -197,11 +195,24 @@ public class AssetListServiceImpl extends BaseService {
...
@@ -197,11 +195,24 @@ public class AssetListServiceImpl extends BaseService {
Row
rowData
=
sheet
.
getRow
(
rowNum
);
Row
rowData
=
sheet
.
getRow
(
rowNum
);
//因模板固定,则按照写死的做法处理数据单元格数据
//因模板固定,则按照写死的做法处理数据单元格数据
citAsset
=
cellToCitAsset
(
rowData
,
citAsset
,
assetNameSet
,
citAssetGroupResults
);
citAsset
=
cellToCitAsset
(
rowData
,
citAsset
,
assetNameSet
,
citAssetGroupResults
);
if
(
citAsset
==
null
){
saveResult
.
setResult
(
false
);
errorMsgSb
.
append
(
rowNum
+
","
);
}
if
(!
saveResult
.
getResult
()){
saveResult
.
setResultMsg
(
"行数据为空或格式错误!"
);
}
//目前没有进行税法分类,标注状态
//目前没有进行税法分类,标注状态
citAsset
.
setStatus
(
0
);
citAsset
.
setStatus
(
0
);
assetListMapper
.
insertSelective
(
citAsset
);
citAssetsLists
.
add
(
citAsset
);
}
}
//在循环存储新的资产之前先删除原有资产
deleteByExample
(
projectId
);
//循环存储新的资产
for
(
CitAssetsList
citAsset
:
citAssetsLists
){
assetListMapper
.
insertSelective
(
citAsset
);
}
//处理资产类别
//处理资产类别
//1、根据projectId查询数据库中已有的资产类别,并和新导入的资产类别进行比较
//1、根据projectId查询数据库中已有的资产类别,并和新导入的资产类别进行比较
// for (CitAssetGroupResult groupResult : citAssetGroupResults) {
// for (CitAssetGroupResult groupResult : citAssetGroupResults) {
...
@@ -232,6 +243,9 @@ public class AssetListServiceImpl extends BaseService {
...
@@ -232,6 +243,9 @@ public class AssetListServiceImpl extends BaseService {
//获取资产编号
//获取资产编号
Cell
cell
=
rowData
.
getCell
(
1
);
Cell
cell
=
rowData
.
getCell
(
1
);
Object
value
=
getValue
(
cell
);
Object
value
=
getValue
(
cell
);
if
(
value
==
null
)
{
return
null
;
}
citAsset
.
setAssetNumber
(
value
.
toString
());
citAsset
.
setAssetNumber
(
value
.
toString
());
//获取资产描述
//获取资产描述
...
...
atms-dao/etc/generator-mysql/generatorConfig.xml
View file @
8de05bb1
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