完善 专管员区域 条件筛选功能,删除多余的“网格员区域”下拉选项

This commit is contained in:
TS-QD1 2023-03-07 14:29:30 +08:00
parent b7190049ec
commit 931a8f9593
8 changed files with 224 additions and 60 deletions

View File

@ -319,7 +319,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
/** /**
* 设置专管员区域参数 * 设置专管员区域参数
* *
* @param areaId * @param params
*/ */
private void setNPersonAreaParams(Map<String, Object> params) { private void setNPersonAreaParams(Map<String, Object> params) {
Object areaIdObj = params.get("areaId"); Object areaIdObj = params.get("areaId");
@ -1150,7 +1150,6 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
if (areaIdObj == null || StringUtils.isBlank(areaIdObj.toString()) || if (areaIdObj == null || StringUtils.isBlank(areaIdObj.toString()) ||
StringUtils.equals(ISystemCityConsts.N_PERSON_AREA_ID, areaIdObj.toString())) { StringUtils.equals(ISystemCityConsts.N_PERSON_AREA_ID, areaIdObj.toString())) {
// 列出所有的专管机构 // 列出所有的专管机构
params.put("departmentParentId", "0"); params.put("departmentParentId", "0");
List<HandleDepartmentDTO> handleDepartmentDTOS = reportCaseDao.listDept(params); List<HandleDepartmentDTO> handleDepartmentDTOS = reportCaseDao.listDept(params);
for (int i = 0; i < handleDepartmentDTOS.size(); i++) { for (int i = 0; i < handleDepartmentDTOS.size(); i++) {

View File

@ -298,7 +298,19 @@
relation_id = #{excludeRelationId} relation_id = #{excludeRelationId}
) )
</if> </if>
GROUP BY t1.grid_id GROUP BY
t1.grid_id,
t1.grid_name,
t1.grid_summary,
t1.grid_group_id,
t1.grid_duty,
t1.grid_code,
t1.grid_square,
t1.area_code,
t1.area_name,
t1.fill_color,
t1.gmt_create,
t1.gmt_modified
</select> </select>
<!-- 网格列表group --> <!-- 网格列表group -->

View File

@ -157,16 +157,34 @@
AND LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime} AND LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if> </if>
<!-- 专管员N员区域上报的案件 --> <!-- 专管员N员区域上报的案件 -->
<!-- <if test="isNPersonArea != null and isNPersonArea == 'true'">-->
<!-- AND-->
<!-- t1.creator IN (-->
<!-- SELECT-->
<!-- user_id-->
<!-- FROM-->
<!-- sys_role_user-->
<!-- WHERE-->
<!-- &lt;!&ndash; 专管员角色ID &ndash;&gt;-->
<!-- role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'-->
<!-- )-->
<!-- </if>-->
<if test="isNPersonArea != null and isNPersonArea == 'true'"> <if test="isNPersonArea != null and isNPersonArea == 'true'">
AND AND
t1.creator IN ( t1.report_case_id IN (
SELECT SELECT
user_id st1.case_id
FROM FROM
sys_role_user city_report_case_assign st1
WHERE WHERE
<!-- 专管员角色ID --> st1.is_delete = 0
role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' AND
st1.handle_user_id IN (
SELECT
sst1.user_id
FROM
sys_department_user sst1
)
) )
</if> </if>
ORDER BY t1.gmt_modified DESC ORDER BY t1.gmt_modified DESC
@ -422,17 +440,42 @@
) )
</if> </if>
<!-- 专管员N员区域上报的案件 --> <!-- 专管员N员区域上报的案件 -->
<!-- <if test="isNPersonArea != null and isNPersonArea == 'true'">-->
<!-- AND-->
<!-- t1.creator IN (-->
<!-- SELECT-->
<!-- user_id-->
<!-- FROM-->
<!-- sys_role_user-->
<!-- WHERE-->
<!-- &lt;!&ndash; 专管员角色ID &ndash;&gt;-->
<!-- role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'-->
<!-- )-->
<!-- </if>-->
<!-- 专管员处理的案件 -->
<if test="isNPersonArea != null and isNPersonArea == 'true'"> <if test="isNPersonArea != null and isNPersonArea == 'true'">
AND AND
t1.creator IN ( t1.report_case_id IN (
SELECT SELECT
user_id st1.case_id
FROM FROM
sys_role_user city_report_case_assign st1
WHERE WHERE
<!-- 专管员角色ID --> st1.is_delete = 0
role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' AND
) st1.handle_user_id IN (
SELECT
sst1.user_id
FROM
sys_department_user sst1
INNER JOIN
sys_role_user sst2
ON
sst1.user_id = sst2.user_id
AND
sst2.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
)
)
</if> </if>
<if test="handleDepartmentId != null and handleDepartmentId != ''"> <if test="handleDepartmentId != null and handleDepartmentId != ''">
AND AND
@ -792,16 +835,41 @@
</foreach> </foreach>
</if> </if>
<!-- 专管员N员区域上报的案件 --> <!-- 专管员N员区域上报的案件 -->
<!-- <if test="isNPersonArea != null and isNPersonArea == 'true'">-->
<!-- AND-->
<!-- t1.creator IN (-->
<!-- SELECT-->
<!-- user_id-->
<!-- FROM-->
<!-- sys_role_user-->
<!-- WHERE-->
<!-- &lt;!&ndash; 专管员角色ID &ndash;&gt;-->
<!-- role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'-->
<!-- )-->
<!-- </if>-->
<!-- 专管员处理的案件 -->
<if test="isNPersonArea != null and isNPersonArea == 'true'"> <if test="isNPersonArea != null and isNPersonArea == 'true'">
AND AND
t1.creator IN ( t1.report_case_id IN (
SELECT SELECT
user_id st1.case_id
FROM FROM
sys_role_user city_report_case_assign st1
WHERE WHERE
<!-- 专管员角色ID --> st1.is_delete = 0
role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' AND
st1.handle_user_id IN (
SELECT
sst1.user_id
FROM
sys_department_user sst1
INNER JOIN
sys_role_user sst2
ON
sst1.user_id = sst2.user_id
AND
sst2.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
)
) )
</if> </if>
ORDER BY ORDER BY
@ -885,16 +953,41 @@
</foreach> </foreach>
</if> </if>
<!-- 专管员N员区域上报的案件 --> <!-- 专管员N员区域上报的案件 -->
<!-- <if test="isNPersonArea != null and isNPersonArea == 'true'">-->
<!-- AND-->
<!-- t1.creator IN (-->
<!-- SELECT-->
<!-- user_id-->
<!-- FROM-->
<!-- sys_role_user-->
<!-- WHERE-->
<!-- &lt;!&ndash; 专管员角色ID &ndash;&gt;-->
<!-- role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'-->
<!-- )-->
<!-- </if>-->
<!-- 专管员处理的案件 -->
<if test="isNPersonArea != null and isNPersonArea == 'true'"> <if test="isNPersonArea != null and isNPersonArea == 'true'">
AND AND
t1.creator IN ( t1.report_case_id IN (
SELECT SELECT
user_id st1.case_id
FROM FROM
sys_role_user city_report_case_assign st1
WHERE WHERE
<!-- 专管员角色ID --> st1.is_delete = 0
role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' AND
st1.handle_user_id IN (
SELECT
sst1.user_id
FROM
sys_department_user sst1
INNER JOIN
sys_role_user sst2
ON
sst1.user_id = sst2.user_id
AND
sst2.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
)
) )
</if> </if>
ORDER BY t1.gmt_modified DESC ORDER BY t1.gmt_modified DESC
@ -1050,17 +1143,42 @@
</foreach> </foreach>
</if> </if>
<!-- 专管员N员区域上报的案件 --> <!-- 专管员N员区域上报的案件 -->
<!-- <if test="isNPersonArea != null and isNPersonArea == 'true'">-->
<!-- AND-->
<!-- t1.creator IN (-->
<!-- SELECT-->
<!-- user_id-->
<!-- FROM-->
<!-- sys_role_user-->
<!-- WHERE-->
<!-- &lt;!&ndash; 专管员角色ID &ndash;&gt;-->
<!-- role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'-->
<!-- )-->
<!-- </if>-->
<!-- 专管员处理的案件 -->
<if test="isNPersonArea != null and isNPersonArea == 'true'"> <if test="isNPersonArea != null and isNPersonArea == 'true'">
AND AND
t1.creator IN ( t1.report_case_id IN (
SELECT SELECT
user_id st1.case_id
FROM FROM
sys_role_user city_report_case_assign st1
WHERE WHERE
<!-- 专管员角色ID --> st1.is_delete = 0
role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' AND
) st1.handle_user_id IN (
SELECT
sst1.user_id
FROM
sys_department_user sst1
INNER JOIN
sys_role_user sst2
ON
sst1.user_id = sst2.user_id
AND
sst2.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
)
)
</if> </if>
ORDER BY ORDER BY
t1.gmt_modified DESC t1.gmt_modified DESC
@ -1256,16 +1374,41 @@
</foreach> </foreach>
</if> </if>
<!-- 专管员N员区域上报的案件 --> <!-- 专管员N员区域上报的案件 -->
<!-- <if test="isNPersonArea != null and isNPersonArea == 'true'">-->
<!-- AND-->
<!-- t1.creator IN (-->
<!-- SELECT-->
<!-- user_id-->
<!-- FROM-->
<!-- sys_role_user-->
<!-- WHERE-->
<!-- &lt;!&ndash; 专管员角色ID &ndash;&gt;-->
<!-- role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'-->
<!-- )-->
<!-- </if>-->
<!-- 专管员处理的案件 -->
<if test="isNPersonArea != null and isNPersonArea == 'true'"> <if test="isNPersonArea != null and isNPersonArea == 'true'">
AND AND
t1.creator IN ( t1.report_case_id IN (
SELECT SELECT
user_id st1.case_id
FROM FROM
sys_role_user city_report_case_assign st1
WHERE WHERE
<!-- 专管员角色ID --> st1.is_delete = 0
role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a' AND
st1.handle_user_id IN (
SELECT
sst1.user_id
FROM
sys_department_user sst1
INNER JOIN
sys_role_user sst2
ON
sst1.user_id = sst2.user_id
AND
sst2.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
)
) )
</if> </if>
ORDER BY ORDER BY
@ -1535,7 +1678,7 @@
AND gmt_create <![CDATA[ <= ]]> #{endTime} AND gmt_create <![CDATA[ <= ]]> #{endTime}
</if> </if>
<if test="handleDepartmentId != null and handleDepartmentId != ''"> <if test="handleDepartmentId != null and handleDepartmentId != ''">
AND AND (
report_case_id IN ( report_case_id IN (
SELECT SELECT
st1.case_id st1.case_id
@ -1549,9 +1692,16 @@
sst1.user_id sst1.user_id
FROM FROM
sys_department_user sst1 sys_department_user sst1
INNER JOIN
sys_role_user sst2
ON
sst1.user_id = sst2.user_id
AND
sst2.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
WHERE WHERE
sst1.department_id = #{handleDepartmentId} sst1.department_id = #{handleDepartmentId}
) )
)
) )
</if> </if>
</select> </select>

View File

@ -28,6 +28,7 @@
<select id="areaId" name="areaId" lay-filter="changeArea"> <select id="areaId" name="areaId" lay-filter="changeArea">
<option value="">选择街镇</option> <option value="">选择街镇</option>
{{# for(var i = 0, item; item = d[i++];) { }} {{# for(var i = 0, item; item = d[i++];) { }}
{{# if(item.dictId === 'e64a0a05-45ca-4452-a869-a4dcbff74593') { continue; } }}
<option value="{{item.dictId}}">{{item.dictName}}</option> <option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }} {{# } }}
</select> </select>

View File

@ -22,6 +22,7 @@
<select id="areaId" name="areaId" lay-filter="changeArea"> <select id="areaId" name="areaId" lay-filter="changeArea">
<option value="">选择地区</option> <option value="">选择地区</option>
{{# for(var i = 0, item; item = d[i++];) { }} {{# for(var i = 0, item; item = d[i++];) { }}
{{# if(item.dictId === 'e64a0a05-45ca-4452-a869-a4dcbff74593') { continue; } }}
<option value="{{item.dictId}}">{{item.dictName}}</option> <option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }} {{# } }}
</select> </select>
@ -140,7 +141,6 @@
//初始化社区 //初始化社区
function initCommunity(areaId) { function initCommunity(areaId) {
top.restAjax.get('api/community/listcommunity?areaId=' + areaId, {}, null, function(code, data) { top.restAjax.get('api/community/listcommunity?areaId=' + areaId, {}, null, function(code, data) {
console.log(data);
laytpl(document.getElementById('communitySelectTemplate').innerHTML).render(data, function(html) { laytpl(document.getElementById('communitySelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('communitySelectTemplateBox').innerHTML = html; document.getElementById('communitySelectTemplateBox').innerHTML = html;
}); });

View File

@ -27,15 +27,15 @@
{{# } }} {{# } }}
</select> </select>
</script> </script>
<div class="layui-inline" id="communitySelectTemplateBox" style="width: 150px;"></div> <!-- <div class="layui-inline" id="communitySelectTemplateBox" style="width: 150px;"></div>-->
<script id="communitySelectTemplate" type="text/html"> <!-- <script id="communitySelectTemplate" type="text/html">-->
<select id="communityId" name="communityId"> <!-- <select id="communityId" name="communityId">-->
<option value="">请选择社区</option> <!-- <option value="">请选择社区</option>-->
{{# for(var i = 0, item; item = d[i++];) { }} <!-- {{# for(var i = 0, item; item = d[i++];) { }}-->
<option value="{{item.communityId}}">{{item.communityName}}</option> <!-- <option value="{{item.communityId}}">{{item.communityName}}</option>-->
{{# } }} <!-- {{# } }}-->
</select> <!-- </select>-->
</script> <!-- </script>-->
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 150px;"></div> <div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 150px;"></div>
<script id="caseTypeSelectTemplate" type="text/html"> <script id="caseTypeSelectTemplate" type="text/html">
<select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType"> <select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType">
@ -93,7 +93,7 @@
function init(){ function init(){
initArea(); initArea();
initCommunity(); // initCommunity();
} }
init(); init();
@ -111,7 +111,7 @@
form.on('select(areaChange)',function(data){ form.on('select(areaChange)',function(data){
var areaId = data.value; var areaId = data.value;
initCommunity(areaId); // initCommunity(areaId);
}); });
//初始化社区 //初始化社区

View File

@ -28,6 +28,7 @@
<select id="areaId" name="areaId" lay-filter="changeArea"> <select id="areaId" name="areaId" lay-filter="changeArea">
<option value="">选择街镇</option> <option value="">选择街镇</option>
{{# for(var i = 0, item; item = d[i++];) { }} {{# for(var i = 0, item; item = d[i++];) { }}
{{# if(item.dictId === 'e64a0a05-45ca-4452-a869-a4dcbff74593') { continue; } }}
<option value="{{item.dictId}}">{{item.dictName}}</option> <option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }} {{# } }}
</select> </select>

View File

@ -22,6 +22,7 @@
<select id="areaId" name="areaId" lay-filter="changeArea"> <select id="areaId" name="areaId" lay-filter="changeArea">
<option value="">选择地区</option> <option value="">选择地区</option>
{{# for(var i = 0, item; item = d[i++];) { }} {{# for(var i = 0, item; item = d[i++];) { }}
{{# if(item.dictId === 'e64a0a05-45ca-4452-a869-a4dcbff74593') { continue; } }}
<option value="{{item.dictId}}">{{item.dictName}}</option> <option value="{{item.dictId}}">{{item.dictName}}</option>
{{# } }} {{# } }}
</select> </select>