代码备份

dev_unify
yewj 5 months ago
parent 4db47217c4
commit 90e09f8bff

@ -77,7 +77,7 @@ public enum BasicExportTypeEnum {
/**
*
*/
DRUG_DATA_TASK("drug_data_task", "药品关联信息任"),
DRUG_DATA_TASK("drug_data_task", "药品关联关系"),
;
@EnumValue
private String key;

@ -74,8 +74,10 @@ public class SyncDataSetEntity {
private int deviceRepairApply;//报修管理
private int deviceUpkeep;//设备保养
private int produceBusiness;//生产企业 PRODUCE_BUSINESS_DATA
private int drugDataTask;//药品关联信息
/**
*
*/
private int drugDataTask;
}

@ -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
*

@ -1188,3 +1188,6 @@ CALL Pro_Temp_ColumnWork('basic_products', 'detailSort',
' tinyint DEFAULT NULL COMMENT ''明细分类''',
1);
CALL Pro_Temp_ColumnWork('sync_data_set', 'drugDataTask',
' tinyint NULL DEFAULT NULL COMMENT ''药品关联关系同步''',
1);

Loading…
Cancel
Save