|
@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.tools.enums.UserSexEnum; |
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; |
|
|
|
|
|
import com.elink.esua.epdc.commons.tools.utils.IdentityNoUtils; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.commons.tools.utils.Result; |
|
|
import com.elink.esua.epdc.dto.PersonTestingDTO; |
|
|
import com.elink.esua.epdc.dto.PersonTestingDTO; |
|
|
import com.elink.esua.epdc.dto.PersonTestingPageDTO; |
|
|
import com.elink.esua.epdc.dto.PersonTestingPageDTO; |
|
@ -34,11 +35,10 @@ import com.elink.esua.epdc.modules.epidemic.entity.PersonTestingEntity; |
|
|
import com.elink.esua.epdc.modules.epidemic.feign.OssFeignClient; |
|
|
import com.elink.esua.epdc.modules.epidemic.feign.OssFeignClient; |
|
|
import com.elink.esua.epdc.modules.epidemic.redis.PersonTestingRedis; |
|
|
import com.elink.esua.epdc.modules.epidemic.redis.PersonTestingRedis; |
|
|
import com.elink.esua.epdc.modules.epidemic.service.PersonTestingService; |
|
|
import com.elink.esua.epdc.modules.epidemic.service.PersonTestingService; |
|
|
import com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao; |
|
|
|
|
|
import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; |
|
|
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao; |
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInfoDao; |
|
|
import com.elink.esua.epdc.vaccine.epidemic.dao.EpidemicUserInoutRecordDao; |
|
|
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; |
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; |
|
|
|
|
|
import com.elink.esua.epdc.vaccine.house.dao.PopulationInformationDao; |
|
|
|
|
|
import com.elink.esua.epdc.vaccine.house.entity.PopulationInformationEntity; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
@ -66,13 +66,9 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
@Autowired |
|
|
@Autowired |
|
|
private EpidemicUserInfoDao epidemicUserInfoDao; |
|
|
private EpidemicUserInfoDao epidemicUserInfoDao; |
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private EpidemicUserInoutRecordDao epidemicUserInoutRecordDao; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private PopulationInformationDao populationInformationDao; |
|
|
private PopulationInformationDao populationInformationDao; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<PersonTestingPageDTO> page(Map<String, Object> params) { |
|
|
public PageData<PersonTestingPageDTO> page(Map<String, Object> params) { |
|
|
// IPage<PersonTestingEntity> page = baseDao.selectPage(
|
|
|
// IPage<PersonTestingEntity> page = baseDao.selectPage(
|
|
@ -193,7 +189,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
//检测时间
|
|
|
//检测时间
|
|
|
Date date = new Date(); |
|
|
Date date = new Date(); |
|
|
dto.setTestingTime(date); |
|
|
dto.setTestingTime(date); |
|
|
saveScanningInfoForUserV2(dto); |
|
|
saveScanningInfoForUserV1(dto); |
|
|
PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class); |
|
|
PersonTestingEntity entity = ConvertUtils.sourceToTarget(dto, PersonTestingEntity.class); |
|
|
entity.setTestingTime(date); |
|
|
entity.setTestingTime(date); |
|
|
if (StringUtils.isNotBlank(dto.getImgCode())) { |
|
|
if (StringUtils.isNotBlank(dto.getImgCode())) { |
|
@ -213,7 +209,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public Result getMobileByIdCard(PersonTestingDTO dto) { |
|
|
public Result getMobileByIdCard(PersonTestingDTO dto) { |
|
|
String result = epidemicUserInoutRecordDao.getMobileByIdCard(dto.getIdcard()); |
|
|
String result = epidemicUserInfoDao.getMobileByIdCard(dto.getIdcard()); |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(result)) { |
|
|
if (StringUtils.isBlank(result)) { |
|
|
result = baseDao.getMobileByIdCard(dto.getIdcard()); |
|
|
result = baseDao.getMobileByIdCard(dto.getIdcard()); |
|
@ -268,7 +264,7 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void personTestingDTO2EpidemicUserInfoEntityTransfor(PersonTestingDTO sDto, PopulationInformationEntity dDto) { |
|
|
private void personTestingDTO2PopulationInfomationEntityTransfor(PersonTestingDTO sDto, PopulationInformationEntity dDto) { |
|
|
dDto.setResidentsName(sDto.getName()); |
|
|
dDto.setResidentsName(sDto.getName()); |
|
|
dDto.setResidentsSex(sexTransfor(sDto.getSex())); |
|
|
dDto.setResidentsSex(sexTransfor(sDto.getSex())); |
|
|
dDto.setResidentsNation(sDto.getNation()); |
|
|
dDto.setResidentsNation(sDto.getNation()); |
|
@ -279,6 +275,22 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
dDto.setCheckState("0"); |
|
|
dDto.setCheckState("0"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void personTestingDTO2EpidemicUserInfoEntityTransfor(PersonTestingDTO sDto, EpidemicUserInfoEntity dDto) { |
|
|
|
|
|
dDto.setUserName(sDto.getName()); |
|
|
|
|
|
String result = IdentityNoUtils.IdentityNoVerification(sDto.getIdcard()); |
|
|
|
|
|
if (result != null) { |
|
|
|
|
|
throw new RenException(result); |
|
|
|
|
|
} else { |
|
|
|
|
|
dDto.setGender(IdentityNoUtils.getSex(sDto.getIdcard())); |
|
|
|
|
|
dDto.setBirthday(IdentityNoUtils.getBirthday(sDto.getIdcard())); |
|
|
|
|
|
} |
|
|
|
|
|
dDto.setNation(sDto.getNation()); |
|
|
|
|
|
dDto.setHouseholdRegisterDetail(sDto.getAddress()); |
|
|
|
|
|
dDto.setIdCard(sDto.getIdcard()); |
|
|
|
|
|
dDto.setCheckDate(sDto.getTestingTime()); |
|
|
|
|
|
dDto.setCheckState("0"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @return void |
|
|
* @return void |
|
|
* @describe: 匹配到更新人员的核酸检测状态和最后一次核酸检测时间,匹配不到用户新增一条人员信息 |
|
|
* @describe: 匹配到更新人员的核酸检测状态和最后一次核酸检测时间,匹配不到用户新增一条人员信息 |
|
@ -294,11 +306,31 @@ public class PersonTestingServiceImpl extends BaseServiceImpl<PersonTestingDao, |
|
|
populationInformationDao.updateById(en); |
|
|
populationInformationDao.updateById(en); |
|
|
} else { |
|
|
} else { |
|
|
PopulationInformationEntity entity = new PopulationInformationEntity(); |
|
|
PopulationInformationEntity entity = new PopulationInformationEntity(); |
|
|
personTestingDTO2EpidemicUserInfoEntityTransfor(dto, entity); |
|
|
personTestingDTO2PopulationInfomationEntityTransfor(dto, entity); |
|
|
populationInformationDao.insert(entity); |
|
|
populationInformationDao.insert(entity); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @return void |
|
|
|
|
|
* @describe: 匹配到更新人员的核酸检测状态和最后一次核酸检测时间,匹配不到用户新增一条人员信息 |
|
|
|
|
|
* @author zhy |
|
|
|
|
|
* @date 2021/9/15 |
|
|
|
|
|
* @params dto |
|
|
|
|
|
*/ |
|
|
|
|
|
private void saveScanningInfoForUserV1(PersonTestingDTO dto) { |
|
|
|
|
|
EpidemicUserInfoEntity entity = epidemicUserInfoDao.selectInfoByIdCard(dto.getIdcard()); |
|
|
|
|
|
if (entity != null) { |
|
|
|
|
|
entity.setCheckDate(dto.getTestingTime()); |
|
|
|
|
|
entity.setCheckState("0"); |
|
|
|
|
|
epidemicUserInfoDao.updateById(entity); |
|
|
|
|
|
} else { |
|
|
|
|
|
entity = new EpidemicUserInfoEntity(); |
|
|
|
|
|
personTestingDTO2EpidemicUserInfoEntityTransfor(dto, entity); |
|
|
|
|
|
epidemicUserInfoDao.insert(entity); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 根据生日计算年龄 |
|
|
* 根据生日计算年龄 |
|
|
* dateStr 这样格式的生日 1990-01-01 |
|
|
* dateStr 这样格式的生日 1990-01-01 |
|
|