|
|
@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.distributedlock.DistributedLock; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
@ -61,6 +62,7 @@ import com.github.pagehelper.PageInfo; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.logging.log4j.LogManager; |
|
|
|
import org.apache.logging.log4j.Logger; |
|
|
|
import org.redisson.api.RLock; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -68,6 +70,7 @@ import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户基础信息 |
|
|
@ -102,6 +105,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us |
|
|
|
private RegisterRelationDao registerRelationDao; |
|
|
|
@Resource |
|
|
|
private UserDao userDao; |
|
|
|
@Autowired |
|
|
|
private DistributedLock distributedLock; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<UserBaseInfoDTO> page(Map<String, Object> params) { |
|
|
@ -550,6 +555,9 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us |
|
|
|
result.setGridId(StrConstant.EPMETY_STR); |
|
|
|
result.setGridName(StrConstant.EPMETY_STR); |
|
|
|
result.setAgencyId(StrConstant.EPMETY_STR); |
|
|
|
RLock lock = null; |
|
|
|
try { |
|
|
|
lock = distributedLock.getLock(String.format("epmet:lock:dingResiLogin:%s",formDTO.getMobile()), 120L, 3L, TimeUnit.SECONDS); |
|
|
|
//根据手机号从baseinfo查对应的信息,如果有则返回,没有则注册
|
|
|
|
UserBaseInfoEntity baseInfo = baseDao.selectUserByMobile(formDTO.getCustomerId(),formDTO.getMobile()); |
|
|
|
if (null == baseInfo) { |
|
|
@ -611,6 +619,9 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us |
|
|
|
result.setRegFlag(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} finally { |
|
|
|
distributedLock.unLock(lock); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|