|
@ -18,6 +18,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
import com.epmet.commons.tools.utils.*; |
|
|
import com.epmet.commons.tools.utils.*; |
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
|
|
import com.epmet.dao.IcNatDao; |
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
import com.epmet.dao.IcVaccineDao; |
|
|
import com.epmet.dao.IcVaccineDao; |
|
|
import com.epmet.dao.IcVaccineRelationDao; |
|
|
import com.epmet.dao.IcVaccineRelationDao; |
|
@ -79,6 +80,8 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
private UserService userService; |
|
|
private UserService userService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IcNoticeService icNoticeService; |
|
|
private IcNoticeService icNoticeService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcNatDao icNatDao; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @Author sun |
|
|
* @Author sun |
|
@ -568,4 +571,46 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
icVaccineRelationDao.delRelation(formDTO.getVaccineId(), null); |
|
|
icVaccineRelationDao.delRelation(formDTO.getVaccineId(), null); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void initVaccineLocal() { |
|
|
|
|
|
Integer no = NumConstant.ONE; |
|
|
|
|
|
Integer size; |
|
|
|
|
|
// 查询关系表
|
|
|
|
|
|
do { |
|
|
|
|
|
PageInfo<RelationAndNatResultDTO> pageInfo = PageHelper.startPage(no, NumConstant.ONE_THOUSAND).doSelectPageInfo(() -> baseDao.initVaccineLocal()); |
|
|
|
|
|
List<RelationAndNatResultDTO> list = pageInfo.getList(); |
|
|
|
|
|
size = list.size(); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)){ |
|
|
|
|
|
List<IcResiUserEntity> users = icNatDao.getResiByIdCards(list.stream().map(m -> m.getIdCard()).distinct().collect(Collectors.toList())); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(users)){ |
|
|
|
|
|
for (RelationAndNatResultDTO l : list) { |
|
|
|
|
|
for (IcResiUserEntity u : users) { |
|
|
|
|
|
if (l.getStaffAgencyIdPath().contains(u.getAgencyId())){ |
|
|
|
|
|
l.setIsLocalResiUser(NumConstant.ONE_STR); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
updateRelation(list,NumConstant.ONE_STR); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
no++; |
|
|
|
|
|
}while (size == NumConstant.ONE_THOUSAND); |
|
|
|
|
|
// 其他类型的userType直接是居民的组织信息,所以直接赋值 is_local_resi_user = '1'
|
|
|
|
|
|
updateRelation(null,NumConstant.TWO_STR); |
|
|
|
|
|
log.error("/epmetuser/icNat/initNatLocal更新核酸检测记录关系表,是否是本辖区居民标志 end"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public void updateRelation(List<RelationAndNatResultDTO> list,String type){ |
|
|
|
|
|
if (NumConstant.ONE_STR.equals(type)){ |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(list)){ |
|
|
|
|
|
baseDao.updateRelation(list); |
|
|
|
|
|
} |
|
|
|
|
|
}else { |
|
|
|
|
|
baseDao.updateRelationOther("1"); |
|
|
|
|
|
baseDao.updateRelationOther("0"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|