From 68c60affc7f6e4e609255ce14d581daa4f205b8b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 20 Dec 2022 16:15:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=94=BE=E5=9C=A8data=5Freport=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/HistoryScoreListFormDTO.java | 53 ++++++ .../result/HistoryScoreDetailResultDTO.java | 160 ++++++++++++++++++ .../index/IndexExplainController.java | 7 + .../index/IndexExplainDao.java | 4 + .../index/IndexExplainService.java | 4 + .../index/impl/IndexExplainServiceImpl.java | 26 ++- .../mapper/index/IndexExplainDao.xml | 29 ++++ 7 files changed, 282 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java new file mode 100644 index 0000000000..e6665350d1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/HistoryScoreListFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.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 {} + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + //@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; + + /** + * 当前页 + */ + private Integer pageNo = 1; + + /** + * 每页记录数 + */ + private Integer pageSize = 20; + + /** + * 是否分页【true分 false不分】 + */ + private Boolean isPage = true; + + private String customerId; + private String userId; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java new file mode 100644 index 0000000000..374a5af2e1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/HistoryScoreDetailResultDTO.java @@ -0,0 +1,160 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +@Data +public class HistoryScoreDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface Add extends CustomerClientShowGroup { + } + + public interface Edit extends CustomerClientShowGroup { + } + + /** + * id + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 起始时间 + */ + private Date startTime; + + /** + * 截止时间 + */ + private Date endTime; + + /** + * 时间区间 + */ + private String time; + + /** + * 发布时间 + */ + private Date releaseTime; + + /** + * 截止时间 + */ + private List detailList; + + @Data + public static class Detail implements Serializable { + /** + * id + */ + private String id; + + /** + * screen_py_history_score.id + */ + private String historyScoreId; + + /** + * 街道组织Id + */ + private String agencyId = ""; + + /** + * 街道名称 + */ + private String agencyName = ""; + + /** + * 网格活跃度 + */ + private BigDecimal wghyd = new BigDecimal(0); + + /** + * 事件赋分 + */ + private BigDecimal sjff = new BigDecimal(0); + + /** + * 接入率 + */ + private BigDecimal jrl = new BigDecimal(0); + + /** + * 在线率 + */ + private BigDecimal zxl = new BigDecimal(0); + + /** + * 出图率 + */ + private BigDecimal ctl = new BigDecimal(0); + + /** + * 雪亮工程 + */ + private BigDecimal xlgc = new BigDecimal(0); + + /** + * 完成进度 + */ + private BigDecimal wcjd = new BigDecimal(0); + + /** + * 未补检 + */ + private BigDecimal wbj = new BigDecimal(0); + + /** + * 反馈抽检 + */ + private BigDecimal fkcj = new BigDecimal(0); + + /** + * 日核周调 + */ + private BigDecimal rhzt = new BigDecimal(0); + + /** + * 亮点工作 + */ + private BigDecimal ldgz = new BigDecimal(0); + + /** + * 亮点工作备注 + */ + private String ldgzbz; + + /** + * 其他工作 + */ + private BigDecimal qtgz = new BigDecimal(0); + + /** + * 其他工作备注 + */ + private String qtgzbz; + + /** + * 能力得分 + */ + private BigDecimal nldf = new BigDecimal(0); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java index e248a6ac35..89e1c94860 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java @@ -21,6 +21,8 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; @@ -78,5 +80,10 @@ public class IndexExplainController { return new Result().ok(result); } + @RequestMapping("dplist") + public Result> dplist(@RequestBody HistoryScoreListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, HistoryScoreListFormDTO.List.class); + return new Result>().ok(indexExplainService.dplist(formDTO)); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java index 64fc30bac1..25ea956679 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.evaluationindex.index; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -33,4 +35,6 @@ import java.util.List; public interface IndexExplainDao { List getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); + + List selectDpList(HistoryScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java index c028422cd4..3e6510f853 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java @@ -17,6 +17,8 @@ package com.epmet.datareport.service.evaluationindex.index; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; import com.epmet.evaluationindex.index.result.IndexExplainResult; @@ -51,4 +53,6 @@ public interface IndexExplainService { * @date 2021/5/20 10:20 上午 */ IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO); + + List dplist(HistoryScoreListFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index ae40c88329..4daa9e282d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -29,6 +29,8 @@ import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.dto.form.HistoryScoreListFormDTO; +import com.epmet.dto.result.HistoryScoreDetailResultDTO; import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; @@ -45,6 +47,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -436,4 +439,25 @@ public class IndexExplainServiceImpl implements IndexExplainService { return headers; } -} + + @Override + public List dplist(HistoryScoreListFormDTO formDTO) { + //按条件查询数据,并做加和取平均值操作 + List resultList = indexExplainDao.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-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml index 9c7f5d0870..1fe95e6eaf 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml @@ -37,4 +37,33 @@ AND PID = #{pid} ORDER BY SORT + + + From f4665e3cc1712ab18549c82c2ab64b2a2f747f88 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 20 Dec 2022 16:18:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=94=BE=E5=9C=A8data=5Freport=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/impl/IndexExplainServiceImpl.java | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 4daa9e282d..b4a69d462b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -443,16 +443,20 @@ public class IndexExplainServiceImpl implements IndexExplainService { @Override public List dplist(HistoryScoreListFormDTO formDTO) { //按条件查询数据,并做加和取平均值操作 - List resultList = indexExplainDao.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->{ + List resultList = indexExplainDao.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()){ + for (String ma : map.keySet()) { HistoryScoreDetailResultDTO.Detail detail = new HistoryScoreDetailResultDTO.Detail(); detail.setAgencyId(ma); detail.setAgencyName(map.get(ma)); @@ -461,3 +465,5 @@ public class IndexExplainServiceImpl implements IndexExplainService { return resultList; } + +}