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); 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())); } /**