From 468f6adb98980301a845ffcbb66b85844c12b2b7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 25 Jun 2021 10:19:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=BB=84=E7=BB=87=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/BaseReportConstant.java | 13 ++++ .../com/epmet/dao/stats/BaseReportDao.java | 20 +++++ .../service/impl/BaseReportServiceImpl.java | 22 +++++- .../resources/mapper/stats/BaseReportDao.xml | 75 +++++++++++++++++++ 4 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java new file mode 100644 index 0000000000..0c6669c3bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/6/24 5:19 下午 + * @DESC + */ +public interface BaseReportConstant { + + String DATA_IS_NULL = "上传%s数据为空"; + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java index d60d287216..5d65fe2ea3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java @@ -1,5 +1,8 @@ package com.epmet.dao.stats; +import com.epmet.dto.basereport.form.AgencyProjectFormDTO; +import com.epmet.dto.basereport.form.AgencyRegUserFormDTO; +import com.epmet.dto.basereport.form.GridRegUserFormDTO; import com.epmet.dto.basereport.form.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -84,4 +87,21 @@ public interface BaseReportDao { * @author sun */ void insertBatchAgencyHotTopic(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户组织项目数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/24 5:30 下午 + */ + int delAgencyProject(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增组织项目数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 9:14 上午 + */ + void insertAgencyProject(@Param("list")List dataList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index 5c4f341e8d..2a92d567c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -1,19 +1,25 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.BaseReportConstant; import com.epmet.dao.stats.BaseReportDao; import com.epmet.dto.basereport.form.*; import com.epmet.service.BaseReportService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.util.List; + /** * @Author sun * @Description 部分基础数据上报 */ @Service +@Slf4j public class BaseReportServiceImpl implements BaseReportService { @Autowired @@ -217,9 +223,21 @@ public class BaseReportServiceImpl implements BaseReportService { * @author sun */ @Override - @Transactional(rollbackFor = Exception.class) public void agencyProject(AgencyProjectFormDTO formDTO) { - + if (CollectionUtils.isEmpty(formDTO.getDataList())){ + log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"组织项目"); + return; + } + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyProject(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertAgencyProject(p); + }); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml index 45f112c07b..147bbd845d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -156,5 +156,80 @@ + + + DELETE FROM fact_agency_project_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + INSERT INTO fact_agency_project_daily + (REPLACE(UUID(), '-', ''), + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + PROJECT_TOTAL, + PENDING_TOTAL, + PENDING_RATIO, + CLOSED_TOTAL, + CLOSED_RATIO, + RESOLVED_TOTAL, + RESOLVED_RATIO, + UNRESOLVED_TOTAL, + UNRESOLVED_RATIO, + PROJECT_INCR, + PENDING_INCR, + CLOSED_INCR, + RESOLVED_INCR, + UNRESOLVED_INCR, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + values + + ( + id + #{i.customerId}, + #{i.agencyId}, + #{i.parentId}, + #{i.dateId}, + #{i.weekId}, + #{i.monthId}, + #{i.quarterId}, + #{i.yearId}, + #{i.projectTotal}, + #{i.pendingTotal}, + #{i.pendingRatio}, + #{i.closedTotal}, + #{i.closedRatio}, + #{i.resolvedTotal}, + #{i.resolvedRatio}, + #{i.unresolvedTotal}, + #{i.unresolvedRatio}, + #{i.projectIncr}, + #{i.pendingIncr}, + #{i.closedIncr}, + #{i.resolvedIncr}, + #{i.unresolvedIncr}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) + + From f2f79f69430e7875f4b34b5ebd4a1d46eb60da2d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 25 Jun 2021 10:33:55 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/basereport/form/AgencyProjectFormDTO.java | 3 +-- .../src/main/resources/mapper/stats/BaseReportDao.xml | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java index d5a71d43f3..698e25306e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java @@ -24,8 +24,7 @@ public class AgencyProjectFormDTO implements Serializable { private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户Id 【dim_customer.id】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml index 147bbd845d..b63c8e8d5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -167,7 +167,8 @@ INSERT INTO fact_agency_project_daily - (REPLACE(UUID(), '-', ''), + ( + ID, CUSTOMER_ID, AGENCY_ID, PARENT_ID, @@ -199,7 +200,7 @@ values ( - id + REPLACE(UUID(), '-', ''), #{i.customerId}, #{i.agencyId}, #{i.parentId}, From 918326a0fe8786a7bf0f8e5b27e88eecff239add Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 25 Jun 2021 10:47:38 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/stats/BaseReportDao.java | 17 +++++ .../service/impl/BaseReportServiceImpl.java | 15 +++- .../resources/mapper/stats/BaseReportDao.xml | 75 +++++++++++++++++++ 3 files changed, 106 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java index 5d65fe2ea3..ff9babbaef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java @@ -104,4 +104,21 @@ public interface BaseReportDao { * @date 2021/6/25 9:14 上午 */ void insertAgencyProject(@Param("list")List dataList); + + /** + * @Description 根据dateId删除客户网格项目数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 10:36 上午 + */ + int delGridProject(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增网格项目数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 10:37 上午 + */ + void insertGridProject(@Param("list")List dataList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index 2a92d567c8..bf0ffac269 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -214,7 +214,20 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridProject(GridProjectFormDTO formDTO) { - + if (CollectionUtils.isEmpty(formDTO.getDataList())){ + log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"网格项目"); + return; + } + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridProject(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertGridProject(p); + }); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml index b63c8e8d5f..28bdbfd737 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -233,4 +233,79 @@ + + + INSERT INTO fact_grid_project_daily + (ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + PROJECT_TOTAL, + PENDING_TOTAL, + PENDING_RATIO, + CLOSED_TOTAL, + CLOSED_RATIO, + RESOLVED_TOTAL, + RESOLVED_RATIO, + UNRESOLVED_TOTAL, + UNRESOLVED_RATIO, + PROJECT_INCR, + PENDING_INCR, + CLOSED_INCR, + RESOLVED_INCR, + UNRESOLVED_INCR, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + values + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.agencyId}, + #{i.gridId}, + #{i.dateId}, + #{i.weekId}, + #{i.monthId}, + #{i.quarterId}, + #{i.yearId}, + #{i.projectTotal}, + #{i.pendingTotal}, + #{i.pendingRatio}, + #{i.closedTotal}, + #{i.closedRatio}, + #{i.resolvedTotal}, + #{i.resolvedRatio}, + #{i.unresolvedTotal}, + #{i.unresolvedRatio}, + #{i.projectIncr}, + #{i.pendingIncr}, + #{i.closedIncr}, + #{i.resolvedIncr}, + #{i.unresolvedIncr}, + 0, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + NOW() + ) + + + + + + DELETE FROM fact_grid_project_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + From b7691a0a71cbb1611870e43b3902a7d0a8ca48e5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 25 Jun 2021 11:00:41 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=B5=8C=E5=A5=97=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=8C=E5=85=A5=E5=8F=82=E9=9D=9E=E7=A9=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgencyGroupTotalFormDTO.java | 15 +++++++++------ .../basereport/form/AgencyHotTopicFormDTO.java | 15 +++++++++------ .../basereport/form/AgencyRegUserFormDTO.java | 15 +++++++++------ .../basereport/form/GridGroupTotalFormDTO.java | 18 ++++++++++-------- .../basereport/form/GridHotTopicFormDTO.java | 15 +++++++++------ .../basereport/form/GridRegUserFormDTO.java | 14 ++++++++------ .../epmet/controller/BaseReportController.java | 12 +++++++++++- 7 files changed, 65 insertions(+), 39 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java index b7f71d2257..0c47f9dfac 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.List; @@ -12,19 +14,20 @@ import java.util.List; @Data public class AgencyGroupTotalFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 数据集合对象 + */ + @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + private List dataList; /** * 为true时需要删除历史数据 */ private Boolean isFirst; - /** - * 数据集合对象 - */ - private List dataList; + public interface saveList extends CustomerClientShowGroup {} @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList { /** * 客户ID diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java index 4a09a985d1..865d118b89 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.List; @@ -12,19 +14,20 @@ import java.util.List; @Data public class AgencyHotTopicFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 数据集合对象 + */ + @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + private List dataList; /** * 为true时需要删除历史数据 */ private Boolean isFirst; - /** - * 数据集合对象 - */ - private List dataList; + public interface saveList extends CustomerClientShowGroup {} @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList { /** * 客户ID diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java index 26ea79aede..c488150a62 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -13,19 +15,20 @@ import java.util.List; @Data public class AgencyRegUserFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 数据集合对象 + */ + @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + private List dataList; /** * 为true时需要删除历史数据 */ private Boolean isFirst; - /** - * 数据集合对象 - */ - private List dataList; + public interface saveList extends CustomerClientShowGroup {} @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList { /** * 客户id diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java index 88ff0f7e3f..506f8a9797 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -13,20 +16,19 @@ import java.util.List; @Data public class GridGroupTotalFormDTO implements Serializable { private static final long serialVersionUID = 1L; - - /** - * 为true时需要删除历史数据 - */ - private Boolean isFirst; /** * 数据集合对象 */ + @NotEmpty(message = "至少有一条数据", groups = {saveList.class}) private List dataList; + /** + * 为true时需要删除历史数据 + */ + private Boolean isFirst; + public interface saveList extends CustomerClientShowGroup {} @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; - + public static class DataList { /** * 客户ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java index 9ed203d5e0..a46847f10b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.List; @@ -12,19 +14,20 @@ import java.util.List; @Data public class GridHotTopicFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 数据集合对象 + */ + @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + private List dataList; /** * 为true时需要删除历史数据 */ private Boolean isFirst; - /** - * 数据集合对象 - */ - private List dataList; + public interface saveList extends CustomerClientShowGroup {} @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList { /** * 客户ID diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java index 41f74c5c4f..0885763751 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; import lombok.Data; @@ -15,19 +16,20 @@ import java.util.List; @Data public class GridRegUserFormDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 数据集合对象 + */ + @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + private List dataList; /** * 为true时需要删除历史数据 */ private Boolean isFirst; - /** - * 数据集合对象 - */ - private List dataList; + public interface saveList extends CustomerClientShowGroup {} @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList { /** * 客户id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java index 9bb84ceba8..803e054e26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java @@ -1,10 +1,14 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.basereport.form.*; import com.epmet.service.BaseReportService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * @Author sun @@ -24,6 +28,7 @@ public class BaseReportController { */ @PostMapping("gridreguser") public Result gridRegUser(@RequestBody GridRegUserFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridRegUserFormDTO.saveList.class); baseReportService.gridRegUser(formDTO); return new Result(); } @@ -35,6 +40,7 @@ public class BaseReportController { */ @PostMapping("agencyreguser") public Result agencyRegUser(@RequestBody AgencyRegUserFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyRegUserFormDTO.saveList.class); baseReportService.agencyRegUser(formDTO); return new Result(); } @@ -46,6 +52,7 @@ public class BaseReportController { */ @PostMapping("gridgrouptotal") public Result gridGroupTotal(@RequestBody GridGroupTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridGroupTotalFormDTO.saveList.class); baseReportService.gridGroupTotal(formDTO); return new Result(); } @@ -57,6 +64,7 @@ public class BaseReportController { */ @PostMapping("agencygrouptotal") public Result agencyGroupTotal(@RequestBody AgencyGroupTotalFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyGroupTotalFormDTO.saveList.class); baseReportService.agencyGroupTotal(formDTO); return new Result(); } @@ -68,6 +76,7 @@ public class BaseReportController { */ @PostMapping("gridhottopic") public Result gridHotTopic(@RequestBody GridHotTopicFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridHotTopicFormDTO.saveList.class); baseReportService.gridHotTopic(formDTO); return new Result(); } @@ -79,6 +88,7 @@ public class BaseReportController { */ @PostMapping("agencyhottopic") public Result agencyHotTopic(@RequestBody AgencyHotTopicFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyHotTopicFormDTO.saveList.class); baseReportService.agencyHotTopic(formDTO); return new Result(); } From 10fbf816f8bf9c062f0455298674d370a7187854 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 25 Jun 2021 11:09:13 +0800 Subject: [PATCH 5/8] .. --- .../basereport/form/AgencyIssueFormDTO.java | 3 +- .../basereport/form/GridProjectFormDTO.java | 3 +- .../com/epmet/dao/stats/BaseReportDao.java | 17 ++++ .../service/impl/BaseReportServiceImpl.java | 15 ++- .../resources/mapper/stats/BaseReportDao.xml | 98 +++++++++++++++++++ 5 files changed, 131 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java index 3022e34bc8..137f11f162 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java @@ -24,8 +24,7 @@ public class AgencyIssueFormDTO implements Serializable { private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户ID diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java index 20d3306685..a136dd155c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java @@ -24,8 +24,7 @@ public class GridProjectFormDTO implements Serializable { private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户Id 【dim_customer.id】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java index ff9babbaef..bb9b5a2c9d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java @@ -121,4 +121,21 @@ public interface BaseReportDao { * @date 2021/6/25 10:37 上午 */ void insertGridProject(@Param("list")List dataList); + + /** + * @Description 删除组织议题数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 10:53 上午 + */ + int delAgencyIssue(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 新增组织议题数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 10:54 上午 + */ + void insertAgencyIssue(@Param("list")List dataList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index bf0ffac269..1f55ed9c37 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -203,7 +203,20 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyIssue(AgencyIssueFormDTO formDTO) { - + if (CollectionUtils.isEmpty(formDTO.getDataList())){ + log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"组织议题"); + return; + } + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyIssue(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertAgencyIssue(p); + }); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml index 28bdbfd737..b9daa49495 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -308,4 +308,102 @@ AND date_id = #{dateId} LIMIT 1000 + + + + DELETE FROM fact_issue_agency_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + INSERt INTO fact_issue_agency_daily + (ID, + CUSTOMER_ID, + AGENCY_ID, + PID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + WEEK_ID, + DATE_ID, + ISSUE_INCR, + ISSUE_TOTAL, + SHIFT_PROJECT_INCR, + SHIFT_PROJECT_TOTAL, + SHIFT_PROJECT_PERCENT, + VOTING_INCR, + VOTING_TOTAL, + VOTING_PERCENT, + CLOSED_INCR, + CLOSED_RESOLVED_INCR, + CLOSED_UNRESOLVED_INCR, + CLOSED_TOTAL, + CLOSED_RESOLVED_TOTAL, + CLOSED_UNRESOLVED_TOTAL, + CLOSED_PERCENT, + CLOSED_RESOLVED_PERCENT, + CLOSED_UNRESOLVED_PERCENT, + CLOSED_CASE_INCR, + CLOSED_CASE_RESOLVED_INCR, + CLOSED_CASE_UNRESOLVED_INCR, + CLOSED_CASE_TOTAL, + CLOSED_CASE_RESOLVED_TOTAL, + CLOSED_CASE_UNRESOLVED_TOTAL, + CLOSED_CASE_RESOLVED_PERCENT, + CLOSED_CASE_UNRESOLVED_PERCENT, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + DEL_FLAG, + UPDATED_TIME) + VALUES + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.agencyId}, + #{i.pid}, + #{i.yearId}, + #{i.quarterId}, + #{i.monthId}, + #{i.weekId}, + #{i.dateId}, + #{i.issueIncr}, + #{i.issueTotal}, + #{i.shiftProjectIncr}, + #{i.shiftProjectTotal}, + #{i.shiftProjectPercent}, + #{i.votingIncr}, + #{i.votingTotal}, + #{i.votingPercent}, + #{i.closedIncr}, + #{i.closedResolvedIncr}, + #{i.closedUnresolvedIncr}, + #{i.closedTotal}, + #{i.closedResolvedTotal}, + #{i.closedUnresolvedTotal}, + #{i.closedPercent}, + #{i.closedResolvedPercent}, + #{i.closedUnresolvedPercent}, + #{i.closedCaseIncr}, + #{i.closedCaseResolvedIncr}, + #{i.closedCaseUnresolvedIncr}, + #{i.closedCaseTotal}, + #{i.closedCaseResolvedTotal}, + #{i.closedCaseUnresolvedTotal}, + #{i.closedCaseResolvedPercent}, + #{i.closedCaseUnresolvedPercent}, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + 0, + NOW() + ) + + From 99aa211326876656b35b4d9999ece5aa12e29ddb Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 25 Jun 2021 13:42:50 +0800 Subject: [PATCH 6/8] .. --- .../dto/basereport/form/AgencyIssueFormDTO.java | 5 +++++ .../dto/basereport/form/AgencyProjectFormDTO.java | 6 ++++++ .../dto/basereport/form/GridProjectFormDTO.java | 5 +++++ .../com/epmet/controller/BaseReportController.java | 3 +++ .../epmet/service/impl/BaseReportServiceImpl.java | 12 ------------ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java index 137f11f162..d57740cb12 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +16,8 @@ import java.util.List; public class AgencyIssueFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AgencyIssueForm extends CustomerClientShowGroup{} + /** * 为true时需要删除历史数据 */ @@ -21,6 +25,7 @@ public class AgencyIssueFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = AgencyIssueForm.class) private List dataList; @Data diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java index 698e25306e..7702a90a4b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +17,8 @@ import java.util.List; public class AgencyProjectFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AgencyProjectForm extends CustomerClientShowGroup {} + /** * 为true时需要删除历史数据 */ @@ -21,6 +26,7 @@ public class AgencyProjectFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = AgencyProjectForm.class) private List dataList; @Data diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java index a136dd155c..b85f741c82 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +16,8 @@ import java.util.List; public class GridProjectFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface GridProjectForm extends CustomerClientShowGroup {} + /** * 为true时需要删除历史数据 */ @@ -21,6 +25,7 @@ public class GridProjectFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = GridProjectForm.class) private List dataList; @Data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java index 803e054e26..1db8161221 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java @@ -155,6 +155,7 @@ public class BaseReportController { */ @PostMapping("agencyissue") public Result agencyIssue(@RequestBody AgencyIssueFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyIssueFormDTO.AgencyIssueForm.class); baseReportService.agencyIssue(formDTO); return new Result(); } @@ -166,6 +167,7 @@ public class BaseReportController { */ @PostMapping("gridproject") public Result gridProject(@RequestBody GridProjectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridProjectFormDTO.GridProjectForm.class); baseReportService.gridProject(formDTO); return new Result(); } @@ -177,6 +179,7 @@ public class BaseReportController { */ @PostMapping("agencyproject") public Result agencyProject(@RequestBody AgencyProjectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyProjectFormDTO.AgencyProjectForm.class); baseReportService.agencyProject(formDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index 1f55ed9c37..db2753e51e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -203,10 +203,6 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyIssue(AgencyIssueFormDTO formDTO) { - if (CollectionUtils.isEmpty(formDTO.getDataList())){ - log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"组织议题"); - return; - } if (formDTO.getIsFirst()) { int deleteNum; do { @@ -227,10 +223,6 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridProject(GridProjectFormDTO formDTO) { - if (CollectionUtils.isEmpty(formDTO.getDataList())){ - log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"网格项目"); - return; - } if (formDTO.getIsFirst()) { int deleteNum; do { @@ -250,10 +242,6 @@ public class BaseReportServiceImpl implements BaseReportService { */ @Override public void agencyProject(AgencyProjectFormDTO formDTO) { - if (CollectionUtils.isEmpty(formDTO.getDataList())){ - log.warn(String.format(BaseReportConstant.DATA_IS_NULL),"组织项目"); - return; - } if (formDTO.getIsFirst()) { int deleteNum; do { From 4a6ba99c999a86ba2886dfd896343aa04248f0f8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Jun 2021 14:10:49 +0800 Subject: [PATCH 7/8] difficultyrank-multic --- .../result/ScreenProjectDetailResultDTO.java | 6 +++ .../resources/mapper/project/ProjectDao.xml | 50 ++++++++++++------- .../mapper/screen/ScreenProjectDataDao.xml | 3 +- .../ScreenGovernRankDataDailyEntity.java | 4 +- 4 files changed, 41 insertions(+), 22 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java index a52300cc0b..287703b6ef 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.util.Set; @@ -71,6 +72,11 @@ public class ScreenProjectDetailResultDTO implements Serializable { */ private List processList; + /** + * 满意度得分 + */ + private BigDecimal score; + @Data public static class processDTO{ private String processId; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index 888f8b0938..b7ea753131 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -286,6 +286,22 @@ where sdd1.DEL_FLAG='0' and scg.DEL_FLAG='0' and sdd1.ORG_TYPE='grid' + + and sdd1.AREA_CODE like concat(#{areaCode},'%') + + + + + AND sdd1.ORG_ID = #{agencyId,jdbcType=VARCHAR} + + + AND sdd1.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') + + + + + AND sdd1.EVENT_STATUS_CODE = #{status} + union select sca.AREA_CODE,sdd2.* from screen_difficulty_data sdd2 left join screen_customer_agency sca @@ -293,25 +309,23 @@ where sdd2.DEL_FLAG='0' and sca.DEL_FLAG='0' and sdd2.ORG_TYPE='agency' + + and sdd2.AREA_CODE like concat(#{areaCode},'%') + + + + + AND sdd2.ORG_ID = #{agencyId,jdbcType=VARCHAR} + + + AND sdd2.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') + + + + + AND sdd2.EVENT_STATUS_CODE = #{status} + ) diff - WHERE - diff.DEL_FLAG = '0' - - and diff.AREA_CODE like concat(#{areaCode},'%') - - - - - AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR} - - - AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%') - - - - - AND diff.EVENT_STATUS_CODE = #{status} - ORDER BY CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index f45f13aadc..53294f4783 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -69,7 +69,8 @@ IFNULL(link_mobile,'') as mobile, IFNULL(project_address,'') as reportAddress, CUSTOMER_ID as customerId, - PROJECT_STATUS_CODE as projectStatusCode + PROJECT_STATUS_CODE as projectStatusCode, + floor( SATISFACTION_SCORE) AS score, FROM screen_project_data WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java index 66b0db7dfa..d2f2c16625 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java @@ -18,13 +18,11 @@ package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; import java.math.BigDecimal; -import java.util.Date; /** * 基层治理-治理能力排行数据(按月统计) @@ -97,7 +95,7 @@ public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { /** * 满意率 */ - private BigDecimal satisfactionRatio;. + private BigDecimal satisfactionRatio; /** * 响应数 From 7e0ecfea9dfadbf6d6d31c9762e06942a21cc2d1 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 25 Jun 2021 14:14:37 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgencyGroupTotalFormDTO.java | 14 +- .../form/AgencyHotTopicFormDTO.java | 14 +- .../basereport/form/AgencyRegUserFormDTO.java | 26 +-- .../form/GridGroupTotalFormDTO.java | 14 +- .../basereport/form/GridHotTopicFormDTO.java | 14 +- .../basereport/form/GridRegUserFormDTO.java | 26 +-- .../resources/mapper/stats/BaseReportDao.xml | 200 ++++++++++++++++++ 7 files changed, 254 insertions(+), 54 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java index 0c47f9dfac..76f12be516 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java @@ -52,37 +52,37 @@ public class AgencyGroupTotalFormDTO implements Serializable { /** * 周ID */ - private String weekId; + private String weekId = ""; /** * 月份ID */ - private String monthId; + private String monthId = ""; /** * 季度ID */ - private String quarterId; + private String quarterId = ""; /** * 年ID */ - private String yearId; + private String yearId = ""; /** * 当前组织及下级小组总数 */ - private Integer groupTotal; + private Integer groupTotal = 0; /** * 当前组织及下级楼院小组总数 */ - private Integer ordinaryTotal; + private Integer ordinaryTotal = 0; /** * 当前组织及下级支部小组总数 */ - private Integer branchTotal; + private Integer branchTotal = 0; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java index 865d118b89..6583407543 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java @@ -52,37 +52,37 @@ public class AgencyHotTopicFormDTO implements Serializable { /** * 周ID */ - private String weekId; + private String weekId = ""; /** * 月ID */ - private String monthId; + private String monthId = ""; /** * 季度ID */ - private String quarterId; + private String quarterId = ""; /** * 年ID */ - private String yearId; + private String yearId = ""; /** * 话题总数 */ - private Integer topicTotal; + private Integer topicTotal = 0; /** * 话题状态【热议中:hot_discuss】 */ - private String status; + private String status = ""; /** * 状态话题数量 */ - private Integer topicCount; + private Integer topicCount = 0; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java index c488150a62..d6a3063eeb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java @@ -29,7 +29,7 @@ public class AgencyRegUserFormDTO implements Serializable { @Data public static class DataList { - + BigDecimal bi = new BigDecimal(0); /** * 客户id */ @@ -48,62 +48,62 @@ public class AgencyRegUserFormDTO implements Serializable { /** * */ - private String weekId; + private String weekId = ""; /** * */ - private String yearId; + private String yearId = ""; /** * 注册用户总数 */ - private Integer regTotal; + private Integer regTotal = 0; /** * 居民总数 */ - private Integer resiTotal; + private Integer resiTotal = 0; /** * 热心居民总数 */ - private Integer warmHeartedTotal; + private Integer warmHeartedTotal = 0; /** * 党员总数 */ - private Integer partymemberTotal; + private Integer partymemberTotal = 0; /** * 本日注册居民日增量 */ - private Integer regIncr; + private Integer regIncr = 0; /** * 本日热心居民日增量 */ - private Integer warmIncr; + private Integer warmIncr = 0; /** * 本日党员认证日增量 */ - private Integer partymemberIncr; + private Integer partymemberIncr = 0; /** * 居民总数占比 */ - private BigDecimal resiProportion; + private BigDecimal resiProportion = bi; /** * 党员总数占比 */ - private BigDecimal partymemberProportion; + private BigDecimal partymemberProportion = bi; /** * 热心居民占比 */ - private BigDecimal warmHeartedProportion; + private BigDecimal warmHeartedProportion = bi; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java index 506f8a9797..8fb2dc7e25 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java @@ -52,37 +52,37 @@ public class GridGroupTotalFormDTO implements Serializable { /** * 周ID */ - private String weekId; + private String weekId = ""; /** * 月份ID */ - private String monthId; + private String monthId = ""; /** * 季度ID */ - private String quarterId; + private String quarterId = ""; /** * 年ID */ - private String yearId; + private String yearId = ""; /** * 网格下小组总数 */ - private Integer groupTotal; + private Integer groupTotal = 0; /** * 网格下楼院小组总数 */ - private Integer ordinaryTotal; + private Integer ordinaryTotal = 0; /** * 网格下支部小组总数 */ - private Integer branchTotal; + private Integer branchTotal = 0; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java index a46847f10b..3fd04fa2f6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java @@ -52,37 +52,37 @@ public class GridHotTopicFormDTO implements Serializable { /** * 周ID */ - private String weekId; + private String weekId = ""; /** * 月ID */ - private String monthId; + private String monthId = ""; /** * 季度ID */ - private String quarterId; + private String quarterId = ""; /** * 年ID */ - private String yearId; + private String yearId = ""; /** * 话题总数 */ - private Integer topicTotal; + private Integer topicTotal = 0; /** * 话题状态【热议中:hot_discuss】 */ - private String status; + private String status = ""; /** * 状态话题数量 */ - private Integer topicCount; + private Integer topicCount = 0; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java index 0885763751..e2b85792ea 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java @@ -30,7 +30,7 @@ public class GridRegUserFormDTO implements Serializable { @Data public static class DataList { - + BigDecimal bi = new BigDecimal(0); /** * 客户id */ @@ -54,62 +54,62 @@ public class GridRegUserFormDTO implements Serializable { /** * 周维度Id */ - private String weekId; + private String weekId = ""; /** * 年维度Id */ - private String yearId; + private String yearId = ""; /** * 注册用户总数 */ - private Integer regTotal; + private Integer regTotal = 0; /** * 居民总数 */ - private Integer resiTotal; + private Integer resiTotal = 0; /** * 热心居民总数 */ - private Integer warmHeartedTotal; + private Integer warmHeartedTotal = 0; /** * 党员总数 */ - private Integer partymemberTotal; + private Integer partymemberTotal = 0; /** * 本日注册居民日增量 */ - private Integer regIncr; + private Integer regIncr = 0; /** * 本日热心居民日增量 */ - private Integer warmIncr; + private Integer warmIncr = 0; /** * 本日党员认证日增量 */ - private Integer partymemberIncr; + private Integer partymemberIncr = 0; /** * 居民总数占比 */ - private BigDecimal resiProportion; + private BigDecimal resiProportion = bi; /** * 党员总数占比 */ - private BigDecimal partymemberProportion; + private BigDecimal partymemberProportion = bi; /** * 热心居民占比 */ - private BigDecimal warmHeartedProportion; + private BigDecimal warmHeartedProportion = bi; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml index b9daa49495..8f16d0462a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -133,27 +133,227 @@ + DELETE + FROM + fact_group_total_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + insert into fact_group_total_grid_daily + ( + id, + customer_id, + agency_id, + grid_id, + date_id, + week_id, + month_id, + quarter_id, + year_id, + group_total, + ordinary_total, + branch_total, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.groupTotal}, + #{item.ordinaryTotal}, + #{item.branchTotal}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) + + DELETE + FROM + fact_group_total_agency_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + insert into fact_group_total_agency_daily + ( + id, + customer_id, + agency_id, + pid, + date_id, + week_id, + month_id, + quarter_id, + year_id, + group_total, + ordinary_total, + branch_total, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.pid}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.groupTotal}, + #{item.ordinaryTotal}, + #{item.branchTotal}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) + + DELETE + FROM + fact_topic_hotdiscuss_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + insert into fact_topic_hotdiscuss_grid_daily + ( + id, + customer_id, + agency_id, + grid_id, + date_id, + week_id, + month_id, + quarter_id, + year_id, + topic_total, + status, + topic_count, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.topicTotal}, + #{item.status}, + #{item.topicCount}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) + + DELETE + FROM + fact_topic_hotdiscuss_agency_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + insert into fact_topic_hotdiscuss_agency_daily + ( + id, + customer_id, + agency_id, + pid, + date_id, + week_id, + month_id, + quarter_id, + year_id, + topic_total, + status, + topic_count, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.pid}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.topicTotal}, + #{item.status}, + #{item.topicCount}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) +