|
|
|
@ -257,34 +257,34 @@ public class SpsSyncDownloadService {
|
|
|
|
|
, x -> x.generateDevTaskDataFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_INFO_DATA:
|
|
|
|
|
basicExportInfoCreate(exportType,syncTime,now
|
|
|
|
|
basicExportInfoCreate(exportType, syncTime, now
|
|
|
|
|
, x -> x.generateDeviceInfoFile(info, now, false, syncTime)
|
|
|
|
|
,x -> x.generateDeviceInfoFile(info, now, true, syncTime));
|
|
|
|
|
, x -> x.generateDeviceInfoFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_CHECK_DATA:
|
|
|
|
|
basicExportInfoCreate(exportType,syncTime,now
|
|
|
|
|
basicExportInfoCreate(exportType, syncTime, now
|
|
|
|
|
, x -> x.generateDeviceCheckFile(info, now, false, syncTime)
|
|
|
|
|
,x -> x.generateDeviceCheckFile(info, now, true, syncTime));
|
|
|
|
|
, x -> x.generateDeviceCheckFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_REPAIR_DATA:
|
|
|
|
|
basicExportInfoCreate(exportType,syncTime,now
|
|
|
|
|
basicExportInfoCreate(exportType, syncTime, now
|
|
|
|
|
, x -> x.generateDeviceRepairFile(info, now, false, syncTime)
|
|
|
|
|
,x -> x.generateDeviceRepairFile(info, now, true, syncTime));
|
|
|
|
|
, x -> x.generateDeviceRepairFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
case DEVICE_UPKEEP_DATA:
|
|
|
|
|
basicExportInfoCreate(exportType,syncTime,now
|
|
|
|
|
basicExportInfoCreate(exportType, syncTime, now
|
|
|
|
|
, x -> x.generateDeviceUpkeepFile(info, now, false, syncTime)
|
|
|
|
|
,x -> x.generateDeviceUpkeepFile(info, now, true, syncTime));
|
|
|
|
|
, x -> x.generateDeviceUpkeepFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
case PRODUCE_BUSINESS_DATA:
|
|
|
|
|
basicExportInfoCreate(exportType,syncTime,now
|
|
|
|
|
basicExportInfoCreate(exportType, syncTime, now
|
|
|
|
|
, x -> x.generateProBusFile(info, now, false, syncTime)
|
|
|
|
|
,x -> x.generateProBusFile(info, now, true, syncTime));
|
|
|
|
|
, x -> x.generateProBusFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
case DRUG_DATA_TASK:
|
|
|
|
|
basicExportInfoCreate(exportType,syncTime,now
|
|
|
|
|
basicExportInfoCreate(exportType, syncTime, now
|
|
|
|
|
, x -> x.generateDrugDataFile(info, now, false, syncTime)
|
|
|
|
|
,x -> x.generateDrugDataFile(info, now, true, syncTime));
|
|
|
|
|
, x -> x.generateDrugDataFile(info, now, true, syncTime));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -854,12 +854,12 @@ public class SpsSyncDownloadService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceInfoService deviceInfoService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 设备信息同步
|
|
|
|
|
*
|
|
|
|
|
* @param info
|
|
|
|
|
* @param now
|
|
|
|
|
* @param createFile
|
|
|
|
@ -987,7 +987,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceCheckDetailItemEntities)) {
|
|
|
|
|
log.error("设备巡检项目信息:"+deviceCheckDetailItemEntities);
|
|
|
|
|
log.error("设备巡检项目信息:" + deviceCheckDetailItemEntities);
|
|
|
|
|
remark.append("设备巡检项目信息:").append(deviceCheckDetailItemEntities.size()).append("条\n");
|
|
|
|
|
jsonMap.put(DeviceCheckDetailItemEntity.class.getSimpleName(), deviceCheckDetailItemEntities);
|
|
|
|
|
}
|
|
|
|
@ -998,7 +998,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
, map.get("oldDate"), now)
|
|
|
|
|
);
|
|
|
|
|
if (CollectionUtil.isNotEmpty(deviceCheckItemDictEntities)) {
|
|
|
|
|
log.error("设备巡检项目字典信息:"+deviceCheckItemDictEntities);
|
|
|
|
|
log.error("设备巡检项目字典信息:" + deviceCheckItemDictEntities);
|
|
|
|
|
remark.append("设备巡检项目字典信息:").append(deviceCheckItemDictEntities.size()).append("条\n");
|
|
|
|
|
jsonMap.put(DeviceCheckItemDictEntity.class.getSimpleName(), deviceCheckItemDictEntities);
|
|
|
|
|
}
|
|
|
|
@ -1116,7 +1116,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
log.error("接收到的各种图片集合{}",syncFiles);
|
|
|
|
|
log.error("接收到的各种图片集合{}", syncFiles);
|
|
|
|
|
if (CollUtil.isNotEmpty(syncFiles)) {
|
|
|
|
|
jsonMap.put("syncFiles", syncFiles);
|
|
|
|
|
}
|
|
|
|
@ -1164,6 +1164,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
DeviceUpkeepDetailItemService deviceUpkeepDetailItemService;
|
|
|
|
|
|
|
|
|
|
protected boolean generateDeviceUpkeepFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) {
|
|
|
|
|
BasicExportTypeEnum exportType = BasicExportTypeEnum.DEVICE_UPKEEP_DATA;
|
|
|
|
|
//文件数据
|
|
|
|
@ -1248,8 +1249,10 @@ public class SpsSyncDownloadService {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
ThrManufacturerService thrManufacturerService;
|
|
|
|
|
|
|
|
|
|
// 生产企业 generateProBusFile
|
|
|
|
|
protected boolean generateProBusFile(SyncDataSetResponse info, Date now, boolean createFile, Date syncTime) {
|
|
|
|
|
BasicExportTypeEnum exportType = BasicExportTypeEnum.PRODUCE_BUSINESS_DATA;
|
|
|
|
@ -1333,14 +1336,14 @@ public class SpsSyncDownloadService {
|
|
|
|
|
ge = true;
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
//确认有开启报修设备管理信息由外向内同步
|
|
|
|
|
//确认有开启关联关系由外向内同步
|
|
|
|
|
if (needExec(info.getDrugDataTask())) {
|
|
|
|
|
Map<String, Object> map = basicExportStatusTimeInfo(now, BasicExportStatusTimeEnum.DRUG_DATA_TASK, createFile);
|
|
|
|
|
totalTimeMap.put(BasicExportStatusTimeEnum.DRUG_DATA_TASK, map);
|
|
|
|
|
SpsSyncDrugDataTaskResponse dataResponse = null;
|
|
|
|
|
|
|
|
|
|
List<RelCodeBatch> relCodeBatches = relCodeBatchService.list(Wrappers.lambdaQuery(RelCodeBatch.class)
|
|
|
|
|
.in(RelCodeBatch::getUploadFlagDown,0)
|
|
|
|
|
.in(RelCodeBatch::getUploadFlagDown, 0)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (CollectionUtil.isNotEmpty(relCodeBatches)) {
|
|
|
|
@ -1350,11 +1353,11 @@ public class SpsSyncDownloadService {
|
|
|
|
|
//增加明细数据
|
|
|
|
|
List<Integer> batchIds = relCodeBatches.stream().map(RelCodeBatch::getId).collect(Collectors.toList());
|
|
|
|
|
List<RelCodeDetail> list = relCodeDetailService.list(Wrappers.lambdaQuery(RelCodeDetail.class)
|
|
|
|
|
.in(RelCodeDetail::getBatchIdFk,batchIds));
|
|
|
|
|
.in(RelCodeDetail::getBatchIdFk, batchIds));
|
|
|
|
|
dataResponse.setRelCodeDetails(list);
|
|
|
|
|
|
|
|
|
|
jsonMap.put(SpsSyncDrugDataTaskResponse.class.getSimpleName(), dataResponse);
|
|
|
|
|
remark.append("药品关联信息任务:").append(relCodeBatches.size()).append("条\n");
|
|
|
|
|
remark.append("药品关联关系任务:").append(relCodeBatches.size()).append("条\n");
|
|
|
|
|
boolean update = relCodeBatchService.update(new LambdaUpdateWrapper<RelCodeBatch>().set(RelCodeBatch::getUploadFlagDown, 1).in(RelCodeBatch::getId, batchIds));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1390,6 +1393,7 @@ public class SpsSyncDownloadService {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 插入 basicExportStatusTime表
|
|
|
|
|
*
|
|
|
|
|