Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
cf55039f
Commit
cf55039f
authored
Jun 29, 2021
by
gaodongdong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
bd456242
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
36 deletions
+42
-36
IOrgUsrService.java
...join/amos/boot/module/jcs/api/service/IOrgUsrService.java
+3
-2
OrgMenuVo.java
...va/com/yeejoin/amos/boot/module/jcs/api/vo/OrgMenuVo.java
+6
-4
OrgUsrMapper.xml
...module-jcs-api/src/main/resources/mapper/OrgUsrMapper.xml
+20
-18
OrgUsrController.java
...amos/boot/module/jcs/biz/controller/OrgUsrController.java
+1
-1
OrgUsrServiceImpl.java
...s/boot/module/jcs/biz/service/impl/OrgUsrServiceImpl.java
+12
-11
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/service/IOrgUsrService.java
View file @
cf55039f
...
...
@@ -35,11 +35,12 @@ public interface IOrgUsrService {
* @param NAMEMethodName
* @param PARENTIDMethodName
* @param OrgTypeMethodName
* @param KeyMethodName
* @return
* @throws Exception
*/
List
<
OrgMenuVo
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
;
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
,
String
KeyMethodName
)
throws
Exception
;
/**
* 获取子数据集合
...
...
@@ -55,7 +56,7 @@ public interface IOrgUsrService {
* @throws Exception
*/
List
<
OrgMenuVo
>
getSub
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
;
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
,
String
KeyMethodName
)
throws
Exception
;
/**
* 组装融合调度单位人员信息
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/vo/OrgMenuVo.java
View file @
cf55039f
...
...
@@ -14,26 +14,28 @@ import java.util.List;
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"OrgMenuVo"
,
description
=
"树菜单"
)
public
class
OrgMenuVo
{
public
Lo
ng
key
;
public
Stri
ng
key
;
public
String
title
;
public
Long
id
;
public
Long
parentId
;
public
boolean
leaf
=
true
;
public
List
<
OrgMenuVo
>
children
;
public
String
bizOrgType
;
public
OrgMenuVo
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
,
boolean
leaf
)
{
public
OrgMenuVo
(
String
key
,
String
title
,
Long
parentId
,
String
bizOrgType
,
boolean
leaf
,
Long
id
)
{
super
();
this
.
key
=
key
;
this
.
title
=
title
;
this
.
parentId
=
parentId
;
this
.
bizOrgType
=
bizOrgType
;
this
.
leaf
=
leaf
;
this
.
id
=
id
;
}
public
OrgMenuVo
(
Long
key
,
String
title
,
Long
parentId
,
String
bizOrgType
)
{
public
OrgMenuVo
(
String
key
,
String
title
,
Long
parentId
,
String
bizOrgType
,
Long
id
)
{
this
.
key
=
key
;
this
.
id
=
id
;
this
.
title
=
title
;
this
.
parentId
=
parentId
;
this
.
children
=
children
;
this
.
bizOrgType
=
bizOrgType
;
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/OrgUsrMapper.xml
View file @
cf55039f
...
...
@@ -29,20 +29,21 @@
cb_org_usr u LEFT JOIN
jc_alert_form_value v on u.sequence_nbr = v.alert_called_id
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType}
AND U.is_delete = 0
where
u.biz_org_type = #{bizOrgType}
AND u.is_delete = 0
<if
test=
"bizOrgName != null"
>
AND u.biz_org_name = #{bizOrgName}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != '-1'"
>
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
)a where a.sequenceNbr is not null
<if
test=
"bizOrgName != null"
>
AND u.bizOrgName = #{bizOrgName}
</if>
<if
test=
"bizOrgCode != null"
>
AND u.bizOrgName = #{bizOrgCode}
</if>
<if
test=
"fieldsValue != null"
>
<foreach
collection=
"fieldsValue.keys"
item=
"item"
>
AND a.${item} = #{fieldsValue[${item}]}
</foreach>
</if>
...
...
@@ -63,20 +64,20 @@
cb_org_usr u LEFT JOIN
jc_alert_form_value v on u.sequence_nbr = v.alert_called_id
LEFT JOIN jc_alert_form f ON f.sequence_nbr = v.alert_form_id
where u.parent_id = #{parentId}
AND u.biz_org_type = #{bizOrgType}
AND U.is_delete = 0
where
u.biz_org_type = #{bizOrgType}
AND u.is_delete = 0
<if
test=
"bizOrgName != null"
>
AND u.biz_org_name = #{bizOrgName}
</if>
<if
test=
"bizOrgCode != null and bizOrgCode != '-1'"
>
AND u.biz_org_code like concat(#{bizOrgCode}, '%')
</if>
GROUP BY
u.sequence_nbr ,
u.biz_org_name ,
u.biz_org_code
)a where a.sequenceNbr is not null
<if
test=
"bizOrgName != null"
>
AND u.bizOrgName = #{bizOrgName}
</if>
<if
test=
"bizOrgCode != null"
>
AND u.bizOrgName = #{bizOrgCode}
</if>
<if
test=
"fieldsValue != null"
>
<foreach
collection=
"fieldsValue.keys"
item=
"item"
>
AND a.${item} = #{fieldsValue[${item}]}
</foreach>
</if>
...
...
@@ -114,6 +115,7 @@
SELECT
sequence_nbr,
biz_org_name,
biz_org_code,
biz_org_type,
parent_id
FROM
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/OrgUsrController.java
View file @
cf55039f
...
...
@@ -140,7 +140,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/companyTree"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取单位部门树"
,
notes
=
"获取单位部门树"
)
public
ResponseModel
<
List
<
OrgMenuVo
>>
selectCompanyTree
()
throws
Exception
{
List
<
OrgMenuVo
>
menus
=
iOrgUsrService
.
getTree
(
null
,
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
List
<
OrgMenuVo
>
menus
=
iOrgUsrService
.
getTree
(
null
,
iOrgUsrService
.
selectCompanyDepartmentMsg
(),
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
,
"getBizOrgCode"
);
return
ResponseHelper
.
buildResponse
(
menus
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/OrgUsrServiceImpl.java
View file @
cf55039f
...
...
@@ -69,7 +69,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
}
@Override
public
List
<
OrgMenuVo
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
public
List
<
OrgMenuVo
>
getTree
(
Long
topId
,
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
,
String
KeyMethodName
)
throws
Exception
{
List
<
OrgMenuVo
>
resultList
=
new
ArrayList
<>();
Class
<?>
clazz
=
Class
.
forName
(
packageURL
);
Method
IDMethodNameme
=
null
;
...
...
@@ -91,6 +91,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Method
OrgTypeMethodNameme
=
clazz
.
getDeclaredMethod
(
OrgTypeMethodName
);
Method
KeyMethodNameme
=
clazz
.
getDeclaredMethod
(
KeyMethodName
);
//获取顶层元素集合
Long
parentId
;
for
(
Object
ob
:
entityList
)
{
...
...
@@ -100,20 +101,20 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
parentId
=
PARENTIDMethodNameme
.
invoke
(
entity
)
!=
null
?
Long
.
valueOf
(
String
.
valueOf
(
PARENTIDMethodNameme
.
invoke
(
entity
)))
:
null
;
if
(
parentId
==
null
||
topId
==
parentId
)
{
OrgMenuVo
menu
=
new
OrgMenuVo
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
);
OrgMenuVo
menu
=
new
OrgMenuVo
(
String
.
valueOf
(
KeyMethodNameme
.
invoke
(
entity
)),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
,
Long
.
parseLong
(
IDMethodNameme
.
invoke
(
entity
).
toString
())
);
resultList
.
add
(
menu
);
}
}
//获取每个顶层元素的子数据集合
for
(
OrgMenuVo
entity
:
resultList
)
{
entity
.
setChildren
(
getSub
(
entity
.
get
Key
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgType
MethodName
));
entity
.
setChildren
(
getSub
(
entity
.
get
Id
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
,
Key
MethodName
));
}
return
resultList
;
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
OrgMenuVo
>
getSub
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
)
throws
Exception
{
public
List
<
OrgMenuVo
>
getSub
(
Long
topId
,
@SuppressWarnings
(
"rawtypes"
)
Collection
entityList
,
String
packageURL
,
String
IDMethodName
,
int
IDHierarchy
,
String
NAMEMethodName
,
String
PARENTIDMethodName
,
String
OrgTypeMethodName
,
String
KeyMethodName
)
throws
Exception
{
List
<
OrgMenuVo
>
childList
=
new
ArrayList
<>();
@SuppressWarnings
(
"rawtypes"
)
Class
clazz
=
Class
.
forName
(
packageURL
);
...
...
@@ -135,7 +136,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Method
OrgTypeMethodNameme
=
clazz
.
getDeclaredMethod
(
OrgTypeMethodName
);
Method
NAMEMethodNameme
=
clazz
.
getDeclaredMethod
(
NAMEMethodName
);
Method
PARENTIDMethodNameme
=
clazz
.
getDeclaredMethod
(
PARENTIDMethodName
);
Method
KeyMethodNameme
=
clazz
.
getDeclaredMethod
(
KeyMethodName
);
Long
parentId
;
//子集的直接子对象
for
(
Object
ob
:
entityList
)
{
...
...
@@ -145,12 +146,12 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if
(
parentId
==
null
)
{
if
(
topId
==
parentId
)
{
OrgMenuVo
menu
=
new
OrgMenuVo
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)));
OrgMenuVo
menu
=
new
OrgMenuVo
(
String
.
valueOf
(
KeyMethodNameme
.
invoke
(
entity
)),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
,
Long
.
parseLong
(
IDMethodNameme
.
invoke
(
entity
).
toString
(
)));
childList
.
add
(
menu
);
}
}
else
{
if
(
topId
.
longValue
()
==
parentId
.
longValue
())
{
OrgMenuVo
menu
=
new
OrgMenuVo
(
Long
.
valueOf
(
String
.
valueOf
(
IDMethodNameme
.
invoke
(
entity
))),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)));
OrgMenuVo
menu
=
new
OrgMenuVo
(
String
.
valueOf
(
KeyMethodNameme
.
invoke
(
entity
)),
String
.
valueOf
(
NAMEMethodNameme
.
invoke
(
entity
)),
parentId
,
String
.
valueOf
(
OrgTypeMethodNameme
.
invoke
(
entity
)),
false
,
Long
.
parseLong
(
IDMethodNameme
.
invoke
(
entity
).
toString
(
)));
childList
.
add
(
menu
);
}
}
...
...
@@ -159,7 +160,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
//子集的间接子对象
for
(
OrgMenuVo
entity
:
childList
)
{
entity
.
setChildren
(
getSub
(
entity
.
get
Key
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgType
MethodName
));
entity
.
setChildren
(
getSub
(
entity
.
get
Id
(),
entityList
,
packageURL
,
IDMethodName
,
IDHierarchy
,
NAMEMethodName
,
PARENTIDMethodName
,
OrgTypeMethodName
,
Key
MethodName
));
if
(
entity
.
getChildren
()
!=
null
)
{
entity
.
setLeaf
(
false
);
}
...
...
@@ -261,11 +262,11 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if
(!
ObjectUtils
.
isEmpty
(
req
.
get
(
"bizOrgName"
)))
{
map
.
put
(
"bizOrgName"
,
req
.
get
(
"bizOrgName"
));
}
map
.
put
(
"
parentId"
,
req
.
get
(
"parentId
"
));
map
.
put
(
"
bizOrgCode"
,
req
.
get
(
"bizOrgCode
"
));
req
.
remove
(
"bizOrgName"
);
req
.
remove
(
"pageSize"
);
req
.
remove
(
"pageNum"
);
req
.
remove
(
"
parentId
"
);
req
.
remove
(
"
bizOrgCode
"
);
map
.
put
(
"fieldsValue"
,
req
);
map
.
put
(
"fields"
,
alertFormServiceImpl
.
queryListByFormId
(
OrgPersonEnum
.
人员
.
getCode
()));
pageBean
.
setTotal
(
this
.
baseMapper
.
selectPersonListCount
(
map
));
...
...
@@ -584,7 +585,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
columnMap
.
put
(
"is_delete"
,
CommonConstant
.
IS_DELETE_00
);
columnMap
.
put
(
"biz_org_type"
,
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
Collection
<
OrgUsr
>
list
=
listByMap
(
columnMap
);
return
getTree
(
null
,
list
,
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
);
return
getTree
(
null
,
list
,
OrgUsr
.
class
.
getName
(),
"getSequenceNbr"
,
2
,
"getBizOrgName"
,
"getParentId"
,
"getBizOrgType"
,
"getBizOrgCode"
);
}
...
...
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