dev_xds
姜玉琦 2023-08-27 00:19:25 +08:00
commit 4f0181d7db
5 changed files with 56 additions and 44 deletions

View File

@ -1,6 +1,7 @@
package com.yanzhu.jh.bigscreen.web.controller; package com.yanzhu.jh.bigscreen.web.controller;
import cn.hutool.core.date.DateUtil;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -34,16 +35,19 @@ public class ProblemmodifyController extends BaseController {
* @param roleType * @param roleType
* @return * @return
*/ */
@GetMapping("/safetySummary") @PostMapping("/safetySummary")
public List<SmzSspProblemmodify> safetySummary(int deptId,int roleType,int projectId) public List<SmzSspProblemmodify> safetySummary(@RequestBody SmzSspProblemmodifyWhere where)
{ {
//3集团//4子公司//5监理单位//6总包//7分包 //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); Object obj=redisCache.getCacheObject(key);
if(obj!=null){ if(obj!=null){
return (List<SmzSspProblemmodify>) obj; return (List<SmzSspProblemmodify>) obj;
} }
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummary(deptId,roleType,projectId,0); List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummary(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list; return list;
} }
@ -55,16 +59,19 @@ public class ProblemmodifyController extends BaseController {
* @param roleType * @param roleType
* @return * @return
*/ */
@GetMapping("/qualitySummary") @PostMapping("/qualitySummary")
public List<SmzSspProblemmodify> qualitySummary(int deptId,int roleType,int projectId) public List<SmzSspProblemmodify> qualitySummary(@RequestBody SmzSspProblemmodifyWhere where)
{ {
//3集团//4子公司//5监理单位//6总包//7分包 //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); Object obj=redisCache.getCacheObject(key);
if(obj!=null){ if(obj!=null){
return (List<SmzSspProblemmodify>) obj; return (List<SmzSspProblemmodify>) obj;
} }
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummary(deptId,roleType,projectId,1); List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummary(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list; return list;
} }
@ -76,16 +83,19 @@ public class ProblemmodifyController extends BaseController {
* @param roleType * @param roleType
* @return * @return
*/ */
@GetMapping("/safetySummaryByProject") @PostMapping("/safetySummaryByProject")
public List<SmzSspProblemmodify> safetySummaryByProject(int deptId,int roleType,int projectId) public List<SmzSspProblemmodify> safetySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where)
{ {
//3集团//4子公司//5监理单位//6总包//7分包 //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); Object obj=redisCache.getCacheObject(key);
if(obj!=null){ if(obj!=null){
return (List<SmzSspProblemmodify>) obj; return (List<SmzSspProblemmodify>) obj;
} }
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummaryByProject(deptId,roleType,projectId,0); List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummaryByProject(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list; return list;
} }
@ -97,16 +107,20 @@ public class ProblemmodifyController extends BaseController {
* @param roleType * @param roleType
* @return * @return
*/ */
@GetMapping("/qualitySummaryByProject") @PostMapping("/qualitySummaryByProject")
public List<SmzSspProblemmodify> qualitySummaryByProject(int deptId,int roleType,int projectId) public List<SmzSspProblemmodify> qualitySummaryByProject(@RequestBody SmzSspProblemmodifyWhere where)
{ {
//3集团//4子公司//5监理单位//6总包//7分包 //3集团//4子公司//5监理单位//6总包//7分包 int deptId,int roleType,int projectId
String key="problemmodify_qualitySummaryByProject-"+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_qualitySummaryByProject-"+where.getDeptId()+"-"+where.getRoleType()+"_"+where.getProjectId()+"-"+startDate+"_"+endDate;
Object obj=redisCache.getCacheObject(key); Object obj=redisCache.getCacheObject(key);
if(obj!=null){ if(obj!=null){
return (List<SmzSspProblemmodify>) obj; return (List<SmzSspProblemmodify>) obj;
} }
List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummaryByProject(deptId,roleType,projectId,1); List<SmzSspProblemmodify> list = smzSspProblemmodifyService.selectSummaryByProject(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return list; return list;
} }

View File

@ -94,17 +94,17 @@ public interface SmzSspProblemmodifyMapper
/** /**
* *
* @param smzSspProblemmodify * @param where
* @return * @return
*/ */
public List<SmzSspProblemmodify> selectSummary(SmzSspProblemmodify smzSspProblemmodify); public List<SmzSspProblemmodify> selectSummary(SmzSspProblemmodifyWhere where);
/** /**
* *
* @param smzSspProblemmodify * @param where
* @return * @return
*/ */
public List<SmzSspProblemmodify> selectSummaryByProject(SmzSspProblemmodify smzSspProblemmodify); public List<SmzSspProblemmodify> selectSummaryByProject(SmzSspProblemmodifyWhere where);
/** /**
* *

View File

@ -93,7 +93,7 @@ public interface ISmzSspProblemmodifyService
* @param infoType 01 * @param infoType 01
* @return * @return
*/ */
public List<SmzSspProblemmodify> selectSummary(int deptId, int roleType,int projectId, int infoType); public List<SmzSspProblemmodify> selectSummary(SmzSspProblemmodifyWhere where);
/** /**
* () * ()
@ -102,7 +102,7 @@ public interface ISmzSspProblemmodifyService
* @param infoType 01 * @param infoType 01
* @return * @return
*/ */
public List<SmzSspProblemmodify> selectSummaryByProject(int deptId, int roleType,int projectId, int infoType); public List<SmzSspProblemmodify> selectSummaryByProject(SmzSspProblemmodifyWhere where);
public List<SmzSspProblemmodify> countByDate(SmzSspProblemmodifyWhere where); public List<SmzSspProblemmodify> countByDate(SmzSspProblemmodifyWhere where);

View File

@ -202,23 +202,13 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi
} }
@Override @Override
public List<SmzSspProblemmodify> selectSummary(int deptId, int roleType,int projectId, int infoType) { public List<SmzSspProblemmodify> selectSummary(SmzSspProblemmodifyWhere where) {
SmzSspProblemmodify smzSspProblemmodify=new SmzSspProblemmodify(); return smzSspProblemmodifyMapper.selectSummary(where);
smzSspProblemmodify.setRoleType(roleType);
smzSspProblemmodify.setProjectId((long)projectId);
smzSspProblemmodify.setInfoType((long)infoType);
smzSspProblemmodify.setId((long)deptId);
return smzSspProblemmodifyMapper.selectSummary(smzSspProblemmodify);
} }
@Override @Override
public List<SmzSspProblemmodify> selectSummaryByProject(int deptId, int roleType,int projectId, int infoType) { public List<SmzSspProblemmodify> selectSummaryByProject(SmzSspProblemmodifyWhere where) {
SmzSspProblemmodify smzSspProblemmodify=new SmzSspProblemmodify(); return smzSspProblemmodifyMapper.selectSummaryByProject(where);
smzSspProblemmodify.setRoleType(roleType);
smzSspProblemmodify.setProjectId((long)projectId);
smzSspProblemmodify.setInfoType((long)infoType);
smzSspProblemmodify.setId((long)deptId);
return smzSspProblemmodifyMapper.selectSummaryByProject(smzSspProblemmodify);
} }
@Override @Override

View File

@ -349,7 +349,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<select id="selectSummary" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult"> <select id="selectSummary" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
SELECT a.dict_value id,a.dict_label problemArea,b.cnt roleType FROM (SELECT * FROM sys_dict_data SELECT a.dict_value id,a.dict_label problemArea,b.cnt roleType FROM (SELECT * FROM sys_dict_data
<where> <where>
<if test="infoType==0">and dict_type='ssp_aqyhlx'</if> <if test="infoType==0">and dict_type='ssp_aqyhlx'</if>
@ -361,21 +361,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT id FROM sur_project SELECT id FROM sur_project
where isDel=0 where isDel=0
<if test="projectId>0">and projectId=#{projectId}</if> <if test="projectId>0">and projectId=#{projectId}</if>
<if test="id >0 ">AND deptid = #{id}</if> <if test="deptId >0 ">AND deptid = #{deptId}</if>
) AND infotype=#{infoType} and isDel=0 ) AND infotype=#{infoType} and isDel=0
<if test="roleType > 0">AND roletype=#{roleType}</if> <if test="roleType > 0">AND roletype=#{roleType}</if>
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if>
GROUP BY danger_type) b GROUP BY danger_type) b
ON a.dict_value=b.danger_type ORDER BY cnt DESC,a.dict_value+0 ON a.dict_value=b.danger_type ORDER BY cnt DESC,a.dict_value+0
</select> </select>
<select id="selectSummaryByProject" parameterType="SmzSspProblemmodify" resultMap="SmzSspProblemmodifyResult"> <select id="selectSummaryByProject" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
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 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 select projectId,prjName,count(1) proble from vw_smz_ssp_problemmodify_audit
where infoType=#{infoType} where infoType=#{infoType}
<if test="projectId>0">and projectId=#{projectId}</if> <if test="projectId>0">and projectId=#{projectId}</if>
<if test="id >0 ">AND deptid = #{id}</if> <if test="deptId >0 ">AND deptid = #{deptId}</if>
<if test="roleType > 0">AND roletype=#{roleType}</if> <if test="roleType > 0">AND roletype=#{roleType}</if>
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if>
group by projectId,prjName group by projectId,prjName
) )
a a
@ -384,8 +388,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
((updateTime is null and date(nickedTime) &lt; date(now()) ) or date(updateTime )>date(nickedTime)) ((updateTime is null and date(nickedTime) &lt; date(now()) ) or date(updateTime )>date(nickedTime))
and infoType=#{infoType} and infoType=#{infoType}
<if test="projectId>0">and projectId=#{projectId}</if> <if test="projectId>0">and projectId=#{projectId}</if>
<if test="id >0 ">AND deptid = #{id}</if> <if test="deptId >0 ">AND deptid = #{deptId}</if>
<if test="roleType > 0">AND roletype=#{roleType}</if> <if test="roleType > 0">AND roletype=#{roleType}</if>
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if>
group by projectId group by projectId
) b on a.projectId=b.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) &lt; date(now()) ) SELECT projectid,COUNT(1) timoutComp FROM vw_smz_ssp_problemmodify_audit WHERE (updateTime is null and date(nickedTime) &lt; date(now()) )
and infoType=#{infoType} and infoType=#{infoType}
<if test="projectId>0">and projectId=#{projectId}</if> <if test="projectId>0">and projectId=#{projectId}</if>
<if test="id >0 ">AND deptid = #{id}</if> <if test="deptId >0 ">AND deptid = #{deptId}</if>
<if test="roleType > 0">AND roletype=#{roleType}</if> <if test="roleType > 0">AND roletype=#{roleType}</if>
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if>
GROUP BY projectid GROUP BY projectid
) c on a.projectId=c.projectId ) c on a.projectId=c.projectId
@ -407,7 +415,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId &lt;= 0"> <if test="projectId &lt;= 0">
AND projectId IN ( AND projectId IN (
SELECT id FROM sur_project WHERE isdel=0 SELECT id FROM sur_project WHERE isdel=0
<if test="deptId >0 ">AND deptid = #{id}</if> <if test="deptId >0 ">AND deptid = #{deptId}</if>
) )
</if> </if>
and DATE(createTime)=Date(#{startDate}) and DATE(createTime)=Date(#{startDate})