From dcb536454e86da30201949827b575ae9b451b70b Mon Sep 17 00:00:00 2001 From: YUJT Date: Mon, 25 Apr 2022 13:33:08 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PowerAxisStructServiceImpl.java | 44 ++----------------- 1 file changed, 4 insertions(+), 40 deletions(-) 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 4c5fcd7..29a48a2 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 @@ -230,58 +230,22 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl tagList = powerAxisTagService.listSimple(PowerTagCategoryEnum.PARAM.category(), loginUserUtil.getLoginUserCustomerId()); - tagList.forEach( - item -> { - int numTemp; - switch (item.getCategoryCode()) { - case "volunteerTeamNum": - numTemp = Integer.parseInt(item.getCategoryName()); - if (numTemp > NumConstant.ZERO) { - result.setVolunteerTeamNum(numTemp); - } - break; - case "partyMemberNum": - numTemp = Integer.parseInt(item.getCategoryName()); - if (numTemp > NumConstant.ZERO) { - result.setPartyMemberNum(numTemp); - } - break; - case "kernelHouseHoldNum": - numTemp = Integer.parseInt(item.getCategoryName()); - if (numTemp > NumConstant.ZERO) { - result.setKernelHouseHoldNum(numTemp); - } - break; - default: - break; - } - } - ); return result; } From 68e2ec2c39112777731473ca49072559242cbed0 Mon Sep 17 00:00:00 2001 From: HAHA Date: Mon, 25 Apr 2022 13:33:25 +0800 Subject: [PATCH 02/15] =?UTF-8?q?message:=20=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/plugin/power/modules/axis/dao/PowerAxisStructDao.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e81be15..4aefafa 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 @@ -77,7 +77,7 @@ public interface PowerAxisStructDao extends BaseDao { int queryGridParty(String agencyId,String customerId,String gridCateGoryCode); - int queryGroupParty(String agencyId,String customerId,String groupCateGoryCode); + int queryGroupParty(@Param("agencyId") String agencyId,@Param("customerId") String customerId,@Param("groupCateGoryCode") String groupCateGoryCode); int getKernelHouseHold(PowerAxisStructViewFormDTO form); From 861c5c9fd75c91050c5d11b8784e17c34a643788 Mon Sep 17 00:00:00 2001 From: YUJT Date: Mon, 25 Apr 2022 14:06:14 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E6=9B=B4=E6=8D=A2redis=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pli-power-base/pli-power-base-server/pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml index 770b347..8003fd0 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/pom.xml @@ -226,8 +226,12 @@ epmet_pli_power_user EpmEt-db-UsEr + + + + 0 - r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 192.168.10.150 6379 EpmEtrEdIs!q@w From 25723e1a17d9cd4227db490c49306a3e57c19fef Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 25 Apr 2022 14:21:16 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E6=96=B0=E5=A2=9Eflyway=E7=9A=84V0.0.1de?= =?UTF-8?q?mo=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/db/migration/V0.0.1__demo.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.1__demo.sql diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000..7a51a3f --- /dev/null +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file From 850c73662e222a9f7f1bd976be8220123f862a70 Mon Sep 17 00:00:00 2001 From: wangxianzhang Date: Mon, 25 Apr 2022 15:17:36 +0800 Subject: [PATCH 05/15] prod compose version_placeholder --- .../pli-power-base-server/deploy/docker-compose-prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/deploy/docker-compose-prod.yml b/epmet-plugins-module/pli-power-base/pli-power-base-server/deploy/docker-compose-prod.yml index da64eaf..5f186d8 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/deploy/docker-compose-prod.yml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: pli-power-base-server: container_name: pli-power-base-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/pli-power-base-server:0.3.83 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/pli-power-base-server:version_placeholder ports: - "8201:8201" network_mode: host # 使用现有网络 From bba55f858e12487001caab1d2c22ffb14024e73d Mon Sep 17 00:00:00 2001 From: HAHA Date: Mon, 25 Apr 2022 15:40:59 +0800 Subject: [PATCH 06/15] =?UTF-8?q?message:=20=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/power/modules/axis/dao/PowerAxisStructDao.java | 2 +- .../axis/service/impl/PowerAxisStructLeaderServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 4aefafa..6f9b0da 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,7 +75,7 @@ public interface PowerAxisStructDao extends BaseDao { List getIdsByAgencyId(String agencyId, String customerId); - int queryGridParty(String agencyId,String customerId,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); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java index df73902..0555fbe 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java @@ -138,10 +138,10 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl Date: Mon, 25 Apr 2022 15:46:53 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/poweraxis/PowerAxisStructDao.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 9e1f729..6e9aa09 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 @@ -47,10 +47,10 @@ 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 - left join pli_power_axis_leader l on l.ID = sl.LEADER_ID - left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE - where s.DEL_FLAG = '0' and sl.del_flag = '0' and l.del_flag = '0' + 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' + left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE and t.DEL_FLAG = '0' + where s.DEL_FLAG = '0' and s.AGENCY_ID = #{agencyId} From 31c04a0467ae894490288cc3adb71ab090927ff1 Mon Sep 17 00:00:00 2001 From: YUJT Date: Mon, 25 Apr 2022 15:48:14 +0800 Subject: [PATCH 08/15] append --- .../src/main/resources/mapper/poweraxis/PowerAxisStructDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 6e9aa09..891c126 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 @@ -50,7 +50,7 @@ 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' left join pli_power_axis_tag t on s.CATEGORY_CODE = t.CATEGORY_CODE and t.DEL_FLAG = '0' - where s.DEL_FLAG = '0' + where s.DEL_FLAG = '0' and s.AGENCY_ID = #{agencyId} From da25beb505fa029e1b4cc576b1fc32bd6c4ec6eb Mon Sep 17 00:00:00 2001 From: YUJT Date: Mon, 25 Apr 2022 16:06:54 +0800 Subject: [PATCH 09/15] update --- .../service/impl/PowerAxisStructLeaderServiceImpl.java | 2 +- .../resources/mapper/poweraxis/PowerAxisStructDao.xml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java index 0555fbe..e2063a5 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisStructLeaderServiceImpl.java @@ -120,7 +120,7 @@ public class PowerAxisStructLeaderServiceImpl extends BaseServiceImpl lqw = new LambdaQueryWrapper<>(); lqw.eq(PowerAxisStructEntity::getCustomerId, customerId) - .eq(PowerAxisStructEntity::getPid, axisStructId) + .eq(PowerAxisStructEntity::getId, axisStructId) .eq(PowerAxisStructEntity::getDelFlag, EpmetDelFlagEnum.NORMAL.value()); PowerAxisStructEntity axisStructEntity = powerAxisStructDao.selectOne(lqw); 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 891c126..1680762 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 @@ -159,12 +159,12 @@ leader.NAME AS leaderName FROM pli_power_axis_struct AS struct - LEFT JOIN pli_power_axis_struct_leader AS sl ON struct.id = sl.STRUCT_REFERENCE_ID - LEFT JOIN pli_power_axis_leader AS leader ON sl.LEADER_ID = leader.id + LEFT JOIN pli_power_axis_struct_leader AS sl ON struct.id = sl.STRUCT_REFERENCE_ID and sl.DEL_FLAG = '0' + LEFT JOIN pli_power_axis_leader AS leader ON sl.LEADER_ID = leader.id and leader.DEL_FLAG = '0' WHERE - struct.agency_id = #{agencyId} - AND - struct.customer_id = #{customerId} + struct.DEL_FLAG = '0' + AND struct.agency_id = #{agencyId} + AND struct.customer_id = #{customerId} From 77bd26a8389bcd2ddef167d2aeb4da3c3fef1c3e Mon Sep 17 00:00:00 2001 From: YUJT Date: Mon, 25 Apr 2022 16:57:14 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E5=85=9A=E5=91=98=E4=B8=AD=E5=BF=83=E6=88=B7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../power/dto/axis/PowerAxisLeaderDTO.java | 5 +++ .../axis/form/PowerKernelHouseFormDTO.java | 23 ++++++++++- .../axis/dao/PowerKernelHouseholdDao.java | 18 +++++++-- .../impl/PowerAxisLeaderServiceImpl.java | 2 - .../impl/PowerKernelHouseholdServiceImpl.java | 38 +++++++++++-------- .../poweraxis/PowerKernelHouseholdDao.xml | 13 ++++--- 6 files changed, 70 insertions(+), 29 deletions(-) diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java index 159d00f..b33b8cd 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/PowerAxisLeaderDTO.java @@ -4,6 +4,8 @@ import java.io.Serializable; import java.util.Date; import lombok.Data; +import javax.validation.constraints.NotBlank; + /** * 动力主轴领导人 @@ -29,16 +31,19 @@ public class PowerAxisLeaderDTO implements Serializable { /** * 姓名 */ + @NotBlank(message = "姓名不能为空") private String name; /** * 关联动力主轴ID */ + @NotBlank(message = "绑定动力主轴不能为空") private String structReferenceId; /** * 性别 1男2女0未知 */ + @NotBlank(message = "性别不能为空") private String gender; /** diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseFormDTO.java index 907b360..20104c3 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseFormDTO.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseFormDTO.java @@ -2,8 +2,27 @@ package com.epmet.plugin.power.dto.axis.form; import lombok.Data; +import java.io.Serializable; +import java.util.List; + +/** + * 绑定党员中心户(房屋) + * + * @author work@yujt.net.cn + * @date 2022/4/25/0025 16:48 + */ @Data -public class PowerKernelHouseFormDTO { +public class PowerKernelHouseFormDTO implements Serializable { + + private static final long serialVersionUID = -3319310604730621237L; + + /** + * 动力主轴节点ID + */ private String axisStructId; - private String[] houseIdList; + + /** + * 要绑定的房屋ID集合 + */ + private List houseIdList; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java index 77add6e..2dd0035 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerKernelHouseholdDao.java @@ -1,7 +1,6 @@ package com.epmet.plugin.power.modules.axis.dao; - import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseFormDTO; import com.epmet.plugin.power.dto.axis.form.PowerKernelHouseHoldViewListFormDTO; @@ -28,12 +27,23 @@ public interface PowerKernelHouseholdDao extends BaseDao getListPosition(PowerKernelListPostitionFormDTO form,List axisStructIds); + List getListPosition(PowerKernelListPostitionFormDTO form, List axisStructIds); long getListTotal(PowerKernelListPostitionFormDTO form); - - List queryHouseIdList(String[] houseIdList, String customerId,String axisStructId); + /** + * 根据节点ID查询已绑定的房屋ID + * + * @param houseIdList 需要绑定的房屋ID + * @param customerId 客户ID + * @param axisStructId 动力主轴节点 + * @return java.util.List + * @author work@yujt.net.cn + * @date 2022/4/25/0025 16:49 + */ + List queryHouseIdList(@Param("houseIdList") List houseIdList, + @Param("customerId") String customerId, + @Param("axisStructId") String axisStructId); List queryIds(String customerId, String axisStructId); diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java index 8212a11..dfc8564 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisLeaderServiceImpl.java @@ -1,6 +1,5 @@ package com.epmet.plugin.power.modules.axis.service.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; @@ -15,7 +14,6 @@ import com.epmet.plugin.power.dto.axis.result.PowerAxisSimpleListDTO; import com.epmet.plugin.power.modules.axis.dao.PowerAxisLeaderDao; import com.epmet.plugin.power.modules.axis.dao.PowerAxisStructLeaderDao; import com.epmet.plugin.power.modules.axis.entity.PowerAxisLeaderEntity; -import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity; import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructLeaderEntity; import com.epmet.plugin.power.modules.axis.service.PowerAxisLeaderService; import org.apache.commons.lang3.StringUtils; diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java index ec2a1e2..0a06d63 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerKernelHouseholdServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.plugin.power.modules.axis.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -27,6 +28,7 @@ import com.epmet.plugin.power.modules.axis.entity.PowerKernelHouseholdEntity; import com.epmet.plugin.power.modules.axis.redis.PowerKernelHouseholdRedis; import com.epmet.plugin.power.modules.axis.service.PowerAxisTagService; import com.epmet.plugin.power.modules.axis.service.PowerKernelHouseholdService; +import com.google.common.collect.Sets; import org.apache.commons.compress.utils.Lists; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -135,7 +137,7 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getListPosition(PowerKernelListPostitionFormDTO form) { - return baseDao.queryListPosition(form.getAxisStructId(),form.getCustomerId(),form.getLimit()); + return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), form.getLimit()); } @@ -148,29 +150,35 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl idList = baseDao.queryHouseIdList(form.getHouseIdList(), form.getAxisStructId(), customerId); - // 将idList转换为Set集合进行去重 - Set setIdList = new HashSet<>(); - for (String id : idList) { - setIdList.add(id); + // 需要绑定的房屋ID集合 + List houseIdList = form.getHouseIdList(); + // 查询已绑定的houseId集合 + List existHouseIdList = baseDao.queryHouseIdList(houseIdList, form.getAxisStructId(), customerId); + // 倒序,取差集 + for (int i = houseIdList.size() - 1; i >= 0; i--) { + for (String existHouseId : existHouseIdList) { + if (existHouseId.equals(houseIdList.get(i))) { + houseIdList.remove(i); + } + } } - // 将前端发送的houseId放入Set集合 - Set houseIds = new HashSet<>(); - Collections.addAll(houseIds, form.getHouseIdList()); - // 去重 - houseIds.removeAll(setIdList); - Result> listResult = govOrgOpenFeignClient.queryListHouseInfo(houseIds, customerId); + if (CollUtil.isEmpty(houseIdList)) { + return; + } + // 查询房屋信息 + Result> listResult = govOrgOpenFeignClient.queryListHouseInfo(Sets.newHashSet(houseIdList), customerId); if (!listResult.success()) { return; } List houseList = listResult.getData(); PowerKernelHouseholdEntity entity; + Result icHouseDTOResult; for (HouseInfoDTO houseInfo : houseList) { - Result icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId()); + + // 查询房屋与房主信息 + icHouseDTOResult = govOrgOpenFeignClient.get(houseInfo.getHomeId()); if (!icHouseDTOResult.success()) { continue; } diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml index 0c08a74..c281065 100644 --- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml +++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/resources/mapper/poweraxis/PowerKernelHouseholdDao.xml @@ -94,16 +94,17 @@ FROM pli_power_kernel_household - house_id in - - #{houseId} - + del_flag = '0' + + and house_id in + + #{houseId} + + AND STRUCT_REFERENCE_ID = #{axisStructId} AND customer_id = #{customerId} - AND - del_flag = '0'