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
ea2fab46
Commit
ea2fab46
authored
Dec 06, 2022
by
gaoyingwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 隔离点、方舱与用户对应关系
parent
8f302d33
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
8 deletions
+82
-8
SysDictData.java
...java/com/ruoyi/common/core/domain/entity/SysDictData.java
+1
-1
DataUtils.java
...ommon/src/main/java/com/ruoyi/common/utils/DataUtils.java
+27
-7
FcryMapper.java
...tem/src/main/java/com/ruoyi/system/mapper/FcryMapper.java
+2
-0
GldryMapper.java
...em/src/main/java/com/ruoyi/system/mapper/GldryMapper.java
+2
-0
SysDictDataServiceImpl.java
...com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
+41
-0
FcryMapper.xml
ruoyi-system/src/main/resources/mapper/system/FcryMapper.xml
+5
-0
GldryMapper.xml
...i-system/src/main/resources/mapper/system/GldryMapper.xml
+4
-0
No files found.
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
View file @
ea2fab46
...
@@ -85,7 +85,7 @@ public class SysDictData extends BaseEntity
...
@@ -85,7 +85,7 @@ public class SysDictData extends BaseEntity
}
}
@NotBlank
(
message
=
"字典键值不能为空"
)
@NotBlank
(
message
=
"字典键值不能为空"
)
@Size
(
min
=
0
,
max
=
100
,
message
=
"字典键值长度不能超过1
00个字符"
)
@Size
(
min
=
0
,
max
=
100
0
,
message
=
"字典键值长度不能超过10
00个字符"
)
public
String
getDictValue
()
public
String
getDictValue
()
{
{
return
dictValue
;
return
dictValue
;
...
...
ruoyi-common/src/main/java/com/ruoyi/common/utils/DataUtils.java
View file @
ea2fab46
...
@@ -3,8 +3,11 @@ package com.ruoyi.common.utils;
...
@@ -3,8 +3,11 @@ package com.ruoyi.common.utils;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.ruoyi.common.core.domain.entity.SysDictData
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* 数据工具类
* 数据工具类
...
@@ -15,9 +18,7 @@ public class DataUtils {
...
@@ -15,9 +18,7 @@ public class DataUtils {
public
static
String
dateMap
=
"{\"area\":{ \"1\":\"123\",\"2\":\"124\",\"3\":\"124\",\"4\":\"124\",\"5\":\"124\",\"6\":\"124\",\"7\":\"124\",\"8\":\"124\",\"9\":\"124\",\"10\":\"124\",\"11\":\"124\",\"12\":\"124\",\"13\":\"124\",\"14\":\"124\",\"15\":\"124\",\"16\":\"124\",\"17\":\"124\",\"18\":\"124\",\"19\":\"124\",\"20\":\"124\",\"21\":\"124\",\"22\":\"124\",\"23\":\"124\",\"24\":\"124\"},"
+
public
static
String
dateMap
=
"{\"area\":{ \"1\":\"123\",\"2\":\"124\",\"3\":\"124\",\"4\":\"124\",\"5\":\"124\",\"6\":\"124\",\"7\":\"124\",\"8\":\"124\",\"9\":\"124\",\"10\":\"124\",\"11\":\"124\",\"12\":\"124\",\"13\":\"124\",\"14\":\"124\",\"15\":\"124\",\"16\":\"124\",\"17\":\"124\",\"18\":\"124\",\"19\":\"124\",\"20\":\"124\",\"21\":\"124\",\"22\":\"124\",\"23\":\"124\",\"24\":\"124\"},"
+
"\"street\":{\"1\":\"101\",\"2\":\"103\", \"3\":\"102\", \"4\":\"104\",\"5\":\"105\", \"6\":\"106\", \"7\":\"121\", \"8\":\"120\", \"9\":\"117\", \"10\":\"119\", \"11\":\"118\"},"
+
"\"street\":{\"1\":\"101\",\"2\":\"103\", \"3\":\"102\", \"4\":\"104\",\"5\":\"105\", \"6\":\"106\", \"7\":\"121\", \"8\":\"120\", \"9\":\"117\", \"10\":\"119\", \"11\":\"118\"},"
+
"\"community\":{\"1\":\"125\",\"2\":\"126\", \"3\":\"127\",\"4\":\"128\", \"5\":\"129\", \"6\":\"130\", \"7\":\"131\", \"17\":\"132\", \"18\":\"133\", \"19\":\"134\", \"20\":\"135\", \"21\":\"136\", \"22\":\"137\", \"23\":\"138\", \"24\":\"139\", \"34\":\"140\", \"35\":\"141\", \"36\":\"142\", \"37\":\"143\", \"38\":\"144\", \"39\":\"145\", \"40\":\"146\", \"41\":\"147\", \"42\":\"148\", \"43\":\"149\",\"44\":\"150\",\"45\":\"151\",\"46\":\"152\",\"47\":\"153\",\"48\":\"154\",\"49\":\"155\",\"50\":\"156\", \"60\":\"157\", \"61\":\"158\", \"62\":\"159\", \"63\":\"160\", \"64\":\"161\", \"65\":\"162\", \"66\":\"163\", \"67\":\"164\", \"68\":\"181\", \"69\":\"165\", \"70\":\"166\", \"71\":\"167\", \"72\":\"168\", \"73\":\"169\", \"74\":\"170\", \"75\":\"171\", \"76\":\"172\"},"
+
"\"community\":{\"1\":\"125\",\"2\":\"126\", \"3\":\"127\",\"4\":\"128\", \"5\":\"129\", \"6\":\"130\", \"7\":\"131\", \"17\":\"132\", \"18\":\"133\", \"19\":\"134\", \"20\":\"135\", \"21\":\"136\", \"22\":\"137\", \"23\":\"138\", \"24\":\"139\", \"34\":\"140\", \"35\":\"141\", \"36\":\"142\", \"37\":\"143\", \"38\":\"144\", \"39\":\"145\", \"40\":\"146\", \"41\":\"147\", \"42\":\"148\", \"43\":\"149\",\"44\":\"150\",\"45\":\"151\",\"46\":\"152\",\"47\":\"153\",\"48\":\"154\",\"49\":\"155\",\"50\":\"156\", \"60\":\"157\", \"61\":\"158\", \"62\":\"159\", \"63\":\"160\", \"64\":\"161\", \"65\":\"162\", \"66\":\"163\", \"67\":\"164\", \"68\":\"181\", \"69\":\"165\", \"70\":\"166\", \"71\":\"167\", \"72\":\"168\", \"73\":\"169\", \"74\":\"170\", \"75\":\"171\", \"76\":\"172\"}}"
;
"\"shelters\":{\"1\":\"107\",\"2\":\"108\", \"3\":\"109\", \"4\":\"110\",\"5\":\"111\", \"6\":\"112\", \"7\":\"113\", \"8\":\"114\", \"9\":\"115\", \"10\":\"116\", \"11\":\"182\"},"
+
"\"isolation\":{\"01\":\"173\",\"02\":\"174\", \"03\":\"175\", \"04\":\"176\",\"05\":\"177\", \"06\":\"178\", \"07\":\"179\", \"08\":\"180\"}}"
;
public
static
String
getValue
(
String
area
,
String
street
,
String
community
)
{
public
static
String
getValue
(
String
area
,
String
street
,
String
community
)
{
JSONObject
map
=
JSON
.
parseObject
(
dateMap
);
JSONObject
map
=
JSON
.
parseObject
(
dateMap
);
...
@@ -36,6 +37,19 @@ public class DataUtils {
...
@@ -36,6 +37,19 @@ public class DataUtils {
public
static
String
getKey
(
String
area
,
String
street
,
String
community
,
String
shelters
,
String
isolation
)
{
public
static
String
getKey
(
String
area
,
String
street
,
String
community
,
String
shelters
,
String
isolation
)
{
JSONObject
map
=
JSON
.
parseObject
(
dateMap
);
JSONObject
map
=
JSON
.
parseObject
(
dateMap
);
JSONObject
sheltersJson
=
null
;
JSONObject
isolationJson
=
null
;
List
<
SysDictData
>
corresponding
=
DictUtils
.
getDictCache
(
"corresponding_user"
);
if
(
corresponding
!=
null
){
List
<
String
>
labels
=
corresponding
.
stream
().
filter
(
i
->
"shelters"
.
equals
(
i
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
if
(!
labels
.
isEmpty
())
sheltersJson
=
JSON
.
parseObject
(
labels
.
get
(
0
));
List
<
String
>
isolations
=
corresponding
.
stream
().
filter
(
i
->
"isolation"
.
equals
(
i
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
if
(!
isolations
.
isEmpty
())
isolationJson
=
JSON
.
parseObject
(
isolations
.
get
(
0
));
}
if
(
StringUtils
.
isNotEmpty
(
community
))
{
if
(
StringUtils
.
isNotEmpty
(
community
))
{
JSONObject
com
=
map
.
getJSONObject
(
"community"
);
JSONObject
com
=
map
.
getJSONObject
(
"community"
);
return
getKey
(
com
,
community
);
return
getKey
(
com
,
community
);
...
@@ -46,11 +60,17 @@ public class DataUtils {
...
@@ -46,11 +60,17 @@ public class DataUtils {
JSONObject
a
=
map
.
getJSONObject
(
"area"
);
JSONObject
a
=
map
.
getJSONObject
(
"area"
);
return
getKey
(
a
,
area
);
return
getKey
(
a
,
area
);
}
else
if
(
StringUtils
.
isNotEmpty
(
shelters
))
{
}
else
if
(
StringUtils
.
isNotEmpty
(
shelters
))
{
JSONObject
a
=
map
.
getJSONObject
(
"shelters"
);
// JSONObject a = map.getJSONObject("shelters");
return
getKey
(
a
,
shelters
);
if
(
sheltersJson
!=
null
)
return
getKey
(
sheltersJson
,
shelters
);
else
return
""
;
}
else
if
(
StringUtils
.
isNotEmpty
(
isolation
))
{
}
else
if
(
StringUtils
.
isNotEmpty
(
isolation
))
{
JSONObject
a
=
map
.
getJSONObject
(
"isolation"
);
if
(
isolationJson
!=
null
)
return
getKey
(
a
,
isolation
);
return
getKey
(
isolationJson
,
isolation
);
else
return
""
;
// JSONObject a = map.getJSONObject("isolation");
}
else
}
else
return
"null"
;
return
"null"
;
}
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/mapper/FcryMapper.java
View file @
ea2fab46
...
@@ -85,4 +85,6 @@ public interface FcryMapper
...
@@ -85,4 +85,6 @@ public interface FcryMapper
List
<
Fcry
>
selectAll
();
List
<
Fcry
>
selectAll
();
int
updateBatch
(
@Param
(
"list"
)
List
<
Fcry
>
list
);
int
updateBatch
(
@Param
(
"list"
)
List
<
Fcry
>
list
);
int
updateFcryByCreateBy
(
@Param
(
"newUserId"
)
String
newUserId
,
@Param
(
"oldUserId"
)
String
oldUserId
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/GldryMapper.java
View file @
ea2fab46
...
@@ -84,4 +84,6 @@ public interface GldryMapper
...
@@ -84,4 +84,6 @@ public interface GldryMapper
List
<
Gldry
>
selectAll
();
List
<
Gldry
>
selectAll
();
int
updateBatch
(
@Param
(
"list"
)
List
<
Gldry
>
list
);
int
updateBatch
(
@Param
(
"list"
)
List
<
Gldry
>
list
);
int
updateGldryByCreateBy
(
@Param
(
"newUserId"
)
String
newUserId
,
@Param
(
"oldUserId"
)
String
oldUserId
);
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
View file @
ea2fab46
package
com
.
ruoyi
.
system
.
service
.
impl
;
package
com
.
ruoyi
.
system
.
service
.
impl
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson2.JSON
;
import
com.alibaba.fastjson2.JSONObject
;
import
com.ruoyi.system.mapper.FcryMapper
;
import
com.ruoyi.system.mapper.GldryMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.common.core.domain.entity.SysDictData
;
import
com.ruoyi.common.core.domain.entity.SysDictData
;
...
@@ -18,6 +25,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService
...
@@ -18,6 +25,10 @@ public class SysDictDataServiceImpl implements ISysDictDataService
{
{
@Autowired
@Autowired
private
SysDictDataMapper
dictDataMapper
;
private
SysDictDataMapper
dictDataMapper
;
@Autowired
private
FcryMapper
fcryMapper
;
@Autowired
private
GldryMapper
gldryMapper
;
/**
/**
* 根据条件分页查询字典数据
* 根据条件分页查询字典数据
...
@@ -100,6 +111,36 @@ public class SysDictDataServiceImpl implements ISysDictDataService
...
@@ -100,6 +111,36 @@ public class SysDictDataServiceImpl implements ISysDictDataService
@Override
@Override
public
int
updateDictData
(
SysDictData
data
)
public
int
updateDictData
(
SysDictData
data
)
{
{
if
(
"corresponding_user"
.
equals
(
data
.
getDictType
())){
List
<
SysDictData
>
dictDatas
=
dictDataMapper
.
selectDictDataByType
(
data
.
getDictType
());
List
<
String
>
values
=
dictDatas
.
stream
().
filter
(
i
->
"shelters"
.
equals
(
i
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
JSONObject
sheltersJson
=
null
;
if
(!
values
.
isEmpty
())
sheltersJson
=
JSON
.
parseObject
(
values
.
get
(
0
));
List
<
String
>
isolations
=
dictDatas
.
stream
().
filter
(
i
->
"isolation"
.
equals
(
i
.
getDictLabel
()))
.
map
(
SysDictData:
:
getDictValue
).
collect
(
Collectors
.
toList
());
JSONObject
isolationJson
=
null
;
if
(!
isolations
.
isEmpty
())
isolationJson
=
JSON
.
parseObject
(
isolations
.
get
(
0
));
JSONObject
dateValue
=
JSON
.
parseObject
(
data
.
getDictValue
());
Iterator
<
String
>
keys
=
dateValue
.
keySet
().
iterator
();
if
(
"shelters"
.
equals
(
data
.
getDictLabel
()))
{
while
(
keys
.
hasNext
())
{
String
key
=
keys
.
next
();
if
(!((
String
)
dateValue
.
get
(
key
)).
equals
(
sheltersJson
.
get
(
key
)))
{
fcryMapper
.
updateFcryByCreateBy
((
String
)
dateValue
.
get
(
key
),(
String
)
sheltersJson
.
get
(
key
));
}
}
}
else
{
while
(
keys
.
hasNext
())
{
String
key
=
keys
.
next
();
if
(!((
String
)
dateValue
.
get
(
key
)).
equals
(
isolationJson
.
get
(
key
)))
{
gldryMapper
.
updateGldryByCreateBy
((
String
)
dateValue
.
get
(
key
),(
String
)
isolationJson
.
get
(
key
));
}
}
}
}
int
row
=
dictDataMapper
.
updateDictData
(
data
);
int
row
=
dictDataMapper
.
updateDictData
(
data
);
if
(
row
>
0
)
if
(
row
>
0
)
{
{
...
...
ruoyi-system/src/main/resources/mapper/system/FcryMapper.xml
View file @
ea2fab46
...
@@ -324,6 +324,11 @@
...
@@ -324,6 +324,11 @@
</foreach>
</foreach>
</update>
</update>
<update
id=
"updateFcryByCreateBy"
>
update fcry set create_by = #{newUserId}
where create_by = #{oldUserId}
</update>
<insert
id=
"updateBatchFcry"
parameterType=
"com.ruoyi.system.domain.Fcry"
>
<insert
id=
"updateBatchFcry"
parameterType=
"com.ruoyi.system.domain.Fcry"
>
<foreach
item=
"item"
index=
"index"
collection=
"list"
separator=
";"
>
<foreach
item=
"item"
index=
"index"
collection=
"list"
separator=
";"
>
update fcry
update fcry
...
...
ruoyi-system/src/main/resources/mapper/system/GldryMapper.xml
View file @
ea2fab46
...
@@ -242,6 +242,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -242,6 +242,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{item.id}
where id = #{item.id}
</foreach>
</foreach>
</update>
</update>
<update
id=
"updateGldryByCreateBy"
>
update gldry set create_by = #{newUserId}
where create_by = #{oldUserId}
</update>
<delete
id=
"deleteGldryById"
parameterType=
"Long"
>
<delete
id=
"deleteGldryById"
parameterType=
"Long"
>
delete from gldry where id = #{id}
delete from gldry where id = #{id}
...
...
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