From b7c2690d56873722089d40f813ed2738691054ae Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 27 Apr 2023 14:32:56 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/constant/BasicExportTypeEnum.java | 2 +- .../glxp/api/constant/BasicProcessStatus.java | 2 +- .../sync/SpsSyncDownloadController.java | 4 +- .../api/dao/system/SystemPDFTemplateDao.java | 6 +- .../system/SystemPDFTemplateEntity.java | 21 +++++- .../glxp/api/res/sync/BaseSyncResponse.java | 2 +- .../service/sync/SpsSyncDownloadService.java | 17 ++++- .../impl/SystemPDFTemplateServiceImpl.java | 2 +- .../mapper/system/SystemPDFTemplateDao.xml | 72 +------------------ 9 files changed, 42 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java index 7dedff99..d8f662fc 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java @@ -19,7 +19,7 @@ public enum BasicExportTypeEnum { /** * 国家库DI数据 */ - COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), +// COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), /** * 单据类型 diff --git a/src/main/java/com/glxp/api/constant/BasicProcessStatus.java b/src/main/java/com/glxp/api/constant/BasicProcessStatus.java index 38029eb6..2db63ac3 100644 --- a/src/main/java/com/glxp/api/constant/BasicProcessStatus.java +++ b/src/main/java/com/glxp/api/constant/BasicProcessStatus.java @@ -29,7 +29,7 @@ public class BasicProcessStatus { public static final String NEW_ALL_BUS = "8"; public static final String NEW_ALL_ORDER = "出入库扫码单据"; public static final String NEW_ALL_BUS_ORDER = "业务单据"; - public static final String NEW_ALL_DI = "10"; + public static final String NEW_ALL_UDIS = "国家库数据"; public static final String NEW_ALL_THR_DATA = "12"; //所有第三方基础数据 public static final String NEW_ALL_THR_PRODUCTS = "13"; //所有第三方产品数据 diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index b90b85b0..d62a333c 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -352,7 +352,6 @@ public class SpsSyncDownloadController { case SYS_SET_DATA: saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class)); break; - case COUNTRY_DI_DATA: } String taskId = obj.getStr("taskId"); BasicDownloadStatusEntity downloadStatus = BasicDownloadStatusEntity.builder() @@ -422,7 +421,8 @@ public class SpsSyncDownloadController { systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities()); } if (CollectionUtil.isNotEmpty(bean.getSystemPDFTemplateEntities())) { - systemPDFTemplateDao.insertOrUpdateBatch(bean.getSystemPDFTemplateEntities()); + for (SystemPDFTemplateEntity systemPDFTemplateEntity : bean.getSystemPDFTemplateEntities()) + systemPDFTemplateDao.insertOrUpdate(systemPDFTemplateEntity); } if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceCodeEntities())) { sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities()); diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java index 7be977ac..9e93b3f3 100644 --- a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java @@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper -public interface SystemPDFTemplateDao extends BaseMapperPlus { +public interface SystemPDFTemplateDao extends BaseMapperPlus { List queryPage(FilterPdfTemplateRequest filterPdfTemplateRequest); @@ -17,13 +17,11 @@ public interface SystemPDFTemplateDao extends BaseMapperPlus files; + private List syncFiles; private String updateTime; } diff --git a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java index eefa3c08..5a948f45 100644 --- a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java @@ -47,6 +47,8 @@ import java.io.IOException; import java.util.*; import java.util.function.Function; +import static com.glxp.api.constant.BasicProcessStatus.NEW_ALL_UDIS; + @Slf4j @Service @RequiredArgsConstructor @@ -111,7 +113,7 @@ public class SpsSyncDownloadService { public void syncDiProductsTask() { BasicExportStatusEntity exportStatus = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) - .eq(BasicExportStatusEntity::getType, BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark()) + .eq(BasicExportStatusEntity::getType, NEW_ALL_UDIS) .orderByDesc(BasicExportStatusEntity::getStartTime) .last("limit 1") ); @@ -126,7 +128,7 @@ public class SpsSyncDownloadService { BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); basicExportStatusEntity.setId(CustomUtil.getId()); basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); - basicExportStatusEntity.setType(BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark()); + basicExportStatusEntity.setType(NEW_ALL_UDIS); basicExportStatusEntity.setUpdateTime(new Date()); basicExportStatusEntity.setStartTime(new Date()); basicExportStatusEntity.setStatus(BasicExportStatusEnum.WAIT_TRIGGERED.getCode()); @@ -310,6 +312,7 @@ public class SpsSyncDownloadService { BasicExportTypeEnum exportType = BasicExportTypeEnum.BASIC_DATA; //文件数据 Map jsonMap = new WeakHashMap<>(4); + List syncFiles = new ArrayList<>(); Map> totalTimeMap = new WeakHashMap<>(10); try { //确认有开启物资字典由外向内同步 @@ -375,6 +378,14 @@ public class SpsSyncDownloadService { ); if (CollectionUtil.isNotEmpty(supCertList)) { jsonMap.put(SupCertEntity.class.getSimpleName(), supCertList); + for (SupCertEntity supCertEntity : supCertList) { + if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) { + syncFiles.add(supCertEntity.getFilePath()); + } + } + if (CollUtil.isNotEmpty(syncFiles)) { + jsonMap.put("syncFiles", syncFiles); + } } List supCertSetList = supCertSetService.list(Wrappers.lambdaQuery(SupCertSetEntity.class) .le((boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime, now) @@ -825,7 +836,7 @@ public class SpsSyncDownloadService { } } - syncOrderResponse.setFiles(syncFiles); + syncOrderResponse.setSyncFiles(syncFiles); syncOrderResponse.setCodeEntities(codeEntities); syncOrderResponse.setOrderDetailBizEntities(orderDetailBizEntities); syncOrderResponse.setOrderDetailCodeEntities(orderDetailCodeEntities); diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java index 78941721..cf3ed39c 100644 --- a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java @@ -50,7 +50,7 @@ public class SystemPDFTemplateServiceImpl extends ServiceImpl - - - + UPDATE sys_pdf_template @@ -117,65 +110,4 @@ from sys_pdf_template where id = #{id} - - - insert into sys_pdf_template - - - id, - - `name`, - `type`, - `module`, - param, - `path`, - `rowCount`, - qrcodeCount, - remark, - create_time, - update_time, - jrxmlPath, - bussinessType, - bussinessStatus, - - values - - - #{id,jdbcType=INTEGER}, - - #{name,jdbcType=VARCHAR}, - #{type,jdbcType=INTEGER}, - #{module,jdbcType=INTEGER}, - #{param,jdbcType=VARCHAR}, - #{path,jdbcType=VARCHAR}, - #{rowCount,jdbcType=INTEGER}, - #{qrcodeCount,jdbcType=INTEGER}, - #{remark,jdbcType=VARCHAR}, - #{create_time,jdbcType=TIMESTAMP}, - #{update_time,jdbcType=TIMESTAMP}, - #{jrxmlPath,jdbcType=VARCHAR}, - #{bussinessType,jdbcType=VARCHAR}, - #{bussinessStatus,jdbcType=VARCHAR}, - - on duplicate key update - - - id = #{id,jdbcType=INTEGER}, - - `name` = #{name,jdbcType=VARCHAR}, - `type` = #{type,jdbcType=INTEGER}, - `module` = #{module,jdbcType=INTEGER}, - param = #{param,jdbcType=VARCHAR}, - `path` = #{path,jdbcType=VARCHAR}, - `rowCount` = #{rowCount,jdbcType=INTEGER}, - qrcodeCount = #{qrcodeCount,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR}, - create_time = #{create_time,jdbcType=TIMESTAMP}, - update_time = #{update_time,jdbcType=TIMESTAMP}, - jrxmlPath = #{jrxmlPath,jdbcType=VARCHAR}, - bussinessType = #{bussinessType,jdbcType=VARCHAR}, - bussinessStatus = #{bussinessStatus,jdbcType=VARCHAR}, - - - \ No newline at end of file +