From ee783ac7851243c0cb55befcdeab45f8480fc1ac Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 4 May 2023 22:06:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8C=91=E9=80=89=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/constant/BasicExportTypeEnum.java | 7 +++- .../sale/admin/thread/DlAllDataService.java | 33 +++++++++++-------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java index 908b436..2258203 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java @@ -15,7 +15,7 @@ public enum BasicExportTypeEnum { /** * 国家库DI数据 */ - COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), +// COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), /** * 单据类型 @@ -47,6 +47,11 @@ public enum BasicExportTypeEnum { */ IO_ORDER("io_order", "单据信息"), + /** + * 发票信息 + */ + ORDER_INVOICE("io_order_invoice", "扫码单据发票信息"), + ; private String key; diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java index 44e3c38..cc3ec68 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/DlAllDataService.java @@ -210,6 +210,7 @@ public class DlAllDataService { myEntity.setRemark(remark); myEntity.setIdDatas(SYNC_SCAN_ORDER); myEntity.setType(BasicProcessStatus.NEW_ALL_ORDER); + myEntity.setScheduleType(1); basicExportService.insertExportStatus(myEntity); myEntity.setStatus(Constant.SYNC_STATUS_WAIT); if (downstream.getParamValue().equals("1")) { @@ -233,15 +234,18 @@ public class DlAllDataService { } } } - if (basicExportStatusEntity.getFromType() == 0) { - BasicExportStatusEntity basicExportStatusEntity1 = basicExportStatusEntities.get(0); - basicExportStatusEntity1.setStatus(4); - spGetHttp.postUpdateBasicStatus(basicExportStatusEntity1); - spGetHttp.finishTask(basicExportStatusEntity1.getId()); - spGetHttp.updateLastTime(SYNC_SCAN_ORDER, DateUtil.formatDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); - } else { - spGetHttp.postDeleteBasicStatus(basicExportStatusEntity.getId()); - } +// if (basicExportStatusEntity.getFromType() == 0) { +// +// } else { +// spGetHttp.postDeleteBasicStatus(basicExportStatusEntity.getId()); +// } + + + BasicExportStatusEntity basicExportStatusEntity1 = basicExportStatusEntities.get(0); + basicExportStatusEntity1.setStatus(4); + spGetHttp.postUpdateBasicStatus(basicExportStatusEntity1); + spGetHttp.finishTask(basicExportStatusEntity1.getId()); + spGetHttp.updateLastTime(SYNC_SCAN_ORDER, DateUtil.formatDate(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss")); } } @@ -280,7 +284,6 @@ public class DlAllDataService { if (StrUtil.isNotBlank(bean.getTaskId())) { // 将数据写入文件 // try { - FileUtils.makeDirectory(filePath + "sync/"); String fileName = filePath + "sync/" + exportType.getRemark() + "-" + bean.getTaskId() + ".udi"; FileUtils.SaveFileAs(bean.getFileContent(), fileName); @@ -288,14 +291,13 @@ public class DlAllDataService { // log.error("从UDI自助平台拉取基础数据 文件[{}]写入异常----{}",bean.getFilePath(), e.getMessage()); // throw new RuntimeException(e); // } - BasicExportStatusEntity exportStatusEntity = BasicExportStatusEntity.builder() .id(bean.getTaskId()) .taskId(bean.getTaskId()) .status(BasicExportStatusEnum.WAIT_SYNC.getCode()) .type(exportType.getRemark()) .transportType(1) - .scheduleType(0) + .scheduleType(1) .fromType(1).remark(remark) .startTime(DateUtil.getDateTime()) .updateTime(new Date()) @@ -390,6 +392,7 @@ public class DlAllDataService { myEntity.setUpdateTime(new Date()); myEntity.setType(NEW_ALL_UDIS); myEntity.setStartTime(DateUtil.getDateTime()); + myEntity.setScheduleType(1); myEntity.setRemark("国家库DI信息:" + spSyncUdiResponse.getProductInfoEntityList().size() + " 条"); basicExportService.insertExportStatus(myEntity); if (downstream.getParamValue().equals("1")) { @@ -449,6 +452,7 @@ public class DlAllDataService { myEntity.setStartTime(DateUtil.getDateTime()); myEntity.setUpdateTime(new Date()); myEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); + myEntity.setScheduleType(1); myEntity.setRemark("医疗器械注册人信息:{} " + spSyncUdiResponse.getUdiCompanyEntities().size() + " 条"); basicExportService.insertExportStatus(myEntity); if (downstream.getParamValue().equals("1")) { @@ -522,8 +526,9 @@ public class DlAllDataService { myEntity.setCacheFilePath(fileName); basicExportService.updateExportStatus(myEntity); } - - spGetHttp.postDeleteBasicStatus(basicExportStatusEntity.getId()); +// BasicExportStatusEntity basicExportStatusEntity1 = basicExportStatusEntities.get(0); + basicExportStatusEntity.setStatus(4); + spGetHttp.postUpdateBasicStatus(basicExportStatusEntity); } } From 4e02998626589815449663137606aa8c28df0348 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Fri, 5 May 2023 14:11:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=8C=91=E9=80=89=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java index 2258203..e1a76bd 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/constant/BasicExportTypeEnum.java @@ -15,7 +15,7 @@ public enum BasicExportTypeEnum { /** * 国家库DI数据 */ -// COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), + COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), /** * 单据类型