Browse Source

Merge branch 'dev0.2' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev0.2

master
sunyuchao 5 years ago
parent
commit
910df3121a
  1. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java
  3. 8
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java
  4. 65
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupInfoRedisDTO.java
  5. 52
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupStatisticalInfoRedisDTO.java
  6. 48
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java
  7. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/ApplyJoinGroupFormDTO.java
  8. 4
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java
  9. 5
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java
  10. 4
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java
  11. 49
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java
  12. 73
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java
  13. 17
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java
  14. 5
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberConfirmAutoDTO.java
  15. 14
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java
  16. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java
  17. 1
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java
  18. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmAutoService.java
  19. 116
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmManualService.java
  20. 54
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  21. 41
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java
  22. 120
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmAutoServiceImpl.java
  23. 8
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java
  24. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml
  25. 1
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -12,10 +12,10 @@ public enum EpmetErrorCode {
ALREADY_APPLIED_GROUP(8004,"该群已申请过,请耐心等待审核"),
LOSE_EFFICACY(8006,"此邀请链接已过期"),
MOBILE_HAS_BEEN_USED(8101, "该手机已被使用,请更换手机或使用原绑定的微信用户登录"),
MOBILE_CODE_ERROR(8102, "手机验证码错误"),
AUTO_CONFIRM_FAILED(8103, "自动认证失败"),
MOBILE_GET_CODE_ERROR(8104,"获取手机验证码失败"),
MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"),
MOBILE_CODE_ERROR(8102, "验证码错误"),
AUTO_CONFIRM_FAILED(8103, "党员注册失败"),
MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"),
MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"),
CANNOT_AUDIT_WARM(8201, "未注册居民不能申请热心居民,请先完善居民注册。"),

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java

@ -56,7 +56,7 @@ public interface TopicConstant {
/**
* 构造queryWrapper 创建日期列名
* */
String CREATED_DATE = "CREATED_TIME";
String CREATED_TIME = "CREATED_TIME";
/**
* 构造queryWrapper 小组Id

8
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/comment/result/ResiCommentResultDTO.java

@ -1,10 +1,10 @@
package com.epmet.resi.group.dto.comment.result;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
@ -43,10 +43,10 @@ public class ResiCommentResultDTO implements Serializable {
private String userId;
/**
* 评论时间 yyyy-MM-dd HH:mm:ss
* 评论时间 yyyy-MM-dd HH:mm
* */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private String commentTime;
@JSONField(format="yyyy-MM-dd HH:mm")
private Date commentTime;
/**
* 评论状态

65
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupInfoRedisDTO.java

@ -0,0 +1,65 @@
package com.epmet.resi.group.dto.group;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 组信息缓存对象
* @ClassName ResiGroupInfoRedisDTO
* @Author wangc
* @date 2020.04.11 09:51
*/
@Data
public class ResiGroupInfoRedisDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 小组Id
* */
private String groupId;
/**
* 用户头像
* */
private String groupHeadPhoto;
/**
* 组名称
* */
private String groupName;
/**
* 组介绍
* */
private String groupIntroduction;
/**
* 客户Id
* */
private String customerId;
/**
* 网格Id
* */
private String gridId;
/**
* 组状态
* */
private String groupState;
/**
* 最新话题发布时间
* */
private String latestTopicPublishDate;
/**
* 组统计嘻嘻你系
* */
private ResiGroupStatisticalInfoRedisDTO groupStatisticalInfo;
}

52
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/ResiGroupStatisticalInfoRedisDTO.java

@ -0,0 +1,52 @@
package com.epmet.resi.group.dto.group;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 组数据统计信息缓存对象
* @ClassName ResiGroupStatisticalInfoRedisDTO
* @Author wangc
* @date 2020.04.11 10:58
*/
@Data
public class ResiGroupStatisticalInfoRedisDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 统计Id
* */
private String id;
/**
* 总成员数
* */
private Integer totalMembers;
/**
*总话题数
* */
private Integer totalTopics;
/**
* 总议题数
* */
private Integer totalIssues;
/**
* 党员总数
* */
private Integer totalPartyMembers;
/**
* 热心居民总数
* */
private Integer totalEarnestMembers ;
/**
* 注册居民总数
* */
private Integer totalNormalMembers;
}

48
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java

@ -0,0 +1,48 @@
package com.epmet.resi.group.dto.member;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 组成员信息缓存对象
* @ClassName ResiGroupMemberInfoRedisDTO
* @Author wangc
* @date 2020.04.11 09:52
*/
@Data
public class ResiGroupMemberInfoRedisDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 用户Id
* */
private String userId;
/**
* 用户头像
* */
private String userHeadPhoto;
/**
* 用户显示昵称
* */
private String userShowName;
/**
* 组长标识
* */
private String groupLeaderFlag;
/**
* 进群方式
* */
private String enterGroupType;
/**
* 成员状态
* */
private String memberStatus;
}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/ApplyJoinGroupFormDTO.java

@ -29,7 +29,7 @@ public class ApplyJoinGroupFormDTO implements Serializable {
/**
* 入群理由
*/
@NotBlank(message="入理由不能为空")
@NotBlank(message="入理由不能为空")
private String operateDes;
private String app;

4
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicDetailResultDTO.java

@ -1,7 +1,5 @@
package com.epmet.resi.group.dto.topic.result;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
@ -36,8 +34,6 @@ public class ResiTopicDetailResultDTO implements Serializable {
/**
* 发布时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private String releaseTime;
/**

5
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicInfoResultDTO.java

@ -1,10 +1,10 @@
package com.epmet.resi.group.dto.topic.result;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 查看历史话题返回对象
@ -41,8 +41,7 @@ public class ResiTopicInfoResultDTO implements Serializable{
* 发布时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private String releaseTime;
private Date releaseTime;
/**
* 话题内容

4
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java

@ -265,8 +265,8 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl<ResiGroupMemberD
formDTO.setUserIdList(userIdList);
Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult=epmetUserFeignClient.getUserResiInfoList(formDTO);
if(userResiInfoDTOListResult.success()){
for(UserResiInfoResultDTO userResiInfo:userResiInfoDTOListResult.getData()){
for (ApplyingMemberResultDTO memberInfo : list) {
for (ApplyingMemberResultDTO memberInfo : list) {
for(UserResiInfoResultDTO userResiInfo:userResiInfoDTOListResult.getData()){
if(memberInfo.getApplyUserId().equals(userResiInfo.getUserId())){
memberInfo.setApplyUserName(userResiInfo.getShowName());
memberInfo.setApplyUserHeadPhoto(userResiInfo.getHeadPhoto());

49
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java

@ -44,8 +44,9 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -73,6 +74,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
@Autowired
EpmetUserFeignClient epmetUserFeignClient;
private final Log logger = LogFactory.getLog(getClass());
@Override
public PageData<ResiTopicCommentDTO> page(Map<String, Object> params) {
IPage<ResiTopicCommentEntity> page = baseDao.selectPage(
@ -139,7 +142,8 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
//1.判断当前用户是否被禁言
ResiTopicDTO topic = resiTopicService.get(resiCommentFormDTO.getTopicId());
if(null == topic){
return new Result().error();
logger.warn(ModuleConstant.NO_SUCH_TOPIC);
return new Result().error(ModuleConstant.NO_SUCH_TOPIC);
}
ResiGroupMemberDTO resiGroupMemberDTO =
@ -148,19 +152,22 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
if(null != resiGroupMemberDTO){
if(MemberStateConstant.SILENT.equals(resiGroupMemberDTO.getStatus())){
//当前用户被禁言
logger.warn(ModuleConstant.SLIENT_MEMBER);
return new Result().error(ModuleConstant.SLIENT_MEMBER);
}else if(MemberStateConstant.REMOVED.equals(resiGroupMemberDTO.getStatus())){
//当前用户已被移出群
logger.warn(ModuleConstant.REMOVED_MEMBER);
return new Result().error(ModuleConstant.REMOVED_MEMBER);
}
}else{
//当前用户非组内成员
logger.warn(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
return new Result().error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
}
if(resiCommentFormDTO.getCommentContent().length() > TopicConstant.MAX_NUMBER_OF_COMMENT){
logger.warn(ModuleConstant.COMMENT_NUMBER_OF_WORDS_EXCEEDED);
return new Result().error(ModuleConstant.COMMENT_NUMBER_OF_WORDS_EXCEEDED);
}
ResiTopicCommentEntity comment = ConvertUtils.sourceToTarget(resiCommentFormDTO,ResiTopicCommentEntity.class);
@ -186,25 +193,27 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl<ResiTopicCommen
if (null != comments && comments.size() > 0) {
List<String> userIdList = new ArrayList<>();
for (ResiCommentResultDTO comment : comments) {
userIdList.add(comment.getUserId());
}
UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO();
formDTO.setUserIdList(userIdList);
Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult = epmetUserFeignClient.getUserResiInfoList(formDTO);
if (userResiInfoDTOListResult.success() && null != userResiInfoDTOListResult.getData()) {
if (userResiInfoDTOListResult.getData().size() > 0) {
for (UserResiInfoResultDTO resiUser : userResiInfoDTOListResult.getData()) {
for (ResiCommentResultDTO comment : comments) {
if (StringUtils.equals(comment.getUserId(), resiUser.getUserId())) {
comment.setCommentUserHeadPhoto(resiUser.getHeadPhoto());
comment.setCommentUserName(resiUser.getShowName());
continue;
}
}
for (ResiCommentResultDTO comment : comments) {
userIdList.add(comment.getUserId());
}
UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO();
formDTO.setUserIdList(userIdList);
Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult = epmetUserFeignClient.getUserResiInfoList(formDTO);
if (userResiInfoDTOListResult.success() && null != userResiInfoDTOListResult.getData()) {
if (userResiInfoDTOListResult.getData().size() > 0) {
for (UserResiInfoResultDTO resiUser : userResiInfoDTOListResult.getData()) {
for (ResiCommentResultDTO comment : comments) {
if (StringUtils.equals(comment.getUserId(), resiUser.getUserId())) {
comment.setCommentUserHeadPhoto(resiUser.getHeadPhoto());
comment.setCommentUserName(resiUser.getShowName());
continue;
}
}
}
}
}
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
}
return new Result<List<ResiCommentResultDTO>>().ok(comments);

73
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.modules.topic.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;
@ -55,13 +56,15 @@ import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO;
import com.epmet.resi.group.dto.topic.ResiTopicDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicOperationFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPageFormDTO;
import com.epmet.resi.group.dto.topic.form.ResiTopicPublishFormDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.bouncycastle.math.raw.Mod;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -108,6 +111,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
@Autowired
private ResiTopicOperationService resiTopicOperationService;
private final Log logger = LogFactory.getLog(getClass());
@Override
public PageData<ResiTopicDTO> page(Map<String, Object> params) {
@ -198,6 +202,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
baseDao.insertOne(topic);
if(StringUtils.isBlank(topic.getId())){
//没有返回主键
logger.warn(ModuleConstant.NO_PRIMARY_KEY_RETURNED);
return new Result().error(ModuleConstant.NO_PRIMARY_KEY_RETURNED);
}
if(null != resiTopicPublishFormDTO.getAttachmentList() && resiTopicPublishFormDTO.getAttachmentList().size() > 0){
@ -207,7 +212,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
attachment.setAttachmentUrl(url);
attachment.setTopicId(topic.getId());
attachment.setCreatedBy(tokenDto.getUserId());
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + 1).toLowerCase());
attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase());
attachment.setSort(sort++);
resiTopicAttachmentDao.insertOne(attachment);
}
@ -227,6 +232,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
List<ResiGroupStatisticalEntity> statistical = resiGroupStatisticalDao.selectList(wrapper);
if(null != statistical && statistical.size() >= NumConstant.ONE){
if(statistical.size() != NumConstant.ONE){
logger.warn(ModuleConstant.GROUP_STASTICAL_NOT_SINGLE);
return new Result().error(ModuleConstant.GROUP_STASTICAL_NOT_SINGLE);
}else{
ResiGroupStatisticalEntity statistical2Update = new ResiGroupStatisticalEntity();
@ -237,6 +243,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resiGroupStatisticalDao.updateById(statistical2Update);
}
}else{
logger.warn(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO);
return new Result().error(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO);
}
@ -360,6 +367,20 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operationRecord.setCreatedBy(tokenDto.getUserId());
resiTopicOperationDao.insertOne(operationRecord);
// 4.组话题数量-1 (对应的在解除屏蔽时组话题数量+1)
QueryWrapper<ResiGroupStatisticalEntity> statisticalWrapper = new QueryWrapper<>();
statisticalWrapper.eq(TopicConstant.RESI_GROUP_ID,topic.getGroupId());
statisticalWrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
ResiGroupStatisticalEntity statistical = resiGroupStatisticalDao.selectOne(statisticalWrapper);
if(null != statistical && StringUtils.isNotBlank(statistical.getId()) && StringUtils.isNotBlank(statistical.getResiGroupId())){
ResiGroupStatisticalEntity statistical2Update = new ResiGroupStatisticalEntity();
statistical2Update.setId(statistical.getId());
statistical2Update.setTotalTopics(
null == statistical.getTotalTopics() || statistical.getTotalTopics() == 0 ? 0 : statistical.getTotalTopics() - NumConstant.ONE
);
resiGroupStatisticalDao.updateById(statistical2Update);
}
return new Result();
}
@ -399,6 +420,18 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
operation.setCreatedBy(tokenDto.getUserId());
resiTopicOperationDao.insertOne(operation);
}
QueryWrapper<ResiGroupStatisticalEntity> statisticalWrapper = new QueryWrapper<>();
statisticalWrapper.eq(TopicConstant.RESI_GROUP_ID,topic.getGroupId());
statisticalWrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR);
ResiGroupStatisticalEntity statistical = resiGroupStatisticalDao.selectOne(statisticalWrapper);
if(null != statistical && StringUtils.isNotBlank(statistical.getId())){
ResiGroupStatisticalEntity statistical2Update = new ResiGroupStatisticalEntity();
statistical2Update.setId(statistical.getId());
statistical2Update.setTotalTopics(
statistical.getTotalTopics() == null ? 0 : statistical.getTotalTopics() + topicIds.size()
);
resiGroupStatisticalDao.updateById(statistical2Update);
}
return new Result();
}
@ -450,14 +483,10 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
**/
@Override
public Result<ResiTopicDetailResultDTO> getTopicDetail(TokenDto tokenDto, String topicId) {
if(StringUtils.isBlank(topicId)){
return new Result<ResiTopicDetailResultDTO>().error();
}
//1.获取话题基本信息
ResiTopicEntity topicDetail = baseDao.selectById(topicId);
if(null == topicDetail || !StringUtils.equals(topicDetail.getId(),topicId)){
logger.warn(ModuleConstant.NO_SUCH_TOPIC);
return new Result().error(ModuleConstant.NO_SUCH_TOPIC);
}
ResiTopicDetailResultDTO resultDTO = new ResiTopicDetailResultDTO();
@ -491,7 +520,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
resultDTO.setReleaseUserHeadPhoto(userInfo.getData().getHeadPhoto());
}
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
@ -509,6 +539,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
**/
@Override
public Result<List<ResiTopicInfoResultDTO>> getHiddenTopics(TokenDto tokenDto, ResiTopicPageFormDTO topicPageFormDTO) {
//1.查询屏蔽话题列表
topicPageFormDTO.setUserId(tokenDto.getUserId());
topicPageFormDTO.setPageNo((topicPageFormDTO.getPageNo() - NumConstant.ONE) * topicPageFormDTO.getPageSize());
@ -518,7 +549,17 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
baseDao.getPastTopics(topicPageFormDTO);
//2.遍历用户信息
if (null != hiddenTopics && hiddenTopics.size() > 0) {
List<String> userIdList = new ArrayList<>();
for (ResiTopicInfoResultDTO topic : hiddenTopics) {
userIdList.add(topic.getUserId());
}
UserResiInfoListFormDTO formDTO = new UserResiInfoListFormDTO();
formDTO.setUserIdList(userIdList);
Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult = epmetUserFeignClient.getUserResiInfoList(formDTO);
setUserInfo(userResiInfoDTOListResult, hiddenTopics);
}
return new Result<List<ResiTopicInfoResultDTO>>().ok(hiddenTopics);
}
@ -534,15 +575,18 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
if(null != resiGroupMemberDTO){
if(MemberStateConstant.SILENT.equals(resiGroupMemberDTO.getStatus())){
//当前用户被禁言
logger.error(ModuleConstant.SLIENT_MEMBER);
return new Result().error(ModuleConstant.SLIENT_MEMBER);
}else if(MemberStateConstant.REMOVED.equals(resiGroupMemberDTO.getStatus())){
//当前用户已被移出群
logger.error(ModuleConstant.REMOVED_MEMBER);
return new Result().error(ModuleConstant.REMOVED_MEMBER);
}else{
return new Result();
}
}else{
//当前用户非组内成员
logger.error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
return new Result().error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
}
}
@ -561,6 +605,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
//1.2判断是否是组长
if(!StringUtils.equals(leaderVerify.getCustomerUserId(),userId)){
//非组长,无权限进行操作
logger.warn(ModuleConstant.NO_TEAMLEADER_AUTH);
return new Result().error(ModuleConstant.NO_TEAMLEADER_AUTH);
}else{
//是组长
@ -568,14 +613,24 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
}else{
//未找到当前用户的成员信息
logger.warn(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
return new Result().error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP);
}
}else{
//未能识别该话题基本信息
logger.warn(ModuleConstant.NO_SUCH_TOPIC);
return new Result().error(ModuleConstant.NO_SUCH_TOPIC);
}
}
/**
* @Description 将用户信息(头像昵称)遍历到返回的查询话题结果中 TODO 后期要改到缓存中
* @Param Result<List<UserResiInfoResultDTO>>
* @Param List<ResiTopicInfoResultDTO>
* @return void
* @Author wangc
* @Date 2020.04.10 17:47
**/
public void setUserInfo(Result<List<UserResiInfoResultDTO>> userResiInfoDTOListResult,List<ResiTopicInfoResultDTO> topics){
if(userResiInfoDTOListResult.success() && null != userResiInfoDTOListResult.getData()){
if(userResiInfoDTOListResult.getData().size() > 0){
@ -589,6 +644,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl<ResiTopicDao, ResiTopi
}
}
}
}else{
logger.warn(ModuleConstant.USER_INFO_LIST_NOT_FOUND);
}
}

17
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java

@ -71,7 +71,7 @@ public interface ModuleConstant extends Constant {
/**
* 当前用户并非该组组员
* */
String NOT_BELONG_TO_CURRENT_GROUP="当前用户并非该组员";
String NOT_BELONG_TO_CURRENT_GROUP="当前用户并非该组员";
/**
* 逻辑删除标识 未删除
@ -121,17 +121,17 @@ public interface ModuleConstant extends Constant {
/**
* 当前用户被禁言
* */
String SLIENT_MEMBER = "您已被禁言";
String SLIENT_MEMBER = "当前用户被禁言";
/**
* 当前用户被移出群
* */
String REMOVED_MEMBER = "您已被移除群";
String REMOVED_MEMBER = "当前用户被移出小组";
/**
* 当前用户不是组长
* */
String NO_TEAMLEADER_AUTH = "没有组长权限";
String NO_TEAMLEADER_AUTH = "当前用户没有组长权限";
/**
* 话题Id集合不能为空
@ -141,10 +141,15 @@ public interface ModuleConstant extends Constant {
/**
* 一个组找到多个统计信息
* */
String GROUP_STASTICAL_NOT_SINGLE = "一个组找到多个统计信息";
String GROUP_STASTICAL_NOT_SINGLE = "找到多个统计信息";
/**
* 未找到对应的小组统计信息
* */
String NO_SUCH_GROUP_STASTICAL_INFO = "未找到对应的小组统计信息";
String NO_SUCH_GROUP_STASTICAL_INFO = "未找到对应小组的统计信息";
/**
* 没有找到用户列表信息
* */
String USER_INFO_LIST_NOT_FOUND = "没有找到用户列表信息";
}

5
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberConfirmAutoDTO.java

@ -135,4 +135,9 @@ public class PartymemberConfirmAutoDTO implements Serializable {
*/
private Date updatedTime;
/**
* 比对结果
*/
private Boolean comparisonResults;
}

14
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java

@ -49,37 +49,37 @@ public interface PartyMemberConstant {
/**
* 比对结果相同
*/
Double EQUALS = 1.0;
Double EQUALS = 0.0;
/**
* 身份证比对结果大部分相同最低值
*/
Double ID_MOST = 0.88;
Double ID_MOST = 2.0;
/**
* 身份证比对结果小部分相同最低值
*/
Double ID_SMALL = 0.5;
Double ID_SMALL = 5.0;
/**
* 手机号比对结果大部分相同最低值
*/
Double MOBILE_MOST = 0.81;
Double MOBILE_MOST = 2.0;
/**
* 手机号比对结果小部分相同最低值
*/
Double MOBILE_SMALL = 0.5;
Double MOBILE_SMALL = 4.0;
/**
* 姓名比对结果大部分相同最低值
*/
Double NAME_MOST = 0.66;
Double NAME_MOST = 1.0;
/**
* 姓名比对结果小部分相同最低值
*/
Double NAME_SMALL = 0.5;
Double NAME_SMALL = 2.0;
/**
* 比对结果相同

2
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java

@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @dscription
* @date 2020/3/30 14:51
*/
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class,url="http://localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class)
public interface EpmetUserFeignClient {
/**

1
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java

@ -46,4 +46,5 @@ public interface PartyMemberConfirmService {
*/
Result partyMemberInfoExtra(PartymemberInfoDTO partyMemberInfoDTO);
}

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmAutoService.java

@ -93,4 +93,14 @@ public interface PartymemberConfirmAutoService extends BaseService<PartymemberCo
* @date 2020-03-30
*/
void delete(String[] ids);
/**
* 单条查询
*
* @param id
* @return PartymemberConfirmAutoDTO
* @author generator
* @date 2020-03-30
*/
PartymemberConfirmAutoDTO getInfoByPartyMemberInfoId(String id);
}

116
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmManualService.java

@ -33,63 +33,71 @@ import java.util.Map;
*/
public interface PartymemberConfirmManualService extends BaseService<PartymemberConfirmManualEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<PartymemberConfirmManualDTO>
* @author generator
* @date 2020-03-30
*/
PageData<PartymemberConfirmManualDTO> page(Map<String, Object> params);
/**
* 默认分页
*
* @param params
* @return PageData<PartymemberConfirmManualDTO>
* @author generator
* @date 2020-03-30
*/
PageData<PartymemberConfirmManualDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PartymemberConfirmManualDTO>
* @author generator
* @date 2020-03-30
*/
List<PartymemberConfirmManualDTO> list(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<PartymemberConfirmManualDTO>
* @author generator
* @date 2020-03-30
*/
List<PartymemberConfirmManualDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return PartymemberConfirmManualDTO
* @author generator
* @date 2020-03-30
*/
PartymemberConfirmManualDTO get(String id);
/**
* 单条查询
*
* @param id
* @return PartymemberConfirmManualDTO
* @author generator
* @date 2020-03-30
*/
PartymemberConfirmManualDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-03-30
*/
void save(PartymemberConfirmManualDTO dto);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-03-30
*/
void save(PartymemberConfirmManualDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-03-30
*/
void update(PartymemberConfirmManualDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-03-30
*/
void update(PartymemberConfirmManualDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-03-30
*/
void delete(String[] ids);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-03-30
*/
void delete(String[] ids);
/**
* 单条查询
*
* @param partymemberInfoId
* @return
*/
PartymemberConfirmManualDTO getInfoByPartyMemberInfoId(String partymemberInfoId);
}

54
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -18,6 +18,7 @@ import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO;
import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO;
import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -81,8 +82,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
userResiInfoFormDTO.setUserId(fromDto.getUserId());
UserResiInfoResultDTO userResiInfoResult = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO).getData();
if (null != userResiInfoResult) {
PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult,
PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult,
PartymemberInfoDTO.class);
partyMemberInfo.setId("");
partyMemberInfo.setMobile(userResiInfoResult.getRegMobile());
partyMemberInfo.setEstate(userResiInfoResult.getDistrict());
partyMemberInfo.setBuilding(userResiInfoResult.getBuildingAddress());
@ -115,7 +117,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
//生成短信验证码
Map<String, String> message = (Map<String, String>) messageFeignClient.sendSmsCaptcha(fromDTO.getMobile()).getData();
if(null == message) {
if (null == message) {
result.setCode(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode());
result.setMsg(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getMsg());
return result;
@ -157,13 +159,18 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO,
PartymemberInfoEntity.class);
if (confirmAutoDTO == null || confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0) {
if (confirmAutoDTO == null || (confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0 && !confirmAutoDTO.getComparisonResults())) {
//将访问记录更新到热心居民申请行为记录表
saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_FAILED);
//自动认证失败
partyMemberInfoEntity.setConfirmResult("1");
partymemberInfoService.insert(partyMemberInfoEntity);
if (partyMemberInfoEntity.getId().isEmpty()) {
partymemberInfoService.insert(partyMemberInfoEntity);
} else {
partymemberInfoService.updateById(partyMemberInfoEntity);
}
result.setCode(EpmetErrorCode.AUTO_CONFIRM_FAILED.getCode());
result.setMsg(EpmetErrorCode.AUTO_CONFIRM_FAILED.getMsg());
@ -173,7 +180,11 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
//自动认证成功
partyMemberInfoEntity.setConfirmResult("0");
partymemberInfoService.insert(partyMemberInfoEntity);
if (partyMemberInfoEntity.getId().isEmpty()) {
partymemberInfoService.insert(partyMemberInfoEntity);
} else {
partymemberInfoService.updateById(partyMemberInfoEntity);
}
//添加用户党员角色关系
UserRoleDTO userRole = new UserRoleDTO();
@ -188,9 +199,17 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
//将自动认证结果存入党员认证自动审核表
if (confirmAutoDTO != null) {
PartymemberConfirmAutoDTO partymemberConfirmAutoDTO =
partymemberConfirmAutoService.getInfoByPartyMemberInfoId(partyMemberInfoEntity.getPartymemberVisitId());
confirmAutoDTO.setPartymemberInfoId(partyMemberInfoEntity.getPartymemberVisitId());
partymemberConfirmAutoService.insert(ConvertUtils.sourceToTarget(confirmAutoDTO,
PartymemberConfirmAutoEntity.class));
if (null == partymemberConfirmAutoDTO) {
partymemberConfirmAutoService.insert(ConvertUtils.sourceToTarget(confirmAutoDTO,
PartymemberConfirmAutoEntity.class));
} else {
confirmAutoDTO.setId(partymemberConfirmAutoDTO.getId());
partymemberConfirmAutoService.updateById(ConvertUtils.sourceToTarget(confirmAutoDTO,
PartymemberConfirmAutoEntity.class));
}
}
//判断是否已注册居民,如果没有则注册居民
@ -209,15 +228,20 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
PartymemberInfoDTO partyMemberInfo = partymemberInfoService.getPartyMemberInfo(infoDTO);
infoDTO.setId(partyMemberInfo.getId());
partymemberInfoService.updateById(ConvertUtils.sourceToTarget(infoDTO, PartymemberInfoEntity.class));
PartymemberConfirmManualDTO partymemberConfirmManualDTO =
partymemberConfirmManualService.getInfoByPartyMemberInfoId(partyMemberInfo.getId());
if (null == partymemberConfirmManualDTO) {
//待审核数据存入党员认证人工审核表
PartymemberConfirmManualEntity manualEntity = new PartymemberConfirmManualEntity();
manualEntity.setCustomerId(infoDTO.getCustomerId());
manualEntity.setGridId(infoDTO.getGridId());
manualEntity.setUserId(infoDTO.getUserId());
manualEntity.setPartymemberInfoId(infoDTO.getId());
manualEntity.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING);
partymemberConfirmManualService.insert(manualEntity);
}
//待审核数据存入党员认证人工审核表
PartymemberConfirmManualEntity manualEntity = new PartymemberConfirmManualEntity();
manualEntity.setCustomerId(infoDTO.getCustomerId());
manualEntity.setGridId(infoDTO.getGridId());
manualEntity.setUserId(infoDTO.getUserId());
manualEntity.setPartymemberInfoId(infoDTO.getId());
manualEntity.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING);
partymemberConfirmManualService.insert(manualEntity);
return new Result();
}

41
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java

@ -31,7 +31,7 @@ import com.epmet.modules.partymember.service.PartymemberBaseInfoService;
import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO;
import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO;
import info.debatty.java.stringsimilarity.JaroWinkler;
import info.debatty.java.stringsimilarity.Levenshtein;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
@ -129,7 +129,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
idCardList.stream().filter(baseInfo -> baseInfo.getMobile().equals(partyMemberInfo.getMobile())).findFirst();
if (matchingResult.isPresent()) {
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo);
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
return confirmAutoDTO;
}
@ -137,7 +137,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
matchingResult = idCardList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst();
if (matchingResult.isPresent()) {
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo);
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
return confirmAutoDTO;
}
@ -147,7 +147,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
} else {
//根据手机号匹配数据
List<PartymemberBaseInfoEntity> mobileList = baseDao.selectBaseInfoByIdCard(partyMemberInfo);
List<PartymemberBaseInfoEntity> mobileList = baseDao.selectBaseInfoByMobile(partyMemberInfo);
if (null != mobileList && mobileList.size() > 0) {
//判断手机号和姓名
@ -155,7 +155,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
mobileList.stream().filter(baseInfo -> baseInfo.getName().equals(name)).findFirst();
if (matchingResult.isPresent()) {
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo);
confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true);
return confirmAutoDTO;
}
@ -164,7 +164,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0));
} else {
//根据姓名匹配数据
List<PartymemberBaseInfoEntity> nameList = baseDao.selectBaseInfoByIdCard(partyMemberInfo);
List<PartymemberBaseInfoEntity> nameList = baseDao.selectBaseInfoByName(partyMemberInfo);
if (null != nameList && nameList.size() > 0) {
//获取匹配度最高的数据
@ -175,13 +175,20 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
nameList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0);
confirmAutoDTO = getResult(similar, partyMemberInfo);
confirmAutoDTO = getResult(similar, partyMemberInfo, false);
return confirmAutoDTO;
} else {
return null;
}
}
}
return null;
PartymemberBaseInfoEntity similar =
sortList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) ->
getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0);
return getResult(similar, partyMemberInfo, false);
}
@ -192,7 +199,8 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
* @param info 录入信息
* @return PartymemberConfirmAutoDTO
*/
private PartymemberConfirmAutoDTO getResult(PartymemberBaseInfoEntity baseInfo, PartymemberInfoDTO info) {
private PartymemberConfirmAutoDTO getResult(PartymemberBaseInfoEntity baseInfo, PartymemberInfoDTO info,
boolean comparisonResults) {
PartymemberConfirmAutoDTO confirmAutoDTO = new PartymemberConfirmAutoDTO();
confirmAutoDTO.setPatryMemberBaseInfoId(baseInfo.getId());
confirmAutoDTO.setBaseName(baseInfo.getName());
@ -200,8 +208,9 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
confirmAutoDTO.setBaseIdCard(baseInfo.getIdCard());
confirmAutoDTO.setInputIdCard(info.getIdCard());
confirmAutoDTO.setBaseMobile(baseInfo.getMobile());
confirmAutoDTO.setInputMobile(info.getIdCard());
confirmAutoDTO.setInputMobile(info.getMobile());
confirmAutoDTO.setContrastTime(new Date());
confirmAutoDTO.setComparisonResults(comparisonResults);
String result = getSimilarity(baseInfo, info);
//身份证比对结果
if (EQUAL.equals(result.substring(START, ID_CARD_COUNT))) {
@ -237,10 +246,10 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
String result = "";
JaroWinkler jw = new JaroWinkler();
double idCardResult = jw.similarity(baseInfo.getIdCard(), info.getIdCard());
double mobileResult = jw.similarity(baseInfo.getMobile(), info.getMobile());
double nameResult = jw.similarity(baseInfo.getName(), info.getSurname() + info.getName());
Levenshtein levenshtein = new Levenshtein();
double idCardResult = levenshtein.distance(baseInfo.getIdCard(), info.getIdCard());
double mobileResult = levenshtein.distance(baseInfo.getMobile(), info.getMobile());
double nameResult = levenshtein.distance(baseInfo.getName(), info.getSurname() + info.getName());
result = getString(result, idCardResult, PartyMemberConstant.ID_MOST, PartyMemberConstant.ID_SMALL);
result = getString(result, mobileResult, PartyMemberConstant.MOBILE_MOST, PartyMemberConstant.MOBILE_SMALL);
@ -255,9 +264,9 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl<PartymemberB
private String getString(String result, double comparisonResult, double most, double small) {
if (comparisonResult == PartyMemberConstant.EQUALS) {
result = result + "11";
} else if (comparisonResult > most) {
} else if (comparisonResult <= most) {
result = result + "10";
} else if (comparisonResult < small) {
} else if (comparisonResult >= small) {
result = result + "00";
} else {
result = result + "01";

120
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmAutoServiceImpl.java

@ -38,8 +38,8 @@ import java.util.List;
import java.util.Map;
/**
* 党员认证自动审核表
只有在根据三项比对在partymember_base_info表有查询到数据 并且有一项的比对结果是11的才会在自动审核表有记录
* 党员认证自动审核表
* 只有在根据三项比对在partymember_base_info表有查询到数据 并且有一项的比对结果是11的才会在自动审核表有记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
@ -47,59 +47,67 @@ import java.util.Map;
@Service
public class PartymemberConfirmAutoServiceImpl extends BaseServiceImpl<PartymemberConfirmAutoDao, PartymemberConfirmAutoEntity> implements PartymemberConfirmAutoService {
@Autowired
private PartymemberConfirmAutoRedis partymemberConfirmAutoRedis;
@Override
public PageData<PartymemberConfirmAutoDTO> page(Map<String, Object> params) {
IPage<PartymemberConfirmAutoEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PartymemberConfirmAutoDTO.class);
}
@Override
public List<PartymemberConfirmAutoDTO> list(Map<String, Object> params) {
List<PartymemberConfirmAutoEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PartymemberConfirmAutoDTO.class);
}
private QueryWrapper<PartymemberConfirmAutoEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartymemberConfirmAutoEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PartymemberConfirmAutoDTO get(String id) {
PartymemberConfirmAutoEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PartymemberConfirmAutoDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PartymemberConfirmAutoDTO dto) {
PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PartymemberConfirmAutoDTO dto) {
PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Autowired
private PartymemberConfirmAutoRedis partymemberConfirmAutoRedis;
@Override
public PageData<PartymemberConfirmAutoDTO> page(Map<String, Object> params) {
IPage<PartymemberConfirmAutoEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, PartymemberConfirmAutoDTO.class);
}
@Override
public List<PartymemberConfirmAutoDTO> list(Map<String, Object> params) {
List<PartymemberConfirmAutoEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, PartymemberConfirmAutoDTO.class);
}
private QueryWrapper<PartymemberConfirmAutoEntity> getWrapper(Map<String, Object> params) {
String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper<PartymemberConfirmAutoEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public PartymemberConfirmAutoDTO get(String id) {
PartymemberConfirmAutoEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, PartymemberConfirmAutoDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(PartymemberConfirmAutoDTO dto) {
PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(PartymemberConfirmAutoDTO dto) {
PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public PartymemberConfirmAutoDTO getInfoByPartyMemberInfoId(String partymemberInfoId) {
QueryWrapper<PartymemberConfirmAutoEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(partymemberInfoId), "PARTYMEMBER_INFO_ID", partymemberInfoId);
PartymemberConfirmAutoEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, PartymemberConfirmAutoDTO.class);
}
}

8
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java

@ -101,4 +101,12 @@ public class PartymemberConfirmManualServiceImpl extends BaseServiceImpl<Partyme
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public PartymemberConfirmManualDTO getInfoByPartyMemberInfoId(String partymemberInfoId) {
QueryWrapper<PartymemberConfirmManualEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(partymemberInfoId), "PARTYMEMBER_INFO_ID", partymemberInfoId);
PartymemberConfirmManualEntity entity = baseDao.selectOne(wrapper);
return ConvertUtils.sourceToTarget(entity, PartymemberConfirmManualDTO.class);
}
}

15
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml

@ -31,14 +31,17 @@
<select id="selectPartyMemberInfo" resultType="com.epmet.modules.partymember.entity.PartymemberInfoEntity"
parameterType="com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO">
SELECT
*
pi.*
FROM
epmet_resi_partymember.partymember_info
epmet_resi_partymember.partymember_info pi
LEFT JOIN epmet_resi_partymember.partymember_confirm_manual pcm ON pi.ID = pcm.PARTYMEMBER_INFO_ID
AND pcm.DEL_FLAG = 0
WHERE
CUSTOMER_ID = #{customerId}
AND GRID_ID = #{gridId}
AND USER_ID = #{userId}
AND DEL_FLAG = 0
pi.CUSTOMER_ID = #{customerId}
AND pi.GRID_ID = #{gridId}
AND pi.USER_ID = #{userId}
AND pi.DEL_FLAG = 0
AND ( pcm.AUDIT_STATUS = 'under_auditting' OR pi.ORGANIZATION_TYPE IS NULL )
</select>
<select id="selectPartyMemberInfoByMobile"
parameterType="com.epmet.modules.partymember.entity.PartymemberInfoEntity"

1
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -50,6 +50,7 @@
uri.STREET,
uri.DISTRICT,
uri.RESI_VISIT_ID,
uri.BUILDING_ADDRESS,
CONCAT(
uri.STREET,
'-',

Loading…
Cancel
Save