Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zczlService
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
曹崟
zczlService
Commits
121bf963
Commit
121bf963
authored
Nov 17, 2020
by
wangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
海南侦查指令管理联络员不显示下级联络员bug修改
parent
1e6dce08
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
76 deletions
+20
-76
src/main/java/com/founder/zczl/controller/ZczlController.java
+14
-0
src/main/java/com/founder/zczl/service/impl/ZczlService.java
+0
-74
src/main/resources/mapper/ZczlMapper.xml
+6
-2
No files found.
src/main/java/com/founder/zczl/controller/ZczlController.java
View file @
121bf963
...
...
@@ -975,6 +975,20 @@ public class ZczlController {
tbYwZczlLly
.
setBegin
(
begin
);
tbYwZczlLly
.
setEnd
(
end
);
String
unitcode
=
tbYwZczlLly
.
getUnitcode
();
if
(
StringUtils
.
isNotBlank
(
unitcode
)){
if
(
unitcode
.
endsWith
(
"0000000000"
)){
tbYwZczlLly
.
setUnitcode
(
unitcode
.
substring
(
0
,
2
));
}
else
if
(
unitcode
.
endsWith
(
"00000000"
)){
tbYwZczlLly
.
setUnitcode
(
unitcode
.
substring
(
0
,
4
));
}
else
if
(
unitcode
.
endsWith
(
"000000"
)){
tbYwZczlLly
.
setUnitcode
(
unitcode
.
substring
(
0
,
6
));
}
else
if
(
unitcode
.
endsWith
(
"0000"
)){
tbYwZczlLly
.
setUnitcode
(
unitcode
.
substring
(
0
,
8
));
}
else
if
(
unitcode
.
endsWith
(
"00"
)){
tbYwZczlLly
.
setUnitcode
(
unitcode
.
substring
(
0
,
10
));
}
}
List
<
TbYwZczlLly
>
tbYwZczlLlyList
=
zczlService
.
toQueryAllUser
(
tbYwZczlLly
,
user
);
Integer
totalCount
=
0
;
totalCount
=
zczlService
.
toQueryAllUserForTotal
(
tbYwZczlLly
);
...
...
src/main/java/com/founder/zczl/service/impl/ZczlService.java
View file @
121bf963
...
...
@@ -522,80 +522,6 @@ public class ZczlService implements IZczlService {
*/
@Override
public
List
<
TbYwZczlLly
>
toQueryAllUser
(
TbYwZczlLly
tbYwZczlLly
,
User
user
)
{
//进入默认查询本单位用户以及下级单位用户
String
myUnitcode
=
user
.
getUnitcode
();
String
searchUnitcode
=
tbYwZczlLly
.
getUnitcode
();
if
(
searchUnitcode
==
null
||
""
.
equals
(
searchUnitcode
)){
String
inString
=
null
;
//通过单位代码拿到其下级的单位
List
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
myUnitcode
);
//添加本单位
List
<
String
>
xycxList
=
new
ArrayList
<>();
//需要查询的单位
xycxList
.
add
(
myUnitcode
);
boolean
bool
=
true
;
//是否还存在子节点
//通过单位代码拿到其子节点
while
(
bool
){
xycxList
=
zczlDao
.
getChilds
(
xycxList
);
if
(
xycxList
==
null
||
xycxList
.
size
()==
0
){
bool
=
false
;
//没有子节点
}
else
{
for
(
int
i
=
0
;
i
<
xycxList
.
size
();
i
++){
list
.
add
(
xycxList
.
get
(
i
));
}
}
}
//oracle的in关键字中的元素不能超过1000
boolean
oneIn
=
true
;
//是否只用一个in
if
(
list
!=
null
&&
list
.
size
()>
1000
){
oneIn
=
false
;
}
if
(
oneIn
){
//遍历list,拼接单位的字符串
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
//只有一个单位
if
(
i
==
0
&&
i
==
list
.
size
()-
1
){
inString
=
"('"
+
list
.
get
(
i
)+
"')"
;
}
else
if
(
i
==
0
){
inString
=
"('"
+
list
.
get
(
i
)+
"'"
;
}
else
if
(
i
!=
list
.
size
()-
1
){
inString
=
inString
+
",'"
+
list
.
get
(
i
)+
"'"
;
}
else
{
inString
=
inString
+
",'"
+
list
.
get
(
i
)+
"')"
;
}
}
}
else
{
//遍历list,拼接单位的字符串
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
if
(
i
<
500
){
if
(
i
==
0
){
inString
=
"('"
+
list
.
get
(
i
)+
"'"
;
}
else
if
(
i
<
499
){
inString
=
inString
+
",'"
+
list
.
get
(
i
)+
"'"
;
}
else
{
inString
=
inString
+
",'"
+
list
.
get
(
i
)+
"')"
;
}
}
else
{
if
(
i
==
list
.
size
()
-
1
&&
i
%
500
==
0
){
inString
=
inString
+
"or UNITCODE in ('"
+
list
.
get
(
i
)+
"'"
;
}
else
if
(
i
%
500
==
0
){
inString
=
inString
+
"or UNITCODE in ('"
+
list
.
get
(
i
)+
"'"
;
}
else
if
((
i
+
1
)
%
500
!=
0
&&
i
!=
list
.
size
()-
1
){
inString
=
inString
+
",'"
+
list
.
get
(
i
)+
"'"
;
}
else
{
inString
=
inString
+
",'"
+
list
.
get
(
i
)+
"')"
;
}
}
}
}
searchUnitcode
=
inString
;
}
else
{
searchUnitcode
=
"('"
+
searchUnitcode
+
"')"
;
}
tbYwZczlLly
.
setUnitcode
(
searchUnitcode
);
return
zczlDao
.
toQueryAllUser
(
tbYwZczlLly
);
}
...
...
src/main/resources/mapper/ZczlMapper.xml
View file @
121bf963
...
...
@@ -743,9 +743,11 @@
(select name from sys_dictitem where groupid='CODE_XZUNIT' and code=UNITCODE) as unitname,
TELEPHONE telephone
from SYS_USER where scbz='0'
<if
test=
"unitcode!=null and unitcode!=''"
>
and
(UNITCODE in ${unitcode} )
</if>
<if
test=
"unitcode!=null and unitcode!=''"
>
and
UNITCODE like #{unitcode, jdbcType=VARCHAR}||'%'
</if>
<if
test=
"truename!=null and truename!=''"
>
and TRUE_NAME like '%'||#{truename, jdbcType=VARCHAR}||'%'
</if>
<if
test=
"policemanid!=null and policemanid!=''"
>
and POLICEMANID = #{policemanid, jdbcType=VARCHAR}
</if>
and UNITCODE IN
(select CODE from sys_dictitem where groupid='CODE_XZUNIT')
) t
WHERE ROWNUM
<![CDATA[<=]]>
#{end}
) WHERE RN > #{begin}
...
...
@@ -753,9 +755,11 @@
<select
id=
"toQueryAllUserForTotal"
parameterType=
"com.founder.model.TbYwZczlLly"
resultType=
"java.lang.Integer"
>
select count(*) from SYS_USER where scbz='0'
<if
test=
"unitcode!=null and unitcode!=''"
>
and UNITCODE
in ${unitcode}
</if>
<if
test=
"unitcode!=null and unitcode!=''"
>
and UNITCODE
like #{unitcode, jdbcType=VARCHAR}||'%'
</if>
<if
test=
"truename!=null and truename!=''"
>
and TRUE_NAME like '%'||#{truename, jdbcType=VARCHAR}||'%'
</if>
<if
test=
"policemanid!=null and policemanid!=''"
>
and POLICEMANID = #{policemanid, jdbcType=VARCHAR}
</if>
and UNITCODE IN
(select CODE from sys_dictitem where groupid='CODE_XZUNIT')
</select>
<!-- 根据userid拿到用户信息 -->
...
...
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