双重预防项目-国泰新华二开定制版
16639036659
2022-09-05 1d59b1ab2e678f23de72c2c60be3cd80be58bfc2
添加风险分析单元附属表,移除mybatisPlus相关配置
已修改10个文件
已添加7个文件
221 ■■■■■ 文件已修改
src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/entity/PreventRiskUnitUuid.java 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/enums/StatusEnum.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskControlMeasureRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskEventRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskUnitUuidRepository.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/RiskService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskControlMeasureService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskEventService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskUnitUuidService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskUnitUuidServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/doublePrevention/service/impl/RiskServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/framework/shiro/web/session/SpringSessionValidationScheduler.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/tr/riskList/controller/RiskListController.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/project/tr/riskType/controller/RiskTypeController.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/ruoyi/common/utils/spring/SpringUtils.java
@@ -29,7 +29,7 @@
     *
     * @param name
     * @return Object 一个以所给名字注册的bean的实例
     * @throws BeansException
     * @throws org.springframework.beans.BeansException
     *
     */
    @SuppressWarnings("unchecked")
@@ -43,7 +43,7 @@
     *
     * @param clz
     * @return
     * @throws BeansException
     * @throws org.springframework.beans.BeansException
     *
     */
    public static <T> T getBean(Class<T> clz) throws BeansException
@@ -68,7 +68,7 @@
     *
     * @param name
     * @return boolean
     * @throws NoSuchBeanDefinitionException
     * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
     *
     */
    public static boolean isSingleton(String name) throws NoSuchBeanDefinitionException
@@ -79,7 +79,7 @@
    /**
     * @param name
     * @return Class 注册对象的类型
     * @throws NoSuchBeanDefinitionException
     * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
     *
     */
    public static Class<?> getType(String name) throws NoSuchBeanDefinitionException
@@ -92,7 +92,7 @@
     *
     * @param name
     * @return
     * @throws NoSuchBeanDefinitionException
     * @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
     *
     */
    public static String[] getAliases(String name) throws NoSuchBeanDefinitionException
src/main/java/com/ruoyi/doublePrevention/entity/PreventRiskUnitUuid.java
对比新文件
@@ -0,0 +1,59 @@
package com.ruoyi.doublePrevention.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@TableName("prevent_risk_unit_uuid")
public class PreventRiskUnitUuid {
    /**
     * 主键
     * */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 风险分析单元(设施区域)id
     * */
    private Long riskUnitId;
    /**
     * 风险分析单元(设施区域)Uuid
     * */
    private String riskUnitUuid;
    /**
     * 删除标识
     * */
    private Byte deleteStatus;
    public Byte getDeleteStatus() {
        return deleteStatus;
    }
    public void setDeleteStatus(Byte deleteStatus) {
        this.deleteStatus = deleteStatus;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getRiskUnitId() {
        return riskUnitId;
    }
    public void setRiskUnitId(Long riskUnitId) {
        this.riskUnitId = riskUnitId;
    }
    public String getRiskUnitUuid() {
        return riskUnitUuid;
    }
    public void setRiskUnitUuid(String riskUnitUuid) {
        this.riskUnitUuid = riskUnitUuid;
    }
}
src/main/java/com/ruoyi/doublePrevention/enums/StatusEnum.java
对比新文件
@@ -0,0 +1,27 @@
package com.ruoyi.doublePrevention.enums;
import com.fasterxml.jackson.annotation.JsonValue;
public enum StatusEnum {
    DELETE_STATUS_USE((byte) 0, "正常"),
    DELETE_STATUS_DISCARD((byte) 1, "删除"),
    ;
    byte code;
    @JsonValue
    String value;
    StatusEnum(byte code, String value) {
        this.code = code;
        this.value = value;
    }
    public byte getCode() {
        return code;
    }
    public String getValue() {
        return value;
    }
}
src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskControlMeasureRepository.java
@@ -10,6 +10,6 @@
import java.util.List;
@Repository
public interface PreventRiskControlMeasureRepository extends BaseMapper<PreventRiskControlMeasure> {
public interface PreventRiskControlMeasureRepository{
}
src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskEventRepository.java
@@ -10,6 +10,6 @@
import java.util.List;
@Repository
public interface PreventRiskEventRepository extends BaseMapper<PreventRiskEvent> {
public interface PreventRiskEventRepository{
}
src/main/java/com/ruoyi/doublePrevention/repository/PreventRiskUnitUuidRepository.java
对比新文件
@@ -0,0 +1,13 @@
package com.ruoyi.doublePrevention.repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.doublePrevention.entity.PreventRiskUnitUuid;
import org.springframework.stereotype.Repository;
@Repository
public interface PreventRiskUnitUuidRepository{
    /**
     * 为设施设备清单附属表添加uuid
     * */
    int insertUuid(PreventRiskUnitUuid riskUnitUuid);
}
src/main/java/com/ruoyi/doublePrevention/service/RiskService.java
对比新文件
@@ -0,0 +1,11 @@
package com.ruoyi.doublePrevention.service;
import com.ruoyi.project.tr.riskList.domain.RiskList;
public interface RiskService {
    /**
     * 为设施设备清单附属表添加uuid
     * */
    int insertRiskUnitUuid(Long id);
}
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskControlMeasureService.java
@@ -8,6 +8,6 @@
import java.util.List;
public interface PreventRiskControlMeasureService extends IService<PreventRiskControlMeasure> {
public interface PreventRiskControlMeasureService {
}
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskEventService.java
@@ -7,6 +7,6 @@
import java.util.List;
public interface PreventRiskEventService extends IService<PreventRiskEvent> {
public interface PreventRiskEventService {
}
src/main/java/com/ruoyi/doublePrevention/service/baseService/PreventRiskUnitUuidService.java
对比新文件
@@ -0,0 +1,11 @@
package com.ruoyi.doublePrevention.service.baseService;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.doublePrevention.entity.PreventRiskUnitUuid;
public interface PreventRiskUnitUuidService {
    /**
     * 为设施设备清单附属表添加uuid
     * */
    int insertRiskUnitUuid(PreventRiskUnitUuid riskUnitUuid);
}
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskControlMeasureServiceImpl.java
@@ -10,5 +10,5 @@
import java.util.List;
@Service("PreventRiskControlMeasureService")
public class PreventRiskControlMeasureServiceImpl extends ServiceImpl<PreventRiskControlMeasureRepository, PreventRiskControlMeasure> implements PreventRiskControlMeasureService {
public class PreventRiskControlMeasureServiceImpl implements PreventRiskControlMeasureService {
}
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskEventServiceImpl.java
@@ -10,6 +10,6 @@
import java.util.List;
//@Service("PreventRiskEventService")
public class PreventRiskEventServiceImpl extends ServiceImpl<PreventRiskEventRepository, PreventRiskEvent> implements PreventRiskEventService {
public class PreventRiskEventServiceImpl implements PreventRiskEventService {
}
src/main/java/com/ruoyi/doublePrevention/service/baseService/impl/PreventRiskUnitUuidServiceImpl.java
对比新文件
@@ -0,0 +1,22 @@
package com.ruoyi.doublePrevention.service.baseService.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.doublePrevention.entity.PreventRiskUnitUuid;
import com.ruoyi.doublePrevention.repository.PreventRiskUnitUuidRepository;
import com.ruoyi.doublePrevention.service.baseService.PreventRiskUnitUuidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service("PreventRiskUnitUuidService")
public class PreventRiskUnitUuidServiceImpl implements PreventRiskUnitUuidService {
    @Autowired
    private PreventRiskUnitUuidRepository preventRiskUnitUuidRepository;
    /**
     * 为设施设备清单附属表添加uuid
     * */
    @Override
    public int insertRiskUnitUuid(PreventRiskUnitUuid riskUnitUuid) {
        return preventRiskUnitUuidRepository.insertUuid(riskUnitUuid);
    }
}
src/main/java/com/ruoyi/doublePrevention/service/impl/RiskServiceImpl.java
对比新文件
@@ -0,0 +1,32 @@
package com.ruoyi.doublePrevention.service.impl;
import com.ruoyi.doublePrevention.entity.PreventRiskUnitUuid;
import com.ruoyi.doublePrevention.enums.StatusEnum;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.doublePrevention.service.baseService.PreventRiskUnitUuidService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
@Service("RiskService")
public class RiskServiceImpl implements RiskService {
    @Autowired
    private PreventRiskUnitUuidService preventRiskUnitUuidService;
    /**
     * 为设施设备清单附属表添加uuid
     * */
    @Override
    public int insertRiskUnitUuid(Long id) {
        String uuid = UUID.randomUUID().toString();
        PreventRiskUnitUuid riskUnitUuid = new PreventRiskUnitUuid();
        //封装参数 todo
        riskUnitUuid.setRiskUnitId(id);
        riskUnitUuid.setRiskUnitUuid(uuid);
        riskUnitUuid.setDeleteStatus(StatusEnum.DELETE_STATUS_USE.getCode());
        return preventRiskUnitUuidService.insertRiskUnitUuid(riskUnitUuid);
    }
}
src/main/java/com/ruoyi/framework/shiro/web/session/SpringSessionValidationScheduler.java
@@ -55,7 +55,7 @@
    /**
     * Specifies how frequently (in milliseconds) this Scheduler will call the
     * {@link ValidatingSessionManager#validateSessions()
     * {@link org.apache.shiro.session.mgt.ValidatingSessionManager#validateSessions()
     * ValidatingSessionManager#validateSessions()} method.
     *
     * <p>
src/main/java/com/ruoyi/project/tr/riskList/controller/RiskListController.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
@@ -26,8 +27,10 @@
import com.ruoyi.project.tr.riskType.service.IRiskTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import org.thymeleaf.spring5.processor.SpringErrorClassTagProcessor;
import java.util.ArrayList;
import java.util.Date;
@@ -59,6 +62,9 @@
    @Autowired
    private IRegionService regionService;
    @Autowired
    private RiskService riskService;
    @GetMapping("/{name}")
    public String riskList(@PathVariable("name") String name, ModelMap mmap) {
@@ -182,6 +188,7 @@
    @Log(title = "风险清单", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    @Transactional
    public AjaxResult addSave(RiskList riskList) {
        //保存前获取用户名以及公司信息
        User sysUser = getSysUser();
@@ -191,7 +198,17 @@
        riskList.setCreateTime(nowDate);
        riskList.setUpdateTime(nowDate);
        riskList.setCompanyId(sysUser.getCompanyId());
        return toAjax(riskListService.insertRiskList(riskList));
        int result = riskListService.insertRiskList(riskList);
        riskList.getRiskListId();
        //新代码,为设施设备清单附属表添加uuid
        int uuidResult = riskService.insertRiskUnitUuid(riskList.getRiskListId());
        if (uuidResult < 0){
            throw new RuntimeException("保存uuid对应关系失败");
        }
        return toAjax(result);
    }
    /**
src/main/java/com/ruoyi/project/tr/riskType/controller/RiskTypeController.java
@@ -1,8 +1,11 @@
package com.ruoyi.project.tr.riskType.controller;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.doublePrevention.service.RiskService;
import com.ruoyi.project.system.user.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;