From f3c8b3413a164d2085e3772c4f8cd0899977a5a7 Mon Sep 17 00:00:00 2001 From: 21819 Date: Mon, 18 Mar 2024 15:53:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=BB=A5=E5=8F=8A=E8=BD=AE=E6=92=AD=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datascreen/DataScreenController.java | 16 ++-- .../com/biutag/lan/service/WorkService.java | 4 +- .../resources/mapper/DataScreenMapper.xml | 88 ++++++++++++++----- .../src/main/resources/mapper/WorkMapper.xml | 20 +++-- 4 files changed, 91 insertions(+), 37 deletions(-) diff --git a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java index 1bb1f4e..c3b5f68 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/controller/datascreen/DataScreenController.java @@ -5,17 +5,23 @@ import com.biutag.aop.NotPower; import com.biutag.core.AjaxResult; import com.biutag.lan.domain.Mail; import com.biutag.lan.domain.vo.MailDetail; +import com.biutag.lan.mapper.DataScreenMapper; import com.biutag.lan.service.DataScreenService; import com.biutag.lan.service.IDutyService; import com.biutag.lan.service.MailService; -import com.biutag.lan.service.MailSourceService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; @Slf4j @RestController @@ -25,10 +31,6 @@ public class DataScreenController { @Resource DataScreenService dataScreenService; - @Resource - IDutyService iDutyService; - @Resource - MailService mailService; @NotLogin @GetMapping("/mapData") @ApiOperation(value="大屏地图数据") diff --git a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java index a04e9a3..bd48577 100644 --- a/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java +++ b/mailbox-lan/src/main/java/com/biutag/lan/service/WorkService.java @@ -551,6 +551,8 @@ public class WorkService extends ServiceImpl { public Page dissatisfied(Page page, MailQuery mailQuery) { QueryWrapper queryWrapper = new QueryWrapper() + //必须是已办结的件才可以申诉 + .eq("m.mail_state", "completion") .ge(StrUtil.isNotBlank(mailQuery.getMailTimeStart()), "m.mail_time", mailQuery.getMailTimeStart()) .le(StrUtil.isNotBlank(mailQuery.getMailTimeEnd()), "m.mail_time", mailQuery.getMailTimeEnd()) .eq(StrUtil.isNotBlank(mailQuery.getSource()), "m.source", mailQuery.getSource()) @@ -586,7 +588,7 @@ public class WorkService extends ServiceImpl { } } // 排序 - queryWrapper.orderByDesc("m.mail_time"); + queryWrapper.orderByDesc("m.mail_time").groupBy("m.id"); Page result = baseMapper.selectDissatisfiedPage(page, queryWrapper); for (QueryMailVo workVo : result.getRecords()) { workVo.setNowDeptId(AdminThreadLocal.getDeptId()); diff --git a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml index d833f52..f191e2c 100644 --- a/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml +++ b/mailbox-lan/src/main/resources/mapper/DataScreenMapper.xml @@ -83,18 +83,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.category='2' and b.second_dept_id=#{deptId} GROUP BY second_dept_name + + + + + + - + select + CONCAT(ROUND(SUM(COALESCE(b.satisfied, 0))*100 / NULLIF(SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END), 0),0),'%') AS satisfiedRate, + SUM(COALESCE(b.satisfied, 0)) AS satisfied, + SUM(CASE WHEN b.completed = '1' THEN 1 ELSE 0 END) AS satisfiedSum + from mail_mark b left join dept a on a.id=b.second_dept_id where 1=1 + + and a.category='2' and b.second_dept_id=#{deptId} GROUP BY second_dept_name + + + - + SELECT d.name, a.id, + ( + SELECT COUNT(1) + FROM mail c + WHERE c.create_time >= CURRENT_DATE + AND c.second_dept_id = a.id + ) AS todaysum, + CONCAT(ROUND(SUM(COALESCE(b.resolved, 0)) * 100 / NULLIF(COUNT(1), 0),0), '%') AS resolvedRate, + SUM(COALESCE(b.resolved, 0)) AS resolved, + ROUND(SUM(COALESCE(b.completed, 0)) * 100 / NULLIF(COUNT(b.mail_id), 0),0) AS value, + CONCAT(ROUND(SUM(COALESCE(b.completed, 0)) * 100 / NULLIF(COUNT(b.mail_id), 0),0), '%') AS completedRate, + SUM(COALESCE(b.completed, 0)) AS completed, + CONCAT(ROUND(SUM(COALESCE(b.satisfied, 0)) * 100 / NULLIF(COUNT(1), 0),0), '%') AS satisfiedRate, + SUM(COALESCE(b.satisfied, 0)) AS satisfied, + COUNT(b.second_dept_id) AS allsum + FROM + mail_mark b + RIGHT JOIN dept a ON a.id = b.second_dept_id + left join county_street_dept d on a.id=d.dept_id + WHERE + a.level = 2 AND a.category = 2 + GROUP BY d.name, a.id