大数据新增接口和页面。

This commit is contained in:
Renpc-kilig 2024-04-24 15:21:12 +08:00
parent b96e254bcb
commit 147fe7c737
7 changed files with 807 additions and 28 deletions

View File

@ -1278,4 +1278,16 @@ public class DataReleaseController extends AbstractController {
return bdr;
}
@GetMapping("list-page-handle-case")
public SuccessResultList<List<ReportCaseDTO>> listPageHandleCase(ListPage page) throws SearchException {
Map<String, Object> params = requestParams();
// 为了避免案件类型没传单独处理
/*if (params.get("caseFlowType") == null || "".equals(params.get("caseFlowType").toString().trim())) {
params.put("caseFlowType", "1,2");
}*/
page.setParams(params);
SuccessResultList<List<ReportCaseDTO>> resList = reportCaseService.listPageHandleCase(page);
return resList;
}
}

View File

@ -398,4 +398,12 @@ public interface IReportCaseDao {
void insertIntoTempTable(Map<String, Object> params);
void cleanUpTempTable();
List<Map<String, Object>> handleData(Map<String, Object> params);
List<ReportCaseDTO> reporeCaseList(Map<String, Object> params);
List<ReportCaseDTO> showBoxWgyCaseList(Map<String, Object> params);
List<ReportCaseDTO> showBoxZgyCaseList(Map<String, Object> params);
}

View File

@ -498,4 +498,6 @@ public interface IReportCaseService {
List<CaseCountDTO> dataCount(Integer level, Map<String, Object> params);
void exportDataCount(HttpServletResponse response, Map<String, Object> params);
SuccessResultList<List<ReportCaseDTO>> listPageHandleCase(ListPage page);
}

View File

@ -34,6 +34,7 @@ import com.cm.systemcity.pojo.dtos.AreaPointsDTO;
import com.cm.systemcity.pojo.dtos.areapoints.GridAndPointsDTO;
import com.cm.systemcity.pojo.dtos.bindingdepartment.BindingDepartmentDTO;
import com.cm.systemcity.pojo.dtos.community.CommunityDTO;
import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO;
import com.cm.systemcity.pojo.dtos.dict.DictDTO;
import com.cm.systemcity.pojo.dtos.readstate.ReadStateDTO;
import com.cm.systemcity.pojo.dtos.reportcase.*;
@ -46,6 +47,7 @@ import com.cm.systemcity.service.readstate.IReadStateService;
import com.cm.systemcity.service.reportcase.IReportCaseService;
import com.cm.systemcity.service.userpoints.IUserPointsService;
import com.cm.systemcity.service.worknote.IWorkNoteService;
import com.cm.systemcity.utils.BigDataResult2;
import com.cm.systemcity.utils.ImageUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -54,6 +56,7 @@ import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.util.CollectionUtils;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.format.DateTimeFormat;
@ -2177,6 +2180,35 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
}
}
@Override
public SuccessResultList<List<ReportCaseDTO>> listPageHandleCase(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<ReportCaseDTO> handleList = getHandleList(page.getParams());
PageInfo<ReportCaseDTO> pageInfo = new PageInfo<>(handleList);
return new SuccessResultList<>(handleList, pageInfo.getPageNum(), pageInfo.getTotal());
}
private List<ReportCaseDTO> getHandleList(Map<String, Object> params) {
// 获取当前年份
Calendar calendar = Calendar.getInstance();
int year = calendar.get(Calendar.YEAR);
params.put("year", year);
List<ReportCaseDTO> reportCaseDTOAll = new ArrayList<>();
String userType = params.get("userType").toString();
if(userType.equals("网格员")) {
reportCaseDTOAll = reportCaseDao.showBoxWgyCaseList(params);
}
if(userType.equals("专管员")) {
// 查询所有的专管员(ID: bc405346-8714-4ded-89ac-9cc4d755f66a)
params.put("roleId", "bc405346-8714-4ded-89ac-9cc4d755f66a");
reportCaseDTOAll = reportCaseDao.showBoxZgyCaseList(params);
}
return reportCaseDTOAll;
}
/**
* 全区数据
*
@ -2309,6 +2341,19 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
}
}
if(CollectionUtils.isEmpty(caseCountDTOList)) {
CaseCountDTO caseCountDTO = new CaseCountDTO();
caseCountDTO.setName("暂无数据");
caseCountDTO.setSelfCount("0");
caseCountDTO.setHandleCount("0");
caseCountDTO.setAllCount("0");
caseCountDTO.setDataId("9999");
caseCountDTO.setLevel(2);
caseCountDTO.setPrpeLevel(1);
caseCountDTO.setPrpeDataId("9d179f05-3ea0-48f7-853c-d3b7124b791c");
caseCountDTOList.add(caseCountDTO);
}
return caseCountDTOList;
}
@ -2394,6 +2439,19 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
}
}
if(CollectionUtils.isEmpty(caseCountDTOList)) {
CaseCountDTO caseCountDTO = new CaseCountDTO();
caseCountDTO.setName("暂无数据");
caseCountDTO.setSelfCount("0");
caseCountDTO.setHandleCount("0");
caseCountDTO.setAllCount("0");
caseCountDTO.setDataId("9999");
caseCountDTO.setLevel(3);
caseCountDTO.setPrpeLevel(2);
caseCountDTO.setPrpeDataId(params.get("areaId").toString());
caseCountDTOList.add(caseCountDTO);
}
return caseCountDTOList;
}
@ -2475,6 +2533,20 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
}
}
if(CollectionUtils.isEmpty(caseCountDTOList)) {
CaseCountDTO caseCountDTO = new CaseCountDTO();
caseCountDTO.setName("暂无数据");
caseCountDTO.setSelfCount("0");
caseCountDTO.setHandleCount("0");
caseCountDTO.setAllCount("0");
caseCountDTO.setDataId("9999");
caseCountDTO.setLevel(4);
caseCountDTO.setPrpeLevel(3);
caseCountDTO.setPrpeDataId(params.get("prpeDataId").toString());
caseCountDTO.setDataId(params.get("communityId").toString());
caseCountDTOList.add(caseCountDTO);
}
return caseCountDTOList;
}
}

View File

@ -2250,6 +2250,12 @@
</if>
AND is_delete = 0
AND creator <![CDATA[ <> ]]> '1'
<if test="start != null and start != ''">
AND LEFT(gmt_create, 10) <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND LEFT(gmt_create, 10) <![CDATA[ <= ]]> #{end}
</if>
<if test="area != null and area != ''">
GROUP BY area_id
</if>
@ -2280,6 +2286,12 @@
report_case_id case_id
FROM city_report_case
WHERE 1 = 1
<if test="start != null and start != ''">
AND LEFT(gmt_create, 10) <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND LEFT(gmt_create, 10) <![CDATA[ <= ]]> #{end}
</if>
<if test="isSelf != null and isSelf != ''">
AND is_self = 1
</if>
@ -2337,4 +2349,144 @@
<delete id="cleanUpTempTable">DROP TEMPORARY TABLE temp_table</delete>
<select id="handleData" parameterType="map" resultMap="countMap">
SELECT
case_id
FROM
city_report_case_handle
WHERE
creator <![CDATA[ <> ]]> '1'
AND is_delete = 0
<if test="time != null and time != ''">
AND LEFT(gmt_create, 7) = #{time}
</if>
<if test="year != null and year != ''">
AND LEFT(gmt_create, 4) = #{year}
</if>
<if test="caseIds != null and caseIds.size > 0">
AND case_id IN
<foreach collection="caseIds" index="index" open="(" separator="," close=")">
#{caseIds[${index}]}
</foreach>
</if>
<if test="bossIds != null and bossIds.size > 0">
AND creator IN
<foreach collection="bossIds" index="index" open="(" separator="," close=")">
#{bossIds[${index}]}
</foreach>
</if>
</select>
<select id="reporeCaseList" parameterType="map" resultMap="reportCaseDTO">
SELECT
t1.report_case_id,
t1.case_number,
t1.area_id,
t1.area_name,
t1.case_photos,
t1.case_audio,
t1.community_id,
t1.community_name,
t1.case_source,
t1.case_status,
t1.case_type_id,
t1.case_type_name,
t1.case_content,
t1.case_longitude,
t1.case_latitude,
t1.case_position,
t1.grade,
t1.is_accept,
t1.is_self,
t1.case_reporter,
t1.creator,
LEFT(t1.gmt_create, 19) gmt_create,
LEFT(t1.gmt_modified, 19) gmt_modified
FROM
city_report_case t1
<where>
<if test="caseIds != null and caseIds.size > 0">
AND report_case_id IN
<foreach collection="caseIds" index="index" open="(" separator="," close=")">
#{caseIds[${index}]}
</foreach>
</if>
</where>
</select>
<select id="showBoxWgyCaseList" parameterType="map" resultMap="reportCaseDTO">
SELECT
t3.report_case_id,
t3.case_number,
t3.area_id,
t3.area_name,
t3.case_photos,
t3.case_audio,
t3.community_id,
t3.community_name,
t3.case_source,
t3.case_status,
t3.case_type_id,
t3.case_type_name,
t3.case_content,
t3.case_longitude,
t3.case_latitude,
t3.case_position,
t3.grade,
t3.is_accept,
t3.is_self,
t3.case_reporter,
t3.creator,
LEFT (t3.gmt_create, 19) gmt_create,
LEFT (t3.gmt_modified, 19) gmt_modified
FROM
city_community_boss t1
LEFT JOIN city_report_case_handle t2 ON t1.community_boss_user_id = t2.creator
LEFT JOIN city_report_case t3 ON t2.case_id = t3.report_case_id
WHERE
t1.community_boss_id <![CDATA[ <> ]]> '1'
<if test="year != null and year != ''">
AND LEFT(t2.gmt_create, 4) = #{year}
</if>
</select>
<select id="showBoxZgyCaseList" parameterType="map" resultMap="reportCaseDTO">
SELECT
t3.report_case_id,
t3.case_number,
t3.area_id,
t3.area_name,
t3.case_photos,
t3.case_audio,
t3.community_id,
t3.community_name,
t3.case_source,
t3.case_status,
t3.case_type_id,
t3.case_type_name,
t3.case_content,
t3.case_longitude,
t3.case_latitude,
t3.case_position,
t3.grade,
t3.is_accept,
t3.is_self,
t3.case_reporter,
t3.creator,
LEFT (t3.gmt_create, 19) gmt_create,
LEFT (t3.gmt_modified, 19) gmt_modified
FROM
sys_role_user t1
LEFT JOIN city_report_case_handle t2 ON t1.user_id = t2.creator
LEFT JOIN city_report_case t3 ON t2.case_id = t3.report_case_id
WHERE
t1.user_id <![CDATA[ <> ]]> '1'
<if test="roleId != null and roleId != ''">
AND t1.role_id = #{roleId}
</if>
<if test="year != null and year != ''">
AND LEFT(t2.gmt_create, 4) = #{year}
</if>
</select>
</mapper>

View File

@ -0,0 +1,436 @@
<!doctype html>
<html lang="zh-CN">
<head>
<base href="/servicecity/">
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<!-- 图片 -->
<link rel="stylesheet" type="text/css" href="assets/js/vendor/swiper3/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
<!-- 图片 -->
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<style>
.layui-table-cell{
height: auto;
}
.layui-table-body td{
height: 210px;
}
.layui-table img{
max-width: 100%;
}
.info-row {border-bottom: 1px dotted;}
.info-row:last-child {border: none;}
.info-row .col-left {width:30%;height:28px;text-align:center;border-right:1px dotted;display:inline-block;padding:5px;vertical-align:top;}
.info-row .col-right {width:70%;display:inline-block;padding:5px;vertical-align:top;}
.info-row .col-line {width:100%;color:black;text-align:center;display:block;padding:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.info-row .col-line .fa {color: red; margin-right: 5px;}
.info-row .col-content {width:100%;display:inline-block;padding:5px;height:86px;overflow:auto;white-space:normal;word-break:break-all;word-wrap:break-word;vertical-align:top;}
</style>
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
<div class="layui-inline" id="userType" style="width: 150px;"></div>
<div class="layui-inline">
<select id="userTypeSel" name="userTypeSel" lay-filter="changeUserType">
<option value="网格员">网格员</option>
<option value="专管员">专管员</option>
</select>
</div>
<!--<div class="layui-inline" id="areaSelectTemplateBox" style="width: 150px;"></div>
<script id="areaSelectTemplate" type="text/html">
<select id="areaId" name="areaId" lay-filter="changeArea">
<option value="">选择街镇</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dict_id}}">{{item.dict_name}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline" id="communityBox" style="width: 150px;"></div>
<script id="communityTemplate" type="text/html">
<select id="communityId" name="communityId">
<option value="">选择社区(村)</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.community_id}}">{{item.community_name}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 100px;"></div>
<script id="caseTypeSelectTemplate" type="text/html">
<select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType">
<option value="">案件类型</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dict_id}}">{{item.dict_name}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline" id="childCaseTypeSelectTemplateBox" style="width: 150px;"></div>
<script id="childCaseTypeSelectTemplate" type="text/html">
<select id="childCaseTypeId" name="childCaseTypeId">
<option value="">案件子类型</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dict_id}}">{{item.dict_name}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline">
<input type="text" id="startTime" class="layui-input search-item"
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
</div>
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item"
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
</div>
<div class="layui-inline">
<input type="text" id="caseNumber" class="layui-input search-item" placeholder="案件编号" style="height: 38px;width:150px;" autocomplete="off">
</div>-->
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
</div>
</div>
</div>
</div>
</div>
<script src="assets/layuiadmin/layui/layui.js"></script>
<!-- 图片 -->
<script type="text/javascript" src="assets/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="assets/js/restajax.js"></script>
<script type="text/javascript" src="assets/js/vendor/swiper3/js/swiper.min.js"></script>
<script type="text/javascript" src="assets/js/vendor/viewer/viewer.min.js"></script>
<!-- 图片 -->
<script type="text/javascript">
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laytpl', 'form','laydate', 'dialog'], function() {
var $ = layui.$;
var $win = $(window);
var laytpl = layui.laytpl;
var table = layui.table;
var admin = layui.admin;
var form = layui.form;
var laydate = layui.laydate;
var dialog = layui.dialog;
var tableUrl = 'app/data-external-release/list-page-handle-case?userType={userType}';
function init() {
laydate.render({
elem: '#startTime'
,value: ''
});
laydate.render({
elem: '#endTime'
,value: ''
});
/*initArea();
initCommunity('');
initCaseType();
initChildCaseType('');*/
initTable('网格员');
}
init();
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 初始化地区
function initArea(){
restAjax.get('app/data-external-release/get-area-info-city-dict', {dictParentId: '9d179f05-3ea0-48f7-853c-d3b7124b791c'}, null, function(code, data) {
laytpl(document.getElementById('areaSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('areaSelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
dialog.msg(data.msg);
});
}
form.on('select(changeArea)', function(data){
initCommunity(data.value);
});
// 初始化社区村
function initCommunity(areaId){
if(typeof (areaId) === 'undefined' || areaId == ''){
laytpl(document.getElementById('communityTemplate').innerHTML).render([], function(html) {
document.getElementById('communityBox').innerHTML = html;
});
form.render('select');
return;
}
restAjax.get('app/data-external-release/get-community-info', {areaId : areaId}, null, function(code, data) {
laytpl(document.getElementById('communityTemplate').innerHTML).render(data, function(html) {
document.getElementById('communityBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
dialog.msg(data.msg);
});
}
// 初始化案件类型
function initCaseType(){
restAjax.get('app/data-external-release/get-area-info-city-dict', {dictParentId: '46d108b2-4ef9-4f6f-b30c-0c700e3ee852'}, null, function(code, data) {
laytpl(document.getElementById('caseTypeSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('caseTypeSelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
dialog.msg(data.msg);
});
}
form.on('select(changeCaseType)',function(data){
initChildCaseType(data.value);
});
//初始化子案件类型
function initChildCaseType(parentId){
if(typeof(parentId) === 'undefined' || '' == parentId){
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render([], function(html) {
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
});
form.render('select');
return;
}
restAjax.get('app/data-external-release/get-area-info-city-dict', {dictParentId: parentId}, null, function(code, data) {
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
});
form.render('select');
}, function(code, data) {
dialog.msg(data.msg);
});
}
// 初始化表格
function initTable(userType) {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: restAjax.path(tableUrl, [userType]),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 100,
where :{
caseStatus : 6
},
limit: 10,
limits: [10, 20, 40, 80, 100, 200],
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [[
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{width: 300, title: '案件图片', align:'center',
templet: function(row) {
var photos = row.casePhotos.split(',')
var value = '<div id="photo_'+ row.reportCaseId +'" class="swiper-container" style="width:100%;">' +
'<div class="swiper-wrapper" style="width:100%">';
for(var i = 0, item = photos[i]; item = photos[i++];) {
value += '<div class="swiper-slide" style="width:100%;">' +
'<img class="swiper-lazy" src="route/file/downloadfile/true/'+ item +'" style="width:270px;height:180px;cursor:pointer;"/>' +
'<div class="swiper-lazy-preloader"></div>' +
'</div>';
}
value += '</div><div id="photo_swiper_'+ row.reportCaseId +'" class="swiper-pagination"></div></div>';
setTimeout(function() {
new Swiper('#photo_'+ row.reportCaseId, {
lazyLoading: true,
autoplay: 3000,
pagination : '#photo_swiper_'+ row.reportCaseId,
paginationClickable :true,
});
new Viewer(document.getElementById('photo_'+ row.reportCaseId));
}, 50);
return value;
}
},
{width: 450, title: '案件信息', align: 'center',
templet: function (row) {
var caseFlowType = row.caseFlowType;
if(caseFlowType == '1'){
caseFlowType = '(职能部门案件)';
} else {
caseFlowType = '(街镇案件)'
}
var value = '<div style="text-align: left">'+
'<div class="info-row"><span class="col-left">案件编号</span><span class="col-right">'+ row.caseNumber +'</span></div>'+
'<div class="info-row"><span class="col-left">所在地区</span><span class="col-right">'+ row.areaName +'</span></div>'+
'<div class="info-row"><span class="col-left">所在社区</span><span class="col-right">'+ row.communityName +'</span></div>'+
'<div class="info-row"><span class="col-left">案件类型</span><span class="col-right">'+ caseFlowType + row.caseTypeName +'</span></div>'+
'<div class="info-row"><span class="col-left">操作</span>' +
'<span class="col-right">'+
'<div class="btn-group btn-group-xs">' +
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="showEvent">详情</button>'+
'<button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="caseFlowEvent">流程查看</button>'+
'</div>'+
'</span>'+
'</div>'+
'</div>'
return value;
}
},
{width: 300, title: '案件内容', align: 'center',
templet: function (row) {
var value = '<div style="text-align: left">'+
'<div class="info-row"><span class="col-left">案件来源</span><span class="col-right">'+ sourceFormatter(row.caseSource) +'</span></div>'+
'<div class="info-row"><a href="javascript:;" class="col-line" lay-event="showLocation"><i class="fa fa-map-marker"></i>'+ row.casePosition +'</a></div>'+
'<div class="info-row"><span class="col-content">'+ row.caseContent +'</span></div>'+
'</div>';
return value;
}
},
{width: 250, title: '案件状态', align: 'center',
templet: function (row) {
var value = '<div style="text-align: left">'+
'<div class="info-row"><span class="col-left">上报时间</span><span class="col-right">'+ row.reportDate +'</span></div>'+
'<div class="info-row"><span class="col-left">上报人员</span><span class="col-right">'+ row.caseReporter +'</span></div>'+
'<div class="info-row"><span class="col-left">案件状态</span><span class="col-right">'+ caseStatusFormatter(row.caseStatus) +'</span></div>'+
'<div class="info-row"><span class="col-left"></span><span class="col-right" style="color: red;">'+ ((row.overDays != null && row.overDays >= 1) ? '【超过'+ row.overDays +'天未处理】' : '') +'</span></div>'+
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
'</div>';
return value;
}
}
]],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
},
done: function(){
}
});
}
// 重载表格
function reloadTable(currentPage) {
var userType = $('#userTypeSel').val();
table.reload('dataTable', {
url: restAjax.path(tableUrl, [userType]),
where:{
/*areaId : $('#areaId').val(),
communityId : $('#communityId').val(),
caseTypeId : $('#childCaseTypeId').val(),
caseTypeId : $('#childCaseTypeId').val(),
caseStatus : 6,
startTime : $('#startTime').val(),
endTime : $('#endTime').val(),
caseNumber : $('#caseNumber').val(),*/
userType : userType
},
page: {
curr: currentPage
},
height: $win.height() - 100
});
}
// 来源格式化
function sourceFormatter(val) {
var value;
switch (val) {
case '1':
value = '群众举报';
break;
case '2':
value = '巡检采集';
break;
case '3':
value = '专管员上报';
break;
default:
value = '未知';
}
return value;
}
// 案件状态
function caseStatusFormatter(val) {
var value;
switch (val) {
case '0':
value = '待受理';
break;
case '1':
value = '待立案';
break;
case '2':
value = '待转派';
break;
case '3':
value = '待处理';
break;
case '4':
value = '待检查';
break;
case '5':
value = '待结案';
break;
case '6':
value = '已归档';
break;
case '7':
value = '删除且有争议';
break;
default:
value = '异常';
}
return value;
}
table.on('tool(dataTable)', function(obj) {
if(obj.event === 'showEvent'){
layer.open({
type: 2,
title: '详情',
closeBtn: 1,
area: ['70%', '80%'],
shadeClose: true,
anim: 2,
content: restAjax.path('route/bigdata/show.html?reportCaseId={id}',
[obj.data.reportCaseId]),
end: function() {
}
});
}
if(obj.event === 'caseFlowEvent'){
layer.open({
type: 2,
title: '案件流程',
closeBtn: 1,
area: ['70%', '80%'],
shadeClose: true,
anim: 2,
content: restAjax.path('route/bigdata/list_case_log.html?reportCaseId={id}',
[obj.data.reportCaseId]),
end: function() {
}
});
}
});
})
</script>
</body>
</html>

View File

@ -15,6 +15,19 @@
<div class="layui-row">
<div class="layui-card" id="left-card-div" style="">
<div class="layui-card-body">
<div style="padding: 10px 0px; border-bottom: 1px solid #DDDDDD;text-align: left">
<div class="layui-inline">
<input type="text" id="start" class="layui-input search-item"
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
</div>
<div class="layui-inline">
<input type="text" id="end" class="layui-input search-item"
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
</div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<div style="padding: 10px 0px; border-bottom: 1px solid #DDDDDD;text-align: right">
<button typeof="button" id="backToArea" class="layui-btn layui-btn-sm">返回上级</button>
<button typeof="button" id="exportExcel" class="layui-btn layui-btn-sm">导出本级数据</button>
@ -40,6 +53,17 @@
{{# for(var i = 0, item; item = d[i++];) { }}
<tr>
<td style="text-align: center;">
{{# if(item.name == '暂无数据'){ }}
<a href="javascript:void(0)"
data-hansubarea="{{item.name}}" class=""
style="color: #0a54a6;text-decoration: underline"
data-level="{{item.level}}"
data-dataId="{{item.dataId}}"
data-prpeLevel="{{item.prpeLevel}}"
data-prpeDataId="{{item.prpeDataId}}">{{item.name}}</a>
{{# } }}
{{# if(item.name != '暂无数据'){ }}
<a href="javascript:void(0)"
data-hansubarea="{{item.name}}" class="change-area"
style="color: #0a54a6;text-decoration: underline"
@ -47,6 +71,7 @@
data-dataId="{{item.dataId}}"
data-prpeLevel="{{item.prpeLevel}}"
data-prpeDataId="{{item.prpeDataId}}">{{item.name}}</a>
{{# } }}
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.allCount}}</a>
@ -84,21 +109,46 @@
var resizeTimeout = null;
var tableUrl = 'api/building/listpage';
var residentialId = top.restAjax.params(window.location.href).residentialId;
var dataLoading = false;
$(document).on('click', '#search', function() {
if(dataLoading){
layer.msg('数据加载中,请稍等...');
return;
}
var start = $('#start').val();
var end = $('#end').val();
changeSearchData(start, end);
});
function initDateTime(){
laydate.render({
elem: '#start'
,value: ''
});
laydate.render({
elem: '#end'
,value: ''
});
}
initDateTime();
var dataMsg = {
url: '',
dataId: '',
level: '',
level: 0,
nowLevel: '',
nowDataId: ''
};
var areaCode = '';
$('#left-card-div').height($win.height() - 30);
$('#left-card-div').css('overflow', 'auto');
function initData() {
listAreaUserCounts('api/reportcase/data-counts/{level}', 1, '');
var start = $('#start').val();
var end = $('#end').val();
var url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
listAreaUserCounts(url, 1, '');
}
initData();
@ -127,14 +177,20 @@
level+=1;
var dataId = $(this).data().dataid;
var url = '';
console.log("level==" + level + "-------" + "dataId==" + dataId)
var start = $('#start').val();
var end = $('#end').val();
if(level == 2) {
url = 'api/reportcase/data-counts/{level}';
url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'api/reportcase/data-counts/{level}?areaId={areaId}';
url = 'api/reportcase/data-counts/{level}?areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'api/reportcase/data-counts/{level}?communityId={communityId}&prpeDataId={prpeDataId}';
url = 'api/reportcase/data-counts/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end;
}
if(level > 4) {
@ -142,9 +198,41 @@
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
reloadTable();
});
function changeSearchData() {
// 假设 elem 是你已经获取到的元素引用
let elem = document.querySelector('.change-area');
let level = elem.dataset.level;
let dataId = elem.dataset.dataid;
console.log(level, "------------", dataId)
var url = '';
var start = $('#start').val();
var end = $('#end').val();
if(level == 1) {
url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'api/reportcase/data-counts/{level}?areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'api/reportcase/data-counts/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end;
}
if(level > 4) {
return false;
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
}
// 返回上级
$(document).on('click', '#backToArea', function () {
var level = dataMsg.level;
@ -164,9 +252,31 @@
url = 'api/reportcase/data-counts/{level}?communityId={communityId}';
}
listAreaUserCounts(url, level, dataId);
reloadTable();
});
function backSearchData(start, end) {
var level = 1;
var dataId = dataMsg.dataId;
var url;
console.log(start)
console.log(end)
if(level == 1) {
url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'api/reportcase/data-counts/{level}?areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'api/reportcase/data-counts/{level}?communityId={communityId}&start=' + start + '&end='+ end;
}
listAreaUserCounts(url, level, dataId);
}
// 导出数据
$(document).on('click', '#exportExcel', function () {
top.dialog.msg('确定导出吗?', {
@ -179,39 +289,26 @@
var dataId = dataMsg.nowDataId;
var url;
var start = $('#start').val();
var end = $('#end').val();
if(level == 1) {
url = 'api/reportcase/export-datacount?level={level}';
url = 'api/reportcase/export-datacount?level={level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'api/reportcase/export-datacount?level={level}';
url = 'api/reportcase/export-datacount?level={level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'api/reportcase/export-datacount?level={level}&areaId={areaId}';
url = 'api/reportcase/export-datacount?level={level}&areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'api/reportcase/export-datacount?level={level}&communityId={communityId}&prpeDataId={prpeDataId}';
url = 'api/reportcase/export-datacount?level={level}&communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end;
}
window.open(top.restAjax.path(url, [level, dataId, dataMsg.dataId]));
}
});
});
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, [residentialId]),
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 事件 - 页面变化
$win.on('resize', function () {
clearTimeout(resizeTimeout);