|
|
@ -408,10 +408,6 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void natInfoSyncButton(DataSyncTaskParam formDTO) { |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new EpmetException("未查询到工作人员信息:"+formDTO.getStaffId()); |
|
|
|
} |
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(formDTO.getAgencyId()); |
|
|
|
if (null == agencyInfo){ |
|
|
|
throw new EpmetException("未查询到组织信息:"+formDTO.getAgencyId()); |
|
|
@ -420,6 +416,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
// 查询该组织是否存在等待中或者进行中的任务
|
|
|
|
LambdaQueryWrapper<IcSyncJobEntity> qw = new LambdaQueryWrapper<>(); |
|
|
|
qw.eq(IcSyncJobEntity::getOrgId,formDTO.getAgencyId()) |
|
|
|
.eq(IcSyncJobEntity::getJobType,formDTO.getJobType()) |
|
|
|
.in(IcSyncJobEntity::getOperationStatus,OPERATION_STATUS_WAITING,OPERATION_STATUS_PROCESSING); |
|
|
|
List<IcSyncJobEntity> icSyncJobEntities = icSyncJobDao.selectList(qw); |
|
|
|
// 当前组织下存在同步任务
|
|
|
@ -433,43 +430,10 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
e.setOrgId(formDTO.getAgencyId()); |
|
|
|
e.setPid(agencyInfo.getPid()); |
|
|
|
e.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) ? agencyInfo.getId() : agencyInfo.getPids()+":"+agencyInfo.getId()); |
|
|
|
e.setJobType(JOB_TYPE_NAT); |
|
|
|
e.setJobType(formDTO.getJobType()); |
|
|
|
e.setOperatorId(formDTO.getStaffId()); |
|
|
|
e.setOperationStatus(OPERATION_STATUS_WAITING); |
|
|
|
insertSync(e); |
|
|
|
|
|
|
|
//List<IcSyncJobEntity> waitList;
|
|
|
|
//do {
|
|
|
|
// LambdaQueryWrapper<IcSyncJobEntity> qw3 = new LambdaQueryWrapper<>();
|
|
|
|
// qw3.eq(IcSyncJobEntity::getCustomerId,formDTO.getCustomerId())
|
|
|
|
// .eq(IcSyncJobEntity::getOperationStatus,OPERATION_STATUS_WAITING)
|
|
|
|
// .eq(IcSyncJobEntity::getJobType,JOB_TYPE_NAT)
|
|
|
|
// .orderByAsc(BaseEpmetEntity::getCreatedTime);
|
|
|
|
// waitList = icSyncJobDao.selectList(qw3);
|
|
|
|
// if (CollectionUtils.isNotEmpty(waitList)){
|
|
|
|
// for (IcSyncJobEntity entity : waitList) {
|
|
|
|
// RLock lock = null;
|
|
|
|
// try {
|
|
|
|
// lock = distributedLock.getLock(entity.getOrgId() + JOB_TYPE_NAT, 60L, 60L, TimeUnit.SECONDS);
|
|
|
|
// updateSync(entity.getId(),OPERATION_STATUS_PROCESSING);
|
|
|
|
// }catch (Exception ex){
|
|
|
|
// log.error(ex.getMessage());
|
|
|
|
// throw new EpmetException(ex.getMessage());
|
|
|
|
// }finally {
|
|
|
|
// lock.unlock();
|
|
|
|
// }
|
|
|
|
// formDTO.setAgencyId(entity.getOrgId());
|
|
|
|
// try {
|
|
|
|
// natInfoScanTask(formDTO);
|
|
|
|
// }catch (Exception ee){
|
|
|
|
// log.error(ee.getMessage());
|
|
|
|
// throw new EpmetException(ee.getMessage());
|
|
|
|
// }finally {
|
|
|
|
// updateSync(entity.getId(),OPERATION_STATUS_FINISH);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//}while (CollectionUtils.isNotEmpty(waitList));
|
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@ -1103,7 +1067,7 @@ public class DataSyncConfigServiceImpl extends BaseServiceImpl<DataSyncConfigDao |
|
|
|
// todo 疫苗接种视图
|
|
|
|
|
|
|
|
List<Map<String, Object>> vaccineList = yantaiNamedParamLantuJdbcTemplate.queryForList( |
|
|
|
"select id, name,card_no, create_time, realname from hscyxxb where card_no in (:idcards)", args); |
|
|
|
"select id, name,card_no, create_time from hscyxxb where card_no in (:idcards)", args); |
|
|
|
if (CollectionUtils.isNotEmpty(vaccineList)) { |
|
|
|
List<IcVaccineEntity> entities = new ArrayList<>(); |
|
|
|
vaccineList.forEach(resiVaccineInfo -> { |
|
|
|