|
|
|
@ -23,18 +23,21 @@ import com.elink.esua.epdc.dto.SysSimpleDictDTO; |
|
|
|
import com.elink.esua.epdc.dto.house.SysPopulationSimpleDictDTO; |
|
|
|
import com.elink.esua.epdc.dto.house.form.SysPopulationSimpleDictFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.house.result.EpdcPopulationErrorResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.EpidemicBuildingUnitDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.EpidemicUnitOwnerDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.form.BindingFamilyFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.form.FamilyMemberInfoFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.form.GetMemberListFormDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.result.EpidemicPlotBuildingResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.result.EpidemicUnitInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.result.EpidemicBuildingUnitDetailResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.personroom.result.FamilyMemberInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.constant.ImageConstant; |
|
|
|
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.dto.*; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.*; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.EpidemicPageResultV2DTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.dto.result.VaccinationInfoResultV2DTO; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserErrorEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInfoEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.epidemic.entity.EpidemicUserInoutRecordEntity; |
|
|
|
@ -47,7 +50,6 @@ import com.elink.esua.epdc.vaccine.house.excel.BaseResidentInformationUpdateExce |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.dao.EpidemicUnitOwnerDao; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.entity.EpidemicUnitOwnerEntity; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicBuildingUnitService; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicPlotBuildingService; |
|
|
|
import com.elink.esua.epdc.vaccine.personroom.service.EpidemicUnitOwnerService; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dao.VaccinationInfoDao; |
|
|
|
import com.elink.esua.epdc.vaccine.vim.dao.VimImgDao; |
|
|
|
@ -100,12 +102,12 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
private VimImgDao vimImgDao; |
|
|
|
@Autowired |
|
|
|
private EpidemicUserErrorService epidemicUserErrorService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EpidemicPlotBuildingService epidemicPlotBuildingService; |
|
|
|
private EpidemicUnitOwnerService epidemicUnitOwnerService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EpidemicBuildingUnitService epidemicBuildingUnitService; |
|
|
|
@Autowired |
|
|
|
private EpidemicUnitOwnerService epidemicUnitOwnerService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EpidemicUserInoutRecordDao epidemicUserInoutRecordDao; |
|
|
|
@ -126,16 +128,17 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
@Override |
|
|
|
public PageData<EpidemicRecordListDTO> getPageList(Map<String, Object> params) { |
|
|
|
IPage<EpidemicRecordListDTO> page = getPage(params); |
|
|
|
|
|
|
|
String grids = (String) params.get("deptIdList"); |
|
|
|
String agencyList = (String) params.get("agencyList"); |
|
|
|
params.put("deptIdList",null); |
|
|
|
if(StringUtils.isNotBlank(grids)){ |
|
|
|
params.put("deptIdList", null); |
|
|
|
if (StringUtils.isNotBlank(grids)) { |
|
|
|
List<String> gridList = Arrays.asList(grids.split(",")); |
|
|
|
params.put("gridList",gridList); |
|
|
|
params.put("gridList", gridList); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(agencyList)){ |
|
|
|
if (StringUtils.isNotBlank(agencyList)) { |
|
|
|
List<String> agencyIdList = Arrays.asList(agencyList.split(",")); |
|
|
|
params.put("agencyList",agencyIdList); |
|
|
|
params.put("agencyList", agencyIdList); |
|
|
|
} |
|
|
|
UserDetail user = SecurityUser.getUser(); |
|
|
|
if (user == null) { |
|
|
|
@ -164,11 +167,8 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
result.setAllDeptIds(result.getAllDeptIds().replace(result.getAllDeptIds().substring(0, result.getAllDeptIds().indexOf(",") + 1), "")); |
|
|
|
result.setDeptIdList(result.getAllDeptIds().split(",")); |
|
|
|
} |
|
|
|
// result.setIdCard(idEncrypt(result.getIdCard()));
|
|
|
|
// result.setMobile(mobileEncrypt(result.getMobile()));
|
|
|
|
result.setUserName(nameDesensitization(result.getUserName())); |
|
|
|
result.setRelationPeople(nameDesensitization(result.getRelationPeople())); |
|
|
|
// result.setRelationPeopleMobile(mobileEncrypt(result.getRelationPeopleMobile()));
|
|
|
|
if (StringUtils.isNotBlank(result.getHouseholdRegisterCode())) { |
|
|
|
result.setHouseholdRegisterCodes(result.getHouseholdRegisterCode().split(",")); |
|
|
|
} else { |
|
|
|
@ -199,6 +199,16 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
result.setDestinationAddressCodes(new String[]{}); |
|
|
|
} |
|
|
|
|
|
|
|
// 查询房屋关联信息
|
|
|
|
EpidemicBuildingUnitDTO formDTO = new EpidemicBuildingUnitDTO(); |
|
|
|
formDTO.setIdCard(result.getIdCard()); |
|
|
|
formDTO.setGridId(result.getDeptId().toString()); |
|
|
|
EpidemicBuildingUnitDetailResultDTO unitInfo = epidemicBuildingUnitService.getUnitInfo(formDTO); |
|
|
|
if (unitInfo != null) { |
|
|
|
result.setUnitId(unitInfo.getId()); |
|
|
|
result.setBuildingId(unitInfo.getBuildingId()); |
|
|
|
result.setPlotId(unitInfo.getPlotId()); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@ -227,6 +237,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public Result updateNew(EpidemicReportUserInfoDTO dto) { |
|
|
|
|
|
|
|
//基础信息dto
|
|
|
|
EpidemicUserInfoEntity userInfoDTO = new EpidemicUserInfoEntity(); |
|
|
|
//录入信息dto
|
|
|
|
@ -290,24 +301,12 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
// return new Result().error("电话号格式不正确");
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// //判断关联人
|
|
|
|
// if (!StringUtils.isEmpty(userInoutRecordDTO.getRelationPeople())) {
|
|
|
|
// if (userInoutRecordDTO.getRelationPeople().contains("*")) {
|
|
|
|
// userInoutRecordDTO.setRelationPeople(inoutRecordEntity.getRelationPeople());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// //判断关联人联系电话
|
|
|
|
// if (!StringUtils.isEmpty(userInoutRecordDTO.getRelationPeopleMobile())) {
|
|
|
|
// if (userInoutRecordDTO.getRelationPeopleMobile().contains("*")) {
|
|
|
|
// userInoutRecordDTO.setRelationPeopleMobile(inoutRecordEntity.getRelationPeopleMobile());
|
|
|
|
// } else {
|
|
|
|
// String peopleMobile = userInoutRecordDTO.getRelationPeopleMobile();
|
|
|
|
// boolean isMobile = ValidateUtils.validateMobilePhone(peopleMobile);
|
|
|
|
// if (!isMobile) {
|
|
|
|
// return new Result().error("关联人联系电话格式不正确");
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// 更新人房关系
|
|
|
|
if (dto.getUnitId() != null && dto.getUnitId() != NumConstant.ZERO) { |
|
|
|
dto.setUserName(entity.getUserName()); |
|
|
|
saveHouseRelation(dto); |
|
|
|
} |
|
|
|
} catch (RenException e) { |
|
|
|
return new Result().error(e.getMsg()); |
|
|
|
} |
|
|
|
@ -334,6 +333,10 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
public Result saveNew(EpidemicReportUserInfoDTO dto) { |
|
|
|
if (dto.getUnitId() != null && dto.getUnitId() != NumConstant.ZERO) { |
|
|
|
saveHouseRelation(dto); |
|
|
|
} |
|
|
|
|
|
|
|
//基础信息dto
|
|
|
|
EpidemicUserInfoEntity userInfoDTO = new EpidemicUserInfoEntity(); |
|
|
|
//录入信息dto
|
|
|
|
@ -483,29 +486,9 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Result deleteUserById(Long[] ids) { |
|
|
|
|
|
|
|
//物理删除
|
|
|
|
baseDao.deleteByIds(ids); |
|
|
|
// //1、获取详情id
|
|
|
|
// Long inoutRecord = ids[0];
|
|
|
|
// if (null != inoutRecord) {
|
|
|
|
// baseDao.deleteById(inoutRecord);
|
|
|
|
// //查询信息
|
|
|
|
// EpidemicUserInfoEntity entity = baseDao.selectByIdCard(inoutRecord);
|
|
|
|
// if (null == entity) {
|
|
|
|
// return new Result().error("数据错误,刷新后重试!!");
|
|
|
|
// }
|
|
|
|
// // 2、判断人员信息表中数据如果只有一条就全删
|
|
|
|
// Integer integer = inoutRecordDao.selectByState(entity.getIdCard());
|
|
|
|
// if (integer == 1) {
|
|
|
|
// // 若同时存在,则保留基础信息,删除额外信息。
|
|
|
|
// baseDao.deleteById(entity.getId());
|
|
|
|
// }
|
|
|
|
// inoutRecordDao.deleteById(inoutRecord);
|
|
|
|
// } else {
|
|
|
|
// return new Result().error("删除参数不正确,请联系管理员查看");
|
|
|
|
// }
|
|
|
|
//根据情况进项删除
|
|
|
|
epidemicUserInoutRecordDao.deleteByIds(ids); |
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
@ -1644,7 +1627,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
FamilyMemberInfoResultDTO dto = baseDao.getFamilyMember(formDTO); |
|
|
|
|
|
|
|
// 如果记录表没有信息,需插入一条
|
|
|
|
if(dto != null && (dto.getRecordId() == null || dto.getRecordId() == 0)){ |
|
|
|
if (dto != null && (dto.getRecordId() == null || dto.getRecordId() == 0)) { |
|
|
|
// 新增epidemic_user_inout_record
|
|
|
|
EpidemicUserInoutRecordEntity epidemicUserInoutRecordEntity = new EpidemicUserInoutRecordEntity(); |
|
|
|
epidemicUserInoutRecordEntity.setIdCard(dto.getIdCard()); |
|
|
|
@ -1691,7 +1674,7 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
@Override |
|
|
|
public Result bindingFamily(BindingFamilyFormDTO formDTO) { |
|
|
|
// 新增人员
|
|
|
|
if("1".equals(formDTO.getFlag())){ |
|
|
|
if ("1".equals(formDTO.getFlag())) { |
|
|
|
// 获取部门信息
|
|
|
|
Result<ParentAndAllDeptDTO> result = adminVimFeignClient.getParentAndAllDept(formDTO.getDeptId()); |
|
|
|
ParentAndAllDeptDTO parentAndAllDeptDTO = result.getData(); |
|
|
|
@ -1715,9 +1698,21 @@ public class EpidemicUserInfoServiceImpl extends CrudServiceImpl<EpidemicUserInf |
|
|
|
EpidemicUnitOwnerEntity epidemicUnitOwnerEntity = ConvertUtils.sourceToTarget(formDTO, EpidemicUnitOwnerEntity.class); |
|
|
|
epidemicUnitOwnerEntity.setOwnerName(formDTO.getUserName()); |
|
|
|
epidemicUnitOwnerEntity.setAddress(formDTO.getHouseAddress()); |
|
|
|
epidemicUnitOwnerEntity.setId(null); |
|
|
|
epidemicUnitOwnerService.deletePhysicalByIdCardAndUnitId(formDTO.getIdCard(), formDTO.getUnitId()); |
|
|
|
epidemicUnitOwnerService.insert(epidemicUnitOwnerEntity); |
|
|
|
|
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|
private void saveHouseRelation(EpidemicReportUserInfoDTO dto) { |
|
|
|
// 绑定房屋
|
|
|
|
EpidemicUnitOwnerEntity epidemicUnitOwnerEntity = ConvertUtils.sourceToTarget(dto, EpidemicUnitOwnerEntity.class); |
|
|
|
epidemicUnitOwnerEntity.setOwnerName(dto.getUserName()); |
|
|
|
epidemicUnitOwnerEntity.setAddress(dto.getHouseAddress()); |
|
|
|
epidemicUnitOwnerEntity.setId(null); |
|
|
|
epidemicUnitOwnerService.deletePhysicalByIdCardAndUnitId(dto.getIdCard(), dto.getUnitId()); |
|
|
|
epidemicUnitOwnerService.insert(epidemicUnitOwnerEntity); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|