|
|
@ -16,6 +16,7 @@ import com.epmet.dao.UserResiInfoDao; |
|
|
|
import com.epmet.dao.UserRoleDao; |
|
|
|
import com.epmet.dto.IcHouseDTO; |
|
|
|
import com.epmet.dto.UserResiInfoDTO; |
|
|
|
import com.epmet.dto.form.EnterGridFormDTO; |
|
|
|
import com.epmet.dto.form.GetRoleKeyListFormDTO; |
|
|
|
import com.epmet.dto.form.RegisterAndBindFormDTO; |
|
|
|
import com.epmet.dto.result.HomeInfoResultDTO; |
|
|
@ -25,15 +26,13 @@ import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.entity.UserBaseInfoEntity; |
|
|
|
import com.epmet.entity.UserResiInfoEntity; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.service.IcResiUserService; |
|
|
|
import com.epmet.service.MyHomeService; |
|
|
|
import com.epmet.service.UserBaseInfoService; |
|
|
|
import com.epmet.service.UserResiInfoService; |
|
|
|
import com.epmet.service.*; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.compress.utils.Lists; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.List; |
|
|
@ -63,6 +62,8 @@ public class MyHomeServiceImpl implements MyHomeService { |
|
|
|
private UserBaseInfoDao userBaseInfoDao; |
|
|
|
@Resource |
|
|
|
private IcResiUserDao icResiUserDao; |
|
|
|
@Resource |
|
|
|
private RegisterRelationService registerRelationService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<HomeUserBriefResultDTO> selectListHomeMember(String houseCode, String customerId) { |
|
|
@ -85,8 +86,15 @@ public class MyHomeServiceImpl implements MyHomeService { |
|
|
|
* @Date 2022/6/1 16:33 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void registerAndBind(RegisterAndBindFormDTO formDTO) { |
|
|
|
//TODO 是否走进入网格(entergrid)流程
|
|
|
|
EnterGridFormDTO userInfoParams = new EnterGridFormDTO(); |
|
|
|
userInfoParams.setUserId(formDTO.getUserId()); |
|
|
|
userInfoParams.setCustomerId(formDTO.getCustomerId()); |
|
|
|
userInfoParams.setGridId(formDTO.getGridId()); |
|
|
|
registerRelationService.getUserInfoAndRoles(userInfoParams); |
|
|
|
|
|
|
|
//1.判断是否是居民,如果不是则注册居民,如果是则更新居民信息
|
|
|
|
GetRoleKeyListFormDTO getRoleKeyListFormDTO = new GetRoleKeyListFormDTO(); |
|
|
|
getRoleKeyListFormDTO.setUserId(formDTO.getUserId()); |
|
|
@ -173,14 +181,13 @@ public class MyHomeServiceImpl implements MyHomeService { |
|
|
|
return resultDto; |
|
|
|
} |
|
|
|
resultDto.setIcResiUserId(icUser.getId()); |
|
|
|
//TODO 获取房屋信息
|
|
|
|
HouseInfoCache houseInfo = CustomerIcHouseRedis.getHouseInfo(tokenDto.getCustomerId(), icUser.getHomeId()); |
|
|
|
if (null == houseInfo) { |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取房屋信息失败", "获取房屋信息失败"); |
|
|
|
} |
|
|
|
resultDto.setHouseName(houseInfo.getAllName()); |
|
|
|
resultDto.setHouseCode(null); |
|
|
|
resultDto.setQrCodeUrl(null); |
|
|
|
resultDto.setHouseCode(houseInfo.getHouseCode()); |
|
|
|
resultDto.setQrCodeUrl(houseInfo.getHouseQrcodeUrl()); |
|
|
|
return resultDto; |
|
|
|
} |
|
|
|
} |
|
|
|