|
|
@ -2,12 +2,10 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.ServiceConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
@ -38,6 +36,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.feign.OssFeignClient; |
|
|
|
import com.epmet.service.IcNatService; |
|
|
|
import com.epmet.service.IcNoticeService; |
|
|
|
import com.epmet.service.UserService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
@ -83,6 +82,8 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
private IcNatRelationDao icNatRelationDao; |
|
|
|
@Autowired |
|
|
|
private IcResiUserDao icResiUserDao; |
|
|
|
@Autowired |
|
|
|
private UserService userService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Author sun |
|
|
@ -313,9 +314,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
String app = EpmetRequestHolder.getHeader(AppClientConstant.APP); |
|
|
|
String client = EpmetRequestHolder.getHeader(AppClientConstant.CLIENT); |
|
|
|
|
|
|
|
LoginUserDetailsFormDTO ludf = new LoginUserDetailsFormDTO(app, client, userId); |
|
|
|
LoginUserDetailsResultDTO loginUserDetails = getResultDataOrThrowsException(epmetUserOpenFeignClient.getLoginUserDetails(ludf), ServiceConstant.EPMET_USER_SERVER, |
|
|
|
EpmetErrorCode.SERVER_ERROR.getCode(), "调用user出错", ""); |
|
|
|
LoginUserDetailsResultDTO loginUserDetails = userService.getLoginUserDetails(app, client, userId); |
|
|
|
|
|
|
|
String agencyId = loginUserDetails.getAgencyId(); |
|
|
|
|
|
|
@ -513,7 +512,7 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
// 检测地点和手机号先不提示,说需要提示再提示
|
|
|
|
if (!natAddress.equals(resiNat.getNatAddress())) { |
|
|
|
changedFieldNames.add("检测地点"); |
|
|
|
resiNat.setNatResult(natAddress); |
|
|
|
resiNat.setNatAddress(natAddress); |
|
|
|
needUpdate = true; |
|
|
|
} |
|
|
|
|
|
|
@ -537,6 +536,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
if (needUpdate) { |
|
|
|
resiNat.setUpdatedBy(currentUserId); |
|
|
|
resiNat.setUpdatedTime(new Date()); |
|
|
|
|
|
|
|
IcResiUserEntity resi = getResi(customerId, idCard); |
|
|
|
resiNat.setIsResiUser(resi != null ? "1" : "0"); |
|
|
|
resiNat.setUserId(resi != null ? resi.getId() : ""); |
|
|
|
|
|
|
|
baseDao.updateById(resiNat); |
|
|
|
} |
|
|
|
|
|
|
@ -547,7 +551,9 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
} |
|
|
|
|
|
|
|
// 执行新增操作
|
|
|
|
e.setIsResiUser(isResi(customerId, idCard)); |
|
|
|
IcResiUserEntity resi = getResi(customerId, idCard); |
|
|
|
e.setIsResiUser(resi != null ? "1" : "0"); |
|
|
|
e.setUserId(resi != null ? resi.getId() : ""); |
|
|
|
e.setUserType("import"); |
|
|
|
|
|
|
|
baseDao.insert(e); |
|
|
@ -564,11 +570,11 @@ public class IcNatServiceImpl extends BaseServiceImpl<IcNatDao, IcNatEntity> imp |
|
|
|
* @param idCard |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public String isResi(String customerId, String idCard) { |
|
|
|
public IcResiUserEntity getResi(String customerId, String idCard) { |
|
|
|
LambdaQueryWrapper<IcResiUserEntity> query = new LambdaQueryWrapper(); |
|
|
|
query.eq(IcResiUserEntity::getCustomerId, customerId); |
|
|
|
query.eq(IcResiUserEntity::getIdCard, idCard); |
|
|
|
return icResiUserDao.selectCount(query) > 0 ? "1" : "0"; |
|
|
|
return icResiUserDao.selectOne(query); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|