Browse Source

导入房屋信息时,同步更新疫苗接种记录网格信息

origin/epidemic_user
zhangyuan 4 years ago
parent
commit
3ce985d2ea
  1. 39
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java
  2. 10
      epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationInfoDao.java
  3. 1
      epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml
  4. 11
      epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml

39
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/house/service/impl/HousingInformationServiceImpl.java

@ -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);
}
}

10
epdc-cloud-vim-yushan/src/main/java/com/elink/esua/epdc/vaccine/vim/dao/VaccinationInfoDao.java

@ -79,6 +79,16 @@ public interface VaccinationInfoDao extends BaseDao<VaccinationInfoEntity> {
*/
void updateAddress(VaccinationInfoEntity entity);
/**
* 更新网格信息
*
* @param entity
* @return void
* @author zhy
* @date 2021/5/20 17:46
*/
void updateDeptInfo(VaccinationInfoEntity entity);
/**
* 查询实际接种情况
*

1
epdc-cloud-vim-yushan/src/main/resources/mapper/house/HouseResidentDao.xml

@ -35,6 +35,7 @@
t.RELATION as HOUSE_HEAD_RELATION
from epidemic_user_info t left join epdc_house_resident t1 on t1.RESIDENT_ID = t.ID
where t.DEL_FLAG ='0' and t1.DEL_FLAG ='0' and t1.IS_HOUSE_HEAD = '0' and t1.HOUSE_HEAD_ID = #{houseHeadId}
GROUP BY t.id
order by t1.CREATED_TIME desc
</select>
<select id="selectByHouseResidentId" resultType="com.elink.esua.epdc.dto.house.PopulationInformationDTO">

11
epdc-cloud-vim-yushan/src/main/resources/mapper/vim/VaccinationInfoDao.xml

@ -153,6 +153,17 @@
WHERE id = #{id}
</update>
<update id="updateDeptInfo">
UPDATE vaccination_info
SET
GRID_ID = #{gridId},
PARENT_DEPT_IDS = #{parentDeptIds},
PARENT_DEPT_NAMES = #{parentDeptNames},
ALL_DEPT_IDS = #{allDeptIds},
ALL_DEPT_NAMES = #{allDeptNames}
WHERE IDENTITY_NO = #{identityNo} AND DEL_FLAG = '0'
</update>
<select id="selectAllVaccinationInfo" resultType="com.elink.esua.epdc.vaccine.vim.dto.VaccinationInfoDTO">
SELECT
COUNT(0) AS dose,

Loading…
Cancel
Save