处理绩效考核的新问题
This commit is contained in:
parent
d79632274f
commit
9596a2b851
@ -136,4 +136,59 @@ public class KpiKhxzController extends AbstractController {
|
|||||||
return new SuccessResult();
|
return new SuccessResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-case")
|
||||||
|
public void syncCase() throws IOException {
|
||||||
|
kpiKhxzService.updateCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-wgy3/{year}/{month}")
|
||||||
|
public void syncWgy3(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateWgy3(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-wgy4/{year}/{month}")
|
||||||
|
public void syncWgy4(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateWgy4(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-ddy/{year}/{month}")
|
||||||
|
public void syncDdy(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateDdy(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-zgy/{year}/{month}")
|
||||||
|
public void syncZgy(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateZgy(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-wgy3-task/{year}/{month}")
|
||||||
|
public void syncWgy3Task(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateWgy3Task(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-wgy4-task/{year}/{month}")
|
||||||
|
public void syncWgy4Task(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateWgy4Task(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-ddy-task/{year}/{month}")
|
||||||
|
public void syncDdyTask(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateDdyTask(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-zf-ga-task/{year}/{month}")
|
||||||
|
public void syncZfGaTask(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateZfGaTask(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-znbm-task/{year}/{month}")
|
||||||
|
public void syncZnbmTask(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateZnbmTask(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("sync-wgz-tazk/{year}/{month}")
|
||||||
|
public void syncWgzTask(@PathVariable("year") Integer year, @PathVariable("month") Integer month) throws IOException {
|
||||||
|
kpiKhxzService.updateWgzTask(year, month);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,27 @@ public interface IKpiKhxzService {
|
|||||||
|
|
||||||
void update(Integer khYear, Integer khMonth);
|
void update(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateCase();
|
||||||
|
|
||||||
|
void updateWgy3(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateWgy4(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateDdy(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateZgy(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateWgy3Task(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateWgy4Task(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateDdyTask(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateZfGaTask(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateZnbmTask(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
|
void updateWgzTask(Integer khYear, Integer khMonth);
|
||||||
|
|
||||||
List<KpiKhxzWgyDTO> listWgy(Map<String, Object> queryMap);
|
List<KpiKhxzWgyDTO> listWgy(Map<String, Object> queryMap);
|
||||||
|
|
||||||
@ -43,4 +64,5 @@ public interface IKpiKhxzService {
|
|||||||
void exportZnbm(HttpServletResponse httpServletResponse, Map<String, Object> queryMap) throws IOException;
|
void exportZnbm(HttpServletResponse httpServletResponse, Map<String, Object> queryMap) throws IOException;
|
||||||
|
|
||||||
void updateZnbm(KpiUpdateVO kpiUpdateVO);
|
void updateZnbm(KpiUpdateVO kpiUpdateVO);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,52 +54,47 @@ public class KpiKhxzServiceImpl extends AbstractService implements IKpiKhxzServi
|
|||||||
// 开始更新
|
// 开始更新
|
||||||
Executors.newSingleThreadExecutor().execute(() -> {
|
Executors.newSingleThreadExecutor().execute(() -> {
|
||||||
// 更新案件,1任务
|
// 更新案件,1任务
|
||||||
kpiService.updateCaseCount();
|
updateCase();
|
||||||
KpiUpdateMonitor.getInstance().complete();
|
|
||||||
|
|
||||||
// 更新4级网格员日统计,1任务
|
// 更新4级网格员日统计,1任务
|
||||||
kpiService.updateCommunityBossDayCount(khYear, khMonth, 3);
|
updateWgy3(khYear, khMonth);
|
||||||
KpiUpdateMonitor.getInstance().complete();
|
|
||||||
|
|
||||||
// 更新5级网格员日统计,1任务
|
// 更新5级网格员日统计,1任务
|
||||||
kpiService.updateCommunityBossDayCount(khYear, khMonth, 4);
|
updateWgy4(khYear, khMonth);
|
||||||
KpiUpdateMonitor.getInstance().complete();
|
|
||||||
|
|
||||||
// 更新调度员日统计,1任务
|
// 更新调度员日统计,1任务
|
||||||
kpiService.updateNPersonDayCount(KpiUtil.DDY_ROLE_ID, khYear, khMonth);
|
updateDdy(khYear, khMonth);
|
||||||
KpiUpdateMonitor.getInstance().complete();
|
|
||||||
|
|
||||||
// 更新专管员,1任务
|
// 更新专管员,1任务
|
||||||
kpiService.updateNPersonDayCount(KpiUtil.ZGY_ROLE_ID, khYear, khMonth);
|
updateZgy(khYear, khMonth);
|
||||||
KpiUpdateMonitor.getInstance().complete();
|
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
// 更新4级网格员,4任务
|
// 更新4级网格员,4任务
|
||||||
kpiKhxzWgyTask.update(khYear, khMonth, 3);
|
updateWgy3Task(khYear, khMonth);
|
||||||
});
|
});
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
// 更新5级网格员,4个任务
|
// 更新5级网格员,4个任务
|
||||||
kpiKhxzWgyTask.update(khYear, khMonth, 4);
|
updateWgy4Task(khYear, khMonth);
|
||||||
});
|
});
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
// 调度员,4任务
|
// 调度员,4任务
|
||||||
kpiKhxzDdyTask.update(khYear, khMonth);
|
updateDdyTask(khYear, khMonth);
|
||||||
});
|
});
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
// 执法公安,5任务
|
// 执法公安,5任务
|
||||||
khKhxzZfGaTask.update(khYear, khMonth);
|
updateZfGaTask(khYear, khMonth);
|
||||||
});
|
});
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
// 职能部门,4任务
|
// 职能部门,4任务
|
||||||
kpiKhxzZnbmTask.update(khYear, khMonth);
|
updateZnbmTask(khYear, khMonth);
|
||||||
});
|
});
|
||||||
|
|
||||||
executorService.execute(() -> {
|
executorService.execute(() -> {
|
||||||
while(KpiUpdateMonitor.getInstance().getCompleteCount() < 26) {
|
while (KpiUpdateMonitor.getInstance().getCompleteCount() < 26) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(3000);
|
Thread.sleep(3000);
|
||||||
LOG.debug("等待其他任务执行完成");
|
LOG.debug("等待其他任务执行完成");
|
||||||
@ -108,11 +103,71 @@ public class KpiKhxzServiceImpl extends AbstractService implements IKpiKhxzServi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 网格长,3任务
|
// 网格长,3任务
|
||||||
kpiKhxzWgzTask.update(khYear, khMonth);
|
updateWgzTask(khYear, khMonth);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateCase() {
|
||||||
|
kpiService.updateCaseCount();
|
||||||
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWgy3(Integer khYear, Integer khMonth) {
|
||||||
|
kpiService.updateCommunityBossDayCount(khYear, khMonth, 3);
|
||||||
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWgy4(Integer khYear, Integer khMonth) {
|
||||||
|
kpiService.updateCommunityBossDayCount(khYear, khMonth, 4);
|
||||||
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDdy(Integer khYear, Integer khMonth) {
|
||||||
|
kpiService.updateNPersonDayCount(KpiUtil.DDY_ROLE_ID, khYear, khMonth);
|
||||||
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateZgy(Integer khYear, Integer khMonth) {
|
||||||
|
kpiService.updateNPersonDayCount(KpiUtil.ZGY_ROLE_ID, khYear, khMonth);
|
||||||
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWgy3Task(Integer khYear, Integer khMonth) {
|
||||||
|
kpiKhxzWgyTask.update(khYear, khMonth, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWgy4Task(Integer khYear, Integer khMonth) {
|
||||||
|
kpiKhxzWgyTask.update(khYear, khMonth, 4);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDdyTask(Integer khYear, Integer khMonth) {
|
||||||
|
kpiKhxzDdyTask.update(khYear, khMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateZfGaTask(Integer khYear, Integer khMonth) {
|
||||||
|
khKhxzZfGaTask.update(khYear, khMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateZnbmTask(Integer khYear, Integer khMonth) {
|
||||||
|
kpiKhxzZnbmTask.update(khYear, khMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWgzTask(Integer khYear, Integer khMonth) {
|
||||||
|
kpiKhxzWgzTask.update(khYear, khMonth);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<KpiKhxzWgyDTO> listWgy(Map<String, Object> queryMap) {
|
public List<KpiKhxzWgyDTO> listWgy(Map<String, Object> queryMap) {
|
||||||
return kpiKhxzWgyDao.listWgy(queryMap);
|
return kpiKhxzWgyDao.listWgy(queryMap);
|
||||||
|
@ -51,7 +51,7 @@ public class KpiKhxzWgyTask {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
executorService.execute(new KpiKhxzWgyCRunnable(kpiKhxzWgyDao, kpiDao, khYear, khMonth, wgyLevel, userIds));
|
executorService.execute(new KpiKhxzWgyCRunnable(kpiKhxzWgyDao, kpiDao, khYear, khMonth, wgyLevel, userIds));
|
||||||
executorService.execute(new KpiKhxzWgyEGIKRTRunnable(kpiKhxzWgyDao, kpiHolidayDao, kpiDao, khYear, khMonth, wgyLevel, userIds));
|
executorService.execute(new KpiKhxzWgyEGIKRTRunnable(userGridService, kpiKhxzWgyDao, kpiHolidayDao, kpiDao, khYear, khMonth, wgyLevel, userIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteBaseWgy(int khYear, int khMonth, int wgyLevel) {
|
private void deleteBaseWgy(int khYear, int khMonth, int wgyLevel) {
|
||||||
|
@ -38,7 +38,7 @@ public class KpiKhxzWgzTask {
|
|||||||
KpiUpdateMonitor.getInstance().complete();
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
executorService.execute(new KpiKhxzWgzCDEFGHRunnable(kpiKhxzWgzDao, kpiKhxzWgyDao, khYear, khMonth, kpiKhxzWgzDTOS));
|
executorService.execute(new KpiKhxzWgzCDEFGHRunnable(communityBossService, kpiKhxzWgzDao, kpiKhxzWgyDao, khYear, khMonth, kpiKhxzWgzDTOS));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteBase(int khYear, int khMonth) {
|
private void deleteBase(int khYear, int khMonth) {
|
||||||
|
@ -6,6 +6,7 @@ import com.cm.bigdata.dao.kpi.IKpiKhxzWgyDao;
|
|||||||
import com.cm.bigdata.monitor.KpiUpdateMonitor;
|
import com.cm.bigdata.monitor.KpiUpdateMonitor;
|
||||||
import com.cm.bigdata.pojo.pos.kpi.CasePO;
|
import com.cm.bigdata.pojo.pos.kpi.CasePO;
|
||||||
import com.cm.bigdata.pojo.pos.kpi.HolidayPO;
|
import com.cm.bigdata.pojo.pos.kpi.HolidayPO;
|
||||||
|
import com.cm.bigdata.service.kpi.IUserGridService;
|
||||||
import com.cm.bigdata.utils.KpiUtil;
|
import com.cm.bigdata.utils.KpiUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
@ -16,6 +17,7 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class KpiKhxzWgyEGIKRTRunnable implements Runnable {
|
public class KpiKhxzWgyEGIKRTRunnable implements Runnable {
|
||||||
|
|
||||||
|
private IUserGridService userGridService;
|
||||||
private IKpiKhxzWgyDao kpiKhxzWgyDao;
|
private IKpiKhxzWgyDao kpiKhxzWgyDao;
|
||||||
private IKpiHolidayDao kpiHolidayDao;
|
private IKpiHolidayDao kpiHolidayDao;
|
||||||
private IKpiDao kpiDao;
|
private IKpiDao kpiDao;
|
||||||
@ -24,7 +26,8 @@ public class KpiKhxzWgyEGIKRTRunnable implements Runnable {
|
|||||||
private int level;
|
private int level;
|
||||||
private List<String> userIds;
|
private List<String> userIds;
|
||||||
|
|
||||||
public KpiKhxzWgyEGIKRTRunnable(IKpiKhxzWgyDao kpiKhxzWgyDao, IKpiHolidayDao kpiHolidayDao, IKpiDao kpiDao, int year, int month, int level, List<String> userIds) {
|
public KpiKhxzWgyEGIKRTRunnable(IUserGridService userGridService, IKpiKhxzWgyDao kpiKhxzWgyDao, IKpiHolidayDao kpiHolidayDao, IKpiDao kpiDao, int year, int month, int level, List<String> userIds) {
|
||||||
|
this.userGridService = userGridService;
|
||||||
this.kpiKhxzWgyDao = kpiKhxzWgyDao;
|
this.kpiKhxzWgyDao = kpiKhxzWgyDao;
|
||||||
this.kpiHolidayDao = kpiHolidayDao;
|
this.kpiHolidayDao = kpiHolidayDao;
|
||||||
this.kpiDao = kpiDao;
|
this.kpiDao = kpiDao;
|
||||||
@ -80,6 +83,9 @@ public class KpiKhxzWgyEGIKRTRunnable implements Runnable {
|
|||||||
private void updateEGIKRT(List<String> userIds, List<List<KpiUtil.DayWeek>> shouldReportDayWeeks) {
|
private void updateEGIKRT(List<String> userIds, List<List<KpiUtil.DayWeek>> shouldReportDayWeeks) {
|
||||||
int shouldCount = shouldReportDayWeeks.size();
|
int shouldCount = shouldReportDayWeeks.size();
|
||||||
userIds.forEach(userId -> {
|
userIds.forEach(userId -> {
|
||||||
|
// 网格数量
|
||||||
|
Integer gridCount = userGridService.countUserGrid(userId);
|
||||||
|
int totalShouldCount = shouldCount * gridCount;
|
||||||
// 每周上报
|
// 每周上报
|
||||||
int weekReportCount = 0;
|
int weekReportCount = 0;
|
||||||
// 实报
|
// 实报
|
||||||
@ -100,6 +106,7 @@ public class KpiKhxzWgyEGIKRTRunnable implements Runnable {
|
|||||||
params.put("startTime", startTime);
|
params.put("startTime", startTime);
|
||||||
params.put("endTime", endTime);
|
params.put("endTime", endTime);
|
||||||
List<CasePO> casePOS = kpiDao.listCase(params);
|
List<CasePO> casePOS = kpiDao.listCase(params);
|
||||||
|
// 本周是否有上报数据
|
||||||
boolean isWeekReport = false;
|
boolean isWeekReport = false;
|
||||||
for (CasePO casePO : casePOS) {
|
for (CasePO casePO : casePOS) {
|
||||||
urgeCount += casePO.getTotalUrge();
|
urgeCount += casePO.getTotalUrge();
|
||||||
@ -130,12 +137,13 @@ public class KpiKhxzWgyEGIKRTRunnable implements Runnable {
|
|||||||
isWeekReport = true;
|
isWeekReport = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
weekReportCount += isWeekReport ? 1 : 0;
|
// 每周上报数量由网格数量决定
|
||||||
lackCount = Math.max(shouldCount - weekReportCount, 0);
|
weekReportCount += isWeekReport ? gridCount : 0;
|
||||||
exceedCount = Math.max(realityCount - shouldCount, 0);
|
lackCount = Math.max(totalShouldCount - weekReportCount, 0);
|
||||||
|
exceedCount = Math.max(realityCount - totalShouldCount, 0);
|
||||||
}
|
}
|
||||||
Map<String, Object> updateParams = new HashMap<>();
|
Map<String, Object> updateParams = new HashMap<>();
|
||||||
updateParams.put("E", shouldCount);
|
updateParams.put("E", totalShouldCount);
|
||||||
updateParams.put("G", weekReportCount);
|
updateParams.put("G", weekReportCount);
|
||||||
updateParams.put("I", lackCount);
|
updateParams.put("I", lackCount);
|
||||||
updateParams.put("K", exceedCount);
|
updateParams.put("K", exceedCount);
|
||||||
|
@ -5,21 +5,27 @@ import com.cm.bigdata.dao.kpi.IKpiKhxzWgzDao;
|
|||||||
import com.cm.bigdata.monitor.KpiUpdateMonitor;
|
import com.cm.bigdata.monitor.KpiUpdateMonitor;
|
||||||
import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgyDTO;
|
import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgyDTO;
|
||||||
import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgzDTO;
|
import com.cm.bigdata.pojo.dtos.kpi.KpiKhxzWgzDTO;
|
||||||
|
import com.cm.bigdata.pojo.pos.kpi.CommunityBossPO;
|
||||||
|
import com.cm.bigdata.service.kpi.ICommunityBossService;
|
||||||
|
import org.apache.commons.collections4.ListUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class KpiKhxzWgzCDEFGHRunnable implements Runnable {
|
public class KpiKhxzWgzCDEFGHRunnable implements Runnable {
|
||||||
|
|
||||||
|
private ICommunityBossService communityBossService;
|
||||||
private IKpiKhxzWgzDao kpiKhxzWgzDao;
|
private IKpiKhxzWgzDao kpiKhxzWgzDao;
|
||||||
private IKpiKhxzWgyDao kpiKhxzWgyDao;
|
private IKpiKhxzWgyDao kpiKhxzWgyDao;
|
||||||
private int khYear;
|
private int khYear;
|
||||||
private int khMonth;
|
private int khMonth;
|
||||||
private List<KpiKhxzWgzDTO> kpiKhxzWgzDTOS;
|
private List<KpiKhxzWgzDTO> kpiKhxzWgzDTOS;
|
||||||
|
|
||||||
public KpiKhxzWgzCDEFGHRunnable(IKpiKhxzWgzDao kpiKhxzWgzDao, IKpiKhxzWgyDao kpiKhxzWgyDao, int khYear, int khMonth, List<KpiKhxzWgzDTO> kpiKhxzWgzDTOS) {
|
public KpiKhxzWgzCDEFGHRunnable(ICommunityBossService communityBossService, IKpiKhxzWgzDao kpiKhxzWgzDao, IKpiKhxzWgyDao kpiKhxzWgyDao, int khYear, int khMonth, List<KpiKhxzWgzDTO> kpiKhxzWgzDTOS) {
|
||||||
|
this.communityBossService = communityBossService;
|
||||||
this.kpiKhxzWgzDao = kpiKhxzWgzDao;
|
this.kpiKhxzWgzDao = kpiKhxzWgzDao;
|
||||||
this.kpiKhxzWgyDao = kpiKhxzWgyDao;
|
this.kpiKhxzWgyDao = kpiKhxzWgyDao;
|
||||||
this.khYear = khYear;
|
this.khYear = khYear;
|
||||||
@ -30,14 +36,34 @@ public class KpiKhxzWgzCDEFGHRunnable implements Runnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
kpiKhxzWgzDTOS.forEach(kpiKhxzWgzDTO -> {
|
kpiKhxzWgzDTOS.forEach(kpiKhxzWgzDTO -> {
|
||||||
Map<String, Object> wgyParams = new HashMap<>();
|
Map<String, Object> communityBossMap = new HashMap<>();
|
||||||
wgyParams.put("areaId", kpiKhxzWgzDTO.getAreaId());
|
communityBossMap.put("communityBossParentUserId", kpiKhxzWgzDTO.getUserId());
|
||||||
wgyParams.put("communityId", kpiKhxzWgzDTO.getCommunityId());
|
// 直属下级网格员
|
||||||
wgyParams.put("wgyLevel", 3);
|
List<CommunityBossPO> communityBossPOS = communityBossService.listPO(communityBossMap);
|
||||||
List<KpiKhxzWgyDTO> kpiKhxzWgyDTOS = kpiKhxzWgyDao.listWgy(wgyParams);
|
List<String> communityBossUserIds = communityBossPOS.stream().map(CommunityBossPO::getCommunityBossUserId).collect(Collectors.toList());
|
||||||
wgyParams.put("wgyLevel", 4);
|
List<KpiKhxzWgyDTO> kpiKhxzWgyDTOS = new ArrayList<>();
|
||||||
List<KpiKhxzWgyDTO> kpiKhxzWgyDTOS1 = kpiKhxzWgyDao.listWgy(wgyParams);
|
if (!communityBossUserIds.isEmpty()) {
|
||||||
kpiKhxzWgyDTOS.addAll(kpiKhxzWgyDTOS1);
|
// 下级的直属下级
|
||||||
|
communityBossMap.clear();
|
||||||
|
communityBossMap.put("communityBossParentUserIds", communityBossUserIds);
|
||||||
|
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("wgyLevel", 4);
|
||||||
|
List<KpiKhxzWgyDTO> kpiKhxzWgyDTOS1 = kpiKhxzWgyDao.listWgy(wgyParams);
|
||||||
|
kpiKhxzWgyDTOS.addAll(kpiKhxzWgyDTOS1);
|
||||||
|
}
|
||||||
int unPassCount = 0;
|
int unPassCount = 0;
|
||||||
int unReportCompleteCount = 0;
|
int unReportCompleteCount = 0;
|
||||||
for (KpiKhxzWgyDTO kpiKhxzWgyDTO : kpiKhxzWgyDTOS) {
|
for (KpiKhxzWgyDTO kpiKhxzWgyDTO : kpiKhxzWgyDTOS) {
|
||||||
@ -58,10 +84,10 @@ public class KpiKhxzWgzCDEFGHRunnable implements Runnable {
|
|||||||
updateParams.put("userId", kpiKhxzWgzDTO.getUserId());
|
updateParams.put("userId", kpiKhxzWgzDTO.getUserId());
|
||||||
updateParams.put("C", defaultC);
|
updateParams.put("C", defaultC);
|
||||||
updateParams.put("D", unPassCount);
|
updateParams.put("D", unPassCount);
|
||||||
updateParams.put("E", unPassCount * 10);
|
updateParams.put("E", Math.min(defaultC, unPassCount * 10));
|
||||||
updateParams.put("F", defaultF);
|
updateParams.put("F", defaultF);
|
||||||
updateParams.put("G", unReportCompleteCount);
|
updateParams.put("G", unReportCompleteCount);
|
||||||
updateParams.put("H", unReportCompleteCount * 10);
|
updateParams.put("H", Math.min(defaultF, unReportCompleteCount * 10));
|
||||||
kpiKhxzWgzDao.updateCDEFGH(updateParams);
|
kpiKhxzWgzDao.updateCDEFGH(updateParams);
|
||||||
});
|
});
|
||||||
KpiUpdateMonitor.getInstance().complete();
|
KpiUpdateMonitor.getInstance().complete();
|
||||||
|
@ -55,6 +55,17 @@
|
|||||||
AND
|
AND
|
||||||
community_boss_level = #{communityBossLevel}
|
community_boss_level = #{communityBossLevel}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="communityBossParentUserId != null and communityBossParentUserId != ''">
|
||||||
|
AND
|
||||||
|
community_boss_parent_user_id = #{communityBossParentUserId};
|
||||||
|
</if>
|
||||||
|
<if test="communityBossParentUserIds != null and communityBossParentUserIds.size > 0">
|
||||||
|
AND
|
||||||
|
community_boss_parent_user_id IN
|
||||||
|
<foreach collection="communityBossParentUserIds" index="index" open="(" separator="," close=")">
|
||||||
|
#{communityBossParentUserIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="list" parameterType="map" resultMap="communityBossDTO">
|
<select id="list" parameterType="map" resultMap="communityBossDTO">
|
||||||
|
@ -100,7 +100,15 @@
|
|||||||
FROM
|
FROM
|
||||||
kpi_khxz_wgy_${wgyLevel}
|
kpi_khxz_wgy_${wgyLevel}
|
||||||
<where>
|
<where>
|
||||||
|
<if test="userIds != null and userIds.size > 0">
|
||||||
|
AND
|
||||||
|
user_id IN
|
||||||
|
<foreach collection="userIds" index="index" open="(" separator="," close=")">
|
||||||
|
#{userIds[${index}]}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="areaId != null and areaId != ''">
|
<if test="areaId != null and areaId != ''">
|
||||||
|
AND
|
||||||
area_id = #{areaId}
|
area_id = #{areaId}
|
||||||
</if>
|
</if>
|
||||||
<if test="communityId != null and communityId != ''">
|
<if test="communityId != null and communityId != ''">
|
||||||
|
Loading…
Reference in New Issue
Block a user