From 4daee83b4508575b3a6b3561bd51fa61bca9f3e0 Mon Sep 17 00:00:00 2001 From: xiepeng Date: Wed, 10 Apr 2024 16:53:54 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppTrafficSecurityNoticeController.java | 10 ++- .../TrafficSecurityNoticeController.java | 68 +++++++++---------- .../TrafficSecurityReadDetailMapper.java | 2 +- .../TrafficSecurityReadDetailService.java | 3 +- .../impl/TrafficSecurityReadDetailImpl.java | 5 +- .../TrafficSecurityNoticeMapper.xml | 13 +++- .../TrafficSecurityReadDetailMapper.xml | 38 ++++------- 7 files changed, 74 insertions(+), 65 deletions(-) diff --git a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java index 5d23be6..6c27ad2 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/AppTrafficSecurityNoticeController.java @@ -61,7 +61,15 @@ public class AppTrafficSecurityNoticeController extends BaseController { Map map = new HashMap(); String errInfo = "success"; PageData pd = this.getPageData(); - pd.put("SIGNEDDATE",DateUtil.date2Str(new Date())); // 签收时间 + PageData pageData = new PageData(); + pageData.put("NOTIFICATION_ID", pd.getString("NOTIFICATION_ID")); + pageData.put("PERSON_ID", pd.getString("USER_ID")); + PageData securityNotice = securityReadDetail.listByUserIdOrNoticeId(pageData); + if(StringUtils.isEmpty(securityNotice.getString("SIGNEDDATE"))) { + pd.put("SIGNEDDATE",DateUtil.date2Str(new Date())); // 签收时间 + }else{ + pd.put("SIGNEDDATE",securityNotice.getString("SIGNEDDATE")); + } pd.put("SIGNING", "1"); //设置签收情况 if (pd.getString("REPLYCONTENT") != null && !pd.getString("REPLYCONTENT").isEmpty()) { pd.put("REPLYDATE", DateUtil.date2Str(new Date())); //设置回复时间 diff --git a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityNoticeController.java b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityNoticeController.java index dffaeb4..0f55c19 100644 --- a/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityNoticeController.java +++ b/src/main/java/com/zcloud/controller/comprehensive/TrafficSecurityNoticeController.java @@ -137,27 +137,27 @@ public class TrafficSecurityNoticeController extends BaseController { long replyStatusNum = 0; long signedStatusNum = 0; for (PageData data : varList) { - pd.put("NOTIFICATION_ID", data.get("NOTIFICATION_ID")); - page.setPd(pd); - List readDetail = securityReadDetail.getAllReadDetail(page); +// pd.put("NOTIFICATION_ID", data.get("NOTIFICATION_ID")); +// page.setPd(pd); +// List readDetail = securityReadDetail.getAllReadDetail(page); +// +// long currentReplyStatusNum = readDetail.stream() +// .filter(d -> "1".equals(d.getString("REPLY"))) +// .count(); +// long currentSignedStatusNum = readDetail.stream() +// .filter(d -> "1".equals(d.getString("SIGNING"))) +// .count(); +// long currentTotalReadDetail = readDetail.size(); +// +// replyStatusNum += currentReplyStatusNum; +// signedStatusNum += currentSignedStatusNum; +// data.put("REPLYSTATUSNUM", currentReplyStatusNum); +// data.put("SIGNEDSTATUSNUM", currentSignedStatusNum); - long currentReplyStatusNum = readDetail.stream() - .filter(d -> "1".equals(d.getString("REPLY"))) - .count(); - long currentSignedStatusNum = readDetail.stream() - .filter(d -> "1".equals(d.getString("SIGNING"))) - .count(); - long currentTotalReadDetail = readDetail.size(); - - replyStatusNum += currentReplyStatusNum; - signedStatusNum += currentSignedStatusNum; - - data.put("TOTALREADDETAIL", currentTotalReadDetail); - data.put("REPLYSTATUSNUM", currentReplyStatusNum); - data.put("SIGNEDSTATUSNUM", currentSignedStatusNum); + // 获取 回复与签收 的总人数 + data.put("TOTALREADDETAIL", Tools.notEmpty(data.getString("PERSON_ID"))?data.getString("PERSON_ID").split(",").length : 0); } - map.put("REPLYSTATUSNUM", String.valueOf(replyStatusNum)); - map.put("SIGNEDSTATUSNUM", String.valueOf(signedStatusNum)); + map.put("varList", varList); map.put("page", page); map.put("result", errInfo); @@ -167,7 +167,6 @@ public class TrafficSecurityNoticeController extends BaseController { //详情 @RequestMapping(value="/goEdit") - // @RequiresPermissions("traininginfo:edit") @ResponseBody public Object goEdit() throws Exception{ Map map = new HashMap(); @@ -176,22 +175,24 @@ public class TrafficSecurityNoticeController extends BaseController { pd = this.getPageData(); pd = securityNoticeService.findById(pd);//根据ID读取 String[] personIds = pd.getString("PERSON_ID").split(","); - List names = new ArrayList<>(); List readDetail = new ArrayList<>(); + List names = new ArrayList<>(); for (String personId : personIds) { - PageData pageData = new PageData(); - pageData.put("USER_ID",personId); - pageData.put("NOTIFICATION_ID",pd.getString("NOTIFICATION_ID")); - PageData pageData1 = usersService.findById(pageData); + PageData pd2 = new PageData(); + pd2.put("NOTIFICATION_ID", pd.getString("NOTIFICATION_ID")); + pd2.put("PERSON_ID",personId.trim()); + PageData pageData = trafficSecurityReadDetailService.listByUserIdOrNoticeId(pd2); + readDetail.add(pageData); + + // 通过 用户id获取用户名 + PageData user = new PageData(); + user.put("USER_ID",personId.trim()); + PageData pageData1 = usersService.findById(user); names.add(pageData1); - Page page = new Page(); - page.setPd(pageData); - readDetail = trafficSecurityReadDetailService.listByUserIdOrNoticeId(page); } pd.put("readDetail",readDetail); + pd.put("names",names); map.put("pd", pd); - //map.put("readDetail", readDetail); - map.put("names", names); map.put("result", errInfo); return map; } @@ -250,7 +251,7 @@ public class TrafficSecurityNoticeController extends BaseController { pd.put("REPLY", "0"); // 回复情况 securityNoticeService.edit(pd); - String[] personIds = pd.getString("PERSON_ID").split(","); + /*String[] personIds = pd.getString("PERSON_ID").split(","); for (String personId : personIds) { //pd.put("NOTIFICATION_ID", notificationId); pd.put("PERSON_ID", personId.trim()); @@ -258,7 +259,7 @@ public class TrafficSecurityNoticeController extends BaseController { pd.put("REPLYSTATUS", "0"); // 主键 pd.put("SIGNEDSTATUS", "0"); // 主键 securityReadDetail.save(pd); - } + }*/ map.put("result", errInfo); map.put("pd", pd); return map; @@ -336,8 +337,7 @@ public class TrafficSecurityNoticeController extends BaseController { issue.put("REPLY", "0"); issue.put("SIGNING", "0"); issue.put("CORPINFO_ID", securityNotice.getString("CORPINFO_ID")); - issue.put("PERSON_ID",personIds[i]); - issue.put("PERSON", securityNotice.getString("PERSON_ID")); + issue.put("PERSON_ID",personIds[i].trim()); issue.put("ISDELETE", "0"); issue.put("CREATOR", Jurisdiction.getUSER_ID()); issue.put("CREATORNAME", Jurisdiction.getUsername()); diff --git a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityReadDetailMapper.java b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityReadDetailMapper.java index f06df75..be328a5 100644 --- a/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityReadDetailMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/comprehensive/TrafficSecurityReadDetailMapper.java @@ -16,6 +16,6 @@ public interface TrafficSecurityReadDetailMapper { void edit(PageData pd); void delete(PageData pd); + PageData listByUserIdOrNoticeId(PageData pd); - List listByUserIdOrNoticeId(Page page); } diff --git a/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityReadDetailService.java b/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityReadDetailService.java index 2692d1b..85df8dc 100644 --- a/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityReadDetailService.java +++ b/src/main/java/com/zcloud/service/comprehensive/TrafficSecurityReadDetailService.java @@ -16,5 +16,6 @@ public interface TrafficSecurityReadDetailService { void delete(PageData pd); - List listByUserIdOrNoticeId(Page page); + PageData listByUserIdOrNoticeId(PageData pd); + } diff --git a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityReadDetailImpl.java b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityReadDetailImpl.java index d975b40..2dff192 100644 --- a/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityReadDetailImpl.java +++ b/src/main/java/com/zcloud/service/comprehensive/impl/TrafficSecurityReadDetailImpl.java @@ -40,7 +40,8 @@ public class TrafficSecurityReadDetailImpl implements TrafficSecurityReadDetailS } @Override - public List listByUserIdOrNoticeId(Page page) { - return securityReadDetailMapper.listByUserIdOrNoticeId(page); + public PageData listByUserIdOrNoticeId(PageData pd) { + return securityReadDetailMapper.listByUserIdOrNoticeId(pd); } + } diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityNoticeMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityNoticeMapper.xml index d055cad..af26cfe 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityNoticeMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityNoticeMapper.xml @@ -39,7 +39,8 @@ f.VIDEO_ROUTE, f.VIDEO_NAME, f.REPLYSTATUS, - f.POSTSTATUS + f.POSTSTATUS, + f.SIGNEDDATE @@ -164,10 +165,14 @@ diff --git a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityReadDetailMapper.xml b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityReadDetailMapper.xml index 49d5b74..79de2f6 100644 --- a/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityReadDetailMapper.xml +++ b/src/main/resources/mybatis/datasource/comprehensive/TrafficSecurityReadDetailMapper.xml @@ -138,6 +138,9 @@ and f.SIGNEDSTATUS = #{pd.SIGNEDSTATUS} + @@ -193,32 +196,19 @@ - SELECT - c.*, - u.NOTIFICATIONCONTENT, - u.VIDEO_ROUTE, - u.ATTACHMENT_ROUTE, - u.REPLYSTATUS, - u.CREATETIME, - su.NAME + c.*, + su.NAME FROM - bus_traffic_read_detail c - INNER JOIN bus_traffic_comprehensivemanagement_securitynotice u ON c.NOTIFICATION_ID = u.NOTIFICATION_ID - INNER JOIN sys_user su on c.PERSON_ID = su.USER_ID - WHERE c.PERSON_ID = #{pd.USER_ID} - AND u.ISDELETE = 0 - - and c.NOTIFICATION_ID = #{pd.NOTIFICATION_ID} - - - AND ( - c.SYNOPSIS LIKE CONCAT('%', #{pd.KEYWORDS}, '%') - OR - c.CONTENT LIKE CONCAT('%', #{pd.KEYWORDS}, '%') - ) - - ORDER BY u.CREATETIME DESC + bus_traffic_read_detail c + LEFT JOIN sys_user su on c.PERSON_ID = su.USER_ID + WHERE c.ISDELETE = 0 + and + c.NOTIFICATION_ID = #{NOTIFICATION_ID} + and + c.PERSON_ID = #{PERSON_ID} + ORDER BY c.CREATETIME DESC