| | |
| | | package com.ruoyi.doublePrevention.service.impl;
|
| | |
|
| | | import com.ruoyi.common.utils.StringUtils;
|
| | | import com.ruoyi.doublePrevention.entity.PreventRiskEvent;
|
| | | import com.ruoyi.doublePrevention.entity.PreventRiskUnitUuid;
|
| | | import com.ruoyi.doublePrevention.entity.dto.req.PreventRiskEventSaveReqDTO;
|
| | | import com.ruoyi.doublePrevention.enums.StatusEnum;
|
| | | import com.ruoyi.doublePrevention.service.RiskService;
|
| | | import com.ruoyi.doublePrevention.service.baseService.PreventRiskUnitUuidService;
|
| | | import com.ruoyi.doublePrevention.vo.ResultVO;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | |
| | | riskUnitUuid.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode());
|
| | | return preventRiskUnitUuidService.insertRiskUnitUuid(riskUnitUuid);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 风险事件-新增
|
| | | */
|
| | | @Override
|
| | | public ResultVO<PreventRiskEvent> saveRiskEvent(PreventRiskEventSaveReqDTO riskEventSaveReqDTO) {
|
| | | ResultVO resultVO = new ResultVO<>();
|
| | | resultVO.setCode("200");
|
| | | resultVO.setMsg("新增成功");
|
| | | Long riskUnitId = riskEventSaveReqDTO.getRiskUnitId();
|
| | | String riskEventName = riskEventSaveReqDTO.getRiskEventName();
|
| | | String eventResult = riskEventSaveReqDTO.getEventResult();
|
| | | if (riskUnitId == null){
|
| | | resultVO.setMsg("安全风险分析单元名称不能为空");
|
| | | return resultVO;
|
| | | }
|
| | | if (StringUtils.isEmpty(riskEventName)){
|
| | | resultVO.setMsg("安全风险事件名称");
|
| | | return resultVO;
|
| | | }
|
| | | if (StringUtils.isEmpty(eventResult)){
|
| | | resultVO.setMsg("可能造成得后果");
|
| | | return resultVO;
|
| | | }
|
| | |
|
| | | return null;
|
| | | }
|
| | | }
|