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
aef2ca5c
Commit
aef2ca5c
authored
Feb 19, 2019
by
zhkwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CIT固定资产-资产清单补充及优化以及部分导入工具类
parent
15fef97a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
1 deletion
+80
-1
AssetListServiceImpl.java
...a/pwc/taxtech/atms/service/impl/AssetListServiceImpl.java
+0
-0
CitCommonUtil.java
...ain/java/pwc/taxtech/atms/service/impl/CitCommonUtil.java
+55
-0
FileService.java
.../main/java/pwc/taxtech/atms/service/impl/FileService.java
+23
-0
MenuServiceImpl.java
...n/java/pwc/taxtech/atms/service/impl/MenuServiceImpl.java
+1
-0
app-data-import.html
...webapp/app/framework/app-data-import/app-data-import.html
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AssetListServiceImpl.java
View file @
aef2ca5c
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CitCommonUtil.java
0 → 100644
View file @
aef2ca5c
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.apache.poi.ss.usermodel.Cell
;
import
java.util.Calendar
;
/**
* @author ZhiKai Z Wei
*/
public
class
CitCommonUtil
{
/**
* 计算当前期间
* @return
*/
public
static
StringBuilder
getPeriod
(){
//计算当前期间
Calendar
now
=
Calendar
.
getInstance
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
now
.
get
(
Calendar
.
YEAR
));
if
(
now
.
get
(
Calendar
.
MONTH
)
+
1
<
10
){
sb
.
append
(
0
);
}
sb
.
append
(
now
.
get
(
Calendar
.
MONTH
)
+
1
);
return
sb
;
}
/**
* 导入Excel时根据单元格类型获取单元格的值
* @param cell
* @return
*/
public
static
Object
getValue
(
Cell
cell
)
{
Object
obj
=
null
;
switch
(
cell
.
getCellTypeEnum
())
{
case
BOOLEAN:
obj
=
cell
.
getBooleanCellValue
();
break
;
case
ERROR:
obj
=
cell
.
getErrorCellValue
();
break
;
case
NUMERIC:
obj
=
cell
.
getNumericCellValue
();
break
;
case
STRING:
obj
=
cell
.
getStringCellValue
();
break
;
default
:
break
;
}
return
obj
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/FileService.java
View file @
aef2ca5c
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.usermodel.Sheet
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.apache.poi.ss.usermodel.WorkbookFactory
;
import
org.nutz.lang.Files
;
...
...
@@ -198,4 +203,22 @@ public class FileService {
}
}
public
Workbook
getWorkbook
(
InputStream
inputStream
,
String
fileName
,
String
fileDir
)
throws
IOException
,
InvalidFormatException
{
String
filePath
=
FileUtils
.
getTempDirectory
().
getAbsolutePath
()
+
File
.
separator
+
fileDir
+
File
.
separator
+
CommonUtils
.
getUUID
()
+
"_"
+
fileName
;
//保存导入的文件
OperationResultDto
<
Object
>
saveResult
=
saveFile
(
inputStream
,
filePath
);
//判断是否成功导入
if
(
saveResult
.
getResult
()
!=
null
&&
!
saveResult
.
getResult
())
{
return
null
;
}
//获取保存文件的输入流
InputStream
newInputStream
=
Files
.
findFileAsStream
(
filePath
);
//通过输入流获取当前workbook
Workbook
workbook
=
WorkbookFactory
.
create
(
newInputStream
);
return
workbook
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/MenuServiceImpl.java
View file @
aef2ca5c
...
...
@@ -143,6 +143,7 @@ public class MenuServiceImpl {
menuIds
.
add
(
"a9b1cd87-89ef-4dae-b798-b19e9bbe0821"
);
menuIds
.
add
(
"a9b1cd87-89ef-4dae-b798-b19e9bbe0822"
);
menuIds
.
add
(
"a9b1cd87-89ef-4dae-b798-b19e9bbe0823"
);
menuIds
.
add
(
"a9b1cd87-89ef-4dae-b798-b19e9bbe0824"
);
menuIds
.
add
(
"b8c74ee9-e5d7-467b-8565-e77efe6a499f"
);
// List<MenuDto> menus = getMenus(moduleId).stream().filter(x -> permissionNames.contains(x.getName())).collect(Collectors.toList());
return
menuIds
;
...
...
atms-web/src/main/webapp/app/framework/app-data-import/app-data-import.html
View file @
aef2ca5c
<div
id=
"app-data-import"
class=
"app-data-import "
>
<nav
class=
"navbar navbar-custom"
role=
"navigation"
style=
"margin-bottom: 0; background-image:url(../../../app-resources/images/leftbarbg.png); height:
100%
;width: 260px"
>
style=
"margin-bottom: 0; background-image:url(../../../app-resources/images/leftbarbg.png); height:
auto
;width: 260px"
>
<div
class=
"sidebar navbarfix"
role=
"navigation"
>
<div
class=
"sidebar-nav navbar-collapse"
id=
"sidebar-area"
style=
"height:100%;width: 260px"
>
<div
class=
"app-data-import-side-bar"
style=
"height: 100%"
>
...
...
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