提交代码

dev_xds
姜玉琦 2024-04-15 22:39:48 +08:00
parent 225c258af3
commit b60ad07a83
2 changed files with 20 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package com.yanzhu.jh.project.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.SysRoleEnum;
@ -32,6 +33,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* ProjectViewController
@ -43,6 +45,9 @@ import java.util.List;
@RequestMapping("/statistics/project")
public class ProjectViewController extends BaseBuildNodeController{
@Autowired
private RedisCache redisCache;
@Autowired
private ISysDeptService sysDeptService;
@ -57,7 +62,13 @@ public class ProjectViewController extends BaseBuildNodeController{
if(SysRoleEnum.ZGS.getCode().equals(surProject.getNowRole())){
surProject.setDeptId(sysDeptService.getZGSDeptId(getDeptId()));
}
List<ProjectViewExport> list = projectViewService.selectStatisticsProjectList(surProject);
String key = "statistics.project.selectStatisticsProjectList-"+surProject.getProjectName()+"-"+surProject.getDeptId()+"-"+surProject.getProjectType()+"-"+surProject.getProjectNature();
List<ProjectViewExport> list = redisCache.getCacheObject(key);
if(list!=null){
return getDataTable(list);
}
list = projectViewService.selectStatisticsProjectList(surProject);
redisCache.setCacheObject(key,list,5, TimeUnit.MINUTES);
return getDataTable(list);
}
@ -628,7 +639,13 @@ public class ProjectViewController extends BaseBuildNodeController{
if(SysRoleEnum.ZGS.getCode().equals(surProject.getNowRole())){
surProject.setDeptId(sysDeptService.getZGSDeptId(getDeptId()));
}
List<ProjectViewJlExport> list = projectViewService.selectStatisticsJlProjectList(surProject);
String key = "statistics.project.selectStatisticsJlProjectList-"+surProject.getProjectName()+"-"+surProject.getDeptId()+"-"+surProject.getProjectType()+"-"+surProject.getProjectNature();
List<ProjectViewJlExport> list = redisCache.getCacheObject(key);
if(list!=null){
return getDataTable(list);
}
list = projectViewService.selectStatisticsJlProjectList(surProject);
redisCache.setCacheObject(key,list,5, TimeUnit.MINUTES);
return getDataTable(list);
}

View File

@ -38,7 +38,7 @@
(select count(1) from dev_ai_project_config a where a.project_id = sp.id and a.dept_id = pui.unitId and a.is_del=0)as aijk,
(select count(1) from dev_ai_project_data a where a.project_id = sp.id and a.dept_id = pui.unitId and a.is_del=0)as aiyjs,
(select count(1) from sur_project_attendance_cfg a where a.project_id = sp.id and a.sub_dept_id = pui.unitId and a.state=0)as lwsm,
(select count(1) from sur_project_attendance_user a left join sur_project_attendance_cfg b on a.cfgid = b.id where b.project_id = sp.id and b.sub_dept_id = pui.unitId and b.state=0)as lwry,
(select count(1) from sur_project_attendance_user a left join sur_project_attendance_cfg b on a.cfgid = b.id where b.project_id = sp.id and b.sub_dept_id = pui.unitId and b.state=0 and and a.state=0 and b.is_del=0)as lwry,
(select count(1) from vw_flow_all a where a.businessKey = sp.id and a.startDeptName = pui.unitName and a.finishTime is null)as gcsq,
(select count(1) from vw_flow_all a where a.businessKey = sp.id and a.startDeptName = pui.unitName and a.finishTime is not null)as gcsp,
(select count(1) from sur_project_standard a where a.project_id = sp.id and a.dept_id = pui.unitId and a.is_del=0)as bzh,
@ -78,7 +78,6 @@
(select count(1) from sur_project_measure a where a.project_id = sp.id and a.is_del=0 and approve_status=4)as csclwc,
(select count(1) from sur_project_material_seal a where a.project_id = sp.id and a.is_del=0 and approve_status=1)as clfy,
(select count(1) from sur_project_material_seal a where a.project_id = sp.id and a.is_del=0 and approve_status=4)as clfywc,
(select count(DISTINCT a.procInsId) from vw_flow_await a where a.businessKey = sp.id and a.taskName like '%监理%')as gcsq,
(select count(DISTINCT a.procInsId) from vw_flow_finished a where a.businessKey = sp.id and a.taskName like '%监理%')as gcsp
from sur_project sp