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-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..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 @@ -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 @@ -49,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 4a09a985d1..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 @@ -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 @@ -49,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/AgencyIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java index 3022e34bc8..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,11 +25,11 @@ public class AgencyIssueFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = AgencyIssueForm.class) 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/AgencyProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java index d5a71d43f3..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,11 +26,11 @@ public class AgencyProjectFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = AgencyProjectForm.class) 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-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..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 @@ -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,20 +15,21 @@ 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 { + BigDecimal bi = new BigDecimal(0); /** * 客户id */ @@ -45,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 88ff0f7e3f..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 @@ -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 */ @@ -50,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 9ed203d5e0..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 @@ -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 @@ -49,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/GridProjectFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java index 20d3306685..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,11 +25,11 @@ public class GridProjectFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = GridProjectForm.class) 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-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..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 @@ -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,20 +16,21 @@ 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 { + BigDecimal bi = new BigDecimal(0); /** * 客户id */ @@ -52,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/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/controller/BaseReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java index 9bb84ceba8..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 @@ -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(); } @@ -145,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(); } @@ -156,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(); } @@ -167,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/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java index d60d287216..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 @@ -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,55 @@ 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); + + /** + * @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); + + /** + * @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/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java index 02757e6d8f..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; /** * 基层治理-治理能力排行数据(按月统计) 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..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 @@ -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 @@ -197,7 +203,16 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyIssue(AgencyIssueFormDTO formDTO) { - + 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); + }); } /** @@ -208,7 +223,16 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridProject(GridProjectFormDTO formDTO) { - + 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); + }); } /** @@ -217,9 +241,17 @@ public class BaseReportServiceImpl implements BaseReportService { * @author sun */ @Override - @Transactional(rollbackFor = Exception.class) public void agencyProject(AgencyProjectFormDTO formDTO) { - + 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..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,28 +133,477 @@ + 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() + ) + + + + + + DELETE FROM fact_agency_project_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + INSERT INTO fact_agency_project_daily + ( + ID, + 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 + + ( + REPLACE(UUID(), '-', ''), + #{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() + ) + + + + + + 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 + + + + + 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() + ) + +