diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/ProjectFormDTO.java new file mode 100644 index 0000000000..445cefc453 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/TopProfileFormDTO.java new file mode 100644 index 0000000000..6b0d00dae1 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java index 0a836a6bfd..f4a611cc10 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java +++ b/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 = ""; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java new file mode 100644 index 0000000000..7a0a016b25 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java new file mode 100644 index 0000000000..607891f5bf --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index d4bbc8f160..d671c4cd05 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/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 compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index a85fe05054..648d1e088b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/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> 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 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 parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); return new Result().ok(distributionService.parymember(parymemberFormDTO)); } + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ +// @ExternalAppRequestAuth + @PostMapping("project") + public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ + ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); + return new Result>().ok(distributionService.project(projectFormDTO)); + } + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ +// @ExternalAppRequestAuth + @PostMapping("topprofile") + public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ + ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); + return new Result().ok(distributionService.topProfile(topProfileFormDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java index 7ef0c0287b..362ada2193 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java +++ b/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 selectEvent(@Param("parentId")String parentId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java index 70477e48c6..46576c5517 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java +++ b/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); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java index 02471cdf22..62a0d0d7bf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java +++ b/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 project(ProjectFormDTO projectFormDTO); + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java index 1c6356d550..a1d9025ead 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java +++ b/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 project(ProjectFormDTO projectFormDTO) { + List projectResultDTOS = screenEventDataDao.selectEvent(projectFormDTO.getAgencyId()); + if (projectResultDTOS.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return projectResultDTOS; + } + + /** + * @Description 5、top区概况 + * @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; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index 813b3f74a3..6cfafcf70a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -3,6 +3,19 @@ - - + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index 72c533126d..673ffee04a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -16,4 +16,21 @@ AND ORG_ID = #{agencyId} + + + \ No newline at end of file