|
|
@ -56,6 +56,8 @@ import com.elink.esua.epdc.vaccine.house.service.HouseBusinessInfoService; |
|
|
|
import com.elink.esua.epdc.vaccine.house.service.HouseRentInfoService; |
|
|
|
import com.elink.esua.epdc.vaccine.house.service.HousingInformationService; |
|
|
|
import com.elink.esua.epdc.vaccine.house.service.PopulationInformationService; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dao.VaccinationInfoDao; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.entity.VaccinationInfoEntity; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -81,7 +83,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
@Autowired |
|
|
|
private HousingInformationRedis housingInformationRedis; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private HouseRentInfoService houseRentInfoService; |
|
|
|
|
|
|
@ -103,6 +104,9 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
@Resource |
|
|
|
private EpidemicUserInfoDao epidemicUserInfoDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private VaccinationInfoDao vaccinationInfoDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<HousingInformationDTO> page(Map<String, Object> params) { |
|
|
|
IPage<HousingInformationEntity> page = baseDao.selectPage( |
|
|
@ -389,7 +393,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
} |
|
|
|
// 保存居住人信息
|
|
|
|
if (baseResidentInformationExcels != null && baseResidentInformationExcels.size() > 0) { |
|
|
|
saveResidentList(baseResidentInformationExcels, populationIdNoAndIdMap); |
|
|
|
saveResidentList(baseResidentInformationExcels, parentAndAllDeptDTO, populationIdNoAndIdMap); |
|
|
|
} |
|
|
|
} catch (Exception e1) { |
|
|
|
throw new RenException("导入失败:请检查导入模板或导入数据"); |
|
|
@ -471,7 +475,7 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
* @Date 2020/8/31 |
|
|
|
* @Param [baseResidentInformationExcels] |
|
|
|
**/ |
|
|
|
private void saveResidentList(List<BaseResidentInformationExcel> baseResidentInformationExcels, Map<String, String> populationIdNoAndIdMap) { |
|
|
|
private void saveResidentList(List<BaseResidentInformationExcel> baseResidentInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO, Map<String, String> populationIdNoAndIdMap) { |
|
|
|
for (BaseResidentInformationExcel baseResidentInformationExcel : baseResidentInformationExcels) { |
|
|
|
//插入居民信息
|
|
|
|
PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(baseResidentInformationExcel, PopulationInformationEntity.class); |
|
|
@ -480,9 +484,10 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
epidemicUserInfoEntity.setIdCard(baseResidentInformationExcel.getSelfIdentityNo()); |
|
|
|
EpidemicUserInfoEntity check = epidemicUserInfoService.selectInfoByIdCard(baseResidentInformationExcel.getSelfIdentityNo()); |
|
|
|
if (null == check) { |
|
|
|
epidemicUserInfoEntity.setRelation(baseResidentInformationExcel.getHouseHeadRelation()); |
|
|
|
epidemicUserInfoService.insert(epidemicUserInfoEntity); |
|
|
|
} else { |
|
|
|
check.setRelation(epidemicUserInfoEntity.getRelation()); |
|
|
|
check.setRelation(baseResidentInformationExcel.getHouseHeadRelation()); |
|
|
|
check.setUserName(epidemicUserInfoEntity.getUserName()); |
|
|
|
check.setGender(epidemicUserInfoEntity.getGender()); |
|
|
|
check.setNation(epidemicUserInfoEntity.getNation()); |
|
|
@ -493,7 +498,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
check.setPeopleCategories(epidemicUserInfoEntity.getPeopleCategories()); |
|
|
|
check.setSpecialCrowd(epidemicUserInfoEntity.getSpecialCrowd()); |
|
|
|
check.setPoliticsStatus(epidemicUserInfoEntity.getPoliticsStatus()); |
|
|
|
|
|
|
|
epidemicUserInfoService.update(ConvertUtils.sourceToTarget(check, EpidemicUserInfoDTO.class)); |
|
|
|
} |
|
|
|
//插入房屋人员关联关系表
|
|
|
@ -523,6 +527,8 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
houseResidentEntity.setHouseHeadRelation(baseResidentInformationExcel.getHouseHeadRelation()); |
|
|
|
houseResidentDao.insert(houseResidentEntity); |
|
|
|
|
|
|
|
// 更新疫苗接种记录
|
|
|
|
vaccinationInfoHandle(baseResidentInformationExcel.getSelfIdentityNo(), parentAndAllDeptDTO); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
@ -578,6 +584,8 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
houseResidentDao.insert(houseResidentEntity); |
|
|
|
populationIdNoAndIdMap.put(basePopulationInformationExcel.getResidentsIdentityNo(), epidemicUserInfoEntity.getId().toString()); |
|
|
|
populationIdNoAndIdMap.put(epidemicUserInfoEntity.getId().toString(), housingInformationEntity.getId()); |
|
|
|
// 更新疫苗接种记录
|
|
|
|
vaccinationInfoHandle(basePopulationInformationExcel.getResidentsIdentityNo(), parentAndAllDeptDTO); |
|
|
|
} |
|
|
|
return populationIdNoAndIdMap; |
|
|
|
} |
|
|
@ -1557,4 +1565,25 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform |
|
|
|
return entity; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新疫苗接种信息 |
|
|
|
* |
|
|
|
* @param idCard |
|
|
|
* @param parentAndAllDeptDTO |
|
|
|
* @return void |
|
|
|
* @author zhy |
|
|
|
* @date 2021/9/16 14:09 |
|
|
|
*/ |
|
|
|
private void vaccinationInfoHandle(String idCard, ParentAndAllDeptDTO parentAndAllDeptDTO) { |
|
|
|
// 更新疫苗接种网格信息
|
|
|
|
VaccinationInfoEntity vaccinationInfoEntity = new VaccinationInfoEntity(); |
|
|
|
vaccinationInfoEntity.setIdentityNo(idCard); |
|
|
|
vaccinationInfoEntity.setGridId(parentAndAllDeptDTO.getGridId()); |
|
|
|
vaccinationInfoEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); |
|
|
|
vaccinationInfoEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); |
|
|
|
vaccinationInfoEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); |
|
|
|
vaccinationInfoEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); |
|
|
|
vaccinationInfoDao.updateDeptInfo(vaccinationInfoEntity); |
|
|
|
} |
|
|
|
|
|
|
|
} |