From 93c13d394caf29f48a3e1c321b07eb139510e671 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 7 Aug 2024 11:38:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?#=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspect/offline/service/impl/InspectOfflineServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java index 8accdf3..62d76e2 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java @@ -948,17 +948,17 @@ public class InspectOfflineServiceImpl implements IOfflineDataService { if (!file.exists()) { throw new RuntimeException("文件名称为:" + fileName + "不存在,上传失败!"); } - R r = null; + R r; try { r = putFile(file); if (!r.isSuccess()) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r); + throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错" ); } BladeFile bladeFile = r.getData(); return bladeFile != null ? bladeFile.getLink() : null; } catch (Exception ex) { - throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:" + r.toString(), ex); + throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错:", ex); } }).filter(StringUtils::isNotBlank).collect(Collectors.toList()); bo.setFiles(urls); From d232690c383f8368d72ceb5e0080f50b7a6e2b91 Mon Sep 17 00:00:00 2001 From: yang_shj <1069818635@QQ.com> Date: Wed, 7 Aug 2024 13:35:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?#=E9=A3=8E=E9=99=A9=E8=AF=84=E4=BC=B0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../safeproduct/hazard/controller/HazardLibraryController.java | 5 ++++- .../hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java | 6 ++++-- .../hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java | 2 ++ .../safeproduct/risk/service/impl/HazardCategoryServiceImpl.java | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java index c7cf1d9..1f5ef35 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java @@ -1,6 +1,7 @@ package com.hnac.hzims.safeproduct.hazard.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.hnac.hzims.safeproduct.hazard.dto.HazardLibraryDTO; @@ -40,7 +41,9 @@ public class HazardLibraryController extends BladeController { @ApiOperationSupport(order = 2) public R> list(HazardLibraryDTO req) { HazardLibraryEntity library = BeanUtil.copy(req, HazardLibraryEntity.class); - List list = hazardLibraryService.list(hazardLibraryService.getQueryWrapper(library)); + LambdaQueryWrapper queryWrapper = hazardLibraryService.getQueryWrapper(library); + queryWrapper.orderByDesc(HazardLibraryEntity::getCreateTime); + List list = hazardLibraryService.list(queryWrapper); return R.data(HazardLibraryWrapper.build().listVO(list)); } diff --git a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java index 55799b4..13bbb90 100644 --- a/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java +++ b/hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java @@ -5,6 +5,9 @@ import com.hnac.hzims.safeproduct.hazard.vo.HazardLibraryVO; import org.springblade.core.mp.support.BaseEntityWrapper; import org.springblade.core.tool.utils.BeanUtil; +/** + * @author huangxing + */ public class HazardLibraryWrapper extends BaseEntityWrapper { public static HazardLibraryWrapper build() { @@ -13,7 +16,6 @@ public class HazardLibraryWrapper extends BaseEntityWrapper source.setCategoryId(entity.getId())).collect(Collectors.toList())); + return sourceService.saveOrUpdateBatch(entity.getSources().stream().peek(source-> source.setCategoryId(entity.getId())).collect(Collectors.toList())); } /**