处理绩效考核的新问题

This commit is contained in:
TS-QD1 2023-07-26 18:30:13 +08:00
parent 9596a2b851
commit 188629696d
11 changed files with 144 additions and 85 deletions

View File

@ -1,7 +1,6 @@
package com.cm.bigdata.dao.kpi;
import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzDdyDTO;
import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzZnbmDTO;
import org.springframework.stereotype.Repository;
import java.util.List;
@ -18,7 +17,7 @@ public interface IKpiKhxzDdyDao {
void updateC(Map<String, Object> updateParams);
void updateEF(Map<String, Object> updateParams);
void updateEFN(Map<String, Object> updateParams);
List<KpiKhxzDdyDTO> list(Map<String, Object> params);

View File

@ -78,24 +78,31 @@ public class KpiKhxzDdyDTO implements Serializable {
@JsonProperty("D")
private Double d;
/**
* 基础分
*/
@ApiModelProperty("基础分")
@ExcelProperty(value = {"网格案件调度情况", "处理量"}, index = 4)
@JsonProperty("N")
private Double n;
/**
* 案件调度数量
*/
@ApiModelProperty("案件调度数量")
@ExcelProperty(value = {"网格案件调度情况", "案件调度", "数量"}, index = 4)
@ExcelProperty(value = {"网格案件调度情况", "案件调度", "数量"}, index = 5)
@JsonProperty("E")
private Integer e;
/**
* 案件调度扣分
*/
@ApiModelProperty("案件调度扣分")
@ExcelProperty(value = {"网格案件调度情况", "案件调度", "扣分"}, index = 5)
@ExcelProperty(value = {"网格案件调度情况", "案件调度", "扣分"}, index = 6)
@JsonProperty("F")
private Double f;
/**
* 应调度却未及时调度
*/
@ApiModelProperty("应调度却未及时调度")
@ExcelProperty(value = {"网格案件调度情况", "案件调度过程质量", "应调度却未及时调度"}, index = 6)
@ExcelProperty(value = {"网格案件调度情况", "案件调度过程质量", "应调度却未及时调度"}, index = 7)
@JsonProperty("G")
private Double g;
/**
@ -110,7 +117,7 @@ public class KpiKhxzDdyDTO implements Serializable {
* 未及时调度案件造成严重影响
*/
@ApiModelProperty("未及时调度案件造成严重影响")
@ExcelProperty(value = {"网格案件调度情况", "案件调度过程质量", "未及时调度案件造成严重影响"}, index = 7)
@ExcelProperty(value = {"网格案件调度情况", "案件调度过程质量", "未及时调度案件造成严重影响"}, index = 8)
@JsonProperty("H")
private Double h;
/**
@ -125,7 +132,7 @@ public class KpiKhxzDdyDTO implements Serializable {
* 其它情况
*/
@ApiModelProperty("其它情况")
@ExcelProperty(value = {"网格案件调度情况", "案件调度过程质量", "其它情况"}, index = 8)
@ExcelProperty(value = {"网格案件调度情况", "案件调度过程质量", "其它情况"}, index = 9)
@JsonProperty("I")
private Double i;
/**
@ -140,7 +147,7 @@ public class KpiKhxzDdyDTO implements Serializable {
* 组织评价
*/
@ApiModelProperty("组织评价")
@ExcelProperty(value = {"其他工作考核", "组织评价"}, index = 9)
@ExcelProperty(value = {"其他工作考核", "组织评价"}, index = 10)
@JsonProperty("J")
private Double j;
/**
@ -155,21 +162,21 @@ public class KpiKhxzDdyDTO implements Serializable {
* 总得分
*/
@ApiModelProperty("总得分")
@ExcelProperty(value = {"总得分"}, index = 10)
@ExcelProperty(value = {"总得分"}, index = 11)
@JsonProperty("K")
private Double k;
/**
* 应发绩效工资
*/
@ApiModelProperty("应发绩效工资")
@ExcelProperty(value = {"应发绩效工资"}, index = 11)
@ExcelProperty(value = {"应发绩效工资"}, index = 12)
@JsonProperty("L")
private Double l;
/**
* 实发绩效工资
*/
@ApiModelProperty("实发绩效工资")
@ExcelProperty(value = {"实发绩效工资"}, index = 12)
@ExcelProperty(value = {"实发绩效工资"}, index = 13)
@JsonProperty("M")
private Double m;
/**
@ -257,6 +264,14 @@ public class KpiKhxzDdyDTO implements Serializable {
this.d = d;
}
public Double getN() {
return n;
}
public void setN(Double n) {
this.n = n;
}
public Integer getE() {
return e;
}

View File

@ -59,7 +59,7 @@ public class KpiKhxzWgyDTO implements Serializable {
/**
* 姓名
*/
@ExcelProperty(value = {"姓名"}, index = 1)
@ExcelProperty(value = {"姓名(网格数)"}, index = 1)
@JsonProperty("B")
private String b;
/**
@ -314,9 +314,9 @@ public class KpiKhxzWgyDTO implements Serializable {
/**
* 应发绩效工资
*/
@ExcelProperty(value = {"应发绩效工资"}, index = 31)
@ExcelProperty(value = {"应发(浮动)绩效工资"}, index = 31)
@JsonProperty("AF")
private Double aF;
private String aF;
/**
* 实发绩效工资
*/
@ -764,11 +764,11 @@ public class KpiKhxzWgyDTO implements Serializable {
this.aE = aE;
}
public Double getaF() {
public String getaF() {
return aF;
}
public void setaF(Double aF) {
public void setaF(String aF) {
this.aF = aF;
}

View File

@ -176,6 +176,17 @@ public class KpiKhxzServiceImpl extends AbstractService implements IKpiKhxzServi
@Override
public void exportWgy(HttpServletResponse httpServletResponse, Map<String, Object> queryMap) throws IOException {
List<KpiKhxzWgyDTO> wgys = listWgy(queryMap);
for (int i = 0; i < wgys.size(); i++) {
KpiKhxzWgyDTO kpiKhxzWgyDTO = wgys.get(i);
kpiKhxzWgyDTO.setA(i + 1);
kpiKhxzWgyDTO.setB(kpiKhxzWgyDTO.getB() + "(" + kpiKhxzWgyDTO.getGridCount() + ")");
Double score = kpiKhxzWgyDTO.getaE();
if (score <= 100 && score >= 85) {
kpiKhxzWgyDTO.setaF(333 * kpiKhxzWgyDTO.getGridCount() + "(" + 500 * kpiKhxzWgyDTO.getGridCount() + ")");
} else {
kpiKhxzWgyDTO.setaF(333 * kpiKhxzWgyDTO.getGridCount() + "(0)");
}
}
ExcelExportUtil.simple(httpServletResponse, "网格员考核细则", wgys, KpiKhxzWgyDTO.class);
}

View File

@ -331,17 +331,18 @@ public class KpiServiceImpl implements IKpiService {
String handleEndTime = assignDateTime.plusHours((int) (reportCaseAssignPO.getHandleTime() * 24)).toString(DATE_TIME_FORMATTER);
params.put("handleEndTime", handleEndTime);
// 如果是自处理处理人为上报人
if (StringUtils.equals(reportCasePO.getIsSelf(), "1")) {
params.put("handleUserId", reportCasePO.getCreator());
} else {
params.put("handleUserId", reportCaseAssignPO.getHandleUserId());
}
// if (StringUtils.equals(reportCasePO.getIsSelf(), "1")) {
// params.put("handleUserId", reportCasePO.getCreator());
// } else {
// params.put("handleUserId", reportCaseAssignPO.getHandleUserId());
// }
break;
}
}
// 案件处理
for (ReportCaseHandlePO reportCaseHandlePO : reportCaseHandlePOS) {
if (StringUtils.equals(reportCasePO.getReportCaseId(), reportCaseHandlePO.getCaseId())) {
params.put("handleUserId", reportCaseHandlePO.getCreator());
params.put("gmtHandle", reportCaseHandlePO.getGmtModified());
params.put("isTimeout", reportCaseHandlePO.getHandleTimeout());
break;

View File

@ -6,7 +6,7 @@ import com.cm.bigdata.monitor.KpiUpdateMonitor;
import com.cm.bigdata.pojo.pos.kpi.UserPO;
import com.cm.bigdata.service.kpi.IUserService;
import com.cm.bigdata.service.kpi.task.sub.KpiKhxzDdyCRunnable;
import com.cm.bigdata.service.kpi.task.sub.KpiKhxzDdyEFRunnable;
import com.cm.bigdata.service.kpi.task.sub.KpiKhxzDdyEFNRunnable;
import com.cm.bigdata.utils.KpiUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -39,7 +39,7 @@ public class KpiKhxzDdyTask {
return;
}
executorService.execute(new KpiKhxzDdyCRunnable(kpiKhxzDdyDao, kpiDao, khYear, khMonth, userIds));
executorService.execute(new KpiKhxzDdyEFRunnable(kpiKhxzDdyDao, kpiDao, khYear, khMonth, userIds));
executorService.execute(new KpiKhxzDdyEFNRunnable(kpiKhxzDdyDao, kpiDao, khYear, khMonth, userIds));
}
private void deleteBase(int khYear, int khMonth) {

View File

@ -0,0 +1,74 @@
package com.cm.bigdata.service.kpi.task.sub;
import com.cm.bigdata.dao.kpi.IKpiDao;
import com.cm.bigdata.dao.kpi.IKpiKhxzDdyDao;
import com.cm.bigdata.monitor.KpiUpdateMonitor;
import com.cm.bigdata.pojo.pos.kpi.CasePO;
import com.cm.common.constants.ISystemConstant;
import org.joda.time.Hours;
import org.joda.time.LocalDateTime;
import org.joda.time.format.DateTimeFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class KpiKhxzDdyEFNRunnable implements Runnable {
private IKpiKhxzDdyDao kpiKhxzDdyDao;
private IKpiDao kpiDao;
private int khYear;
private int khMonth;
private List<String> userIds;
public KpiKhxzDdyEFNRunnable(IKpiKhxzDdyDao kpiKhxzDdyDao, IKpiDao kpiDao, int khYear, int khMonth, List<String> userIds) {
this.kpiKhxzDdyDao = kpiKhxzDdyDao;
this.kpiDao = kpiDao;
this.khYear = khYear;
this.khMonth = khMonth;
this.userIds = userIds;
}
@Override
public void run() {
Map<String, Object> params = new HashMap<>();
params.put("assignYearMonth", String.format("%04d-%02d", khYear, khMonth));
Map<String, Object> handleParams = new HashMap<>();
handleParams.put("handleYearMonth", String.format("%04d-%02d", khYear, khMonth));
userIds.forEach(userId -> {
params.put("assignUserId", userId);
List<CasePO> casePOS = kpiDao.listCase(params);
try {
// 调度员处理完成的案件由调度员处理包含自处理和转派的案件
handleParams.put("handleUserId", userId);
List<CasePO> handleCasePOS = kpiDao.listCase(handleParams);
Map<String, Object> updateParams = new HashMap<>();
updateParams.put("khYear", khYear);
updateParams.put("khMonth", khMonth);
updateParams.put("userId", userId);
// 超时转派扣分
int assignIn24HoursCount = 0;
int notAssignIn24HoursCount = 0;
for (CasePO casePO : casePOS) {
LocalDateTime reportDateTime = LocalDateTime.parse(casePO.getGmtReport().substring(0, 18), DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD_HH_MM_SS));
LocalDateTime assignDateTime = LocalDateTime.parse(casePO.getGmtAssign().substring(0, 18), DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD_HH_MM_SS));
int hours = Hours.hoursBetween(reportDateTime, assignDateTime).getHours();
if (hours > 24) {
notAssignIn24HoursCount++;
} else {
assignIn24HoursCount++;
}
}
updateParams.put("E", notAssignIn24HoursCount);
updateParams.put("F", notAssignIn24HoursCount * 10);
updateParams.put("N", handleCasePOS.size());
kpiKhxzDdyDao.updateEFN(updateParams);
} catch (Exception e) {
e.printStackTrace();
}
});
KpiUpdateMonitor.getInstance().complete();
}
}

View File

@ -1,46 +0,0 @@
package com.cm.bigdata.service.kpi.task.sub;
import com.cm.bigdata.dao.kpi.IKpiDao;
import com.cm.bigdata.dao.kpi.IKpiKhxzDdyDao;
import com.cm.bigdata.monitor.KpiUpdateMonitor;
import com.cm.bigdata.pojo.pos.kpi.CasePO;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class KpiKhxzDdyEFRunnable implements Runnable {
private IKpiKhxzDdyDao kpiKhxzDdyDao;
private IKpiDao kpiDao;
private int khYear;
private int khMonth;
private List<String> userIds;
public KpiKhxzDdyEFRunnable(IKpiKhxzDdyDao kpiKhxzDdyDao, IKpiDao kpiDao, int khYear, int khMonth, List<String> userIds) {
this.kpiKhxzDdyDao = kpiKhxzDdyDao;
this.kpiDao = kpiDao;
this.khYear = khYear;
this.khMonth = khMonth;
this.userIds = userIds;
}
@Override
public void run() {
Map<String, Object> params = new HashMap<>();
params.put("assignYearMonth", String.format("%04d-%02d", khYear, khMonth));
userIds.forEach(userId -> {
params.put("assignUserId", userId);
List<CasePO> casePOS = kpiDao.listCase(params);
Map<String, Object> updateParams = new HashMap<>();
updateParams.put("khYear", khYear);
updateParams.put("khMonth", khMonth);
updateParams.put("userId", userId);
updateParams.put("E", casePOS.size());
updateParams.put("F", casePOS.size() * 10);
kpiKhxzDdyDao.updateEF(updateParams);
});
KpiUpdateMonitor.getInstance().complete();
}
}

View File

@ -38,31 +38,24 @@ public class KpiKhxzWgzCDEFGHRunnable implements Runnable {
kpiKhxzWgzDTOS.forEach(kpiKhxzWgzDTO -> {
Map<String, Object> communityBossMap = new HashMap<>();
communityBossMap.put("communityBossParentUserId", kpiKhxzWgzDTO.getUserId());
// 直属下级网格员
// 4及网格员
List<CommunityBossPO> communityBossPOS = communityBossService.listPO(communityBossMap);
List<String> communityBossUserIds = communityBossPOS.stream().map(CommunityBossPO::getCommunityBossUserId).collect(Collectors.toList());
List<String> communityBossIds = communityBossPOS.stream().map(CommunityBossPO::getCommunityBossId).collect(Collectors.toList());
List<KpiKhxzWgyDTO> kpiKhxzWgyDTOS = new ArrayList<>();
if (!communityBossUserIds.isEmpty()) {
// 下级的直属下级
if (!communityBossIds.isEmpty()) {
// 5级网格员
communityBossMap.clear();
communityBossMap.put("communityBossParentUserIds", communityBossUserIds);
communityBossMap.put("communityBossParentIds", communityBossIds);
List<CommunityBossPO> communityBossPOS1 = communityBossService.listPO(communityBossMap);
List<String> communityBossUserIds1 = communityBossPOS1.stream().map(CommunityBossPO::getCommunityBossUserId).collect(Collectors.toList());
// 合并用户ID
communityBossUserIds.addAll(communityBossUserIds1);
List<String> userIds = communityBossUserIds;
Map<String, Object> wgyParams = new HashMap<>();
wgyParams.put("areaId", kpiKhxzWgzDTO.getAreaId());
wgyParams.put("communityId", kpiKhxzWgzDTO.getCommunityId());
wgyParams.put("khYear", khYear);
wgyParams.put("khMonth", khMonth);
wgyParams.put("userIds", userIds);
wgyParams.put("wgyLevel", 3);
kpiKhxzWgyDTOS.addAll(kpiKhxzWgyDao.listWgy(wgyParams));
wgyParams.put("userIds", communityBossUserIds1);
wgyParams.put("wgyLevel", 4);
List<KpiKhxzWgyDTO> kpiKhxzWgyDTOS1 = kpiKhxzWgyDao.listWgy(wgyParams);
kpiKhxzWgyDTOS.addAll(kpiKhxzWgyDTOS1);
kpiKhxzWgyDTOS.addAll(kpiKhxzWgyDao.listWgy(wgyParams));
}
int unPassCount = 0;
int unReportCompleteCount = 0;

View File

@ -55,6 +55,17 @@
AND
community_boss_level = #{communityBossLevel}
</if>
<if test="communityBossParentId != null and communityBossParentId != ''">
AND
community_boss_parent_id = #{communityBossParentId}
</if>
<if test="communityBossParentIds != null and communityBossParentIds.size > 0">
AND
community_boss_parent_id IN
<foreach collection="communityBossParentIds" index="index" open="(" separator="," close=")">
#{communityBossParentIds[${index}]}
</foreach>
</if>
<if test="communityBossParentUserId != null and communityBossParentUserId != ''">
AND
community_boss_parent_user_id = #{communityBossParentUserId};

View File

@ -75,12 +75,13 @@
user_id = #{userId}
</update>
<update id="updateEF" parameterType="map">
<update id="updateEFN" parameterType="map">
UPDATE
kpi_khxz_ddy
SET
E = #{E},
F = #{F}
F = #{F},
N = #{N}
WHERE
kh_year = #{khYear}
AND