From 0351a453e8993036d89d9cffa8265622320cf3db Mon Sep 17 00:00:00 2001 From: HAHA Date: Mon, 9 May 2022 14:27:26 +0800 Subject: [PATCH 1/3] =?UTF-8?q?message:=20=E4=B8=BA=E5=85=9A=E5=91=98?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=88=B7=E5=9D=90=E6=A0=87=E9=9B=86=E5=90=88?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E8=A7=A3=20=E4=B8=BA=E5=85=9A?= =?UTF-8?q?=E5=91=98=E4=B8=AD=E5=BF=83=E6=88=B7=E6=95=B0=E5=92=8C=E5=85=9A?= =?UTF-8?q?=E7=BE=A4=E6=9C=8D=E5=8A=A1=E7=AB=99=E6=95=B0=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PowerAxisDataVisualController.java | 3 +- .../modules/axis/dao/PowerAxisStructDao.java | 10 +- .../impl/PowerAxisStructServiceImpl.java | 4 +- .../mapper/poweraxis/PowerAxisStructDao.xml | 106 ++++++++++-------- 4 files changed, 69 insertions(+), 54 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java index d1c1615..63c9820 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -14,6 +14,7 @@ import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; /*** @@ -129,7 +130,7 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("kernelHousehold/listPosition") - public Result> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { + public Result> getListPosition(@Valid @RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); form.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(powerKernelHouseholdService.getListPosition(form)); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java index 401925c..33f6571 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java @@ -75,19 +75,19 @@ public interface PowerAxisStructDao extends BaseDao { List getIdsByAgencyId(String agencyId, String customerId); - int queryGridParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("gridCateGoryCode") String gridCateGoryCode); + int queryGridParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("gridCateGoryCode") String gridCateGoryCode); - int queryGroupParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("groupCateGoryCode") String groupCateGoryCode); + int queryGroupParty(@Param("agencyId") String agencyId, @Param("customerId") String customerId, @Param("groupCateGoryCode") String groupCateGoryCode); - int getKernelHouseHold(PowerAxisStructViewFormDTO form); + int getKernelHouseHold(@Param("agencyId") String agencyId, @Param("customerId") String customerId); - int getServiceStation(PowerAxisStructViewFormDTO form); + int getServiceStation(@Param("agencyId") String agencyId,@Param("customerId") String customerId); List getStructTree(PowerAxisStructStructTreeFormDTO form); String queryCategoryCode(PowerAxisListPositionFormDTO form); - List querylistPosition(@Param("customerId") String customerId,@Param("code") String code ,@Param("agencyId") String agencyId); + List querylistPosition(@Param("customerId") String customerId, @Param("code") String code, @Param("agencyId") String agencyId); /** * 根据节点接报,组装其上级节点树 diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index cddd027..5e14c34 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -237,9 +237,9 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl select - s.ID, - s.NAME, - s.PID, - s.PIDS, - s.CATEGORY_CODE, - s.SORT, - s.CREATED_TIME, - sl.LEADER_ID, - l.NAME as LEADER_NAME, - l.MOBILE as LEADER_MOBILE, - t.STRUCT_LEVEL + s.ID, + s.NAME, + s.PID, + s.PIDS, + s.CATEGORY_CODE, + s.SORT, + s.CREATED_TIME, + sl.LEADER_ID, + l.NAME as LEADER_NAME, + l.MOBILE as LEADER_MOBILE, + t.STRUCT_LEVEL from pli_power_axis_struct s left join pli_power_axis_struct_leader sl on s.ID = sl.STRUCT_REFERENCE_ID and sl.del_flag = '0' left join pli_power_axis_leader l on l.ID = sl.LEADER_ID and l.del_flag = '0' @@ -66,16 +66,16 @@ - SELECT - count( DISTINCT HOUSE_ID ) + count(*) FROM - pli_power_kernel_household + pli_power_service_station WHERE del_flag = '0' - - + \ No newline at end of file From a5002f1379c08fa7520a8e06232e9a008d83114f Mon Sep 17 00:00:00 2001 From: YUJT Date: Wed, 11 May 2022 09:45:56 +0800 Subject: [PATCH 2/3] update --- .../axis/form/PowerAxisStructViewFormDTO.java | 3 +++ .../form/PowerKernelListPostitionFormDTO.java | 2 +- .../result/PowerAxisStructViewResultDTO.java | 4 ++-- .../PowerAxisDataVisualController.java | 6 ++++-- .../impl/PowerAxisStructServiceImpl.java | 17 +++++++++-------- .../impl/PowerKernelHouseholdServiceImpl.java | 7 ++++++- .../mapper/poweraxis/PowerAxisStructDao.xml | 2 ++ 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java index c22c881..a597f68 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructViewFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.plugin.power.dto.axis.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @Data @@ -11,10 +12,12 @@ public class PowerAxisStructViewFormDTO implements Serializable { /** * 客户id */ + @NotBlank(message = "所属客户不能为空") private String customerId; /** * 组织id */ + @NotBlank(message = "所属组织不能为空") private String agencyId; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java index b2eb8ee..72923d7 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelListPostitionFormDTO.java @@ -19,7 +19,7 @@ public class PowerKernelListPostitionFormDTO implements Serializable { /** * 条数 */ - private int limit; + private Integer limit; /** * 客户id diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java index 5944990..fafb304 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/result/PowerAxisStructViewResultDTO.java @@ -22,7 +22,7 @@ public class PowerAxisStructViewResultDTO implements Serializable { /** * 党员数 */ - private int partyMemberNum; +// private int partyMemberNum; /** * 党员中心户数 @@ -37,5 +37,5 @@ public class PowerAxisStructViewResultDTO implements Serializable { /** * 志愿队伍数 */ - private int volunteerTeamNum; +// private int volunteerTeamNum; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java index 63c9820..a9de19f 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisDataVisualController.java @@ -60,7 +60,9 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("axis/statistics") - public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form) { + public Result getStatistics(@RequestBody PowerAxisStructViewFormDTO form, @LoginUser TokenDto tokenDto) { + form.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(form); PowerAxisStructViewResultDTO result = powerAxisStructService.getStatistics(form); return new Result().ok(result); } @@ -130,7 +132,7 @@ public class PowerAxisDataVisualController { * @date 2022/4/23 10:20 */ @PostMapping("kernelHousehold/listPosition") - public Result> getListPosition(@Valid @RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { + public Result> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) { ValidatorUtils.validateEntity(form); form.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(powerKernelHouseholdService.getListPosition(form)); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java index 5e14c34..df6c554 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructServiceImpl.java @@ -31,6 +31,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import javax.validation.constraints.NotBlank; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -227,19 +228,19 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl getListPosition(PowerKernelListPostitionFormDTO form) { - return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), form.getLimit()); + Integer limit = form.getLimit(); + if (null == limit || NumConstant.ZERO_L == limit) { + limit = 999; + } + return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), limit); } @Override diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml index 7b8d66f..a3e9c5e 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml @@ -131,6 +131,7 @@ CATEGORY_CODE = #{gridCateGoryCode} AND customer_id = #{customerId} + AND del_flag = '0'