Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
14ebe5cf
Commit
14ebe5cf
authored
Feb 14, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改根据业务查询部门逻辑
parent
eee54194
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
15 deletions
+72
-15
base-manager/doc/api.md
base-manager/doc/api.md
+4
-2
base-manager/src/main/java/com/mortals/xhx/module/dept/dao/DeptDao.java
...rc/main/java/com/mortals/xhx/module/dept/dao/DeptDao.java
+3
-0
base-manager/src/main/java/com/mortals/xhx/module/dept/dao/ibatis/DeptDaoImpl.java
...a/com/mortals/xhx/module/dept/dao/ibatis/DeptDaoImpl.java
+11
-0
base-manager/src/main/java/com/mortals/xhx/module/dept/model/vo/DeptVo.java
...ain/java/com/mortals/xhx/module/dept/model/vo/DeptVo.java
+8
-1
base-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptService.java
...java/com/mortals/xhx/module/dept/service/DeptService.java
+4
-1
base-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
...mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
+11
-7
base-manager/src/main/java/com/mortals/xhx/module/dept/web/DeptController.java
.../java/com/mortals/xhx/module/dept/web/DeptController.java
+3
-3
base-manager/src/main/resources/sqlmap/module/dept/DeptMapperExt.xml
...r/src/main/resources/sqlmap/module/dept/DeptMapperExt.xml
+28
-1
No files found.
base-manager/doc/api.md
View file @
14ebe5cf
...
@@ -5275,11 +5275,13 @@ msg|String|消息|-
...
@@ -5275,11 +5275,13 @@ msg|String|消息|-
参数名称|类型|备注|必填|其它
参数名称|类型|备注|必填|其它
---|---|---|---|---
---|---|---|---|---
id
|Long|部门id
|是|-
id
List|Arrays|部门ids
|是|-
**请求样例:**
**请求样例:**
```
```
{"idList":[414]}
```
```
**响应参数:**
**响应参数:**
...
@@ -5288,7 +5290,7 @@ id|Long|部门id|是|-
...
@@ -5288,7 +5290,7 @@ id|Long|部门id|是|-
---|---|---|---
---|---|---|---
code|Integer|结果码(-1.失败,1.成功)|-
code|Integer|结果码(-1.失败,1.成功)|-
msg|String|消息|-
msg|String|消息|-
data|
array|结果集列表|数组
data|
Object|结果集|
**响应消息样例:**
**响应消息样例:**
...
...
base-manager/src/main/java/com/mortals/xhx/module/dept/dao/DeptDao.java
View file @
14ebe5cf
...
@@ -19,7 +19,10 @@ import java.util.List;
...
@@ -19,7 +19,10 @@ import java.util.List;
public
interface
DeptDao
extends
ICRUDDao
<
DeptEntity
,
Long
>{
public
interface
DeptDao
extends
ICRUDDao
<
DeptEntity
,
Long
>{
String
GET_DEPT_LIST_BY_BUSINESS
=
"getDeptListByBusiness"
;
String
GET_DEPT_LIST_BY_BUSINESS
=
"getDeptListByBusiness"
;
String
GET_BUSINESS_BY_DEPT
=
"getBusinessByDept"
;
List
<
DeptVo
>
getDeptListByBusiness
(
DeptQuery
deptQuery
);
List
<
DeptVo
>
getDeptListByBusiness
(
DeptQuery
deptQuery
);
List
<
DeptVo
>
getBusinessByDept
(
DeptQuery
deptQuery
);
}
}
base-manager/src/main/java/com/mortals/xhx/module/dept/dao/ibatis/DeptDaoImpl.java
View file @
14ebe5cf
...
@@ -30,4 +30,15 @@ public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements
...
@@ -30,4 +30,15 @@ public class DeptDaoImpl extends BaseCRUDDaoMybatis<DeptEntity,Long> implements
List
list
=
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
GET_DEPT_LIST_BY_BUSINESS
),
paramDto
);
List
list
=
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
GET_DEPT_LIST_BY_BUSINESS
),
paramDto
);
return
list
;
return
list
;
}
}
/**
* @param deptQuery
* @return
*/
@Override
public
List
<
DeptVo
>
getBusinessByDept
(
DeptQuery
deptQuery
)
{
ParamDto
paramDto
=
this
.
getQueryParam
(
deptQuery
);
List
list
=
this
.
getSqlSession
().
selectList
(
this
.
getSqlId
(
GET_BUSINESS_BY_DEPT
),
paramDto
);
return
list
;
}
}
}
base-manager/src/main/java/com/mortals/xhx/module/dept/model/vo/DeptVo.java
View file @
14ebe5cf
...
@@ -28,13 +28,20 @@ public class DeptVo extends BaseEntityLong {
...
@@ -28,13 +28,20 @@ public class DeptVo extends BaseEntityLong {
* 站点业务ID
* 站点业务ID
*/
*/
private
Long
siteBusinessId
;
private
Long
siteBusinessId
;
private
Long
windowId
;
private
String
windowName
;
/**
/**
* 业务名称
* 业务名称
*/
*/
private
String
businessName
;
private
String
businessName
;
/** 站点业务ID列表 */
/** 站点业务ID列表 */
private
List
<
Long
>
siteBusinessIdList
;
private
List
<
Long
>
siteBusinessIdList
;
/** 部门ID列表 */
private
List
<
Long
>
idList
;
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/dept/service/DeptService.java
View file @
14ebe5cf
...
@@ -39,11 +39,14 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> {
...
@@ -39,11 +39,14 @@ public interface DeptService extends ICRUDCacheService<DeptEntity, Long> {
Rest
<
String
>
syncDeptBySiteId
(
SiteEntity
siteEntity
,
Context
context
);
Rest
<
String
>
syncDeptBySiteId
(
SiteEntity
siteEntity
,
Context
context
);
Rest
<
List
<
BusinessEntity
>>
getBusinessByDept
(
DeptQuery
deptQuery
,
Context
context
);
Rest
<
Map
<
Long
,
List
<
DeptVo
>
>>
getBusinessByDept
(
DeptQuery
deptQuery
,
Context
context
);
void
deleteGovBySiteId
(
Long
siteId
,
Context
context
);
void
deleteGovBySiteId
(
Long
siteId
,
Context
context
);
Rest
<
Map
<
Long
,
List
<
DeptVo
>>>
getDeptListByBusiness
(
DeptQuery
deptQuery
,
Context
context
);
Rest
<
Map
<
Long
,
List
<
DeptVo
>>>
getDeptListByBusiness
(
DeptQuery
deptQuery
,
Context
context
);
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/dept/service/impl/DeptServiceImpl.java
View file @
14ebe5cf
...
@@ -131,8 +131,15 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
...
@@ -131,8 +131,15 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
}
}
@Override
@Override
public
Rest
<
List
<
BusinessEntity
>>
getBusinessByDept
(
DeptQuery
deptQuery
,
Context
context
)
{
public
Rest
<
Map
<
Long
,
List
<
DeptVo
>>>
getBusinessByDept
(
DeptQuery
deptQuery
,
Context
context
)
{
//查询部门窗口
List
<
DeptVo
>
businessDeptList
=
this
.
dao
.
getBusinessByDept
(
deptQuery
);
Map
<
Long
,
List
<
DeptVo
>>
collect
=
businessDeptList
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getId
()));
return
Rest
.
ok
(
collect
);
/* //查询部门窗口
List<WindowEntity> windowEntities = windowService.find(new WindowQuery().deptId(deptQuery.getId()));
List<WindowEntity> windowEntities = windowService.find(new WindowQuery().deptId(deptQuery.getId()));
//查询窗口业务
//查询窗口业务
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
WindowBusinessQuery windowBusinessQuery = new WindowBusinessQuery();
...
@@ -156,8 +163,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
...
@@ -156,8 +163,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
return Rest.ok("业务查询结果为空", Collections.EMPTY_LIST);
return Rest.ok("业务查询结果为空", Collections.EMPTY_LIST);
}
}
businessQuery.setIdList(businessList);
businessQuery.setIdList(businessList);
List
<
BusinessEntity
>
businessEntities
=
businessService
.
find
(
businessQuery
);
List<BusinessEntity> businessEntities = businessService.find(businessQuery);
*/
return
Rest
.
ok
(
businessEntities
);
//
return Rest.ok(businessEntities);
}
}
@Override
@Override
...
@@ -175,11 +182,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
...
@@ -175,11 +182,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
*/
*/
@Override
@Override
public
Rest
<
Map
<
Long
,
List
<
DeptVo
>>>
getDeptListByBusiness
(
DeptQuery
deptQuery
,
Context
context
)
{
public
Rest
<
Map
<
Long
,
List
<
DeptVo
>>>
getDeptListByBusiness
(
DeptQuery
deptQuery
,
Context
context
)
{
List
<
DeptVo
>
deptListByBusiness
=
this
.
dao
.
getDeptListByBusiness
(
deptQuery
);
List
<
DeptVo
>
deptListByBusiness
=
this
.
dao
.
getDeptListByBusiness
(
deptQuery
);
Map
<
Long
,
List
<
DeptVo
>>
collect
=
deptListByBusiness
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getSiteBusinessId
()));
Map
<
Long
,
List
<
DeptVo
>>
collect
=
deptListByBusiness
.
parallelStream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getSiteBusinessId
()));
return
Rest
.
ok
(
collect
);
return
Rest
.
ok
(
collect
);
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/dept/web/DeptController.java
View file @
14ebe5cf
...
@@ -107,10 +107,10 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
...
@@ -107,10 +107,10 @@ public class DeptController extends BaseCRUDJsonBodyMappingController<DeptServic
JSONObject
jsonObject
=
new
JSONObject
();
JSONObject
jsonObject
=
new
JSONObject
();
String
busiDesc
=
"根据部门查询业务"
+
this
.
getModuleDesc
();
String
busiDesc
=
"根据部门查询业务"
+
this
.
getModuleDesc
();
try
{
try
{
if
(
ObjectUtils
.
isEmpty
(
deptQuery
.
getId
()))
{
if
(
ObjectUtils
.
isEmpty
(
deptQuery
.
getId
List
()))
{
throw
new
AppException
(
"参数部门id不能为空!"
);
throw
new
AppException
(
"参数部门id
s
不能为空!"
);
}
}
Rest
<
List
<
BusinessEntity
>>
rest
=
this
.
service
.
getBusinessByDept
(
deptQuery
,
getContext
());
Rest
<
Map
<
Long
,
List
<
DeptVo
>
>>
rest
=
this
.
service
.
getBusinessByDept
(
deptQuery
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
jsonObject
.
put
(
KEY_RESULT_DATA
,
rest
.
getData
());
jsonObject
.
put
(
KEY_RESULT_DATA
,
rest
.
getData
());
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
...
...
base-manager/src/main/resources/sqlmap/module/dept/DeptMapperExt.xml
View file @
14ebe5cf
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
<id
property=
"id"
column=
"id"
/>
<id
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"deptNumber"
column=
"deptNumber"
/>
<result
property=
"deptNumber"
column=
"deptNumber"
/>
<result
property=
"windowId"
column=
"windowId"
/>
<result
property=
"windowName"
column=
"windowName"
/>
<result
property=
"siteBusinessId"
column=
"siteBusinessId"
/>
<result
property=
"siteBusinessId"
column=
"siteBusinessId"
/>
<result
property=
"businessName"
column=
"businessName"
/>
<result
property=
"businessName"
column=
"businessName"
/>
</resultMap>
</resultMap>
...
@@ -15,7 +17,7 @@
...
@@ -15,7 +17,7 @@
<!-- 根据业务ids获取部门列表 -->
<!-- 根据业务ids获取部门列表 -->
<select
id=
"getDeptListByBusiness"
parameterType=
"paramDto"
resultMap=
"DeptVo-Map"
>
<select
id=
"getDeptListByBusiness"
parameterType=
"paramDto"
resultMap=
"DeptVo-Map"
>
SELECT
SELECT
d.id,d.`name`,d.deptNumber,wb.siteBusinessId,wb.businessName
d.id,d.`name`,d.deptNumber,wb.siteBusinessId,wb.businessName
,w.id as windowId,w.`name` as windowName
FROM
FROM
mortals_sys_dept d
mortals_sys_dept d
LEFT JOIN mortals_sys_window w ON d.id = w.deptId
LEFT JOIN mortals_sys_window w ON d.id = w.deptId
...
@@ -33,4 +35,29 @@
...
@@ -33,4 +35,29 @@
</trim>
</trim>
</trim>
</trim>
</select>
</select>
<!-- 根据部门ids获取业务部门列表 -->
<select
id=
"getBusinessByDept"
parameterType=
"paramDto"
resultMap=
"DeptVo-Map"
>
SELECT
d.id,d.`name`,d.deptNumber,wb.siteBusinessId,wb.businessName,w.id as windowId,w.`name` as windowName
FROM
mortals_sys_dept d
LEFT JOIN mortals_sys_window w ON d.id = w.deptId
LEFT JOIN mortals_sys_window_business wb ON w.id = wb.windowId
<trim
suffixOverrides=
"where"
suffix=
""
>
where 1=1 and
<trim
prefixOverrides=
"and"
prefix=
""
>
<if
test=
"condition.containsKey('idList')"
>
id in
<foreach
collection=
"condition.idList"
open=
"("
close=
")"
index=
"index"
item=
"item"
separator=
","
>
#{item}
</foreach>
</if>
</trim>
</trim>
</select>
</mapper>
</mapper>
\ No newline at end of file
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