双重预防项目-国泰新华二开定制版
16639036659
2023-07-13 40b263fb22d260e5d3afffcb6009eabd935aef03
临时提交
已修改4个文件
52 ■■■■■ 文件已修改
src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventOverhaulLogUpdateReqBO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventOverhaulLogRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventOverhaulLogServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mybatis/doublePrevention/PreventOverhaulMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/dto/req/PreventOverhaulLogUpdateReqBO.java
@@ -8,7 +8,7 @@
public class PreventOverhaulLogUpdateReqBO {
    /**
     * 风险分析对象编码
     *
     */
    private Long id;
src/main/java/com/ruoyi/doublePrevention/repository/PreventOverhaulLogRepository.java
@@ -19,7 +19,7 @@
    PreventOverhaulLog getOverhaulLogById(Long id);
    int updateOverhaulLog(PreventOverhaulLogUpdateReqBO updateReqBO);
    int updateOverhaulLog(@Param("preventOverhaulLog") PreventOverhaulLog preventOverhaulLog);
    int deleteOverhaulLogByIds(String[] ids);
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventOverhaulLogServiceImpl.java
@@ -161,21 +161,27 @@
        ResultVO resultVO = new ResultVO<>();
        resultVO.setCode(ErrorCodes.REQUEST_PARAM_ERROR.getCode());
        resultVO.setCode("200");
        resultVO.setMsg("保存成功");
        if (ObjectUtils.isEmpty(updateReqBO.getId())){
            throw new RuntimeException("所选记录不能为空");
        }
        PreventOverhaulLog overhaulLogById = overhaulLogRepository.getOverhaulLogById(updateReqBO.getId());
        if (ObjectUtils.isEmpty(overhaulLogById)){
            throw new RuntimeException("记录不存在或已被被删除");
        }
        if (ObjectUtils.isEmpty(updateReqBO.getRiskUnitId())){
            resultVO.setMsg("所属安全风险分析单元");
            return resultVO;
            throw new RuntimeException("安全风险分析单元为空");
        }
        if (ObjectUtils.isEmpty(updateReqBO.getStopStartTime())){
            resultVO.setMsg("装置停用或者检维修开始时间");
            return resultVO;
            throw new RuntimeException("装置停用或者检维修开始时间为空");
        }
        if (ObjectUtils.isEmpty(updateReqBO.getStopEndTime())){
            resultVO.setMsg("装置停用或者检维修结束时间");
            return resultVO;
            throw new RuntimeException("装置停用或者检维修结束时间为空");
        }
        if (updateReqBO.getStopReason().isEmpty()){
            resultVO.setMsg("描述停用原因");
            return resultVO;
            throw new RuntimeException("停用原因为空");
        }
        Date date = new Date();
@@ -187,7 +193,8 @@
        preventOverhaulLog.setDeleteStatus((byte) 0);
        preventOverhaulLog.setLastEditUserName(sysUser.getUserName());
        preventOverhaulLog.setGmtModitify(date);
        preventOverhaulLog.setRiskUnitId(null);// todo 暂时未设置
        preventOverhaulLog.setLastEditUserName(sysUser.getUserName());
        preventOverhaulLog.setGmtModitify(date);
        //todo 对所属企业id和uuid没有进行设置
@@ -211,11 +218,12 @@
            preventOverhaulLog.setReportSwitch(SyncEnum.REPORT_OFF.getCode());
        }
        int result = overhaulLogRepository.updateOverhaulLog(updateReqBO);
        int result = overhaulLogRepository.updateOverhaulLog(preventOverhaulLog);
        if (result < 1){
            throw new RuntimeException("操作失败");
        }
        resultVO.setCount(result);
        resultVO.setCode("200");
        resultVO.setMsg("保存成功");
        return resultVO;
    }
src/main/resources/mybatis/doublePrevention/PreventOverhaulMapper.xml
@@ -101,14 +101,16 @@
    <update id="updateOverhaulLog" parameterType="com.ruoyi.doublePrevention.entity.PreventOverhaulLog">
        update prevent_overhaul_log
        <trim prefix="SET" suffixOverrides=",">
            <if test="hazardCode != null  and hazardCode != ''">hazard_code = #{updateReqBO.id},</if>
            <if test="riskUnitId != null ">risk_unit_id = #{updateReqBO.riskUnitId},</if>
            <if test="riskUnitUuid != null  and riskUnitUuid != ''">risk_unit_uuid = #{updateReqBO.riskUnitUuid},</if>
            <if test="stopStartTime != null ">stop_start_time = #{updateReqBO.stopStartTime},</if>
            <if test="stopEndTime != null ">stop_end_time = #{updateReqBO.stopEndTime},</if>
            <if test="stopReason != null  and stopReason != ''">stop_reason = #{updateReqBO.stopReason},</if>
            <if test="preventOverhaulLog.hazardCode != null  and preventOverhaulLog.hazardCode != ''">hazard_code = #{preventOverhaulLog.id},</if>
            <if test="preventOverhaulLog.riskUnitId != null ">risk_unit_id = #{preventOverhaulLog.riskUnitId},</if>
            <if test="preventOverhaulLog.riskUnitUuid != null  and preventOverhaulLog.riskUnitUuid != ''">risk_unit_uuid = #{preventOverhaulLog.riskUnitUuid},</if>
            <if test="preventOverhaulLog.stopStartTime != null ">stop_start_time = #{preventOverhaulLog.stopStartTime},</if>
            <if test="preventOverhaulLog.stopEndTime != null ">stop_end_time = #{preventOverhaulLog.stopEndTime},</if>
            <if test="preventOverhaulLog.stopReason != null  and preventOverhaulLog.stopReason != ''">stop_reason = #{preventOverhaulLog.stopReason},</if>
            <if test="preventOverhaulLog.gmtModitify != null ">gmt_moditify = #{preventOverhaulLog.gmtModitify},</if>
            <if test="preventOverhaulLog.lastEditUserName != null  and preventOverhaulLog.lastEditUserName != ''">last_edit_user_name = #{preventOverhaulLog.lastEditUserName},</if>
        </trim>
        where id = #{updateReqBO.id}
        where id = #{preventOverhaulLog.id}
    </update>
<!--    int deleteOverhaulLogByIds(String[] ids);-->