Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
ty 4 months ago
parent
commit
8a578ae500
  1. 6
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/offline/service/impl/InspectOfflineServiceImpl.java
  2. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java
  3. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java
  4. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java
  5. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java

6
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()) { if (!file.exists()) {
throw new RuntimeException("文件名称为:" + fileName + "不存在,上传失败!"); throw new RuntimeException("文件名称为:" + fileName + "不存在,上传失败!");
} }
R<BladeFile> r = null; R<BladeFile> r;
try { try {
r = putFile(file); r = putFile(file);
if (!r.isSuccess()) { if (!r.isSuccess()) {
throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错" + r); throw new RuntimeException("上传文件["+fileName+"]失败,bladex-resource报错" );
} }
BladeFile bladeFile = r.getData(); BladeFile bladeFile = r.getData();
return bladeFile != null ? bladeFile.getLink() : null; return bladeFile != null ? bladeFile.getLink() : null;
} catch (Exception ex) { } 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()); }).filter(StringUtils::isNotBlank).collect(Collectors.toList());
bo.setFiles(urls); bo.setFiles(urls);

5
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; package com.hnac.hzims.safeproduct.hazard.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.safeproduct.hazard.dto.HazardLibraryDTO; import com.hnac.hzims.safeproduct.hazard.dto.HazardLibraryDTO;
@ -40,7 +41,9 @@ public class HazardLibraryController extends BladeController {
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
public R<List<HazardLibraryVO>> list(HazardLibraryDTO req) { public R<List<HazardLibraryVO>> list(HazardLibraryDTO req) {
HazardLibraryEntity library = BeanUtil.copy(req, HazardLibraryEntity.class); HazardLibraryEntity library = BeanUtil.copy(req, HazardLibraryEntity.class);
List<HazardLibraryEntity> list = hazardLibraryService.list(hazardLibraryService.getQueryWrapper(library)); LambdaQueryWrapper<HazardLibraryEntity> queryWrapper = hazardLibraryService.getQueryWrapper(library);
queryWrapper.orderByDesc(HazardLibraryEntity::getCreateTime);
List<HazardLibraryEntity> list = hazardLibraryService.list(queryWrapper);
return R.data(HazardLibraryWrapper.build().listVO(list)); return R.data(HazardLibraryWrapper.build().listVO(list));
} }

6
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.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.BeanUtil;
/**
* @author huangxing
*/
public class HazardLibraryWrapper extends BaseEntityWrapper<HazardLibraryEntity, HazardLibraryVO> { public class HazardLibraryWrapper extends BaseEntityWrapper<HazardLibraryEntity, HazardLibraryVO> {
public static HazardLibraryWrapper build() { public static HazardLibraryWrapper build() {
@ -13,7 +16,6 @@ public class HazardLibraryWrapper extends BaseEntityWrapper<HazardLibraryEntity,
@Override @Override
public HazardLibraryVO entityVO(HazardLibraryEntity entity) { public HazardLibraryVO entityVO(HazardLibraryEntity entity) {
HazardLibraryVO hazardLibraryVO = BeanUtil.copy(entity, HazardLibraryVO.class); return BeanUtil.copy(entity, HazardLibraryVO.class);
return hazardLibraryVO;
} }
} }

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java

@ -56,6 +56,7 @@ public class EstimateServiceImpl extends ServiceImpl<EstimateMapper, RiskEstimat
} }
// 站点年度评估保存 // 站点年度评估保存
entity.setStatus(1);
this.save(entity); this.save(entity);
// 站点类型评估危险源绑定 // 站点类型评估危险源绑定
@ -79,6 +80,7 @@ public class EstimateServiceImpl extends ServiceImpl<EstimateMapper, RiskEstimat
point.setEDownLimit(source.getLDownLimit()); point.setEDownLimit(source.getLDownLimit());
point.setCSUpLimit(source.getCSUpLimit()); point.setCSUpLimit(source.getCSUpLimit());
point.setCSDownLimit(source.getCSDownLimit()); point.setCSDownLimit(source.getCSDownLimit());
point.setStatus(1);
return point; return point;
}).collect(Collectors.toList())); }).collect(Collectors.toList()));
} }

2
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java

@ -81,7 +81,7 @@ public class HazardCategoryServiceImpl extends ServiceImpl<HazardCategoryMapper,
// 保存危险类别记录 // 保存危险类别记录
this.updateById(entity); this.updateById(entity);
// 保存详情 // 保存详情
return sourceService.updateBatchById(entity.getSources().stream().peek(source-> source.setCategoryId(entity.getId())).collect(Collectors.toList())); return sourceService.saveOrUpdateBatch(entity.getSources().stream().peek(source-> source.setCategoryId(entity.getId())).collect(Collectors.toList()));
} }
/** /**

Loading…
Cancel
Save