From 6491e9d05d6e6579d141c250fb5b6ab58befe451 Mon Sep 17 00:00:00 2001 From: haha Date: Sat, 1 Mar 2025 00:06:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=9A=90=E6=82=A3=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/SmzSspProblemmodifyMapper.java | 8 + .../trouble/SmzSspProblemmodifyMapper.xml | 31 ++ .../SmzSspProblemmodifyController.java | 22 ++ .../service/ISmzSspProblemmodifyService.java | 9 + .../impl/SmzSspProblemmodifyServiceImpl.java | 15 +- .../src/api/trouble/problemmodify.js | 9 + .../src/views/trouble/problemmodify/index.vue | 272 +++--------------- .../trouble/problemmodifyDraft/index.vue | 33 ++- 8 files changed, 158 insertions(+), 241 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 27ec9472..a5a905a1 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 @@ -1,6 +1,8 @@ package com.yanzhu.manage.mapper; import java.util.List; +import java.util.Map; + import com.yanzhu.manage.domain.SmzSspProblemmodify; /** @@ -59,4 +61,10 @@ public interface SmzSspProblemmodifyMapper */ public int deleteSmzSspProblemmodifyByIds(Long[] ids); + /** + * 分组统计 用户 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @param where + * @return + */ + List getListCount(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 e956d1b9..60b20a6d 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 @@ -213,4 +213,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + and problemType = #{problemType} + and danger_type = #{dangerType} + and date(createTime) >= date(#{createTime}) + and date(updateTime) <= date(#{updateTime}) + and createUser = #{createUser} + and lordSent = #{lordSent} + + AND + ( + createUser=#{currentUserId} or lordSent=#{currentUserId} or find_in_set(#{currentUserId},copySend) or recheckSend=#{currentUserId} + ) + + + + \ 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 ca40b368..7a304cd8 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 @@ -1,10 +1,13 @@ package com.yanzhu.manage.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; +import com.yanzhu.common.security.utils.SecurityUtils; import com.yanzhu.manage.domain.SmzSspProblemmodify; import com.yanzhu.manage.service.ISmzSspProblemmodifyService; +import com.yanzhu.system.api.domain.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -47,6 +50,24 @@ public class SmzSspProblemmodifyController extends BaseController return getDataTable(list); } + /** + * 分组统计 用户 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @return + */ + @RequiresPermissions("trouble:problemmodify:list") + @GetMapping("/listCount") + public AjaxResult getListCount(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()); + } + List result=smzSspProblemmodifyService.getListCount(where); + return AjaxResult.success(result); + } /** * 导出安全隐患整改列表 */ @@ -92,6 +113,7 @@ public class SmzSspProblemmodifyController extends BaseController return toAjax(smzSspProblemmodifyService.insertSmzSspProblemmodifies(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 c6f57138..0d1a5e5e 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 @@ -1,6 +1,8 @@ package com.yanzhu.manage.service; import java.util.List; +import java.util.Map; + import com.yanzhu.manage.domain.SmzSspProblemmodify; /** @@ -60,4 +62,11 @@ public interface ISmzSspProblemmodifyService public int deleteSmzSspProblemmodifyById(Long id); public int insertSmzSspProblemmodifies(List list); + + /** + * 分组统计 用户 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @param where + * @return + */ + List getListCount(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 7be5a1ec..06193998 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 @@ -1,10 +1,12 @@ package com.yanzhu.manage.service.impl; import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import com.yanzhu.common.core.context.SecurityContextHolder; import com.yanzhu.common.core.utils.DateUtils; +import com.yanzhu.common.security.utils.SecurityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.yanzhu.manage.mapper.SmzSspProblemmodifyMapper; @@ -106,9 +108,20 @@ public class SmzSspProblemmodifyServiceImpl implements ISmzSspProblemmodifyServi it.setCheckState(0L); it.setIsDel(0L); it.setCreateTime(DateUtils.getNowDate()); - it.setCreateBy(SecurityContextHolder.getUserName()); + it.setCreateBy(""+SecurityUtils.getLoginUser().getSysUser().getUserId()); + it.setCreateUser(""+SecurityUtils.getLoginUser().getSysUser().getUserId()); count.addAndGet(smzSspProblemmodifyMapper.insertSmzSspProblemmodify(it)); }); return count.get(); } + + /** + * 分组统计 用户 全部数据、待整改、待复检、整改完成、整改超时的数量 + * @param where + * @return + */ + @Override + public List getListCount(SmzSspProblemmodify where) { + return smzSspProblemmodifyMapper.getListCount(where); + } } diff --git a/yanzhu-ui-vue3/src/api/trouble/problemmodify.js b/yanzhu-ui-vue3/src/api/trouble/problemmodify.js index f352f7ee..3d4c4a13 100644 --- a/yanzhu-ui-vue3/src/api/trouble/problemmodify.js +++ b/yanzhu-ui-vue3/src/api/trouble/problemmodify.js @@ -50,3 +50,12 @@ export function batchAddProblemmodify(datas) { data: datas, }); } + +// 查询安全隐患整改详细 +export function getListCount(data) { + return request({ + url: "/manage/problemmodify/listCount", + method: "get", + params: data, + }); +} diff --git a/yanzhu-ui-vue3/src/views/trouble/problemmodify/index.vue b/yanzhu-ui-vue3/src/views/trouble/problemmodify/index.vue index a6255f5c..08cd5057 100644 --- a/yanzhu-ui-vue3/src/views/trouble/problemmodify/index.vue +++ b/yanzhu-ui-vue3/src/views/trouble/problemmodify/index.vue @@ -1,92 +1,28 @@ + \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/views/trouble/problemmodifyDraft/index.vue b/yanzhu-ui-vue3/src/views/trouble/problemmodifyDraft/index.vue index 7b4f7e4d..a6eeb574 100644 --- a/yanzhu-ui-vue3/src/views/trouble/problemmodifyDraft/index.vue +++ b/yanzhu-ui-vue3/src/views/trouble/problemmodifyDraft/index.vue @@ -301,14 +301,14 @@ function doBatchAdd(datas) { it.comId = userStore.currentComId; it.infoType = 0; let users = data.users.filter(u => u.userId == it.lordSent); - it.lordSent = users.map(u => u.userName).join(","); - it.lordSentUser = users.map(u => u.userPhone).join(","); + it.lordSent = users.map(u => u.userId).join(","); + it.lordSentUser = users.map(u => u.userName).join(","); users = data.users.filter(u => it.copySend.includes(u.userId)); - it.copySend = users.map(u => u.userName).join(","); - it.copySendUser = users.map(u => u.userPhone).join(","); + it.copySend = users.map(u => u.userId).join(","); + it.copySendUser = users.map(u => u.userName).join(","); users = data.users.filter(u => u.userId == it.recheckSend); - it.recheckSend = users.map(u => u.userName).join(","); - it.recheckSendUser = users.map(u => u.userPhone).join(","); + it.recheckSend = users.map(u => u.userId).join(","); + it.recheckSendUser = users.map(u => u.userName).join(","); }); batchAddProblemmodify(datas).then(res => { if (res.code == 200) { @@ -317,6 +317,27 @@ function doBatchAdd(datas) { data.showList.splice(it, 1); data.dataList.splice(it, 1); }); + if (data.showList.length == 0) { + let row = { + key: +new Date(), + id: null, + projectId: userStore.currentPrjId, + comId: userStore.currentComId, + problemType: null, + dangerType: null, + smarkUrl: null, + workParts: null, + changeInfo: null, + lordSent: null, + copySend: null, + recheckSend: null, + nickedTime: null, + isDel: 0, + infoType: 1 + }; + data.dataList.push(row); + data.showList.push(row); + } } }); }