From 623f4f4852e3914235f795e96465b11c57b083a6 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 19 Dec 2022 16:55:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E5=B9=B3=E9=98=B4=E6=94=BF?= =?UTF-8?q?=E6=B3=95=E8=83=BD=E5=8A=9B=E6=8E=92=E5=90=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/HistoryScoreListFormDTO.java | 5 ++++ .../result/HistoryScoreDetailResultDTO.java | 30 +++++++++---------- .../ScreenPyHistoryScoreController.java | 5 ++++ .../indexcoll/ScreenPyHistoryScoreDao.java | 3 ++ .../ScreenPyHistoryScoreService.java | 5 +++- .../impl/ScreenPyHistoryScoreServiceImpl.java | 24 +++++++++++++-- .../indexcoll/ScreenPyHistoryScoreDao.xml | 28 +++++++++++++++++ 7 files changed, 81 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java index 0e61017efe..faa54eaf8a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/HistoryScoreListFormDTO.java @@ -1,13 +1,16 @@ package com.epmet.dto.indexcollect.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @Data public class HistoryScoreListFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface List extends CustomerClientShowGroup {} /** * 标题 @@ -18,12 +21,14 @@ public class HistoryScoreListFormDTO implements Serializable { * 起始时间 */ //@JsonFormat(pattern = "yyyy-MM-dd") + @NotBlank(message = "起始时间不能为空", groups = List.class) private String startTime; /** * 截止时间 */ //@JsonFormat(pattern = "yyyy-MM-dd") + @NotBlank(message = "截止时间不能为空", groups = List.class) private String endTime; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java index 78ff979d52..371199267d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/HistoryScoreDetailResultDTO.java @@ -74,67 +74,67 @@ public class HistoryScoreDetailResultDTO implements Serializable { /** * 街道组织Id */ - private String agencyId; + private String agencyId = ""; /** * 街道名称 */ - private String agencyName; + private String agencyName = ""; /** * 网格活跃度 */ - private BigDecimal wghyd; + private BigDecimal wghyd = new BigDecimal(0); /** * 事件赋分 */ - private BigDecimal sjff; + private BigDecimal sjff = new BigDecimal(0); /** * 接入率 */ - private BigDecimal jrl; + private BigDecimal jrl = new BigDecimal(0); /** * 在线率 */ - private BigDecimal zxl; + private BigDecimal zxl = new BigDecimal(0); /** * 出图率 */ - private BigDecimal ctl; + private BigDecimal ctl = new BigDecimal(0); /** * 雪亮工程 */ - private BigDecimal xlgc; + private BigDecimal xlgc = new BigDecimal(0); /** * 完成进度 */ - private BigDecimal wcjd; + private BigDecimal wcjd = new BigDecimal(0); /** * 未补检 */ - private BigDecimal wbj; + private BigDecimal wbj = new BigDecimal(0); /** * 反馈抽检 */ - private BigDecimal fkcj; + private BigDecimal fkcj = new BigDecimal(0); /** * 日核周调 */ - private BigDecimal rhzt; + private BigDecimal rhzt = new BigDecimal(0); /** * 亮点工作 */ - private BigDecimal ldgz; + private BigDecimal ldgz = new BigDecimal(0); /** * 亮点工作备注 @@ -144,7 +144,7 @@ public class HistoryScoreDetailResultDTO implements Serializable { /** * 其他工作 */ - private BigDecimal qtgz; + private BigDecimal qtgz = new BigDecimal(0); /** * 其他工作备注 @@ -154,7 +154,7 @@ public class HistoryScoreDetailResultDTO implements Serializable { /** * 能力得分 */ - private BigDecimal nldf; + private BigDecimal nldf = new BigDecimal(0); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java index 72a1321300..5c90c6a5d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenPyHistoryScoreController.java @@ -156,4 +156,9 @@ public class ScreenPyHistoryScoreController { return new Result().ok(screenPyHistoryScoreService.nldfScore(dto)); } + @RequestMapping("dplist") + public Result> dplist(@RequestBody HistoryScoreListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, HistoryScoreListFormDTO.List.class); + return new Result>().ok(screenPyHistoryScoreService.dplist(formDTO)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java index 97d9cdc287..531aa77f53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.indexcoll; /** import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcollect.form.HistoryScoreComputeFormDTO; import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; +import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; import com.epmet.dto.indexcollect.result.HistoryScoreSjffResultDTO; import com.epmet.entity.evaluationindex.indexcoll.ScreenPyHistoryScoreEntity; @@ -41,4 +42,6 @@ public interface ScreenPyHistoryScoreDao extends BaseDao selectDpList(HistoryScoreListFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java index 8f716045dd..53d012a042 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/ScreenPyHistoryScoreService.java @@ -7,7 +7,8 @@ import com.epmet.dto.indexcollect.form.HistoryScoreListFormDTO; import com.epmet.dto.indexcollect.result.HistoryScoreComputeResultDTO; import com.epmet.dto.indexcollect.result.HistoryScoreDetailResultDTO; import com.epmet.dto.indexcollect.result.HistoryScoreListResultDTO; -import com.epmet.dto.result.IcMoveInListResultDTO; + +import java.util.List; /** * 平阴历史得分主表 @@ -29,4 +30,6 @@ public interface ScreenPyHistoryScoreService { HistoryScoreComputeResultDTO computeScore(HistoryScoreComputeFormDTO formDTO); HistoryScoreComputeResultDTO nldfScore(HistoryScoreFormDTO.Detail dto); + + List dplist(HistoryScoreListFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java index 5424dd89da..05429d9505 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/ScreenPyHistoryScoreServiceImpl.java @@ -42,9 +42,7 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; /** * 平阴历史得分主表 @@ -229,5 +227,25 @@ public class ScreenPyHistoryScoreServiceImpl implements ScreenPyHistoryScoreServ return resultDTO; } + @Override + public List dplist(HistoryScoreListFormDTO formDTO) { + //按条件查询数据,并做加和取平均值操作 + List resultList = screenPyHistoryScoreDao.selectDpList(formDTO); + Map map = new HashMap<>(); + map.put("1258587398679126017","榆山街道");map.put("1215437824174608386","锦水街道"); + map.put("f8d4a6af53b3fc5991ab1434b6ad39b8","东阿镇");map.put("d20a7488eedf5bcfd5231c3771bc0e3d","玫瑰镇"); + map.put("ea78a8e9252f567517c4a8d60250c714","安城镇");map.put("1234085031077498881","孔村镇"); + map.put("f279343a67653fc20d8333c6b2e4dbee","孝直镇");map.put("c259c3b1d27f960b9b379fb2886179ba","洪范池镇"); + resultList.forEach(re->{ + map.remove(re.getAgencyId()); + }); + for (String ma : map.keySet()){ + HistoryScoreDetailResultDTO.Detail detail = new HistoryScoreDetailResultDTO.Detail(); + detail.setAgencyId(ma); + detail.setAgencyName(map.get(ma)); + resultList.add(detail); + } + return resultList; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml index eaee21870c..1b311eb25c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/ScreenPyHistoryScoreDao.xml @@ -67,5 +67,33 @@ AND pids LIKE CONCAT('%', #{agencyId}, '%') + +