wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+ wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
Calendar before3daysDate = Calendar.getInstance();
before3daysDate.setTime(new Date());
before3daysDate.add(Calendar.DATE, -3);
diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java
index 03283c179a..943a096740 100644
--- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java
+++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedController.java
@@ -43,6 +43,7 @@ public class ResiWarmheartedController {
**/
@PostMapping("submit")
public Result submit(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
+ formDTO.setApp(tokenDTO.getApp());
ValidatorUtils.validateEntity(formDTO);
return resiWarmheartedService.submit(tokenDTO, formDTO);
}
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java
index 31c92d0a34..4f301d4ba1 100644
--- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/ResiWarmheartedApplyDTO.java
@@ -69,6 +69,16 @@ public class ResiWarmheartedApplyDTO implements Serializable {
*/
private String refuseReason;
+ /**
+ * 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)
+ */
+ private String readFlag;
+
+ /**
+ * 消息通知内容
+ */
+ private String messageText;
+
/**
* 热心居民申请行为记录表Id (resi_warmhearted_visit.id)
*/
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java
new file mode 100644
index 0000000000..058627678a
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditApproveFormDTO.java
@@ -0,0 +1,51 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.resi.partymember.dto.warmhearted.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 政府端-人工审核热心居民申请-审核通过-入参配置
+ * @author sun
+ */
+@Data
+public class ResiWarmAuditApproveFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 热心居民申请id
+ */
+ @NotBlank(message = "申请ID不能为空")
+ private String applyId;
+
+ /**
+ * 用户Id
+ */
+ private String userId;
+
+ /**
+ * 所属端 app
+ */
+ private String app;
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java
new file mode 100644
index 0000000000..844fdee598
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditFormDTO.java
@@ -0,0 +1,66 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.resi.partymember.dto.warmhearted.form;
+
+
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 政府端-获取待审核的热心居民申请列表-入参配置
+ *
+ * @author sun
+ */
+@Data
+public class ResiWarmAuditFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 用户当前所在网格所属客户id
+ */
+ @NotBlank(message = "客户id不能为空")
+ private String customerId;
+
+ /**
+ * 用户当前所在网格id
+ */
+ @NotBlank(message = "网格id不能为空")
+ private String gridId;
+
+ /**
+ * 页码
+ */
+ @Min(1)
+ private Integer pageNo;
+
+ /**
+ * 每页显示条数
+ */
+ private Integer pageSize = 10;
+
+ /**
+ * 审核状态 【key:audit_status,value:(under_auditting:待审核,approved:通过,rejected :未通过)】
+ */
+ private String auditStatus;
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java
similarity index 74%
rename from epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java
rename to epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java
index 707e41f30f..6f19739bcc 100644
--- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditFormDTO.java
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmAuditRejectFormDTO.java
@@ -24,11 +24,11 @@ import java.io.Serializable;
/**
- * 政府端-人工审核热心居民申请-配置入参
+ * 政府端-人工审核热心居民申请-审核驳回-入参配置
* @author sun
*/
@Data
-public class ResiWarmheartedAuditFormDTO implements Serializable {
+public class ResiWarmAuditRejectFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@@ -36,28 +36,22 @@ public class ResiWarmheartedAuditFormDTO implements Serializable {
* 热心居民申请id
*/
@NotBlank(message = "申请ID不能为空")
- private String resiWarmApplyId;
-
- /**
- * 审核状态(0:取消驳回 1:审核通过)
- */
- @NotBlank(message = "审核状态不能为空")
- private String auditStatus;
+ private String applyId;
/**
* 驳回理由
*/
+ @NotBlank(message = "驳回理由不能为空")
private String refuseReason;
/**
- * 客户Id CUSTOMER.id
+ * 用户Id
*/
- @NotBlank(message = "客户ID不能为空")
- private String customerId;
+ private String userId;
/**
- * 用户Id
+ * 所属端 app
*/
- private String userId;
+ private String app;
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java
new file mode 100644
index 0000000000..97bb2b4f44
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmGetDetailFormDTO.java
@@ -0,0 +1,42 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.resi.partymember.dto.warmhearted.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * 政府端-热心居民申请详情信息-入参配置
+ *
+ * @author sun
+ */
+@Data
+public class ResiWarmGetDetailFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 热心居民申请id
+ */
+ @NotBlank(message = "申请ID不能为空")
+ private String applyId;
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java
new file mode 100644
index 0000000000..c7a9b8bacd
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedAuditedFromDTO.java
@@ -0,0 +1,31 @@
+package com.epmet.resi.partymember.dto.warmhearted.form;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author zhaoqifeng
+ * @dscription 热心居民-审核历史请求参数
+ * @date 2020/4/16 13:51
+ */
+@Data
+public class ResiWarmheartedAuditedFromDTO implements Serializable {
+ private static final long serialVersionUID = -7290137219142856024L;
+ /**
+ * 客户id
+ */
+ private String customerId;
+ /**
+ * 网格id
+ */
+ private String gridId;
+ /**
+ * 页码
+ */
+ private Integer pageNo;
+ /**
+ * 每页显示数量
+ */
+ private Integer pageSize;
+}
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java
index 38adf78eae..7ce698f0af 100644
--- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/form/ResiWarmheartedSubmitFormDTO.java
@@ -61,4 +61,14 @@ public class ResiWarmheartedSubmitFormDTO implements Serializable {
*/
private String userId;
+ /**
+ * 所属端 app
+ */
+ private String app;
+
+ /**
+ * 消息内容
+ */
+ private String messageText;
+
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java
new file mode 100644
index 0000000000..8e00af9ca4
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmAuditResultDTO.java
@@ -0,0 +1,106 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.resi.partymember.dto.warmhearted.result;
+
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 政府端-获取待审核的热心居民申请列表-返参配置
+ *
+ * @author sun
+ */
+@Data
+public class ResiWarmAuditResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+
+ /**
+ * 申请单Id
+ */
+ private String applyId;
+
+ /**
+ * 客户Id (customer.id)
+ */
+ private String customerId;
+
+ /**
+ * 网格Id (customer_grid.id)
+ */
+ private String gridId;
+
+ /**
+ * 申请用户id
+ */
+ private String userId;
+
+ /**
+ * 热心居民申请理由 (300字)
+ */
+ private String reason;
+
+ /**
+ * 审核状态 【key:audit_status,value:(under_auditting:待审核,approved:通过,rejected :未通过)】
+ */
+ private String auditStatus;
+
+ /**
+ * 拒绝理由
+ */
+ private String refuseReason;
+
+ /**
+ * 申请用户头像
+ */
+ private String userHeadPhoto;
+
+ /**
+ * 申请用户的显示昵称
+ */
+ private String userNickName;
+
+ /**
+ * 阅读标记 未读unread 界面显示红点,已读read不显示红点
+ */
+ private String readFlag;
+
+ /**
+ * 消息通知内容
+ */
+ private String messageText;
+
+ /**
+ * 热心居民申请行为记录表Id (resi_warmhearted_visit.id)
+ */
+ private String resiWarmVisitId;
+
+ /**
+ * 申请时间
+ */
+ private Date applyTime;
+
+ /**
+ * 街道
+ */
+ private String street;
+
+}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java
new file mode 100644
index 0000000000..7b8a147be8
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/warmhearted/result/ResiWarmheartedAuditedResultDTO.java
@@ -0,0 +1,46 @@
+package com.epmet.resi.partymember.dto.warmhearted.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author zhaoqifeng
+ * @dscription 热心居民-审核历史返回值
+ * @date 2020/4/16 13:52
+ */
+@Data
+public class ResiWarmheartedAuditedResultDTO implements Serializable {
+ private static final long serialVersionUID = 4109086860497055842L;
+ /**
+ * 申请单id
+ */
+ private String applyId;
+ /**
+ * 申请用户id
+ */
+ private String userId;
+ /**
+ * 申请用户头像
+ */
+ private String userHeadPhoto;
+ /**
+ * 申请用户显示昵称
+ */
+ private String userNickName;
+ /**
+ * 申请时间HH:mm
+ */
+ private Date applyTime;
+ /**
+ * 已驳回rejected ,已通过approved
+ */
+ private String status;
+ /**
+ * 消息通知内容
+ */
+ private String messageText;
+
+
+}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml
index 1b3efe725e..0ac1f5db89 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml
+++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml
@@ -81,6 +81,18 @@
RELEASE
compile
+
+ com.epmet
+ epmet-message-client
+ 2.0.0
+ compile
+
+
+ com.epmet
+ gov-org-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java
index b39f6bbea2..50b8cf9bb5 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetMessageFeignClient.java
@@ -2,10 +2,13 @@ package com.epmet.modules.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.modules.feign.fallback.EpmetMessageFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
/**
* @author kamui
@@ -21,4 +24,13 @@ public interface EpmetMessageFeignClient {
@GetMapping(value = "message/sms/captcha/{mobile}")
Result sendSmsCaptcha(@PathVariable String mobile);
+ /**
+ * @param formDto
+ * @return com.epmet.commons.tools.utils.Result
+ * @Author sun
+ * @Description 新增未读消息
+ **/
+ @PostMapping(value = "message/usermessage/saveusermessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
+ Result saveUserMessage(UserMessageFormDTO formDto);
+
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java
index 30cb07eb4b..6f15d6b399 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java
@@ -5,12 +5,15 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
+import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.fallback.EpmetUserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import java.util.List;
+
/**
* @author zhaoqifeng
* @dscription
@@ -21,6 +24,7 @@ public interface EpmetUserFeignClient {
/**
* 查询用户注册信息
+ *
* @param userResiInfoFormDTO 参数
* @return Result
*/
@@ -29,11 +33,12 @@ public interface EpmetUserFeignClient {
/**
* 党员认证时,如果没有注册居民,则注册居民信息
+ *
* @param userResiInfoDTO
* @author zhaoqifeng
**/
@PostMapping("/epmetuser/userresiinfo/saveResiInfo")
- Result saveResiInfo (@RequestBody UserResiInfoDTO userResiInfoDTO);
+ Result saveResiInfo(@RequestBody UserResiInfoDTO userResiInfoDTO);
/**
* 添加用户角色关系
@@ -44,4 +49,14 @@ public interface EpmetUserFeignClient {
@PostMapping("/epmetuser/userrole/saveUserRole")
Result saveUserRole(@RequestBody UserRoleDTO userRoleDTO);
+ /**
+ * 根据userId集合查询用户注册信息
+ *
+ * @param userResiInfoListFormDTO
+ * @return com.epmet.commons.tools.utils.Result>
+ * @Date 2020/4/7 18:24
+ **/
+ @PostMapping("/epmetuser/userresiinfo/getuserresiinfolist")
+ Result> getUserResiInfoList(@RequestBody UserResiInfoListFormDTO userResiInfoListFormDTO);
+
}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java
new file mode 100644
index 0000000000..620bd1feaf
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/GovOrgFeignClient.java
@@ -0,0 +1,35 @@
+package com.epmet.modules.feign;
+
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.dto.form.ListCustomerGridFormDTO;
+import com.epmet.modules.feign.fallback.GovOrgFeignClientFallBack;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+
+/**
+ * @Description Feign调用gov-org-server模块
+ * @ClassName GovOrgFeginFallBack
+ * @Author sun
+ */
+@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgFeignClientFallBack.class)
+public interface GovOrgFeignClient {
+
+ /**
+ * 根据网格Id查询网格信息
+ * @param customerGridFormDTO
+ * @return
+ */
+ @PostMapping("/gov/org/customergrid/getcustomergridbygridid")
+ Result getCustomerGridByGridId(@RequestBody CustomerGridFormDTO customerGridFormDTO);
+
+
+
+
+
+}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java
index e87f27e4d3..f588f55781 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetMessageFeignClientFallback.java
@@ -3,6 +3,7 @@ package com.epmet.modules.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.modules.feign.EpmetMessageFeignClient;
import org.springframework.stereotype.Component;
@@ -18,4 +19,9 @@ public class EpmetMessageFeignClientFallback implements EpmetMessageFeignClient
return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSmsCaptcha", mobile);
}
+ @Override
+ public Result saveUserMessage(UserMessageFormDTO formDto) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "saveUserMessage", formDto);
+ }
+
}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java
index 93e9d3cf20..1203bc053d 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/EpmetUserFeignClientFallBack.java
@@ -6,10 +6,13 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
+import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.modules.feign.EpmetUserFeignClient;
import org.springframework.stereotype.Component;
+import java.util.List;
+
/**
* @author zhaoqifeng
* @dscription
@@ -31,4 +34,9 @@ public class EpmetUserFeignClientFallBack implements EpmetUserFeignClient {
public Result saveUserRole(UserRoleDTO userRoleDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveUserRole", userRoleDTO);
}
+
+ @Override
+ public Result> getUserResiInfoList(UserResiInfoListFormDTO userResiInfoListFormDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserResiInfoList", userResiInfoListFormDTO);
+ }
}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java
new file mode 100644
index 0000000000..f1f0195374
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/fallback/GovOrgFeignClientFallBack.java
@@ -0,0 +1,28 @@
+package com.epmet.modules.feign.fallback;
+
+import com.epmet.commons.tools.constant.ServiceConstant;
+import com.epmet.commons.tools.utils.ModuleUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.modules.feign.GovOrgFeignClient;
+import org.springframework.stereotype.Component;
+
+/**
+ * @Description Feign
+ * @ClassName GovOrgFeginFallBack
+ * @Author sun
+ */
+@Component
+public class GovOrgFeignClientFallBack implements GovOrgFeignClient {
+
+ /**
+ * 根据网格Id查询网格信息
+ * @param customerGridFormDTO
+ * @return
+ */
+ @Override
+ public Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) {
+ return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId",customerGridFormDTO);
+ }
+}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
index 54e7dc19f4..28959478c1 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
@@ -153,7 +153,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO,
PartymemberInfoEntity.class);
- if (confirmAutoDTO == null || (confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0 && !confirmAutoDTO.getComparisonResults())) {
+ if (confirmAutoDTO == null || !confirmAutoDTO.getComparisonResults()) {
//将访问记录更新到热心居民申请行为记录表
saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_FAILED);
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
index 2f8e281b68..8d0381e8a3 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
@@ -40,6 +40,9 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.toList;
/**
* 党员库基本信息表
@@ -125,25 +128,58 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl 0) {
//优先判断身份证和手机号
- Optional matchingResult =
- idCardList.stream().filter(baseInfo -> baseInfo.getMobile().equals(partyMemberInfo.getMobile())).findFirst();
-
- if (matchingResult.isPresent()) {
- confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
- return confirmAutoDTO;
+ List matchingList = idCardList.stream().filter(baseInfo ->
+ baseInfo.getMobile().equals(partyMemberInfo.getMobile())).collect(toList());
+
+ if (matchingList.size() > 0) {
+ //姓名匹配度是01(含)以上
+ List nameMatchingList = idCardList.stream().filter(baseInfo ->
+ getOneSimilarity(baseInfo.getName(), name,
+ PartyMemberConstant.NAME_SMALL)).collect(toList());
+ if (nameMatchingList.size() > 0) {
+ //获取匹配度最高的一条
+ PartymemberBaseInfoEntity baseInfoEntity =
+ nameMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
+ confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
+ return confirmAutoDTO;
+ }
}
//判断身份证和姓名
- matchingResult = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst();
-
- if (matchingResult.isPresent()) {
- confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
+ matchingList = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).collect(toList());
+
+ if (matchingList.size() > 0) {
+ //手机号匹配度是01(含)以上
+ List mobileMatchingList = idCardList.stream().filter(baseInfo ->
+ getOneSimilarity(baseInfo.getMobile(), partyMemberInfo.getMobile(),
+ PartyMemberConstant.MOBILE_SMALL)).collect(toList());
+ if (mobileMatchingList.size() > 0) {
+ //获取匹配度最高的一条
+ PartymemberBaseInfoEntity baseInfoEntity =
+ mobileMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
+ confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
+ return confirmAutoDTO;
+ }
+ }
+ //有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过;
+ matchingList = idCardList.stream().filter(baseInfo ->
+ getOneSimilarity(baseInfo.getMobile(), partyMemberInfo.getMobile(),
+ PartyMemberConstant.MOBILE_MOST) && getOneSimilarity(baseInfo.getName(),
+ name, PartyMemberConstant.NAME_MOST)).collect(toList());
+
+ if (matchingList.size() > 0) {
+ //获取匹配度最高的一条
+ PartymemberBaseInfoEntity baseInfoEntity =
+ matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
+ confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
-
//获取匹配度最高的数据
sortList.add(idCardList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
- getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0));
} else {
//根据手机号匹配数据
@@ -151,32 +187,63 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl 0) {
//判断手机号和姓名
- Optional matchingResult =
- mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst();
-
- if (matchingResult.isPresent()) {
- confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
+ List matchingList =
+ mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).collect(toList());
+
+ if (matchingList.size() > 0) {
+ //身份证匹配度是01(含)以上
+ List idCardMatchingList = mobileList.stream().filter(baseInfo ->
+ getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(),
+ PartyMemberConstant.ID_SMALL)).collect(toList());
+ if (idCardMatchingList.size() > 0) {
+ //获取匹配度最高的一条
+ PartymemberBaseInfoEntity baseInfoEntity =
+ idCardMatchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
+ confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
+ return confirmAutoDTO;
+ }
+ }
+ //有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过;
+ matchingList = mobileList.stream().filter(baseInfo ->
+ getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(),
+ PartyMemberConstant.ID_MOST) && getOneSimilarity(baseInfo.getName(),
+ name, PartyMemberConstant.NAME_MOST)).collect(toList());
+
+ if (matchingList.size() > 0) {
+ //获取匹配度最高的一条
+ PartymemberBaseInfoEntity baseInfoEntity =
+ matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
+ confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
return confirmAutoDTO;
}
-
//获取匹配度最高的数据
sortList.add(mobileList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
- getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0));
} else {
//根据姓名匹配数据
List nameList = baseDao.selectBaseInfoByName(partyMemberInfo);
if (null != nameList && nameList.size() > 0) {
+ //有一项是11的情况下,另外两项需要是10(含)以上,可以认证通过;
+ List matchingList = nameList.stream().filter(baseInfo ->
+ getOneSimilarity(baseInfo.getIdCard(), partyMemberInfo.getIdCard(),
+ PartyMemberConstant.ID_MOST) && getOneSimilarity(baseInfo.getMobile(),
+ partyMemberInfo.getMobile(), PartyMemberConstant.MOBILE_MOST)).collect(toList());
+
+ if (matchingList.size() > 0) {
+ //获取匹配度最高的一条
+ PartymemberBaseInfoEntity baseInfoEntity =
+ matchingList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
+ confirmAutoDTO = getResult(baseInfoEntity, partyMemberInfo, true);
+ return confirmAutoDTO;
+ }
+
//获取匹配度最高的数据
sortList.add(nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
- getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
-
- PartymemberBaseInfoEntity similar =
- nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
- getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0);
-
- confirmAutoDTO = getResult(similar, partyMemberInfo, false);
- return confirmAutoDTO;
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0));
} else {
return null;
@@ -184,9 +251,9 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl
- getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0);
+ getSimilarity(p, partyMemberInfo)).reversed()).collect(toList()).get(0);
return getResult(similar, partyMemberInfo, false);
}
@@ -274,4 +341,15 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl> page(@RequestParam Map params) {
- PageData page = resiWarmheartedApplyService.page(params);
- return new Result>().ok(page);
- }
-
- @GetMapping("{id}")
- public Result get(@PathVariable("id") String id) {
- ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id);
- return new Result().ok(data);
- }
-
- @PostMapping
- public Result save(@RequestBody ResiWarmheartedApplyDTO dto) {
- //效验数据
- ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
- resiWarmheartedApplyService.save(dto);
- return new Result();
- }
-
- @PutMapping
- public Result update(@RequestBody ResiWarmheartedApplyDTO dto) {
- //效验数据
- ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
- resiWarmheartedApplyService.update(dto);
- return new Result();
- }
-
- @DeleteMapping
- public Result delete(@RequestBody String[] ids) {
- //效验数据
- AssertUtils.isArrayEmpty(ids, "id");
- resiWarmheartedApplyService.delete(ids);
- return new Result();
- }
-
- @GetMapping("export")
- public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
- List list = resiWarmheartedApplyService.list(params);
- ExcelUtils.exportExcelToTarget(response, null, list, ResiWarmheartedApplyExcel.class);
- }
-
- @PostMapping("init")
- public Result init(@RequestBody ResiWarmheartedFormDTO formDTO) {
- return resiWarmheartedApplyService.init(formDTO);
- }
-
- @PostMapping("submit")
- public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
- return resiWarmheartedApplyService.submit(formDTO);
- }
-
- @PostMapping("manageaudit")
- public Result manageAudit(@RequestBody ResiWarmheartedAuditFormDTO formDTO) {
- return resiWarmheartedApplyService.manageAudit(formDTO);
- }
+ @Autowired
+ private ResiWarmheartedApplyService resiWarmheartedApplyService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params) {
+ PageData page = resiWarmheartedApplyService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id) {
+ ResiWarmheartedApplyDTO data = resiWarmheartedApplyService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody ResiWarmheartedApplyDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ resiWarmheartedApplyService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody ResiWarmheartedApplyDTO dto) {
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ resiWarmheartedApplyService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids) {
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ resiWarmheartedApplyService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = resiWarmheartedApplyService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, ResiWarmheartedApplyExcel.class);
+ }
+
+ @PostMapping("init")
+ public Result init(@RequestBody ResiWarmheartedFormDTO formDTO) {
+ return resiWarmheartedApplyService.init(formDTO);
+ }
+
+ @PostMapping("submit")
+ public Result submit(@RequestBody ResiWarmheartedSubmitFormDTO formDTO) {
+ return resiWarmheartedApplyService.submit(formDTO);
+ }
+
+ /**
+ * 热心居民审核历史列表
+ *
+ * @param formDTO 参数
+ * @return
+ */
+ @PostMapping("audited")
+ public Result> audited(@RequestBody ResiWarmheartedAuditedFromDTO formDTO) {
+ return resiWarmheartedApplyService.audited(formDTO);
+ }
+
+ /**
+ * @param
+ * @Author sun
+ * @Description 政府端-获取待审核的热心居民申请列表
+ **/
+ @PostMapping("auditing")
+ public Result> auditing(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ return resiWarmheartedApplyService.auditing(formDTO);
+ }
+
+ /**
+ * @param
+ * @Author sun
+ * @Description 政府端-热心居民申请-审核通过
+ **/
+ @PostMapping("approve")
+ public Result approve(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditApproveFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ return resiWarmheartedApplyService.approve(formDTO);
+ }
+
+ /**
+ * @param
+ * @Author sun
+ * @Description 政府端-热心居民申请-审核驳回
+ **/
+ @PostMapping("reject")
+ public Result reject(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditRejectFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ return resiWarmheartedApplyService.reject(formDTO);
+ }
+
+ /**
+ * @param
+ * @Author sun
+ * @Description 政府端-热心居民申请详情信息
+ **/
+ @PostMapping("getdetail")
+ public Result getDetail(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmGetDetailFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO);
+ return resiWarmheartedApplyService.getDetail(formDTO);
+ }
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java
index 843eac1b54..5467173db1 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java
@@ -18,12 +18,16 @@
package com.epmet.modules.warmhearted.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
-import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
+import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmAuditFormDTO;
+import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditedFromDTO;
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
+import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 热心居民申请表
*
@@ -40,4 +44,12 @@ public interface ResiWarmheartedApplyDao extends BaseDao selectAuditedApplyList(ResiWarmheartedAuditedFromDTO params);
+
+ /**
+ * 查询待审核状态的热心居民申请
+ * @param formDTO
+ * @return
+ */
+ List selectResiWarmAuditList(ResiWarmAuditFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java
index 6c5545dabf..4df8b1c43c 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/entity/ResiWarmheartedApplyEntity.java
@@ -68,6 +68,16 @@ public class ResiWarmheartedApplyEntity extends BaseEpmetEntity {
*/
private String refuseReason;
+ /**
+ * 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)
+ */
+ private String readFlag;
+
+ /**
+ * 消息通知内容
+ */
+ private String messageText;
+
/**
* 热心居民申请行为记录表Id (resi_warmhearted_visit.id)
*/
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java
index cee8444ca4..f04c5afcaa 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/excel/ResiWarmheartedApplyExcel.java
@@ -52,6 +52,12 @@ public class ResiWarmheartedApplyExcel {
@Excel(name = "拒绝理由")
private String refuseReason;
+ @Excel(name = "阅读标记")
+ private String readFlag;
+
+ @Excel(name = "消息通知内容")
+ private String messageText;
+
@Excel(name = "热心居民申请行为记录表Id (resi_warmhearted_visit.id)")
private String resiWarmVisitId;
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java
index 87fb3ffd31..0fba6e16ff 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java
@@ -22,9 +22,9 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
-import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
-import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
-import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
+import com.epmet.resi.partymember.dto.warmhearted.form.*;
+import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
+import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
import java.util.List;
@@ -117,11 +117,45 @@ public interface ResiWarmheartedApplyService extends BaseService> audited(ResiWarmheartedAuditedFromDTO formDTO);
+
+ /**
+ * 政府端-获取待审核的热心居民申请列表
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ Result> auditing(ResiWarmAuditFormDTO formDTO);
+
+ /**
+ * 政府端-热心居民申请-审核通过
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ Result approve(ResiWarmAuditApproveFormDTO formDTO);
+
+ /**
+ * 政府端-热心居民申请-审核驳回
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ Result reject(ResiWarmAuditRejectFormDTO formDTO);
+
+ /**
+ * 政府端-热心居民申请详情信息
*
* @param
* @return void
* @author sun
*/
- Result manageAudit(ResiWarmheartedAuditFormDTO formDTO);
+ Result getDetail(ResiWarmGetDetailFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java
index cae8a76100..b78ffa53eb 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java
@@ -19,7 +19,6 @@ package com.epmet.modules.warmhearted.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
@@ -31,11 +30,18 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.PartyMemberConstant;
+import com.epmet.constant.ReadFlagConstant;
+import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.UserRoleDTO;
+import com.epmet.dto.form.CustomerGridFormDTO;
+import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
+import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
+import com.epmet.modules.feign.EpmetMessageFeignClient;
import com.epmet.modules.feign.EpmetUserFeignClient;
-import com.epmet.modules.utils.ModuleConstant;
+import com.epmet.modules.feign.GovOrgFeignClient;
+import com.epmet.modules.warmhearted.constant.ResiWarmUserMessageConstant;
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant;
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao;
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity;
@@ -43,22 +49,22 @@ import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis;
import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService;
import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService;
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO;
-import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditFormDTO;
-import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO;
-import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO;
+import com.epmet.resi.partymember.dto.warmhearted.form.*;
+import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO;
+import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedAuditedResultDTO;
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO;
import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Date;
import java.util.List;
import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.stream.Collectors;
/**
* 热心居民申请表
@@ -69,174 +75,391 @@ import org.slf4j.LoggerFactory;
@Service
public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl implements ResiWarmheartedApplyService {
- private static final Logger logger = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class);
- @Autowired
- private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis;
- @Autowired
- private ResiWarmheartedVisitService resiWarmheartedVisitService;
- @Autowired
- private ResiWarmheartedApplyDao resiWarmheartedApplyDao;
- @Autowired
- private EpmetUserFeignClient epmetUserFeignClient;
-
- @Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
- );
- return getPageData(page, ResiWarmheartedApplyDTO.class);
- }
-
- @Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
-
- return ConvertUtils.sourceToTarget(entityList, ResiWarmheartedApplyDTO.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 ResiWarmheartedApplyDTO get(String id) {
- ResiWarmheartedApplyEntity entity = baseDao.selectById(id);
- return ConvertUtils.sourceToTarget(entity, ResiWarmheartedApplyDTO.class);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void save(ResiWarmheartedApplyDTO dto) {
- ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class);
- insert(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void update(ResiWarmheartedApplyDTO dto) {
- ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.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 Result init(ResiWarmheartedFormDTO formDTO) {
- Result result = new Result();
- //0:先判断该用户是否是已注册居民
- UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
- userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId());
- userResiInfoFormDTO.setUserId(formDTO.getUserId());
- Result result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO);
- if (!result1.success() || null == result1.getData()) {
- result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
- result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
- return result;
- }
- //1:热心居民申请行为记录表新增数据
- result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO);
- if (!result.success()) {
- logger.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION);
- }
- ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData();
- //2:查询是否已申请热心居民(不查询审核未通过的)
- formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
- ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO);
- if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) {
- //是否已申请热心居民 0:否, 1:是
- resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR);
- } else {
- resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR);
- result.setCode(NumConstant.ZERO);
- result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_INIT);
- }
- return result.ok(resiWarmheartedResultDTO);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Result submit(ResiWarmheartedSubmitFormDTO formDTO) {
- Result result = new Result();
- //0:为防止前台点击多次提交 先查询一下是否有已提交数据
- ResiWarmheartedFormDTO ResiWarmheartedFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiWarmheartedFormDTO.class);
- ResiWarmheartedFormDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
- ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(ResiWarmheartedFormDTO);
- if (null != resiWarmheartedApplyDTO) {
- logger.error(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
- throw new RenException(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
- }else{
- //1:将申请记录存入热心居民申请表中
- saveResiWarmApply(formDTO);
- //2:将最后一次操作行为更新到热心居民申请行为记录表中
- resiWarmheartedVisitService.updateResiWarmVisit(formDTO);
- result.setCode(NumConstant.ZERO);
- result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_SUBMIT);
- }
- return result;
- }
-
- /**
- * 热心居民申请表新增数据
- *
- * @param formDTO
- * @return
- */
- public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) {
- ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
- entity.setCustomerId(formDTO.getCustomerId());
- entity.setGridId(formDTO.getGridId());
- entity.setUserId(formDTO.getUserId());
- entity.setReason(formDTO.getReason());
- entity.setResiWarmVisitId(formDTO.getResiWarmVisitId());
- entity.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING);
- baseDao.insert(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public Result manageAudit(ResiWarmheartedAuditFormDTO formDTO) {
- Result result = new Result();
- //1:更新热心居民申请表数据
- ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
- entity.setId(formDTO.getResiWarmApplyId());
- if (NumConstant.ZERO_STR.equals(formDTO.getAuditStatus())) {
- //审核状态-未通过
- entity.setAuditStatus(PartyMemberConstant.REJECTED);
- } else {
- //审核状态-通过
- entity.setAuditStatus(PartyMemberConstant.APPROVED);
- }
- if (!StringUtils.isBlank(formDTO.getRefuseReason())) {
- entity.setRefuseReason(formDTO.getRefuseReason());
- }
- int num = baseDao.updateById(entity);
- //2:审核通过的添加热心居民的角色
- if (num > NumConstant.ZERO && NumConstant.ONE_STR.equals(formDTO.getAuditStatus())) {
- //查询需要添加热心居民角色的userId
- ResiWarmheartedApplyEntity resiWarmheartedApplyEntity = baseDao.selectById(formDTO.getResiWarmApplyId());
- UserRoleDTO dto = new UserRoleDTO();
- dto.setCustomerId(formDTO.getCustomerId());
- dto.setUserId(resiWarmheartedApplyEntity.getUserId());
- //所属端-居民端
- dto.setApp(AppClientConstant.APP_RESI);
- //角色-热心居民
- dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED);
- //角色表新增网格Id
- dto.setGridId(resiWarmheartedApplyEntity.getGridId());
- result = epmetUserFeignClient.saveUserRole(dto);
+ private static final Logger logger = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class);
+ @Autowired
+ private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis;
+ @Autowired
+ private ResiWarmheartedVisitService resiWarmheartedVisitService;
+ @Autowired
+ private ResiWarmheartedApplyDao resiWarmheartedApplyDao;
+ @Autowired
+ private EpmetUserFeignClient epmetUserFeignClient;
+ @Autowired
+ private EpmetMessageFeignClient epmetMessageFeignClient;
+ @Autowired
+ private GovOrgFeignClient govOrgFeignClient;
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, ResiWarmheartedApplyDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, ResiWarmheartedApplyDTO.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 ResiWarmheartedApplyDTO get(String id) {
+ ResiWarmheartedApplyEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, ResiWarmheartedApplyDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(ResiWarmheartedApplyDTO dto) {
+ ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(ResiWarmheartedApplyDTO dto) {
+ ResiWarmheartedApplyEntity entity = ConvertUtils.sourceToTarget(dto, ResiWarmheartedApplyEntity.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 Result init(ResiWarmheartedFormDTO formDTO) {
+ Result result = new Result();
+ //0:先判断该用户是否是已注册居民
+ UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
+ userResiInfoFormDTO.setCustomerId(formDTO.getCustomerId());
+ userResiInfoFormDTO.setUserId(formDTO.getUserId());
+ Result result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO);
+ if (!result1.success() || null == result1.getData()) {
+ result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode());
+ result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg());
+ return result;
+ }
+ //1:热心居民申请行为记录表新增数据
+ result = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO);
+ if (!result.success()) {
+ logger.error(ResiWarmheartedVisitConstant.OPERATION_EXCEPTION);
+ }
+ ResiWarmheartedResultDTO resiWarmheartedResultDTO = result.getData();
+ //2:查询是否已申请热心居民(不查询审核未通过的)
+ formDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
+ ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(formDTO);
+ if (null == resiWarmheartedApplyDTO || StringUtils.isEmpty(resiWarmheartedApplyDTO.getId())) {
+ //是否已申请热心居民 0:否, 1:是
+ resiWarmheartedResultDTO.setIsApplied(NumConstant.ZERO_STR);
+ } else {
+ resiWarmheartedResultDTO.setIsApplied(NumConstant.ONE_STR);
+ result.setCode(NumConstant.ZERO);
+ result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_INIT);
+ }
+ return result.ok(resiWarmheartedResultDTO);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result submit(ResiWarmheartedSubmitFormDTO formDTO) {
+ Result result = new Result();
+ //0:为防止前台点击多次提交 先查询一下是否有已提交数据
+ ResiWarmheartedFormDTO ResiWarmheartedFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiWarmheartedFormDTO.class);
+ ResiWarmheartedFormDTO.setAuditStatus(ResiWarmheartedVisitConstant.REJECTED);
+ ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = resiWarmheartedApplyDao.selectResiWarmheartedApply(ResiWarmheartedFormDTO);
+ if (null != resiWarmheartedApplyDTO) {
+ logger.error(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
+ throw new RenException(ResiWarmheartedVisitConstant.REPEAT_EXCEPTION);
+ } else {
+ //0:调用user服务获取申请人的基本信息
+ UserResiInfoFormDTO resiInfoParam = new UserResiInfoFormDTO();
+ resiInfoParam.setCustomerId(formDTO.getCustomerId());
+ resiInfoParam.setUserId(formDTO.getUserId());
+ Result resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(resiInfoParam);
+ if (!resultUserInfo.success() || null == resultUserInfo.getData()) {
+ throw new RenException(ResiWarmheartedVisitConstant.SELECT_USERINFO_EXCEPTION);
+ }
+ String showName = resultUserInfo.getData().getShowName();
+ String messageContent = String.format(ResiWarmUserMessageConstant.RESIWARM_APPLY_MSG, showName);
+ formDTO.setMessageText(messageContent);
+ //1:将申请记录存入热心居民申请表中
+ saveResiWarmApply(formDTO);
+ //2:将最后一次操作行为更新到热心居民申请行为记录表中
+ resiWarmheartedVisitService.updateResiWarmVisit(formDTO);
+ //3:添加消息信息,给网格长发消息
+ saveResiWarmUserMessage(formDTO);
+ result.setCode(NumConstant.ZERO);
+ result.setMsg(ResiWarmheartedVisitConstant.RESI_WARM_SUBMIT);
+ }
+ return result;
+ }
+ /**
+ * 热心居民申请表新增数据
+ *
+ * @param formDTO
+ * @return
+ */
+ public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) {
+ ResiWarmheartedApplyEntity entity = new ResiWarmheartedApplyEntity();
+ entity.setCustomerId(formDTO.getCustomerId());
+ entity.setGridId(formDTO.getGridId());
+ entity.setUserId(formDTO.getUserId());
+ entity.setReason(formDTO.getReason());
+ entity.setResiWarmVisitId(formDTO.getResiWarmVisitId());
+ entity.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING);
+ entity.setReadFlag(ResiWarmheartedVisitConstant.UN_READ);
+ entity.setMessageText(formDTO.getMessageText());
+ baseDao.insert(entity);
+ }
+ /**
+ * 热心居民申请像网格长发送消息
+ *
+ * @param formDTO
+ * @return
+ * @Author sun
+ */
+ private void saveResiWarmUserMessage(ResiWarmheartedSubmitFormDTO formDTO) {
+ UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
+ userMessageFormDTO.setCustomerId(formDTO.getCustomerId());
+ userMessageFormDTO.setGridId(formDTO.getGridId());
+ //网格长用户Id TODO
+ //userMessageFormDTO.setUserId();
+ userMessageFormDTO.setUserId(formDTO.getUserId());//先在token中取一个默认值
+ userMessageFormDTO.setApp(formDTO.getApp());
+ userMessageFormDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE);
+ userMessageFormDTO.setMessageContent(formDTO.getMessageText());
+ userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
+ //保存消息
+ epmetMessageFeignClient.saveUserMessage(userMessageFormDTO);
+ }
+
+ @Override
+ public Result> audited(ResiWarmheartedAuditedFromDTO formDTO) {
+ Result> result = new Result<>();
+ List resultList = new ArrayList<>();
+ //查询条件
+ int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
+ formDTO.setPageNo(pageIndex);
+ //获取审核列表
+ List applyList = baseDao.selectAuditedApplyList(formDTO);
+ if (null == applyList || applyList.size() == 0) {
+ return result.ok(resultList);
+ }
+ //提取所有userID
+ List userIds =
+ applyList.stream().map(ResiWarmheartedApplyEntity::getUserId).collect(Collectors.toList());
+ //获取用户昵称,头像
+ UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO();
+ userResiInfoListFormDTO.setUserIdList(userIds);
+ List userResiInfoList =
+ epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO).getData();
+ if (null == userResiInfoList || userResiInfoList.size() == 0) {
+ return result.ok(resultList);
}
- return result;
- }
+ resultList = applyList.stream().flatMap(apply -> userResiInfoList.stream().filter(user ->
+ apply.getUserId().equals(user.getUserId())).map(userInfo -> {
+ ResiWarmheartedAuditedResultDTO resultDTO = new ResiWarmheartedAuditedResultDTO();
+ resultDTO.setApplyId(apply.getId());
+ resultDTO.setUserId(apply.getUserId());
+ resultDTO.setStatus(apply.getAuditStatus());
+ resultDTO.setApplyTime(apply.getUpdatedTime());
+ resultDTO.setMessageText(apply.getMessageText());
+ resultDTO.setUserNickName(userInfo.getShowName());
+ resultDTO.setUserHeadPhoto(userInfo.getHeadPhoto());
+ return resultDTO;
+ })).collect(Collectors.toList());
+
+ return result.ok(resultList);
+ }
+
+ /**
+ * 政府端-获取待审核的热心居民申请列表
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ @Override
+ public Result> auditing(ResiWarmAuditFormDTO formDTO) {
+ Result> result = new Result<>();
+ List applyList = new ArrayList<>();
+ //1:查询待审核状态的热心居民申请
+ formDTO.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING);
+ formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize());
+ applyList = baseDao.selectResiWarmAuditList(formDTO);
+ if (null == applyList || applyList.size() < NumConstant.ONE) {
+ return result.ok(applyList);
+ }
+ //2:调用epmet-user服务 获取用户头像 昵称
+ //遍历获取所有的userId
+ List userIds = applyList.stream().map(ResiWarmAuditResultDTO::getUserId).collect(Collectors.toList());
+ //获取所有用户的头像 昵称
+ UserResiInfoListFormDTO userResiInfoListFormDTO = new UserResiInfoListFormDTO();
+ userResiInfoListFormDTO.setUserIdList(userIds);
+ List userResiInfoList = epmetUserFeignClient.getUserResiInfoList(userResiInfoListFormDTO).getData();
+ if (null == userResiInfoList || userResiInfoList.size() < NumConstant.ONE) {
+ return result.ok(applyList);
+ }
+ //3:将每个用户的头像 昵称放到对应实体中返回给前台
+ List resultList = applyList.stream().flatMap(apply -> userResiInfoList.stream().filter(user ->
+ apply.getUserId().equals(user.getUserId())).map(userInfo -> {
+ ResiWarmAuditResultDTO resultDTO = ConvertUtils.sourceToTarget(apply, ResiWarmAuditResultDTO.class);
+ resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName());
+ resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto());
+ return resultDTO;
+ })).collect(Collectors.toList());
+
+ return result.ok(resultList);
+ }
+
+ /**
+ * 政府端-热心居民申请-审核通过
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result approve(ResiWarmAuditApproveFormDTO formDTO) {
+ Result result = new Result();
+ //0:先校验数据是否是未审核状态,防止接口测试调用多次
+ ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId());
+ if (null == entity || !ResiWarmheartedVisitConstant.UNDER_AUDITTING.equals(entity.getAuditStatus())) {
+ result.error(ResiWarmheartedVisitConstant.AUDIT_EXCEPTION);
+ return result;
+ }
+ //1:更新热心居民申请表数据
+ //审核状态-通过
+ entity.setAuditStatus(PartyMemberConstant.APPROVED);
+ int num = baseDao.updateById(entity);
+ //2:审核通过的添加热心居民的角色
+ if (num < NumConstant.ONE) {
+ result.error(ResiWarmheartedVisitConstant.UPDATE_EXCEPTION);
+ return result;
+ }
+ //查询需要添加热心居民角色的userId
+ UserRoleDTO dto = new UserRoleDTO();
+ dto.setCustomerId(entity.getCustomerId());
+ dto.setUserId(entity.getUserId());
+ //所属端-居民端
+ dto.setApp(AppClientConstant.APP_RESI);
+ //角色-热心居民
+ dto.setRoleKey(EpmetRoleKeyConstant.WARMHEARTED);
+ //角色表新增网格Id
+ dto.setGridId(entity.getGridId());
+ result = epmetUserFeignClient.saveUserRole(dto);
+ //3:为申请人发送审核通过消息提示
+ result = auditMessage(entity, ResiWarmUserMessageConstant.AUDIT_APPROVE_MSG);
+ return result;
+ }
+ /**
+ * 热心居民申请审核通过向申请人发送消息
+ * @Author sun
+ * @param formDTO
+ * @param userMsg 消息模板
+ */
+ private Result auditMessage(ResiWarmheartedApplyEntity formDTO, String userMsg) {
+ UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
+ userMessageFormDTO.setCustomerId(formDTO.getCustomerId());
+ userMessageFormDTO.setGridId(formDTO.getGridId());
+ userMessageFormDTO.setUserId(formDTO.getUserId());
+ userMessageFormDTO.setApp(AppClientConstant.APP_RESI);
+ userMessageFormDTO.setTitle(ResiWarmUserMessageConstant.GROUP_TITLE);
+ //调用gov-org服务查询网格信息
+ CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
+ customerGridFormDTO.setGridId(formDTO.getGridId());
+ Result result = govOrgFeignClient.getCustomerGridByGridId(customerGridFormDTO);
+ String gridName = null;
+ if (result.success() && null != result.getData()) {
+ gridName = result.getData().getGridName();
+ }
+ String messageContent = String.format(userMsg, gridName);
+ userMessageFormDTO.setMessageContent(messageContent);
+ userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ);
+ //保存消息
+ return epmetMessageFeignClient.saveUserMessage(userMessageFormDTO);
+ }
+ /**
+ * 政府端-热心居民申请-审核驳回
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public Result reject(ResiWarmAuditRejectFormDTO formDTO) {
+ Result result = new Result();
+ //0:先校验数据是否是未审核状态,防止接口测试调用多次
+ ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId());
+ if (null == entity || !ResiWarmheartedVisitConstant.UNDER_AUDITTING.equals(entity.getAuditStatus())) {
+ result.error(ResiWarmheartedVisitConstant.AUDIT_EXCEPTION);
+ return result;
+ }
+ //1:更新热心居民申请表数据
+ //审核状态-未通过
+ entity.setAuditStatus(PartyMemberConstant.REJECTED);
+ entity.setRefuseReason(formDTO.getRefuseReason());
+ baseDao.updateById(entity);
+ //2:为申请人发送审核驳回消息提示
+ //查询申请信息
+ auditMessage(entity, ResiWarmUserMessageConstant.AUDIT_REJECT_MSG);
+ return result;
+ }
+
+ /**
+ * 政府端-热心居民申请详情信息
+ *
+ * @param
+ * @return void
+ * @author sun
+ */
+ @Override
+ public Result getDetail(ResiWarmGetDetailFormDTO formDTO) {
+ Result result = new Result<>();
+ //1:根据申请Id查询热心居民申请审核详情
+ ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId());
+ if (null == entity) {
+ result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION);
+ return result;
+ }
+ //2:修改申请数据状态为已读
+ if(!ResiWarmheartedVisitConstant.READ.equals(entity.getReadFlag())){
+ entity.setReadFlag(ResiWarmheartedVisitConstant.READ);
+ baseDao.updateById(entity);
+ }
+ //3:调用epmet-user服务查询用户头像 昵称信息
+ UserResiInfoFormDTO userResiInfoFormDTO = new UserResiInfoFormDTO();
+ userResiInfoFormDTO.setCustomerId(entity.getCustomerId());
+ userResiInfoFormDTO.setUserId(entity.getUserId());
+ Result resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO);
+ if (!resultUserInfo.success() || null == resultUserInfo.getData()) {
+ result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION);
+ return result;
+ }
+ UserResiInfoResultDTO userInfo = resultUserInfo.getData();
+ ResiWarmAuditResultDTO resultDTO = ConvertUtils.sourceToTarget(entity, ResiWarmAuditResultDTO.class);
+ resultDTO.setApplyTime(entity.getUpdatedTime());
+ resultDTO.setUserNickName(null == userInfo.getShowName() ? "" : userInfo.getShowName());
+ resultDTO.setUserHeadPhoto(null == userInfo.getHeadPhoto() ? "" : userInfo.getHeadPhoto());
+ resultDTO.setStreet(userInfo.getStreet());
+ return result.ok(resultDTO);
+ }
}
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml
index ba8099f0fb..7056d086e8 100644
--- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml
@@ -56,6 +56,48 @@
AND rw.audit_status != #{auditStatus}
+
+ SELECT
+ *
+ FROM
+ resi_warmhearted_apply
+ WHERE customer_id = #{customerId}
+ AND grid_id = #{gridId}
+ AND audit_status != 'under_auditting'
+ AND DEL_FLAG = 0
+ ORDER BY UPDATED_TIME DESC
+ LIMIT #{pageNo}, #{pageSize}
+
+
+ SELECT
+ id AS 'applyId',
+ customer_id AS 'customerId',
+ grid_id AS 'gridId',
+ user_id AS 'userId',
+ reason AS 'reason',
+ audit_status AS 'auditStatus',
+ refuse_reason AS 'refuseReason',
+ read_flag AS 'readFlag',
+ message_text AS 'messageText',
+ resi_warm_visit_id AS 'resiWarmVisitId',
+ created_time AS 'applyTime'
+ FROM resi_warmhearted_apply
+ WHERE del_flag = '0'
+
+ AND customer_id = #{customerId}
+
+
+ AND grid_id = #{gridId}
+
+
+ AND audit_status = #{auditStatus}
+
+ ORDER BY CREATED_TIME DESC
+ LIMIT #{pageNo}, #{pageSize}
+
\ No newline at end of file
diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql
new file mode 100644
index 0000000000..a60097daac
--- /dev/null
+++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/redis/migration/db.sql
@@ -0,0 +1,5 @@
+#epmet_resi_partymember数据库-热心居民申请表新增字段
+ALTER TABLE resi_warmhearted_apply ADD (
+ READ_FLAG VARCHAR (255) DEFAULT NULL COMMENT '审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点)',
+ MESSAGE_TEXT VARCHAR (500) DEFAULT NULL COMMENT '消息通知内容'
+);
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
index 3defd336ac..e2f315d22f 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java
@@ -172,6 +172,7 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>();
wrapper.eq(UserCustomerConstant.CUSTOMER_ID,enterGridFormDTO.getCustomerId());
wrapper.eq(UserCustomerConstant.USER_ID,enterGridFormDTO.getUserId());
+ wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
//1.查找用户注册关系表,如果没有表示当前用户为陌生人(拉取用户微信表信息),如果有表示当前用户已经进行居民认证