|
|
@@ -7,11 +7,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.google.common.collect.Sets; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
|
import com.hz.pm.api.common.model.constant.BizConst; |
|
|
|
import com.hz.pm.api.common.helper.UserInfoHelper; |
|
|
|
import com.hz.pm.api.common.model.constant.BizConst; |
|
|
|
import com.hz.pm.api.projectdeclared.manage.DefaultDeclaredProjectManage; |
|
|
|
import com.hz.pm.api.projectlib.manage.ProjectLibManage; |
|
|
|
import com.hz.pm.api.projectlib.model.entity.Project; |
|
|
@@ -34,6 +31,9 @@ import com.hz.pm.api.user.security.model.UserFullInfoDTO; |
|
|
|
import com.hz.pm.api.user.util.LoginUserUtil; |
|
|
|
import com.hz.pm.api.workbench.converter.WorkbenchConverter; |
|
|
|
import com.hz.pm.api.workbench.model.vo.WorkbenchVO; |
|
|
|
import com.ningdatech.basic.function.VUtils; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.basic.util.StrPool; |
|
|
|
import com.wflow.bean.entity.WflowEarlyWarning; |
|
|
|
import com.wflow.enums.WarningNoticeTypeEnum; |
|
|
|
import com.wflow.service.IEarlyWarningService; |
|
|
@@ -92,15 +92,14 @@ public class WorkbenchManage { |
|
|
|
//1.待办中心数据 |
|
|
|
TodoCenterStatisticsVO statisticsVO = todoCenterManage.todoCenterStatistics(user.getEmployeeCode()); |
|
|
|
ToBeProcessedReq toBeProcessedReq = new ToBeProcessedReq(); |
|
|
|
toBeProcessedReq.setPageNumber(1); |
|
|
|
toBeProcessedReq.setPageSize(5); |
|
|
|
toBeProcessedReq.page(1, 5); |
|
|
|
toBeProcessedReq.setLoginUserId(userId); |
|
|
|
toBeProcessedReq.setEmployeeCode(user.getEmployeeCode()); |
|
|
|
statisticsVO.setTodoList(todoCenterManage.todoProjectList(toBeProcessedReq).getRecords() |
|
|
|
.stream().map(WorkbenchConverter::convert).collect(Collectors.toList())); |
|
|
|
res.setTodoCerter(statisticsVO); |
|
|
|
stopWatch.stop(); |
|
|
|
log.info("待办中心数据 耗时,{} s",stopWatch.getTotalTimeSeconds()); |
|
|
|
log.info("待办中心数据 耗时,{} s", stopWatch.getTotalTimeSeconds()); |
|
|
|
}, ForkJoinPool.commonPool()), |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
StopWatch stopWatch = new StopWatch(); |
|
|
@@ -108,15 +107,15 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
//2.项目统计数据 |
|
|
|
res.setOrgDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage |
|
|
|
.declaredProjectOrgStatistics(year, user),defaultDeclaredProjectManage.declaredProjectOrgStatistics(year - 1, user))); |
|
|
|
.declaredProjectOrgStatistics(year, user), defaultDeclaredProjectManage.declaredProjectOrgStatistics(year - 1, user))); |
|
|
|
if (userInfoHelper.isSuperOrRegionAdmin(user.getUserId())) { |
|
|
|
res.setRegionDeclared(WorkbenchConverter.convert(defaultDeclaredProjectManage |
|
|
|
.declaredProjectRegionStatistics(year, user),defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user))); |
|
|
|
}else{ |
|
|
|
.declaredProjectRegionStatistics(year, user), defaultDeclaredProjectManage.declaredProjectRegionStatistics(year - 1, user))); |
|
|
|
} else { |
|
|
|
res.setRegionDeclared(new WorkbenchVO.DeclaredStatistics()); |
|
|
|
} |
|
|
|
stopWatch.stop(); |
|
|
|
log.info("项目统计数据 耗时,{} s",stopWatch.getTotalTimeSeconds()); |
|
|
|
log.info("项目统计数据 耗时,{} s", stopWatch.getTotalTimeSeconds()); |
|
|
|
}, ForkJoinPool.commonPool()), |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
StopWatch stopWatch = new StopWatch(); |
|
|
@@ -124,11 +123,10 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
//3.所有公告按类型分 |
|
|
|
NoticeListReq noticeListReq = new NoticeListReq(); |
|
|
|
noticeListReq.setPageNumber(1); |
|
|
|
noticeListReq.setPageSize(1000); |
|
|
|
res.setNoticeList(noticeManage.listToMapByManager(noticeListReq,user)); |
|
|
|
noticeListReq.page(1, 1000); |
|
|
|
res.setNoticeList(noticeManage.listToMapByManager(noticeListReq, user)); |
|
|
|
stopWatch.stop(); |
|
|
|
log.info("公告 耗时,{} s",stopWatch.getTotalTimeSeconds()); |
|
|
|
log.info("公告 耗时,{} s", stopWatch.getTotalTimeSeconds()); |
|
|
|
}, ForkJoinPool.commonPool()), |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
StopWatch stopWatch = new StopWatch(); |
|
|
@@ -136,7 +134,7 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
//4.项目预警记录 |
|
|
|
res.setProjectEarlyWarning(getProjectEarlyWarning(user)); |
|
|
|
log.info("项目预警记录 耗时,{} s",stopWatch.getTotalTimeSeconds()); |
|
|
|
log.info("项目预警记录 耗时,{} s", stopWatch.getTotalTimeSeconds()); |
|
|
|
}, ForkJoinPool.commonPool()), |
|
|
|
CompletableFuture.runAsync(() -> { |
|
|
|
StopWatch stopWatch = new StopWatch(); |
|
|
@@ -144,11 +142,10 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
// 项目列表 |
|
|
|
ProjectListReq projectListReq = new ProjectListReq(); |
|
|
|
projectListReq.setPageNumber(1); |
|
|
|
projectListReq.setPageSize(2000); |
|
|
|
projectListReq.page(1, 2000); |
|
|
|
projectListReq.setProjectYear(year); |
|
|
|
res.setProjects(new ArrayList<>(projectLibManage.listWithPermissionWorkbentch(projectListReq,user).getRecords())); |
|
|
|
log.info("工作台 项目列表 耗时,{} s",stopWatch.getTotalTimeSeconds()); |
|
|
|
res.setProjects(new ArrayList<>(projectLibManage.listWithPermissionWorkbentch(projectListReq, user).getRecords())); |
|
|
|
log.info("工作台 项目列表 耗时,{} s", stopWatch.getTotalTimeSeconds()); |
|
|
|
}, ForkJoinPool.commonPool()) |
|
|
|
).join(); |
|
|
|
|
|
|
@@ -159,12 +156,12 @@ public class WorkbenchManage { |
|
|
|
WorkbenchVO.ProjectEarlyWarning projectEarlyWarning = new WorkbenchVO.ProjectEarlyWarning(); |
|
|
|
LambdaQueryWrapper<Project> projectWrapper = Wrappers.lambdaQuery(Project.class) |
|
|
|
.eq(Project::getNewest, Boolean.TRUE); |
|
|
|
EarlyWarningUtil.buildPermissonProjectWrapper(projectWrapper,user); |
|
|
|
EarlyWarningUtil.buildPermissonProjectWrapper(projectWrapper, user); |
|
|
|
List<Project> projects = projectService.list(projectWrapper); |
|
|
|
Set<String> projectCodeS = Sets.newHashSet(); |
|
|
|
Map<String,String> projectNameMap = projects.stream() |
|
|
|
Map<String, String> projectNameMap = projects.stream() |
|
|
|
.filter(p -> projectCodeS.add(p.getProjectCode())) |
|
|
|
.collect(Collectors.toMap(Project::getProjectCode,Project::getProjectName)); |
|
|
|
.collect(Collectors.toMap(Project::getProjectCode, Project::getProjectName)); |
|
|
|
|
|
|
|
//4.1 |
|
|
|
//累积预警统计 |
|
|
@@ -172,125 +169,131 @@ public class WorkbenchManage { |
|
|
|
LambdaQueryWrapper<WflowEarlyWarningRecords> overWrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) |
|
|
|
.eq(WflowEarlyWarningRecords::getNoticeType, WarningNoticeTypeEnum.OVER.getCode()) |
|
|
|
.or(q2 -> q2.isNull(WflowEarlyWarningRecords::getNoticeType)); |
|
|
|
EarlyWarningUtil.buildPermissonFullWrapper(overWrapper,user); |
|
|
|
Long overCount = earlyWarningRecordsService.count(overWrapper); |
|
|
|
accumulate.setOver(overCount.intValue()); |
|
|
|
EarlyWarningUtil.buildPermissonFullWrapper(overWrapper, user); |
|
|
|
long overCount = earlyWarningRecordsService.count(overWrapper); |
|
|
|
accumulate.setOver((int) overCount); |
|
|
|
LambdaQueryWrapper<WflowEarlyWarningRecords> adventWrapper = Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) |
|
|
|
.eq(WflowEarlyWarningRecords::getNoticeType, WarningNoticeTypeEnum.ADVENT.getCode()); |
|
|
|
EarlyWarningUtil.buildPermissonFullWrapper(adventWrapper,user); |
|
|
|
Long adventCount = earlyWarningRecordsService.count(adventWrapper); |
|
|
|
accumulate.setAdvent(adventCount.intValue()); |
|
|
|
EarlyWarningUtil.buildPermissonFullWrapper(adventWrapper, user); |
|
|
|
long adventCount = earlyWarningRecordsService.count(adventWrapper); |
|
|
|
accumulate.setAdvent((int) adventCount); |
|
|
|
projectEarlyWarning.setAccumulate(accumulate); |
|
|
|
|
|
|
|
//4.2 |
|
|
|
//当前 |
|
|
|
//4.2.1 超期 |
|
|
|
Page<ProjectEarlyWarning> overPage = Page.of(1,1000); |
|
|
|
Page<ProjectEarlyWarning> adventPage = Page.of(1,1000); |
|
|
|
Page<ProjectEarlyWarning> normalPage = Page.of(1,1000); |
|
|
|
LambdaQueryWrapper<ProjectEarlyWarning> overPWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) |
|
|
|
Page<ProjectEarlyWarning> overPage = Page.of(1, 1000); |
|
|
|
Page<ProjectEarlyWarning> adventPage = Page.of(1, 1000); |
|
|
|
Page<ProjectEarlyWarning> normalPage = Page.of(1, 1000); |
|
|
|
LambdaQueryWrapper<ProjectEarlyWarning> overPewWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) |
|
|
|
.eq(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.OVER_TIME.name()) |
|
|
|
.eq(user.getRegionAdmin()&&!user.getSuperAdmin(),ProjectEarlyWarning::getAreaCode,user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin()&&!user.getSuperAdmin()) || user.notAdmin(),ProjectEarlyWarning::getBuildOrgCode,user.getEmpPosUnitCode()); |
|
|
|
projectEarlyWarningService.page(overPage,overPWrapper); |
|
|
|
LambdaQueryWrapper<ProjectEarlyWarning> adventPWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) |
|
|
|
.eq(user.getRegionAdmin() && !user.getSuperAdmin(), ProjectEarlyWarning::getAreaCode, user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), ProjectEarlyWarning::getBuildOrgCode, user.getEmpPosUnitCode()); |
|
|
|
projectEarlyWarningService.page(overPage, overPewWrapper); |
|
|
|
LambdaQueryWrapper<ProjectEarlyWarning> adventPewWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) |
|
|
|
.eq(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.ADVENT_TIME.name()) |
|
|
|
.eq(user.getRegionAdmin()&&!user.getSuperAdmin(),ProjectEarlyWarning::getAreaCode,user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin()&&!user.getSuperAdmin()) || user.notAdmin(),ProjectEarlyWarning::getBuildOrgCode,user.getEmpPosUnitCode()); |
|
|
|
projectEarlyWarningService.page(adventPage,adventPWrapper); |
|
|
|
.eq(user.getRegionAdmin() && !user.getSuperAdmin(), ProjectEarlyWarning::getAreaCode, user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), ProjectEarlyWarning::getBuildOrgCode, user.getEmpPosUnitCode()); |
|
|
|
projectEarlyWarningService.page(adventPage, adventPewWrapper); |
|
|
|
LambdaQueryWrapper<ProjectEarlyWarning> normalWrapper = Wrappers.lambdaQuery(ProjectEarlyWarning.class) |
|
|
|
.eq(ProjectEarlyWarning::getStatus, ProjectEarlyWarningStatusEnum.NORMAL.name()) |
|
|
|
.eq(user.getRegionAdmin()&&!user.getSuperAdmin(),ProjectEarlyWarning::getAreaCode,user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin()&&!user.getSuperAdmin()) || user.notAdmin(),ProjectEarlyWarning::getBuildOrgCode,user.getEmpPosUnitCode()); |
|
|
|
projectEarlyWarningService.page(normalPage,normalWrapper); |
|
|
|
.eq(user.getRegionAdmin() && !user.getSuperAdmin(), ProjectEarlyWarning::getAreaCode, user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), ProjectEarlyWarning::getBuildOrgCode, user.getEmpPosUnitCode()); |
|
|
|
projectEarlyWarningService.page(normalPage, normalWrapper); |
|
|
|
|
|
|
|
WorkbenchVO.WarningStatistics cuurent = new WorkbenchVO.WarningStatistics(); |
|
|
|
Long overTotal = overPage.getTotal(); |
|
|
|
Long adventTotal = adventPage.getTotal(); |
|
|
|
Long normalTotal = normalPage.getTotal(); |
|
|
|
cuurent.setAdvent(adventTotal.intValue()); |
|
|
|
cuurent.setOver(overTotal.intValue()); |
|
|
|
cuurent.setNormal(normalTotal.intValue()); |
|
|
|
long overTotal = overPage.getTotal(); |
|
|
|
long adventTotal = adventPage.getTotal(); |
|
|
|
long normalTotal = normalPage.getTotal(); |
|
|
|
cuurent.setAdvent((int) adventTotal); |
|
|
|
cuurent.setOver((int) overTotal); |
|
|
|
cuurent.setNormal((int) normalTotal); |
|
|
|
projectEarlyWarning.setCurrent(cuurent); |
|
|
|
|
|
|
|
List<WflowEarlyWarningRecords> warningRecords = earlyWarningRecordsService.list(Wrappers.lambdaQuery(WflowEarlyWarningRecords.class) |
|
|
|
.eq(user.getRegionAdmin()&&!user.getSuperAdmin(),WflowEarlyWarningRecords::getAreaCode,user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin()&&!user.getSuperAdmin()) || user.notAdmin(),WflowEarlyWarningRecords::getBuildOrgCode,user.getEmpPosUnitCode()) |
|
|
|
.eq(user.getRegionAdmin() && !user.getSuperAdmin(), WflowEarlyWarningRecords::getAreaCode, user.getRegionCode()) |
|
|
|
.eq((user.getIsOrgAdmin() && !user.getSuperAdmin()) || user.notAdmin(), WflowEarlyWarningRecords::getBuildOrgCode, user.getEmpPosUnitCode()) |
|
|
|
.orderByDesc(WflowEarlyWarningRecords::getWarningTime)); |
|
|
|
Set<String> projectCodeSet = Sets.newHashSet(); |
|
|
|
Map<String, WflowEarlyWarningRecords> warningMap = warningRecords.stream() |
|
|
|
.filter(w -> projectCodeSet.add(w.getProjectCode())) |
|
|
|
.collect(Collectors.toMap(WflowEarlyWarningRecords::getProjectCode, w -> w)); |
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(overPage.getRecords())){ |
|
|
|
if (CollUtil.isNotEmpty(overPage.getRecords())) { |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
List<ProjectEarlyWarningVO> overVos = overPage.getRecords().stream().map(o -> { |
|
|
|
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o,ProjectEarlyWarningVO.class); |
|
|
|
//取最新一条预警信息 |
|
|
|
if(warningMap.containsKey(vo.getProjectCode())){ |
|
|
|
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); |
|
|
|
vo.setWarningTime(record.getWarningTime()); |
|
|
|
vo.setInstStart(record.getInstStart()); |
|
|
|
vo.setWarningEmployeecode(record.getWarningEmployeecode()); |
|
|
|
vo.setNoticeMethod(record.getNoticeMethod()); |
|
|
|
vo.setNoticeContent(record.getNoticeContent()); |
|
|
|
vo.setPath(record.getPath()); |
|
|
|
vo.setBatchEmployees(record.getBatchEmployees()); |
|
|
|
vo.setRecordId(record.getId()); |
|
|
|
} |
|
|
|
vo.setProjectName(projectNameMap.get(o.getProjectCode())); |
|
|
|
return vo; |
|
|
|
}).sorted(Comparator.comparing(ProjectEarlyWarningVO::getWarningTime).reversed()) |
|
|
|
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); |
|
|
|
//取最新一条预警信息 |
|
|
|
if (warningMap.containsKey(vo.getProjectCode())) { |
|
|
|
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); |
|
|
|
vo.setWarningTime(record.getWarningTime()); |
|
|
|
vo.setInstStart(record.getInstStart()); |
|
|
|
vo.setWarningEmployeecode(record.getWarningEmployeecode()); |
|
|
|
vo.setNoticeMethod(record.getNoticeMethod()); |
|
|
|
vo.setNoticeContent(record.getNoticeContent()); |
|
|
|
vo.setPath(record.getPath()); |
|
|
|
vo.setBatchEmployees(record.getBatchEmployees()); |
|
|
|
vo.setRecordId(record.getId()); |
|
|
|
} else { |
|
|
|
vo.setWarningTime(now); |
|
|
|
} |
|
|
|
vo.setProjectName(projectNameMap.get(o.getProjectCode())); |
|
|
|
return vo; |
|
|
|
}).sorted(Comparator.comparing(ProjectEarlyWarningVO::getWarningTime).reversed()) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
projectEarlyWarning.setOvers(PageVo.of(overVos,overPage.getTotal())); |
|
|
|
}else{ |
|
|
|
projectEarlyWarning.setOvers(PageVo.of(overVos, overPage.getTotal())); |
|
|
|
} else { |
|
|
|
projectEarlyWarning.setOvers(PageVo.empty()); |
|
|
|
} |
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(adventPage.getRecords())){ |
|
|
|
if (CollUtil.isNotEmpty(adventPage.getRecords())) { |
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
List<ProjectEarlyWarningVO> adventVos = adventPage.getRecords().stream().map(o -> { |
|
|
|
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o,ProjectEarlyWarningVO.class); |
|
|
|
//取最新一条预警信息 |
|
|
|
if(warningMap.containsKey(vo.getProjectCode())){ |
|
|
|
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); |
|
|
|
vo.setWarningTime(record.getWarningTime()); |
|
|
|
vo.setInstStart(record.getInstStart()); |
|
|
|
vo.setWarningEmployeecode(record.getWarningEmployeecode()); |
|
|
|
vo.setNoticeMethod(record.getNoticeMethod()); |
|
|
|
vo.setNoticeContent(record.getNoticeContent()); |
|
|
|
vo.setPath(record.getPath()); |
|
|
|
vo.setBatchEmployees(record.getBatchEmployees()); |
|
|
|
vo.setRecordId(record.getId()); |
|
|
|
} |
|
|
|
vo.setProjectName(projectNameMap.get(o.getProjectCode())); |
|
|
|
return vo; |
|
|
|
}).sorted(Comparator.comparing(ProjectEarlyWarningVO::getWarningTime).reversed()) |
|
|
|
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); |
|
|
|
//取最新一条预警信息 |
|
|
|
if (warningMap.containsKey(vo.getProjectCode())) { |
|
|
|
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); |
|
|
|
vo.setWarningTime(record.getWarningTime()); |
|
|
|
vo.setInstStart(record.getInstStart()); |
|
|
|
vo.setWarningEmployeecode(record.getWarningEmployeecode()); |
|
|
|
vo.setNoticeMethod(record.getNoticeMethod()); |
|
|
|
vo.setNoticeContent(record.getNoticeContent()); |
|
|
|
vo.setPath(record.getPath()); |
|
|
|
vo.setBatchEmployees(record.getBatchEmployees()); |
|
|
|
vo.setRecordId(record.getId()); |
|
|
|
} else { |
|
|
|
vo.setWarningTime(now); |
|
|
|
} |
|
|
|
vo.setProjectName(projectNameMap.get(o.getProjectCode())); |
|
|
|
return vo; |
|
|
|
}).sorted(Comparator.comparing(ProjectEarlyWarningVO::getWarningTime).reversed()) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
projectEarlyWarning.setAdvents(PageVo.of(adventVos,adventPage.getTotal())); |
|
|
|
}else{ |
|
|
|
projectEarlyWarning.setAdvents(PageVo.of(adventVos, adventPage.getTotal())); |
|
|
|
} else { |
|
|
|
projectEarlyWarning.setAdvents(PageVo.empty()); |
|
|
|
} |
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(normalPage.getRecords())){ |
|
|
|
if (CollUtil.isNotEmpty(normalPage.getRecords())) { |
|
|
|
List<ProjectEarlyWarningVO> normalVos = normalPage.getRecords().stream().map(o -> { |
|
|
|
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o,ProjectEarlyWarningVO.class); |
|
|
|
//取最新一条预警信息 |
|
|
|
if(warningMap.containsKey(vo.getProjectCode())){ |
|
|
|
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); |
|
|
|
vo.setWarningTime(record.getWarningTime()); |
|
|
|
vo.setInstStart(record.getInstStart()); |
|
|
|
vo.setWarningEmployeecode(record.getWarningEmployeecode()); |
|
|
|
vo.setNoticeMethod(record.getNoticeMethod()); |
|
|
|
vo.setNoticeContent(record.getNoticeContent()); |
|
|
|
vo.setPath(record.getPath()); |
|
|
|
vo.setBatchEmployees(record.getBatchEmployees()); |
|
|
|
vo.setRecordId(record.getId()); |
|
|
|
} |
|
|
|
vo.setProjectName(projectNameMap.get(o.getProjectCode())); |
|
|
|
return vo; |
|
|
|
}).sorted(Comparator.comparing(ProjectEarlyWarningVO::getId).reversed()) |
|
|
|
ProjectEarlyWarningVO vo = BeanUtil.copyProperties(o, ProjectEarlyWarningVO.class); |
|
|
|
//取最新一条预警信息 |
|
|
|
if (warningMap.containsKey(vo.getProjectCode())) { |
|
|
|
WflowEarlyWarningRecords record = warningMap.get(vo.getProjectCode()); |
|
|
|
vo.setWarningTime(record.getWarningTime()); |
|
|
|
vo.setInstStart(record.getInstStart()); |
|
|
|
vo.setWarningEmployeecode(record.getWarningEmployeecode()); |
|
|
|
vo.setNoticeMethod(record.getNoticeMethod()); |
|
|
|
vo.setNoticeContent(record.getNoticeContent()); |
|
|
|
vo.setPath(record.getPath()); |
|
|
|
vo.setBatchEmployees(record.getBatchEmployees()); |
|
|
|
vo.setRecordId(record.getId()); |
|
|
|
} |
|
|
|
vo.setProjectName(projectNameMap.get(o.getProjectCode())); |
|
|
|
return vo; |
|
|
|
}).sorted(Comparator.comparing(ProjectEarlyWarningVO::getId).reversed()) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
projectEarlyWarning.setNormals(PageVo.of(normalVos,normalPage.getTotal())); |
|
|
|
}else{ |
|
|
|
projectEarlyWarning.setNormals(PageVo.of(normalVos, normalPage.getTotal())); |
|
|
|
} else { |
|
|
|
projectEarlyWarning.setNormals(PageVo.empty()); |
|
|
|
} |
|
|
|
return projectEarlyWarning; |
|
|
@@ -298,6 +301,7 @@ public class WorkbenchManage { |
|
|
|
|
|
|
|
/** |
|
|
|
* 催办 |
|
|
|
* |
|
|
|
* @param recordId |
|
|
|
* @return |
|
|
|
*/ |
|
|
@@ -314,12 +318,11 @@ public class WorkbenchManage { |
|
|
|
Integer ruleType = record.getRuleType(); |
|
|
|
String areaCode = record.getAreaCode(); |
|
|
|
//如果是临期 可以取到 超期的小时数 |
|
|
|
Integer overTime = record.getOverTime(); |
|
|
|
String path = record.getPath(); |
|
|
|
LocalDateTime instStart = record.getInstStart(); |
|
|
|
Integer biz = record.getBiz(); |
|
|
|
VUtils.isTrue(Objects.isNull(project)).throwMessage("催办失败,项目不存在!"); |
|
|
|
if(StringUtils.isBlank(batchEmployees)){ |
|
|
|
if (StringUtils.isBlank(batchEmployees)) { |
|
|
|
//如果批次员工号不存在 就取当前 |
|
|
|
batchEmployees = record.getWarningEmployeecode(); |
|
|
|
} |
|
|
@@ -330,24 +333,20 @@ public class WorkbenchManage { |
|
|
|
.eq(WflowEarlyWarning::getRuleType, ruleType) |
|
|
|
.last(BizConst.LIMIT_1)); |
|
|
|
//如果配置能取到 就取模板的 |
|
|
|
if(Objects.nonNull(config)){ |
|
|
|
if (Objects.nonNull(config)) { |
|
|
|
noticeContent = config.getNoticeContent(); |
|
|
|
} |
|
|
|
|
|
|
|
VUtils.isTrue(StringUtils.isBlank(batchEmployees)) |
|
|
|
.throwMessage("催办失败,员工为空!"); |
|
|
|
.throwMessage("催办失败,员工为空!"); |
|
|
|
String[] employees = batchEmployees.split(StrPool.COMMA); |
|
|
|
//算出 当前和他的 小时差 临期 |
|
|
|
Long adventBetween = ChronoUnit.HOURS.between(instStart,LocalDateTime.now()); |
|
|
|
Integer times = 0; |
|
|
|
for(String employee : employees){ |
|
|
|
earlyWarningManage.urging(noticeMethod,noticeContent,adventBetween.intValue() |
|
|
|
,adventBetween.intValue(),biz, |
|
|
|
instStart,employee,project, |
|
|
|
ruleType,noticeType,path,batchEmployees,record.getNodeId()); |
|
|
|
times++; |
|
|
|
long adventBetween = ChronoUnit.HOURS.between(instStart, LocalDateTime.now()); |
|
|
|
for (String employee : employees) { |
|
|
|
earlyWarningManage.urging(noticeMethod, noticeContent, (int) adventBetween, (int) adventBetween, |
|
|
|
biz, instStart, employee, project, ruleType, noticeType, path, batchEmployees, record.getNodeId()); |
|
|
|
} |
|
|
|
|
|
|
|
return "催办成功了" + times + "个人"; |
|
|
|
return "催办成功了" + employees.length + "个人"; |
|
|
|
} |
|
|
|
|
|
|
|
} |