From 610aad4f88eb829d479bdc8fce9307281edfe77d Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Tue, 29 Aug 2023 15:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E7=9A=84=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=9F=A5=E7=9C=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/apis/kpi/KpiController.java | 9 +- .../cm/bigdata/dao2/kpi/IReportCaseDao.java | 2 + .../pojo/dtos/kpi/ReportCaseLogDTO.java | 159 ++++++++++++++++++ .../service/kpi/IReportCaseService.java | 4 + .../kpi/impl/ReportCaseServiceImpl.java | 7 +- .../kpi/task/sub/KpiKhxzWgyCRunnable.java | 13 +- .../kpi/task/sub/KpiKhxzWgyCUserRunnable.java | 14 +- .../task/sub/KpiKhxzWgyEGIKRTRunnable.java | 18 +- .../sub/KpiKhxzWgyEGIKRTUserRunnable.java | 19 ++- .../com/cm/bigdata/utils/KpiScoreUtil.java | 10 -- .../db2-mapper/kpi/report-case-mapper.xml | 39 +++++ .../static/route/kpi/community-count.html | 8 +- .../route/kpi/detail/user-case-log.html | 119 +++++++++++++ .../static/route/kpi/detail/user-case.html | 15 +- 14 files changed, 394 insertions(+), 42 deletions(-) create mode 100644 src/main/java/com/cm/bigdata/pojo/dtos/kpi/ReportCaseLogDTO.java create mode 100644 src/main/resources/static/route/kpi/detail/user-case-log.html diff --git a/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiController.java b/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiController.java index f975727..bfa1388 100644 --- a/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiController.java +++ b/src/main/java/com/cm/bigdata/controller/apis/kpi/KpiController.java @@ -2,10 +2,12 @@ package com.cm.bigdata.controller.apis.kpi; import com.cm.bigdata.pojo.dtos.grid.GridDTO; import com.cm.bigdata.pojo.dtos.kpi.*; +import com.cm.bigdata.pojo.dtos.kpi.ReportCaseLogDTO; import com.cm.bigdata.pojo.vos.kpi.CaseListPage; import com.cm.bigdata.service.kpi.*; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; +import com.cm.common.exception.SearchException; import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; @@ -239,7 +241,12 @@ public class KpiController extends AbstractController { return reportCaseService.listPage(caseListPage); } - + @GetMapping("list-report-case-log/{reportCaseId}") + public List listReportCaseLog(@PathVariable("reportCaseId") String reportCaseId) throws SearchException { + Map params = requestParams(); + params.put("caseId", reportCaseId); + return reportCaseService.listReportCaseLog(params); + } @GetMapping("list-n-person-case-day-count/user-id/{userId}") public List listNPersonCaseDayCountByUserId( diff --git a/src/main/java/com/cm/bigdata/dao2/kpi/IReportCaseDao.java b/src/main/java/com/cm/bigdata/dao2/kpi/IReportCaseDao.java index 8b00c85..d4127a5 100644 --- a/src/main/java/com/cm/bigdata/dao2/kpi/IReportCaseDao.java +++ b/src/main/java/com/cm/bigdata/dao2/kpi/IReportCaseDao.java @@ -1,6 +1,7 @@ package com.cm.bigdata.dao2.kpi; import com.cm.bigdata.pojo.dtos.kpi.ReportCaseDTO; +import com.cm.bigdata.pojo.dtos.kpi.ReportCaseLogDTO; import com.cm.bigdata.pojo.pos.kpi.*; import org.springframework.stereotype.Repository; @@ -21,4 +22,5 @@ public interface IReportCaseDao { List list(Map params); + List listReportCaseLog(Map params); } diff --git a/src/main/java/com/cm/bigdata/pojo/dtos/kpi/ReportCaseLogDTO.java b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/ReportCaseLogDTO.java new file mode 100644 index 0000000..0d60c5d --- /dev/null +++ b/src/main/java/com/cm/bigdata/pojo/dtos/kpi/ReportCaseLogDTO.java @@ -0,0 +1,159 @@ +package com.cm.bigdata.pojo.dtos.kpi; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * When you feel like quitting. Think about why you started + * 当你想要放弃的时候,想想当初你为何开始 + * + * @ClassName: ReportCaseLogDTO + * @Description: 案件流程日志 + * @Author: WangGeng + * @Date: 2019-08-13 15:36 + * @Version: 1.0 + **/ +@ApiModel +public class ReportCaseLogDTO { + + @ApiModelProperty(name = "caseId", value = "案件ID") + private String caseId; + @ApiModelProperty(name = "optionType", value = "操作类型") + private String optionType; + @ApiModelProperty(name = "userId", value = "用户ID") + private String userId; + @ApiModelProperty(name = "userName", value = "用户名称") + private String userName; + @ApiModelProperty(name = "userPhone", value = "用户电话") + private String userPhone; + @ApiModelProperty(name = "userOpinion", value = "用户意见") + private String userOpinion; + @ApiModelProperty(name = "userPhotos", value = "用户图片") + private String userPhotos; + @ApiModelProperty(name = "userAudio", value = "用户音频") + private String userAudio; + @ApiModelProperty(name = "handleUserId", value = "处理人ID") + private String handleUserId; + @ApiModelProperty(name = "handleUserName", value = "处理人名称") + private String handleUserName; + @ApiModelProperty(name = "handleTime", value = "处理时长") + private Double handleTime; + @ApiModelProperty(name = "handleStatus", value = "处理状态,成功0,失败1") + private String handleStatus; + @ApiModelProperty(name = "grade", value = "满意度评分") + private String grade; + @ApiModelProperty(name = "gmtCreate", value = "时间") + private String gmtCreate; + + public String getCaseId() { + return caseId == null ? "" : caseId.trim(); + } + + public void setCaseId(String caseId) { + this.caseId = caseId; + } + + public String getOptionType() { + return optionType == null ? "" : optionType.trim(); + } + + public void setOptionType(String optionType) { + this.optionType = optionType; + } + + public String getUserId() { + return userId == null ? "" : userId.trim(); + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getUserName() { + return userName == null ? "" : userName.trim(); + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getUserPhone() { + return userPhone == null ? "" : userPhone.trim(); + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public String getUserOpinion() { + return userOpinion == null ? "" : userOpinion.trim(); + } + + public void setUserOpinion(String userOpinion) { + this.userOpinion = userOpinion; + } + + public String getUserPhotos() { + return userPhotos == null ? "" : userPhotos.trim(); + } + + public void setUserPhotos(String userPhotos) { + this.userPhotos = userPhotos; + } + + public String getUserAudio() { + return userAudio == null ? "" : userAudio.trim(); + } + + public void setUserAudio(String userAudio) { + this.userAudio = userAudio; + } + + public String getHandleUserId() { + return handleUserId == null ? "" : handleUserId.trim(); + } + + public void setHandleUserId(String handleUserId) { + this.handleUserId = handleUserId; + } + + public String getHandleUserName() { + return handleUserName == null ? "" : handleUserName.trim(); + } + + public void setHandleUserName(String handleUserName) { + this.handleUserName = handleUserName; + } + + public Double getHandleTime() { + return handleTime; + } + + public void setHandleTime(Double handleTime) { + this.handleTime = handleTime; + } + + public String getHandleStatus() { + return handleStatus == null ? "" : handleStatus.trim(); + } + + public void setHandleStatus(String handleStatus) { + this.handleStatus = handleStatus; + } + + public String getGrade() { + return grade == null ? "" : grade; + } + + public void setGrade(String grade) { + this.grade = grade; + } + + public String getGmtCreate() { + return gmtCreate == null ? "" : gmtCreate.trim(); + } + + public void setGmtCreate(String gmtCreate) { + this.gmtCreate = gmtCreate; + } +} diff --git a/src/main/java/com/cm/bigdata/service/kpi/IReportCaseService.java b/src/main/java/com/cm/bigdata/service/kpi/IReportCaseService.java index 75e62fe..bdf398f 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/IReportCaseService.java +++ b/src/main/java/com/cm/bigdata/service/kpi/IReportCaseService.java @@ -1,6 +1,7 @@ package com.cm.bigdata.service.kpi; import com.cm.bigdata.pojo.dtos.kpi.ReportCaseDTO; +import com.cm.bigdata.pojo.dtos.kpi.ReportCaseLogDTO; import com.cm.bigdata.pojo.pos.kpi.*; import com.cm.bigdata.pojo.vos.kpi.CaseListPage; import com.cm.common.result.SuccessResultList; @@ -20,4 +21,7 @@ public interface IReportCaseService { List listInspectPO(Map params); SuccessResultList> listPage(CaseListPage caseListPage); + + List listReportCaseLog(Map params); + } diff --git a/src/main/java/com/cm/bigdata/service/kpi/impl/ReportCaseServiceImpl.java b/src/main/java/com/cm/bigdata/service/kpi/impl/ReportCaseServiceImpl.java index ecd58f4..cb755ee 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/impl/ReportCaseServiceImpl.java +++ b/src/main/java/com/cm/bigdata/service/kpi/impl/ReportCaseServiceImpl.java @@ -2,7 +2,7 @@ package com.cm.bigdata.service.kpi.impl; import com.cm.bigdata.dao2.kpi.IReportCaseDao; import com.cm.bigdata.pojo.dtos.kpi.ReportCaseDTO; -import com.cm.bigdata.pojo.dtos.kpi.UserSignoutDTO; +import com.cm.bigdata.pojo.dtos.kpi.ReportCaseLogDTO; import com.cm.bigdata.pojo.pos.kpi.*; import com.cm.bigdata.pojo.vos.kpi.CaseListPage; import com.cm.bigdata.service.kpi.IReportCaseService; @@ -70,4 +70,9 @@ public class ReportCaseServiceImpl implements IReportCaseService { PageInfo pageInfo = new PageInfo<>(reportCaseDTOS); return new SuccessResultList<>(reportCaseDTOS, pageInfo.getPageNum(), pageInfo.getTotal()); } + + @Override + public List listReportCaseLog(Map params) { + return reportCaseDao.listReportCaseLog(params); + } } diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCRunnable.java b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCRunnable.java index 19a9506..1769b5c 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCRunnable.java +++ b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCRunnable.java @@ -44,11 +44,18 @@ public class KpiKhxzWgyCRunnable implements Runnable { for (CommunityBossDayCountPO communityBossDayCountPO : communityBossDayCountPOS) { // 如果是假期不记录 int isHoliday = communityBossDayCountPO.getIsHoliday(); - if (isHoliday == 1) { + double dayScore = communityBossDayCountPO.getDayScore(); + // 如果是假期,并且分数就算工作日 + if (isHoliday == 1 && dayScore > 0D) { + totalDayScore += communityBossDayCountPO.getDayScore(); + workDay++; continue; } - totalDayScore += communityBossDayCountPO.getDayScore(); - workDay++; + // 如果不是假期,则标记为工作日 + if (isHoliday == 0) { + totalDayScore += communityBossDayCountPO.getDayScore(); + workDay++; + } } double totalScore = workDay == 0 ? 0D : totalDayScore / workDay; // 保存总分 diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCUserRunnable.java b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCUserRunnable.java index 65ee08a..b648275 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCUserRunnable.java +++ b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyCUserRunnable.java @@ -41,13 +41,19 @@ public class KpiKhxzWgyCUserRunnable implements Runnable { int workDay = 0; double totalDayScore = 0D; for (CommunityBossDayCountPO communityBossDayCountPO : communityBossDayCountPOS) { - // 如果是假期不记录 int isHoliday = communityBossDayCountPO.getIsHoliday(); - if (isHoliday == 1) { + double dayScore = communityBossDayCountPO.getDayScore(); + // 如果是假期,并且分数就算工作日 + if (isHoliday == 1 && dayScore > 0D) { + totalDayScore += communityBossDayCountPO.getDayScore(); + workDay++; continue; } - totalDayScore += communityBossDayCountPO.getDayScore(); - workDay++; + // 如果不是假期,则标记为工作日 + if (isHoliday == 0) { + totalDayScore += communityBossDayCountPO.getDayScore(); + workDay++; + } } double totalScore = workDay == 0 ? 0D : totalDayScore / workDay; // 保存总分 diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTRunnable.java b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTRunnable.java index b34f7ea..401f937 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTRunnable.java +++ b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTRunnable.java @@ -117,15 +117,21 @@ public class KpiKhxzWgyEGIKRTRunnable implements Runnable { exceedCount++; continue; } + // 处理时间 + String gmtHandle = casePO.getGmtHandle(); + if (StringUtils.isBlank(gmtHandle)) { + continue; + } // 检查过了,算多报 String gmtInspect = casePO.getGmtInspect(); if (StringUtils.isBlank(gmtInspect)) { continue; } - // 检查时间复合规定 - if (KpiUtil.isDateBetween(gmtInspect.substring(0, 10), startTime, endTime)) { - exceedCount++; + // 处理时间和检查时间超过24小时 + if (!KpiUtil.isdateTimeIn24Hours(gmtHandle, gmtInspect)) { + inspectTimeoutCount++; } + exceedCount++; } } for (List shouldReportDayWeek : shouldReportDayWeeks) { @@ -158,12 +164,10 @@ public class KpiKhxzWgyEGIKRTRunnable implements Runnable { continue; } // 处理时间和检查时间超过24小时 - if (KpiUtil.isdateTimeIn24Hours(gmtHandle, gmtInspect)) { + if (!KpiUtil.isdateTimeIn24Hours(gmtHandle, gmtInspect)) { inspectTimeoutCount++; } - if (KpiUtil.isDateBetween(gmtInspect.substring(0, 10), startTime, endTime)) { - realityCount++; - } + realityCount++; } // 每周上报数量由网格数量决定 weekReportCount += Math.min(gridCount, realityCount); diff --git a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTUserRunnable.java b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTUserRunnable.java index 58c3e4c..a46f593 100644 --- a/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTUserRunnable.java +++ b/src/main/java/com/cm/bigdata/service/kpi/task/sub/KpiKhxzWgyEGIKRTUserRunnable.java @@ -115,15 +115,22 @@ public class KpiKhxzWgyEGIKRTUserRunnable implements Runnable { exceedCount++; continue; } + // 处理时间 + String gmtHandle = casePO.getGmtHandle(); + if (StringUtils.isBlank(gmtHandle)) { + continue; + } // 检查过了,算多报 String gmtInspect = casePO.getGmtInspect(); if (StringUtils.isBlank(gmtInspect)) { continue; } - // 检查时间复合规定 - if (KpiUtil.isDateBetween(gmtInspect.substring(0, 10), startTime, endTime)) { - exceedCount++; + // 处理时间和检查时间超过24小时 + if (!KpiUtil.isdateTimeIn24Hours(gmtHandle, gmtInspect)) { + inspectTimeoutCount++; } + // 检查时间复合规定 + exceedCount++; } } for (List shouldReportDayWeek : shouldReportDayWeeks) { @@ -156,12 +163,10 @@ public class KpiKhxzWgyEGIKRTUserRunnable implements Runnable { continue; } // 处理时间和检查时间超过24小时 - if (KpiUtil.isdateTimeIn24Hours(gmtHandle, gmtInspect)) { + if (!KpiUtil.isdateTimeIn24Hours(gmtHandle, gmtInspect)) { inspectTimeoutCount++; } - if (KpiUtil.isDateBetween(gmtInspect.substring(0, 10), startTime, endTime)) { - realityCount++; - } + realityCount++; } // 每周上报数量由网格数量决定 weekReportCount += Math.min(gridCount, realityCount); diff --git a/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java b/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java index c8ee7c6..3dbbd32 100644 --- a/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java +++ b/src/main/java/com/cm/bigdata/utils/KpiScoreUtil.java @@ -13,9 +13,6 @@ public class KpiScoreUtil { public static double getWgyDayScore(int isSignin, int isSigninLate, int isSignout, int isSignoutEarly, double workDistance, int isLeave, int isLeaveSelf, int isLeaveSelfOverLimitInQuarter, int isHoliday) { - if (isHoliday == 1) { - return 0; - } double signinScore = 0D; double signoutScore = 0D; double distanceScore = 0D; @@ -47,9 +44,6 @@ public class KpiScoreUtil { } public static double getDdyDayScore(int isSignin, int isSigninLate, int isSignout, int isSignoutEarly, int isHoliday) { - if (isHoliday == 1) { - return 0; - } double signinScore = 0D; double signoutScore = 0D; if (isSignin == 1) { @@ -62,9 +56,6 @@ public class KpiScoreUtil { } public static double getZgyDayScore(int isSignin, int isSigninLate, int isSignout, int isSignoutEarly, double workDistance, int isHoliday) { - if (isHoliday == 1) { - return 0; - } double signinScore = 0D; double signoutScore = 0D; double distanceScore = 0D; @@ -81,5 +72,4 @@ public class KpiScoreUtil { return signinScore + signoutScore + distanceScore; } - } diff --git a/src/main/resources/mybatis/db2-mapper/kpi/report-case-mapper.xml b/src/main/resources/mybatis/db2-mapper/kpi/report-case-mapper.xml index c8ea8ab..5339a95 100644 --- a/src/main/resources/mybatis/db2-mapper/kpi/report-case-mapper.xml +++ b/src/main/resources/mybatis/db2-mapper/kpi/report-case-mapper.xml @@ -85,6 +85,22 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/kpi/community-count.html b/src/main/resources/static/route/kpi/community-count.html index 7ad6a5e..f9a9f05 100644 --- a/src/main/resources/static/route/kpi/community-count.html +++ b/src/main/resources/static/route/kpi/community-count.html @@ -221,7 +221,7 @@ var event = obj.event; if(event === 'caseEvent') { top.dialog.open({ - title: `${data.userName} 案件总数`, + title: `${data.communityName} 案件总数`, url: top.restAjax.path('route/kpi/detail/user-case.html?areaId={areaId}&communityId={communityId}&startTime={startTime}&endTime={endTime}', [data.areaId, data.communityId, $('#startTime').val(), $('#endTime').val()]), width: '80%', height: '80%', @@ -229,7 +229,7 @@ }) } else if(event === 'caseAcceptEvent') { top.dialog.open({ - title: `${data.userName} 案件总数`, + title: `${data.communityName} 案件总数`, url: top.restAjax.path('route/kpi/detail/user-case.html?areaId={areaId}&communityId={communityId}&isAccept=1&startTime={startTime}&endTime={endTime}', [data.areaId, data.communityId, $('#startTime').val(), $('#endTime').val()]), width: '80%', height: '80%', @@ -237,7 +237,7 @@ }) } else if(event === 'caseHandleEvent') { top.dialog.open({ - title: `${data.userName} 案件总数`, + title: `${data.communityName} 案件总数`, url: top.restAjax.path('route/kpi/detail/user-case.html?areaId={areaId}&communityId={communityId}&isHandle=1&startTime={startTime}&endTime={endTime}', [data.areaId, data.communityId, $('#startTime').val(), $('#endTime').val()]), width: '80%', height: '80%', @@ -245,7 +245,7 @@ }) } else if(event === 'caseInspectEvent') { top.dialog.open({ - title: `${data.userName} 案件总数`, + title: `${data.communityName} 案件总数`, url: top.restAjax.path('route/kpi/detail/user-case.html?areaId={areaId}&communityId={communityId}&isInspect=1&startTime={startTime}&endTime={endTime}', [data.areaId, data.communityId, $('#startTime').val(), $('#endTime').val()]), width: '80%', height: '80%', diff --git a/src/main/resources/static/route/kpi/detail/user-case-log.html b/src/main/resources/static/route/kpi/detail/user-case-log.html new file mode 100644 index 0000000..5e31253 --- /dev/null +++ b/src/main/resources/static/route/kpi/detail/user-case-log.html @@ -0,0 +1,119 @@ + + + + + + + + + + + + +
+
+
    +
  • + +
    +

    {{caseLog.gmtCreate}}

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    操作类型{{caseLog.optionType}}
    操作人员{{caseLog.userName}}手机号码{{caseLog.userPhone}}
    处理人员{{caseLog.handleUserName}}处理时限{{caseLog.handleTime}} 天
    处理状态 + [处理成功] + [处理失败] +
    操作说明{{caseLog.userOpinion}}
    说明图片 +
    + + + + + +
    +
    +
    +
    +
  • +
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/kpi/detail/user-case.html b/src/main/resources/static/route/kpi/detail/user-case.html index b340641..4c8de81 100644 --- a/src/main/resources/static/route/kpi/detail/user-case.html +++ b/src/main/resources/static/route/kpi/detail/user-case.html @@ -1,5 +1,3 @@ - - @@ -139,7 +137,7 @@ '
所在地区'+ row.areaName +'
'+ '
所在社区'+ row.communityName +'
'+ '
案件类型'+ row.caseTypeName +'
'+ - ''+ + '
操作
'+ '' return value; } @@ -263,8 +261,15 @@ width: '800px', height: '80%', onClose: function() {} - }) - console.log(data); + }); + } else if(event === 'logEvent') { + top.dialog.open({ + title: '案件日志', + url: top.restAjax.path('route/kpi/detail/user-case-log.html?reportCaseId={reportCaseId}', [data.reportCaseId]), + width: '800px', + height: '80%', + onClose: function() {} + }); } }) })