Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-qyxzpt-report
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
刘良浪
xzxt-qyxzpt-report
Commits
6221af56
Commit
6221af56
authored
Jun 13, 2024
by
liulianglang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
协作单位字典
parent
ff3ee8fd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
408 additions
and
5 deletions
+408
-5
src/main/java/org/springblade/common/config/BladeConfiguration.java
+3
-0
src/main/java/org/springblade/founder/redis/controller/DictitemController.java
+228
-1
src/main/java/org/springblade/founder/redis/mapper/DictitemMapper.java
+2
-0
src/main/java/org/springblade/founder/redis/mapper/DictitemMapper.xml
+29
-0
src/main/java/org/springblade/founder/redis/service/IDicItemService.java
+4
-1
src/main/java/org/springblade/founder/redis/service/impl/IDicItemServiceImpl.java
+112
-2
src/main/java/org/springblade/founder/redis/service/impl/ImportCode.java
+29
-0
src/main/java/org/springblade/founder/xzqq/entity/TbYwXzqqXx.java
+1
-1
No files found.
src/main/java/org/springblade/common/config/BladeConfiguration.java
View file @
6221af56
...
@@ -55,6 +55,9 @@ public class BladeConfiguration implements WebMvcConfigurer {
...
@@ -55,6 +55,9 @@ public class BladeConfiguration implements WebMvcConfigurer {
secureRegistry
.
excludePathPatterns
(
"/tjpg/*"
);
secureRegistry
.
excludePathPatterns
(
"/tjpg/*"
);
secureRegistry
.
excludePathPatterns
(
"/bbkwp/*"
);
secureRegistry
.
excludePathPatterns
(
"/bbkwp/*"
);
secureRegistry
.
excludePathPatterns
(
"/queryCodeByType"
);
secureRegistry
.
excludePathPatterns
(
"/queryCodeByType"
);
secureRegistry
.
excludePathPatterns
(
"/refreshQyxzCodeCache"
);
secureRegistry
.
excludePathPatterns
(
"/queryQyxzCodeByType"
);
secureRegistry
.
excludePathPatterns
(
"/reloadQyxzXzxtDict"
);
secureRegistry
.
excludePathPatterns
(
"/whitelist/check"
);
secureRegistry
.
excludePathPatterns
(
"/whitelist/check"
);
secureRegistry
.
excludePathPatterns
(
"/sysuser/zcinsertUserNew"
);
secureRegistry
.
excludePathPatterns
(
"/sysuser/zcinsertUserNew"
);
secureRegistry
.
excludePathPatterns
(
"/qqzc/flow/getDzqqByAsjbhAndSjhCount"
);
secureRegistry
.
excludePathPatterns
(
"/qqzc/flow/getDzqqByAsjbhAndSjhCount"
);
...
...
src/main/java/org/springblade/founder/redis/controller/DictitemController.java
View file @
6221af56
...
@@ -47,6 +47,88 @@ public class DictitemController {
...
@@ -47,6 +47,88 @@ public class DictitemController {
return
R
.
error
();
return
R
.
error
();
}
}
}
}
@RequestMapping
(
value
=
"/queryQyxzCodeByType"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
R
queryQyxzCodeByType
(
String
type
,
String
id
,
String
startId
,
String
yycj
,
String
name
,
String
codes
,
String
grade
)
{
try
{
if
(
"prev"
.
equals
(
grade
))
{
JSONObject
jsonObject
=
getXzqyPreNodes
(
type
,
id
);
return
R
.
ok
().
data
(
"data"
,
jsonObject
.
getJSONArray
(
"data"
));
}
else
{
List
<
ZTreeNode
>
ZTreeNodeList
=
queryQyxzTypeCode
(
type
,
id
,
startId
,
yycj
,
name
,
codes
);
return
R
.
ok
().
data
(
"rows"
,
ZTreeNodeList
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
error
();
}
}
private
JSONObject
getXzqyPreNodes
(
String
type
,
String
code
)
{
JSONObject
resultObj
=
new
JSONObject
();
List
<
Map
<
String
,
Object
>>
rtList
=
new
ArrayList
<>();
ZTreeNode
curNode
=
null
;
String
pid
=
null
;
List
<
ZTreeNode
>
siblingNodes
;
while
(!
StringUtils
.
isEmpty
(
code
))
{
curNode
=
getQyxzNodeByCode
(
type
,
code
);
pid
=
curNode
.
getPId
();
if
(!
StringUtils
.
isEmpty
(
pid
))
{
siblingNodes
=
queryQyxzTypeCode
(
type
,
pid
,
null
,
null
,
null
,
null
);
code
=
pid
;
}
else
{
siblingNodes
=
queryQyxzTypeCode
(
type
,
null
,
null
,
null
,
null
,
null
);
code
=
null
;
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"pid"
,
pid
);
map
.
put
(
"items"
,
siblingNodes
);
rtList
.
add
(
map
);
}
int
index1
=
0
;
int
index2
=
0
;
for
(
int
i
=
rtList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
Map
<
String
,
Object
>
itemMap
=
rtList
.
get
(
i
);
String
parentid
=
(
String
)
itemMap
.
get
(
"pid"
);
JSONArray
items
=
JSONArray
.
parseArray
(
JSONObject
.
toJSONString
(
itemMap
.
get
(
"items"
)));
if
(
i
==
rtList
.
size
()
-
1
)
{
resultObj
.
put
(
"data"
,
items
);
}
else
{
if
(
i
==
rtList
.
size
()
-
2
)
{
JSONArray
lastArray
=
resultObj
.
getJSONArray
(
"data"
);
for
(
int
j
=
0
;
j
<
lastArray
.
size
();
j
++)
{
if
(
parentid
.
equals
(
lastArray
.
getJSONObject
(
j
).
getString
(
"id"
)))
{
index1
=
j
;
lastArray
.
getJSONObject
(
j
).
put
(
"children"
,
items
);
break
;
}
}
}
if
(
i
==
rtList
.
size
()
-
3
)
{
JSONArray
array2
=
resultObj
.
getJSONArray
(
"data"
).
getJSONObject
(
index1
).
getJSONArray
(
"children"
);
for
(
int
k
=
0
;
k
<
array2
.
size
();
k
++)
{
if
(
parentid
.
equals
(
array2
.
getJSONObject
(
k
).
getString
(
"id"
)))
{
index2
=
k
;
array2
.
getJSONObject
(
k
).
put
(
"children"
,
items
);
break
;
}
}
}
if
(
i
==
rtList
.
size
()
-
4
)
{
JSONArray
array3
=
resultObj
.
getJSONArray
(
"data"
).
getJSONObject
(
index1
).
getJSONArray
(
"children"
).
getJSONObject
(
index2
).
getJSONArray
(
"children"
);
for
(
int
m
=
0
;
m
<
array3
.
size
();
m
++)
{
if
(
parentid
.
equals
(
array3
.
getJSONObject
(
m
).
getString
(
"id"
)))
{
index2
=
m
;
array3
.
getJSONObject
(
m
).
put
(
"children"
,
items
);
break
;
}
}
}
}
}
return
resultObj
;
}
private
JSONObject
getPreNodes
(
String
type
,
String
code
)
{
private
JSONObject
getPreNodes
(
String
type
,
String
code
)
{
JSONObject
resultObj
=
new
JSONObject
();
JSONObject
resultObj
=
new
JSONObject
();
...
@@ -121,7 +203,13 @@ public class DictitemController {
...
@@ -121,7 +203,13 @@ public class DictitemController {
}
}
return
zTreeNodeList
.
get
(
0
);
return
zTreeNodeList
.
get
(
0
);
}
}
private
ZTreeNode
getQyxzNodeByCode
(
String
type
,
String
code
)
{
List
<
ZTreeNode
>
zTreeNodeList
=
dicItemService
.
queryQyxzCodes
(
type
,
code
,
null
);
if
(
zTreeNodeList
==
null
||
zTreeNodeList
.
size
()
<
1
)
{
return
new
ZTreeNode
();
}
return
zTreeNodeList
.
get
(
0
);
}
@RequestMapping
(
value
=
"/queryTypeCode"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/queryTypeCode"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
List
<
ZTreeNode
>
queryTypeCode
(
String
type
,
String
id
,
String
startId
,
String
yycj
,
String
name
,
String
codes
)
{
public
List
<
ZTreeNode
>
queryTypeCode
(
String
type
,
String
id
,
String
startId
,
String
yycj
,
String
name
,
String
codes
)
{
...
@@ -161,7 +249,45 @@ public class DictitemController {
...
@@ -161,7 +249,45 @@ public class DictitemController {
ZTreeNodeList
=
Sort
(
ZTreeNodeList
);
ZTreeNodeList
=
Sort
(
ZTreeNodeList
);
return
ZTreeNodeList
;
return
ZTreeNodeList
;
}
}
@RequestMapping
(
value
=
"/queryQyxzTypeCode"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
List
<
ZTreeNode
>
queryQyxzTypeCode
(
String
type
,
String
id
,
String
startId
,
String
yycj
,
String
name
,
String
codes
)
{
List
<
ZTreeNode
>
ZTreeNodeList
=
new
ArrayList
<
ZTreeNode
>();
if
(
type
!=
null
&&
!
""
.
equals
(
type
))
{
if
(
type
.
equals
(
"CODE_JY"
))
{
//添加警员查询的字典
ZTreeNodeList
=
dicItemService
.
queryTypeUsercode
(
startId
,
name
);
//查询警员字典
}
else
{
if
(
codes
!=
null
&&
!
""
.
equals
(
codes
))
{
ZTreeNodeList
=
dicItemService
.
queryCodes
(
type
,
codes
,
name
);
}
else
{
// 立案单位走这条路
ZTreeNodeList
=
dicItemService
.
queryQyxzTypeCode
(
type
,
id
,
startId
,
yycj
,
name
);
}
}
}
if
(
"CODE_QGUNIT"
.
equals
(
type
)
&&
StringUtils
.
isEmpty
(
id
)){
List
<
ZTreeNode
>
bjdwList
=
new
ArrayList
<>();
List
<
ZTreeNode
>
sjdwList
=
new
ArrayList
<>();
for
(
ZTreeNode
node
:
ZTreeNodeList
){
String
codestr
=
node
.
getId
();
if
(
codestr
.
startsWith
(
"01"
)){
bjdwList
.
add
(
node
);
}
else
{
sjdwList
.
add
(
node
);
}
}
bjdwList
=
Sort
(
bjdwList
);
sjdwList
=
Sort
(
sjdwList
);
sjdwList
.
addAll
(
bjdwList
);
return
sjdwList
;
}
ZTreeNodeList
=
Sort
(
ZTreeNodeList
);
return
ZTreeNodeList
;
}
private
List
<
ZTreeNode
>
Sort
(
List
<
ZTreeNode
>
ZTreeNodeList
)
{
private
List
<
ZTreeNode
>
Sort
(
List
<
ZTreeNode
>
ZTreeNodeList
)
{
Collections
.
sort
(
ZTreeNodeList
,
new
Comparator
<
ZTreeNode
>()
{
Collections
.
sort
(
ZTreeNodeList
,
new
Comparator
<
ZTreeNode
>()
{
@Override
@Override
...
@@ -232,6 +358,25 @@ public class DictitemController {
...
@@ -232,6 +358,25 @@ public class DictitemController {
}
}
/**
* 根据类别重新刷新redis缓存
*/
@RequestMapping
(
"/refreshQyxzCodeCache"
)
@ResponseBody
public
R
refreshQyxzCodeCache
(
String
type
)
{
String
result
=
""
;
try
{
importCode
.
insertQyxzIntoRedis
(
type
);
type
=
(
null
==
type
||
"null"
==
type
)
?
""
:
type
;
result
=
"字典"
+
type
+
"成功加入缓存"
;
return
R
.
ok
().
data
(
"result"
,
result
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
result
=
"刷新字典发生异常!"
+
"\n"
+
e
.
getMessage
();
return
R
.
error
(
result
);
}
}
@RequestMapping
(
value
=
"/reloadXzxtDict"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/reloadXzxtDict"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
R
reloadXzxtDict
(
String
type
)
{
public
R
reloadXzxtDict
(
String
type
)
{
...
@@ -253,6 +398,27 @@ public class DictitemController {
...
@@ -253,6 +398,27 @@ public class DictitemController {
return
R
.
error
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
}
}
}
}
@RequestMapping
(
value
=
"/reloadQyxzXzxtDict"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
R
reloadQyxzXzxtDict
(
String
type
)
{
try
{
List
<
String
>
types
;
if
(
StringUtils
.
isEmpty
(
type
))
{
types
=
importCode
.
getAllTypes
(
null
);
}
else
if
(
"SHCE"
.
equals
(
type
))
{
types
=
importCode
.
getAllTypes
(
"SHCE"
);
}
else
{
types
=
Arrays
.
asList
(
type
.
split
(
","
));
}
for
(
String
str
:
types
)
{
getQyxzAllDicJson
(
str
);
}
return
R
.
ok
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
R
.
error
(
e
.
getMessage
());
}
}
//生成对应groupid的字典的json文件
//生成对应groupid的字典的json文件
private
void
getAllDicJson
(
String
type
)
throws
Exception
{
private
void
getAllDicJson
(
String
type
)
throws
Exception
{
...
@@ -297,6 +463,51 @@ public class DictitemController {
...
@@ -297,6 +463,51 @@ public class DictitemController {
}
}
}
}
//生成对应groupid的字典的json文件
private
void
getQyxzAllDicJson
(
String
type
)
throws
Exception
{
System
.
out
.
println
(
"type==========="
+
type
);
String
jsonStr
=
""
;
JSONObject
jsonObject
=
new
JSONObject
();
List
<
ZTreeNode
>
ZTreeNodeList
=
dicItemService
.
queryQyxzTypeCode
(
type
,
null
,
null
,
null
,
null
);
ZTreeNodeList
=
Sort
(
ZTreeNodeList
);
//拿到所有父节点,通过父节点去查询所有的子节点,然后生成json串
for
(
int
i
=
0
;
i
<
ZTreeNodeList
.
size
();
i
++)
{
ZTreeNode
zTreeNode1
=
ZTreeNodeList
.
get
(
i
);
//判断是否为父节点
if
(
zTreeNode1
.
isIsParent
())
{
//为父节点拿到子节点
List
<
ZTreeNode
>
ZTreeNodeChildrenList1
=
dicItemService
.
queryQyxzTypeCode
(
type
,
zTreeNode1
.
getId
(),
null
,
null
,
null
);
getqyxzZdList
(
ZTreeNodeChildrenList1
,
type
);
zTreeNode1
.
setChildren
(
ZTreeNodeChildrenList1
);
}
}
jsonObject
.
put
(
"success"
,
true
);
jsonObject
.
put
(
"code"
,
200
);
jsonObject
.
put
(
"message"
,
"成功"
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
();
dataMap
.
put
(
"rows"
,
ZTreeNodeList
);
jsonObject
.
put
(
"data"
,
dataMap
);
jsonStr
=
JSONObject
.
toJSONString
(
jsonObject
,
SerializerFeature
.
PrettyFormat
,
SerializerFeature
.
WriteMapNullValue
,
SerializerFeature
.
WriteDateUseDateFormat
);
try
{
String
filePath
=
jsonPath
+
File
.
separator
;
File
file
=
new
File
(
filePath
);
if
(!
file
.
exists
())
{
file
.
mkdir
();
}
String
fileName
=
filePath
+
type
+
".json"
;
String
encoding
=
"utf-8"
;
BufferedWriter
out
=
new
BufferedWriter
(
new
OutputStreamWriter
(
new
FileOutputStream
(
fileName
),
encoding
));
out
.
write
(
jsonStr
);
// \r\n即为换行
out
.
flush
();
// 把缓存区内容压入文件
out
.
close
();
// 最后记得关闭文件
}
catch
(
IOException
e
)
{
throw
new
IOException
(
e
);
}
}
public
void
getZdList
(
List
<
ZTreeNode
>
ZTreeNodeChildrenList
,
String
type
)
{
public
void
getZdList
(
List
<
ZTreeNode
>
ZTreeNodeChildrenList
,
String
type
)
{
if
(
ZTreeNodeChildrenList
!=
null
&&
ZTreeNodeChildrenList
.
size
()
>
0
)
{
if
(
ZTreeNodeChildrenList
!=
null
&&
ZTreeNodeChildrenList
.
size
()
>
0
)
{
ZTreeNodeChildrenList
=
Sort
(
ZTreeNodeChildrenList
);
ZTreeNodeChildrenList
=
Sort
(
ZTreeNodeChildrenList
);
...
@@ -311,4 +522,20 @@ public class DictitemController {
...
@@ -311,4 +522,20 @@ public class DictitemController {
}
}
}
}
}
}
public
void
getqyxzZdList
(
List
<
ZTreeNode
>
ZTreeNodeChildrenList
,
String
type
)
{
if
(
ZTreeNodeChildrenList
!=
null
&&
ZTreeNodeChildrenList
.
size
()
>
0
)
{
ZTreeNodeChildrenList
=
Sort
(
ZTreeNodeChildrenList
);
for
(
int
t
=
0
;
t
<
ZTreeNodeChildrenList
.
size
();
t
++)
{
ZTreeNode
zTreeNode
=
ZTreeNodeChildrenList
.
get
(
t
);
if
(
zTreeNode
.
isIsParent
())
{
List
<
ZTreeNode
>
ZTreeNodeChildrenList1
=
dicItemService
.
queryQyxzTypeCode
(
type
,
zTreeNode
.
getId
(),
null
,
null
,
null
);
ZTreeNodeChildrenList1
=
Sort
(
ZTreeNodeChildrenList1
);
zTreeNode
.
setChildren
(
ZTreeNodeChildrenList1
);
getqyxzZdList
(
ZTreeNodeChildrenList1
,
type
);
}
}
}
}
}
}
src/main/java/org/springblade/founder/redis/mapper/DictitemMapper.java
View file @
6221af56
...
@@ -14,6 +14,8 @@ import java.util.Map;
...
@@ -14,6 +14,8 @@ import java.util.Map;
public
interface
DictitemMapper
{
public
interface
DictitemMapper
{
List
<
SysDictitem
>
findCodeAllByType
(
String
value
);
List
<
SysDictitem
>
findCodeAllByType
(
String
value
);
List
<
SysDictitem
>
findQyxzCodeAllByType
(
String
value
);
List
<
User
>
queryAllUnitUser
(
Map
m
);
List
<
User
>
queryAllUnitUser
(
Map
m
);
List
<
String
>
getAllTypes
(
@Param
(
value
=
"type"
)
String
type
);
List
<
String
>
getAllTypes
(
@Param
(
value
=
"type"
)
String
type
);
...
...
src/main/java/org/springblade/founder/redis/mapper/DictitemMapper.xml
View file @
6221af56
...
@@ -40,6 +40,35 @@
...
@@ -40,6 +40,35 @@
order by code asc
order by code asc
</select>
</select>
<select
id=
"findQyxzCodeAllByType"
parameterType=
"java.lang.String"
resultType=
"org.springblade.modules.system.entity.SysDictitem"
>
select distinct
id,
isparent,
groupid,
code ,
name,
groupname,
pid,
description,
yycj1,
yycj2,
yycj3,
yycj4,
yycj5,
yycj6,
yycj7,
yycj8,
yycj9,
startcode,
endcode
from tb_yw_xzqq_xzdwdm
where 1=1
and scbz = '0'
<if
test=
"value != null"
>
and groupid=#{value, jdbcType=VARCHAR}
</if>
order by code asc
</select>
<select
id=
"getAllTypes"
resultType=
"java.lang.String"
>
<select
id=
"getAllTypes"
resultType=
"java.lang.String"
>
select distinct(groupid) from sys_dictitem
select distinct(groupid) from sys_dictitem
...
...
src/main/java/org/springblade/founder/redis/service/IDicItemService.java
View file @
6221af56
...
@@ -8,13 +8,16 @@ public interface IDicItemService {
...
@@ -8,13 +8,16 @@ public interface IDicItemService {
List
<
ZTreeNode
>
queryTypeCode
(
String
code_type
,
String
id
,
String
startId
,
String
yycj
,
String
name
);
List
<
ZTreeNode
>
queryTypeCode
(
String
code_type
,
String
id
,
String
startId
,
String
yycj
,
String
name
);
/**
List
<
ZTreeNode
>
queryQyxzTypeCode
(
String
code_type
,
String
id
,
String
startId
,
String
yycj
,
String
name
);
/**
* 查询指定节点的代码
* 查询指定节点的代码
* @param code_type
* @param code_type
* @param codes
* @param codes
* @return
* @return
*/
*/
List
<
ZTreeNode
>
queryCodes
(
String
code_type
,
String
codes
,
String
name
);
List
<
ZTreeNode
>
queryCodes
(
String
code_type
,
String
codes
,
String
name
);
List
<
ZTreeNode
>
queryQyxzCodes
(
String
code_type
,
String
codes
,
String
name
);
/**
/**
* 根据条件查询代码
* 根据条件查询代码
...
...
src/main/java/org/springblade/founder/redis/service/impl/IDicItemServiceImpl.java
View file @
6221af56
...
@@ -120,7 +120,76 @@ public class IDicItemServiceImpl implements IDicItemService {
...
@@ -120,7 +120,76 @@ public class IDicItemServiceImpl implements IDicItemService {
return
ztreeNodes
;
return
ztreeNodes
;
}
}
public
List
<
ZTreeNode
>
getZtreeNodeByName
(
String
code_type
,
String
id
,
String
yycj
,
String
unitcode
,
String
name
)
{
@Override
public
List
<
ZTreeNode
>
queryQyxzTypeCode
(
String
type
,
String
id
,
String
startId
,
String
yycj
,
String
name
)
{
List
<
ZTreeNode
>
ztreeNodes
=
new
ArrayList
<>();
if
(
null
!=
ssdw
&&
!
""
.
equals
(
ssdw
)
&&
ssdw
.
length
()
>=
2
)
{
ssdw
=
ssdw
.
substring
(
0
,
2
);
}
if
(
id
==
null
||
""
.
equals
(
id
)){
//根节点
id
=
null
;
if
(
"CODE_UNIT"
.
equals
(
type
)){
//单位代码增加起始单位过滤功能
if
(
startId
!=
null
){
id
=
startId
.
substring
(
0
,
2
)+
"000000000000"
.
substring
(
startId
.
length
()-
2
);
}
}
else
if
(
"CODE_AJXZLB"
.
equals
(
type
)||
"CODE_XALBDMBCMS"
.
equals
(
type
)){
id
=
startId
;
//System.out.println("startId="+startId);
}
}
if
(
name
==
null
||
""
.
equals
(
name
)){
name
=
"*"
;
}
else
{
name
=
"*"
+
name
+
"*"
;
id
=
"*"
;
}
if
(
startId
==
null
||
""
.
equals
(
startId
)){
startId
=
"*"
;
}
else
{
startId
=
startId
+
"*"
;
}
//获取符合条件的key
String
keys
=
"qyxz"
+
ssdw
+
":"
+
type
+
":"
+
id
+
":"
+
startId
+
":"
+
name
+
":*"
;
Set
<
String
>
set
=
redisTemplate
.
keys
(
keys
);
//System.out.println("keys="+keys);
//System.out.println("=============");
//System.out.println(set);
Iterator
<
String
>
iterator
=
set
.
iterator
();
while
(
iterator
.
hasNext
()){
String
str
=
iterator
.
next
();
//System.out.println("key="+str);
String
jsonStr
=
redisTemplate
.
opsForValue
().
get
(
str
);
//System.out.println("jsonStr="+jsonStr);
jsonStr
=
jsonStr
.
replaceAll
(
"\\\\"
,
""
);
if
(
jsonStr
.
startsWith
(
"\""
)){
jsonStr
=
jsonStr
.
substring
(
1
,
jsonStr
.
length
());
}
if
(
jsonStr
.
endsWith
(
"\""
)){
jsonStr
=
jsonStr
.
substring
(
0
,
jsonStr
.
length
()-
1
);
}
//System.out.println("jsonStr="+jsonStr);
SysDictitem
sysDictitem
=
JSON
.
parseObject
(
jsonStr
,
SysDictitem
.
class
);
ZTreeNode
node
=
new
ZTreeNode
();
node
=
parseSysDictitemToNode
(
node
,
sysDictitem
);
if
(
node
.
getPId
()==
null
||
""
.
equals
(
node
.
getPId
())||
node
.
isIsParent
()){
node
.
setState
(
"closed"
);
//显示文件夹图标
}
else
{
node
.
setState
(
null
);
//显示叶子图标
}
ztreeNodes
.
add
(
node
);
}
//System.out.println("------------------------");
//System.out.println(ztreeNodes.toString());
return
ztreeNodes
;
}
public
List
<
ZTreeNode
>
getZtreeNodeByName
(
String
code_type
,
String
id
,
String
yycj
,
String
unitcode
,
String
name
)
{
List
<
ZTreeNode
>
ztreeNodes
=
new
ArrayList
<>();
List
<
ZTreeNode
>
ztreeNodes
=
new
ArrayList
<>();
if
(
null
!=
ssdw
&&
!
""
.
equals
(
ssdw
)
&&
ssdw
.
length
()
>=
2
)
{
if
(
null
!=
ssdw
&&
!
""
.
equals
(
ssdw
)
&&
ssdw
.
length
()
>=
2
)
{
ssdw
=
ssdw
.
substring
(
0
,
2
);
ssdw
=
ssdw
.
substring
(
0
,
2
);
...
@@ -237,11 +306,52 @@ public class IDicItemServiceImpl implements IDicItemService {
...
@@ -237,11 +306,52 @@ public class IDicItemServiceImpl implements IDicItemService {
}
}
@Override
public
List
<
ZTreeNode
>
queryQyxzCodes
(
String
type
,
String
codes
,
String
name
)
{
List
<
ZTreeNode
>
ztreeNodes
=
new
ArrayList
<
ZTreeNode
>();
if
(
null
!=
ssdw
&&
!
""
.
equals
(
ssdw
)
&&
ssdw
.
length
()
>=
2
)
{
ssdw
=
ssdw
.
substring
(
0
,
2
);
}
if
(
codes
.
endsWith
(
","
)){
codes
=
codes
.
substring
(
0
,
codes
.
length
()-
1
);
}
if
(
name
==
null
||
""
.
equals
(
name
)){
name
=
"*"
;
}
String
[]
codeArray
=
codes
.
split
(
","
);
for
(
String
code:
codeArray
){
//获取符合条件的key
System
.
out
.
println
(
"code="
+
code
);
String
key
=
"qyxz"
+
ssdw
+
":"
+
type
+
":*:"
+
code
+
":"
+
name
+
":*"
;
Set
<
String
>
set
=
redisTemplate
.
keys
(
key
);
Iterator
<
String
>
iterator
=
set
.
iterator
();
while
(
iterator
.
hasNext
()){
String
str
=
iterator
.
next
();
String
jsonStr
=
redisTemplate
.
opsForValue
().
get
(
str
);
if
(
jsonStr
!=
null
){
jsonStr
=
jsonStr
.
replaceAll
(
"\\\\"
,
""
);
if
(
jsonStr
.
startsWith
(
"\""
)){
jsonStr
=
jsonStr
.
substring
(
1
,
jsonStr
.
length
());
}
if
(
jsonStr
.
endsWith
(
"\""
)){
jsonStr
=
jsonStr
.
substring
(
0
,
jsonStr
.
length
()-
1
);
}
SysDictitem
sysDictitem
=
JSON
.
parseObject
(
jsonStr
,
SysDictitem
.
class
);
ZTreeNode
node
=
new
ZTreeNode
();
node
=
parseSysDictitemToNode
(
node
,
sysDictitem
);
node
.
setState
(
null
);
//显示叶子图标
ztreeNodes
.
add
(
node
);
}
}
}
return
ztreeNodes
;
}
private
ZTreeNode
parseSysDictitemToNode
(
ZTreeNode
node
,
SysDictitem
sysDictitem
){
private
ZTreeNode
parseSysDictitemToNode
(
ZTreeNode
node
,
SysDictitem
sysDictitem
){
node
.
setIds
(
sysDictitem
.
getId
());
node
.
setIds
(
sysDictitem
.
getId
());
node
.
setCodeType
(
sysDictitem
.
getGroupid
());
node
.
setCodeType
(
sysDictitem
.
getGroupid
());
node
.
setLabel
(
sysDictitem
.
getName
());
node
.
setLabel
(
sysDictitem
.
getName
());
...
...
src/main/java/org/springblade/founder/redis/service/impl/ImportCode.java
View file @
6221af56
...
@@ -21,6 +21,7 @@ public class ImportCode {
...
@@ -21,6 +21,7 @@ public class ImportCode {
private
DictitemMapper
iDictitemDao
;
private
DictitemMapper
iDictitemDao
;
@Value
(
"${ssdw}"
)
@Value
(
"${ssdw}"
)
private
String
ssdw
;
//所属单位
private
String
ssdw
;
//所属单位
@Autowired
@Autowired
private
StringRedisTemplate
redisTemplate
;
private
StringRedisTemplate
redisTemplate
;
...
@@ -51,6 +52,34 @@ public class ImportCode {
...
@@ -51,6 +52,34 @@ public class ImportCode {
System
.
out
.
println
(
"字典"
+
type
+
"成功加入缓存---------------------------------------------"
);
System
.
out
.
println
(
"字典"
+
type
+
"成功加入缓存---------------------------------------------"
);
}
}
public
void
insertQyxzIntoRedis
(
String
type
)
{
if
(
null
!=
ssdw
&&
!
""
.
equals
(
ssdw
)
&&
ssdw
.
length
()
>=
2
)
{
ssdw
=
ssdw
.
substring
(
0
,
2
);
}
//先删除指定key缓存,再加入缓存
String
keys
=
ssdw
+
":*"
;
if
(
null
!=
type
&&
"null"
!=
type
){
keys
=
ssdw
+
":"
+
type
+
"*"
;
}
System
.
out
.
println
(
"ssdw="
+
ssdw
);
System
.
out
.
println
(
"keys="
+
keys
);
Set
<
String
>
dictitemKeys
=
redisTemplate
.
keys
(
"qyxz"
+
keys
);
redisTemplate
.
delete
(
dictitemKeys
);
List
<
SysDictitem
>
zTreeNodeList
=
iDictitemDao
.
findQyxzCodeAllByType
(
type
);
for
(
SysDictitem
node:
zTreeNodeList
){
String
nodeStr
=
JSON
.
toJSONString
(
node
);
String
pid
=
null
;
if
(!
StringUtils
.
isEmpty
(
node
.
getPid
())){
pid
=
node
.
getPid
();
}
String
key
=
"qyxz"
+
ssdw
+
":"
+
node
.
getGroupid
()+
":"
+
pid
+
":"
+
node
.
getCode
()+
":"
+
node
.
getName
()+
":"
+
node
.
getId
()+
"|"
+
node
.
getName
();
redisTemplate
.
opsForValue
().
set
(
key
,
nodeStr
);
}
type
=
(
null
==
type
||
"null"
==
type
)?
""
:
type
;
System
.
out
.
println
(
"字典"
+
type
+
"成功加入缓存---------------------------------------------"
);
}
//获取字典表中相关的的groupid
//获取字典表中相关的的groupid
public
List
<
String
>
getAllTypes
(
String
type
)
{
public
List
<
String
>
getAllTypes
(
String
type
)
{
return
iDictitemDao
.
getAllTypes
(
type
);
return
iDictitemDao
.
getAllTypes
(
type
);
...
...
src/main/java/org/springblade/founder/xzqq/entity/TbYwXzqqXx.java
View file @
6221af56
...
@@ -94,7 +94,7 @@ public class TbYwXzqqXx implements Serializable {
...
@@ -94,7 +94,7 @@ public class TbYwXzqqXx implements Serializable {
private
Date
spsj
;
private
Date
spsj
;
/**
/**
* 协作状态 1-待审核,2-协作中,3-完成 ,4-审核不通过,5-管理员驳回
* 协作状态
0-草稿
1-待审核,2-协作中,3-完成 ,4-审核不通过,5-管理员驳回
*/
*/
private
String
xzzt
;
private
String
xzzt
;
private
String
xzztStr
;
private
String
xzztStr
;
...
...
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