Browse Source

Merge branches 'dev' and 'dev_heart' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_heart

dev_shibei_match
yinzuomei 5 years ago
parent
commit
88c1cadb66
  1. 2
      epmet-gateway/deploy/docker-compose-dev.yml
  2. 2
      epmet-gateway/pom.xml
  3. 2
      epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
  4. 2
      epmet-module/epmet-point/epmet-point-server/pom.xml
  5. 2
      epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml
  6. 2
      epmet-module/epmet-third/epmet-third-server/pom.xml
  7. 13
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserServiceImpl.java
  8. 4
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserVisitedServiceImpl.java
  9. 1
      epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxLoginServiceImpl.java
  10. 2
      epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml
  11. 2
      epmet-module/gov-org/gov-org-server/pom.xml
  12. 2
      epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/VerificationCodeFromDTO.java
  13. 2
      epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml
  14. 2
      epmet-module/resi-mine/resi-mine-server/pom.xml
  15. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml
  16. 2
      epmet-module/resi-partymember/resi-partymember-server/pom.xml
  17. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  18. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java
  19. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  20. 2
      epmet-user/epmet-user-server/pom.xml
  21. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java
  22. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserCustomerDao.java
  23. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java
  24. 31
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  25. 8
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.5__add_isRegister.sql
  26. 16
      epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml
  27. 8
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

2
epmet-gateway/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-gateway-server:
container_name: epmet-gateway-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.28
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.29
ports:
- "8080:8080"
network_mode: host # 使用现有网络

2
epmet-gateway/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.28</version>
<version>0.3.29</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

2
epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-point-server:
container_name: epmet-point-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.5
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.8
ports:
- "8112:8112"
network_mode: host # 使用现有网络

2
epmet-module/epmet-point/epmet-point-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.5</version>
<version>0.0.8</version>
<parent>
<artifactId>epmet-point</artifactId>
<groupId>com.epmet</groupId>

2
epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-third-server:
container_name: epmet-third-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.75
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.76
ports:
- "8110:8110"
network_mode: host # 使用现有网络

2
epmet-module/epmet-third/epmet-third-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.0.75</version>
<version>0.0.76</version>
<parent>
<groupId>com.epmet</groupId>

13
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserServiceImpl.java

@ -34,12 +34,14 @@ import com.epmet.dto.PaCustomerDTO;
import com.epmet.dto.PaUserDTO;
import com.epmet.dto.PaUserVisitedDTO;
import com.epmet.dto.PaUserWechatDTO;
import com.epmet.dto.form.SaveUserVisitedFormDTO;
import com.epmet.dto.result.CustomerUserResultDTO;
import com.epmet.dto.result.SaveUserResultDTO;
import com.epmet.entity.PaUserEntity;
import com.epmet.entity.PaUserWechatEntity;
import com.epmet.redis.PaUserRedis;
import com.epmet.service.PaUserService;
import com.epmet.service.PaUserVisitedService;
import com.epmet.service.PaUserWechatService;
import me.chanjar.weixin.mp.bean.result.WxMpUser;
import org.apache.commons.lang3.StringUtils;
@ -72,6 +74,8 @@ public class PaUserServiceImpl extends BaseServiceImpl<PaUserDao, PaUserEntity>
private PaUserWechatDao paUserWechatDao;
@Autowired
private PaUserVisitedDao paUserVisitedDao;
@Autowired
private PaUserVisitedService paUserVisitedService;
@Override
public PageData<PaUserDTO> page(Map<String, Object> params) {
@ -156,10 +160,15 @@ public class PaUserServiceImpl extends BaseServiceImpl<PaUserDao, PaUserEntity>
wechatEntity.setCity(null == wxMpUser.getCity() ? "" : wxMpUser.getCity());
wechatEntity.setLanguage(null == wxMpUser.getLanguage() ? "" : wxMpUser.getLanguage());
paUserWechatService.insert(wechatEntity);
//2.3、pa_user_visited表新增访问记录数据
SaveUserVisitedFormDTO visited = new SaveUserVisitedFormDTO();
visited.setUserId(userEntity.getId());
visited.setLogonUserId(userEntity.getId());
paUserVisitedService.saveUserVisited(visited);
resultDTO.setUserId(userEntity.getId());
} else {
//2.3、批量更新user_wechat表数据
//2.4、批量更新user_wechat表数据
List<PaUserWechatEntity> wechatEntity = ConvertUtils.sourceToTarget(wechatDTO, PaUserWechatEntity.class);
for(PaUserWechatEntity entity : wechatEntity){
entity.setGender(wxMpUser.getSex().toString());
@ -172,7 +181,7 @@ public class PaUserServiceImpl extends BaseServiceImpl<PaUserDao, PaUserEntity>
}
paUserWechatService.updateBatchById(wechatEntity);
//2.4、根据openid查询用户登陆访问记录表数据,按登陆时间倒序
//2.5、根据openid查询用户登陆访问记录表数据,按登陆时间倒序
PaUserVisitedDTO visitedDTO = paUserVisitedDao.selectByOpenId(wxMpUser.getOpenId());
if (null == visitedDTO || "".equals(visitedDTO.getUserId())) {
logger.error("根据openid查询用户访问记录表数据失败,openid->"+wxMpUser.getOpenId());

4
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserVisitedServiceImpl.java

@ -134,7 +134,9 @@ public class PaUserVisitedServiceImpl extends BaseServiceImpl<PaUserVisitedDao,
entity.setUserId(visited.getUserId());
entity.setWxOpenId(userEntity.getWxOpenId());
entity.setOpenId(openId);
entity.setPhone(visited.getPhone());
if (null != visited.getPhone()) {
entity.setPhone(visited.getPhone());
}
baseDao.insert(entity);
}

1
epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxLoginServiceImpl.java

@ -52,6 +52,7 @@ public class WxLoginServiceImpl implements WxLoginService {
HashMap<String, String> hashMap = JSON.parseObject(resultStr, HashMap.class);
if (null != hashMap.get("errcode")) {
logger.error("wxcode换取openid接口调用失败");
logger.error("对应参数:小程序appId->"+appId+"第三方component_appid->"+componentAppId+",第三方component_access_token->"+componentAccessToken);
throw new RenException(hashMap.get("errmsg"));
}
String openid = hashMap.get("openid");

2
epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-org-server:
container_name: gov-org-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.79
image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.80
ports:
- "8092:8092"
network_mode: host # 使用现有网络

2
epmet-module/gov-org/gov-org-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.79</version>
<version>0.3.80</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>gov-org</artifactId>

2
epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/VerificationCodeFromDTO.java

@ -32,7 +32,7 @@ public class VerificationCodeFromDTO implements Serializable {
private String mobile;
/**
* 行为记录表ID
* 行为记录表ID partymember_visit.id
*/
@NotBlank(message = "行为记录表ID不能为空")
private String visitId;

2
epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-mine-server:
container_name: resi-mine-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.30
image: 192.168.1.130:10080/epmet-cloud-dev/resi-mine-server:0.3.31
ports:
- "8094:8094"
network_mode: host # 使用现有网络

2
epmet-module/resi-mine/resi-mine-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.30</version>
<version>0.3.31</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>resi-mine</artifactId>

2
epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-partymember-server:
container_name: resi-partymember-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.55
image: 192.168.1.130:10080/epmet-cloud-dev/resi-partymember-server:0.3.57
ports:
- "8096:8096"
network_mode: host # 使用现有网络

2
epmet-module/resi-partymember/resi-partymember-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.55</version>
<version>0.3.57</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>resi-partymember</artifactId>

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

@ -445,7 +445,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
resultDTO.setMobile(partyMemberInfo.getMobile());
resultDTO.setAddress(partyMemberInfo.getStreet() + partyMemberInfo.getEstate() + partyMemberInfo.getBuilding());
List<String> failedReason = new ArrayList<>();
if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()) {
if (null != fromDTO.getAutoId() && !fromDTO.getAutoId().isEmpty()&& !("null").equals(fromDTO.getAutoId())) {
PartymemberConfirmAutoEntity autoEntity = partymemberConfirmAutoService.selectById(fromDTO.getAutoId());
resultDTO.setCertifyTime(autoEntity.getContrastTime().getTime());
if (PartyMemberConstant.SAME.equals(autoEntity.getMobileResult())) {
@ -560,6 +560,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
userResiInfoDTO.setResiVisitId(partyMemberInfoDTO.getPartymemberVisitId());
userResiInfoDTO.setDistrict(partyMemberInfoDTO.getEstate());
userResiInfoDTO.setBuildingAddress(partyMemberInfoDTO.getBuilding());
userResiInfoDTO.setCustomerId(partyMemberInfoDTO.getCustomerId());
epmetUserFeignClient.saveResiInfo(userResiInfoDTO);
}
}

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserResiInfoDTO.java

@ -17,9 +17,11 @@
package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -51,7 +53,8 @@ public class UserResiInfoDTO implements Serializable {
/**
* 手机号(注册手机号)
*/
private String regMobile;
@NotBlank(message = "手机号不能为空")
private String regMobile;
/**
* 姓氏
@ -121,6 +124,7 @@ public class UserResiInfoDTO implements Serializable {
/**
* 客户Id (customer.id)
*/
@NotBlank(message = "客户Id不能为空")
private String customerId;
/**

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.86
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.88
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.86</version>
<version>0.3.88</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

1
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java

@ -149,6 +149,7 @@ public class UserResiInfoController {
**/
@PostMapping("saveResiInfo")
public Result saveResiInfo (@RequestBody UserResiInfoDTO userResiInfoDTO) {
ValidatorUtils.validateEntity(userResiInfoDTO);
return userResiInfoService.saveResiInfo(userResiInfoDTO);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserCustomerDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.UserCustomerEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description 客户用户关系表
@ -11,6 +12,14 @@ import org.apache.ibatis.annotations.Mapper;
* @date 2020.03.31 13:53
*/
@Mapper
public interface UserCustomerDao extends BaseDao<UserCustomerEntity>{
public interface UserCustomerDao extends BaseDao<UserCustomerEntity> {
/**
* desc:修改客户的用户的注册状态为已注册
*
* @param customerId
* @param userId
* @return
*/
int updateRegistered(@Param("customerId") String customerId, @Param("userId") String userId);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java

@ -39,8 +39,8 @@ import java.util.List;
public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
/**
* @return com.epmet.dto.UserResiInfoDTO
* @param userResiInfoFormDTO
* @return com.epmet.dto.UserResiInfoDTO
* @Author yinzuomei
* @Description 查询用户注册信息
* @Date 2020/3/30 11:10
@ -48,23 +48,23 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
UserResiInfoResultDTO selectUserResiInfoDTO(UserResiInfoFormDTO userResiInfoFormDTO);
/**
* @Description 查询用户注册信息 不按照客户Id查询
* @param userResiInfoFormDTO
* @return UserResiInfoResultDTO
* @return UserResiInfoResultDTO
* @Description 查询用户注册信息 不按照客户Id查询
* @author wangc
* @date 2020.05.21 13:18
**/
**/
UserResiInfoResultDTO selectUserResiInfoNotByCustId(UserResiInfoFormDTO userResiInfoFormDTO);
/**
* @Author sun
* @Description 根据手机号查询居民注册信息(user_resi_info)表数据
**/
List<UserResiInfoDTO> selectResiInfoByMobile(String regMobile);
List<UserResiInfoDTO> selectResiInfoByMobile(@Param("regMobile") String regMobile, @Param("customerId") String customerId);
/**
* @return java.util.List<com.epmet.dto.UserResiInfoDTO>
* @param userIdList
* @return java.util.List<com.epmet.dto.UserResiInfoDTO>
* @Author yinzuomei
* @Description 根据userId集合查询用户注册信息
* @Date 2020/4/7 18:26
@ -72,8 +72,8 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
List<UserResiInfoResultDTO> selectListUserResiInfoDTO(@Param("userIdList") List<String> userIdList);
/**
* @Description 根据userId查询议题发起人
* @param formDTO
* @Description 根据userId查询议题发起人
* @author zxc
* @date 2020/5/11 11:18
*/

31
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -19,6 +19,7 @@ package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.common.token.util.UserUtil;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.FieldConstant;
@ -30,9 +31,11 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserConstant;
import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.UserCustomerDao;
import com.epmet.dao.UserResiInfoDao;
import com.epmet.dao.UserWechatDao;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserResiRegisterVisitDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO;
@ -82,6 +85,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
private UserBaseInfoService userBaseInfoService;
@Autowired
private UserWechatDao userWechatService;
@Autowired
private UserCustomerDao userCustomerDao;
@Override
public PageData<UserResiInfoDTO> page(Map<String, Object> params) {
@ -164,8 +169,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}*/
//2:再次判断手机号是否可用
if (!getResiInfoByMobile(userResiInfoDTO.getRegMobile())) {
//2:再次判断手机号是否在客户下可用
if (!getResiInfoByMobile(userResiInfoDTO.getRegMobile(), userResiInfoDTO.getCustomerId())) {
//手机号验证失败则更新行为记录表数据 返回前台结果
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
@ -221,15 +226,17 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
//1:更新居民注册访问记录表数据
userResiRegisterVisitService.updateResiVisitOperate(verificationCodeFormDTO);
//2:判断手机号是否可用
if (!getResiInfoByMobile(verificationCodeFormDTO.getMobile())) {
//2020-07-29 根据要注册的网格获取客户Id
UserResiRegisterVisitDTO registerVisitDTO = userResiRegisterVisitService.get(verificationCodeFormDTO.getResiVisitId());
if (!getResiInfoByMobile(verificationCodeFormDTO.getMobile(), registerVisitDTO.getCustomerId())) {
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
}
//3:调用短信服务 生成验证码发送短信
SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO();
SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO();
sendVerificationCodeFormDTO.setMobile(verificationCodeFormDTO.getMobile());
sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER);
Result<SendVerificationCodeResultDTO> result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO);
if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getCode())){
if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getCode())) {
return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode());
}
//4:删除缓存中可能存在的旧验证码
@ -240,11 +247,12 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
}
@Override
@Transactional(rollbackFor = Exception.class)
public Result saveResiInfo(UserResiInfoDTO userResiInfoDTO) {
Result result = new Result();
//判断手机号是否可用
if (getResiInfoByMobile(userResiInfoDTO.getRegMobile())) {
if (getResiInfoByMobile(userResiInfoDTO.getRegMobile(), userResiInfoDTO.getCustomerId())) {
//数据存入居民注册表
saveUserResiInfo(userResiInfoDTO);
//居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
@ -254,6 +262,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
userRole.setUserId(userResiInfoDTO.getUserId());
userRole.setRoleKey(UserConstant.ROLE_RESI);
userRoleService.saveUserRole(userRole);
//更新该用户在该客户下的注册状态
userCustomerDao.updateRegistered(userResiInfoDTO.getCustomerId(), userResiInfoDTO.getUserId());
}
return result;
@ -280,12 +290,17 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
* 判断手机号是否可用-根据手机号查询居民注册信息(user_resi_info)表数据
*
* @param mobile
* @param customerId
* @return
* @Author sun
*/
private Boolean getResiInfoByMobile(String mobile) {
private Boolean getResiInfoByMobile(String mobile, String customerId) {
if (StringUtils.isBlank(customerId)) {
customerId = UserUtil.getCurrentUser().getCustomerId();
log.info("getResiInfoByMobile UserUtil.getCustomerId:{}", customerId);
}
Boolean bl = true;
List<UserResiInfoDTO> list = userResiInfoDao.selectResiInfoByMobile(mobile);
List<UserResiInfoDTO> list = userResiInfoDao.selectResiInfoByMobile(mobile, customerId);
if (list.size() > 0) {
bl = false;
}

8
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.5__add_isRegister.sql

@ -0,0 +1,8 @@
ALTER TABLE `epmet_user`.`user_customer`
ADD COLUMN `IS_REGISTER` varchar(1) NOT NULL DEFAULT 0 COMMENT '是否注册 1注册; 0未注册' AFTER `USER_ID`;
UPDATE user_customer uc,
register_relation t
SET uc.IS_REGISTER = 1
WHERE
uc.CUSTOMER_ID = t.CUSTOMER_ID
AND t.USER_ID = uc.USER_ID;

16
epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml

@ -3,18 +3,8 @@
<mapper namespace="com.epmet.dao.UserCustomerDao">
<resultMap type="com.epmet.entity.UserCustomerEntity" id="userCustomerMap">
<result property="id" column="ID"/>
<result property="app" column="APP"/>
<result property="roleName" column="ROLE_NAME"/>
<result property="roleKey" column="ROLE_KEY"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateRegistered">
update set IS_REGISTER = 1 where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and USER_ID = #{userId,jdbcType=VARCHAR}
</update>
</mapper>

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

@ -98,8 +98,12 @@
SELECT
<include refid="sql"></include>
FROM user_resi_info uri
WHERE uri.del_flag = '0'
AND uri.reg_mobile = #{regMobile}
LEFT JOIN user_customer uc ON uri.USER_ID = uc.USER_ID
WHERE
uri.DEL_FLAG = '0'
AND uri.REG_MOBILE = #{regMobile,jdbcType=VARCHAR}
AND uc.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR}
AND uc.IS_REGISTER = 1
</select>
<!-- 根据userId集合查询用户注册信息 -->

Loading…
Cancel
Save