update code

dev_xds
haha 2024-05-09 22:02:20 +08:00
parent 3c6ec3fb1d
commit 19c540b97e
10 changed files with 94 additions and 9 deletions

View File

@ -70,4 +70,15 @@ public class ProjectCheckDetectionController extends BaseController {
List<SurProjectCheckDetection> list=checkDetectionService.getList(where);
return getDataTable(list);
}
/**
* CheckType
* @param where
* @return
*/
@PostMapping("/groupCheckType")
public AjaxResult groupCheckType(@RequestBody SurProjectCheckDetection where){
List<SurProjectCheckDetection> list=checkDetectionService.groupCheckType(where);
return AjaxResult.success(list);
}
}

View File

@ -3,6 +3,7 @@ package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.sign.Md5Utils;
@ -51,21 +52,20 @@ public class ProjectMeasureController extends BaseController {
return AjaxResult.success(list);
}
@PostMapping("/getList")
public AjaxResult getList(@RequestBody SurProjectMeasure where){
public TableDataInfo getList(@RequestBody SurProjectMeasure where){
Long deptId= where.getDeptId();
if(deptId==null || deptId<=0){
if (SecurityUtils.isUserB()) {
where.setPrjIds(getProjectIds());
}
}
String key="bgscreen_measure_getList_"+where.getMeasureType()+"_"+where.getDeptId()+"_"+where.getProjectId()+"_"+where.getProType()+"_"+Md5Utils.hash(where.getPrjIds());
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
startPage();
List<SurProjectMeasure> list=measureService.getList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return getDataTable(list);
}
@PostMapping("/groupMeasureType")
public AjaxResult groupMeasureType(@RequestBody SurProjectMeasure where){
List<SurProjectMeasure> list=measureService.groupMeasureType(where);
return AjaxResult.success(list);
}
}

View File

@ -86,4 +86,10 @@ public interface SurProjectCheckDetectionMapper
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<SurProjectCheckDetection> getList(SurProjectCheckDetection where);
/**
* CheckType
* @param where
* @return
*/
public List<SurProjectCheckDetection> groupCheckType(SurProjectCheckDetection where);
}

View File

@ -72,4 +72,6 @@ public interface SurProjectMeasureMapper
public List<SurProjectMeasure> groupMeasureInfo(SurProjectMeasure where);
public List<SurProjectMeasure> getList(SurProjectMeasure where);
public List<SurProjectMeasure> groupMeasureType(SurProjectMeasure where);
}

View File

@ -86,4 +86,10 @@ public interface ISurProjectCheckDetectionService
public List<Map<String,Object>> findGroupCountByProjectId(Long projectId);
public List<SurProjectCheckDetection> getList(SurProjectCheckDetection where);
/**
* CheckType
* @param where
* @return
*/
public List<SurProjectCheckDetection> groupCheckType(SurProjectCheckDetection where);
}

View File

@ -81,4 +81,6 @@ public interface ISurProjectMeasureService
public List<SurProjectMeasure> groupMeasureInfo(SurProjectMeasure where);
public List<SurProjectMeasure> getList(SurProjectMeasure where);
public List<SurProjectMeasure> groupMeasureType(SurProjectMeasure where);
}

View File

@ -203,5 +203,14 @@ public class SurProjectCheckDetectionServiceImpl extends WeChatMessageServiceImp
public List<SurProjectCheckDetection> getList(SurProjectCheckDetection where) {
return surProjectCheckDetectionMapper.getList(where);
}
/**
* CheckType
* @param where
* @return
*/
@Override
public List<SurProjectCheckDetection> groupCheckType(SurProjectCheckDetection where) {
return surProjectCheckDetectionMapper.groupCheckType(where);
}
}

View File

@ -206,4 +206,10 @@ public class SurProjectMeasureServiceImpl extends WeChatMessageServiceImpl imple
public List<SurProjectMeasure> getList(SurProjectMeasure where) {
return surProjectMeasureMapper.getList(where);
}
@Override
public List<SurProjectMeasure> groupMeasureType(SurProjectMeasure where) {
return surProjectMeasureMapper.groupMeasureType(where);
}
}

View File

@ -317,7 +317,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getList" parameterType="SurProjectCheckDetection" resultMap="SurProjectCheckDetectionResult">
<include refid="selectSurProjectCheckDetectionVo"/>
WHERE spcd.is_del=0
WHERE spcd.is_del=0 and sp.isDel=0 and sp.progressVisible=0
<if test="detectionResult==1">and spcd.detection_result=1</if>
<if test="detectionResult==0">and spcd.detection_result &lt;&gt; 1</if>
<if test="checkType!=null and checkType>0">and spcd.check_type= #{checkType}</if>
@ -334,5 +334,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId !=null and projectId > 0 ">
and spcd.project_id=#{projectId}
</if>
ORDER BY detection_result
</select>
<select id="groupCheckType" parameterType="SurProjectCheckDetection" resultMap="SurProjectCheckDetectionResult">
SELECT spcd.check_type id,count(1) project_id
FROM sur_project_check_detection spcd
LEFT JOIN sur_project sp ON spcd.project_id = sp.id
where spcd.is_del=0 and sp.isDel=0 and sp.progressVisible=0
<if test="deptId !=null and deptId > 0 ">
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spcd.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId !=null and projectId > 0 ">
and spcd.project_id=#{projectId}
</if>
group by spcd.check_type
</select>
</mapper>

View File

@ -240,6 +240,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectId !=null and projectId >0">
AND spm.project_id=#{projectId}
</if>
order by spm.approve_status
</select>
<select id="groupMeasureType" parameterType="SurProjectMeasure" resultMap="SurProjectMeasureResult">
SELECT spm.measure_type id,count(1) project_id
FROM sur_project_measure spm
LEFT JOIN sur_project sp ON spm.project_id = sp.id
where spm.is_del=0 and sp.isDel=0 and sp.progressVisible=0
<if test="deptId !=null and deptId > 0 ">
and sp.deptId=#{deptId}
</if>
<if test='proType != null and proType != "" and proType != "0"'> and sp.projectType = #{proType}</if>
<if test="prjIds !=null and prjIds.size()>0">
and spm.project_id in
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="projectId !=null and projectId > 0 ">
and spm.project_id=#{projectId}
</if>
group by spm.measure_type
</select>
</mapper>