Browse Source

Merge remote-tracking branch 'origin/dev_data_fusion' into dev_data_fusion

dev_shibei_match
zhaoqifeng 4 years ago
parent
commit
d0b1963362
  1. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
  2. 50
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  3. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml
  4. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java
  5. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java
  6. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyIssueFormDTO.java
  7. 9
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyProjectFormDTO.java
  8. 41
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java
  9. 32
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridGroupTotalFormDTO.java
  10. 29
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java
  11. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridProjectFormDTO.java
  12. 40
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java
  13. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/BaseReportConstant.java
  14. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java
  15. 54
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java
  17. 40
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java
  18. 449
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml

6
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<processDTO> processList;
/**
* 满意度得分
*/
private BigDecimal score;
@Data
public static class processDTO{
private String processId;

50
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'
<if test="areaCode != null and areaCode != ''">
and sdd1.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>
<when test="orgType != null and orgType == 'grid'">
AND sdd1.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND sdd1.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
</if>
<if test="status!= null and status != ''">
AND sdd1.EVENT_STATUS_CODE = #{status}
</if>
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'
<if test="areaCode != null and areaCode != ''">
and sdd2.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>
<when test="orgType != null and orgType == 'grid'">
AND sdd2.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND sdd2.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
</if>
<if test="status!= null and status != ''">
AND sdd2.EVENT_STATUS_CODE = #{status}
</if>
) diff
WHERE
diff.DEL_FLAG = '0'
<if test="areaCode != null and areaCode != ''">
and diff.AREA_CODE like concat(#{areaCode},'%')
</if>
<if test="areaCode == null || areaCode == ''">
<choose>
<when test="orgType != null and orgType == 'grid'">
AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
</if>
<if test="status!= null and status != ''">
AND diff.EVENT_STATUS_CODE = #{status}
</if>
ORDER BY
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT

3
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

29
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> dataList;
/**
* 为true时需要删除历史数据
*/
private Boolean isFirst;
/**
* 数据集合对象
*/
private List<DataList> 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;
}
}

29
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> dataList;
/**
* 为true时需要删除历史数据
*/
private Boolean isFirst;
/**
* 数据集合对象
*/
private List<DataList> 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;
}
}

8
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> dataList;
@Data
public class DataList implements Serializable {
private static final long serialVersionUID = 1L;
public static class DataList{
/**
* 客户ID

9
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> dataList;
@Data
public class DataList implements Serializable {
private static final long serialVersionUID = 1L;
public static class DataList{
/**
* 客户Id dim_customer.id

41
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> dataList;
/**
* 为true时需要删除历史数据
*/
private Boolean isFirst;
/**
* 数据集合对象
*/
private List<DataList> 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;
}
}

32
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> 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;
}
}

29
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> dataList;
/**
* 为true时需要删除历史数据
*/
private Boolean isFirst;
/**
* 数据集合对象
*/
private List<DataList> 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;
}
}

8
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> dataList;
@Data
public class DataList implements Serializable {
private static final long serialVersionUID = 1L;
public static class DataList{
/**
* 客户Id dim_customer.id

40
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> dataList;
/**
* 为true时需要删除历史数据
*/
private Boolean isFirst;
/**
* 数据集合对象
*/
private List<DataList> 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;
}
}

13
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数据为空";
}

15
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();
}

54
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<AgencyHotTopicFormDTO.DataList> 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<AgencyProjectFormDTO.DataList> 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<GridProjectFormDTO.DataList> 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<AgencyIssueFormDTO.DataList> dataList);
}

2
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;
/**
* 基层治理-治理能力排行数据(按月统计)

40
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<List<AgencyIssueFormDTO.DataList>> 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<List<GridProjectFormDTO.DataList>> 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<List<AgencyProjectFormDTO.DataList>> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
baseReportDao.insertAgencyProject(p);
});
}
}

449
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml

@ -133,28 +133,477 @@
</insert>
<delete id="delGridGroupTotal">
DELETE
FROM
fact_group_total_grid_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<insert id="insertBatchGridGroupTotal">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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()
)
</foreach>
</insert>
<delete id="delAgencyGroupTotal">
DELETE
FROM
fact_group_total_agency_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<insert id="insertBatchAgencyGroupTotal">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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()
)
</foreach>
</insert>
<delete id="delGridHotTopic">
DELETE
FROM
fact_topic_hotdiscuss_grid_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<insert id="insertBatchGridHotTopic">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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()
)
</foreach>
</insert>
<delete id="delAgencyHotTopic">
DELETE
FROM
fact_topic_hotdiscuss_agency_daily
WHERE
customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<insert id="insertBatchAgencyHotTopic">
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
<foreach collection="list" item="item" index="index" separator=",">
(
(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()
)
</foreach>
</insert>
<!-- 根据dateId删除客户组织项目数据 -->
<delete id="delAgencyProject">
DELETE FROM fact_agency_project_daily
WHERE customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<!-- 批量新增组织项目数据 -->
<insert id="insertAgencyProject">
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
<foreach collection="list" item="i" separator=",">
(
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()
)
</foreach>
</insert>
<!-- 批量新增网格项目数据 -->
<insert id="insertGridProject">
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
<foreach collection="list" item="i" separator=",">
(
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()
)
</foreach>
</insert>
<!-- 根据dateId删除客户网格项目数据 -->
<delete id="delGridProject">
DELETE FROM fact_grid_project_daily
WHERE customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<!-- 删除组织议题数据 -->
<delete id="delAgencyIssue">
DELETE FROM fact_issue_agency_daily
WHERE customer_id = #{customerId}
AND date_id = #{dateId}
LIMIT 1000
</delete>
<!-- 新增组织议题数据 -->
<insert id="insertAgencyIssue">
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
<foreach collection="list" item="i" separator=",">
(
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()
)
</foreach>
</insert>
</mapper>

Loading…
Cancel
Save