From c093e4dd91d04dccba77583c0340bacb0e162959 Mon Sep 17 00:00:00 2001 From: haha Date: Sat, 1 Mar 2025 16:11:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=9A=90=E6=82=A3?= =?UTF-8?q?=E6=95=B4=E6=94=B9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SmzSspProblemmodifyMapper.java | 7 +++ .../trouble/SmzSspProblemmodifyMapper.xml | 21 +++++++ .../SmzSspProblemmodifyController.java | 12 +++- .../service/ISmzSspProblemmodifyService.java | 7 +++ .../impl/SmzSspProblemmodifyServiceImpl.java | 10 ++++ yanzhu-ui-vue3/src/views/login.vue | 59 ++++++++++++------- 6 files changed, 93 insertions(+), 23 deletions(-) diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SmzSspProblemmodifyMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SmzSspProblemmodifyMapper.java index a5a905a1..7aa182b6 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SmzSspProblemmodifyMapper.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/SmzSspProblemmodifyMapper.java @@ -67,4 +67,11 @@ public interface SmzSspProblemmodifyMapper * @return */ List getListCount(SmzSspProblemmodify where); + + /** + * 分组查询 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @param where + * @return + */ + List selectList(SmzSspProblemmodify where); } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml index 60b20a6d..0d48d615 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/trouble/SmzSspProblemmodifyMapper.xml @@ -244,4 +244,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select 'e' projectName, count(1) id,'整改超时' remark from smz_ssp_problemmodify where projectId=#{projectId} and comId=#{comId} and infoType=#{infoType} and isDel=0 and checkState not in (4) and date(nickedTime) <= curdate() + + \ No newline at end of file diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SmzSspProblemmodifyController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SmzSspProblemmodifyController.java index 7a304cd8..b3bb92a7 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SmzSspProblemmodifyController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SmzSspProblemmodifyController.java @@ -43,10 +43,18 @@ public class SmzSspProblemmodifyController extends BaseController */ @RequiresPermissions("trouble:problemmodify:list") @GetMapping("/list") - public TableDataInfo list(SmzSspProblemmodify smzSspProblemmodify) + public TableDataInfo list(SmzSspProblemmodify where) { + SysUser user=SecurityUtils.getLoginUser().getSysUser(); + where.setProjectId(user.getActiveProjectId()); + where.setComId(user.getActiveComId()); + if(SecurityUtils.isAdmin(SecurityUtils.getUserId()) || SecurityUtils.isGSAdmin()) { + where.setCurrentUserId(null); + }else{ + where.setCurrentUserId(user.getUserId()); + } startPage(); - List list = smzSspProblemmodifyService.selectSmzSspProblemmodifyList(smzSspProblemmodify); + List list = smzSspProblemmodifyService.selectList(where); return getDataTable(list); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISmzSspProblemmodifyService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISmzSspProblemmodifyService.java index 0d1a5e5e..a6797875 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISmzSspProblemmodifyService.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/ISmzSspProblemmodifyService.java @@ -69,4 +69,11 @@ public interface ISmzSspProblemmodifyService * @return */ List getListCount(SmzSspProblemmodify where); + + /** + * 分组查询 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @param where + * @return + */ + List selectList(SmzSspProblemmodify where); } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SmzSspProblemmodifyServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SmzSspProblemmodifyServiceImpl.java index 06193998..fa9f988a 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SmzSspProblemmodifyServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/SmzSspProblemmodifyServiceImpl.java @@ -124,4 +124,14 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi public List getListCount(SmzSspProblemmodify where) { return smzSspProblemmodifyMapper.getListCount(where); } + + /** + * 分组查询 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @param where + * @return + */ + @Override + public List selectList(SmzSspProblemmodify where) { + return smzSspProblemmodifyMapper.selectList(where); + } } diff --git a/yanzhu-ui-vue3/src/views/login.vue b/yanzhu-ui-vue3/src/views/login.vue index 1f3a0a05..80438090 100644 --- a/yanzhu-ui-vue3/src/views/login.vue +++ b/yanzhu-ui-vue3/src/views/login.vue @@ -25,7 +25,8 @@ 记住密码 - + start-placeholder="开始日期" end-placeholder="结束日期" /> 搜索 重置 - + + + + + + + @@ -127,7 +133,9 @@ const data = reactive({ comId: [ { required: true, message: "租户ID不能为空", trigger: "blur" } ], - } + }, + activeName: 'a', + tabInfo: {} }); const { queryParams, form, rules } = toRefs(data); @@ -135,7 +143,19 @@ const { queryParams, form, rules } = toRefs(data); /** 查询安全隐患整改列表 */ function getList() { loading.value = true; - listProblemmodify(queryParams.value).then(response => { + let postData = { + infoType: 0, + problemType: queryParams.value.problemType, + dangerType: queryParams.value.dangerType, + lordSent: queryParams.value.lordSent, + createUser: queryParams.value.createUser, + projectName: " abcde".indexOf(data.activeName) + }; + if (queryParams.value.dataRange && queryParams.value.dataRange.length > 0) { + postData.createTime = queryParams.value.dataRange[0]; + postData.updateTime = queryParams.value.dataRange[1]; + } + listProblemmodify(postData).then(response => { problemmodifyList.value = response.rows; total.value = response.total; loading.value = false; @@ -254,13 +274,41 @@ function handleDelete(row) { }).catch(() => { }); } -/** 导出按钮操作 */ -function handleExport() { - proxy.download('trouble/problemmodify/export', { - ...queryParams.value - }, `problemmodify_${new Date().getTime()}.xlsx`) +function getCount() { + let postData = { + infoType: 0, + problemType: queryParams.value.problemType, + dangerType: queryParams.value.dangerType, + lordSent: queryParams.value.lordSent, + createUser: queryParams.value.createUser + }; + if (queryParams.value.dataRange && queryParams.value.dataRange.length > 0) { + postData.createTime = queryParams.value.dataRange[0]; + postData.updateTime = queryParams.value.dataRange[1]; + } + data.tabInfo = { + a: '全部数据(0)', + b: '待整改(0)', + c: '待复检(0)', + d: '整改完成(0)', + e: '整改超时(0)', + }; + getListCount(postData).then(response => { + let obj = { + a: '全部数据', + b: '待整改', + c: '待复检', + d: '整改完成', + e: '整改超时', + }; + (response.data || []).forEach(it => { + data.tabInfo[it.projectName] = obj[it.projectName] + `(${it.id || 0})` + }); + }); + handleQuery(); } +getCount();