diff --git a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java index 94763c20..1331d348 100644 --- a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java +++ b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProblemmodifyController.java @@ -1,6 +1,7 @@ package com.yanzhu.jh.bigscreen.web.controller; +import cn.hutool.core.date.DateUtil; import com.ruoyi.common.constant.Constants; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; @@ -34,16 +35,19 @@ public class ProblemmodifyController extends BaseController { * @param roleType * @return */ - @GetMapping("/safetySummary") - public List safetySummary(int deptId,int roleType,int projectId) + @PostMapping("/safetySummary") + public List safetySummary(@RequestBody SmzSspProblemmodifyWhere where) { //3集团//4子公司//5监理单位//6总包//7分包 - String key="problemmodify_safetySummary-"+deptId+"-"+roleType+"_"+projectId; + where.setInfoType(0l); + String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd"); + String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd"); + String key="problemmodify_safetySummary-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate; Object obj=redisCache.getCacheObject(key); if(obj!=null){ return (List) obj; } - List list = smzSspProblemmodifyService.selectSummary(deptId,roleType,projectId,0); + List list = smzSspProblemmodifyService.selectSummary(where); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); return list; } @@ -55,16 +59,19 @@ public class ProblemmodifyController extends BaseController { * @param roleType * @return */ - @GetMapping("/qualitySummary") - public List qualitySummary(int deptId,int roleType,int projectId) + @PostMapping("/qualitySummary") + public List qualitySummary(@RequestBody SmzSspProblemmodifyWhere where) { //3集团//4子公司//5监理单位//6总包//7分包 - String key="problemmodify_qualitySummary-"+deptId+"-"+roleType+"_"+projectId; + where.setInfoType(1l); + String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd"); + String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd"); + String key="problemmodify_qualitySummary-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate; Object obj=redisCache.getCacheObject(key); if(obj!=null){ return (List) obj; } - List list = smzSspProblemmodifyService.selectSummary(deptId,roleType,projectId,1); + List list = smzSspProblemmodifyService.selectSummary(where); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); return list; } @@ -76,16 +83,19 @@ public class ProblemmodifyController extends BaseController { * @param roleType * @return */ - @GetMapping("/safetySummaryByProject") - public List safetySummaryByProject(int deptId,int roleType,int projectId) + @PostMapping("/safetySummaryByProject") + public List safetySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where) { //3集团//4子公司//5监理单位//6总包//7分包 - String key="problemmodify_safetySummaryByProject-"+deptId+"-"+roleType+"_"+projectId; + where.setInfoType(0l); + String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd"); + String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd"); + String key="problemmodify_safetySummaryByProject-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate; Object obj=redisCache.getCacheObject(key); if(obj!=null){ return (List) obj; } - List list = smzSspProblemmodifyService.selectSummaryByProject(deptId,roleType,projectId,0); + List list = smzSspProblemmodifyService.selectSummaryByProject(where); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); return list; } @@ -97,16 +107,20 @@ public class ProblemmodifyController extends BaseController { * @param roleType * @return */ - @GetMapping("/qualitySummaryByProject") - public List qualitySummaryByProject(int deptId,int roleType,int projectId) + @PostMapping("/qualitySummaryByProject") + public List qualitySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where) { - //3集团//4子公司//5监理单位//6总包//7分包 - String key="problemmodify_qualitySummaryByProject-"+deptId+"-"+roleType+"_"+projectId; + //3集团//4子公司//5监理单位//6总包//7分包 int deptId,int roleType,int projectId + where.setInfoType(1l); + String startDate=where.getStartDate()==null?"":DateUtil.format(where.getStartDate(),"yyyy-MM-dd"); + String endDate=where.getEndDate()==null?"":DateUtil.format(where.getEndDate(),"yyyy-MM-dd"); + String key="problemmodify_qualitySummaryByProject-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate; + Object obj=redisCache.getCacheObject(key); if(obj!=null){ return (List) obj; } - List list = smzSspProblemmodifyService.selectSummaryByProject(deptId,roleType,projectId,1); + List list = smzSspProblemmodifyService.selectSummaryByProject(where); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); return list; } diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/mapper/SmzSspProblemmodifyMapper.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/mapper/SmzSspProblemmodifyMapper.java index 89a7dd84..74cb23da 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/mapper/SmzSspProblemmodifyMapper.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/mapper/SmzSspProblemmodifyMapper.java @@ -94,17 +94,17 @@ public interface SmzSspProblemmodifyMapper /** * 按安全类型分组查询 - * @param smzSspProblemmodify + * @param where * @return */ - public List selectSummary(SmzSspProblemmodify smzSspProblemmodify); + public List selectSummary(SmzSspProblemmodifyWhere where); /** * 按项目分组统计 - * @param smzSspProblemmodify + * @param where * @return */ - public List selectSummaryByProject(SmzSspProblemmodify smzSspProblemmodify); + public List selectSummaryByProject(SmzSspProblemmodifyWhere where); /** * 查询某天预警数 diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/ISmzSspProblemmodifyService.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/ISmzSspProblemmodifyService.java index 5a56b807..ed458a9d 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/ISmzSspProblemmodifyService.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/ISmzSspProblemmodifyService.java @@ -93,7 +93,7 @@ public interface ISmzSspProblemmodifyService * @param infoType 信息类型(0安全,1质量) * @return */ - public List selectSummary(int deptId, int roleType,int projectId, int infoType); + public List selectSummary(SmzSspProblemmodifyWhere where); /** * 分类汇总(按项目) @@ -102,7 +102,7 @@ public interface ISmzSspProblemmodifyService * @param infoType 信息类型(0安全,1质量) * @return */ - public List selectSummaryByProject(int deptId, int roleType,int projectId, int infoType); + public List selectSummaryByProject(SmzSspProblemmodifyWhere where); public List countByDate(SmzSspProblemmodifyWhere where); diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/impl/SmzSspProblemmodifyServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/impl/SmzSspProblemmodifyServiceImpl.java index 5292b6a9..d4ef9305 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/impl/SmzSspProblemmodifyServiceImpl.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/trouble/service/impl/SmzSspProblemmodifyServiceImpl.java @@ -202,23 +202,13 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi } @Override - public List selectSummary(int deptId, int roleType,int projectId, int infoType) { - SmzSspProblemmodify smzSspProblemmodify=new SmzSspProblemmodify(); - smzSspProblemmodify.setRoleType(roleType); - smzSspProblemmodify.setProjectId((long)projectId); - smzSspProblemmodify.setInfoType((long)infoType); - smzSspProblemmodify.setId((long)deptId); - return smzSspProblemmodifyMapper.selectSummary(smzSspProblemmodify); + public List selectSummary(SmzSspProblemmodifyWhere where) { + return smzSspProblemmodifyMapper.selectSummary(where); } @Override - public List selectSummaryByProject(int deptId, int roleType,int projectId, int infoType) { - SmzSspProblemmodify smzSspProblemmodify=new SmzSspProblemmodify(); - smzSspProblemmodify.setRoleType(roleType); - smzSspProblemmodify.setProjectId((long)projectId); - smzSspProblemmodify.setInfoType((long)infoType); - smzSspProblemmodify.setId((long)deptId); - return smzSspProblemmodifyMapper.selectSummaryByProject(smzSspProblemmodify); + public List selectSummaryByProject(SmzSspProblemmodifyWhere where) { + return smzSspProblemmodifyMapper.selectSummaryByProject(where); } @Override diff --git a/yanzhu-jh/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml b/yanzhu-jh/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml index 40b672af..deb25388 100644 --- a/yanzhu-jh/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml @@ -349,7 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - SELECT a.dict_value id,a.dict_label problemArea,b.cnt roleType FROM (SELECT * FROM sys_dict_data and dict_type='ssp_aqyhlx' @@ -361,21 +361,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT id FROM sur_project where isDel=0 and projectId=#{projectId} - AND deptid = #{id} + AND deptid = #{deptId} ) AND infotype=#{infoType} and isDel=0 AND roletype=#{roleType} + and DATE(createtime)>=DATE(#{startDate}) + and DATE(createtime) <= DATE(#{endDate}) GROUP BY danger_type) b ON a.dict_value=b.danger_type ORDER BY cnt DESC,a.dict_value+0 - select a.projectId,a.prjName projectName,a.proble id,if(b.timoutNoComp is null,0,b.timoutNoComp) infoType,if(c.timoutComp is null,0,c.timoutComp) checkState from ( select projectId,prjName,count(1) proble from vw_smz_ssp_problemmodify_audit where infoType=#{infoType} and projectId=#{projectId} - AND deptid = #{id} + AND deptid = #{deptId} AND roletype=#{roleType} + and DATE(createtime)>=DATE(#{startDate}) + and DATE(createtime) <= DATE(#{endDate}) group by projectId,prjName ) a @@ -384,8 +388,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ((updateTime is null and date(nickedTime) < date(now()) ) or date(updateTime )>date(nickedTime)) and infoType=#{infoType} and projectId=#{projectId} - AND deptid = #{id} + AND deptid = #{deptId} AND roletype=#{roleType} + and DATE(createtime)>=DATE(#{startDate}) + and DATE(createtime) <= DATE(#{endDate}) group by projectId ) b on a.projectId=b.projectId @@ -393,8 +399,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT projectid,COUNT(1) timoutComp FROM vw_smz_ssp_problemmodify_audit WHERE (updateTime is null and date(nickedTime) < date(now()) ) and infoType=#{infoType} and projectId=#{projectId} - AND deptid = #{id} + AND deptid = #{deptId} AND roletype=#{roleType} + and DATE(createtime)>=DATE(#{startDate}) + and DATE(createtime) <= DATE(#{endDate}) GROUP BY projectid ) c on a.projectId=c.projectId @@ -407,7 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND projectId IN ( SELECT id FROM sur_project WHERE isdel=0 - AND deptid = #{id} + AND deptid = #{deptId} ) and DATE(createTime)=Date(#{startDate})