diff --git a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java
new file mode 100644
index 0000000..10ead82
--- /dev/null
+++ b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/redis/RedisKeys.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2018 人人开源 All rights reserved.
+ *
+ * https://www.renren.io
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.epmet.plugin.commons.redis;
+
+/**
+ * @author Mark sunlightcs@gmail.com
+ * @since 1.0.0
+ */
+public class RedisKeys {
+
+ /**
+ * redis前缀
+ */
+ private static String rootPrefix = "epmet:";
+
+ /**
+ * 海康accessToken
+ */
+ public static String getHikTokenKey() {
+ return rootPrefix.concat("hik:token");
+ }
+
+ /**
+ * 大华publicKey
+ */
+ public static String getDhPublicKey() {
+ return rootPrefix.concat("dh:public");
+ }
+
+ /**
+ * 大华token
+ */
+ public static String getDhToken() {
+ return rootPrefix.concat("dh:token");
+ }
+
+}
diff --git a/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java
new file mode 100644
index 0000000..58dfec3
--- /dev/null
+++ b/epmet-plugins-common/src/main/java/com/epmet/plugin/commons/utils/NumUtils.java
@@ -0,0 +1,30 @@
+package com.epmet.plugin.commons.utils;
+
+import com.epmet.commons.tools.constant.NumConstant;
+
+/***
+ * 数字处理相关通用方法
+ * @author work@yujt.net.cn
+ * @date 2022/5/12/0012 10:02
+ */
+public class NumUtils {
+
+ public final static int ONE_THOUSAND = 1000;
+
+ /**
+ * 获取数值
+ *
+ * @param number 数值,可能为空
+ * @param excludeZero 数字不能为0
+ * @param defaultNumber 默认值(数字为空值时 或 数值为0但excludeZero == true 时,使用默认值)
+ * @return int
+ * @author work@yujt.net.cn
+ * @date 2022/5/12/0012 10:11
+ */
+ public static int getNumberInt(Integer number, boolean excludeZero, int defaultNumber) {
+ if (null == number || (excludeZero && NumConstant.ZERO == number)) {
+ return defaultNumber;
+ }
+ return number;
+ }
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java
index eb088e2..86cd108 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisServiceStationFormDTO.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
@@ -9,7 +10,7 @@ public class PowerAxisServiceStationFormDTO implements Serializable {
private static final long serialVersionUID = -8446905334792655596L;
/**
- *动力主轴节点id
+ * 动力主轴节点id
*/
private String axisStructId;
/**
@@ -19,5 +20,11 @@ public class PowerAxisServiceStationFormDTO 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/PowerAxisStructLeaderFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java
index b71d1db..64a51cf 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerAxisStructLeaderFormDTO.java
@@ -3,7 +3,6 @@ package com.epmet.plugin.power.dto.axis.form;
import lombok.Data;
import java.io.Serializable;
-import java.util.Date;
/**
@@ -32,5 +31,10 @@ public class PowerAxisStructLeaderFormDTO implements Serializable {
*/
private String leaderName;
+ /**
+ * 客户id
+ */
+ private String customerId;
+
-}
\ No newline at end of file
+}
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/PowerKernelHouseHoldViewListFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java
index c6ef16e..6f68885 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/axis/form/PowerKernelHouseHoldViewListFormDTO.java
@@ -2,6 +2,8 @@ package com.epmet.plugin.power.dto.axis.form;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
import java.io.Serializable;
@Data
@@ -17,15 +19,24 @@ public class PowerKernelHouseHoldViewListFormDTO implements Serializable {
/**
* 页码
*/
- private int pageNo;
+ @NotNull(message = "页码不能为空")
+ private Integer pageNo;
/**
* 条数
*/
- private int pageSize;
+ @NotNull(message = "页容量不能为空")
+ private Integer pageSize;
+
+ /**
+ * 组织id
+ */
+ @NotBlank(message = "所属组织不能为空")
+ private String agencyId;
/**
* 客户id
*/
+ @NotBlank(message = "所属客户不能为空")
private String customerId;
}
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..3486538 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
@@ -13,16 +13,19 @@ public class PowerKernelListPostitionFormDTO implements Serializable {
/**
* 动力主轴id
*/
- @NotBlank(message = "动力主轴节点不能为空")
private String axisStructId;
/**
* 条数
*/
- private int limit;
+ private Integer limit;
/**
* 客户id
*/
+ @NotBlank(message = "所属客户不能为空")
private String customerId;
+
+ @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/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-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java
new file mode 100644
index 0000000..72e1d58
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikCommunityInfoDTO.java
@@ -0,0 +1,94 @@
+package com.epmet.plugin.power.dto.hik;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class HikCommunityInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 删除标记 0:未删除,1:已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 社区ID
+ */
+ private String communityId;
+
+ /**
+ * 社区名称
+ */
+ private String communityName;
+
+ /**
+ * 省代号
+ */
+ private String provinceCode;
+
+ /**
+ * 市代号
+ */
+ private String cityCode;
+
+ /**
+ * 区代号
+ */
+ private String countyCode;
+
+ /**
+ * 经度坐标值
+ */
+ private String longitude;
+
+ /**
+ * 维度坐标值
+ */
+ private String latitude;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java
new file mode 100644
index 0000000..dc9bac4
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikDeviceInfoDTO.java
@@ -0,0 +1,94 @@
+package com.epmet.plugin.power.dto.hik;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class HikDeviceInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 删除标记 0:未删除,1:已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 社区ID
+ */
+ private String communityId;
+
+ /**
+ * 设备ID
+ */
+ private String deviceId;
+
+ /**
+ * 设备名称
+ */
+ private String deviceName;
+
+ /**
+ * 设备型号
+ */
+ private String deviceModel;
+
+ /**
+ * 设备序列号
+ */
+ private String deviceSerial;
+
+ /**
+ * 设备状态,0:离线,1:在线
+ */
+ private String deviceStatus;
+
+ /**
+ * 设备路径
+ */
+ private String devicePath;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java
new file mode 100644
index 0000000..a06778c
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/HikErrorInfoDTO.java
@@ -0,0 +1,79 @@
+package com.epmet.plugin.power.dto.hik;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@Data
+public class HikErrorInfoDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 删除标记 0:未删除,1:已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 身份证号
+ */
+ private String idCard;
+
+ /**
+ * 错误类型 0:token,1:人员,2权限
+ */
+ private String errorType;
+
+ /**
+ * 错误详情
+ */
+ private String errorInfo;
+
+ /**
+ * 引用ID
+ */
+ private String referenceId;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java
new file mode 100644
index 0000000..3f436c1
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikAuthorityFormDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.plugin.power.dto.hik.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员权限信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class HikAuthorityFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String communityId;
+
+ private String personId;
+
+ private Integer personType;
+
+ private String deviceId;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java
new file mode 100644
index 0000000..1a7eedc
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/hik/form/HikPersonFormDTO.java
@@ -0,0 +1,33 @@
+package com.epmet.plugin.power.dto.hik.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class HikPersonFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String unionId;
+
+ private String personName;
+
+ private Integer gender;
+
+ private Integer credentialType;
+
+ private String credentialNumber;
+
+ private String mobile;
+
+ private String faceUrl;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java
index f0ff8cb..4a10bb4 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentBlacklistDTO.java
@@ -28,6 +28,11 @@ public class RentBlacklistDTO implements Serializable {
@NotBlank(message = "用户ID不能为空")
private String userId;
+ /**
+ * epmet网格ID
+ */
+ private String gridId;
+
/**
* 姓名
*/
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java
index 51f4ab8..34faf2b 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractFileDTO.java
@@ -32,7 +32,7 @@ public class RentContractFileDTO implements Serializable {
private String fileUrl;
/**
- * 文件类型 0:图片,1 文件(合同)
+ * 文件类型 0:图片(人脸/头像),1 文件(合同),2 身份证照片,3 中介资料
*/
private String fileType;
@@ -66,4 +66,4 @@ public class RentContractFileDTO implements Serializable {
*/
private Date updatedTime;
-}
\ No newline at end of file
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java
index c540588..6e38aa5 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentContractInfoDTO.java
@@ -123,6 +123,17 @@ public class RentContractInfoDTO implements Serializable {
@NotBlank(message = "出租人手机不能为空")
private String lessorMobile;
+ /**
+ * 出租人与户主关系
+ */
+ private String lessorRelation;
+
+ /**
+ * 出租人现居住地址
+ */
+ @NotBlank(message = "出租人现居住地址不能为空")
+ private String lessorLiveAddress;
+
/**
* 承租人姓名
*/
@@ -141,6 +152,17 @@ public class RentContractInfoDTO implements Serializable {
@NotBlank(message = "承租人手机不能为空")
private String lesseeMobile;
+ /**
+ * 承租人单位
+ */
+ private String lesseeUnit;
+
+ /**
+ * 承租人户籍地地址
+ */
+ @NotBlank(message = "承租人户籍地地址不能为空")
+ private String lesseeHouseAddress;
+
/**
* 签署日期
*/
@@ -181,8 +203,18 @@ public class RentContractInfoDTO implements Serializable {
@NotEmpty
private List fileList;
+ /**
+ * 中介资料
+ */
+ private List agencyImgList;
+
/**
* 是否黑名单
*/
private String isBlack;
-}
\ No newline at end of file
+
+ /**
+ * 是否是PC录入(0:否,1:是)
+ */
+ private String isPcInput;
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java
new file mode 100644
index 0000000..34008cb
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentHouseDTO.java
@@ -0,0 +1,195 @@
+package com.epmet.plugin.power.dto.rent;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * 房屋信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-11
+ */
+@Data
+public class RentHouseDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 房屋主键
+ */
+ private String id;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 小区id
+ */
+ private String neighborHoodId;
+
+ /**
+ * 片区id,neighbor_hood_part.id,可为空。
+ */
+ private String partId;
+
+ /**
+ * 所属楼栋id
+ */
+ private String buildingId;
+
+ /**
+ * 所属单元id
+ */
+ private String buildingUnitId;
+
+ /**
+ * 房屋名字后台插入时生成
+ */
+ private String houseName;
+
+ /**
+ * 门牌号
+ */
+ private String doorName;
+
+ /**
+ * 房屋类型,1楼房,2平房,3别墅
+ */
+ private String houseType;
+
+ /**
+ * 存储字典value
+ */
+ private String purpose;
+
+ /**
+ * 1:出租 0:自住 2:闲置
+ */
+ private Integer rentFlag;
+
+ /**
+ * 房主姓名
+ */
+ private String ownerName;
+
+ /**
+ * 房主电话
+ */
+ private String ownerPhone;
+
+ /**
+ * 房主身份证号
+ */
+ private String ownerIdCard;
+
+ /**
+ * 排序
+ */
+ private BigDecimal sort;
+
+ /**
+ * 删除标识 0未删除、1已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 社区ID
+ */
+ private String communityId;
+
+ /**
+ * 社区
+ */
+ private String communityName;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 网格
+ */
+ private String gridName;
+
+ /**
+ * 房屋小区ID
+ */
+ private String villageId;
+
+ /**
+ * 房屋小区
+ */
+ private String villageName;
+
+ /**
+ * 楼号ID
+ */
+ private String buildId;
+
+ /**
+ * 楼号
+ */
+ private String buildName;
+
+ /**
+ * 单元ID
+ */
+ private String unitId;
+
+ /**
+ * 单元
+ */
+ private String unitName;
+
+ /**
+ * 房屋ID
+ */
+ private String homeId;
+
+ /**
+ * 房屋
+ */
+ private String homeName;
+
+ /**
+ * 购房日期
+ */
+ private String purchaseDate;
+
+ /**
+ * 是否更新
+ */
+ private Boolean needUpdate;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java
index e7ffb7b..700b825 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/rent/RentTenantInfoDTO.java
@@ -1,10 +1,12 @@
package com.epmet.plugin.power.dto.rent;
+import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
+import java.util.Date;
import java.util.List;
@@ -58,10 +60,58 @@ public class RentTenantInfoDTO implements Serializable {
@NotBlank(message = "人员类型不能为空")
private String type;
+ /**
+ * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用)
+ */
+ private String state;
+
+ /**
+ * 审核-原因
+ */
+ private String reason;
+
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss",
+ timezone = "GMT+8"
+ )
+ private Date createdTime;
+
+ @JsonFormat(
+ pattern = "yyyy-MM-dd HH:mm:ss",
+ timezone = "GMT+8"
+ )
+ private Date updatedTime;
+
+ /**
+ * 政治面貌
+ */
+ private String politicalStatus;
+
+ /**
+ * 是否服兵役【是:1 否:0】
+ */
+ private String isMilitary;
+
+ /**
+ * 国籍
+ */
+ private String nation;
+
+ /**
+ * 工作单位
+ */
+ private String unit;
+
/**
* 头像列表
*/
@NotEmpty
private List imgList;
+ /**
+ * 身份证列表
+ */
+ @NotEmpty
+ private List idCardImgList;
+
}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java
new file mode 100644
index 0000000..bd9732d
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/DhTokenDTO.java
@@ -0,0 +1,39 @@
+package com.epmet.plugin.power.dto.visit;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 大华设备鉴权信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-04-22
+ */
+@Data
+public class DhTokenDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * loginName
+ */
+ private String loginName;
+
+ /**
+ * token
+ */
+ private String token;
+
+ /**
+ * publicKey
+ */
+ private String publicKey;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java
new file mode 100644
index 0000000..dec7fd5
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/VisitVisitorDTO.java
@@ -0,0 +1,163 @@
+package com.epmet.plugin.power.dto.visit;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+
+/**
+ * 租客表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-07-26
+ */
+@Data
+public class VisitVisitorDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ private String id;
+
+ /**
+ * 姓名
+ */
+ private String name;
+
+ /**
+ * 身份证
+ */
+ private String idCard;
+
+ /**
+ * 性别
+ */
+ private String gender;
+
+ /**
+ * 手机号
+ */
+ private String mobile;
+
+ /**
+ * 人员类型 0:访客 1:租客
+ */
+ private String type;
+
+ /**
+ * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用)
+ */
+ private String state;
+
+ /**
+ * 审核原因
+ */
+ private String reason;
+
+ /**
+ * 删除标记 0:未删除,1:已删除
+ */
+ private String delFlag;
+
+ /**
+ * 乐观锁
+ */
+ private Integer revision;
+
+ /**
+ * 创建人
+ */
+ private String createdBy;
+
+ /**
+ * 创建时间
+ */
+ private Date createdTime;
+
+ /**
+ * 更新人
+ */
+ private String updatedBy;
+
+ /**
+ * 更新时间
+ */
+ private Date updatedTime;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 来访事由
+ */
+ private String visitReason;
+
+ /**
+ * 头像
+ */
+ private String faceImg;
+
+ /**
+ * 小区
+ */
+ private String residential;
+
+ /**
+ * 楼栋
+ */
+ private String building;
+
+ /**
+ * 单元
+ */
+ private String unit;
+
+ /**
+ * 房屋
+ */
+ private String room;
+
+ /**
+ * 组织id
+ */
+ private String agencyId;
+
+ /**
+ * 上级组织id
+ */
+ private String parentAgencyId;
+
+ /**
+ * 组织的所有上级组织id
+ */
+ private String agencyPids;
+
+ /**
+ * 网格id
+ */
+ private String gridId;
+
+ /**
+ * 小区ID
+ */
+ private String neighborhoodId;
+
+ /**
+ * 楼栋ID
+ */
+ private String buildingId;
+
+ /**
+ * 单元ID
+ */
+ private String unitId;
+
+ /**
+ * 房屋ID
+ */
+ private String houseId;
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java
new file mode 100644
index 0000000..0f5062e
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhAuthFormDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import com.epmet.plugin.power.dto.visit.result.DhChannelResultDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhAuthFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String cardNumber;
+
+ private String timeQuantumId;
+
+ private List cardPrivilegeDetails;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhCardPageFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhCardPageFormDTO.java
new file mode 100644
index 0000000..b72df21
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhCardPageFormDTO.java
@@ -0,0 +1,29 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhCardPageFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Integer pageNum;
+
+ private Integer pageSize;
+
+ private String personCode;
+
+ private String cardNumber;
+
+ private String cardStatus;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelPageFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelPageFormDTO.java
new file mode 100644
index 0000000..5bb210f
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhChannelPageFormDTO.java
@@ -0,0 +1,25 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhChannelPageFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Integer pageNum;
+
+ private Integer pageSize;
+
+ private String deviceGenre;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java
new file mode 100644
index 0000000..456179d
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhDeptFormDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import com.epmet.plugin.power.dto.visit.result.DhChannelResultDTO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhDeptFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+
+ private String description;
+
+ private Long parentId;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java
new file mode 100644
index 0000000..c30adda
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhIdentityFormDTO.java
@@ -0,0 +1,29 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhIdentityFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String name;
+
+ private Double subsidyAmount;
+
+ private Integer isCashRecharge;
+
+ private Integer isMachineRecharge;
+
+ private String description;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhLoginPassFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhLoginPassFormDTO.java
new file mode 100644
index 0000000..42e4c95
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhLoginPassFormDTO.java
@@ -0,0 +1,23 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhLoginPassFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String loginName;
+
+ private String loginPass;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java
new file mode 100644
index 0000000..0c53aa0
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardFormDTO.java
@@ -0,0 +1,39 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPersonCardFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Long personId;
+
+ private String personName;
+
+ private String cardNumber;
+
+ private String cardType;
+
+ private String category;
+
+ private String cardStatus;
+
+ private String startDate;
+
+ private String endDate;
+
+ private String cardPassword;
+
+ private String subSystems;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardListFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardListFormDTO.java
new file mode 100644
index 0000000..7a734c8
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonCardListFormDTO.java
@@ -0,0 +1,22 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPersonCardListFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private List objectList;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonDelFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonDelFormDTO.java
new file mode 100644
index 0000000..6a2c810
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonDelFormDTO.java
@@ -0,0 +1,22 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPersonDelFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private List personIds;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java
new file mode 100644
index 0000000..3cfcc53
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonFormDTO.java
@@ -0,0 +1,39 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPersonFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String paperType;
+
+ private String paperNumber;
+
+ private String name;
+
+ private String code;
+
+ private Long deptId;
+
+ private String sex;
+
+ private String birthday;
+
+ private String phone;
+
+ private String status;
+
+ private String personIdentityId;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java
new file mode 100644
index 0000000..62c0e89
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonImgFormDTO.java
@@ -0,0 +1,23 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPersonImgFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String personCode;
+
+ private String base64file;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonPageFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonPageFormDTO.java
new file mode 100644
index 0000000..a053eab
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPersonPageFormDTO.java
@@ -0,0 +1,25 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPersonPageFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Integer pageNum;
+
+ private Integer pageSize;
+
+ private String code;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java
new file mode 100644
index 0000000..7719a5a
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanFormDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPlanFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String detail;
+
+ private String memo;
+
+ private String name;
+
+ private Integer type;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanPageFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanPageFormDTO.java
new file mode 100644
index 0000000..9b6f7c6
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPlanPageFormDTO.java
@@ -0,0 +1,25 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPlanPageFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private Integer pageNum;
+
+ private Integer pageSize;
+
+ private String singleCondition;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPublicKeyFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPublicKeyFormDTO.java
new file mode 100644
index 0000000..5400419
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/DhPublicKeyFormDTO.java
@@ -0,0 +1,21 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhPublicKeyFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String loginName;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java
new file mode 100644
index 0000000..e15769d
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorChartFormDTO.java
@@ -0,0 +1,27 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 租客表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-07-26
+ */
+@Data
+public class VisitVisitorChartFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 时间
+ */
+ private String date;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java
new file mode 100644
index 0000000..37233a8
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitVisitorFormDTO.java
@@ -0,0 +1,109 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * 租客表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-07-26
+ */
+@Data
+public class VisitVisitorFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 姓名
+ */
+ @NotBlank(message = "姓名不能为空",groups = {AddGroup.class, DefaultGroup.class})
+ private String name;
+
+ /**
+ * 身份证
+ */
+ @NotBlank(message = "身份证号不能为空",groups = {AddGroup.class, DefaultGroup.class})
+ private String idCard;
+
+ /**
+ * 性别
+ */
+ @NotBlank(message = "性别不能为空",groups = {AddGroup.class, DefaultGroup.class})
+ private String gender;
+
+ /**
+ * 手机号
+ */
+ @NotBlank(message = "联系方式不能为空",groups = {AddGroup.class, DefaultGroup.class})
+ private String mobile;
+
+ /**
+ * 人员类型 0:访客 1:租客
+ */
+ private String type;
+
+ /**
+ * 来访事由
+ */
+ private String visitReason;
+
+ /**
+ * 头像
+ */
+ private String faceImg;
+
+ /**
+ * 小区ID
+ */
+ private String neighborhoodId;
+
+ /**
+ * 楼栋ID
+ */
+ private String buildingId;
+
+ /**
+ * 单元ID
+ */
+ private String unitId;
+
+ /**
+ * 房屋ID
+ */
+ private String houseId;
+
+ /**
+ * 小区
+ */
+ private String residential;
+
+ /**
+ * 楼栋
+ */
+ private String building;
+
+ /**
+ * 单元
+ */
+ private String unit;
+
+ /**
+ * 房屋
+ */
+ private String room;
+
+ /**
+ * 客户ID
+ */
+ @NotBlank(message = "客户ID不能为空",groups = {AddGroup.class, DefaultGroup.class})
+ private String customerId;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitorLogoutFormDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitorLogoutFormDTO.java
new file mode 100644
index 0000000..2059be3
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/form/VisitorLogoutFormDTO.java
@@ -0,0 +1,29 @@
+package com.epmet.plugin.power.dto.visit.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 访客登出
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-27
+ */
+@Data
+public class VisitorLogoutFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 数据更新至:yyyyMMdd;
+ */
+ private String dateId;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java
new file mode 100644
index 0000000..737b3e8
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/DhChannelResultDTO.java
@@ -0,0 +1,23 @@
+package com.epmet.plugin.power.dto.visit.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 海康社区人员信息下放
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class DhChannelResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ private String privilegeType;
+
+ private String resouceCode;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java
new file mode 100644
index 0000000..a5dcd69
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/dto/visit/result/VisitVisitorChartResultDTO.java
@@ -0,0 +1,30 @@
+package com.epmet.plugin.power.dto.visit.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 租客表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-07-26
+ */
+@Data
+public class VisitVisitorChartResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 时间
+ */
+ private String hour;
+
+ /**
+ * 数量
+ */
+ private String num;
+
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/.gitkeep b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/PliPowerFeignClient.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/PliPowerFeignClient.java
new file mode 100644
index 0000000..cfb4135
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/PliPowerFeignClient.java
@@ -0,0 +1,24 @@
+package com.epmet.plugin.power.feign;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO;
+import com.epmet.plugin.power.feign.impl.PliPowerFeignClientFallBackFactory;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+/**
+ * desc: 数据统计 对外feign client
+ *
+ * @return:
+ * @date: 2020/6/22 17:39
+ * @author: jianjun liu
+ */
+@FeignClient(name = ServiceConstant.DATA_STATISTICAL_SERVER, fallbackFactory = PliPowerFeignClientFallBackFactory.class)
+public interface PliPowerFeignClient {
+
+ @PostMapping("/pli/power/visitVisitor/logout")
+ Result visitorLogout(@RequestBody VisitorLogoutFormDTO formDTO);
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/impl/PliPowerFeignClientFallBack.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/impl/PliPowerFeignClientFallBack.java
new file mode 100644
index 0000000..232235e
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/impl/PliPowerFeignClientFallBack.java
@@ -0,0 +1,24 @@
+package com.epmet.plugin.power.feign.impl;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.ModuleUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO;
+import com.epmet.plugin.power.feign.PliPowerFeignClient;
+
+/**
+ * desc:
+ *
+ * @return:
+ * @date: 2020/6/22 9:38
+ * @author: jianjun liu
+ * email:liujianjun@git.elinkit.com.cn
+ */
+public class PliPowerFeignClientFallBack implements PliPowerFeignClient {
+
+ @Override
+ public Result visitorLogout(VisitorLogoutFormDTO formDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "logout",formDTO);
+ }
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/impl/PliPowerFeignClientFallBackFactory.java b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/impl/PliPowerFeignClientFallBackFactory.java
new file mode 100644
index 0000000..99e35fa
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-client/src/main/java/com/epmet/plugin/power/feign/impl/PliPowerFeignClientFallBackFactory.java
@@ -0,0 +1,20 @@
+package com.epmet.plugin.power.feign.impl;
+
+import com.epmet.commons.tools.exception.ExceptionUtils;
+import com.epmet.plugin.power.feign.PliPowerFeignClient;
+import feign.hystrix.FallbackFactory;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Component;
+
+@Component
+@Slf4j
+public class PliPowerFeignClientFallBackFactory implements FallbackFactory {
+
+ private PliPowerFeignClientFallBack fallback = new PliPowerFeignClientFallBack();
+
+ @Override
+ public PliPowerFeignClient create(Throwable cause) {
+ log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
+ return fallback;
+ }
+}
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 af1b196..c95ef81 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
@@ -83,6 +83,11 @@
RELEASE
compile
+
+ net.coobird
+ thumbnailator
+ 0.4.8
+
@@ -164,6 +169,15 @@
SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
+
+
+ https://api2.hik-cloud.com
+ 111
+ 222
+
+ http://112.6.213.175:8314
+ shundeju
+ hg123456
@@ -177,10 +191,10 @@
-
+
- root
- Abc@123456
+ epmet_pli_power_user
+ EpmEt-db-UsEr
0
192.168.1.140
@@ -193,7 +207,7 @@
false
- 192.168.43.104
+ 192.168.43.33
false
@@ -214,6 +228,15 @@
SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
+
+
+ https://api2.hik-cloud.com
+ 111
+ 222
+
+ http://112.6.213.175:8314
+ shundeju
+ hg123456
@@ -268,6 +291,15 @@
SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd
+
+
+ https://api2.hik-cloud.com
+ 111
+ 222
+
+ http://112.6.213.175:8314
+ shundeju
+ hg123456
@@ -317,6 +349,15 @@
SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1
+
+
+ https://api2.hik-cloud.com
+ 90688b09bb9d40088f7be404ccb347c7
+ 7b1940707a4240be9c794c5a967a30c9
+
+ http://112.6.213.175:8314
+ shundeju
+ hg123456
@@ -369,6 +410,15 @@
60
epmet-user
callerRunsPolicy
+
+
+ https://api2.hik-cloud.com
+ 90688b09bb9d40088f7be404ccb347c7
+ 7b1940707a4240be9c794c5a967a30c9
+
+ http://112.6.213.175:8314
+ shundeju
+ hg123456
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java
new file mode 100644
index 0000000..ece4248
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/DhCloudProperties.java
@@ -0,0 +1,56 @@
+package com.epmet.plugin.power.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 海康设备参数
+ *
+ * @author zhy
+ * @date 2022/5/20 14:59
+ */
+@Configuration
+@ConfigurationProperties(prefix = "dh.cloud")
+public class DhCloudProperties {
+
+ /**
+ * URL
+ */
+ private String url;
+
+ /**
+ * 账号
+ */
+ private String loginName;
+
+
+ /**
+ * 账号密码
+ */
+ private String loginPass;
+
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getLoginName() {
+ return loginName;
+ }
+
+ public void setLoginName(String loginName) {
+ this.loginName = loginName;
+ }
+
+ public String getLoginPass() {
+ return loginPass;
+ }
+
+ public void setLoginPass(String loginPass) {
+ this.loginPass = loginPass;
+ }
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java
new file mode 100644
index 0000000..815d47f
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/config/HikCloudProperties.java
@@ -0,0 +1,54 @@
+package com.epmet.plugin.power.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 海康设备参数
+ *
+ * @author zhy
+ * @date 2022/5/20 14:59
+ */
+@Configuration
+@ConfigurationProperties(prefix = "hik.cloud")
+public class HikCloudProperties {
+
+ /**
+ * 应用ID
+ */
+ private String url;
+
+ /**
+ * 应用KEY
+ */
+ private String client;
+
+ /**
+ * 生成AccessToken密钥
+ */
+ private String secret;
+
+ public String getUrl() {
+ return url;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public String getClient() {
+ return client;
+ }
+
+ public void setClient(String client) {
+ this.client = client;
+ }
+
+ public String getSecret() {
+ return secret;
+ }
+
+ public void setSecret(String secret) {
+ this.secret = secret;
+ }
+}
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..8242c23 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
@@ -46,7 +46,9 @@ public class PowerAxisDataVisualController {
* @date 2022/4/22 19:53
*/
@PostMapping("serviceStation/listPosition")
- public Result> getListPostition(@RequestBody PowerAxisServiceStationFormDTO form) {
+ public Result> getListPostition(@RequestBody PowerAxisServiceStationFormDTO form, @LoginUser TokenDto tokenDto) {
+ form.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(form);
return new Result().ok(powerServiceStationService.getListPosition(form));
}
@@ -59,7 +61,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);
}
@@ -115,7 +119,9 @@ public class PowerAxisDataVisualController {
* @date 2022/4/23 10:20
*/
@PostMapping("kernelHousehold/list")
- public ResultDTO getList(@RequestBody PowerKernelHouseHoldViewListFormDTO form) {
+ public ResultDTO getList(@RequestBody PowerKernelHouseHoldViewListFormDTO form, @LoginUser TokenDto tokenDto) {
+ form.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(form);
List dto = powerKernelHouseholdService.getList(form);
return ResultDTO.success("查询成功", dto, powerKernelHouseholdService.getTotal(form));
}
@@ -130,8 +136,8 @@ public class PowerAxisDataVisualController {
*/
@PostMapping("kernelHousehold/listPosition")
public Result> getListPosition(@RequestBody PowerKernelListPostitionFormDTO form, @LoginUser TokenDto tokenDto) {
- ValidatorUtils.validateEntity(form);
form.setCustomerId(tokenDto.getCustomerId());
+ ValidatorUtils.validateEntity(form);
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/controller/PowerAxisStructController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java
index 250a4f8..83cef7c 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisStructController.java
@@ -1,9 +1,12 @@
package com.epmet.plugin.power.modules.axis.controller;
+import com.alibaba.excel.util.StringUtils;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
@@ -97,7 +100,15 @@ public class PowerAxisStructController {
* @date 2022/4/19/0019 14:17
*/
@PostMapping("list4Tree")
- public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto) {
+ public Result> selectAllForTree(@RequestBody PowerAxisStructLeaderFormDTO formDto,@LoginUser TokenDto tokenDto) {
+ String agencyId = formDto.getAgencyId();
+ if (StringUtils.isBlank(agencyId)) {
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
+ if (null != staffInfo && StringUtils.isNotBlank(staffInfo.getAgencyId())) {
+ formDto.setAgencyId(staffInfo.getAgencyId());
+ }
+ }
+ formDto.setCustomerId(tokenDto.getCustomerId());
return new Result().ok(powerAxisStructService.selectAllForTree(formDto));
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java
index 38379a3..aaa1d95 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerAxisTagController.java
@@ -38,8 +38,8 @@ public class PowerAxisTagController {
private PowerAxisTagService powerAxisTagService;
@RequestMapping("page")
- public Result> page(@RequestParam Map params) {
- PageData page = powerAxisTagService.page(params);
+ public Result> page(@LoginUser TokenDto tokenDto,@RequestParam Map params) {
+ PageData page = powerAxisTagService.page(tokenDto,params);
return new Result>().ok(page);
}
@@ -102,8 +102,8 @@ public class PowerAxisTagController {
* @date 2022/4/19/0019 9:24
*/
@PostMapping("listSimpleAll")
- public Result> listSimpleAll() {
- return new Result().ok(powerAxisTagService.listSimpleAll());
+ public Result> listSimpleAll(@LoginUser TokenDto tokenDto) {
+ return new Result().ok(powerAxisTagService.listSimpleAll(tokenDto));
}
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java
index cc183e1..61d5ba9 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/controller/PowerServiceStationController.java
@@ -1,8 +1,10 @@
package com.epmet.plugin.power.modules.axis.controller;
+import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
@@ -48,7 +50,8 @@ public class PowerServiceStationController {
@NoRepeatSubmit
@PostMapping("save")
- public Result save(@RequestBody PowerServiceStationDTO dto){
+ public Result save(@RequestBody PowerServiceStationDTO dto, @LoginUser TokenDto tokenDto){
+ dto.setCustomerId(tokenDto.getCustomerId());
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
powerServiceStationService.save(dto);
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..391ebe2 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
@@ -2,16 +2,18 @@ package com.epmet.plugin.power.modules.axis.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO;
-import com.epmet.plugin.power.dto.axis.form.*;
-import com.epmet.plugin.power.dto.axis.result.*;
+import com.epmet.plugin.power.dto.axis.form.PowerAxisListPositionFormDTO;
+import com.epmet.plugin.power.dto.axis.form.PowerAxisStructFormDTO;
+import com.epmet.plugin.power.dto.axis.form.PowerAxisStructLeaderFormDTO;
+import com.epmet.plugin.power.dto.axis.form.PowerAxisStructStructTreeFormDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisListPositionResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisStructLeaderResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisStructResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisStructTreeResultDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisStructEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
-import java.util.List;
-import java.util.Map;
-
import java.util.List;
/**
@@ -75,19 +77,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);
/**
* 根据节点接报,组装其上级节点树
@@ -111,4 +113,19 @@ public interface PowerAxisStructDao extends BaseDao {
* @date 2022/4/24 19:29
*/
String getCateGoryCode(String customerId, int level, String tagCateGory);
-}
\ No newline at end of file
+
+ /**
+ * 查询动力主轴跟节点
+ *
+ * @param customerId 客户
+ * @param agencyId 组织
+ * @param structLevel 级别 {@link com.epmet.plugin.power.enums.PowerTagLevelEnum#ROOT}
+ * @return java.lang.String
+ * @author work@yujt.net.cn
+ * @date 2022/5/12/0012 9:52
+ */
+ String getRootAxisStructId(@Param("customerId") String customerId,
+ @Param("agencyId") String agencyId,
+ @Param("structLevel") int structLevel);
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java
index ef10c7e..96c38cd 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/dao/PowerAxisTagDao.java
@@ -1,12 +1,15 @@
package com.epmet.plugin.power.modules.axis.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisAllTagCategoryResultDTO;
+import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO;
import com.epmet.plugin.power.modules.axis.entity.PowerAxisTagEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
+import java.util.Map;
/**
* 动力主轴标签
@@ -24,7 +27,7 @@ public interface PowerAxisTagDao extends BaseDao {
* @author work@yujt.net.cn
* @date 2022/4/19/0019 9:14
*/
- List listSimpleAll();
+ List listSimpleAll(@Param("customerId") String customerId);
/**
* 根据ID查询节点等级
@@ -39,4 +42,9 @@ public interface PowerAxisTagDao extends BaseDao {
Integer selectStructLevelById(@Param("customerId") String customerId,
@Param("tagCategory") String tagCategory,
@Param("axisStructId") String axisStructId);
-}
\ No newline at end of file
+
+ List selectByTagCategory(@Param("tagCategory") String tagCategory,
+ @Param("customerId") String customerId);
+
+ List getPageList(Map params);
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java
index 29a10ef..1e1c231 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisStructService.java
@@ -122,7 +122,6 @@ public interface PowerAxisStructService extends BaseService getIdByAgencyId(String agencyId);
/**
- *
* 关键指标统计
*
* @param form
@@ -142,7 +141,7 @@ public interface PowerAxisStructService extends BaseService getStructTree(PowerAxisStructStructTreeFormDTO form);
- List getListPosition(int structLevel,PowerAxisDataListPositionFormDTO form);
+ List getListPosition(int structLevel, PowerAxisDataListPositionFormDTO form);
/**
* 根据节点接报,组装其上级节点树
@@ -154,4 +153,16 @@ public interface PowerAxisStructService extends BaseService listParentTreeByLevel(String structLevel, String customerId);
-}
\ No newline at end of file
+
+ /**
+ * 获取动力主轴根节点ID
+ *
+ * @param rootStructId 根节点ID,不为空直接返回该值
+ * @param customerId 客户
+ * @param agencyId 组织
+ * @return java.lang.String
+ * @author work@yujt.net.cn
+ * @date 2022/5/12/0012 10:26
+ */
+ String getRootAxisStructId(String rootStructId, String customerId, 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/PowerAxisTagService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java
index decaebf..6de234f 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/PowerAxisTagService.java
@@ -3,6 +3,7 @@ package com.epmet.plugin.power.modules.axis.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisAllTagCategoryResultDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisTagCategoryResultDTO;
@@ -27,7 +28,7 @@ public interface PowerAxisTagService extends BaseService {
* @author generator
* @date 2022-04-18
*/
- PageData page(Map params);
+ PageData page(TokenDto tokenDto,Map params);
/**
* 默认查询
@@ -96,7 +97,7 @@ public interface PowerAxisTagService extends BaseService {
* @author work@yujt.net.cn
* @date 2022/4/19/0019 9:23
*/
- List listSimpleAll();
+ List listSimpleAll(TokenDto tokenDto);
/**
* 根据标签编码,查询节点级别
@@ -121,4 +122,4 @@ public interface PowerAxisTagService extends BaseService {
* @date 2022/4/23/0023 15:51
*/
Integer selectStructLevelById(String customerId, String tagCategory, String axisStructId);
-}
\ No newline at end of file
+}
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..da4ee30 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
@@ -2,7 +2,6 @@ package com.epmet.plugin.power.modules.axis.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
-
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
@@ -10,12 +9,11 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
+import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.TreeUtils;
-import com.epmet.dto.CustomerAgencyDTO;
-import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.plugin.power.dto.axis.PowerAxisStructDTO;
import com.epmet.plugin.power.dto.axis.form.*;
import com.epmet.plugin.power.dto.axis.result.*;
@@ -44,9 +42,6 @@ import java.util.Map;
@Service
public class PowerAxisStructServiceImpl extends BaseServiceImpl implements PowerAxisStructService {
- @Autowired
- private GovOrgOpenFeignClient govOrgOpenFeignClient;
-
@Autowired
private PowerAxisTagService powerAxisTagService;
@@ -148,8 +143,9 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl NumConstant.ONE) {
+ Integer parentStructLevel = powerAxisTagService.selectStructLevelById(customerId, PowerTagCategoryEnum.STRUCT.category(), structDto.getPid());
+ parentStructLevel = parentStructLevel == null?0:parentStructLevel;
+ if (structLevel.intValue() - parentStructLevel.intValue() > NumConstant.ONE) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "无法跨级添加节点");
}
}
@@ -185,11 +181,7 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl agencyInfoResult = govOrgOpenFeignClient.getAgencyById(agencyId);
- if (!agencyInfoResult.success()) {
- throw new EpmetException(agencyInfoResult.getCode(), agencyInfoResult.getMsg());
- }
- CustomerAgencyDTO agencyInfo = agencyInfoResult.getData();
+ AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId);
struct.setAgencyId(agencyInfo.getId());
struct.setAgencyName(agencyInfo.getOrganizationName());
struct.setAgencyType(agencyInfo.getLevel());
@@ -227,19 +219,19 @@ public class PowerAxisStructServiceImpl extends BaseServiceImpl result = baseDao.listParentTreeByLevel(Integer.parseInt(structLevel), customerId);
return TreeUtils.build(result);
}
-}
\ No newline at end of file
+
+ @Override
+ public String getRootAxisStructId(String rootStructId, String customerId, String agencyId) {
+ if (StringUtils.isNotBlank(rootStructId)) {
+ return rootStructId;
+ }
+ return baseDao.getRootAxisStructId(customerId, agencyId, PowerTagLevelEnum.ROOT.level());
+ }
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java
index 36ef95e..ebf5d03 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerAxisTagServiceImpl.java
@@ -10,6 +10,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.plugin.power.dto.axis.PowerAxisTagDTO;
@@ -41,12 +42,16 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, true),
- getWrapper(params)
- );
- return getPageData(page, PowerAxisTagDTO.class);
+ public PageData page(TokenDto tokenDto,Map params) {
+// IPage page = baseDao.selectPage(
+// getPage(params, FieldConstant.CREATED_TIME, true),
+// getWrapper(params)
+// );
+// return getPageData(page, PowerAxisTagDTO.class);
+ params.put("customerId", tokenDto.getCustomerId());
+ IPage page = getPage(params);
+ List list = baseDao.getPageList(params);
+ return new PageData<>(list, page.getTotal());
}
@Override
@@ -102,18 +107,22 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>();
- wrapper.eq("TAG_CATEGORY", tagCategory)
- .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value())
- .eq(FieldConstant.CUSTOMER_ID, customerId)
- .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME);
+ List res = baseDao.selectByTagCategory(tagCategory,customerId);
+ return res;
+
- return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class);
+// QueryWrapper wrapper = new QueryWrapper<>();
+// wrapper.eq("TAG_CATEGORY", tagCategory)
+// .eq("FORBIDDEN_FLAG", EpmetDelFlagEnum.NORMAL.value())
+// .eq(FieldConstant.CUSTOMER_ID, customerId)
+// .orderByAsc("STRUCT_LEVEL", FieldConstant.CREATED_TIME);
+//
+// return ConvertUtils.sourceToTarget(baseDao.selectList(wrapper), PowerAxisTagCategoryResultDTO.class);
}
@Override
- public List listSimpleAll() {
- return baseDao.listSimpleAll();
+ public List listSimpleAll(TokenDto tokenDto) {
+ return baseDao.listSimpleAll(tokenDto.getCustomerId());
}
@Override
@@ -135,4 +144,4 @@ public class PowerAxisTagServiceImpl extends BaseServiceImpl page(Map params) {
@@ -121,8 +128,12 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getList(PowerKernelHouseHoldViewListFormDTO form) {
- form.setPageNo((form.getPageNo() - 1) * form.getPageSize());
- form.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+ String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), form.getCustomerId(), form.getAgencyId());
+ if (StringUtils.isBlank(axisStructId)) {
+ return Lists.newArrayList();
+ }
+ form.setAxisStructId(axisStructId);
+ form.setPageNo((form.getPageNo() - NumConstant.ONE) * form.getPageSize());
List list = baseDao.getList(form);
for (PowerKernelHouseHoldViewListResultDTO dto : list) {
List nameList = dto.getKernelMemberList().stream().map(PowerkernelMemberListResultDTO::getKernelMemberName).distinct().collect(Collectors.toList());
@@ -133,13 +144,17 @@ public class PowerKernelHouseholdServiceImpl extends BaseServiceImpl getListPosition(PowerKernelListPostitionFormDTO form) {
- return baseDao.queryListPosition(form.getAxisStructId(), form.getCustomerId(), form.getLimit());
+ String customerId = form.getCustomerId();
+ String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), customerId, form.getAgencyId());
+ if (StringUtils.isBlank(axisStructId)) {
+ return Lists.newArrayList();
+ }
+ return baseDao.queryListPosition(axisStructId, customerId, NumUtils.getNumberInt(form.getLimit(), true, NumUtils.ONE_THOUSAND));
}
@Override
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java
index 41268f5..379cf79 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/axis/service/impl/PowerServiceStationServiceImpl.java
@@ -6,14 +6,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
-import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.plugin.commons.utils.NumUtils;
import com.epmet.plugin.power.dto.axis.PowerServiceStationDTO;
import com.epmet.plugin.power.dto.axis.form.PowerAxisServiceStationFormDTO;
import com.epmet.plugin.power.dto.axis.result.PowerAxisServiceStationResultDTO;
import com.epmet.plugin.power.modules.axis.dao.PowerServiceStationDao;
import com.epmet.plugin.power.modules.axis.entity.PowerServiceStationEntity;
+import com.epmet.plugin.power.modules.axis.service.PowerAxisStructService;
import com.epmet.plugin.power.modules.axis.service.PowerServiceStationService;
+import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -32,9 +34,8 @@ import java.util.Map;
@Service
public class PowerServiceStationServiceImpl extends BaseServiceImpl implements PowerServiceStationService {
-
@Autowired
- private LoginUserUtil loginUser;
+ private PowerAxisStructService powerAxisStructService;
@Override
public PageData page(Map params) {
@@ -74,7 +75,6 @@ public class PowerServiceStationServiceImpl extends BaseServiceImpl getListPosition(PowerAxisServiceStationFormDTO form) {
- form.setCustomerId(loginUser.getLoginUserCustomerId());
- List list = baseDao.getListPosition(form);
- return list;
+ String axisStructId = powerAxisStructService.getRootAxisStructId(form.getAxisStructId(), form.getCustomerId(), form.getAgencyId());
+ if (StringUtils.isBlank(axisStructId)) {
+ return Lists.newArrayList();
+ }
+ form.setAxisStructId(axisStructId);
+ form.setLimit(NumUtils.getNumberInt(form.getLimit(), true, NumUtils.ONE_THOUSAND));
+ return baseDao.getListPosition(form);
}
}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java
new file mode 100644
index 0000000..1639f11
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikCommunityInfoController.java
@@ -0,0 +1,94 @@
+package com.epmet.plugin.power.modules.hik.controller;
+
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
+import com.epmet.plugin.power.modules.hik.excel.HikCommunityInfoExcel;
+import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@RestController
+@RequestMapping("hikCommunityInfo")
+public class HikCommunityInfoController {
+
+ @Autowired
+ private HikCommunityInfoService hikCommunityInfoService;
+
+ @RequestMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = hikCommunityInfoService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ HikCommunityInfoDTO data = hikCommunityInfoService.get(id);
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody HikCommunityInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ hikCommunityInfoService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody HikCommunityInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ hikCommunityInfoService.update(dto);
+ return new Result();
+ }
+
+ @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ hikCommunityInfoService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = hikCommunityInfoService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, HikCommunityInfoExcel.class);
+ }
+
+ /**
+ * @Description: 同步社区列表信息
+ * @Param: [formDto]
+ * @return: com.elink.esua.epdc.commons.tools.utils.Result<>
+ * @Author: wgf
+ * @Date: 2022-05-23
+ */
+ @GetMapping("getCommunityList")
+ public Result getCommunityList() {
+ return hikCommunityInfoService.getCommunityList();
+ }
+
+
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java
new file mode 100644
index 0000000..f1bc823
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikDeviceInfoController.java
@@ -0,0 +1,94 @@
+package com.epmet.plugin.power.modules.hik.controller;
+
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO;
+import com.epmet.plugin.power.modules.hik.excel.HikDeviceInfoExcel;
+import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@RestController
+@RequestMapping("hikDeviceInfo")
+public class HikDeviceInfoController {
+
+ @Autowired
+ private HikDeviceInfoService hikDeviceInfoService;
+
+ @RequestMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = hikDeviceInfoService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ HikDeviceInfoDTO data = hikDeviceInfoService.get(id);
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody HikDeviceInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ hikDeviceInfoService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody HikDeviceInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ hikDeviceInfoService.update(dto);
+ return new Result();
+ }
+
+ @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ hikDeviceInfoService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = hikDeviceInfoService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, HikDeviceInfoExcel.class);
+ }
+
+ /**
+ * @Description: 同步设备列表信息
+ * @Param: [formDto]
+ * @return: com.elink.esua.epdc.commons.tools.utils.Result<>
+ * @Author: wgf
+ * @Date: 2022-05-23
+ */
+ @GetMapping("getDeviceList")
+ public Result getDeviceList() {
+ return hikDeviceInfoService.getDeviceList();
+ }
+
+
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java
new file mode 100644
index 0000000..abea6e8
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/controller/HikErrorInfoController.java
@@ -0,0 +1,82 @@
+package com.epmet.plugin.power.modules.hik.controller;
+
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO;
+import com.epmet.plugin.power.modules.hik.excel.HikErrorInfoExcel;
+import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@RestController
+@RequestMapping("hikErrorInfo")
+public class HikErrorInfoController {
+
+ @Autowired
+ private HikErrorInfoService hikErrorInfoService;
+
+ @RequestMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = hikErrorInfoService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ HikErrorInfoDTO data = hikErrorInfoService.get(id);
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody HikErrorInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ hikErrorInfoService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody HikErrorInfoDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ hikErrorInfoService.update(dto);
+ return new Result();
+ }
+
+ @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ hikErrorInfoService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = hikErrorInfoService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, HikErrorInfoExcel.class);
+ }
+
+
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java
new file mode 100644
index 0000000..c25e7b3
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikCommunityInfoDao.java
@@ -0,0 +1,21 @@
+package com.epmet.plugin.power.modules.hik.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Mapper
+public interface HikCommunityInfoDao extends BaseDao {
+
+ List getCommunityInfoAll();
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java
new file mode 100644
index 0000000..6b91224
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikDeviceInfoDao.java
@@ -0,0 +1,16 @@
+package com.epmet.plugin.power.modules.hik.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Mapper
+public interface HikDeviceInfoDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java
new file mode 100644
index 0000000..95268f5
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/dao/HikErrorInfoDao.java
@@ -0,0 +1,27 @@
+package com.epmet.plugin.power.modules.hik.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.Map;
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@Mapper
+public interface HikErrorInfoDao extends BaseDao {
+
+ /**
+ * 物理删除
+ *
+ * @param params
+ * @return void
+ * @author zhy
+ * @date 2022/4/24 14:08
+ */
+ void deletePhysical(Map params);
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java
new file mode 100644
index 0000000..3b3e83e
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikCommunityInfoEntity.java
@@ -0,0 +1,64 @@
+package com.epmet.plugin.power.modules.hik.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("pli_hik_community_info")
+public class HikCommunityInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 社区ID
+ */
+ private String communityId;
+
+ /**
+ * 社区名称
+ */
+ private String communityName;
+
+ /**
+ * 省代号
+ */
+ private String provinceCode;
+
+ /**
+ * 市代号
+ */
+ private String cityCode;
+
+ /**
+ * 区代号
+ */
+ private String countyCode;
+
+ /**
+ * 经度坐标值
+ */
+ private String longitude;
+
+ /**
+ * 维度坐标值
+ */
+ private String latitude;
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java
new file mode 100644
index 0000000..4ad17cc
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikDeviceInfoEntity.java
@@ -0,0 +1,64 @@
+package com.epmet.plugin.power.modules.hik.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("pli_hik_device_info")
+public class HikDeviceInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 社区ID
+ */
+ private String communityId;
+
+ /**
+ * 设备ID
+ */
+ private String deviceId;
+
+ /**
+ * 设备名称
+ */
+ private String deviceName;
+
+ /**
+ * 设备型号
+ */
+ private String deviceModel;
+
+ /**
+ * 设备序列号
+ */
+ private String deviceSerial;
+
+ /**
+ * 设备状态,0:离线,1:在线
+ */
+ private String deviceStatus;
+
+ /**
+ * 设备路径
+ */
+ private String devicePath;
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java
new file mode 100644
index 0000000..134ea93
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/entity/HikErrorInfoEntity.java
@@ -0,0 +1,48 @@
+package com.epmet.plugin.power.modules.hik.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("pli_hik_error_info")
+public class HikErrorInfoEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户ID
+ */
+ private String customerId;
+
+ /**
+ * 身份证号
+ */
+ private String idCard;
+
+ /**
+ * 错误类型 0:token,1:人员,2权限
+ */
+ private String errorType;
+
+ /**
+ * 错误详情
+ */
+ private String errorInfo;
+
+ /**
+ * 引用ID
+ */
+ private String referenceId;
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java
new file mode 100644
index 0000000..c230129
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikCommunityInfoExcel.java
@@ -0,0 +1,63 @@
+package com.epmet.plugin.power.modules.hik.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class HikCommunityInfoExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "删除标记 0:未删除,1:已删除")
+ private String delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+ @Excel(name = "客户ID")
+ private String customerId;
+
+ @Excel(name = "社区ID")
+ private String communityId;
+
+ @Excel(name = "社区名称")
+ private String communityName;
+
+ @Excel(name = "省代号")
+ private String provinceCode;
+
+ @Excel(name = "市代号")
+ private String cityCode;
+
+ @Excel(name = "区代号")
+ private String countyCode;
+
+ @Excel(name = "经度坐标值")
+ private String longitude;
+
+ @Excel(name = "维度坐标值")
+ private String latitude;
+
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java
new file mode 100644
index 0000000..9cd4f02
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikDeviceInfoExcel.java
@@ -0,0 +1,63 @@
+package com.epmet.plugin.power.modules.hik.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Data
+public class HikDeviceInfoExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "删除标记 0:未删除,1:已删除")
+ private String delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+ @Excel(name = "客户ID")
+ private String customerId;
+
+ @Excel(name = "社区ID")
+ private String communityId;
+
+ @Excel(name = "设备ID")
+ private String deviceId;
+
+ @Excel(name = "设备名称")
+ private String deviceName;
+
+ @Excel(name = "设备型号")
+ private String deviceModel;
+
+ @Excel(name = "设备序列号")
+ private String deviceSerial;
+
+ @Excel(name = "设备状态,0:离线,1:在线")
+ private String deviceStatus;
+
+ @Excel(name = "设备路径")
+ private String devicePath;
+
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java
new file mode 100644
index 0000000..7be08bd
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/excel/HikErrorInfoExcel.java
@@ -0,0 +1,51 @@
+package com.epmet.plugin.power.modules.hik.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@Data
+public class HikErrorInfoExcel {
+
+ @Excel(name = "主键")
+ private String id;
+
+ @Excel(name = "删除标记 0:未删除,1:已删除")
+ private String delFlag;
+
+ @Excel(name = "乐观锁")
+ private Integer revision;
+
+ @Excel(name = "创建人")
+ private String createdBy;
+
+ @Excel(name = "创建时间")
+ private Date createdTime;
+
+ @Excel(name = "更新人")
+ private String updatedBy;
+
+ @Excel(name = "更新时间")
+ private Date updatedTime;
+
+ @Excel(name = "客户ID")
+ private String customerId;
+
+ @Excel(name = "身份证号")
+ private String idCard;
+
+ @Excel(name = "错误类型 0:token,1:人员,2权限")
+ private String errorType;
+
+ @Excel(name = "错误详情")
+ private String errorInfo;
+
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java
new file mode 100644
index 0000000..24a6b3a
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikCommunityInfoRedis.java
@@ -0,0 +1,30 @@
+package com.epmet.plugin.power.modules.hik.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Component
+public class HikCommunityInfoRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java
new file mode 100644
index 0000000..045d049
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikDeviceInfoRedis.java
@@ -0,0 +1,30 @@
+package com.epmet.plugin.power.modules.hik.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Component
+public class HikDeviceInfoRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java
new file mode 100644
index 0000000..970dac0
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/redis/HikErrorInfoRedis.java
@@ -0,0 +1,30 @@
+package com.epmet.plugin.power.modules.hik.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@Component
+public class HikErrorInfoRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java
new file mode 100644
index 0000000..9a47eb5
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikCommunityInfoService.java
@@ -0,0 +1,87 @@
+package com.epmet.plugin.power.modules.hik.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+public interface HikCommunityInfoService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2022-05-20
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2022-05-20
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return HikCommunityInfoDTO
+ * @author generator
+ * @date 2022-05-20
+ */
+ HikCommunityInfoDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-20
+ */
+ void save(HikCommunityInfoDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-20
+ */
+ void update(HikCommunityInfoDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2022-05-20
+ */
+ void delete(String[] ids);
+
+
+ /**
+ * 同步社区信息
+ * @param
+ * @return
+ */
+ Result getCommunityList();
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java
new file mode 100644
index 0000000..abdbe1c
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikDeviceInfoService.java
@@ -0,0 +1,86 @@
+package com.epmet.plugin.power.modules.hik.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+public interface HikDeviceInfoService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2022-05-20
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2022-05-20
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return HikDeviceInfoDTO
+ * @author generator
+ * @date 2022-05-20
+ */
+ HikDeviceInfoDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-20
+ */
+ void save(HikDeviceInfoDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-20
+ */
+ void update(HikDeviceInfoDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2022-05-20
+ */
+ void delete(String[] ids);
+
+ /**
+ * 同步设备信息
+ * @param
+ * @return
+ */
+ Result getDeviceList();
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java
new file mode 100644
index 0000000..bde8c62
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/HikErrorInfoService.java
@@ -0,0 +1,88 @@
+package com.epmet.plugin.power.modules.hik.service;
+
+import com.epmet.commons.mybatis.service.BaseService;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+public interface HikErrorInfoService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2022-05-23
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2022-05-23
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return HikErrorInfoDTO
+ * @author generator
+ * @date 2022-05-23
+ */
+ HikErrorInfoDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-23
+ */
+ void save(HikErrorInfoDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-23
+ */
+ void update(HikErrorInfoDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2022-05-23
+ */
+ void delete(String[] ids);
+
+ /**
+ * 物理删除
+ *
+ * @param params
+ * @return void
+ * @author zhy
+ * @date 2022/4/24 14:08
+ */
+ void deletePhysical(Map params);
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java
new file mode 100644
index 0000000..d026706
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikCommunityInfoServiceImpl.java
@@ -0,0 +1,167 @@
+package com.epmet.plugin.power.modules.hik.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.user.LoginUserUtil;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.utils.HttpClientManager;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao;
+import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity;
+import com.epmet.plugin.power.modules.hik.redis.HikCommunityInfoRedis;
+import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService;
+import com.epmet.plugin.power.modules.utils.HkDeviceUtil;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 海康社区信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Service
+public class HikCommunityInfoServiceImpl extends BaseServiceImpl implements HikCommunityInfoService {
+
+ @Autowired
+ private HikCommunityInfoRedis hikCommunityInfoRedis;
+
+ @Autowired
+ private HkDeviceUtil hkDeviceUtil;
+
+ @Autowired
+ private LoginUserUtil loginUserUtil;
+
+ // 参数
+ private Integer pageNo = 1;
+ private Integer pageSize = 10;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, HikCommunityInfoDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, HikCommunityInfoDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+ String communityName = (String)params.get("communityName");
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+ wrapper.like(StringUtils.isNotBlank(communityName), "COMMUNITY_NAME", communityName);
+
+ return wrapper;
+ }
+
+ @Override
+ public HikCommunityInfoDTO get(String id) {
+ HikCommunityInfoEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, HikCommunityInfoDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(HikCommunityInfoDTO dto) {
+ HikCommunityInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikCommunityInfoEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(HikCommunityInfoDTO dto) {
+ HikCommunityInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikCommunityInfoEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ public Result getCommunityList() {
+ // 请求路径
+ String url = "https://api2.hik-cloud.com/api/v1/estate/system/communities/actions/list";
+
+ // token
+ String token =hkDeviceUtil.getAccessToken();
+// token = "Bearer ".concat(token);
+
+ Map headerMap = new HashMap<>(4);
+ headerMap.put("Authorization",token);
+
+ Map paramsMap = new HashMap<>(4);
+ paramsMap.put("pageNo", pageNo);
+ paramsMap.put("pageSize", pageSize);
+
+ JSONArray jsonArray = getJSONArrayListGET(url,false,paramsMap,headerMap,"请求社区列表信息失败");
+
+ List entityList = new ArrayList();
+ for (int i = 0; i < jsonArray.size(); i++) {
+ JSONObject jsonObj = jsonArray.getJSONObject(i);
+ // 转成对象实体
+ HikCommunityInfoEntity entity = JSONObject.toJavaObject(jsonObj ,HikCommunityInfoEntity.class);
+ entity.setCustomerId(loginUserUtil.getLoginUserCustomerId() == null ? "0001" : loginUserUtil.getLoginUserCustomerId());
+ entityList.add(entity);
+ }
+ insertBatch(entityList);
+
+ if(jsonArray != null && jsonArray.size() == 10){
+ pageNo++;
+ getCommunityList();
+ }
+
+ return new Result();
+ }
+
+ /**
+ * sendGet请求
+ * @param url
+ * @param isHttps
+ * @param paramsMap
+ * @param headerMap
+ * @param msg
+ * @return
+ */
+ public JSONArray getJSONArrayListGET(String url,Boolean isHttps,Map paramsMap,Map headerMap,String msg){
+ // 请求接口
+ String data = HttpClientManager.getInstance().sendGet(url,false,paramsMap, headerMap).getData();
+ if (null == data) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg);
+ }
+ JSONObject toResult = JSON.parseObject(data);
+
+ JSONObject dataList = JSON.parseObject(toResult.get("data").toString());
+
+ JSONArray rows = JSONArray.parseArray(dataList.get("rows").toString());
+
+ return rows;
+ }
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java
new file mode 100644
index 0000000..5933489
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikDeviceInfoServiceImpl.java
@@ -0,0 +1,170 @@
+package com.epmet.plugin.power.modules.hik.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.exception.EpmetErrorCode;
+import com.epmet.commons.tools.exception.EpmetException;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.security.user.LoginUserUtil;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.utils.HttpClientManager;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
+import com.epmet.plugin.power.modules.hik.dao.HikCommunityInfoDao;
+import com.epmet.plugin.power.modules.hik.dao.HikDeviceInfoDao;
+import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikCommunityInfoEntity;
+import com.epmet.plugin.power.modules.hik.entity.HikDeviceInfoEntity;
+import com.epmet.plugin.power.modules.hik.redis.HikDeviceInfoRedis;
+import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService;
+import com.epmet.plugin.power.modules.utils.HkDeviceUtil;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.*;
+
+/**
+ * 海康设备信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-20
+ */
+@Service
+public class HikDeviceInfoServiceImpl extends BaseServiceImpl implements HikDeviceInfoService {
+
+ @Autowired
+ private HikDeviceInfoRedis hikDeviceInfoRedis;
+
+ @Autowired
+ private HkDeviceUtil hkDeviceUtil;
+
+ @Autowired
+ private LoginUserUtil loginUserUtil;
+
+ @Autowired
+ private HikCommunityInfoDao hikCommunityInfoDao;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, HikDeviceInfoDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, HikDeviceInfoDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+ String communityId = (String)params.get("communityId");
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+ wrapper.eq(StringUtils.isNotBlank(communityId), "COMMUNITY_ID", communityId);
+
+ return wrapper;
+ }
+
+ @Override
+ public HikDeviceInfoDTO get(String id) {
+ HikDeviceInfoEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, HikDeviceInfoDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(HikDeviceInfoDTO dto) {
+ HikDeviceInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikDeviceInfoEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(HikDeviceInfoDTO dto) {
+ HikDeviceInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikDeviceInfoEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ public Result getDeviceList() {
+ // 请求路径
+ String url = "https://api2.hik-cloud.com/api/v1/estate/devices/actions/listByCommunityId";
+
+ // token
+ String token =hkDeviceUtil.getAccessToken();
+// token = "Bearer ".concat(token);
+
+ Map headerMap = new HashMap<>(4);
+ headerMap.put("Authorization",token);
+
+ // 获取社区列表
+ List communityList = hikCommunityInfoDao.getCommunityInfoAll();
+
+ for(HikCommunityInfoDTO hikCommunityInfoDTO : communityList){
+ // 参数
+ Integer pageNo = 1;
+ Integer pageSize = 1000;
+ Map paramsMap = new HashMap<>(4);
+ paramsMap.put("pageNo", pageNo);
+ paramsMap.put("pageSize", pageSize);
+ paramsMap.put("communityId",hikCommunityInfoDTO.getCommunityId());
+ JSONArray jsonArray = getJSONArrayListPOST(url,JSON.toJSONString(paramsMap),headerMap,"请求设备列表信息失败");
+
+ List entityList = new ArrayList();
+ for (int i = 0; i < jsonArray.size(); i++) {
+ JSONObject jsonObj = jsonArray.getJSONObject(i);
+ // 转成对象实体
+ HikDeviceInfoEntity entity = JSONObject.toJavaObject(jsonObj ,HikDeviceInfoEntity.class);
+ entity.setCustomerId(loginUserUtil.getLoginUserCustomerId() == null ? "0001" : loginUserUtil.getLoginUserCustomerId());
+ entityList.add(entity);
+ }
+ insertBatch(entityList);
+ }
+
+ return new Result();
+ }
+
+ /**
+ * sendGet请求
+ * @param url
+ * @param jsonStrParam
+ * @param headerMap
+ * @param msg
+ * @return
+ */
+ public JSONArray getJSONArrayListPOST(String url,String jsonStrParam,Map headerMap,String msg){
+ // 请求接口
+ String data = HttpClientManager.getInstance().sendPostByJSONAndHeader(url,jsonStrParam, headerMap).getData();
+ if (null == data) {
+ throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg);
+ }
+ JSONObject toResult = JSON.parseObject(data);
+
+ JSONObject dataList = JSON.parseObject(toResult.get("data").toString());
+
+ JSONArray rows = JSONArray.parseArray(dataList.get("rows").toString());
+
+ return rows;
+ }
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java
new file mode 100644
index 0000000..1a6e31a
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/hik/service/impl/HikErrorInfoServiceImpl.java
@@ -0,0 +1,95 @@
+package com.epmet.plugin.power.modules.hik.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.plugin.power.modules.hik.dao.HikErrorInfoDao;
+import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO;
+import com.epmet.plugin.power.modules.hik.entity.HikErrorInfoEntity;
+import com.epmet.plugin.power.modules.hik.redis.HikErrorInfoRedis;
+import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 海康设备推送失败信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-23
+ */
+@Service
+public class HikErrorInfoServiceImpl extends BaseServiceImpl implements HikErrorInfoService {
+
+ @Autowired
+ private HikErrorInfoRedis hikErrorInfoRedis;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, HikErrorInfoDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, HikErrorInfoDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public HikErrorInfoDTO get(String id) {
+ HikErrorInfoEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, HikErrorInfoDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(HikErrorInfoDTO dto) {
+ HikErrorInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikErrorInfoEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(HikErrorInfoDTO dto) {
+ HikErrorInfoEntity entity = ConvertUtils.sourceToTarget(dto, HikErrorInfoEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void deletePhysical(Map params) {
+ if (!params.isEmpty()) {
+ baseDao.deletePhysical(params);
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java
index a7f68f2..5e71999 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentBlacklistController.java
@@ -70,6 +70,7 @@ public class RentBlacklistController {
return new Result();
}
+ @NoRepeatSubmit
@GetMapping("export")
public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
List list = rentBlacklistService.list(params);
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java
index 7ea49af..69de084 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractFileController.java
@@ -63,7 +63,7 @@ public class RentContractFileController {
return new Result();
}
- @PostMapping("delete")
+ @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
@@ -71,11 +71,4 @@ public class RentContractFileController {
return new Result();
}
- @GetMapping("export")
- public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
- List list = rentContractFileService.list(params);
- ExcelUtils.exportExcelToTarget(response, null, list, RentContractFileExcel.class);
- }
-
-
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java
index fcbfb40..f559bdb 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentContractInfoController.java
@@ -50,7 +50,17 @@ public class RentContractInfoController {
public Result save(@RequestBody RentContractInfoDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
- return rentContractInfoService.save(dto);
+ rentContractInfoService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("savePc")
+ public Result savePc(@RequestBody RentContractInfoDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ rentContractInfoService.savePc(dto);
+ return new Result();
}
@NoRepeatSubmit
@@ -62,6 +72,23 @@ public class RentContractInfoController {
return new Result();
}
+ @NoRepeatSubmit
+ @PostMapping("send")
+ public Result send(@RequestBody RentContractInfoDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ rentContractInfoService.send(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("resend/{id}")
+ public Result resend(@PathVariable("id") String id) {
+ //效验数据
+ rentContractInfoService.resend(id);
+ return new Result();
+ }
+
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody RentContractInfoDTO dto) {
@@ -71,6 +98,15 @@ public class RentContractInfoController {
return new Result();
}
+ @NoRepeatSubmit
+ @PostMapping("updatePc")
+ public Result updatePc(@RequestBody RentContractInfoDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ rentContractInfoService.updatePc(dto);
+ return new Result();
+ }
+
@DeleteMapping("delete")
public Result delete(@RequestBody String[] ids) {
//效验数据
@@ -79,6 +115,7 @@ public class RentContractInfoController {
return new Result();
}
+ @NoRepeatSubmit
@GetMapping("export")
public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
List list = rentContractInfoService.list(params);
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java
new file mode 100644
index 0000000..b4a4f1d
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentHouseController.java
@@ -0,0 +1,89 @@
+package com.epmet.plugin.power.modules.rent.controller;
+
+import com.alibaba.nacos.client.naming.utils.CollectionUtils;
+import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.plugin.power.dto.rent.RentHouseDTO;
+import com.epmet.plugin.power.modules.rent.excel.RentHouseExcel;
+import com.epmet.plugin.power.modules.rent.service.RentHouseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 房屋信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-11
+ */
+@RestController
+@RequestMapping("rentHouse")
+public class RentHouseController {
+
+ @Autowired
+ private RentHouseService rentHouseService;
+
+ @RequestMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = rentHouseService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
+ public Result get(@PathVariable("id") String id){
+ RentHouseDTO data = rentHouseService.get(id);
+ return new Result().ok(data);
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("save")
+ public Result save(@RequestBody RentHouseDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ rentHouseService.save(dto);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @PostMapping("update")
+ public Result update(@RequestBody RentHouseDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ rentHouseService.update(dto);
+ return new Result();
+ }
+
+ @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ rentHouseService.delete(ids);
+ return new Result();
+ }
+
+ @NoRepeatSubmit
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = rentHouseService.list(params);
+ if(CollectionUtils.isEmpty(list)){
+ RentHouseDTO dto = new RentHouseDTO();
+ dto.setId("");
+ list.add(dto);
+ }
+ ExcelUtils.exportExcelToTarget(response, null, list, RentHouseExcel.class);
+ }
+
+
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java
index 7fdd761..4601409 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/controller/RentTenantInfoController.java
@@ -7,8 +7,8 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
-import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO;
import com.epmet.plugin.power.modules.rent.excel.RentTenantInfoExcel;
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService;
@@ -39,6 +39,12 @@ public class RentTenantInfoController {
return new Result>().ok(page);
}
+ @RequestMapping("landlord/page")
+ public Result> page4Landlord(@RequestParam Map params) {
+ PageData page = rentTenantInfoService.page4Landlord(params);
+ return new Result>().ok(page);
+ }
+
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result get(@PathVariable("id") String id) {
RentTenantInfoDTO data = rentTenantInfoService.get(id);
@@ -53,6 +59,14 @@ public class RentTenantInfoController {
return rentTenantInfoService.save(dto);
}
+ @NoRepeatSubmit
+ @PostMapping("landlord/review")
+ public Result review(@RequestBody RentTenantInfoDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ return rentTenantInfoService.review(dto);
+ }
+
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody RentTenantInfoDTO dto) {
@@ -62,7 +76,7 @@ public class RentTenantInfoController {
return new Result();
}
- @PostMapping("delete")
+ @RequestMapping(value = "delete", method = {RequestMethod.POST, RequestMethod.DELETE})
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
@@ -70,11 +84,11 @@ public class RentTenantInfoController {
return new Result();
}
+ @NoRepeatSubmit
@GetMapping("export")
public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
List list = rentTenantInfoService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, RentTenantInfoExcel.class);
}
-
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java
new file mode 100644
index 0000000..2975d72
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentHouseDao.java
@@ -0,0 +1,16 @@
+package com.epmet.plugin.power.modules.rent.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.modules.rent.entity.RentHouseEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 房屋信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-11
+ */
+@Mapper
+public interface RentHouseDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java
index 29cc2c7..443b2b7 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/dao/RentTenantInfoDao.java
@@ -1,9 +1,11 @@
package com.epmet.plugin.power.modules.rent.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO;
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
import java.util.Map;
/**
@@ -25,4 +27,14 @@ public interface RentTenantInfoDao extends BaseDao {
*/
void deletePhysical(Map params);
+ /**
+ * 查询房东列表
+ *
+ * @param params
+ * @return java.util.List
+ * @author zhy
+ * @date 2022/5/5 13:57
+ */
+ List getLandlordList(Map params);
+
}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java
index a9bb81e..9f851ae 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentBlacklistEntity.java
@@ -26,6 +26,11 @@ public class RentBlacklistEntity extends BaseEpmetEntity {
*/
private String userId;
+ /**
+ * epmet网格ID
+ */
+ private String gridId;
+
/**
* 姓名
*/
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java
index d423815..1315055 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractFileEntity.java
@@ -31,9 +31,9 @@ public class RentContractFileEntity extends BaseEpmetEntity {
*/
private String fileUrl;
- /**
- * 文件类型 0:图片,1 文件(合同)
- */
+ /**
+ * 文件类型 0:图片(人脸/头像),1 文件(合同),2 身份证照片,3 中介资料
+ */
private String fileType;
/**
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java
index 11b0433..2230ff3 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentContractInfoEntity.java
@@ -106,6 +106,16 @@ public class RentContractInfoEntity extends BaseEpmetEntity {
*/
private String lessorMobile;
+ /**
+ * 出租人与户主关系
+ */
+ private String lessorRelation;
+
+ /**
+ * 出租人现居住地址
+ */
+ private String lessorLiveAddress;
+
/**
* 承租人姓名
*/
@@ -121,6 +131,16 @@ public class RentContractInfoEntity extends BaseEpmetEntity {
*/
private String lesseeMobile;
+ /**
+ * 承租人单位
+ */
+ private String lesseeUnit;
+
+ /**
+ * 承租人户籍地地址
+ */
+ private String lesseeHouseAddress;
+
/**
* 签署日期
*/
@@ -151,4 +171,9 @@ public class RentContractInfoEntity extends BaseEpmetEntity {
*/
private String customerId;
+ /**
+ * 是否是PC录入(0:否,1:是)
+ */
+ private String isPcInput;
+
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java
new file mode 100644
index 0000000..9a465d3
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentHouseEntity.java
@@ -0,0 +1,160 @@
+package com.epmet.plugin.power.modules.rent.entity;
+
+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;
+
+/**
+ * 房屋信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-11
+ */
+@Data
+@EqualsAndHashCode(callSuper=false)
+@TableName("pli_rent_house")
+public class RentHouseEntity extends BaseEpmetEntity {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户id
+ */
+ private String customerId;
+
+ /**
+ * 小区id
+ */
+ private String neighborHoodId;
+
+ /**
+ * 片区id,neighbor_hood_part.id,可为空。
+ */
+ private String partId;
+
+ /**
+ * 所属楼栋id
+ */
+ private String buildingId;
+
+ /**
+ * 所属单元id
+ */
+ private String buildingUnitId;
+
+ /**
+ * 房屋名字后台插入时生成
+ */
+ private String houseName;
+
+ /**
+ * 门牌号
+ */
+ private String doorName;
+
+ /**
+ * 房屋类型,1楼房,2平房,3别墅
+ */
+ private String houseType;
+
+ /**
+ * 存储字典value
+ */
+ private String purpose;
+
+ /**
+ * 1:出租 0:自住 2:闲置
+ */
+ private Integer rentFlag;
+
+ /**
+ * 房主姓名
+ */
+ private String ownerName;
+
+ /**
+ * 房主电话
+ */
+ private String ownerPhone;
+
+ /**
+ * 房主身份证号
+ */
+ private String ownerIdCard;
+
+ /**
+ * 排序
+ */
+ private BigDecimal sort;
+
+ /**
+ * 社区ID
+ */
+ private String communityId;
+
+ /**
+ * 社区
+ */
+ private String communityName;
+
+ /**
+ * 网格ID
+ */
+ private String gridId;
+
+ /**
+ * 网格
+ */
+ private String gridName;
+
+ /**
+ * 房屋小区ID
+ */
+ private String villageId;
+
+ /**
+ * 房屋小区
+ */
+ private String villageName;
+
+ /**
+ * 楼号ID
+ */
+ private String buildId;
+
+ /**
+ * 楼号
+ */
+ private String buildName;
+
+ /**
+ * 单元ID
+ */
+ private String unitId;
+
+ /**
+ * 单元
+ */
+ private String unitName;
+
+ /**
+ * 房屋ID
+ */
+ private String homeId;
+
+ /**
+ * 房屋
+ */
+ private String homeName;
+
+ /**
+ * 购房日期
+ */
+ private String purchaseDate;
+
+}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java
index 5aec950..f235ed5 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/entity/RentTenantInfoEntity.java
@@ -54,15 +54,51 @@ public class RentTenantInfoEntity extends BaseEpmetEntity {
*/
private String type;
+ /**
+ * 审核状态 0:未审核 1:审核通过 2:审核不通过(房东使用)
+ */
+ private String state;
+
+ /**
+ * 审核-原因
+ */
+ private String reason;
+
/**
* 客户ID
*/
private String customerId;
+ /**
+ * 政治面貌
+ */
+ private String politicalStatus;
+
+ /**
+ * 是否服兵役【是:1 否:0】
+ */
+ private String isMilitary;
+
+ /**
+ * 国籍
+ */
+ private String nation;
+
+ /**
+ * 工作单位
+ */
+ private String unit;
+
/**
* 头像列表
*/
@TableField(exist = false)
private List imgList;
+ /**
+ * 身份证照片列表
+ */
+ @TableField(exist = false)
+ private List idCardImgList;
+
}
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java
new file mode 100644
index 0000000..bea060e
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/excel/RentHouseExcel.java
@@ -0,0 +1,45 @@
+package com.epmet.plugin.power.modules.rent.excel;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+/**
+ * 房屋信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-11
+ */
+@Data
+public class RentHouseExcel {
+
+ @Excel(name = "所属小区")
+ private String villageName;
+
+ @Excel(name = "所属楼栋")
+ private String buildName;
+
+ @Excel(name = "单元号")
+ private String unitName;
+
+ @Excel(name = "门牌号")
+ private String homeName;
+
+ @Excel(name = "类型", replace = {"楼房_1", "平房_2", "别墅_3"})
+ private String houseType;
+
+ @Excel(name = "用途", replace = {"住宅_1", "商业_2", "办公_3", "工业_4", "仓储_5", "商住混用_6", "其他_7"})
+ private String purpose;
+
+ @Excel(name = "房屋状态", replace = {"出租_1", "闲置_2", "自住_0"})
+ private Integer rentFlag;
+
+ @Excel(name = "房主姓名")
+ private String ownerName;
+
+ @Excel(name = "房主电话")
+ private String ownerPhone;
+
+ @Excel(name = "房主身份证")
+ private String ownerIdCard;
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java
new file mode 100644
index 0000000..4165a7e
--- /dev/null
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/redis/RentHouseRedis.java
@@ -0,0 +1,30 @@
+package com.epmet.plugin.power.modules.rent.redis;
+
+import com.epmet.commons.tools.redis.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 房屋信息
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2022-05-11
+ */
+@Component
+public class RentHouseRedis {
+ @Autowired
+ private RedisUtils redisUtils;
+
+ public void delete(Object[] ids) {
+
+ }
+
+ public void set(){
+
+ }
+
+ public String get(String id){
+ return null;
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java
index bb0b789..612e149 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractFileService.java
@@ -85,4 +85,15 @@ public interface RentContractFileService extends BaseService params);
+
+ /**
+ * 查出对应资料
+ *
+ * @param referenceId
+ * @param fileType
+ * @return java.util.List
+ * @author zhy
+ * @date 2022/5/17 20:31
+ */
+ List listByRefAndType(String referenceId, String fileType);
}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java
index 5a552ea..c776310 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentContractInfoService.java
@@ -55,7 +55,17 @@ public interface RentContractInfoService extends BaseService {
+
+ /**
+ * 默认分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2022-05-11
+ */
+ PageData page(Map params);
+
+ /**
+ * 默认查询
+ *
+ * @param params
+ * @return java.util.List
+ * @author generator
+ * @date 2022-05-11
+ */
+ List list(Map params);
+
+ /**
+ * 单条查询
+ *
+ * @param id
+ * @return RentHouseDTO
+ * @author generator
+ * @date 2022-05-11
+ */
+ RentHouseDTO get(String id);
+
+ /**
+ * 默认保存
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-11
+ */
+ void save(RentHouseDTO dto);
+
+ /**
+ * 默认更新
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-05-11
+ */
+ void update(RentHouseDTO dto);
+
+ /**
+ * 批量删除
+ *
+ * @param ids
+ * @return void
+ * @author generator
+ * @date 2022-05-11
+ */
+ void delete(String[] ids);
+}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java
index bbe0401..1b3fa25 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/RentTenantInfoService.java
@@ -27,6 +27,16 @@ public interface RentTenantInfoService extends BaseService
*/
PageData page(Map params);
+ /**
+ * 房东分页
+ *
+ * @param params
+ * @return PageData
+ * @author generator
+ * @date 2022-04-22
+ */
+ PageData page4Landlord(Map params);
+
/**
* 默认查询
*
@@ -48,7 +58,7 @@ public interface RentTenantInfoService extends BaseService
RentTenantInfoDTO get(String id);
/**
- * 默认保存
+ * 默认保存-房东信息
*
* @param dto
* @return void
@@ -57,6 +67,16 @@ public interface RentTenantInfoService extends BaseService
*/
Result save(RentTenantInfoDTO dto);
+ /**
+ * 审核
+ *
+ * @param dto
+ * @return void
+ * @author generator
+ * @date 2022-04-22
+ */
+ Result review(RentTenantInfoDTO dto);
+
/**
* 默认更新
*
@@ -86,4 +106,5 @@ public interface RentTenantInfoService extends BaseService
* @date 2022/4/24 14:08
*/
void deletePhysical(Map params);
+
}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java
index 8a2c413..bca0d53 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentBlacklistServiceImpl.java
@@ -43,10 +43,11 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl page(Map params) {
+ params.put("customerId", loginUserUtil.getLoginUserCustomerId());
IPage page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
@@ -56,6 +57,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl list(Map params) {
+ params.put("customerId", loginUserUtil.getLoginUserCustomerId());
List entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, RentBlacklistDTO.class);
@@ -68,6 +70,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@@ -76,6 +79,7 @@ public class RentBlacklistServiceImpl extends BaseServiceImpl params = new HashMap<>(4);
params.put("idCard", dto.getIdCard());
if (!list(params).isEmpty()) {
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java
index e362927..dffa8a0 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractFileServiceImpl.java
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -96,4 +97,11 @@ public class RentContractFileServiceImpl extends BaseServiceImpl listByRefAndType(String referenceId, String fileType) {
+ Map params = new HashMap<>(4);
+ params.put("referenceId", referenceId);
+ params.put("fileType", fileType);
+ return list(params);
+ }
}
\ No newline at end of file
diff --git a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
index 6db1756..b8f74a7 100644
--- a/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
+++ b/epmet-plugins-module/pli-power-base/pli-power-base-server/src/main/java/com/epmet/plugin/power/modules/rent/service/impl/RentContractInfoServiceImpl.java
@@ -13,14 +13,24 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.IdCardNoValidatorUtils;
import com.epmet.dto.CustomerAgencyDTO;
+import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcResiUserAttachmentDTO;
import com.epmet.dto.IcResiUserDTO;
+import com.epmet.dto.form.IcHouseAddFormDTO;
import com.epmet.dto.form.RentTenantFormDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
+import com.epmet.plugin.power.dto.hik.HikCommunityInfoDTO;
+import com.epmet.plugin.power.dto.hik.HikDeviceInfoDTO;
+import com.epmet.plugin.power.dto.hik.HikErrorInfoDTO;
+import com.epmet.plugin.power.dto.hik.form.HikAuthorityFormDTO;
+import com.epmet.plugin.power.dto.hik.form.HikPersonFormDTO;
import com.epmet.plugin.power.dto.rent.RentContractFileDTO;
import com.epmet.plugin.power.dto.rent.RentContractInfoDTO;
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO;
+import com.epmet.plugin.power.modules.hik.service.HikCommunityInfoService;
+import com.epmet.plugin.power.modules.hik.service.HikDeviceInfoService;
+import com.epmet.plugin.power.modules.hik.service.HikErrorInfoService;
import com.epmet.plugin.power.modules.rent.dao.RentContractInfoDao;
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity;
import com.epmet.plugin.power.modules.rent.entity.RentContractInfoEntity;
@@ -29,6 +39,7 @@ import com.epmet.plugin.power.modules.rent.redis.RentContractInfoRedis;
import com.epmet.plugin.power.modules.rent.service.RentContractFileService;
import com.epmet.plugin.power.modules.rent.service.RentContractInfoService;
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService;
+import com.epmet.plugin.power.modules.utils.HkDeviceUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -50,7 +61,10 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl page(Map params) {
+ params.put("customerId", loginUserUtil.getLoginUserCustomerId());
+ if (StringUtils.isNotBlank((String) params.get("dataFlag"))) {
+ params.put("createdBy", loginUserUtil.getLoginUserId());
+ }
IPage page = getPage(params);
List list = baseDao.getContractInfoList(params);
return new PageData<>(list, page.getTotal());
-
}
@Override
public List list(Map params) {
+ params.put("customerId", loginUserUtil.getLoginUserCustomerId());
List entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, RentContractInfoDTO.class);
@@ -93,10 +120,14 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@@ -112,8 +143,12 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl params = new HashMap<>(4);
params.put("contractId", id);
-
- // 取出租客信息
List tenantList = rentTenantInfoService.list(params);
tenantList.forEach(item -> {
// 租客信息补充照片信息
- params.put("referenceId", item.getId());
- params.put("fileType", NumConstant.ZERO_STR);
- List imgList = rentContractFileService.list(params);
- item.setImgList(imgList);
+ item.setImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.ZERO_STR));
+ // 租客信息补充身份证照片信息
+ item.setIdCardImgList(rentContractFileService.listByRefAndType(item.getId(), NumConstant.TWO_STR));
});
dto.setTenantList(tenantList);
dto.setTenantNum(tenantList.size());
- params.put("referenceId", dto.getId());
- params.put("fileType", NumConstant.ONE_STR);
// 取出合同文件信息
- List fileList = rentContractFileService.list(params);
- dto.setFileList(fileList);
+ dto.setFileList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.ONE_STR));
+ dto.setAgencyImgList(rentContractFileService.listByRefAndType(dto.getId(), NumConstant.THREE_STR));
return dto;
}
@Override
@Transactional(rollbackFor = Exception.class)
- public Result save(RentContractInfoDTO dto) {
+ public void save(RentContractInfoDTO dto) {
RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class);
entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
insert(entity);
- return updateTenantAndFile(entity.getId(), dto);
+ // 处理租客信息和合同信息
+ updateTenantAndFile(entity.getId(), dto);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void savePc(RentContractInfoDTO dto) {
+ // PC 端新增,默认审核通过(0:待审核;1:通过;2:不通过)
+ dto.setState("1");
+ // 是否是 PC 录入(0:否,1:是)
+ dto.setIsPcInput("1");
+
+ RentContractInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentContractInfoEntity.class);
+ entity.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+
+ insert(entity);
+ // 处理租客信息和合同信息
+ updateTenantAndFile(entity.getId(), dto);
+
+ // PC新增,默认审核通过,需要更新基础库头像信息以及居民信息,最后更新房屋的状态
+ if (NumConstant.ONE_STR.equals(entity.getState())) {
+ // 获取基本信息
+ RentContractInfoDTO contractDto = get(entity.getId());
+
+ // 获取租客信息
+ Map tenantParams = new HashMap<>(4);
+ tenantParams.put("contractId", contractDto.getId());
+ List tenantList = rentTenantInfoService.list(tenantParams);
+
+ tenantList.forEach(tenant -> {
+ RentTenantFormDTO formDTO = new RentTenantFormDTO();
+ List images = new ArrayList<>();
+ formDTO.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+ formDTO.setIdCard(tenant.getIdCard());
+ formDTO.setType(NumConstant.ONE_STR);
+
+ List imgList = rentContractFileService.listByRefAndType(tenant.getId(), NumConstant.ZERO_STR);
+
+ imgList.forEach(img -> {
+ // 更新基础库的人员头像
+ IcResiUserAttachmentDTO image = new IcResiUserAttachmentDTO();
+ image.setAttachmentUrl(img.getFileUrl());
+ image.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+ images.add(image);
+ });
+ formDTO.setImages(images);
+
+ // 初始化居民信息
+ IcResiUserDTO user = new IcResiUserDTO();
+ user.setCustomerId(loginUserUtil.getLoginUserCustomerId());
+ user.setGridId(contractDto.getGridId());
+ user.setVillageId(contractDto.getVillageId());
+ user.setBuildId(contractDto.getBuildId());
+ user.setUnitId(contractDto.getUnitId());
+ user.setHomeId(contractDto.getHomeId());
+ user.setName(tenant.getName());
+ user.setIdCard(tenant.getIdCard());
+ user.setMobile(tenant.getMobile());
+ user.setGender(IdCardNoValidatorUtils.getGender(tenant.getIdCard()));
+
+ user.setAgencyId(contractDto.getCommunityId());
+ Result agencyInfo = govOrgOpenFeignClient.getAgencyById(contractDto.getCommunityId());
+ user.setPids(agencyInfo.getData().getPids());
+
+ formDTO.setUser(user);
+
+ epmetUserOpenFeignClient.updateImage(formDTO);
+
+ });
+
+ // 更新房屋的状态为租赁
+ Result houseInfo = govOrgOpenFeignClient.get(dto.getHomeId());
+ IcHouseAddFormDTO formDTO = ConvertUtils.sourceToTarget(houseInfo.getData(), IcHouseAddFormDTO.class);
+ formDTO.setRentFlag(NumConstant.ONE);
+ formDTO.setHouseId(dto.getHomeId());
+ govOrgOpenFeignClient.houseUpdate(formDTO);
+ }
+
}
@Override
@@ -162,7 +270,7 @@ public class RentContractInfoServiceImpl extends BaseServiceImpl imgParams = new HashMap<>(4);
- imgParams.put("referenceId", tenant.getId());
- imgParams.put("fileType", NumConstant.ZERO_STR);
- List