Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
data_management_system
Project
Project
Details
Activity
Releases
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
张伯涛
data_management_system
Commits
6370045b
Commit
6370045b
authored
Nov 30, 2022
by
gaoyingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 隔离点导入
parent
e9d2656c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
32 deletions
+90
-32
GldryController.java
...java/com/ruoyi/web/controller/system/GldryController.java
+14
-0
Gldry.java
...i-system/src/main/java/com/ruoyi/system/domain/Gldry.java
+1
-1
GldryServiceImpl.java
.../java/com/ruoyi/system/service/impl/GldryServiceImpl.java
+73
-29
YxryServiceImpl.java
...n/java/com/ruoyi/system/service/impl/YxryServiceImpl.java
+2
-2
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/GldryController.java
View file @
6370045b
...
...
@@ -79,6 +79,8 @@ public class GldryController extends BaseController
gldry
.
setValue
(
DataUtils
.
getKey
(
null
,
null
,
String
.
valueOf
(
SecurityUtils
.
getUserId
()),
null
,
null
));
List
<
Gldry
>
list
=
gldryService
.
selectGldryList
(
gldry
);
List
<
SysDictData
>
community
=
DictUtils
.
getDictCache
(
"community"
);
List
<
SysDictData
>
committee
=
DictUtils
.
getDictCache
(
"committee"
);
List
<
SysDictData
>
street
=
DictUtils
.
getDictCache
(
"street_town"
);
for
(
Gldry
yxry1
:
list
)
{
if
(
StringUtils
.
isNotEmpty
(
yxry1
.
getCommunity
()))
{
List
<
String
>
labels
=
community
.
stream
().
filter
(
l
->
yxry1
.
getCommunity
().
equals
(
l
.
getDictValue
()))
...
...
@@ -86,6 +88,18 @@ public class GldryController extends BaseController
if
(!
labels
.
isEmpty
())
yxry1
.
setCommunity
(
labels
.
get
(
0
));
}
if
(
StringUtils
.
isNotEmpty
(
yxry1
.
getCommittee
()))
{
List
<
String
>
labels
=
committee
.
stream
().
filter
(
l
->
yxry1
.
getCommittee
().
equals
(
l
.
getDictValue
()))
.
map
(
SysDictData:
:
getDictLabel
).
collect
(
Collectors
.
toList
());
if
(!
labels
.
isEmpty
())
yxry1
.
setCommittee
(
labels
.
get
(
0
));
}
if
(
StringUtils
.
isNotEmpty
(
yxry1
.
getStreet
()))
{
List
<
String
>
labels
=
street
.
stream
().
filter
(
l
->
yxry1
.
getStreet
().
equals
(
l
.
getDictValue
()))
.
map
(
SysDictData:
:
getDictLabel
).
collect
(
Collectors
.
toList
());
if
(!
labels
.
isEmpty
())
yxry1
.
setStreet
(
labels
.
get
(
0
));
}
}
ExcelUtil
<
Gldry
>
util
=
new
ExcelUtil
<
Gldry
>(
Gldry
.
class
);
util
.
exportExcel
(
response
,
list
,
"隔离点人员数据"
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/Gldry.java
View file @
6370045b
...
...
@@ -22,7 +22,7 @@ public class Gldry extends BaseEntity
private
Long
id
;
/** 隔离点名称 */
@Excel
(
name
=
"隔离点名称"
)
@Excel
(
name
=
"隔离点名称"
,
dictType
=
"isolation_point"
)
private
String
glPlace
;
/** 房间号 */
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GldryServiceImpl.java
View file @
6370045b
...
...
@@ -163,13 +163,11 @@ public class GldryServiceImpl implements IGldryService
&&
StringUtils
.
isNotEmpty
(
gldry
.
getPhone
())
&&
StringUtils
.
isNotEmpty
(
gldry
.
getIsYx
())
&&
StringUtils
.
isNotEmpty
(
gldry
.
getArea
())
&&
StringUtils
.
isNotEmpty
(
gldry
.
getStreet
())
&&
StringUtils
.
isNotEmpty
(
gldry
.
getCommittee
())
&&
StringUtils
.
isNotEmpty
(
gldry
.
getZrTime
().
toString
())
&&
gldry
.
getZrTime
()!=
null
){
Gldry
hldryQuerry
=
new
Gldry
();
hldryQuerry
.
setCardNo
(
gldry
.
getCardNo
());
List
<
Gldry
>
gldries
=
gldryMapper
.
selectGldry
List
(
hldryQuerry
);
//
Gldry hldryQuerry = new Gldry();
//
hldryQuerry.setCardNo(gldry.getCardNo());
List
<
Gldry
>
gldries
=
gldryMapper
.
selectGldry
ByCard
(
gldry
.
getCardNo
(),
null
);
//
// SysUser loginUser = getLoginUser().getUser();
// String glPlace = loginUser.getNickName();
...
...
@@ -178,17 +176,17 @@ public class GldryServiceImpl implements IGldryService
// continue;
// }
// 校验 隔离点名称
if
(
StringUtils
.
isNotEmpty
(
gldry
.
getGlPlace
())){
List
<
SysDictData
>
isolation_point
=
DictUtils
.
getDictCache
(
"isolation_point"
);
List
<
String
>
values
=
isolation_point
.
stream
().
filter
(
l
->
gldry
.
getGlPlace
().
equals
(
l
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
if
(!
values
.
isEmpty
())
gldry
.
setGlPlace
(
values
.
get
(
0
));
else
{
failureList
.
add
(
gldry
);
continue
;
}
}
//
if (StringUtils.isNotEmpty(gldry.getGlPlace())){
//
List<SysDictData> isolation_point = DictUtils.getDictCache("isolation_point");
//
List<String> values = isolation_point.stream().filter(l->gldry.getGlPlace().equals(l.getDictLabel()))
//
.map(SysDictData::getDictValue).collect(Collectors.toList());
//
if (!values.isEmpty())
//
gldry.setGlPlace(values.get(0));
//
else {
//
failureList.add(gldry);
//
continue;
//
}
//
}
// 校验四级联动是否对应字典的值
// 校验 所在区
// if (StringUtils.isNotEmpty(gldry.getArea())){
...
...
@@ -238,21 +236,67 @@ public class GldryServiceImpl implements IGldryService
// continue;
// }
// }
String
community
=
""
;
String
committee
=
""
;
String
street
=
""
;
if
(
StringUtils
.
isNotEmpty
(
gldry
.
getCommunity
())){
//如果小区不为空,去数据字典匹配value
List
<
SysDictData
>
communitys
=
DictUtils
.
getDictCache
(
"community"
);
List
<
String
>
values
=
communitys
.
stream
().
filter
(
l
->
gldry
.
getCommunity
().
equals
(
l
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
if
(!
values
.
isEmpty
())
community
=
values
.
get
(
0
);
else
{
failureList
.
add
(
gldry
);
continue
;
}
}
if
(
StringUtils
.
isNotEmpty
(
gldry
.
getCommittee
())){
//如果委员会不为空,去数据字典匹配value
List
<
SysDictData
>
communitys
=
DictUtils
.
getDictCache
(
"committee"
);
List
<
String
>
values
=
communitys
.
stream
().
filter
(
l
->
gldry
.
getCommittee
().
equals
(
l
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
if
(!
values
.
isEmpty
())
committee
=
values
.
get
(
0
);
else
{
failureList
.
add
(
gldry
);
continue
;
}
}
if
(
StringUtils
.
isNotEmpty
(
gldry
.
getStreet
())){
//如果街道不为空,去数据字典匹配value
List
<
SysDictData
>
communitys
=
DictUtils
.
getDictCache
(
"street_town"
);
List
<
String
>
values
=
communitys
.
stream
().
filter
(
l
->
gldry
.
getStreet
().
equals
(
l
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
if
(!
values
.
isEmpty
())
street
=
values
.
get
(
0
);
else
{
failureList
.
add
(
gldry
);
continue
;
}
}
if
((
StringUtils
.
isNotEmpty
(
community
)&&
StringUtils
.
isEmpty
(
committee
))||
(
StringUtils
.
isNotEmpty
(
committee
)&&
StringUtils
.
isEmpty
(
street
))){
failureList
.
add
(
gldry
);
continue
;
}
if
(!
gldries
.
isEmpty
()){
for
(
Gldry
gldryUpdate:
gldries
){
gldry
.
setId
(
gldryUpdate
.
getId
());
gldry
.
setCommunity
(
community
);
gldry
.
setCommittee
(
committee
);
gldry
.
setStreet
(
street
);
gldryMapper
.
updateGldry
(
gldry
);
}
}
else
{
if
(
CheckUtils
.
checkCard
(
gldry
.
getCardNo
())){
gldry
.
setCheckCard
(
"正确"
);
if
(
gldry
.
getIsYx
().
equals
(
"是"
)){
gldry
.
setIsYx
(
"阳"
);
}
if
(
gldry
.
getIsYx
().
equals
(
"否"
)){
gldry
.
setIsYx
(
"未阳"
);
}
// if (gldry.getIsYx().equals("是")){
// gldry.setIsYx("阳");
// }
// if (gldry.getIsYx().equals("否")){
// gldry.setIsYx("未阳");
// }
gldry
.
setCommunity
(
community
);
gldry
.
setCommittee
(
committee
);
gldry
.
setStreet
(
street
);
trueList
.
add
(
gldry
);
}
else
{
gldry
.
setCheckCard
(
"不正确"
);
...
...
@@ -266,11 +310,11 @@ public class GldryServiceImpl implements IGldryService
if
(!
trueList
.
isEmpty
()){
for
(
Gldry
gldry:
trueList
){
String
createBy
=
DataUtils
.
getValue
(
gldry
.
getArea
(),
gldry
.
getStreet
(),
gldry
.
getCommittee
());
if
(
createBy
.
equals
(
"null"
)){
throw
new
ServiceException
(
"所选居住地、街道、社区不存在"
);
}
gldry
.
setCreateBy
(
createBy
);
//
String createBy = DataUtils.getValue(gldry.getArea(),gldry.getStreet(),gldry.getCommittee());
//
if (createBy.equals("null")){
//
throw new ServiceException("所选居住地、街道、社区不存在");
//
}
gldry
.
setCreateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
())
);
gldry
.
setCreateTime
(
DateUtils
.
getNowDate
());
gldryMapper
.
insertGldry
(
gldry
);
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/YxryServiceImpl.java
View file @
6370045b
...
...
@@ -178,8 +178,8 @@ public class YxryServiceImpl implements IYxryService {
continue
;
}
}
if
((
StringUtils
.
isNotEmpty
(
zlqk
.
getCommunity
())&&
StringUtils
.
isEmpty
(
zlqk
.
getCommittee
()
))||
(
StringUtils
.
isNotEmpty
(
zlqk
.
getCommittee
())&&
StringUtils
.
isEmpty
(
zlqk
.
getStreet
()
))){
if
((
StringUtils
.
isNotEmpty
(
community
)&&
StringUtils
.
isEmpty
(
committee
))||
(
StringUtils
.
isNotEmpty
(
committee
)&&
StringUtils
.
isEmpty
(
street
))){
failureList
.
add
(
zlqk
);
continue
;
}
...
...
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