Browse Source

#风险评估默认状态

zhongwei
yang_shj 4 months ago
parent
commit
d232690c38
  1. 5
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/controller/HazardLibraryController.java
  2. 6
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/hazard/wrapper/HazardLibraryWrapper.java
  3. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/EstimateServiceImpl.java
  4. 2
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/risk/service/impl/HazardCategoryServiceImpl.java

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;
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<HazardLibraryVO>> list(HazardLibraryDTO req) {
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));
}

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

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);
// 站点类型评估危险源绑定
@ -79,6 +80,7 @@ public class EstimateServiceImpl extends ServiceImpl<EstimateMapper, RiskEstimat
point.setEDownLimit(source.getLDownLimit());
point.setCSUpLimit(source.getCSUpLimit());
point.setCSDownLimit(source.getCSDownLimit());
point.setStatus(1);
return point;
}).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);
// 保存详情
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