Compare commits

...

5 Commits

Author SHA1 Message Date
Renpc-kilig
781fa71e1f 案件归档缺少专管员区域修改 2024-10-21 16:07:13 +08:00
Renpc-kilig
de668495f0 案件统计功能修改。 2024-05-21 18:23:57 +08:00
Renpc-kilig
75b91cc4c3 案件统计功能修改。 2024-05-20 10:29:58 +08:00
Renpc-kilig
23e1543fa4 案件统计功能修改。 2024-05-14 16:26:01 +08:00
Renpc-kilig
147fe7c737 大数据新增接口和页面。 2024-04-24 15:21:12 +08:00
21 changed files with 3952 additions and 50 deletions

View File

@ -643,4 +643,13 @@ public class ReportCaseController extends AbstractController {
Map<String, Object> params = requestParams();
reportCaseService.exportDataCount(response, params);
}
@GetMapping("update-case")
public SuccessResultData<String> updateCase() {
long startTime = System.currentTimeMillis();
Map<String, Object> params = requestParams();
reportCaseService.updateCaseCount(params);
long endTime = System.currentTimeMillis();
return new SuccessResultData<>("used " + (endTime - startTime) + " ms");
}
}

View File

@ -18,10 +18,7 @@ import com.cm.systemcity.dao.reportcase.IReportCaseDao;
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.reportcase.CaseStatisticDTO;
import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseAssignDTO;
import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseDTO;
import com.cm.systemcity.pojo.dtos.reportcase.ReportCaseLogDTO;
import com.cm.systemcity.pojo.dtos.reportcase.*;
import com.cm.systemcity.pojo.dtos.userlocation.UserLocationDTO;
import com.cm.systemcity.service.bindingdepartment.IBindingDepartmentService;
import com.cm.systemcity.service.community.ICommunityService;
@ -43,8 +40,10 @@ import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
@ -1278,4 +1277,61 @@ 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;
}
@GetMapping("data-counts-bigdata/{level}")
public List<CaseCountDTO> dataCountBigdata(@PathVariable("level") Integer level){
Map<String, Object> params = requestParams();
if(null == params.get("start")) {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前年份
int currentYear = currentDate.getYear();
params.put("start", currentYear + "-01-01");
}
if(null == params.get("end")) {
params.put("end", LocalDate.now().toString());
}
return reportCaseService.dataCountBigdata(level, params);
}
@GetMapping("update-case-bigdata")
public SuccessResultData<String> updateCaseBigData() {
long startTime = System.currentTimeMillis();
Map<String, Object> params = requestParams();
reportCaseService.updateCaseCount(params);
long endTime = System.currentTimeMillis();
return new SuccessResultData<>("used " + (endTime - startTime) + " ms");
}
@ApiOperation(value = "导出自上报案件数量", notes = "导出自上报案件数量接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("export-datacount-bigdata")
public void exportDataCountBigData(HttpServletResponse response) throws Exception {
Map<String, Object> params = requestParams();
if(null == params.get("start")) {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前年份
int currentYear = currentDate.getYear();
params.put("start", currentYear + "01-01");
}
if(null == params.get("end")) {
params.put("start", LocalDate.now());
}
reportCaseService.exportDataCountBigdata(response, params);
}
}

View File

@ -5,6 +5,7 @@ import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException;
import com.cm.systemcity.pojo.dtos.reportcase.*;
import com.cm.systemcity.pojo.pos.reportCase.*;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -398,4 +399,40 @@ 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);
List<Map<String, Object>> allWgyCase(Map<String, Object> params);
List<Map<String, Object>> selfWgyCase(Map<String, Object> params);
List<Map<String, Object>> allZgyCase(Map<String, Object> params);
List<Map<String, Object>> selfZgyCase(Map<String, Object> params);
List<ReportCasePO> listPO(Map<String, Object> params);
List<ReportCaseAcceptPO> listAcceptPO(Map<String, Object> params);
List<ReportCaseAssignPO> listAssignPO(Map<String, Object> params);
List<ReportCaseHandlePO> listHandlePO(Map<String, Object> params);
List<ReportCaseInspectPO> listInspectPO(Map<String, Object> params);
Integer countCaseAssign(Map<String, Object> caseAssignMap);
CasePO getCasePO(Map<String, String> caseId);
void saveCase(Map<String, Object> params);
void updateCase(Map<String, Object> params);
List<CasePO> dataCountLevel1(Map<String, Object> params);
List<ReportCaseDTO> dataCountReportCase(Map<String, Object> caseParams);
}

View File

@ -27,6 +27,8 @@ public class CaseCountDTO {
private Integer prpeLevel;
@ApiModelProperty(name = "userId", value = "网格员ID")
private String userId;
@ApiModelProperty(name = "departmentId", value = "部门ID")
private String departmentId;
public String getName() {
return name;
@ -100,6 +102,14 @@ public class CaseCountDTO {
this.userId = userId;
}
public String getDepartmentId() {
return departmentId;
}
public void setDepartmentId(String departmentId) {
this.departmentId = departmentId;
}
@Override
public String toString() {
return "CaseCountDTO{" +

View File

@ -0,0 +1,311 @@
package com.cm.systemcity.pojo.pos.reportCase;
public class CasePO {
private String caseId;
private String areaId;
private String areaName;
private String communityId;
private String communityName;
private String caseTypeId;
private String caseTypeName;
private String gmtReport;
private String gmtAccept;
private String gmtAssign;
private String handleEndTimeLong;
private String handleEndTime;
private String gmtHandle;
private Integer isTimeout;
private String gmtInspect;
private Integer isSelf;
private String reportUserId;
private String reportUserName;
private String assignUserId;
private String handleUserId;
private String inspectUserId;
private String inspectScore;
private Integer isDelete;
private String gmtDelete;
private String deleteUserId;
private Integer totalUrge;
private Integer totalBack;
private Integer caseStatus;
private Integer caseSource;
private Integer isAccept;
private Integer isAssign;
private Integer isHandle;
private Integer isInspect;
private Integer assignTimeoutCount;
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId;
}
public String getAreaId() {
return areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getCommunityId() {
return communityId;
}
public void setCommunityId(String communityId) {
this.communityId = communityId;
}
public String getCommunityName() {
return communityName;
}
public void setCommunityName(String communityName) {
this.communityName = communityName;
}
public String getCaseTypeId() {
return caseTypeId;
}
public void setCaseTypeId(String caseTypeId) {
this.caseTypeId = caseTypeId;
}
public String getCaseTypeName() {
return caseTypeName;
}
public void setCaseTypeName(String caseTypeName) {
this.caseTypeName = caseTypeName;
}
public String getGmtReport() {
return gmtReport;
}
public void setGmtReport(String gmtReport) {
this.gmtReport = gmtReport;
}
public String getGmtAccept() {
return gmtAccept;
}
public void setGmtAccept(String gmtAccept) {
this.gmtAccept = gmtAccept;
}
public String getGmtAssign() {
return gmtAssign;
}
public void setGmtAssign(String gmtAssign) {
this.gmtAssign = gmtAssign;
}
public String getHandleEndTimeLong() {
return handleEndTimeLong;
}
public void setHandleEndTimeLong(String handleEndTimeLong) {
this.handleEndTimeLong = handleEndTimeLong;
}
public String getHandleEndTime() {
return handleEndTime;
}
public void setHandleEndTime(String handleEndTime) {
this.handleEndTime = handleEndTime;
}
public String getGmtHandle() {
return gmtHandle;
}
public void setGmtHandle(String gmtHandle) {
this.gmtHandle = gmtHandle;
}
public Integer getIsTimeout() {
return isTimeout;
}
public void setIsTimeout(Integer isTimeout) {
this.isTimeout = isTimeout;
}
public String getGmtInspect() {
return gmtInspect;
}
public void setGmtInspect(String gmtInspect) {
this.gmtInspect = gmtInspect;
}
public Integer getIsSelf() {
return isSelf;
}
public void setIsSelf(Integer isSelf) {
this.isSelf = isSelf;
}
public String getReportUserId() {
return reportUserId;
}
public void setReportUserId(String reportUserId) {
this.reportUserId = reportUserId;
}
public String getReportUserName() {
return reportUserName;
}
public void setReportUserName(String reportUserName) {
this.reportUserName = reportUserName;
}
public String getAssignUserId() {
return assignUserId;
}
public void setAssignUserId(String assignUserId) {
this.assignUserId = assignUserId;
}
public String getHandleUserId() {
return handleUserId;
}
public void setHandleUserId(String handleUserId) {
this.handleUserId = handleUserId;
}
public String getInspectUserId() {
return inspectUserId;
}
public void setInspectUserId(String inspectUserId) {
this.inspectUserId = inspectUserId;
}
public String getInspectScore() {
return inspectScore;
}
public void setInspectScore(String inspectScore) {
this.inspectScore = inspectScore;
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public String getGmtDelete() {
return gmtDelete;
}
public void setGmtDelete(String gmtDelete) {
this.gmtDelete = gmtDelete;
}
public String getDeleteUserId() {
return deleteUserId;
}
public void setDeleteUserId(String deleteUserId) {
this.deleteUserId = deleteUserId;
}
public Integer getTotalUrge() {
return totalUrge == null ? 0 : totalUrge;
}
public void setTotalUrge(Integer totalUrge) {
this.totalUrge = totalUrge;
}
public Integer getTotalBack() {
return totalBack;
}
public void setTotalBack(Integer totalBack) {
this.totalBack = totalBack;
}
public Integer getCaseStatus() {
return caseStatus;
}
public void setCaseStatus(Integer caseStatus) {
this.caseStatus = caseStatus;
}
public Integer getCaseSource() {
return caseSource;
}
public void setCaseSource(Integer caseSource) {
this.caseSource = caseSource;
}
public Integer getIsAccept() {
return isAccept;
}
public void setIsAccept(Integer isAccept) {
this.isAccept = isAccept;
}
public Integer getIsAssign() {
return isAssign;
}
public void setIsAssign(Integer isAssign) {
this.isAssign = isAssign;
}
public Integer getIsHandle() {
return isHandle;
}
public void setIsHandle(Integer isHandle) {
this.isHandle = isHandle;
}
public Integer getIsInspect() {
return isInspect;
}
public void setIsInspect(Integer isInspect) {
this.isInspect = isInspect;
}
public Integer getAssignTimeoutCount() {
return assignTimeoutCount;
}
public void setAssignTimeoutCount(Integer assignTimeoutCount) {
this.assignTimeoutCount = assignTimeoutCount;
}
}

View File

@ -0,0 +1,32 @@
package com.cm.systemcity.pojo.pos.reportCase;
public class ReportCaseAcceptPO {
private String caseId;
private String gmtCreate;
private String creator;
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
}

View File

@ -0,0 +1,50 @@
package com.cm.systemcity.pojo.pos.reportCase;
public class ReportCaseAssignPO {
private String caseId;
private String handleUserId;
private Double handleTime;
private String creator;
private String gmtCreate;
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId;
}
public String getHandleUserId() {
return handleUserId;
}
public void setHandleUserId(String handleUserId) {
this.handleUserId = handleUserId;
}
public Double getHandleTime() {
return handleTime;
}
public void setHandleTime(Double handleTime) {
this.handleTime = handleTime;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
}

View File

@ -0,0 +1,77 @@
package com.cm.systemcity.pojo.pos.reportCase;
public class ReportCaseHandlePO {
private String caseId;
private Double handleTime;
private Integer handleTimeout;
private Integer isInspect;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId;
}
public Double getHandleTime() {
return handleTime;
}
public void setHandleTime(Double handleTime) {
this.handleTime = handleTime;
}
public Integer getHandleTimeout() {
return handleTimeout;
}
public void setHandleTimeout(Integer handleTimeout) {
this.handleTimeout = handleTimeout;
}
public Integer getIsInspect() {
return isInspect;
}
public void setIsInspect(Integer isInspect) {
this.isInspect = isInspect;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified;
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
}

View File

@ -0,0 +1,59 @@
package com.cm.systemcity.pojo.pos.reportCase;
public class ReportCaseInspectPO {
private String caseId;
private Integer isPass;
private String creator;
private String gmtCreate;
private String modifier;
private String gmtModified;
public String getCaseId() {
return caseId;
}
public void setCaseId(String caseId) {
this.caseId = caseId;
}
public Integer getIsPass() {
return isPass;
}
public void setIsPass(Integer isPass) {
this.isPass = isPass;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public String getGmtModified() {
return gmtModified;
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
}

View File

@ -0,0 +1,158 @@
package com.cm.systemcity.pojo.pos.reportCase;
public class ReportCasePO {
private String reportCaseId;
private String areaId;
private String areaName;
private String communityId;
private String communityName;
private String caseTypeId;
private String caseTypeName;
private String caseReporter;
private String isSelf;
private Double grade;
private String gmtCreate;
private String creator;
private String gmtModified;
private String modifier;
private Integer isDelete;
private Integer caseStatus;
private Integer caseSource;
public String getReportCaseId() {
return reportCaseId;
}
public void setReportCaseId(String reportCaseId) {
this.reportCaseId = reportCaseId;
}
public String getAreaId() {
return areaId;
}
public void setAreaId(String areaId) {
this.areaId = areaId;
}
public String getAreaName() {
return areaName;
}
public void setAreaName(String areaName) {
this.areaName = areaName;
}
public String getCommunityId() {
return communityId;
}
public void setCommunityId(String communityId) {
this.communityId = communityId;
}
public String getCommunityName() {
return communityName;
}
public void setCommunityName(String communityName) {
this.communityName = communityName;
}
public String getCaseTypeId() {
return caseTypeId;
}
public void setCaseTypeId(String caseTypeId) {
this.caseTypeId = caseTypeId;
}
public String getCaseTypeName() {
return caseTypeName;
}
public void setCaseTypeName(String caseTypeName) {
this.caseTypeName = caseTypeName;
}
public String getCaseReporter() {
return caseReporter;
}
public void setCaseReporter(String caseReporter) {
this.caseReporter = caseReporter;
}
public String getIsSelf() {
return isSelf;
}
public void setIsSelf(String isSelf) {
this.isSelf = isSelf;
}
public Double getGrade() {
return grade;
}
public void setGrade(Double grade) {
this.grade = grade;
}
public String getGmtCreate() {
return gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtModified() {
return gmtModified;
}
public void setGmtModified(String gmtModified) {
this.gmtModified = gmtModified;
}
public String getModifier() {
return modifier;
}
public void setModifier(String modifier) {
this.modifier = modifier;
}
public Integer getIsDelete() {
return isDelete;
}
public void setIsDelete(Integer isDelete) {
this.isDelete = isDelete;
}
public Integer getCaseStatus() {
return caseStatus;
}
public void setCaseStatus(Integer caseStatus) {
this.caseStatus = caseStatus;
}
public Integer getCaseSource() {
return caseSource;
}
public void setCaseSource(Integer caseSource) {
this.caseSource = caseSource;
}
}

View File

@ -241,7 +241,7 @@ public class BindingDepartmentServiceServiceImpl extends BaseService implements
if (!"f0bf2d8a-e736-4895-a9c8-80f530068c3a".equals(item.get("departmentId"))
&& !"52fecef4-f0f5-4077-999c-39db09872718".equals(item.get("departmentId"))
&& !"1a9b5a0c-d842-46ff-b0c5-36a29b9055df".equals(item.get("departmentId"))
&& !"1066b4d1-8d72-4b35-ba1a-f59c54eba021".equals(item.get("departmentId"))) {
/*&& !"1066b4d1-8d72-4b35-ba1a-f59c54eba021".equals(item.get("departmentId"))*/) {
nPersonDept.add(item);
}
}

View File

@ -498,4 +498,12 @@ 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);
void updateCaseCount(Map<String, Object> params);
List<CaseCountDTO> dataCountBigdata(Integer level, Map<String, Object> params);
void exportDataCountBigdata(HttpServletResponse response, Map<String, Object> params);
}

View File

@ -25,11 +25,11 @@ spring:
datasource:
druid:
# url: jdbc:mysql://192.168.0.151:3306/db_btgxq_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
url: jdbc:mysql://localhost:3306/db_btgxq?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
url: jdbc:mysql://192.168.0.151:3306/db_btgxq?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false
db-type: mysql
driver-class-name: com.mysql.jdbc.Driver
username: root
password: 123456
password: root
initial-size: 2
min-idle: 2
max-active: 10
@ -82,7 +82,7 @@ file:
# 安全
security:
oauth2:
oauth-server: http://192.168.0.4:7021/usercenter
oauth-server: http://192.168.0.9:7021/usercenter
oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url}
client:
client-id: c024a89b35b04d4d8b5b4ea4d66a8acb

View File

@ -129,6 +129,95 @@
<result property="caseId" column="case_id"/>
</resultMap>
<resultMap id="reportCasePO" type="com.cm.systemcity.pojo.pos.reportCase.ReportCasePO">
<id column="report_case_id" property="reportCaseId"/>
<result column="area_id" property="areaId"/>
<result column="area_name" property="areaName"/>
<result column="community_id" property="communityId"/>
<result column="community_name" property="communityName"/>
<result column="case_type_id" property="caseTypeId"/>
<result column="case_type_name" property="caseTypeName"/>
<result column="case_reporter" property="caseReporter"/>
<result column="is_self" property="isSelf"/>
<result column="grade" property="grade"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="modifier" property="modifier"/>
<result column="is_delete" property="isDelete"/>
<result column="case_status" property="caseStatus"/>
<result column="case_source" property="caseSource"/>
</resultMap>
<resultMap id="reportCaseAcceptPO" type="com.cm.systemcity.pojo.pos.reportCase.ReportCaseAcceptPO">
<id column="case_id" property="caseId"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
</resultMap>
<resultMap id="reportCaseAssignPO" type="com.cm.systemcity.pojo.pos.reportCase.ReportCaseAssignPO">
<id column="case_id" property="caseId"/>
<result column="handle_user_id" property="handleUserId"/>
<result column="handle_time" property="handleTime"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
</resultMap>
<resultMap id="reportCaseHandlePO" type="com.cm.systemcity.pojo.pos.reportCase.ReportCaseHandlePO">
<id column="case_id" property="caseId"/>
<result column="handle_time" property="handleTime"/>
<result column="handle_timeout" property="handleTimeout"/>
<result column="is_inspect" property="isInspect"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="modifier" property="modifier"/>
</resultMap>
<resultMap id="reportCaseInspectPO" type="com.cm.systemcity.pojo.pos.reportCase.ReportCaseInspectPO">
<id column="case_id" property="caseId"/>
<result column="is_pass" property="isPass"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="modifier" property="modifier"/>
</resultMap>
<resultMap id="casePO" type="com.cm.systemcity.pojo.pos.reportCase.CasePO">
<result column="case_id" property="caseId"/>
<result column="area_id" property="areaId"/>
<result column="area_name" property="areaName"/>
<result column="community_id" property="communityId"/>
<result column="community_name" property="communityName"/>
<result column="gmt_report" property="gmtReport"/>
<result column="gmt_accept" property="gmtAccept"/>
<result column="gmt_assign" property="gmtAssign"/>
<result column="handle_end_time_long" property="handleEndTimeLong"/>
<result column="handle_end_time" property="handleEndTime"/>
<result column="gmt_handle" property="gmtHandle"/>
<result column="is_timeout" property="isTimeout"/>
<result column="gmt_inspect" property="gmtInspect"/>
<result column="is_self" property="isSelf"/>
<result column="report_user_id" property="reportUserId"/>
<result column="report_user_name" property="reportUserName"/>
<result column="assign_user_id" property="assignUserId"/>
<result column="handle_user_id" property="handleUserId"/>
<result column="inspect_user_id" property="inspectUserId"/>
<result column="inspect_score" property="inspectScore"/>
<result column="is_delete" property="isDelete"/>
<result column="gmt_delete" property="gmtDelete"/>
<result column="delete_user_id" property="deleteUserId"/>
<result column="total_urge" property="totalUrge"/>
<result column="total_back" property="totalBack"/>
<result column="case_status" property="caseStatus"/>
<result column="case_source" property="caseSource"/>
<result column="is_accept" property="isAccept"/>
<result column="is_assign" property="isAssign"/>
<result column="is_handle" property="isHandle"/>
<result column="is_inspect" property="isInspect"/>
<result column="assign_timeout_count" property="assignTimeoutCount"/>
</resultMap>
<select id="listPageReportDelete" parameterType="map" resultMap="reportCaseDTO">
SELECT
t1.report_case_id,
@ -2250,6 +2339,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 +2375,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 +2438,696 @@
<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>
<select id="allWgyCase" parameterType="map" resultMap="countMap">
SELECT
<if test="area != null and area != ''">
t3.area_id,
t3.area_name,
</if>
<if test="community != null and community != ''">
t3.community_id,
t3.community_name,
</if>
<if test="creator != null and creator != ''">
t3.case_reporter,
t3.creator,
</if>
t3.report_case_id case_id
FROM (
SELECT
t2.*
FROM
city_community_boss t1
LEFT JOIN city_report_case t2 ON t1.community_boss_user_id = t2.creator
WHERE
t2.is_delete = 0
AND t1.is_delete = 0
AND t2.creator <![CDATA[ <> ]]> '1'
GROUP BY t2.report_case_id
) t3
WHERE
1 = 1
<if test="start != null and start != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ <= ]]> #{end}
</if>
<if test="isSelf != null and isSelf != ''">
AND t3.is_self = 1
</if>
<if test="community != null and community != ''">
AND t3.area_id = #{areaId}
</if>
<if test="creator != null and creator != ''">
AND t3.community_id = #{communityId}
</if>
</select>
<select id="selfWgyCase" parameterType="map" resultMap="countMap">
SELECT
<if test="area != null and area != ''">
t3.area_id,
t3.area_name,
</if>
<if test="community != null and community != ''">
t3.community_id,
t3.community_name,
</if>
<if test="creator != null and creator != ''">
t3.case_reporter,
t3.creator,
</if>
COUNT(*) count
FROM (
SELECT
t2.*
FROM
city_community_boss t1
LEFT JOIN city_report_case t2 ON t1.community_boss_user_id = t2.creator
WHERE
t2.is_delete = 0
AND t1.is_delete = 0
AND t2.creator <![CDATA[ <> ]]> '1'
GROUP BY t2.report_case_id
) t3
WHERE
1 = 1
<if test="isSelf != null and isSelf != ''">
AND t3.is_self = 1
</if>
<if test="start != null and start != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ <= ]]> #{end}
</if>
<if test="area != null and area != ''">
GROUP BY t3.area_id
</if>
<if test="community != null and community != ''">
AND t3.area_id = #{areaId}
GROUP BY t3.community_id
</if>
<if test="creator != null and creator != ''">
AND t3.community_id = #{communityId}
GROUP BY t3.creator
</if>
</select>
<select id="allZgyCase" parameterType="map" resultMap="countMap">
SELECT
<if test="area != null and area != ''">
t3.area_id,
t3.area_name,
</if>
<if test="community != null and community != ''">
t3.community_id,
t3.community_name,
</if>
<if test="creator != null and creator != ''">
t3.case_reporter,
t3.creator,
</if>
t3.report_case_id case_id
FROM (
SELECT
t2.*
FROM
sys_role_user t1
LEFT JOIN city_report_case t2 ON t1.user_id = t2.creator
WHERE
t2.is_delete = 0
AND t1.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
AND t2.creator <![CDATA[ <> ]]> '1'
GROUP BY t2.report_case_id
) t3
WHERE
1 = 1
<if test="isSelf != null and isSelf != ''">
AND t3.is_self = 1
</if>
<if test="start != null and start != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ <= ]]> #{end}
</if>
<if test="area != null and area != ''">
GROUP BY t3.area_id
</if>
<if test="community != null and community != ''">
AND t3.area_id = #{areaId}
GROUP BY t3.community_id
</if>
<if test="creator != null and creator != ''">
AND t3.community_id = #{communityId}
GROUP BY t3.creator
</if>
</select>
<select id="selfZgyCase" parameterType="map" resultMap="countMap">
SELECT
<if test="area != null and area != ''">
t3.area_id,
t3.area_name,
</if>
<if test="community != null and community != ''">
t3.community_id,
t3.community_name,
</if>
<if test="creator != null and creator != ''">
t3.case_reporter,
t3.creator,
</if>
COUNT(*) count
FROM (
SELECT
t2.*
FROM
sys_role_user t1
LEFT JOIN city_report_case t2 ON t1.user_id = t2.creator
WHERE
t2.is_delete = 0
AND t1.role_id = 'bc405346-8714-4ded-89ac-9cc4d755f66a'
AND t2.creator <![CDATA[ <> ]]> '1'
GROUP BY t2.report_case_id
) t3
WHERE
1 = 1
<if test="start != null and start != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND LEFT(t3.gmt_create, 10) <![CDATA[ <= ]]> #{end}
</if>
<if test="isSelf != null and isSelf != ''">
AND t3.is_self = 1
</if>
<if test="community != null and community != ''">
AND t3.area_id = #{areaId}
</if>
<if test="creator != null and creator != ''">
AND t3.community_id = #{communityId}
</if>
</select>
<select id="listPO" parameterType="map" resultMap="reportCasePO">
SELECT
report_case_id,
area_id,
area_name,
community_id,
community_name,
case_type_id,
case_type_name,
is_self,
grade,
case_reporter,
gmt_create,
creator,
gmt_modified,
modifier,
is_delete,
case_status,
case_source
FROM
city_report_case
<where>
<if test="caseStatus != null">
AND
case_status = #{caseStatus}
</if>
<if test="caseStatus != null">
AND case_status = #{caseStatus}
</if>
</where>
</select>
<select id="listAcceptPO" parameterType="map" resultMap="reportCaseAcceptPO">
SELECT
case_id,
gmt_create,
creator
FROM
city_report_case_accept
</select>
<select id="listAssignPO" parameterType="map" resultMap="reportCaseAssignPO">
SELECT
case_id,
handle_user_id,
handle_time,
gmt_create,
creator
FROM
city_report_case_assign
</select>
<select id="listHandlePO" parameterType="map" resultMap="reportCaseHandlePO">
SELECT
case_id,
handle_time,
handle_timeout,
is_inspect,
gmt_create,
creator,
gmt_modified,
modifier
FROM
city_report_case_handle
</select>
<select id="listInspectPO" parameterType="map" resultMap="reportCaseInspectPO">
SELECT
case_id,
is_pass,
gmt_create,
creator,
gmt_modified,
modifier
FROM
city_report_case_inspect
</select>
<!-- 案件详情 -->
<select id="getCasePO" parameterType="map" resultMap="casePO">
SELECT
case_id,
area_id,
area_name,
community_id,
community_name,
case_type_id,
case_type_name,
gmt_report,
gmt_accept,
gmt_assign,
handle_end_time_long,
handle_end_time,
gmt_handle,
is_timeout,
gmt_inspect,
is_self,
report_user_id,
assign_user_id,
handle_user_id,
inspect_user_id,
inspect_score,
is_delete,
gmt_delete,
delete_user_id,
total_urge,
total_back,
case_status,
case_source,
is_accept,
is_assign,
is_handle,
is_inspect,
assign_timeout_count
FROM
kpi_case
WHERE
case_id = #{caseId}
</select>
<insert id="saveCase" parameterType="map">
INSERT INTO kpi_case(
case_id,
area_id,
area_name,
community_id,
community_name,
case_type_id,
case_type_name,
case_status,
case_source,
gmt_report,
gmt_accept,
is_accept,
gmt_assign,
is_assign,
assign_timeout_count,
handle_end_time_long,
handle_end_time,
gmt_handle,
is_handle,
is_timeout,
gmt_inspect,
is_inspect,
is_self,
report_user_id,
report_user_name,
assign_user_id,
handle_user_id,
inspect_user_id,
inspect_score,
is_delete,
gmt_delete,
delete_user_id,
total_urge,
total_back
) VALUES(
#{caseId},
#{areaId},
#{areaName},
#{communityId},
#{communityName},
#{caseTypeId},
#{caseTypeName},
#{caseStatus},
#{caseSource},
#{gmtReport},
#{gmtAccept},
#{isAccept},
#{gmtAssign},
#{isAssign},
#{assignTimeoutCount},
#{handleEndTimeLong},
#{handleEndTime},
#{gmtHandle},
#{isHandle},
#{isTimeout},
#{gmtInspect},
#{isInspect},
#{isSelf},
#{reportUserId},
#{reportUserName},
#{assignUserId},
#{handleUserId},
#{inspectUserId},
#{inspectScore},
#{isDelete},
#{gmtDelete},
#{deleteUserId},
#{totalUrge},
#{totalBack}
)
</insert>
<update id="updateCase" parameterType="map">
UPDATE
kpi_case
SET
area_id = #{areaId},
area_name = #{areaName},
community_id = #{communityId},
community_name = #{communityName},
case_type_id = #{caseTypeId},
case_type_name = #{caseTypeName},
gmt_report = #{gmtReport},
gmt_accept = #{gmtAccept},
gmt_assign = #{gmtAssign},
handle_end_time_long = #{handleEndTimeLong},
handle_end_time = #{handleEndTime},
gmt_handle = #{gmtHandle},
is_timeout = #{isTimeout},
gmt_inspect = #{gmtInspect},
is_self = #{isSelf},
report_user_id = #{reportUserId},
report_user_name = #{reportUserName},
assign_user_id = #{assignUserId},
handle_user_id = #{handleUserId},
inspect_user_id = #{inspectUserId},
inspect_score = #{inspectScore},
is_delete = #{isDelete},
gmt_delete = #{gmtDelete},
delete_user_id = #{deleteUserId},
total_urge = #{totalUrge},
total_back = #{totalBack},
case_status = #{caseStatus},
case_source = #{caseSource},
is_accept = #{isAccept},
is_assign = #{isAssign},
is_handle = #{isHandle},
is_inspect = #{isInspect},
assign_timeout_count = #{assignTimeoutCount}
WHERE
case_id = #{caseId}
</update>
<select id="dataCountLevel1" parameterType="map" resultMap="casePO">
SELECT
case_id,
area_id,
area_name,
community_id,
community_name,
case_type_id,
case_type_name,
case_status,
case_source,
gmt_report,
gmt_accept,
is_accept,
gmt_assign,
is_assign,
assign_timeout_count,
handle_end_time_long,
handle_end_time,
gmt_handle,
is_handle,
is_timeout,
gmt_inspect,
is_inspect,
is_self,
report_user_id,
report_user_name,
assign_user_id,
handle_user_id,
inspect_user_id,
inspect_score,
is_delete,
gmt_delete,
delete_user_id,
total_urge,
total_back
FROM
kpi_case
<where>
is_delete = 0
<if test="start != null and start != ''">
AND
gmt_report <![CDATA[ >= ]]> #{start}
</if>
<if test="end != null and end != ''">
AND
gmt_report <![CDATA[ <= ]]> #{end}
</if>
<if test="community != null and community != ''">
AND area_id = #{areaId}
</if>
<if test="creator != null and creator != ''">
AND community_id = #{communityId}
</if>
<if test="bossIds != null and bossIds.size > 0">
AND report_user_id IN
<foreach collection="bossIds" index="index" open="(" separator="," close=")">
#{bossIds[${index}]}
</foreach>
</if>
</where>
</select>
<select id="dataCountReportCase" parameterType="map" resultMap="reportCaseDTO">
SELECT
*
FROM
city_report_case
WHERE
is_delete = 0
<if test="caseStatusOne != null and caseStatusOne !=''">
AND case_status = #{caseStatusOne}
</if>
<if test="caseStatus != null and caseStatus !=''">
AND case_status >= #{caseStatus}
</if>
<if test="exception != null and exception !=''">
AND case_status = '-1'
</if>
<if test="areaId != null and areaId !=''">
AND area_id = #{areaId}
</if>
<if test="communityId != null and communityId !=''">
AND community_id = #{communityId}
</if>
<if test="caseTypeId != null and caseTypeId !=''">
AND case_type_id = #{caseTypeId}
</if>
<if test="startTime != null and startTime != ''">
AND LEFT(gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND LEFT(gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="handleDepartmentId != null and handleDepartmentId != ''">
AND (
report_case_id IN (
SELECT
st1.case_id
FROM
city_report_case_assign st1
WHERE
st1.is_delete = 0
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'
WHERE
sst1.department_id = #{handleDepartmentId}
)
)
)
</if>
</select>
</mapper>

View File

@ -0,0 +1,363 @@
<!doctype html>
<html lang="en">
<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" 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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<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>
<div class="layui-inline">
<select id="userTypeSel" name="userTypeSel" lay-filter="changeUserType">
<option value="网格员">网格员</option>
<option value="专管员">专管员</option>
</select>
</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 type="button" id="refreshData" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-refresh"></i> 更新案件情况
</button>
<button typeof="button" id="backToArea" class="layui-btn layui-btn-sm">返回上级</button>
<button typeof="button" id="exportExcel" class="layui-btn layui-btn-sm">导出本级数据</button>
</div>
<div>
<table class="layui-table">
<colgroup>
<col width="200">
<col width="130">
<col width="130">
<col width="130">
</colgroup>
<thead>
<tr>
<th style="text-align: center;">级别</th>
<th style="text-align: center;">已上报数量</th>
<th style="text-align: center;">已处理数量</th>
<th style="text-align: center;">自处理数量</th>
</tr>
</thead>
<tbody id="areaUserCountBox"></tbody>
<script type="text/html" id="areaUserCountTemplate">
{{# 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"
data-level="{{item.level}}"
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>
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.handleCount}}</a>
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.selfCount}}</a>
</td>
</tr>
{{# } }}
</script>
</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 src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
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 resizeTimeout = null;
var dataLoading = false;
$(document).on('click', '#search', function() {
if(dataLoading){
layer.msg('数据加载中,请稍等...');
return;
}
changeSearchData();
});
function initDateTime(){
// 获取当前年份
var currentYear = new Date().getFullYear();
// 定义今年的开始和结束日期
var startDate = currentYear + '-01-01';
var endDate = currentYear + '-12-31';
laydate.render({
elem: '#start',
type: 'date',
min: startDate, // 设置最小日期为今年开始日期
max: endDate,
});
laydate.render({
elem: '#end',
type: 'date',
min: startDate, // 设置最小日期为今年开始日期
max: endDate,
});
}
initDateTime();
var dataMsg = {
url: '',
dataId: '',
level: 0,
nowLevel: '',
nowDataId: ''
};
$('#left-card-div').height($win.height() - 30);
$('#left-card-div').css('overflow', 'auto');
function initData() {
var start = $('#start').val();
var end = $('#end').val();
var userType = $('#userTypeSel').val();
var url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
listAreaUserCounts(url, 1, '');
}
initData();
function listAreaUserCounts(url, level, searchData, prpeDataId) {
var loadIndex = layer.load(0, {shade: 0.3});
restAjax.get(restAjax.path(url, [level, searchData, prpeDataId]),
{}, null, function (code, data) {
dataMsg.nowLevel = data[0].level;
dataMsg.nowDataId = data[0].dataId;
dataMsg.level = data[0].prpeLevel;
dataMsg.dataId = data[0].prpeDataId;
console.log(dataMsg)
laytpl(document.getElementById('areaUserCountTemplate').innerHTML).render(data, function (html) {
document.getElementById('areaUserCountBox').innerHTML = html;
});
layer.close(loadIndex);
}, function (code, data) {
dialog.msg(data.msg);
});
}
// 绑定点击区域切换事件
$(document).on('click', '.change-area', function () {
var level = $(this).data().level;
level+=1;
var dataId = $(this).data().dataid;
var url = '';
console.log("level==" + level + "-------" + "dataId==" + dataId)
var start = $('#start').val();
var end = $('#end').val();
var userType = $('#userTypeSel').val();
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level > 4) {
return false;
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
});
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();
var userType = $('#userTypeSel').val();
if(level == 1) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level > 4) {
return false;
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
}
// 返回上级
$(document).on('click', '#backToArea', function () {
var level = dataMsg.level;
var dataId = dataMsg.dataId;
var url;
if(level == 1) {
url = 'app/data-external-release/data-counts-bigdata/{level}';
}
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}';
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}';
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}';
}
listAreaUserCounts(url, level, dataId);
});
function backSearchData(start, end) {
var level = 1;
var dataId = dataMsg.dataId;
var url;
console.log(start)
console.log(end)
if(level == 1) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&start=' + start + '&end='+ end;
}
listAreaUserCounts(url, level, dataId);
}
// 导出数据
$(document).on('click', '#exportExcel', function () {
dialog.msg('确定导出吗?', {
time: 0,
btn: [dataMessage.button.yes, dataMessage.button.no],
shade: 0.3,
yes: function (index) {
dialog.close(index);
var level = dataMsg.nowLevel;
var dataId = dataMsg.nowDataId;
var url;
var start = $('#start').val();
var end = $('#end').val();
if(level == 1) {
url = 'app/data-external-release/export-datacount?level={level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'app/data-external-release/export-datacount?level={level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'app/data-external-release/export-datacount?level={level}&areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'app/data-external-release/export-datacount?level={level}&communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end;
}
window.open(restAjax.path(url, [level, dataId, dataMsg.dataId]));
}
});
});
// 事件 - 页面变化
$win.on('resize', function () {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function () {
reloadTable();
}, 500);
});
$(document).on('click', '#refreshData', function() {
dialog.confirm('确定更新吗?时间可能较长,请不要关闭页面!', function(index) {
dialog.close(index);
var loadLayerIndex;
restAjax.get(restAjax.path('app/data-external-release/update-case-bigdata', []), {}, null, function(code, data) {
initData();
}, function(code, data) {
dialog.msg(data.msg);
}, function() {
loadLayerIndex = dialog.msg('正在更新...', {icon: 16, time: 0, shade: 0.3});
}, function() {
dialog.close(loadLayerIndex);
});
});
});
});
</script>
</body>
</html>

View File

@ -0,0 +1,437 @@
<!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('网格员');
initArea()
}
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

@ -0,0 +1,381 @@
<!doctype html>
<html lang="en">
<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" 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">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<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>
<div class="layui-inline">
<select id="userTypeSel" name="userTypeSel" lay-filter="changeUserType">
<option value="网格员">网格员</option>
<option value="专管员">专管员</option>
</select>
</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 type="button" id="refreshData" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-refresh"></i> 更新案件情况
</button>
<button typeof="button" id="backToArea" class="layui-btn layui-btn-sm">返回上级</button>
<!--<button typeof="button" id="exportExcel" class="layui-btn layui-btn-sm">导出本级数据</button>-->
</div>
<div>
<table class="layui-table">
<colgroup>
<col width="200">
<col width="130">
<col width="130">
<col width="130">
</colgroup>
<thead>
<tr>
<th style="text-align: center;">级别</th>
<th style="text-align: center;">已上报数量</th>
<th style="text-align: center;">已处理数量</th>
<th style="text-align: center;">自处理数量</th>
</tr>
</thead>
<tbody id="areaUserCountBox"></tbody>
<script type="text/html" id="areaUserCountTemplate">
{{# 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}}"
data-departmentId="{{item.departmentId}}">{{item.name}}</a>
{{# } }}
{{# if(item.name != '暂无数据'){ }}
<a href="javascript:void(0)"
data-hansubarea="{{item.name}}" class="change-area"
style="color: #0a54a6;text-decoration: underline"
data-level="{{item.level}}"
data-dataId="{{item.dataId}}"
data-prpeLevel="{{item.prpeLevel}}"
data-prpeDataId="{{item.prpeDataId}}"
data-departmentId="{{item.departmentId}}">{{item.name}}</a>
{{# } }}
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.allCount}}</a>
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.handleCount}}</a>
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.selfCount}}</a>
</td>
</tr>
{{# } }}
</script>
</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 src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
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 resizeTimeout = null;
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(){
// 获取当前年份
var currentYear = new Date().getFullYear();
// 定义今年的开始和结束日期
var startDate = currentYear + '-01-01';
var endDate = currentYear + '-12-31';
laydate.render({
elem: '#start',
type: 'date',
min: startDate, // 设置最小日期为今年开始日期
max: endDate,
});
laydate.render({
elem: '#end',
type: 'date',
min: startDate, // 设置最小日期为今年开始日期
max: endDate,
});
}
initDateTime();
var dataMsg = {
url: '',
dataId: '',
level: 0,
nowLevel: '',
nowDataId: '',
prpedataid: '',
departmentId: ''
};
$('#left-card-div').height($win.height() - 30);
$('#left-card-div').css('overflow', 'auto');
function initData() {
var start = $('#start').val();
var end = $('#end').val();
var userType = $('#userTypeSel').val();
var url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
listAreaUserCounts(url, 1, '');
}
initData();
function listAreaUserCounts(url, level, searchData, prpeDataId) {
var loadIndex = layer.load(0, {shade: 0.3});
restAjax.get(restAjax.path(url, [level, searchData, prpeDataId]),
{}, null, function (code, data) {
dataMsg.nowLevel = data[0].level;
dataMsg.nowDataId = data[0].dataId;
dataMsg.level = data[0].prpeLevel;
dataMsg.dataId = data[0].prpeDataId;
dataMsg.prpedataid = data[0].prpeDataId;
dataMsg.departmentId = data[0].departmentId;
console.log(dataMsg)
laytpl(document.getElementById('areaUserCountTemplate').innerHTML).render(data, function (html) {
document.getElementById('areaUserCountBox').innerHTML = html;
});
layer.close(loadIndex);
}, function (code, data) {
dialog.msg(data.msg);
});
}
// 绑定点击区域切换事件
$(document).on('click', '.change-area', function () {
var level = $(this).data().level;
level+=1;
var dataId = $(this).data().dataid;
var url = '';
var prpedataid = $(this).data().prpedataid;
var departmentId = $(this).data().departmentid;
var start = $('#start').val();
var end = $('#end').val();
var userType = $('#userTypeSel').val();
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start='
+ start + '&end='+ end + '&prpedataId=' + prpedataid + '&departmentId=' + departmentId + '&userType=' + userType;
}
if(level > 4) {
return false;
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
});
function changeSearchData() {
// 假设 elem 是你已经获取到的元素引用
let elem = document.querySelector('.change-area');
console.log(elem)
let level = elem.dataset.level;
let dataId = elem.dataset.dataid;
let prpedataid = elem.dataset.prpedataid;
var departmentId = elem.dataset.departmentid;
console.log(level, "------------", dataId)
var url = '';
var start = $('#start').val();
var end = $('#end').val();
var userType = $('#userTypeSel').val();
if(level == 1) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start='
+ start + '&end='+ end + '&prpedataId=' + prpedataid + '&departmentId=' + departmentId + '&userType=' + userType;
}
if(level > 4) {
return false;
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
}
// 返回上级
$(document).on('click', '#backToArea', function () {
var level = dataMsg.level;
var dataId = dataMsg.dataId;
var prpedataid = dataMsg.prpedataid;
var departmentId = dataMsg.departmentId;
var start = $('#start').val();
var end = $('#end').val();
var userType = $('#userTypeSel').val();
var url;
if(level == 1) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end + '&userType=' + userType;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start='
+ start + '&end='+ end + '&prpedataId=' + prpedataid + '&departmentId=' + departmentId + '&userType=' + userType;
}
listAreaUserCounts(url, level, dataId);
});
function backSearchData(start, end) {
var level = 1;
var dataId = dataMsg.dataId;
var url;
console.log(start)
console.log(end)
if(level == 1) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'app/data-external-release/data-counts-bigdata/{level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'app/data-external-release/data-counts-bigdata/{level}?areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'app/data-external-release/data-counts-bigdata/{level}?communityId={communityId}&start=' + start + '&end='+ end;
}
listAreaUserCounts(url, level, dataId);
}
// 导出数据
$(document).on('click', '#exportExcel', function () {
dialog.msg('确定导出吗?', {
time: 0,
btn: [dataMessage.button.yes, dataMessage.button.no],
shade: 0.3,
yes: function (index) {
dialog.close(index);
var level = dataMsg.nowLevel;
var dataId = dataMsg.nowDataId;
var url;
var start = $('#start').val();
var end = $('#end').val();
if(level == 1) {
url = 'app/data-external-release/export-datacount?level={level}?start=' + start + '&end='+ end;
}
if(level == 2) {
url = 'app/data-external-release/export-datacount?level={level}?start=' + start + '&end='+ end;
}
if(level == 3) {
url = 'app/data-external-release/export-datacount?level={level}&areaId={areaId}&start=' + start + '&end='+ end;
}
if(level == 4) {
url = 'app/data-external-release/export-datacount?level={level}&communityId={communityId}&prpeDataId={prpeDataId}&start=' + start + '&end='+ end;
}
window.open(restAjax.path(url, [level, dataId, dataMsg.dataId]));
}
});
});
// 事件 - 页面变化
$win.on('resize', function () {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function () {
}, 500);
});
$(document).on('click', '#refreshData', function() {
dialog.confirm('确定更新吗?时间可能较长,请不要关闭页面!', function(index) {
dialog.close(index);
var loadLayerIndex;
restAjax.get(restAjax.path('app/data-external-release/update-case-bigdata', []), {}, null, function(code, data) {
initData();
}, function(code, data) {
dialog.msg(data.msg);
}, function() {
loadLayerIndex = dialog.msg('正在更新...', {icon: 16, time: 0, shade: 0.3});
}, function() {
dialog.close(loadLayerIndex);
});
});
});
});
</script>
</body>
</html>

View File

@ -15,7 +15,23 @@
<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 type="button" id="refreshData" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-refresh"></i> 更新案件情况
</button>
<button typeof="button" id="backToArea" class="layui-btn layui-btn-sm">返回上级</button>
<button typeof="button" id="exportExcel" class="layui-btn layui-btn-sm">导出本级数据</button>
</div>
@ -40,13 +56,27 @@
{{# 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}}"
data-departmentId="{{item.departmentId}}">{{item.name}}</a>
{{# } }}
{{# if(item.name != '暂无数据'){ }}
<a href="javascript:void(0)"
data-hansubarea="{{item.name}}" class="change-area"
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>
data-prpeDataId="{{item.prpeDataId}}"
data-departmentId="{{item.departmentId}}">{{item.name}}</a>
{{# } }}
</td>
<td style="text-align: center;">
<a href="javascript:void(0)">{{item.allCount}}</a>
@ -84,21 +114,48 @@
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: ''
nowDataId: '',
prpedataid: '',
departmentId: ''
};
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();
@ -111,6 +168,8 @@
dataMsg.nowDataId = data[0].dataId;
dataMsg.level = data[0].prpeLevel;
dataMsg.dataId = data[0].prpeDataId;
dataMsg.prpedataid = data[0].prpeDataId;
dataMsg.departmentId = data[0].departmentId;
console.log(dataMsg)
laytpl(document.getElementById('areaUserCountTemplate').innerHTML).render(data, function (html) {
document.getElementById('areaUserCountBox').innerHTML = html;
@ -127,14 +186,22 @@
level+=1;
var dataId = $(this).data().dataid;
var url = '';
var prpedataid = $(this).data().prpedataid;
var departmentId = $(this).data().departmentid;
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 + '&prpedataId=' + prpedataid + '&departmentId=' + departmentId;
}
if(level > 4) {
@ -142,31 +209,94 @@
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
reloadTable();
});
function changeSearchData() {
// 假设 elem 是你已经获取到的元素引用
let elem = document.querySelector('.change-area');
console.log(elem)
let level = elem.dataset.level;
let dataId = elem.dataset.dataid;
let prpedataid = elem.dataset.prpedataid;
var departmentId = elem.dataset.departmentid;
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 + '&prpedataId=' + prpedataid + '&departmentId=' + departmentId;
}
if(level > 4) {
return false;
}
listAreaUserCounts(url, level, dataId, dataMsg.dataId);
}
// 返回上级
$(document).on('click', '#backToArea', function () {
var level = dataMsg.level;
var dataId = dataMsg.dataId;
var prpedataid = dataMsg.prpedataid;
var departmentId = dataMsg.departmentId;
var start = $('#start').val();
var end = $('#end').val();
var url;
if(level == 1) {
url = 'api/reportcase/data-counts/{level}';
url = 'api/reportcase/data-counts/{level}?start=' + start + '&end='+ end;
}
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}';
url = 'api/reportcase/data-counts/{level}?communityId={communityId}&prpeDataId={prpeDataId}&start='
+ start + '&end='+ end + '&prpedataId=' + prpedataid + '&departmentId=' + departmentId;
}
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,47 +309,49 @@
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);
resizeTimeout = setTimeout(function () {
reloadTable();
}, 500);
});
$(document).on('click', '#refreshData', function() {
top.dialog.confirm('确定更新吗?时间可能较长,请不要关闭页面!', function(index) {
top.dialog.close(index);
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/reportcase/update-case', []), {}, null, function(code, data) {
initData();
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg('正在更新...', {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
});
});
</script>
</body>

View File

@ -239,9 +239,7 @@
//初始化地区
function initArea(){
top.restAjax.get('api/dict/listdict/9d179f05-3ea0-48f7-853c-d3b7124b791c', {
isHide: 0
}, null, function(code, data) {
top.restAjax.get('api/dict/listdict/9d179f05-3ea0-48f7-853c-d3b7124b791c', {}, null, function(code, data) {
laytpl(document.getElementById('areaSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('areaSelectTemplateBox').innerHTML = html;
});

View File

@ -127,6 +127,7 @@
},
callback: {
onClick: function(event, treeId, treeNode) {
console.log(treeNode)
initUsers(treeNode.pId,treeNode.id);
return false;
}