From dd9662091a999fd861bdb53c756d785431eb763d Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Thu, 16 Jan 2025 15:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF=E5=BE=85?= =?UTF-8?q?=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/njcn/gather/result/service/IResultService.java | 5 +++++ .../gather/device/device/controller/PqDevController.java | 8 +++++--- .../njcn/gather/device/device/service/IPqDevService.java | 4 ++-- .../device/device/service/impl/PqDevServiceImpl.java | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/detection/src/main/java/com/njcn/gather/result/service/IResultService.java b/detection/src/main/java/com/njcn/gather/result/service/IResultService.java index 96137d9c..1d0e76d4 100644 --- a/detection/src/main/java/com/njcn/gather/result/service/IResultService.java +++ b/detection/src/main/java/com/njcn/gather/result/service/IResultService.java @@ -40,4 +40,9 @@ public interface IResultService { ResultVO resultData(ResultParam param); + /** + * 导出原始数据 + * @param param + */ + void exportRawData(ResultParam param); } diff --git a/device/src/main/java/com/njcn/gather/device/device/controller/PqDevController.java b/device/src/main/java/com/njcn/gather/device/device/controller/PqDevController.java index e58d5da2..e82b5c30 100644 --- a/device/src/main/java/com/njcn/gather/device/device/controller/PqDevController.java +++ b/device/src/main/java/com/njcn/gather/device/device/controller/PqDevController.java @@ -233,9 +233,9 @@ public class PqDevController extends BaseController { */ @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD) @PostMapping(value = "/importCNDev") - @ApiOperation("批量设备数据") + @ApiOperation("批量导入设备数据") @ApiImplicitParam(name = "file", value = "被检设备数据文件", required = true) - public HttpResult importCNDev(@RequestParam("file") MultipartFile file, String pattern, HttpServletResponse response) { + public HttpResult importCNDev(@RequestParam("file") MultipartFile file, String patternId, HttpServletResponse response) { String methodDescribe = getMethodDescribe("importCNDev"); LogUtil.njcnDebug(log, "{},上传文件为:{}", methodDescribe, file.getOriginalFilename()); @@ -257,6 +257,8 @@ public class PqDevController extends BaseController { // 此处前端要做特殊处理,具体可以参考技术监督的数据导入 Workbook failWorkbook = excelImportResult.getFailWorkbook(); PoiUtil.exportFileByWorkbook(failWorkbook, "非法被检设备数据.xlsx", response); + throw new BusinessException(DevResponseEnum.IMPORT_DATA_FORMAT_FAIL); +// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe); } else { cnDevExcelList = excelImportResult.getList(); } @@ -264,7 +266,7 @@ public class PqDevController extends BaseController { throw new BusinessException(DevResponseEnum.IMPORT_DATA_FAIL); } if(ObjectUtil.isNotEmpty(cnDevExcelList)){ - pqDevService.importCNDev(cnDevExcelList, pattern); + pqDevService.importCNDev(cnDevExcelList, patternId); } return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe); } diff --git a/device/src/main/java/com/njcn/gather/device/device/service/IPqDevService.java b/device/src/main/java/com/njcn/gather/device/device/service/IPqDevService.java index 57244584..6dc71768 100644 --- a/device/src/main/java/com/njcn/gather/device/device/service/IPqDevService.java +++ b/device/src/main/java/com/njcn/gather/device/device/service/IPqDevService.java @@ -206,7 +206,7 @@ public interface IPqDevService extends IService { * 导入灿能二楼设备数据 * * @param cnDevExcelList 灿能二楼设备数据列表 - * @param pattern 模式Id + * @param patternId 模式Id */ - void importCNDev(List cnDevExcelList,String pattern); + void importCNDev(List cnDevExcelList,String patternId); } diff --git a/device/src/main/java/com/njcn/gather/device/device/service/impl/PqDevServiceImpl.java b/device/src/main/java/com/njcn/gather/device/device/service/impl/PqDevServiceImpl.java index 6548b78e..e6602f20 100644 --- a/device/src/main/java/com/njcn/gather/device/device/service/impl/PqDevServiceImpl.java +++ b/device/src/main/java/com/njcn/gather/device/device/service/impl/PqDevServiceImpl.java @@ -582,7 +582,7 @@ public class PqDevServiceImpl extends ServiceImpl implements @Override @Transactional(rollbackFor = Exception.class) - public void importCNDev(List cnDevExcelList, String pattern) { + public void importCNDev(List cnDevExcelList, String patternId) { List oldDevList = BeanUtil.copyToList(cnDevExcelList, PqDev.class); //逆向可视化 this.reverseVisualizeCNDev(oldDevList); @@ -597,7 +597,7 @@ public class PqDevServiceImpl extends ServiceImpl implements pqDev.setCheckState(CheckStateEnum.UNCHECKED.getValue()); pqDev.setReportState(DevReportStateEnum.UNCHECKED.getValue()); pqDev.setCheckResult(CheckResultEnum.UNCHECKED.getValue()); - pqDev.setPattern(pattern); + pqDev.setPattern(patternId); pqDev.setState(DataStateEnum.ENABLE.getCode()); if (pqDev.getEncryptionFlag() == 1) {