|
|
@ -8,11 +8,10 @@ import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
|
|
import com.epmet.commons.tools.utils.CpUserDetailRedis; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.constant.UserConstant; |
|
|
import com.epmet.constant.UserConstant; |
|
|
import com.epmet.dao.UserDao; |
|
|
import com.epmet.dao.*; |
|
|
import com.epmet.dao.UserRoleDao; |
|
|
|
|
|
import com.epmet.dao.UserWechatDao; |
|
|
|
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
import com.epmet.dto.CustomerGridDTO; |
|
|
import com.epmet.dto.UserDTO; |
|
|
import com.epmet.dto.UserDTO; |
|
|
|
|
|
import com.epmet.dto.UserResiInfoDTO; |
|
|
import com.epmet.dto.UserWechatDTO; |
|
|
import com.epmet.dto.UserWechatDTO; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.*; |
|
|
@ -21,6 +20,7 @@ import com.epmet.entity.UserEntity; |
|
|
import com.epmet.entity.UserWechatEntity; |
|
|
import com.epmet.entity.UserWechatEntity; |
|
|
import com.epmet.feign.EpmetPointOpenFeignClient; |
|
|
import com.epmet.feign.EpmetPointOpenFeignClient; |
|
|
import com.epmet.feign.GovOrgFeignClient; |
|
|
import com.epmet.feign.GovOrgFeignClient; |
|
|
|
|
|
import com.epmet.redis.UserBaseInfoRedis; |
|
|
import com.epmet.service.UserBaseInfoService; |
|
|
import com.epmet.service.UserBaseInfoService; |
|
|
import com.epmet.service.UserService; |
|
|
import com.epmet.service.UserService; |
|
|
import com.epmet.util.ModuleConstant; |
|
|
import com.epmet.util.ModuleConstant; |
|
|
@ -53,6 +53,12 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem |
|
|
private UserBaseInfoService userBaseInfoService; |
|
|
private UserBaseInfoService userBaseInfoService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private EpmetPointOpenFeignClient epmetPointOpenFeignClient; |
|
|
private EpmetPointOpenFeignClient epmetPointOpenFeignClient; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private UserBaseInfoRedis userBaseInfoRedis; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private UserResiInfoDao userResiInfoDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private UserBaseInfoDao userBaseInfoDao; |
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); |
|
|
private static final Logger log = LoggerFactory.getLogger(UserServiceImpl.class); |
|
|
|
|
|
|
|
|
@ -130,7 +136,31 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem |
|
|
userWechatDTO.setUpdatedTime(new Date()); |
|
|
userWechatDTO.setUpdatedTime(new Date()); |
|
|
userWechatDTO.setUpdatedBy(wxUserInfoFormDTO.getUserId()); |
|
|
userWechatDTO.setUpdatedBy(wxUserInfoFormDTO.getUserId()); |
|
|
userWechatDao.updateByUserId(userWechatDTO); |
|
|
userWechatDao.updateByUserId(userWechatDTO); |
|
|
|
|
|
|
|
|
UserBaseInfoEntity baseInfo = new UserBaseInfoEntity(); |
|
|
UserBaseInfoEntity baseInfo = new UserBaseInfoEntity(); |
|
|
|
|
|
UserBaseInfoResultDTO cache = userBaseInfoRedis.get(wxUserInfoFormDTO.getUserId()); |
|
|
|
|
|
if(null == cache || StringUtils.isBlank(cache.getId())){ |
|
|
|
|
|
//没有缓存
|
|
|
|
|
|
cache = |
|
|
|
|
|
userBaseInfoDao.selectListByUserIdList(wxUserInfoFormDTO.getUserId()); |
|
|
|
|
|
if(null == cache || StringUtils.isBlank(cache.getId()) || StringUtils.isBlank(cache.getMobile()) ||StringUtils.isBlank(cache.getSurname())){ |
|
|
|
|
|
//没有baseInfo
|
|
|
|
|
|
UserResiInfoDTO resiInfo = |
|
|
|
|
|
userResiInfoDao.selectByUserId(wxUserInfoFormDTO.getUserId()); |
|
|
|
|
|
if(null == resiInfo || StringUtils.isBlank(resiInfo.getId())){ |
|
|
|
|
|
//没有resiInfo
|
|
|
|
|
|
return new Result(); |
|
|
|
|
|
}else{ |
|
|
|
|
|
baseInfo.setSurname(resiInfo.getSurname()); |
|
|
|
|
|
baseInfo.setName(resiInfo.getName()); |
|
|
|
|
|
baseInfo.setStreet(resiInfo.getStreet()); |
|
|
|
|
|
baseInfo.setDistrict(resiInfo.getDistrict()); |
|
|
|
|
|
baseInfo.setBuildingAddress(resiInfo.getBuildingAddress()); |
|
|
|
|
|
baseInfo.setMobile(resiInfo.getRegMobile()); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
baseInfo.setUserId(wxUserInfoFormDTO.getUserId()); |
|
|
baseInfo.setUserId(wxUserInfoFormDTO.getUserId()); |
|
|
baseInfo.setNickname(wxUserInfoFormDTO.getNickName()); |
|
|
baseInfo.setNickname(wxUserInfoFormDTO.getNickName()); |
|
|
baseInfo.setHeadImgUrl(wxUserInfoFormDTO.getAvatarUrl()); |
|
|
baseInfo.setHeadImgUrl(wxUserInfoFormDTO.getAvatarUrl()); |
|
|
|