Browse Source

事件、党员分布、top区概况

master
zxc 5 years ago
parent
commit
d8dbc52016
  1. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java
  2. 24
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java
  3. 6
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java
  4. 45
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java
  5. 45
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java
  6. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  7. 38
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java
  8. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java
  9. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java
  10. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java
  11. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java
  12. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml
  13. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 1:25 下午
*/
@Data
public class ProjectFormDTO implements Serializable {
private static final long serialVersionUID = 7114390205886348751L;
public interface Project{}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {Project.class})
private String agencyId;
}

24
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java

@ -0,0 +1,24 @@
package com.epmet.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 1:43 下午
*/
@Data
public class TopProfileFormDTO implements Serializable {
private static final long serialVersionUID = -287352242311433250L;
public interface TopProfile{}
/**
* 机关ID
*/
@NotBlank(message = "机关ID不能为空",groups = {TopProfile.class})
private String agencyId;
}

6
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java

@ -16,15 +16,15 @@ public class BranchResultDTO implements Serializable {
/**
* 网格ID
*/
private String gridId;
private String gridId = "";
/**
* 网格名称
*/
private String gridName;
private String gridName = "";
/**
* 党支部(网格)位置
*/
private String partyMark;
private String partyMark = "";
}

45
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 1:27 下午
*/
@Data
public class ProjectResultDTO implements Serializable {
private static final long serialVersionUID = 7130615407473171093L;
/**
* 项目标题
*/
private String projectTitle = "";
/**
* red, green,yellow
*/
private String color = "";
/**
* 项目id
*/
private String projectId = "";
/**
* 网格名称
*/
private String orgName = "";
/**
* 经度
*/
private Double longitude = 0.0;
/**
* 纬度
*/
private Double latitude = 0.0;
}

45
epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java

@ -0,0 +1,45 @@
package com.epmet.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/8/19 1:46 下午
*/
@Data
public class TopProfileResultDTO implements Serializable {
private static final long serialVersionUID = -5081563117620857359L;
/**
* 用户总数
*/
private Integer userNum = 0;
/**
* 党员总数
*/
private Integer partyMemberNum = 0;
/**
* 党群总数
*/
private Integer groupNum = 0;
/**
* 话题总数
*/
private Integer topicNum = 0;
/**
* 议题总数
*/
private Integer issueNum = 0;
/**
* 项目总数
*/
private Integer projectNum = 0;
}

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -49,6 +49,7 @@ public class AgencyController {
* @author zxc
* @date 2020/8/18 2:33 下午
*/
@ExternalAppRequestAuth
@PostMapping("compartment")
public Result<CompartmentResultDTO> compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){
ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class);

38
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java

@ -1,13 +1,10 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.screen.dto.form.BranchFormDTO;
import com.epmet.screen.dto.form.ParymemberFormDTO;
import com.epmet.screen.dto.form.UserFormDTO;
import com.epmet.screen.dto.result.BranchResultDTO;
import com.epmet.screen.dto.result.ParymemberResultDTO;
import com.epmet.screen.dto.result.UserResultDTO;
import com.epmet.screen.dto.form.*;
import com.epmet.screen.dto.result.*;
import com.epmet.datareport.service.screen.DistributionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -36,6 +33,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 10:59 上午
*/
@ExternalAppRequestAuth
@PostMapping("branch")
public Result<List<BranchResultDTO>> branch(@RequestBody BranchFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class);
@ -48,6 +46,7 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 11:10 上午
*/
@ExternalAppRequestAuth
@PostMapping("user")
public Result<UserResultDTO> user(@RequestBody UserFormDTO userFormDTO){
ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class);
@ -60,10 +59,37 @@ public class DistributionController {
* @author zxc
* @date 2020/8/18 11:20 上午
*/
@ExternalAppRequestAuth
@PostMapping("parymember")
public Result<ParymemberResultDTO> parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){
ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class);
return new Result<ParymemberResultDTO>().ok(distributionService.parymember(parymemberFormDTO));
}
/**
* @Description 4事件
* @param projectFormDTO
* @author zxc
* @date 2020/8/19 1:29 下午
*/
// @ExternalAppRequestAuth
@PostMapping("project")
public Result<List<ProjectResultDTO>> project(@RequestBody ProjectFormDTO projectFormDTO){
ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class);
return new Result<List<ProjectResultDTO>>().ok(distributionService.project(projectFormDTO));
}
/**
* @Description 5top区概况
* @param topProfileFormDTO
* @author zxc
* @date 2020/8/19 1:52 下午
*/
// @ExternalAppRequestAuth
@PostMapping("topprofile")
public Result<TopProfileResultDTO> topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){
ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class);
return new Result<TopProfileResultDTO>().ok(distributionService.topProfile(topProfileFormDTO));
}
}

14
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java

@ -17,7 +17,11 @@
package com.epmet.datareport.dao.screen;
import com.epmet.screen.dto.result.ProjectResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-事件数据
@ -27,5 +31,13 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ScreenEventDataDao{
/**
* @Description 查询事件
* @param parentId
* @author zxc
* @date 2020/8/19 2:09 下午
*/
List<ProjectResultDTO> selectEvent(@Param("parentId")String parentId);
}

9
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java

@ -18,6 +18,7 @@
package com.epmet.datareport.dao.screen;
import com.epmet.screen.dto.result.PartymemberPercentResultDTO;
import com.epmet.screen.dto.result.TopProfileResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -39,4 +40,12 @@ public interface ScreenUserTotalDataDao {
**/
PartymemberPercentResultDTO selectAgencyPartymemberPercent(@Param("agencyId")String agencyId);
/**
* @Description 查询top区概况
* @param agencyId
* @author zxc
* @date 2020/8/19 2:13 下午
*/
TopProfileResultDTO selectTopProfile(@Param("agencyId")String agencyId);
}

24
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java

@ -1,11 +1,7 @@
package com.epmet.datareport.service.screen;
import com.epmet.screen.dto.form.BranchFormDTO;
import com.epmet.screen.dto.form.ParymemberFormDTO;
import com.epmet.screen.dto.form.UserFormDTO;
import com.epmet.screen.dto.result.BranchResultDTO;
import com.epmet.screen.dto.result.ParymemberResultDTO;
import com.epmet.screen.dto.result.UserResultDTO;
import com.epmet.screen.dto.form.*;
import com.epmet.screen.dto.result.*;
import java.util.List;
@ -41,4 +37,20 @@ public interface DistributionService {
*/
ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO);
/**
* @Description 4事件
* @param projectFormDTO
* @author zxc
* @date 2020/8/19 1:29 下午
*/
List<ProjectResultDTO> project(ProjectFormDTO projectFormDTO);
/**
* @Description 5top区概况
* @param topProfileFormDTO
* @author zxc
* @date 2020/8/19 1:52 下午
*/
TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO);
}

42
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java

@ -1,10 +1,11 @@
package com.epmet.datareport.service.screen.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.screen.ScreenCustomerGridDao;
import com.epmet.screen.dto.form.BranchFormDTO;
import com.epmet.screen.dto.form.ParymemberFormDTO;
import com.epmet.screen.dto.form.UserFormDTO;
import com.epmet.datareport.dao.screen.ScreenEventDataDao;
import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao;
import com.epmet.screen.dto.form.*;
import com.epmet.screen.dto.result.*;
import com.epmet.screen.constant.*;
import com.epmet.datareport.service.screen.DistributionService;
@ -12,6 +13,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
@ -27,6 +29,10 @@ public class DistributionServiceImpl implements DistributionService {
private ScreenCustomerGridDao screenCustomerGridDao;
@Autowired
private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@Autowired
private ScreenEventDataDao screenEventDataDao;
@Autowired
private ScreenUserTotalDataDao screenUserTotalDataDao;
/**
* @Description 1党支部
@ -87,4 +93,34 @@ public class DistributionServiceImpl implements DistributionService {
}
return parymemberResult;
}
/**
* @Description 4事件
* @param projectFormDTO
* @author zxc
* @date 2020/8/19 1:29 下午
*/
@Override
public List<ProjectResultDTO> project(ProjectFormDTO projectFormDTO) {
List<ProjectResultDTO> projectResultDTOS = screenEventDataDao.selectEvent(projectFormDTO.getAgencyId());
if (projectResultDTOS.size() == NumConstant.ZERO){
return new ArrayList<>();
}
return projectResultDTOS;
}
/**
* @Description 5top区概况
* @param topProfileFormDTO
* @author zxc
* @date 2020/8/19 1:52 下午
*/
@Override
public TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO) {
TopProfileResultDTO topProfileResultDTO = screenUserTotalDataDao.selectTopProfile(topProfileFormDTO.getAgencyId());
if (null == topProfileResultDTO){
return new TopProfileResultDTO();
}
return topProfileResultDTO;
}
}

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml

@ -3,6 +3,19 @@
<mapper namespace="com.epmet.datareport.dao.screen.ScreenEventDataDao">
<!-- 查询事件 -->
<select id="selectEvent" resultType="com.epmet.screen.dto.result.ProjectResultDTO">
SELECT
event_title AS projectTitle,
event_level AS color,
event_id AS projectId,
org_name AS orgName,
longitude AS longitude,
latitude AS latitude
FROM
screen_event_data
WHERE
del_flag = '0'
AND parent_id = #{parentId}
</select>
</mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml

@ -16,4 +16,21 @@
AND ORG_ID = #{agencyId}
</select>
<!-- 查询top区概况 -->
<select id="selectTopProfile" resultType="com.epmet.screen.dto.result.TopProfileResultDTO">
SELECT
user_total AS userNum,
party_total AS partyMemberNum,
group_total AS groupNum,
topic_total AS topicNum,
issue_total AS issueNum,
project_total AS projectNum
FROM
screen_user_total_data
WHERE
del_flag = '0'
AND org_type = 'agency'
AND org_id = #{agencyId}
</select>
</mapper>
Loading…
Cancel
Save