Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fgqyxxlr
Overview
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
yaru
fgqyxxlr
Commits
3192c866
Commit
3192c866
authored
Sep 03, 2020
by
liru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入
parent
0ca98c03
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/OrhonShzzController.java
+44
-0
ruoyi-admin/target/classes/com/ruoyi/web/controller/system/OrhonShzzController.class
+0
-0
ruoyi-system/target/classes/com/ruoyi/system/domain/OrhonGtxx.class
+0
-0
ruoyi-system/target/classes/mapper/system/OrhonGtxxMapper.xml
+5
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/OrhonShzzController.java
View file @
3192c866
...
...
@@ -3,6 +3,18 @@ package com.ruoyi.web.controller.system;
import
com.ruoyi.framework.util.ShiroUtils
;
import
com.ruoyi.system.domain.OrhonShzz
;
import
com.ruoyi.system.domain.SysUser
;
import
org.apache.poi.hssf.usermodel.*
;
import
org.apache.poi.poifs.filesystem.POIFSFileSystem
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
/**
* 社会组织信息Controller
...
...
@@ -44,6 +56,38 @@ public class OrhonShzzController extends com.ruoyi.common.core.controller.BaseCo
}
/**
* 导入社会组织信息列表
*/
@org
.
apache
.
shiro
.
authz
.
annotation
.
RequiresPermissions
(
"system:shzz:importExcel"
)
@com
.
ruoyi
.
common
.
annotation
.
Log
(
title
=
"社会组织信息"
,
businessType
=
com
.
ruoyi
.
common
.
enums
.
BusinessType
.
EXPORT
)
@org
.
springframework
.
web
.
bind
.
annotation
.
PostMapping
(
"/importExcel"
)
@org
.
springframework
.
web
.
bind
.
annotation
.
ResponseBody
public
com
.
ruoyi
.
common
.
core
.
domain
.
AjaxResult
importExcel
(
@RequestParam
(
"file"
)
MultipartFile
file
,
HttpServletRequest
request
)
{
try
{
InputStream
is
=
file
.
getInputStream
();
com
.
ruoyi
.
common
.
utils
.
poi
.
ExcelUtil
<
com
.
ruoyi
.
system
.
domain
.
OrhonShzz
>
util
=
new
com
.
ruoyi
.
common
.
utils
.
poi
.
ExcelUtil
<
com
.
ruoyi
.
system
.
domain
.
OrhonShzz
>(
com
.
ruoyi
.
system
.
domain
.
OrhonShzz
.
class
);
java
.
util
.
List
<
com
.
ruoyi
.
system
.
domain
.
OrhonShzz
>
list
=
util
.
importExcel
(
is
);
java
.
util
.
List
<
com
.
ruoyi
.
system
.
domain
.
OrhonShzz
>
wrongList
=
new
ArrayList
<>();
for
(
OrhonShzz
orhonShzz:
list
){
OrhonShzz
o
=
new
OrhonShzz
();
o
.
setMc
(
orhonShzz
.
getMc
());
java
.
util
.
List
<
com
.
ruoyi
.
system
.
domain
.
OrhonShzz
>
oldlist
=
orhonShzzService
.
selectOrhonShzzList
(
o
);
if
(
oldlist
.
size
()<
1
){
wrongList
.
add
(
orhonShzz
);
}
else
{
orhonShzz
.
setId
(
oldlist
.
get
(
0
).
getId
());
orhonShzzService
.
updateOrhonShzz
(
orhonShzz
);
}
}
return
util
.
exportExcel
(
wrongList
,
"shzz"
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"未找到指定路径的文件!"
);
e
.
printStackTrace
();
return
toAjax
(
0
);
}
}
/**
* 导出社会组织信息列表
*/
@org
.
apache
.
shiro
.
authz
.
annotation
.
RequiresPermissions
(
"system:shzz:export"
)
...
...
ruoyi-admin/target/classes/com/ruoyi/web/controller/system/OrhonShzzController.class
View file @
3192c866
No preview for this file type
ruoyi-system/target/classes/com/ruoyi/system/domain/OrhonGtxx.class
View file @
3192c866
No preview for this file type
ruoyi-system/target/classes/mapper/system/OrhonGtxxMapper.xml
View file @
3192c866
...
...
@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"dzzsdgx"
column=
"dzzsdgx"
/>
<result
property=
"hjxx"
column=
"hjxx"
/>
<result
property=
"dfzh"
column=
"dfzh"
/>
<result
property=
"nyysr"
column=
"nyysr"
/>
</resultMap>
<sql
id=
"selectOrhonGtxxVo"
>
...
...
@@ -134,6 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dzzsdgx != null "
>
and dzzsdgx = #{dzzsdgx}
</if>
<if
test=
"hjxx != null "
>
and hjxx = #{hjxx}
</if>
<if
test=
"dfzh != null "
>
and dfzh = #{dfzh}
</if>
<if
test=
"nyysr != null "
>
and nyysr = #{nyysr}
</if>
</where>
</select>
...
...
@@ -206,6 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dzzsdgx != null"
>
dzzsdgx,
</if>
<if
test=
"hjxx != null"
>
hjxx,
</if>
<if
test=
"dfzh != null"
>
dfzh,
</if>
<if
test=
"nyysr != null"
>
nyysr,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
...
...
@@ -269,6 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dzzsdgx != null"
>
#{dzzsdgx},
</if>
<if
test=
"hjxx != null"
>
#{hjxx},
</if>
<if
test=
"dfzh != null"
>
#{dfzh},
</if>
<if
test=
"nyysr != null"
>
#{nyysr},
</if>
</trim>
</insert>
...
...
@@ -335,6 +339,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dzzsdgx != null"
>
dzzsdgx = #{dzzsdgx},
</if>
<if
test=
"hjxx != null"
>
hjxx = #{hjxx},
</if>
<if
test=
"dfzh != null"
>
dfzh = #{dfzh},
</if>
<if
test=
"nyysr != null"
>
nyysr = #{nyysr},
</if>
</trim>
where id = #{id}
</update>
...
...
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