From f106f2813c1ea26e948f0e9781e0b2a020815f7b Mon Sep 17 00:00:00 2001 From: MrZhai Date: Mon, 7 Mar 2022 18:40:20 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9json=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=B8=BAudi=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/basic/CorpExportLogController.java | 4 ++-- .../controller/basic/CorpImportLogController.java | 13 ++++--------- .../basic/UdiInfoExportLogController.java | 4 ++-- .../basic/UdiInfoImportLogController.java | 12 ++++-------- .../thrsys/ThrCorpImportLogController.java | 4 ++-- .../thrsys/ThrProductsImportLogController.java | 4 ++-- 6 files changed, 16 insertions(+), 25 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpExportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpExportLogController.java index 638ce0c..b6ad92c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpExportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpExportLogController.java @@ -110,7 +110,7 @@ public class CorpExportLogController { CorpExportLogEntity corpExportLogEntity = new CorpExportLogEntity(); corpExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS); String genKey = CustomUtil.getId(); - String fileName = "D:\\udiwms\\exportFile\\" + "往来单位信息" + genKey + ".json"; + String fileName = "D:\\udiwms\\exportFile\\" + "往来单位信息" + genKey + ".udi"; corpExportLogEntity.setGenKey(genKey); corpExportLogEntity.setFilePath(fileName); corpExportLogEntity.setUpdateTime(new Date()); @@ -118,7 +118,7 @@ public class CorpExportLogController { corpExportLogEntity.setType(BasicProcessStatus.EXPORT_EXCEL); corpExportLogService.insertCorpExportLog(corpExportLogEntity); basicGenExcelService.exportCorp(genKey, corpsExportRequest); - return ResultVOUtils.success("后台正在导出生成excel文件,请稍后刷新查看!"); + return ResultVOUtils.success("后台正在导出生成udi文件,请稍后刷新查看!"); } //往来单位上传SMP,并创建生成记录 diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java index 312acda..7cd3aa8 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/CorpImportLogController.java @@ -4,7 +4,6 @@ import cn.hutool.core.io.IoUtil; import cn.hutool.json.JSONUtil; import com.github.pagehelper.PageInfo; import com.glxp.sale.admin.constant.BasicProcessStatus; -import com.glxp.sale.admin.entity.basic.BasicThirdSysEntity; import com.glxp.sale.admin.entity.basic.BasicUnitMaintainEntity; import com.glxp.sale.admin.entity.basic.CorpImportDetailEntity; import com.glxp.sale.admin.entity.basic.CorpImportLogEntity; @@ -21,18 +20,14 @@ import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; import lombok.extern.slf4j.Slf4j; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -133,7 +128,7 @@ public class CorpImportLogController { //解析数据 try { String fileType = fileName.substring(fileName.lastIndexOf(".")); - if (".json".equals(fileType.toLowerCase())) { + if (".udi".equals(fileType.toLowerCase())) { String jsonData = IoUtil.read(file.getInputStream()).toString(); List basicUnitMaintainEntities = JSONUtil.toList(jsonData, BasicUnitMaintainEntity.class); @@ -149,7 +144,7 @@ public class CorpImportLogController { corpImportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_SUCCESS); corpImportLogService.updateImportLog(corpImportLogEntity); } else { - return ResultVOUtils.error(500, "请上传json文件"); + return ResultVOUtils.error(500, "请上传udi文件"); } } catch (Exception e) { log.error("导入往来单位信息错误,文件名为:{}", fileName); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoExportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoExportLogController.java index 25c1704..6de0df7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoExportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoExportLogController.java @@ -116,7 +116,7 @@ public class UdiInfoExportLogController { UdiInfoExportLogEntity udiInfoExportLogEntity = new UdiInfoExportLogEntity(); udiInfoExportLogEntity.setStatus(BasicProcessStatus.UDIINFO_IMPORT_PROCESS); String genKey = CustomUtil.getId(); - String fileName = "D:\\udiwms\\exportFile\\" + "器械信息" + genKey + ".json"; + String fileName = "D:\\udiwms\\exportFile\\" + "器械信息" + genKey + ".udi"; udiInfoExportLogEntity.setGenKey(genKey); udiInfoExportLogEntity.setFilePath(fileName); udiInfoExportLogEntity.setUpdateTime(new Date()); @@ -124,7 +124,7 @@ public class UdiInfoExportLogController { udiInfoExportLogEntity.setType(BasicProcessStatus.EXPORT_EXCEL); udiInfoExportLogService.insertUdiInfoExportLog(udiInfoExportLogEntity); basicGenExcelService.exportJsonUdiInfo(genKey, udiInfoExportRequest); - return ResultVOUtils.success("后台正在导出生成excel文件,请稍后刷新查看!"); + return ResultVOUtils.success("后台正在导出生成udi件,请稍后刷新查看!"); } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoImportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoImportLogController.java index 3481452..9785198 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoImportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoImportLogController.java @@ -18,9 +18,8 @@ import com.glxp.sale.admin.util.CustomUtil; import com.glxp.sale.common.enums.ResultEnum; import com.glxp.sale.common.res.BaseResponse; import com.glxp.sale.common.util.ResultVOUtils; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.validation.BindingResult; @@ -29,10 +28,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.File; -import java.io.IOException; -import java.io.InputStream; import java.sql.Date; -import java.util.ArrayList; import java.util.List; /** @@ -133,8 +129,8 @@ public class UdiInfoImportLogController { String fileName = file.getOriginalFilename(); try { String fileType = fileName.substring(fileName.lastIndexOf(".")); - if (!".json".equals(fileType.toLowerCase())) { - return ResultVOUtils.error(500, "请上传json文件"); + if (!".udi".equals(fileType.toLowerCase())) { + return ResultVOUtils.error(500, "请上传udi文件"); } //导入数据 String jsonData = IoUtil.read(file.getInputStream()).toString(); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrCorpImportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrCorpImportLogController.java index c27b019..f4580e7 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrCorpImportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrCorpImportLogController.java @@ -108,8 +108,8 @@ public class ThrCorpImportLogController { String fileName = file.getOriginalFilename(); try { String fileType = fileName.substring(fileName.lastIndexOf(".")); - if (!".json".equals(fileType.toLowerCase())) { - return ResultVOUtils.error(500, "请上传json文件"); + if (!".udi".equals(fileType.toLowerCase())) { + return ResultVOUtils.error(500, "请上传udi文件"); } //导入数据 String jsonData = IoUtil.read(file.getInputStream()).toString(); diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrProductsImportLogController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrProductsImportLogController.java index 8d1ff8d..e9aa63b 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrProductsImportLogController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/thrsys/ThrProductsImportLogController.java @@ -110,8 +110,8 @@ public class ThrProductsImportLogController { String fileName = file.getOriginalFilename(); try { String fileType = fileName.substring(fileName.lastIndexOf(".")); - if (!".json".equals(fileType.toLowerCase())) { - return ResultVOUtils.error(500, "请上传json文件"); + if (!".udi".equals(fileType.toLowerCase())) { + return ResultVOUtils.error(500, "请上传udi文件"); } //导入数据 String jsonData = IoUtil.read(file.getInputStream()).toString();