|
|
@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.xunmei.common.core.constant.CacheConstants;
|
|
|
import com.xunmei.common.core.constant.Constants;
|
|
|
-import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.domain.safetyindex.domain.*;
|
|
|
import com.xunmei.common.core.domain.safetyindex.dto.CoreSafetyIndexReCalculateDto;
|
|
|
import com.xunmei.common.core.domain.safetyindex.vo.SafeIndexRuleCountVo;
|
|
|
@@ -105,7 +104,7 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
//获取安保履职的数据
|
|
|
- doResumptionExceptionData(time);
|
|
|
+ doResumptionExceptionData(null, time);
|
|
|
}, threadPoolTaskExecutor);
|
|
|
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
@@ -115,7 +114,7 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
|
|
|
CompletableFuture.runAsync(() -> {
|
|
|
//获取监控调阅的异常数据
|
|
|
- doMonitorExceptionData(time);
|
|
|
+ doMonitorExceptionData(null, time);
|
|
|
}, threadPoolTaskExecutor);
|
|
|
}
|
|
|
|
|
|
@@ -165,9 +164,9 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
|
|
|
private void reCalculateSafetyIndex(List<Long> orgIds, String date) {
|
|
|
|
|
|
- DateTime time = dealTimeParam(date);
|
|
|
+ DateTime time = DateUtil.parse(date, "yyyy-MM");
|
|
|
int year = time.year();
|
|
|
- int month = time.month();
|
|
|
+ int month = time.month()+1;
|
|
|
//获取指标配置
|
|
|
List<SafeIndexRuleCountVo> safeIndexConfigVoList = ruleService.findSafeIndexRuleVoList();
|
|
|
//履职的指标配置
|
|
|
@@ -712,9 +711,6 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
.list();
|
|
|
}
|
|
|
|
|
|
- private void doMonitorExceptionData(DateTime time) {
|
|
|
- monitoringRetrievalTaskService.selectMonitorExceptionData(time);
|
|
|
- }
|
|
|
|
|
|
private void doMonitorExceptionData(List<Long> orgIds, DateTime time) {
|
|
|
monitoringRetrievalTaskService.selectMonitorExceptionData(orgIds, time);
|
|
|
@@ -729,19 +725,12 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
questionService.selectQuestionExceptionData(startTime, endTime, orgIds);
|
|
|
}
|
|
|
|
|
|
- private void doResumptionExceptionData(DateTime time) {
|
|
|
+ private void doResumptionExceptionData(List<Long> orgIds, DateTime time) {
|
|
|
// 逾期数据
|
|
|
//扩展字段1:计划id
|
|
|
//扩展字段2:计划执行时刻 (2,3,4 营业前中后)
|
|
|
- resumptionService.findResumptionList(time);
|
|
|
-
|
|
|
- }
|
|
|
+ resumptionService.findResumptionList(orgIds, time);
|
|
|
|
|
|
- private void doResumptionExceptionData(List<Long> orgIds, Date startTime, Date endTime, CoreSafetyIndexReCalculateDto request) {
|
|
|
- // 逾期数据
|
|
|
- //扩展字段1:计划id
|
|
|
- //扩展字段2:计划执行时刻 (2,3,4 营业前中后)
|
|
|
- resumptionService.findResumptionListNew(orgIds, startTime, endTime, request);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -803,7 +792,7 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
coreSafetyExceptionDataMapper.deleteAndUpdateByOrgIdAndDataTime(orgIds, startTime, endTime);
|
|
|
//重新拉起数据
|
|
|
//安保履职
|
|
|
- doResumptionExceptionData(orgIds, startTime, endTime, request);
|
|
|
+ doResumptionExceptionData(orgIds, startTime);
|
|
|
//问题整改
|
|
|
doQuestionExceptionData(orgIds, startTime);
|
|
|
|
|
|
@@ -816,14 +805,15 @@ public class CoreSafetyExceptionDataServiceImpl extends ServiceImpl<CoreSafetyEx
|
|
|
|
|
|
@Override
|
|
|
public void reCalculate(CoreSafetyIndexReCalculateDto request) {
|
|
|
- List<SysOrg> sysOrgList = orgService.selectOrgTreeListByCurOrgId(request.getOrgId(), SecurityConstants.INNER);
|
|
|
+ List<SysOrg> orgList = orgService.selectOrgByPath(request.getOrgId());
|
|
|
+
|
|
|
//List<SysOrg> sysOrgList = orgService.selectSysOrgByParentId(request.getOrgId(), SecurityConstants.INNER);
|
|
|
DateTime time = DateUtil.offsetMonth(new Date(), -1);
|
|
|
DateTime startTime = DateUtil.beginOfMonth(time);
|
|
|
DateTime endTime = DateUtil.endOfMonth(startTime);
|
|
|
request.setQuarter(startTime.quarter());
|
|
|
//删除现有的异常数据,并重新拉取数据计算
|
|
|
- List<Long> idList = sysOrgList.stream().map(SysOrg::getId).collect(Collectors.toList());
|
|
|
+ List<Long> idList = orgList.stream().map(SysOrg::getId).collect(Collectors.toList());
|
|
|
this.deleteAndUpdateByOrgIdAndDataTime(idList, startTime, endTime, request);
|
|
|
}
|
|
|
|