|
@ -23,10 +23,7 @@ import com.epmet.dao.IcVaccineDao; |
|
|
import com.epmet.dao.IcVaccineRelationDao; |
|
|
import com.epmet.dao.IcVaccineRelationDao; |
|
|
import com.epmet.dto.IcVaccineDTO; |
|
|
import com.epmet.dto.IcVaccineDTO; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.form.*; |
|
|
import com.epmet.dto.result.IcVaccineListResultDTO; |
|
|
import com.epmet.dto.result.*; |
|
|
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.UploadImgResultDTO; |
|
|
|
|
|
import com.epmet.dto.result.VaccineListDTO; |
|
|
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
import com.epmet.entity.IcVaccineEntity; |
|
|
import com.epmet.entity.IcVaccineEntity; |
|
|
import com.epmet.entity.IcVaccineRelationEntity; |
|
|
import com.epmet.entity.IcVaccineRelationEntity; |
|
@ -369,7 +366,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
|
|
|
|
|
|
// 建立关系
|
|
|
// 建立关系
|
|
|
if (resi != null) { |
|
|
if (resi != null) { |
|
|
createVaccineRelation(resiVaccine.getId(), resi.getAgencyId(), resi.getPids()); |
|
|
createVaccineRelation(resiVaccine.getId(), resi.getAgencyId(), resi.getPids(), agencyPids); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return; |
|
|
return; |
|
@ -383,7 +380,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
|
|
|
|
|
|
// 只要是居民,就创建上关系
|
|
|
// 只要是居民,就创建上关系
|
|
|
if (resi != null) { |
|
|
if (resi != null) { |
|
|
createVaccineRelation(e.getId(), resi.getAgencyId(), resi.getPids()); |
|
|
createVaccineRelation(e.getId(), resi.getAgencyId(), resi.getPids(), agencyPids); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -425,7 +422,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
* @param vaccineId |
|
|
* @param vaccineId |
|
|
* @param currentUserAgencyId |
|
|
* @param currentUserAgencyId |
|
|
*/ |
|
|
*/ |
|
|
private void createVaccineRelation(String vaccineId, String currentUserAgencyId, String agencyPids) { |
|
|
private void createVaccineRelation(String vaccineId, String currentUserAgencyId, String agencyPids, String tokenAgencyPids) { |
|
|
|
|
|
|
|
|
// 没有关系创建关系,有关系就跳过
|
|
|
// 没有关系创建关系,有关系就跳过
|
|
|
LambdaQueryWrapper<IcVaccineRelationEntity> query = new LambdaQueryWrapper<>(); |
|
|
LambdaQueryWrapper<IcVaccineRelationEntity> query = new LambdaQueryWrapper<>(); |
|
@ -440,6 +437,7 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
relation.setPids(String.join(":", Arrays.asList(agencyPids, currentUserAgencyId))); |
|
|
relation.setPids(String.join(":", Arrays.asList(agencyPids, currentUserAgencyId))); |
|
|
relation.setIcVaccineId(vaccineId); |
|
|
relation.setIcVaccineId(vaccineId); |
|
|
relation.setUserType("import"); |
|
|
relation.setUserType("import"); |
|
|
|
|
|
relation.setIsLocalResiUser(tokenAgencyPids.contains(currentUserAgencyId) ? NumConstant.ONE_STR : NumConstant.ZERO_STR); |
|
|
icVaccineRelationDao.insert(relation); |
|
|
icVaccineRelationDao.insert(relation); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -508,6 +506,9 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
IcVaccineRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcVaccineRelationEntity.class); |
|
|
IcVaccineRelationEntity relationEntity = ConvertUtils.sourceToTarget(formDTO, IcVaccineRelationEntity.class); |
|
|
relationEntity.setIcVaccineId(entity.getId()); |
|
|
relationEntity.setIcVaccineId(entity.getId()); |
|
|
relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId()); |
|
|
relationEntity.setPids(StringUtils.isNotBlank(agencyInfo.getPids()) ? agencyInfo.getPids() + ":" + formDTO.getAgencyId() : formDTO.getAgencyId()); |
|
|
|
|
|
//判断当前身份证号是否本辖区下居民
|
|
|
|
|
|
ResiAndLocalResiResultDTO resiCount = icResiUserDao.getResiCount(formDTO.getAgencyId(), formDTO.getIdCard(), formDTO.getCustomerId()); |
|
|
|
|
|
relationEntity.setIsLocalResiUser(resiCount.getIsLocal() == NumConstant.ZERO ? NumConstant.ZERO_STR : NumConstant.ONE_STR); |
|
|
icVaccineRelationDao.insert(relationEntity); |
|
|
icVaccineRelationDao.insert(relationEntity); |
|
|
|
|
|
|
|
|
//3.新增通知表信息
|
|
|
//3.新增通知表信息
|
|
|