Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
chnmuseum-party
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liqin
chnmuseum-party
Commits
5476fe9f
Commit
5476fe9f
authored
Apr 07, 2021
by
liqin
💬
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/lee/chnmuseum-party
into master
parents
bff7861b
fa7376cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
ImportExcelUtil.java
...isenergy/chnmuseum/party/common/util/ImportExcelUtil.java
+1
-1
TOrganServiceImpl.java
...nergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
+17
-0
TOrganController.java
...ergy/chnmuseum/party/web/controller/TOrganController.java
+1
-1
No files found.
src/main/java/cn/wisenergy/chnmuseum/party/common/util/ImportExcelUtil.java
View file @
5476fe9f
...
...
@@ -52,7 +52,7 @@ public class ImportExcelUtil {
//获取单元格
Cell
cell
=
row
.
getCell
(
j
);
if
(
cell
!=
null
)
{
cell
.
setCell
Formula
(
CellType
.
STRING
.
name
()
);
cell
.
setCell
Type
(
CellType
.
STRING
);
//获取单元格数据
list1
.
add
(
cell
.
getStringCellValue
());
//列名 :数据
...
...
src/main/java/cn/wisenergy/chnmuseum/party/service/impl/TOrganServiceImpl.java
View file @
5476fe9f
...
...
@@ -7,11 +7,13 @@ import cn.wisenergy.chnmuseum.party.model.TArea;
import
cn.wisenergy.chnmuseum.party.model.TOrgan
;
import
cn.wisenergy.chnmuseum.party.mapper.TOrganMapper
;
import
cn.wisenergy.chnmuseum.party.service.TOrganService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -73,6 +75,21 @@ public class TOrganServiceImpl extends ServiceImpl<TOrganMapper, TOrgan> impleme
map
=
(
Map
<
String
,
String
>)
excelList
.
get
(
i
);
TOrgan
organ
=
new
TOrgan
();
organ
.
setName
(
map
.
get
(
"名称"
));
//机构名称不能重复
QueryWrapper
<
TOrgan
>
ew
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNoneBlank
(
organ
.
getName
()))
{
organ
.
setName
(
organ
.
getName
().
trim
());
ew
.
eq
(
"is_deleted"
,
0
);
ew
.
eq
(
"name"
,
organ
.
getName
());
List
<
TOrgan
>
list
=
list
(
ew
);
if
(
list
!=
null
&&
list
.
size
()>
0
&&
list
.
get
(
0
)!=
null
)
{
return
flag
;
}
}
String
parent
=
map
.
get
(
"上级机构"
);
if
(
map1
.
get
(
parent
)==
null
){
organ
.
setParentId
(
"0"
);
...
...
src/main/java/cn/wisenergy/chnmuseum/party/web/controller/TOrganController.java
View file @
5476fe9f
...
...
@@ -293,7 +293,7 @@ public class TOrganController extends BaseController {
return
ResponseEntity
.
ok
(
resultMap
);
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"resultCode"
,
"500"
);
resultMap
.
put
(
"massage"
,
"导入失败!"
);
resultMap
.
put
(
"massage"
,
e
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
resultMap
);
}
}
...
...
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