提交代码

dev_xds
姜玉琦 2024-04-06 13:54:56 +08:00
parent 1dc7cdf4f3
commit d525dcd0a6
3 changed files with 27 additions and 17 deletions

View File

@ -8,6 +8,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
import com.ruoyi.flowable.service.IFlowBusinessKeyService;
import com.ruoyi.system.domain.FlowTaskEntity;
@ -29,7 +30,7 @@ public class FloweController extends BaseController {
private RedisCache redisCache;
@GetMapping("/groupByCategory")
public AjaxResult groupByCategory(long deptId,long projectId,long proType){
public AjaxResult groupByCategory(long deptId,long projectId,String proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -43,14 +44,16 @@ public class FloweController extends BaseController {
}
where.setProjectDeptId(deptId<1?null:""+deptId);
where.setBusinessKey(projectId<1?null:""+projectId);
where.setProType(proType<1?null:""+proType);
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<FlowTaskEntity> list=flowBusinessKeyService.groupByCategory(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
@GetMapping("/groupByUnit")
public AjaxResult groupByUnit(long deptId,long projectId,long proType){
public AjaxResult groupByUnit(long deptId,long projectId,String proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -65,7 +68,9 @@ public class FloweController extends BaseController {
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<FlowTaskEntity> list=flowBusinessKeyService.groupByUnit(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
@ -73,7 +78,7 @@ public class FloweController extends BaseController {
@GetMapping("/groupByUnitFinish")
public AjaxResult groupByUnitFinish(long deptId,long projectId,long proType){
public AjaxResult groupByUnitFinish(long deptId,long projectId,String proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -88,7 +93,9 @@ public class FloweController extends BaseController {
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<FlowTaskEntity> list=flowBusinessKeyService.groupByUnitFinish(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
@ -96,7 +103,7 @@ public class FloweController extends BaseController {
@GetMapping("/groupByUnitTotal")
public AjaxResult groupByUnitTotal(long deptId,long projectId,long proType){
public AjaxResult groupByUnitTotal(long deptId,long projectId,String proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
@ -111,7 +118,9 @@ public class FloweController extends BaseController {
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<FlowTaskEntity> list=flowBusinessKeyService.groupByUnitTotal(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
@ -198,14 +207,14 @@ public class FloweController extends BaseController {
* JiangYuQi
*/
@GetMapping("/findSafetyWorkList")
public AjaxResult findSafetyWorkList(long deptId,long projectId,String flowType,long proType){
public AjaxResult findSafetyWorkList(long deptId,long projectId,String flowType,String proType){
FlowTaskEntity where=new FlowTaskEntity();
if(deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_flow_findSafetyWorkList_"+deptId+"_"+projectId+"_"+flowType+"_"+proType+Md5Utils.hash(where.getPrjIds());
String key="bgscreen_flow_findSafetyWorkList_"+deptId+"_"+projectId+"_"+flowType+"_"+proType+"_"+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
@ -214,7 +223,9 @@ public class FloweController extends BaseController {
where.setProcDefKey(FlowTypeMapper.getFlowProcdefKey(flowType));
where.setProjectDeptId(deptId<1?"":""+deptId);
where.setBusinessKey(projectId<1?"":""+projectId);
where.setProType(proType<1?null:""+proType);
if(StringUtils.isNotNull(proType) && !"0".equals(proType)){
where.setProType(proType);
}
List<FlowTaskEntity> list=flowBusinessKeyService.findSafetyWorkList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);

View File

@ -353,9 +353,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="groupAllByComany" parameterType="SurProjectAttendanceData" resultMap="SurProjectAttendanceDataResult">
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g
left join sur_project sp on c.project_id = sp.id
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.state=0
select g.companyTypeId,count(1) id from sur_project_attendance_user u, sur_project_attendance_cfg c,view_sur_project_attendance_group g,sur_project sp
where u.cfgid=c.id and u.state=0 and u.companyId=g.companyId and u.state=0 and c.project_id = sp.id
and g.companyTypeId in (0,1,2,3,4,5,6,8)
<if test="projectId!=null and projectId>0">
and c.project_id=#{projectId}

View File

@ -174,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countCompletionRate" parameterType="SurProjectBuildNodeData" resultMap="SurProjectBuildNodeDataResultNode">
SELECT IF(b.cnt,b.cnt,0) id ,IF(c.cnt,c.cnt,0) node_id,a.project_id,a.projectName,a.node_text,a.node_lvl FROM (
SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
SELECT MAX(vbn.id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>
@ -190,7 +190,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT a.project_id,COUNT(1) cnt FROM vw_sur_project_build_node_data_current a,
(SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
SELECT MAX(vbn.id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>
@ -208,7 +208,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN(
SELECT a.project_id,COUNT(1) cnt FROM vw_sur_project_build_node_data_current a,
(SELECT * FROM vw_sur_project_build_node_data_current WHERE id IN (
SELECT MAX(id) FROM vw_sur_project_build_node_data_current vbn
SELECT MAX(vbn.id) FROM vw_sur_project_build_node_data_current vbn
left join sur_project sp on sp.id = vbn.project_id
WHERE LENGTH(vbn.node_lvl)=2
<if test="projectId !=null and projectId !=0">and vbn.project_id=#{projectId}</if>