对比新文件 |
| | |
| | | package com.ruoyi.doublePrevention.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @TableName("prevent_report_config") |
| | | public class PreventReportConfig { |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer id; |
| | | /** |
| | | * 上报开关:0-开启;1-关闭 |
| | | */ |
| | | private Byte reportState; |
| | | /** |
| | | * 上报方式:0-手动;1-自动 |
| | | */ |
| | | private Byte reportType; |
| | | /** |
| | | * 上报数据 |
| | | */ |
| | | private String reportData; |
| | | /** |
| | | * 上报数据名称 |
| | | */ |
| | | private String reportDataName; |
| | | /** |
| | | * 最后修改时间 |
| | | */ |
| | | private Date gmtModitify; |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | private String lastEditUserName; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Byte getReportState() { |
| | | return reportState; |
| | | } |
| | | |
| | | public void setReportState(Byte reportState) { |
| | | this.reportState = reportState; |
| | | } |
| | | |
| | | public Byte getReportType() { |
| | | return reportType; |
| | | } |
| | | |
| | | public void setReportType(Byte reportType) { |
| | | this.reportType = reportType; |
| | | } |
| | | |
| | | public String getReportData() { |
| | | return reportData; |
| | | } |
| | | |
| | | public void setReportData(String reportData) { |
| | | this.reportData = reportData; |
| | | } |
| | | |
| | | public String getReportDataName() { |
| | | return reportDataName; |
| | | } |
| | | |
| | | public void setReportDataName(String reportDataName) { |
| | | this.reportDataName = reportDataName; |
| | | } |
| | | |
| | | public Date getGmtModitify() { |
| | | return gmtModitify; |
| | | } |
| | | |
| | | public void setGmtModitify(Date gmtModitify) { |
| | | this.gmtModitify = gmtModitify; |
| | | } |
| | | |
| | | public String getLastEditUserName() { |
| | | return lastEditUserName; |
| | | } |
| | | |
| | | public void setLastEditUserName(String lastEditUserName) { |
| | | this.lastEditUserName = lastEditUserName; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.ruoyi.doublePrevention.enums; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | |
| | | public enum SyncEnum { |
| | | |
| | | SYNC_WAIT_EXEC((byte) 1, "待上报"), |
| | | SYNC_EXEC_SUCCESS((byte) 2, "已上报"), |
| | | SYNC_NOT_EXEC((byte) 3, "不上报"), |
| | | SYNC_EXEC_FAIL((byte) 8, "上报失败"), |
| | | |
| | | REPORT_ON((byte) 0, "开启"), |
| | | REPORT_OFF((byte) 1, "关闭"), |
| | | |
| | | CHOOSE_DATA_REPORT_ON((byte) 1, "上报"), |
| | | CHOOSE_DATA_REPORT_OFF((byte) 2, "不上报"), |
| | | |
| | | REPORT_AUTO_EXEC_CONFIG((byte) 0, "手动上报配置"), |
| | | REPORT_HAND_EXEC_CONFIG((byte) 1, "自动上报配置"), |
| | | |
| | | REPORT_CONFIG_RISK_ANA_UNIT((byte) 1, "风险分析单元"), |
| | | REPORT_CONFIG_RISK_EVENT((byte) 2, "安全风险分析事件"), |
| | | REPORT_CONFIG_RISK_MEASURE((byte) 3, "安全风险管控措施"), |
| | | REPORT_CONFIG_TASK_FROM_WORK((byte) 4, "隐患排查任务配置"), |
| | | REPORT_CONFIG__CHECK_RECORD((byte) 5, "隐患排查任务记录"), |
| | | REPORT_CONFIG_DANGER_INFO((byte) 6, "隐患信息"), |
| | | ; |
| | | byte code; |
| | | @JsonValue |
| | | String value; |
| | | |
| | | SyncEnum(byte code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | |
| | | public byte getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public String getValue() { |
| | | return value; |
| | | } |
| | | } |
对比新文件 |
| | |
| | | package com.ruoyi.doublePrevention.repository; |
| | | |
| | | |
| | | import com.ruoyi.doublePrevention.entity.PreventReportConfig; |
| | | import com.ruoyi.doublePrevention.repository.param.PreventReportConfigUpdateParams; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Repository |
| | | public interface PreventReportConfigRepository { |
| | | |
| | | /** |
| | | * 数据上报配置-查询 |
| | | */ |
| | | List<PreventReportConfig> ListReportConfigs(); |
| | | |
| | | /** |
| | | * 数据上报配置-修改 |
| | | */ |
| | | int updateReportConfig(PreventReportConfigUpdateParams updateParams); |
| | | /** |
| | | * 数据上报配置-按照id查询 |
| | | */ |
| | | PreventReportConfig selectById(int id); |
| | | } |
对比新文件 |
| | |
| | | package com.ruoyi.doublePrevention.repository.param;
|
| | |
|
| | | import com.baomidou.mybatisplus.annotation.TableName;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | @TableName("prevent_report_config")
|
| | | public class PreventReportConfigUpdateParams {
|
| | |
|
| | | /**
|
| | | * 主键
|
| | | */
|
| | | private Integer id;
|
| | | /**
|
| | | * 上报开关:1-开启;2-关闭
|
| | | */
|
| | | private Byte reportState;
|
| | | /**
|
| | | * 上报方式:0-手动;1-自动
|
| | | */
|
| | | private Byte reportType;
|
| | | /**
|
| | | * 最后修改时间
|
| | | */
|
| | | private Date gmtModitify;
|
| | | /**
|
| | | * 修改人
|
| | | */
|
| | | private String lastEditUserName;
|
| | |
|
| | | public String getLastEditUserName() {
|
| | | return lastEditUserName;
|
| | | }
|
| | |
|
| | | public void setLastEditUserName(String lastEditUserName) {
|
| | | this.lastEditUserName = lastEditUserName;
|
| | | }
|
| | |
|
| | | public Date getGmtModitify() {
|
| | | return gmtModitify;
|
| | | }
|
| | |
|
| | | public void setGmtModitify(Date gmtModitify) {
|
| | | this.gmtModitify = gmtModitify;
|
| | | }
|
| | |
|
| | | public Integer getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Integer id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Byte getReportState() {
|
| | | return reportState;
|
| | | }
|
| | |
|
| | | public void setReportState(Byte reportState) {
|
| | | this.reportState = reportState;
|
| | | }
|
| | |
|
| | | public Byte getReportType() {
|
| | | return reportType;
|
| | | }
|
| | |
|
| | | public void setReportType(Byte reportType) {
|
| | | this.reportType = reportType;
|
| | | }
|
| | | }
|
对比新文件 |
| | |
| | | package com.ruoyi.doublePrevention.service.baseService; |
| | | |
| | | |
| | | import com.ruoyi.doublePrevention.entity.PreventReportConfig; |
| | | import com.ruoyi.doublePrevention.repository.param.PreventReportConfigUpdateParams; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PreventReportConfigService { |
| | | |
| | | /** |
| | | * 数据上报配置-查询 |
| | | */ |
| | | List<PreventReportConfig> ListReportConfigs(); |
| | | /** |
| | | * 数据上报配置-修改 |
| | | */ |
| | | int updateReportConfig(PreventReportConfigUpdateParams updateParams); |
| | | /** |
| | | * 数据上报配置-按照id查询 |
| | | */ |
| | | PreventReportConfig getReportConfigById(int Id); |
| | | } |
对比新文件 |
| | |
| | | package com.ruoyi.doublePrevention.service.baseService.impl;
|
| | |
|
| | | import com.ruoyi.doublePrevention.entity.PreventReportConfig;
|
| | | import com.ruoyi.doublePrevention.repository.PreventReportConfigRepository;
|
| | | import com.ruoyi.doublePrevention.repository.param.PreventReportConfigUpdateParams;
|
| | | import com.ruoyi.doublePrevention.service.baseService.PreventReportConfigService;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | @Service("PreventReportConfigService")
|
| | | public class PreventReportConfigServiceImpl implements PreventReportConfigService {
|
| | |
|
| | | @Autowired
|
| | | private PreventReportConfigRepository preventReportConfigRepository;
|
| | |
|
| | | /**
|
| | | * 数据上报配置-查询
|
| | | */
|
| | | @Override
|
| | | public List<PreventReportConfig> ListReportConfigs() {
|
| | | return preventReportConfigRepository.ListReportConfigs();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 数据上报配置-修改
|
| | | */
|
| | | @Override
|
| | | public int updateReportConfig(PreventReportConfigUpdateParams updateParams) {
|
| | | return preventReportConfigRepository.updateReportConfig(updateParams);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 数据上报配置-按照id查询
|
| | | */
|
| | | @Override
|
| | | public PreventReportConfig getReportConfigById(int Id) {
|
| | | return preventReportConfigRepository.selectById(Id);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | * @param sysJob 执行计划 |
| | | * @return 具体执行任务类 |
| | | */ |
| | | private static Class<? extends Job> getQuartzJobClass(HiddenDangerCheckJob job) |
| | | private static Class<? extends org.quartz.Job> getQuartzJobClass(HiddenDangerCheckJob job) |
| | | { |
| | | boolean isConcurrent = "0".equals(job.getConcurrent()); |
| | | return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class; |
| | |
| | | */ |
| | | public static void createScheduleJob(Scheduler scheduler, HiddenDangerCheckJob job) throws SchedulerException, TaskException |
| | | { |
| | | Class<? extends Job> jobClass = getQuartzJobClass(job); |
| | | Class<? extends org.quartz.Job> jobClass = getQuartzJobClass(job); |
| | | // 构建job信息 |
| | | Long jobId = job.getJobId(); |
| | | String jobGroup = job.getJobGroup(); |
| | |
| | | @PostMapping("/add") |
| | | @ResponseBody |
| | | public AjaxResult addSave(RiskList riskList) { |
| | | //老代码 |
| | | //保存前获取用户名以及公司信息 |
| | | User sysUser = getSysUser(); |
| | | riskList.setCreateBy(sysUser.getUserName()); |
| | |
| | | |
| | | int result = riskListService.insertRiskList(riskList); |
| | | riskList.getRiskListId(); |
| | | |
| | | //todo 判断是风先分析单元 ,还是任务单元,分别封装处理 |
| | | //新代码,为设施设备清单附属表添加uuid |
| | | int uuidResult = riskService.insertRiskUnitUuid(riskList.getRiskListId()); |
| | | if (uuidResult < 0){ |
对比新文件 |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.ruoyi.doublePrevention.repository.PreventReportConfigRepository"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.doublePrevention.entity.PreventReportConfig"> |
| | | <id property="id" column="id"/> |
| | | <result property="reportState" column="report_state"/> |
| | | <result property="reportType" column="report_type"/> |
| | | <result property="reportData" column="report_data"/> |
| | | <result property="reportDataName" column="report_data_name"/> |
| | | <result property="gmtModitify" column="gmt_moditify"/> |
| | | <result property="lastEditUserName" column="last_edit_user_name"/> |
| | | </resultMap> |
| | | |
| | | <!--List<PreventReportConfig> ListReportConfigs();--> |
| | | <select id="ListReportConfigs" resultMap="BaseResultMap"> |
| | | select id, report_state, report_type, report_data_name, gmt_moditify, last_edit_user_name |
| | | from prevent_report_config |
| | | </select> |
| | | |
| | | <!--int updateReportConfig(PreventReportConfigUpdateParams updateParams);--> |
| | | <update id="updateReportConfig"> |
| | | update prevent_report_config set |
| | | report_state = #{reportState}, |
| | | report_type = #{reportType}, |
| | | last_edit_user_name = #{lastEditUserName}, |
| | | gmt_moditify = #{gmtModitify} |
| | | where id = #{id} |
| | | </update> |
| | | <!-- PreventReportConfig selectById(int id);--> |
| | | <select id="selectById" resultMap="BaseResultMap"> |
| | | select * from prevent_report_config |
| | | where id = #{id} |
| | | </select> |
| | | </mapper> |