|
|
@ -15,15 +15,13 @@ import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.constants.ImportTaskConstants; |
|
|
|
import com.epmet.dao.IcNatRelationDao; |
|
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
|
import com.epmet.dao.IcVaccineDao; |
|
|
|
import com.epmet.dao.UserBaseInfoDao; |
|
|
|
import com.epmet.dao.*; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.IcNatRelationEntity; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.entity.IcVaccineEntity; |
|
|
|
import com.epmet.entity.IcVaccineRelationEntity; |
|
|
|
import com.epmet.excel.data.IcNatImportExcelData; |
|
|
|
import com.epmet.excel.handler.IcNatExcelImportListener; |
|
|
|
import com.epmet.excel.handler.IcVaccineExcelImportListener; |
|
|
@ -73,6 +71,8 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
|
@Autowired |
|
|
|
private IcNatRelationDao icNatRelationDao; |
|
|
|
@Autowired |
|
|
|
private IcVaccineRelationDao icVaccineRelationDao; |
|
|
|
@Autowired |
|
|
|
private IcResiUserDao icResiUserDao; |
|
|
|
@Autowired |
|
|
|
private UserService userService; |
|
|
@ -143,15 +143,15 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
|
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); |
|
|
|
} |
|
|
|
//2.不管是否已存在关系数据都是先删后增
|
|
|
|
icNatRelationDao.delRelation(formDTO.getIcVaccineId(), staffInfo.getAgencyId()); |
|
|
|
icVaccineRelationDao.delRelation(formDTO.getIcVaccineId(), staffInfo.getAgencyId()); |
|
|
|
//3.新增关系数据
|
|
|
|
IcNatRelationEntity relationEntity = new IcNatRelationEntity(); |
|
|
|
relationEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
relationEntity.setIcNatId(formDTO.getIcNatId()); |
|
|
|
relationEntity.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
relationEntity.setPids(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+staffInfo.getAgencyId():staffInfo.getAgencyId()); |
|
|
|
relationEntity.setUserType("synchro"); |
|
|
|
icNatRelationDao.insert(relationEntity); |
|
|
|
IcVaccineRelationEntity icVaccineRelationEntity = new IcVaccineRelationEntity(); |
|
|
|
icVaccineRelationEntity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
icVaccineRelationEntity.setIcVaccineId(formDTO.getIcVaccineId()); |
|
|
|
icVaccineRelationEntity.setAgencyId(staffInfo.getAgencyId()); |
|
|
|
icVaccineRelationEntity.setPids(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotBlank(staffInfo.getAgencyPIds())?staffInfo.getAgencyPIds()+":"+staffInfo.getAgencyId():staffInfo.getAgencyId()); |
|
|
|
icVaccineRelationEntity.setUserType("synchro"); |
|
|
|
icVaccineRelationDao.insert(icVaccineRelationEntity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -168,8 +168,8 @@ public class IcVaccineServiceImpl extends BaseServiceImpl<IcVaccineDao, IcVaccin |
|
|
|
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId())); |
|
|
|
} |
|
|
|
//1.物理删除关系数据
|
|
|
|
if (icNatRelationDao.delRelation(formDTO.getIcNatId(), staffInfo.getAgencyId()) < NumConstant.ONE) { |
|
|
|
log.error(String.format("数据取消同步失败,疫苗记录Id->%s", formDTO.getIcNatId())); |
|
|
|
if (icVaccineRelationDao.delRelation(formDTO.getIcVaccineId(), staffInfo.getAgencyId()) < NumConstant.ONE) { |
|
|
|
log.error(String.format("数据取消同步失败,疫苗记录Id->%s", formDTO.getAgencyId())); |
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消同步操作失败"); |
|
|
|
} |
|
|
|
} |
|
|
|