Commit 4a0726b8 authored by 军师中郎将's avatar 军师中郎将

运行监测 - 增加 重大污染源模块

应急处置 - 增加  应急演练模块
parent bf1fcec5
package com.zehong.web.controller.energency;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TEmergencyDrills;
import com.zehong.system.service.ITEmergencyDrillsService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 应急演练Controller
*
* @author zehong
* @date 2024-04-19
*/
@RestController
@RequestMapping("/emergencydrills/record")
public class TEmergencyDrillsController extends BaseController
{
@Autowired
private ITEmergencyDrillsService tEmergencyDrillsService;
/**
* 查询应急演练列表
*/
@PreAuthorize("@ss.hasPermi('emergencydrills:record:list')")
@GetMapping("/list")
public TableDataInfo list(TEmergencyDrills tEmergencyDrills)
{
startPage();
List<TEmergencyDrills> list = tEmergencyDrillsService.selectTEmergencyDrillsList(tEmergencyDrills);
return getDataTable(list);
}
/**
* 导出应急演练列表
*/
@PreAuthorize("@ss.hasPermi('emergencydrills:record:export')")
@Log(title = "应急演练", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TEmergencyDrills tEmergencyDrills)
{
List<TEmergencyDrills> list = tEmergencyDrillsService.selectTEmergencyDrillsList(tEmergencyDrills);
ExcelUtil<TEmergencyDrills> util = new ExcelUtil<TEmergencyDrills>(TEmergencyDrills.class);
return util.exportExcel(list, "应急演练数据");
}
/**
* 获取应急演练详细信息
*/
@PreAuthorize("@ss.hasPermi('emergencydrills:record:query')")
@GetMapping(value = "/getDetail/{fDrillsId}")
public AjaxResult getInfo(@PathVariable("fDrillsId") Long fDrillsId)
{
return AjaxResult.success(tEmergencyDrillsService.selectTEmergencyDrillsById(fDrillsId));
}
/**
* 新增应急演练
*/
@PreAuthorize("@ss.hasPermi('emergencydrills:record:add')")
@Log(title = "应急演练", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TEmergencyDrills tEmergencyDrills)
{
return toAjax(tEmergencyDrillsService.insertTEmergencyDrills(tEmergencyDrills));
}
/**
* 修改应急演练
*/
@PreAuthorize("@ss.hasPermi('emergencydrills:record:edit')")
@Log(title = "应急演练", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TEmergencyDrills tEmergencyDrills)
{
return toAjax(tEmergencyDrillsService.updateTEmergencyDrills(tEmergencyDrills));
}
/**
* 删除应急演练
*/
@PreAuthorize("@ss.hasPermi('emergencydrills:record:remove')")
@Log(title = "应急演练", businessType = BusinessType.DELETE)
@DeleteMapping("/{fDrillsIds}")
public AjaxResult remove(@PathVariable Long[] fDrillsIds)
{
return toAjax(tEmergencyDrillsService.deleteTEmergencyDrillsByIds(fDrillsIds));
}
}
package com.zehong.web.controller.energency;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TSupMajorHazard;
import com.zehong.system.service.ITSupMajorHazardService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 重大危险源监管Controller
*
* @author zehong
* @date 2024-04-19
*/
@RestController
@RequestMapping("/majorpollsourcelevel/record")
public class TSupMajorHazardController extends BaseController
{
@Autowired
private ITSupMajorHazardService tSupMajorHazardService;
/**
* 查询重大危险源监管列表
*/
@PreAuthorize("@ss.hasPermi('majorpollsourcelevel:record:list')")
@GetMapping("/list")
public TableDataInfo list(TSupMajorHazard tSupMajorHazard)
{
startPage();
List<TSupMajorHazard> list = tSupMajorHazardService.selectTSupMajorHazardList(tSupMajorHazard);
return getDataTable(list);
}
/**
* 导出重大危险源监管列表
*/
@PreAuthorize("@ss.hasPermi('majorpollsourcelevel:record:export')")
@Log(title = "重大危险源监管", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TSupMajorHazard tSupMajorHazard)
{
//导出
List<TSupMajorHazard> list = tSupMajorHazardService.exportselectTSupMajorHazardList(tSupMajorHazard);
ExcelUtil<TSupMajorHazard> util = new ExcelUtil<TSupMajorHazard>(TSupMajorHazard.class);
return util.exportExcel(list, "重大危险源监管数据");
}
/**
* 获取重大危险源监管详细信息
*/
@PreAuthorize("@ss.hasPermi('majorpollsourcelevel:record:query')")
@GetMapping(value = "/{fHazardId}")
public AjaxResult getInfo(@PathVariable("fHazardId") Long fHazardId)
{
return AjaxResult.success(tSupMajorHazardService.selectTSupMajorHazardById(fHazardId));
}
/**
* 新增重大危险源监管
*/
@PreAuthorize("@ss.hasPermi('majorpollsourcelevel:record:add')")
@Log(title = "重大危险源监管", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSupMajorHazard tSupMajorHazard)
{
return toAjax(tSupMajorHazardService.insertTSupMajorHazard(tSupMajorHazard));
}
/**
* 修改重大危险源监管
*/
@PreAuthorize("@ss.hasPermi('majorpollsourcelevel:record:edit')")
@Log(title = "重大危险源监管", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSupMajorHazard tSupMajorHazard)
{
return toAjax(tSupMajorHazardService.updateTSupMajorHazard(tSupMajorHazard));
}
/**
* 删除重大危险源监管
*/
@PreAuthorize("@ss.hasPermi('majorpollsourcelevel:record:remove')")
@Log(title = "重大危险源监管", businessType = BusinessType.DELETE)
@DeleteMapping("/{fHazardIds}")
public AjaxResult remove(@PathVariable Long[] fHazardIds)
{
return toAjax(tSupMajorHazardService.deleteTSupMajorHazardByIds(fHazardIds));
}
}
...@@ -58,9 +58,9 @@ spring: ...@@ -58,9 +58,9 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: 27.128.233.145 host: 121.29.1.158
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 6380
# 数据库索引 # 数据库索引
database: 0 database: 0
# 密码 # 密码
......
...@@ -6,9 +6,9 @@ spring: ...@@ -6,9 +6,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://27.128.239.197:8902/gas_progress_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://121.29.1.158:33060/gas_progress_db?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: gas_progress_db username: gas_progress_db
password: RMtiC6YCzdLxeJL password: RMtiC6YCzdLxeJJL
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
...@@ -59,13 +59,13 @@ spring: ...@@ -59,13 +59,13 @@ spring:
redis: redis:
# 地址 # 地址
# host: 36.139.41.10 # host: 36.139.41.10
host: 27.128.239.197 host: 121.29.1.158
# host: 36.139.125.48 # host: 36.139.125.48
# host: 36.139.41.83 # host: 36.139.41.83
#host: 121.29.1.158 #host: 121.29.1.158
# 端口,默认为6379 # 端口,默认为6379
# port: 6379 # port: 6379
port: 8903 port: 6380
# port: 6380 # port: 6380
# 数据库索引 # 数据库索引
database: 0 database: 0
...@@ -96,7 +96,8 @@ zehong: ...@@ -96,7 +96,8 @@ zehong:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath) # 文件路径 示例( Windows配置D:/zehong/uploadPath,Linux配置 /home/zehong/uploadPath)
profile: /home/zehong/uploadPath # profile: /home/zehong/uploadPath
profile: D:/20220924/othersoft/idea/workspace/zhkj/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
# 验证码类型 math 数组计算 char 字符验证 # 验证码类型 math 数组计算 char 字符验证
......
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 应急演练对象 t_emergency_drills
*
* @author zehong
* @date 2024-04-19
*/
public class TEmergencyDrills extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 演练ID */
private Long fDrillsId;
/** 演练时间 */
@Excel(name = "演练时间")
private String fDrillsTime;
/** 事件 */
@Excel(name = "事件")
private String fEvent;
/** 地点 */
@Excel(name = "地点")
private String fPlace;
/** 参与演练人员与部门 */
@Excel(name = "参与演练人员与部门")
private String fPerDep;
/** 演练内容 */
@Excel(name = "演练内容")
private String fDrillsContent;
/** 演练图片 */
private String fDrillsPicture;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fCreateTime;
/** 修改时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date fUpdateTime;
/** 是否删除(0正常,1删除) */
private String fIsDel;
/** 备注 */
private String fRemarks;
public void setfDrillsId(Long fDrillsId)
{
this.fDrillsId = fDrillsId;
}
public Long getfDrillsId()
{
return fDrillsId;
}
public void setfDrillsTime(String fDrillsTime)
{
this.fDrillsTime = fDrillsTime;
}
public String getfDrillsTime()
{
return fDrillsTime;
}
public void setfEvent(String fEvent)
{
this.fEvent = fEvent;
}
public String getfEvent()
{
return fEvent;
}
public void setfPlace(String fPlace)
{
this.fPlace = fPlace;
}
public String getfPlace()
{
return fPlace;
}
public void setfPerDep(String fPerDep)
{
this.fPerDep = fPerDep;
}
public String getfPerDep()
{
return fPerDep;
}
public void setfDrillsContent(String fDrillsContent)
{
this.fDrillsContent = fDrillsContent;
}
public String getfDrillsContent()
{
return fDrillsContent;
}
public void setfDrillsPicture(String fDrillsPicture)
{
this.fDrillsPicture = fDrillsPicture;
}
public String getfDrillsPicture()
{
return fDrillsPicture;
}
public void setfCreateTime(Date fCreateTime)
{
this.fCreateTime = fCreateTime;
}
public Date getfCreateTime()
{
return fCreateTime;
}
public void setfUpdateTime(Date fUpdateTime)
{
this.fUpdateTime = fUpdateTime;
}
public Date getfUpdateTime()
{
return fUpdateTime;
}
public void setfIsDel(String fIsDel)
{
this.fIsDel = fIsDel;
}
public String getfIsDel()
{
return fIsDel;
}
public void setfRemarks(String fRemarks)
{
this.fRemarks = fRemarks;
}
public String getfRemarks()
{
return fRemarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fDrillsId", getfDrillsId())
.append("fDrillsTime", getfDrillsTime())
.append("fEvent", getfEvent())
.append("fPlace", getfPlace())
.append("fPerDep", getfPerDep())
.append("fDrillsContent", getfDrillsContent())
.append("fDrillsPicture", getfDrillsPicture())
.append("fCreateTime", getfCreateTime())
.append("fUpdateTime", getfUpdateTime())
.append("fIsDel", getfIsDel())
.append("fRemarks", getfRemarks())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 重大危险源监管对象 t_sup_major_hazard
*
* @author zehong
* @date 2024-04-19
*/
public class TSupMajorHazard extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** ID */
private Long fHazardId;
/** 名称 */
@Excel(name = "名称")
private String fName;
/** 责任人 */
@Excel(name = "责任人")
private String fResPer;
/** 电话 */
@Excel(name = "电话")
private String fPhone;
/** 安全评估信息 */
@Excel(name = "安全评估信息")
private String fEvaInfor;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 分级情况 */
@Excel(name = "分级情况")
private String fLevel;
public Long getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
/** 权属单位 */
private Long beyondEnterpriseId;
/** 创建时间 */
private Date fCreateTime;
/** 修改时间 */
private Date fUpdateTime;
/** 是否删除(0正常,1删除) */
private String fIsDel;
/** 备注 */
private String fRemarks;
public void setfHazardId(Long fHazardId)
{
this.fHazardId = fHazardId;
}
public Long getfHazardId()
{
return fHazardId;
}
public void setfName(String fName)
{
this.fName = fName;
}
public String getfName()
{
return fName;
}
public void setfResPer(String fResPer)
{
this.fResPer = fResPer;
}
public String getfResPer()
{
return fResPer;
}
public void setfPhone(String fPhone)
{
this.fPhone = fPhone;
}
public String getfPhone()
{
return fPhone;
}
public void setfEvaInfor(String fEvaInfor)
{
this.fEvaInfor = fEvaInfor;
}
public String getfEvaInfor()
{
return fEvaInfor;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setfLevel(String fLevel)
{
this.fLevel = fLevel;
}
public String getfLevel()
{
return fLevel;
}
public void setfCreateTime(Date fCreateTime)
{
this.fCreateTime = fCreateTime;
}
public Date getfCreateTime()
{
return fCreateTime;
}
public void setfUpdateTime(Date fUpdateTime)
{
this.fUpdateTime = fUpdateTime;
}
public Date getfUpdateTime()
{
return fUpdateTime;
}
public void setfIsDel(String fIsDel)
{
this.fIsDel = fIsDel;
}
public String getfIsDel()
{
return fIsDel;
}
public void setfRemarks(String fRemarks)
{
this.fRemarks = fRemarks;
}
public String getfRemarks()
{
return fRemarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fHazardId", getfHazardId())
.append("fName", getfName())
.append("fResPer", getfResPer())
.append("fPhone", getfPhone())
.append("fEvaInfor", getfEvaInfor())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("fLevel", getfLevel())
.append("fCreateTime", getfCreateTime())
.append("fUpdateTime", getfUpdateTime())
.append("fIsDel", getfIsDel())
.append("fRemarks", getfRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TEmergencyDrills;
/**
* 应急演练Mapper接口
*
* @author zehong
* @date 2024-04-19
*/
public interface TEmergencyDrillsMapper
{
/**
* 查询应急演练
*
* @param fDrillsId 应急演练ID
* @return 应急演练
*/
public TEmergencyDrills selectTEmergencyDrillsById(Long fDrillsId);
/**
* 查询应急演练列表
*
* @param tEmergencyDrills 应急演练
* @return 应急演练集合
*/
public List<TEmergencyDrills> selectTEmergencyDrillsList(TEmergencyDrills tEmergencyDrills);
/**
* 新增应急演练
*
* @param tEmergencyDrills 应急演练
* @return 结果
*/
public int insertTEmergencyDrills(TEmergencyDrills tEmergencyDrills);
/**
* 修改应急演练
*
* @param tEmergencyDrills 应急演练
* @return 结果
*/
public int updateTEmergencyDrills(TEmergencyDrills tEmergencyDrills);
/**
* 删除应急演练
*
* @param fDrillsId 应急演练ID
* @return 结果
*/
public int deleteTEmergencyDrillsById(Long fDrillsId);
/**
* 批量删除应急演练
*
* @param fDrillsIds 需要删除的数据ID
* @return 结果
*/
public int deleteTEmergencyDrillsByIds(Long[] fDrillsIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TSupMajorHazard;
/**
* 重大危险源监管Mapper接口
*
* @author zehong
* @date 2024-04-19
*/
public interface TSupMajorHazardMapper
{
/**
* 查询重大危险源监管
*
* @param fHazardId 重大危险源监管ID
* @return 重大危险源监管
*/
public TSupMajorHazard selectTSupMajorHazardById(Long fHazardId);
/**
* 查询重大危险源监管列表
*
* @param tSupMajorHazard 重大危险源监管
* @return 重大危险源监管集合
*/
public List<TSupMajorHazard> selectTSupMajorHazardList(TSupMajorHazard tSupMajorHazard);
/**
* 查询重大危险源监管列表 导出
*
* @param tSupMajorHazard 重大危险源监管
* @return 重大危险源监管集合
*/
public List<TSupMajorHazard> exportselectTSupMajorHazardList(TSupMajorHazard tSupMajorHazard);
/**
* 新增重大危险源监管
*
* @param tSupMajorHazard 重大危险源监管
* @return 结果
*/
public int insertTSupMajorHazard(TSupMajorHazard tSupMajorHazard);
/**
* 修改重大危险源监管
*
* @param tSupMajorHazard 重大危险源监管
* @return 结果
*/
public int updateTSupMajorHazard(TSupMajorHazard tSupMajorHazard);
/**
* 删除重大危险源监管
*
* @param fHazardId 重大危险源监管ID
* @return 结果
*/
public int deleteTSupMajorHazardById(Long fHazardId);
/**
* 批量删除重大危险源监管
*
* @param fHazardIds 需要删除的数据ID
* @return 结果
*/
public int deleteTSupMajorHazardByIds(Long[] fHazardIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TEmergencyDrills;
/**
* 应急演练Service接口
*
* @author zehong
* @date 2024-04-19
*/
public interface ITEmergencyDrillsService
{
/**
* 查询应急演练
*
* @param fDrillsId 应急演练ID
* @return 应急演练
*/
public TEmergencyDrills selectTEmergencyDrillsById(Long fDrillsId);
/**
* 查询应急演练列表
*
* @param tEmergencyDrills 应急演练
* @return 应急演练集合
*/
public List<TEmergencyDrills> selectTEmergencyDrillsList(TEmergencyDrills tEmergencyDrills);
/**
* 新增应急演练
*
* @param tEmergencyDrills 应急演练
* @return 结果
*/
public int insertTEmergencyDrills(TEmergencyDrills tEmergencyDrills);
/**
* 修改应急演练
*
* @param tEmergencyDrills 应急演练
* @return 结果
*/
public int updateTEmergencyDrills(TEmergencyDrills tEmergencyDrills);
/**
* 批量删除应急演练
*
* @param fDrillsIds 需要删除的应急演练ID
* @return 结果
*/
public int deleteTEmergencyDrillsByIds(Long[] fDrillsIds);
/**
* 删除应急演练信息
*
* @param fDrillsId 应急演练ID
* @return 结果
*/
public int deleteTEmergencyDrillsById(Long fDrillsId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TSupMajorHazard;
/**
* 重大危险源监管Service接口
*
* @author zehong
* @date 2024-04-19
*/
public interface ITSupMajorHazardService
{
/**
* 查询重大危险源监管
*
* @param fHazardId 重大危险源监管ID
* @return 重大危险源监管
*/
public TSupMajorHazard selectTSupMajorHazardById(Long fHazardId);
/**
* 查询重大危险源监管列表
*
* @param tSupMajorHazard 重大危险源监管
* @return 重大危险源监管集合
*/
public List<TSupMajorHazard> selectTSupMajorHazardList(TSupMajorHazard tSupMajorHazard);
/**
* 导出重大危险源监管列表
*
* @param tSupMajorHazard 重大危险源监管
* @return 重大危险源监管集合
*/
public List<TSupMajorHazard> exportselectTSupMajorHazardList(TSupMajorHazard tSupMajorHazard);
/**
* 新增重大危险源监管
*
* @param tSupMajorHazard 重大危险源监管
* @return 结果
*/
public int insertTSupMajorHazard(TSupMajorHazard tSupMajorHazard);
/**
* 修改重大危险源监管
*
* @param tSupMajorHazard 重大危险源监管
* @return 结果
*/
public int updateTSupMajorHazard(TSupMajorHazard tSupMajorHazard);
/**
* 批量删除重大危险源监管
*
* @param fHazardIds 需要删除的重大危险源监管ID
* @return 结果
*/
public int deleteTSupMajorHazardByIds(Long[] fHazardIds);
/**
* 删除重大危险源监管信息
*
* @param fHazardId 重大危险源监管ID
* @return 结果
*/
public int deleteTSupMajorHazardById(Long fHazardId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TEmergencyDrillsMapper;
import com.zehong.system.domain.TEmergencyDrills;
import com.zehong.system.service.ITEmergencyDrillsService;
/**
* 应急演练Service业务层处理
*
* @author zehong
* @date 2024-04-19
*/
@Service
public class TEmergencyDrillsServiceImpl implements ITEmergencyDrillsService
{
@Autowired
private TEmergencyDrillsMapper tEmergencyDrillsMapper;
/**
* 查询应急演练
*
* @param fDrillsId 应急演练ID
* @return 应急演练
*/
@Override
public TEmergencyDrills selectTEmergencyDrillsById(Long fDrillsId)
{
return tEmergencyDrillsMapper.selectTEmergencyDrillsById(fDrillsId);
}
/**
* 查询应急演练列表
*
* @param tEmergencyDrills 应急演练
* @return 应急演练
*/
@Override
public List<TEmergencyDrills> selectTEmergencyDrillsList(TEmergencyDrills tEmergencyDrills)
{
return tEmergencyDrillsMapper.selectTEmergencyDrillsList(tEmergencyDrills);
}
/**
* 新增应急演练
*
* @param tEmergencyDrills 应急演练
* @return 结果
*/
@Override
public int insertTEmergencyDrills(TEmergencyDrills tEmergencyDrills)
{
return tEmergencyDrillsMapper.insertTEmergencyDrills(tEmergencyDrills);
}
/**
* 修改应急演练
*
* @param tEmergencyDrills 应急演练
* @return 结果
*/
@Override
public int updateTEmergencyDrills(TEmergencyDrills tEmergencyDrills)
{
return tEmergencyDrillsMapper.updateTEmergencyDrills(tEmergencyDrills);
}
/**
* 批量删除应急演练
*
* @param fDrillsIds 需要删除的应急演练ID
* @return 结果
*/
@Override
public int deleteTEmergencyDrillsByIds(Long[] fDrillsIds)
{
return tEmergencyDrillsMapper.deleteTEmergencyDrillsByIds(fDrillsIds);
}
/**
* 删除应急演练信息
*
* @param fDrillsId 应急演练ID
* @return 结果
*/
@Override
public int deleteTEmergencyDrillsById(Long fDrillsId)
{
return tEmergencyDrillsMapper.deleteTEmergencyDrillsById(fDrillsId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSupMajorHazardMapper;
import com.zehong.system.domain.TSupMajorHazard;
import com.zehong.system.service.ITSupMajorHazardService;
/**
* 重大危险源监管Service业务层处理
*
* @author zehong
* @date 2024-04-19
*/
@Service
public class TSupMajorHazardServiceImpl implements ITSupMajorHazardService
{
@Autowired
private TSupMajorHazardMapper tSupMajorHazardMapper;
/**
* 查询重大危险源监管
*
* @param fHazardId 重大危险源监管ID
* @return 重大危险源监管
*/
@Override
public TSupMajorHazard selectTSupMajorHazardById(Long fHazardId)
{
return tSupMajorHazardMapper.selectTSupMajorHazardById(fHazardId);
}
/**
* 查询重大危险源监管列表
*
* @param tSupMajorHazard 重大危险源监管
* @return 重大危险源监管
*/
@Override
public List<TSupMajorHazard> selectTSupMajorHazardList(TSupMajorHazard tSupMajorHazard)
{
return tSupMajorHazardMapper.selectTSupMajorHazardList(tSupMajorHazard);
}
/**
* 导出重大危险源监管列表
*
* @param tSupMajorHazard 重大危险源监管
* @return 重大危险源监管
*/
@Override
public List<TSupMajorHazard> exportselectTSupMajorHazardList(TSupMajorHazard tSupMajorHazard)
{
return tSupMajorHazardMapper.exportselectTSupMajorHazardList(tSupMajorHazard);
}
/**
* 新增重大危险源监管
*
* @param tSupMajorHazard 重大危险源监管
* @return 结果
*/
@Override
public int insertTSupMajorHazard(TSupMajorHazard tSupMajorHazard)
{
return tSupMajorHazardMapper.insertTSupMajorHazard(tSupMajorHazard);
}
/**
* 修改重大危险源监管
*
* @param tSupMajorHazard 重大危险源监管
* @return 结果
*/
@Override
public int updateTSupMajorHazard(TSupMajorHazard tSupMajorHazard)
{
return tSupMajorHazardMapper.updateTSupMajorHazard(tSupMajorHazard);
}
/**
* 批量删除重大危险源监管
*
* @param fHazardIds 需要删除的重大危险源监管ID
* @return 结果
*/
@Override
public int deleteTSupMajorHazardByIds(Long[] fHazardIds)
{
return tSupMajorHazardMapper.deleteTSupMajorHazardByIds(fHazardIds);
}
/**
* 删除重大危险源监管信息
*
* @param fHazardId 重大危险源监管ID
* @return 结果
*/
@Override
public int deleteTSupMajorHazardById(Long fHazardId)
{
return tSupMajorHazardMapper.deleteTSupMajorHazardById(fHazardId);
}
}
<?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.zehong.system.mapper.TEmergencyDrillsMapper">
<resultMap type="TEmergencyDrills" id="TEmergencyDrillsResult">
<result property="fDrillsId" column="f_drills_id" />
<result property="fDrillsTime" column="f_drills_time" />
<result property="fEvent" column="f_event" />
<result property="fPlace" column="f_place" />
<result property="fPerDep" column="f_per_dep" />
<result property="fDrillsContent" column="f_drills_content" />
<result property="fDrillsPicture" column="f_drills_picture" />
<result property="fCreateTime" column="f_create_time" />
<result property="fUpdateTime" column="f_update_time" />
<result property="fIsDel" column="f_is_del" />
<result property="fRemarks" column="f_remarks" />
</resultMap>
<sql id="selectTEmergencyDrillsVo">
select f_drills_id, f_drills_time, f_event, f_place, f_per_dep, f_drills_content, f_drills_picture, f_create_time, f_update_time, f_is_del, f_remarks from t_emergency_drills
</sql>
<select id="selectTEmergencyDrillsList" parameterType="TEmergencyDrills" resultMap="TEmergencyDrillsResult">
<include refid="selectTEmergencyDrillsVo"/>
<where>
<if test="fDrillsId != null "> and f_drills_id = #{fDrillsId}</if>
<if test="fDrillsTime != null and fDrillsTime != ''"> and f_drills_time = #{fDrillsTime}</if>
<if test="fEvent != null and fEvent != ''"> and f_event = #{fEvent}</if>
<if test="fPlace != null and fPlace != ''"> and f_place = #{fPlace}</if>
<if test="fPerDep != null and fPerDep != ''"> and f_per_dep = #{fPerDep}</if>
<if test="fDrillsContent != null and fDrillsContent != ''"> and f_drills_content = #{fDrillsContent}</if>
<if test="fDrillsPicture != null and fDrillsPicture != ''"> and f_drills_picture = #{fDrillsPicture}</if>
<if test="fCreateTime != null "> and f_create_time = #{fCreateTime}</if>
<if test="fUpdateTime != null "> and f_update_time = #{fUpdateTime}</if>
<if test="fIsDel != null and fIsDel != ''"> and f_is_del = #{fIsDel}</if>
<if test="fRemarks != null and fRemarks != ''"> and f_remarks = #{fRemarks}</if>
</where>
</select>
<select id="selectTEmergencyDrillsById" parameterType="Long" resultMap="TEmergencyDrillsResult">
<include refid="selectTEmergencyDrillsVo"/>
where f_drills_id = #{fDrillsId}
</select>
<insert id="insertTEmergencyDrills" parameterType="TEmergencyDrills">
insert into t_emergency_drills
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fDrillsId != null">f_drills_id,</if>
<if test="fDrillsTime != null">f_drills_time,</if>
<if test="fEvent != null">f_event,</if>
<if test="fPlace != null">f_place,</if>
<if test="fPerDep != null">f_per_dep,</if>
<if test="fDrillsContent != null">f_drills_content,</if>
<if test="fDrillsPicture != null">f_drills_picture,</if>
<if test="fCreateTime != null">f_create_time,</if>
<if test="fUpdateTime != null">f_update_time,</if>
<if test="fIsDel != null">f_is_del,</if>
<if test="fRemarks != null">f_remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fDrillsId != null">#{fDrillsId},</if>
<if test="fDrillsTime != null">#{fDrillsTime},</if>
<if test="fEvent != null">#{fEvent},</if>
<if test="fPlace != null">#{fPlace},</if>
<if test="fPerDep != null">#{fPerDep},</if>
<if test="fDrillsContent != null">#{fDrillsContent},</if>
<if test="fDrillsPicture != null">#{fDrillsPicture},</if>
<if test="fCreateTime != null">#{fCreateTime},</if>
<if test="fUpdateTime != null">#{fUpdateTime},</if>
<if test="fIsDel != null">#{fIsDel},</if>
<if test="fRemarks != null">#{fRemarks},</if>
</trim>
</insert>
<update id="updateTEmergencyDrills" parameterType="TEmergencyDrills">
update t_emergency_drills
<trim prefix="SET" suffixOverrides=",">
<if test="fDrillsTime != null">f_drills_time = #{fDrillsTime},</if>
<if test="fEvent != null">f_event = #{fEvent},</if>
<if test="fPlace != null">f_place = #{fPlace},</if>
<if test="fPerDep != null">f_per_dep = #{fPerDep},</if>
<if test="fDrillsContent != null">f_drills_content = #{fDrillsContent},</if>
<if test="fDrillsPicture != null">f_drills_picture = #{fDrillsPicture},</if>
<if test="fCreateTime != null">f_create_time = #{fCreateTime},</if>
<if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
<if test="fIsDel != null">f_is_del = #{fIsDel},</if>
<if test="fRemarks != null">f_remarks = #{fRemarks},</if>
</trim>
where f_drills_id = #{fDrillsId}
</update>
<delete id="deleteTEmergencyDrillsById" parameterType="Long">
delete from t_emergency_drills where f_drills_id = #{fDrillsId}
</delete>
<delete id="deleteTEmergencyDrillsByIds" parameterType="String">
delete from t_emergency_drills where f_drills_id in
<foreach item="fDrillsId" collection="array" open="(" separator="," close=")">
#{fDrillsId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?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.zehong.system.mapper.TSupMajorHazardMapper">
<resultMap type="TSupMajorHazard" id="TSupMajorHazardResult">
<result property="fHazardId" column="f_hazard_id" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="fName" column="f_name" />
<result property="fResPer" column="f_res_per" />
<result property="fPhone" column="f_phone" />
<result property="fEvaInfor" column="f_eva_infor" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="fLevel" column="f_level" />
<result property="fCreateTime" column="f_create_time" />
<result property="fUpdateTime" column="f_update_time" />
<result property="fIsDel" column="f_is_del" />
<result property="fRemarks" column="f_remarks" />
</resultMap>
<resultMap type="TSupMajorHazard" id="ExportTSupMajorHazardResult">
<result property="fHazardId" column="f_hazard_id" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="fName" column="f_name" />
<result property="fResPer" column="f_res_per" />
<result property="fPhone" column="f_phone" />
<result property="fEvaInfor" column="f_eva_infor" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="fLevel" column="dict_label" />
<result property="fCreateTime" column="f_create_time" />
<result property="fUpdateTime" column="f_update_time" />
<result property="fIsDel" column="f_is_del" />
<result property="fRemarks" column="f_remarks" />
</resultMap>
<sql id="selectTSupMajorHazardVo">
select f_hazard_id, f_name, f_res_per, f_phone, f_eva_infor, longitude, latitude, f_level, f_create_time, f_update_time, f_is_del, f_remarks,beyond_enterprise_id from t_sup_major_hazard
</sql>
<sql id="exportSelectTSupMajorHazardVo">
SELECT
f_hazard_id,
f_name,
f_res_per,
f_phone,
f_eva_infor,
longitude,
latitude,
f_level,
f_create_time,
f_update_time,
f_is_del,
f_remarks,
beyond_enterprise_id ,
dict_label
FROM
t_sup_major_hazard hazard inner join sys_dict_data dictData on hazard.f_level = dictData.dict_value and dictData.dict_type = 'major_poll_source_level'
</sql>
<select id="selectTSupMajorHazardList" parameterType="TSupMajorHazard" resultMap="TSupMajorHazardResult">
<include refid="selectTSupMajorHazardVo"/>
<where>
<if test="fName != null and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
<if test="fResPer != null and fResPer != ''"> and f_res_per = #{fResPer}</if>
</where>
</select>
<select id="exportselectTSupMajorHazardList" parameterType="TSupMajorHazard" resultMap="ExportTSupMajorHazardResult">
<include refid="exportSelectTSupMajorHazardVo"/>
<where>
<if test="fName != null and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
<if test="fResPer != null and fResPer != ''"> and f_res_per = #{fResPer}</if>
</where>
</select>
<select id="selectTSupMajorHazardById" parameterType="Long" resultMap="TSupMajorHazardResult">
<include refid="selectTSupMajorHazardVo"/>
where f_hazard_id = #{fHazardId}
</select>
<insert id="insertTSupMajorHazard" parameterType="TSupMajorHazard" useGeneratedKeys="true" keyProperty="fHazardId">
insert into t_sup_major_hazard
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fName != null">f_name,</if>
<if test="fResPer != null">f_res_per,</if>
<if test="fPhone != null">f_phone,</if>
<if test="fEvaInfor != null">f_eva_infor,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="fLevel != null">f_level,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="fCreateTime != null">f_create_time,</if>
<if test="fUpdateTime != null">f_update_time,</if>
<if test="fIsDel != null">f_is_del,</if>
<if test="fRemarks != null">f_remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fName != null">#{fName},</if>
<if test="fResPer != null">#{fResPer},</if>
<if test="fPhone != null">#{fPhone},</if>
<if test="fEvaInfor != null">#{fEvaInfor},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="fLevel != null">#{fLevel},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="fCreateTime != null">#{fCreateTime},</if>
<if test="fUpdateTime != null">#{fUpdateTime},</if>
<if test="fIsDel != null">#{fIsDel},</if>
<if test="fRemarks != null">#{fRemarks},</if>
</trim>
</insert>
<update id="updateTSupMajorHazard" parameterType="TSupMajorHazard">
update t_sup_major_hazard
<trim prefix="SET" suffixOverrides=",">
<if test="fName != null">f_name = #{fName},</if>
<if test="fResPer != null">f_res_per = #{fResPer},</if>
<if test="fPhone != null">f_phone = #{fPhone},</if>
<if test="fEvaInfor != null">f_eva_infor = #{fEvaInfor},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="fLevel != null">f_level = #{fLevel},</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
<if test="fCreateTime != null">f_create_time = #{fCreateTime},</if>
<if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
<if test="fIsDel != null">f_is_del = #{fIsDel},</if>
<if test="fRemarks != null">f_remarks = #{fRemarks},</if>
</trim>
where f_hazard_id = #{fHazardId}
</update>
<delete id="deleteTSupMajorHazardById" parameterType="Long">
delete from t_sup_major_hazard where f_hazard_id = #{fHazardId}
</delete>
<delete id="deleteTSupMajorHazardByIds" parameterType="String">
delete from t_sup_major_hazard where f_hazard_id in
<foreach item="fHazardId" collection="array" open="(" separator="," close=")">
#{fHazardId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询应急演练列表
export function listRecord(query) {
return request({
url: '/emergencydrills/record/list',
method: 'get',
params: query
})
}
// 查询应急演练详细
export function getRecord(fDrillsId) {
return request({
url: '/emergencydrills/record/getDetail/' + fDrillsId,
method: 'get'
})
}
// 新增应急演练
export function addRecord(data) {
return request({
url: '/emergencydrills/record',
method: 'post',
data: data
})
}
// 修改应急演练
export function updateRecord(data) {
return request({
url: '/emergencydrills/record',
method: 'put',
data: data
})
}
// 删除应急演练
export function delRecord(fDrillsId) {
return request({
url: '/emergencydrills/record/' + fDrillsId,
method: 'delete'
})
}
// 导出应急演练
export function exportRecord(query) {
return request({
url: '/emergencydrills/record/export',
method: 'get',
params: query
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询重大危险源监管列表
export function listRecord(query) {
return request({
url: '/majorpollsourcelevel/record/list',
method: 'get',
params: query
})
}
// 查询重大危险源监管详细
export function getRecord(fHazardId) {
return request({
url: '/majorpollsourcelevel/record/' + fHazardId,
method: 'get'
})
}
// 新增重大危险源监管
export function addRecord(data) {
return request({
url: '/majorpollsourcelevel/record',
method: 'post',
data: data
})
}
// 修改重大危险源监管
export function updateRecord(data) {
return request({
url: '/majorpollsourcelevel/record',
method: 'put',
data: data
})
}
// 删除重大危险源监管
export function delRecord(fHazardId) {
return request({
url: '/majorpollsourcelevel/record/' + fHazardId,
method: 'delete'
})
}
// 导出重大危险源监管
export function exportRecord(query) {
return request({
url: '/majorpollsourcelevel/record/export',
method: 'get',
params: query
})
}
\ No newline at end of file
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="事件" prop="fEvent">
<el-input
v-model="queryParams.fEvent"
placeholder="请输入事件"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="地点" prop="fPlace">
<el-input
v-model="queryParams.fPlace"
placeholder="请输入地点"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['emergencydrills:record:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['emergencydrills:record:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['emergencydrills:record:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['emergencydrills:record:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="演练时间" align="center" prop="fDrillsTime" />
<el-table-column label="事件" align="center" prop="fEvent" />
<el-table-column label="地点" align="center" prop="fPlace" />
<el-table-column label="参与演练人员或部门" align="center" prop="fPerDep" />
<el-table-column label="演练内容" align="center" prop="fDrillsContent" />
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['emergencydrills:record:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['emergencydrills:record:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改应急演练对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-form-item label="演练时间" prop="fDrillsTime">
<el-date-picker clearable size="small" style="width: 100%"
v-model="form.fDrillsTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请输入演练时间">
</el-date-picker>
</el-form-item>
<el-form-item label="事件" prop="fEvent">
<el-input v-model="form.fEvent" placeholder="请输入事件" />
</el-form-item>
<el-form-item label="地点" prop="fPlace">
<el-input v-model="form.fPlace" placeholder="请输入地点" />
</el-form-item>
<el-form-item label="参与演练人员或部门" prop="fPerDep">
<el-input v-model="form.fPerDep" placeholder="请输入参与演练人员与部门" />
</el-form-item>
<el-form-item label="演练内容">
<el-input v-model="form.fDrillsContent" type="textarea" placeholder="请输入演练内容" />
</el-form-item>
<el-form-item label="演练图片" prop="fDrillsPicture">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord, exportRecord } from "@/api/emergencydrills/record";
import Editor from '@/components/Editor';
import FileUpload from '@/components/FileSuperviseUpload';
export default {
name: "Record",
components: {
Editor,
FileUpload
},
data() {
return {
//演练图片
fileList: [],
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 应急演练表格数据
recordList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fEvent: null,
fPlace: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
fDrillsTime: [
{ required: true, message: "演练时间不许为空", trigger: "blur" }
],
fEvent: [
{ required: true, message: "演练事件不许为空", trigger: "blur" }
],
fPlace: [
{ required: true, message: "演练地点不许为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/**上传头像*/
getFileInfo(res){
this.form.fDrillsPicture = res.url;
this.fileList.push({
name: res.fileName,
url: uploadfile,
burl:res.burl,
});
},
listRemove(e) {
this.fileList = [];
},
/** 查询应急演练列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
this.form = {
fDrillsId: null,
fDrillsTime: null,
fEvent: null,
fPlace: null,
fPerDep: null,
fDrillsContent: null,
fDrillsPicture: null,
fCreateTime: null,
fUpdateTime: null,
fIsDel: null,
fRemarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fDrillsId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加应急演练";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fDrillsId = row.fDrillsId || this.ids
getRecord(fDrillsId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改应急演练";
//图片回显
if (this.form.fDrillsPicture) {
this.fileList.push({
name: '照片',
url: this.form.fDrillsPicture,
});
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fDrillsId != null) {
updateRecord(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRecord(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fDrillsIds = row.fDrillsId || this.ids;
this.$confirm('是否确认删除应急演练编号为"' + fDrillsIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delRecord(fDrillsIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有应急演练数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportRecord(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="fName">
<el-input
v-model="queryParams.fName"
placeholder="请输入名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="责任人" prop="fResPer">
<el-input
v-model="queryParams.fResPer"
placeholder="请输入责任人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['majorpollsourcelevel:record:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['majorpollsourcelevel:record:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['majorpollsourcelevel:record:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['majorpollsourcelevel:record:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="名称" align="center" prop="fName" />
<el-table-column label="责任人" align="center" prop="fResPer" />
<el-table-column label="电话" align="center" prop="fPhone" />
<el-table-column label="安全评估信息" align="center" prop="fEvaInfor" />
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="分级情况" align="center" prop="fLevel" :formatter="fLevelFormat" />
<el-table-column label="所属单位" align="center" prop="beyondEnterpriseId" :formatter="beyondEnterpriseFormat" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['majorpollsourcelevel:record:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['majorpollsourcelevel:record:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改重大危险源监管对话框 -->
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="11">
<el-form-item label="名称" prop="fName">
<el-input v-model="form.fName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="责任人" prop="fResPer">
<el-input v-model="form.fResPer" placeholder="请输入责任人" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="电话" prop="fPhone">
<el-input v-model="form.fPhone" placeholder="请输入电话" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全评估信息" prop="fEvaInfor">
<el-input v-model="form.fEvaInfor" placeholder="请输入安全评估信息" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="23">
<el-form-item label="经纬度坐标" prop="longitude">
<el-col :span="9">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-col>
<el-col :span="9" style="margin-left: 10px">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-col>
<el-col :span="3" style="margin-left: 30px">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="分级情况" prop="fLevel">
<el-select v-model="form.fLevel" placeholder="请选择分级情况" style="width: 100%;">
<el-option
v-for="dict in fLevelOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属单位" prop="beyondEnterpriseId">
<el-select v-model="form.beyondEnterpriseId" placeholder="请选择所属单位名称" style="width: 100%" @change="selectworkAssignEnterprose($event)">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<GetPos
:dialogVisible.sync="dialogTableVisibles"
device=""
:devicePos="devicePos"
@close="dialogcancelFun"
@getPath="getPath"
/>
</div>
</template>
<script>
import { listRecord, getRecord, delRecord, addRecord, updateRecord, exportRecord } from "@/api/majorpollsourcelevel/record";
import GetPos from '@/components/GetPos';
import { enterpriseLists } from "@/api/regulation/info";
import { getInspectionUsers } from "@/api/system/user";
export default {
name: "Record",
components: {
GetPos
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
enterprises: [],
// 总条数
total: 0,
// 重大危险源监管表格数据
recordList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 分级情况字典
fLevelOptions: [],
// 企业单位情况字典
beyondEnterpriseOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fName: null,
fResPer: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
fName: [
{ required: true, message: "请输入名称", trigger: "blur" },
],
fResPer: [
{ required: true, message: "请输入责任人", trigger: "blur" },
],
},
/**--------------地图使用数据---------------*/
dialogTableVisibles: false,
devicePos: []
};
},
created() {
this.getList();
this.getEnterpriseLists();
this.getDicts("major_poll_source_level").then(response => {
this.fLevelOptions = response.data;
});
},
methods: {
// 分级情况字典翻译
// fLevelFormat(row, column) {
// return this.selectDictLabel(this.fLevelOptions, row.fLevel);
// },
fLevelFormat(row){
let obj=this.fLevelOptions.find(item=>{
return item.dictValue==row.fLevel;
})
if(obj!=undefined || obj!=null){
return obj.dictLabel;
}
},
beyondEnterpriseFormat(row){
let info = this.enterprises.find(item => item.enterpriseId == row.beyondEnterpriseId);
return info?info.enterpriseName:"-";
},
/** 查询重大危险源监管列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then(response => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fHazardId: null,
fName: null,
fResPer: null,
fPhone: null,
fEvaInfor: null,
longitude: null,
latitude: null,
fLevel: null,
fCreateTime: null,
fUpdateTime: null,
fIsDel: null,
fRemarks: null,
beyondEnterpriseId:null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fHazardId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加重大危险源监管";
this.getEnterpriseLists();
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fHazardId = row.fHazardId || this.ids
getRecord(fHazardId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改重大危险源监管";
});
this.getEnterpriseLists();
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fHazardId != null) {
updateRecord(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addRecord(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fHazardIds = row.fHazardId || this.ids;
this.$confirm('是否确认删除重大危险源监管编号为"' + fHazardIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delRecord(fHazardIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有重大危险源监管数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportRecord(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
},
getInspectionUserList(enterpriseId){
getInspectionUsers(enterpriseId,"se").then(response =>{
this.inspectors = response.data;
})
},
selectworkAssignEnterprose(enterpriseId){
this.getInspectionUserList(enterpriseId);
},
//所属单位
getEnterpriseLists(){
const param = {};
// this.judgeOperateType(param);
enterpriseLists(param).then(response => {
if (response.rows.length>1){
this.enterprises = response.rows;
}else {
this.form.beyondEnterpriseId=response.rows[0].enterpriseId;
this.enterprises = response.rows;
}
});
},
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment