Commit 90f16312 authored by 王晓倩's avatar 王晓倩

巡检计划、巡检记录、报警信息、隐患信息

parent 9e0b923c
package com.zehong.web.controller.dataMonitoring;
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.TDeviceAlarm;
import com.zehong.system.service.ITDeviceAlarmService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 报警信息Controller
*
* @author zehong
* @date 2021-07-21
*/
@RestController
@RequestMapping("/dataMonitoring/deviceAlarm")
public class TDeviceAlarmController extends BaseController
{
@Autowired
private ITDeviceAlarmService tDeviceAlarmService;
/**
* 查询报警信息列表
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:list')")
@GetMapping("/list")
public TableDataInfo list(TDeviceAlarm tDeviceAlarm)
{
startPage();
List<TDeviceAlarm> list = tDeviceAlarmService.selectTDeviceAlarmList(tDeviceAlarm);
return getDataTable(list);
}
/**
* 导出报警信息列表
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:export')")
@Log(title = "报警信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TDeviceAlarm tDeviceAlarm)
{
List<TDeviceAlarm> list = tDeviceAlarmService.selectTDeviceAlarmList(tDeviceAlarm);
ExcelUtil<TDeviceAlarm> util = new ExcelUtil<TDeviceAlarm>(TDeviceAlarm.class);
return util.exportExcel(list, "报警信息数据");
}
/**
* 获取报警信息详细信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:query')")
@GetMapping(value = "/{alarmId}")
public AjaxResult getInfo(@PathVariable("alarmId") Long alarmId)
{
return AjaxResult.success(tDeviceAlarmService.selectTDeviceAlarmById(alarmId));
}
/**
* 新增报警信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:add')")
@Log(title = "报警信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TDeviceAlarm tDeviceAlarm)
{
return toAjax(tDeviceAlarmService.insertTDeviceAlarm(tDeviceAlarm));
}
/**
* 修改报警信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:edit')")
@Log(title = "报警信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TDeviceAlarm tDeviceAlarm)
{
return toAjax(tDeviceAlarmService.updateTDeviceAlarm(tDeviceAlarm));
}
/**
* 删除报警信息
*/
@PreAuthorize("@ss.hasPermi('dataMonitoring:deviceAlarm:remove')")
@Log(title = "报警信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{alarmIds}")
public AjaxResult remove(@PathVariable Long[] alarmIds)
{
return toAjax(tDeviceAlarmService.deleteTDeviceAlarmByIds(alarmIds));
}
}
package com.zehong.web.controller.deviceInspection;
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.TInspectionPlan;
import com.zehong.system.service.ITInspectionPlanService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 巡检计划Controller
*
* @author zehong
* @date 2021-07-21
*/
@RestController
@RequestMapping("/deviceInspection/inspectionPlan")
public class TInspectionPlanController extends BaseController
{
@Autowired
private ITInspectionPlanService tInspectionPlanService;
/**
* 查询巡检计划列表
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:list')")
@GetMapping("/list")
public TableDataInfo list(TInspectionPlan tInspectionPlan)
{
startPage();
List<TInspectionPlan> list = tInspectionPlanService.selectTInspectionPlanList(tInspectionPlan);
return getDataTable(list);
}
/**
* 导出巡检计划列表
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:export')")
@Log(title = "巡检计划", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TInspectionPlan tInspectionPlan)
{
List<TInspectionPlan> list = tInspectionPlanService.selectTInspectionPlanList(tInspectionPlan);
ExcelUtil<TInspectionPlan> util = new ExcelUtil<TInspectionPlan>(TInspectionPlan.class);
return util.exportExcel(list, "巡检计划数据");
}
/**
* 获取巡检计划详细信息
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:query')")
@GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") Long planId)
{
return AjaxResult.success(tInspectionPlanService.selectTInspectionPlanById(planId));
}
/**
* 新增巡检计划
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:add')")
@Log(title = "巡检计划", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TInspectionPlan tInspectionPlan)
{
return toAjax(tInspectionPlanService.insertTInspectionPlan(tInspectionPlan));
}
/**
* 修改巡检计划
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:edit')")
@Log(title = "巡检计划", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TInspectionPlan tInspectionPlan)
{
return toAjax(tInspectionPlanService.updateTInspectionPlan(tInspectionPlan));
}
/**
* 删除巡检计划
*/
@PreAuthorize("@ss.hasPermi('deviceInspection:inspectionPlan:remove')")
@Log(title = "巡检计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public AjaxResult remove(@PathVariable Long[] planIds)
{
return toAjax(tInspectionPlanService.deleteTInspectionPlanByIds(planIds));
}
}
package com.zehong.web.controller.riskManagement;
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.THiddenTrouble;
import com.zehong.system.service.ITHiddenTroubleService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 隐患信息Controller
*
* @author zehong
* @date 2021-07-21
*/
@RestController
@RequestMapping("/riskManagement/hiddenTrouble")
public class THiddenTroubleController extends BaseController
{
@Autowired
private ITHiddenTroubleService tHiddenTroubleService;
/**
* 查询隐患信息列表
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:list')")
@GetMapping("/list")
public TableDataInfo list(THiddenTrouble tHiddenTrouble)
{
startPage();
List<THiddenTrouble> list = tHiddenTroubleService.selectTHiddenTroubleList(tHiddenTrouble);
return getDataTable(list);
}
/**
* 导出隐患信息列表
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:export')")
@Log(title = "隐患信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(THiddenTrouble tHiddenTrouble)
{
List<THiddenTrouble> list = tHiddenTroubleService.selectTHiddenTroubleList(tHiddenTrouble);
ExcelUtil<THiddenTrouble> util = new ExcelUtil<THiddenTrouble>(THiddenTrouble.class);
return util.exportExcel(list, "隐患信息数据");
}
/**
* 获取隐患信息详细信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:query')")
@GetMapping(value = "/{troubleId}")
public AjaxResult getInfo(@PathVariable("troubleId") Long troubleId)
{
return AjaxResult.success(tHiddenTroubleService.selectTHiddenTroubleById(troubleId));
}
/**
* 新增隐患信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:add')")
@Log(title = "隐患信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THiddenTrouble tHiddenTrouble)
{
return toAjax(tHiddenTroubleService.insertTHiddenTrouble(tHiddenTrouble));
}
/**
* 修改隐患信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:edit')")
@Log(title = "隐患信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THiddenTrouble tHiddenTrouble)
{
return toAjax(tHiddenTroubleService.updateTHiddenTrouble(tHiddenTrouble));
}
/**
* 删除隐患信息
*/
@PreAuthorize("@ss.hasPermi('riskManagement:hiddenTrouble:remove')")
@Log(title = "隐患信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{troubleIds}")
public AjaxResult remove(@PathVariable Long[] troubleIds)
{
return toAjax(tHiddenTroubleService.deleteTHiddenTroubleByIds(troubleIds));
}
}
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_device_alarm
*
* @author zehong
* @date 2021-07-21
*/
public class TDeviceAlarm extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long alarmId;
/** 设备id */
@Excel(name = "设备id")
private Long deviceId;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 报警类型 */
@Excel(name = "报警类型")
private String alarmType;
/** 报警值(报警信息) */
@Excel(name = "报警值", readConverterExp = "报警信息")
private String alarmValue;
/** 报警开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报警开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 报警结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报警结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/**
处理状态(1不需处理,2已处理完成,3未处理完成) */
@Excel(name = "处理状态", readConverterExp = "1不需处理,2已处理完成,3未处理完成")
private String dealStatus;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setAlarmId(Long alarmId)
{
this.alarmId = alarmId;
}
public Long getAlarmId()
{
return alarmId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setAlarmType(String alarmType)
{
this.alarmType = alarmType;
}
public String getAlarmType()
{
return alarmType;
}
public void setAlarmValue(String alarmValue)
{
this.alarmValue = alarmValue;
}
public String getAlarmValue()
{
return alarmValue;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("alarmId", getAlarmId())
.append("deviceId", getDeviceId())
.append("orderId", getOrderId())
.append("alarmType", getAlarmType())
.append("alarmValue", getAlarmValue())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
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_hidden_trouble
*
* @author zehong
* @date 2021-07-21
*/
public class THiddenTrouble extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 隐患信息id */
private Long troubleId;
/** 设备id */
@Excel(name = "设备id")
private Long deviceId;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 处理状态(1不需处理,2已处理完成,3未处理完成) */
@Excel(name = "处理状态", readConverterExp = "1=不需处理,2已处理完成,3未处理完成")
private String dealStatus;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setTroubleId(Long troubleId)
{
this.troubleId = troubleId;
}
public Long getTroubleId()
{
return troubleId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
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 setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("troubleId", getTroubleId())
.append("deviceId", getDeviceId())
.append("orderId", getOrderId())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain; 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.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel; import com.zehong.common.annotation.Excel;
...@@ -13,7 +9,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -13,7 +9,7 @@ import com.zehong.common.core.domain.BaseEntity;
* 巡检记录对象 t_inspection_data * 巡检记录对象 t_inspection_data
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
public class TInspectionData extends BaseEntity public class TInspectionData extends BaseEntity
{ {
...@@ -22,22 +18,17 @@ public class TInspectionData extends BaseEntity ...@@ -22,22 +18,17 @@ public class TInspectionData extends BaseEntity
/** 巡检记录id */ /** 巡检记录id */
private Long dataId; private Long dataId;
/** 巡检员id */ /** 巡检计划id */
@Excel(name = "巡检员id") @Excel(name = "巡检计划id")
private Long inspectorId; private Long planId;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */ /** 设备id */
@Excel(name = "纬度") @Excel(name = "设备id")
private BigDecimal latitude; private Long deviceId;
/** 创建时间 */ /** 处理状态(1不需处理,2已处理完成,3未处理完成) */
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss") @Excel(name = "处理状态", readConverterExp = "1=不需处理,2已处理完成,3未处理完成")
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss") private String dealStatus;
private Date createTime;
/** 备注 */ /** 备注 */
@Excel(name = "备注") @Excel(name = "备注")
...@@ -52,32 +43,32 @@ public class TInspectionData extends BaseEntity ...@@ -52,32 +43,32 @@ public class TInspectionData extends BaseEntity
{ {
return dataId; return dataId;
} }
public void setInspectorId(Long inspectorId) public void setPlanId(Long planId)
{ {
this.inspectorId = inspectorId; this.planId = planId;
} }
public Long getInspectorId() public Long getPlanId()
{ {
return inspectorId; return planId;
} }
public void setLongitude(BigDecimal longitude) public void setDeviceId(Long deviceId)
{ {
this.longitude = longitude; this.deviceId = deviceId;
} }
public BigDecimal getLongitude() public Long getDeviceId()
{ {
return longitude; return deviceId;
} }
public void setLatitude(BigDecimal latitude) public void setDealStatus(String dealStatus)
{ {
this.latitude = latitude; this.dealStatus = dealStatus;
} }
public BigDecimal getLatitude() public String getDealStatus()
{ {
return latitude; return dealStatus;
} }
public void setRemarks(String remarks) public void setRemarks(String remarks)
{ {
...@@ -89,21 +80,14 @@ public class TInspectionData extends BaseEntity ...@@ -89,21 +80,14 @@ public class TInspectionData extends BaseEntity
return remarks; return remarks;
} }
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("dataId", getDataId()) .append("dataId", getDataId())
.append("inspectorId", getInspectorId()) .append("planId", getPlanId())
.append("longitude", getLongitude()) .append("deviceId", getDeviceId())
.append("latitude", getLatitude()) .append("dealStatus", getDealStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("remarks", getRemarks()) .append("remarks", getRemarks())
.toString(); .toString();
......
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_inspection_plan
*
* @author zehong
* @date 2021-07-21
*/
public class TInspectionPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 巡检计划id */
private Long planId;
/** 巡检计划名称 */
@Excel(name = "巡检计划名称")
private String planName;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 状态 */
@Excel(name = "状态")
private String planStatus;
/** 计划描述 */
@Excel(name = "计划描述")
private String remarks;
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public void setPlanName(String planName)
{
this.planName = planName;
}
public String getPlanName()
{
return planName;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setPlanStatus(String planStatus)
{
this.planStatus = planStatus;
}
public String getPlanStatus()
{
return planStatus;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("planId", getPlanId())
.append("planName", getPlanName())
.append("orderId", getOrderId())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("planStatus", getPlanStatus())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TDeviceAlarm;
/**
* 报警信息Mapper接口
*
* @author zehong
* @date 2021-07-21
*/
public interface TDeviceAlarmMapper
{
/**
* 查询报警信息
*
* @param alarmId 报警信息ID
* @return 报警信息
*/
public TDeviceAlarm selectTDeviceAlarmById(Long alarmId);
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @return 报警信息集合
*/
public List<TDeviceAlarm> selectTDeviceAlarmList(TDeviceAlarm tDeviceAlarm);
/**
* 新增报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int insertTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 修改报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int updateTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 删除报警信息
*
* @param alarmId 报警信息ID
* @return 结果
*/
public int deleteTDeviceAlarmById(Long alarmId);
/**
* 批量删除报警信息
*
* @param alarmIds 需要删除的数据ID
* @return 结果
*/
public int deleteTDeviceAlarmByIds(Long[] alarmIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.THiddenTrouble;
/**
* 隐患信息Mapper接口
*
* @author zehong
* @date 2021-07-21
*/
public interface THiddenTroubleMapper
{
/**
* 查询隐患信息
*
* @param troubleId 隐患信息ID
* @return 隐患信息
*/
public THiddenTrouble selectTHiddenTroubleById(Long troubleId);
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @return 隐患信息集合
*/
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble);
/**
* 新增隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int insertTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 修改隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int updateTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 删除隐患信息
*
* @param troubleId 隐患信息ID
* @return 结果
*/
public int deleteTHiddenTroubleById(Long troubleId);
/**
* 批量删除隐患信息
*
* @param troubleIds 需要删除的数据ID
* @return 结果
*/
public int deleteTHiddenTroubleByIds(Long[] troubleIds);
}
...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData; ...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData;
* 巡检记录Mapper接口 * 巡检记录Mapper接口
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
public interface TInspectionDataMapper public interface TInspectionDataMapper
{ {
......
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TInspectionPlan;
/**
* 巡检计划Mapper接口
*
* @author zehong
* @date 2021-07-21
*/
public interface TInspectionPlanMapper
{
/**
* 查询巡检计划
*
* @param planId 巡检计划ID
* @return 巡检计划
*/
public TInspectionPlan selectTInspectionPlanById(Long planId);
/**
* 查询巡检计划列表
*
* @param tInspectionPlan 巡检计划
* @return 巡检计划集合
*/
public List<TInspectionPlan> selectTInspectionPlanList(TInspectionPlan tInspectionPlan);
/**
* 新增巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 修改巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int updateTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 删除巡检计划
*
* @param planId 巡检计划ID
* @return 结果
*/
public int deleteTInspectionPlanById(Long planId);
/**
* 批量删除巡检计划
*
* @param planIds 需要删除的数据ID
* @return 结果
*/
public int deleteTInspectionPlanByIds(Long[] planIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TDeviceAlarm;
/**
* 报警信息Service接口
*
* @author zehong
* @date 2021-07-21
*/
public interface ITDeviceAlarmService
{
/**
* 查询报警信息
*
* @param alarmId 报警信息ID
* @return 报警信息
*/
public TDeviceAlarm selectTDeviceAlarmById(Long alarmId);
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @return 报警信息集合
*/
public List<TDeviceAlarm> selectTDeviceAlarmList(TDeviceAlarm tDeviceAlarm);
/**
* 新增报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int insertTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 修改报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
public int updateTDeviceAlarm(TDeviceAlarm tDeviceAlarm);
/**
* 批量删除报警信息
*
* @param alarmIds 需要删除的报警信息ID
* @return 结果
*/
public int deleteTDeviceAlarmByIds(Long[] alarmIds);
/**
* 删除报警信息信息
*
* @param alarmId 报警信息ID
* @return 结果
*/
public int deleteTDeviceAlarmById(Long alarmId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.THiddenTrouble;
/**
* 隐患信息Service接口
*
* @author zehong
* @date 2021-07-21
*/
public interface ITHiddenTroubleService
{
/**
* 查询隐患信息
*
* @param troubleId 隐患信息ID
* @return 隐患信息
*/
public THiddenTrouble selectTHiddenTroubleById(Long troubleId);
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @return 隐患信息集合
*/
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble);
/**
* 新增隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int insertTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 修改隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
public int updateTHiddenTrouble(THiddenTrouble tHiddenTrouble);
/**
* 批量删除隐患信息
*
* @param troubleIds 需要删除的隐患信息ID
* @return 结果
*/
public int deleteTHiddenTroubleByIds(Long[] troubleIds);
/**
* 删除隐患信息信息
*
* @param troubleId 隐患信息ID
* @return 结果
*/
public int deleteTHiddenTroubleById(Long troubleId);
}
...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData; ...@@ -7,7 +7,7 @@ import com.zehong.system.domain.TInspectionData;
* 巡检记录Service接口 * 巡检记录Service接口
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
public interface ITInspectionDataService public interface ITInspectionDataService
{ {
......
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TInspectionPlan;
/**
* 巡检计划Service接口
*
* @author zehong
* @date 2021-07-21
*/
public interface ITInspectionPlanService
{
/**
* 查询巡检计划
*
* @param planId 巡检计划ID
* @return 巡检计划
*/
public TInspectionPlan selectTInspectionPlanById(Long planId);
/**
* 查询巡检计划列表
*
* @param tInspectionPlan 巡检计划
* @return 巡检计划集合
*/
public List<TInspectionPlan> selectTInspectionPlanList(TInspectionPlan tInspectionPlan);
/**
* 新增巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 修改巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
public int updateTInspectionPlan(TInspectionPlan tInspectionPlan);
/**
* 批量删除巡检计划
*
* @param planIds 需要删除的巡检计划ID
* @return 结果
*/
public int deleteTInspectionPlanByIds(Long[] planIds);
/**
* 删除巡检计划信息
*
* @param planId 巡检计划ID
* @return 结果
*/
public int deleteTInspectionPlanById(Long planId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceAlarmMapper;
import com.zehong.system.domain.TDeviceAlarm;
import com.zehong.system.service.ITDeviceAlarmService;
/**
* 报警信息Service业务层处理
*
* @author zehong
* @date 2021-07-21
*/
@Service
public class TDeviceAlarmServiceImpl implements ITDeviceAlarmService
{
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
/**
* 查询报警信息
*
* @param alarmId 报警信息ID
* @return 报警信息
*/
@Override
public TDeviceAlarm selectTDeviceAlarmById(Long alarmId)
{
return tDeviceAlarmMapper.selectTDeviceAlarmById(alarmId);
}
/**
* 查询报警信息列表
*
* @param tDeviceAlarm 报警信息
* @return 报警信息
*/
@Override
public List<TDeviceAlarm> selectTDeviceAlarmList(TDeviceAlarm tDeviceAlarm)
{
return tDeviceAlarmMapper.selectTDeviceAlarmList(tDeviceAlarm);
}
/**
* 新增报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
@Override
public int insertTDeviceAlarm(TDeviceAlarm tDeviceAlarm)
{
tDeviceAlarm.setCreateTime(DateUtils.getNowDate());
return tDeviceAlarmMapper.insertTDeviceAlarm(tDeviceAlarm);
}
/**
* 修改报警信息
*
* @param tDeviceAlarm 报警信息
* @return 结果
*/
@Override
public int updateTDeviceAlarm(TDeviceAlarm tDeviceAlarm)
{
tDeviceAlarm.setUpdateTime(DateUtils.getNowDate());
return tDeviceAlarmMapper.updateTDeviceAlarm(tDeviceAlarm);
}
/**
* 批量删除报警信息
*
* @param alarmIds 需要删除的报警信息ID
* @return 结果
*/
@Override
public int deleteTDeviceAlarmByIds(Long[] alarmIds)
{
return tDeviceAlarmMapper.deleteTDeviceAlarmByIds(alarmIds);
}
/**
* 删除报警信息信息
*
* @param alarmId 报警信息ID
* @return 结果
*/
@Override
public int deleteTDeviceAlarmById(Long alarmId)
{
return tDeviceAlarmMapper.deleteTDeviceAlarmById(alarmId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.THiddenTroubleMapper;
import com.zehong.system.domain.THiddenTrouble;
import com.zehong.system.service.ITHiddenTroubleService;
/**
* 隐患信息Service业务层处理
*
* @author zehong
* @date 2021-07-21
*/
@Service
public class THiddenTroubleServiceImpl implements ITHiddenTroubleService
{
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
/**
* 查询隐患信息
*
* @param troubleId 隐患信息ID
* @return 隐患信息
*/
@Override
public THiddenTrouble selectTHiddenTroubleById(Long troubleId)
{
return tHiddenTroubleMapper.selectTHiddenTroubleById(troubleId);
}
/**
* 查询隐患信息列表
*
* @param tHiddenTrouble 隐患信息
* @return 隐患信息
*/
@Override
public List<THiddenTrouble> selectTHiddenTroubleList(THiddenTrouble tHiddenTrouble)
{
return tHiddenTroubleMapper.selectTHiddenTroubleList(tHiddenTrouble);
}
/**
* 新增隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
@Override
public int insertTHiddenTrouble(THiddenTrouble tHiddenTrouble)
{
tHiddenTrouble.setCreateTime(DateUtils.getNowDate());
return tHiddenTroubleMapper.insertTHiddenTrouble(tHiddenTrouble);
}
/**
* 修改隐患信息
*
* @param tHiddenTrouble 隐患信息
* @return 结果
*/
@Override
public int updateTHiddenTrouble(THiddenTrouble tHiddenTrouble)
{
tHiddenTrouble.setUpdateTime(DateUtils.getNowDate());
return tHiddenTroubleMapper.updateTHiddenTrouble(tHiddenTrouble);
}
/**
* 批量删除隐患信息
*
* @param troubleIds 需要删除的隐患信息ID
* @return 结果
*/
@Override
public int deleteTHiddenTroubleByIds(Long[] troubleIds)
{
return tHiddenTroubleMapper.deleteTHiddenTroubleByIds(troubleIds);
}
/**
* 删除隐患信息信息
*
* @param troubleId 隐患信息ID
* @return 结果
*/
@Override
public int deleteTHiddenTroubleById(Long troubleId)
{
return tHiddenTroubleMapper.deleteTHiddenTroubleById(troubleId);
}
}
...@@ -12,7 +12,7 @@ import com.zehong.system.service.ITInspectionDataService; ...@@ -12,7 +12,7 @@ import com.zehong.system.service.ITInspectionDataService;
* 巡检记录Service业务层处理 * 巡检记录Service业务层处理
* *
* @author zehong * @author zehong
* @date 2021-07-09 * @date 2021-07-21
*/ */
@Service @Service
public class TInspectionDataServiceImpl implements ITInspectionDataService public class TInspectionDataServiceImpl implements ITInspectionDataService
...@@ -66,6 +66,7 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService ...@@ -66,6 +66,7 @@ public class TInspectionDataServiceImpl implements ITInspectionDataService
@Override @Override
public int updateTInspectionData(TInspectionData tInspectionData) public int updateTInspectionData(TInspectionData tInspectionData)
{ {
tInspectionData.setUpdateTime(DateUtils.getNowDate());
return tInspectionDataMapper.updateTInspectionData(tInspectionData); return tInspectionDataMapper.updateTInspectionData(tInspectionData);
} }
......
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TInspectionPlanMapper;
import com.zehong.system.domain.TInspectionPlan;
import com.zehong.system.service.ITInspectionPlanService;
/**
* 巡检计划Service业务层处理
*
* @author zehong
* @date 2021-07-21
*/
@Service
public class TInspectionPlanServiceImpl implements ITInspectionPlanService
{
@Autowired
private TInspectionPlanMapper tInspectionPlanMapper;
/**
* 查询巡检计划
*
* @param planId 巡检计划ID
* @return 巡检计划
*/
@Override
public TInspectionPlan selectTInspectionPlanById(Long planId)
{
return tInspectionPlanMapper.selectTInspectionPlanById(planId);
}
/**
* 查询巡检计划列表
*
* @param tInspectionPlan 巡检计划
* @return 巡检计划
*/
@Override
public List<TInspectionPlan> selectTInspectionPlanList(TInspectionPlan tInspectionPlan)
{
return tInspectionPlanMapper.selectTInspectionPlanList(tInspectionPlan);
}
/**
* 新增巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
@Override
public int insertTInspectionPlan(TInspectionPlan tInspectionPlan)
{
tInspectionPlan.setCreateTime(DateUtils.getNowDate());
return tInspectionPlanMapper.insertTInspectionPlan(tInspectionPlan);
}
/**
* 修改巡检计划
*
* @param tInspectionPlan 巡检计划
* @return 结果
*/
@Override
public int updateTInspectionPlan(TInspectionPlan tInspectionPlan)
{
tInspectionPlan.setUpdateTime(DateUtils.getNowDate());
return tInspectionPlanMapper.updateTInspectionPlan(tInspectionPlan);
}
/**
* 批量删除巡检计划
*
* @param planIds 需要删除的巡检计划ID
* @return 结果
*/
@Override
public int deleteTInspectionPlanByIds(Long[] planIds)
{
return tInspectionPlanMapper.deleteTInspectionPlanByIds(planIds);
}
/**
* 删除巡检计划信息
*
* @param planId 巡检计划ID
* @return 结果
*/
@Override
public int deleteTInspectionPlanById(Long planId)
{
return tInspectionPlanMapper.deleteTInspectionPlanById(planId);
}
}
...@@ -52,6 +52,13 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -52,6 +52,13 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
@Override @Override
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback) public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{ {
Long deviceId = tOrderFeedback.getDeviceId();
// 更改巡检记录状态
if(deviceId != 0L){
String dealStatus = tOrderFeedback.getDealStatus();
}
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback); return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
} }
......
<?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.TDeviceAlarmMapper">
<resultMap type="TDeviceAlarm" id="TDeviceAlarmResult">
<result property="alarmId" column="alarm_id" />
<result property="deviceId" column="device_id" />
<result property="orderId" column="order_id" />
<result property="alarmType" column="alarm_type" />
<result property="alarmValue" column="alarm_value" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="dealStatus" column="deal_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTDeviceAlarmVo">
select alarm_id, device_id, order_id, alarm_type, alarm_value, start_time, end_time, deal_status, update_time, create_time, remarks from t_device_alarm
</sql>
<select id="selectTDeviceAlarmList" parameterType="TDeviceAlarm" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="alarmType != null and alarmType != ''"> and alarm_type = #{alarmType}</if>
<if test="alarmValue != null and alarmValue != ''"> and alarm_value = #{alarmValue}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTDeviceAlarmById" parameterType="Long" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/>
where alarm_id = #{alarmId}
</select>
<insert id="insertTDeviceAlarm" parameterType="TDeviceAlarm" useGeneratedKeys="true" keyProperty="alarmId">
insert into t_device_alarm
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="orderId != null">order_id,</if>
<if test="alarmType != null">alarm_type,</if>
<if test="alarmValue != null">alarm_value,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="dealStatus != null">deal_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="alarmType != null">#{alarmType},</if>
<if test="alarmValue != null">#{alarmValue},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="dealStatus != null">#{dealStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTDeviceAlarm" parameterType="TDeviceAlarm">
update t_device_alarm
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="alarmType != null">alarm_type = #{alarmType},</if>
<if test="alarmValue != null">alarm_value = #{alarmValue},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where alarm_id = #{alarmId}
</update>
<delete id="deleteTDeviceAlarmById" parameterType="Long">
delete from t_device_alarm where alarm_id = #{alarmId}
</delete>
<delete id="deleteTDeviceAlarmByIds" parameterType="String">
delete from t_device_alarm where alarm_id in
<foreach item="alarmId" collection="array" open="(" separator="," close=")">
#{alarmId}
</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.THiddenTroubleMapper">
<resultMap type="THiddenTrouble" id="THiddenTroubleResult">
<result property="troubleId" column="trouble_id" />
<result property="deviceId" column="device_id" />
<result property="orderId" column="order_id" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="dealStatus" column="deal_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTHiddenTroubleVo">
select trouble_id, device_id, order_id, longitude, latitude, deal_status, update_time, create_time, remarks from t_hidden_trouble
</sql>
<select id="selectTHiddenTroubleList" parameterType="THiddenTrouble" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
<where>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTHiddenTroubleById" parameterType="Long" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/>
where trouble_id = #{troubleId}
</select>
<insert id="insertTHiddenTrouble" parameterType="THiddenTrouble" useGeneratedKeys="true" keyProperty="troubleId">
insert into t_hidden_trouble
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceId != null">device_id,</if>
<if test="orderId != null">order_id,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="dealStatus != null">deal_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceId != null">#{deviceId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="dealStatus != null">#{dealStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTHiddenTrouble" parameterType="THiddenTrouble">
update t_hidden_trouble
<trim prefix="SET" suffixOverrides=",">
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where trouble_id = #{troubleId}
</update>
<delete id="deleteTHiddenTroubleById" parameterType="Long">
delete from t_hidden_trouble where trouble_id = #{troubleId}
</delete>
<delete id="deleteTHiddenTroubleByIds" parameterType="String">
delete from t_hidden_trouble where trouble_id in
<foreach item="troubleId" collection="array" open="(" separator="," close=")">
#{troubleId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -6,23 +6,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,23 +6,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TInspectionData" id="TInspectionDataResult"> <resultMap type="TInspectionData" id="TInspectionDataResult">
<result property="dataId" column="data_id" /> <result property="dataId" column="data_id" />
<result property="inspectorId" column="inspector_id" /> <result property="planId" column="plan_id" />
<result property="longitude" column="longitude" /> <result property="deviceId" column="device_id" />
<result property="latitude" column="latitude" /> <result property="dealStatus" column="deal_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="remarks" column="remarks" /> <result property="remarks" column="remarks" />
</resultMap> </resultMap>
<sql id="selectTInspectionDataVo"> <sql id="selectTInspectionDataVo">
select data_id, inspector_id, longitude, latitude, create_time, remarks from t_inspection_data select data_id, plan_id, device_id, deal_status, update_time, create_time, remarks from t_inspection_data
</sql> </sql>
<select id="selectTInspectionDataList" parameterType="TInspectionData" resultMap="TInspectionDataResult"> <select id="selectTInspectionDataList" parameterType="TInspectionData" resultMap="TInspectionDataResult">
<include refid="selectTInspectionDataVo"/> <include refid="selectTInspectionDataVo"/>
<where> <where>
<if test="inspectorId != null "> and inspector_id = #{inspectorId}</if> <if test="planId != null "> and plan_id = #{planId}</if>
<if test="longitude != null "> and longitude = #{longitude}</if> <if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="latitude != null "> and latitude = #{latitude}</if> <if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
</select> </select>
...@@ -36,17 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,17 +37,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into t_inspection_data insert into t_inspection_data
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dataId != null">data_id,</if> <if test="dataId != null">data_id,</if>
<if test="inspectorId != null">inspector_id,</if> <if test="planId != null">plan_id,</if>
<if test="longitude != null">longitude,</if> <if test="deviceId != null">device_id,</if>
<if test="latitude != null">latitude,</if> <if test="dealStatus != null">deal_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dataId != null">#{dataId},</if> <if test="dataId != null">#{dataId},</if>
<if test="inspectorId != null">#{inspectorId},</if> <if test="planId != null">#{planId},</if>
<if test="longitude != null">#{longitude},</if> <if test="deviceId != null">#{deviceId},</if>
<if test="latitude != null">#{latitude},</if> <if test="dealStatus != null">#{dealStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if> <if test="remarks != null">#{remarks},</if>
</trim> </trim>
...@@ -55,9 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -55,9 +58,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTInspectionData" parameterType="TInspectionData"> <update id="updateTInspectionData" parameterType="TInspectionData">
update t_inspection_data update t_inspection_data
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="inspectorId != null">inspector_id = #{inspectorId},</if> <if test="planId != null">plan_id = #{planId},</if>
<if test="longitude != null">longitude = #{longitude},</if> <if test="deviceId != null">device_id = #{deviceId},</if>
<if test="latitude != null">latitude = #{latitude},</if> <if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if> <if test="remarks != null">remarks = #{remarks},</if>
</trim> </trim>
......
<?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.TInspectionPlanMapper">
<resultMap type="TInspectionPlan" id="TInspectionPlanResult">
<result property="planId" column="plan_id" />
<result property="planName" column="plan_name" />
<result property="orderId" column="order_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="planStatus" column="plan_status" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTInspectionPlanVo">
select plan_id, plan_name, order_id, start_time, end_time, plan_status, update_time, create_time, remarks from t_inspection_plan
</sql>
<select id="selectTInspectionPlanList" parameterType="TInspectionPlan" resultMap="TInspectionPlanResult">
<include refid="selectTInspectionPlanVo"/>
<where>
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTInspectionPlanById" parameterType="Long" resultMap="TInspectionPlanResult">
<include refid="selectTInspectionPlanVo"/>
where plan_id = #{planId}
</select>
<insert id="insertTInspectionPlan" parameterType="TInspectionPlan" useGeneratedKeys="true" keyProperty="planId">
insert into t_inspection_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planName != null">plan_name,</if>
<if test="orderId != null">order_id,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="planStatus != null">plan_status,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planName != null">#{planName},</if>
<if test="orderId != null">#{orderId},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="planStatus != null">#{planStatus},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTInspectionPlan" parameterType="TInspectionPlan">
update t_inspection_plan
<trim prefix="SET" suffixOverrides=",">
<if test="planName != null">plan_name = #{planName},</if>
<if test="orderId != null">order_id = #{orderId},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="planStatus != null">plan_status = #{planStatus},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where plan_id = #{planId}
</update>
<delete id="deleteTInspectionPlanById" parameterType="Long">
delete from t_inspection_plan where plan_id = #{planId}
</delete>
<delete id="deleteTInspectionPlanByIds" parameterType="String">
delete from t_inspection_plan where plan_id in
<foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询报警信息列表
export function listDeviceAlarm(query) {
return request({
url: '/dataMonitoring/deviceAlarm/list',
method: 'get',
params: query
})
}
// 查询报警信息详细
export function getDeviceAlarm(alarmId) {
return request({
url: '/dataMonitoring/deviceAlarm/' + alarmId,
method: 'get'
})
}
// 新增报警信息
export function addDeviceAlarm(data) {
return request({
url: '/dataMonitoring/deviceAlarm',
method: 'post',
data: data
})
}
// 修改报警信息
export function updateDeviceAlarm(data) {
return request({
url: '/dataMonitoring/deviceAlarm',
method: 'put',
data: data
})
}
// 删除报警信息
export function delDeviceAlarm(alarmId) {
return request({
url: '/dataMonitoring/deviceAlarm/' + alarmId,
method: 'delete'
})
}
// 导出报警信息
export function exportDeviceAlarm(query) {
return request({
url: '/dataMonitoring/deviceAlarm/export',
method: 'get',
params: query
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询巡检计划列表
export function listInspectionPlan(query) {
return request({
url: '/deviceInspection/inspectionPlan/list',
method: 'get',
params: query
})
}
// 查询巡检计划详细
export function getInspectionPlan(planId) {
return request({
url: '/deviceInspection/inspectionPlan/' + planId,
method: 'get'
})
}
// 新增巡检计划
export function addInspectionPlan(data) {
return request({
url: '/deviceInspection/inspectionPlan',
method: 'post',
data: data
})
}
// 修改巡检计划
export function updateInspectionPlan(data) {
return request({
url: '/deviceInspection/inspectionPlan',
method: 'put',
data: data
})
}
// 删除巡检计划
export function delInspectionPlan(planId) {
return request({
url: '/deviceInspection/inspectionPlan/' + planId,
method: 'delete'
})
}
// 导出巡检计划
export function exportInspectionPlan(query) {
return request({
url: '/deviceInspection/inspectionPlan/export',
method: 'get',
params: query
})
}
\ No newline at end of file
import request from '@/utils/request'
// 查询隐患信息列表
export function listHiddenTrouble(query) {
return request({
url: '/riskManagement/hiddenTrouble/list',
method: 'get',
params: query
})
}
// 查询隐患信息详细
export function getHiddenTrouble(troubleId) {
return request({
url: '/riskManagement/hiddenTrouble/' + troubleId,
method: 'get'
})
}
// 新增隐患信息
export function addHiddenTrouble(data) {
return request({
url: '/riskManagement/hiddenTrouble',
method: 'post',
data: data
})
}
// 修改隐患信息
export function updateHiddenTrouble(data) {
return request({
url: '/riskManagement/hiddenTrouble',
method: 'put',
data: data
})
}
// 删除隐患信息
export function delHiddenTrouble(troubleId) {
return request({
url: '/riskManagement/hiddenTrouble/' + troubleId,
method: 'delete'
})
}
// 导出隐患信息
export function exportHiddenTrouble(query) {
return request({
url: '/riskManagement/hiddenTrouble/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="设备id" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="queryParams.alarmType" placeholder="请选择报警类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<el-input
v-model="queryParams.alarmValue"
placeholder="请输入报警值"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="
处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择
处理状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
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="['dataMonitoring:deviceAlarm: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="['dataMonitoring:deviceAlarm: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="['dataMonitoring:deviceAlarm: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="['dataMonitoring:deviceAlarm:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceAlarmList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="备注" align="center" prop="alarmId" />
<el-table-column label="设备id" align="center" prop="deviceId" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="报警类型" align="center" prop="alarmType" />
<el-table-column label="报警值" align="center" prop="alarmValue" />
<el-table-column label="报警开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="报警结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="
处理状态" align="center" prop="dealStatus" />
<el-table-column label="备注" align="center" prop="remarks" />
<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="['dataMonitoring:deviceAlarm:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dataMonitoring:deviceAlarm: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="报警类型" prop="alarmType">
<el-select v-model="form.alarmType" placeholder="请选择报警类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="报警值" prop="alarmValue">
<el-input v-model="form.alarmValue" placeholder="请输入报警值" />
</el-form-item>
<el-form-item label="报警开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="报警结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择报警结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="
处理状态">
<el-radio-group v-model="form.dealStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</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 { listDeviceAlarm, getDeviceAlarm, delDeviceAlarm, addDeviceAlarm, updateDeviceAlarm, exportDeviceAlarm } from "@/api/dataMonitoring/deviceAlarm";
export default {
name: "DeviceAlarm",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 报警信息表格数据
deviceAlarmList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
orderId: null,
alarmType: null,
alarmValue: null,
startTime: null,
endTime: null,
dealStatus: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询报警信息列表 */
getList() {
this.loading = true;
listDeviceAlarm(this.queryParams).then(response => {
this.deviceAlarmList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
alarmId: null,
deviceId: null,
orderId: null,
alarmType: null,
alarmValue: null,
startTime: null,
endTime: null,
dealStatus: "0",
updateTime: null,
createTime: null,
remarks: 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.alarmId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加报警信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const alarmId = row.alarmId || this.ids
getDeviceAlarm(alarmId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改报警信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.alarmId != null) {
updateDeviceAlarm(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDeviceAlarm(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const alarmIds = row.alarmId || this.ids;
this.$confirm('是否确认删除报警信息编号为"' + alarmIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delDeviceAlarm(alarmIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有报警信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDeviceAlarm(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="planName">
<el-input
v-model="queryParams.planName"
placeholder="请输入巡检计划名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="queryParams.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="queryParams.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="状态" prop="planStatus">
<el-select v-model="queryParams.planStatus" placeholder="请选择状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="计划描述" prop="remarks">
<el-input
v-model="queryParams.remarks"
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="['deviceInspection:inspectionPlan: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="['deviceInspection:inspectionPlan: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="['deviceInspection:inspectionPlan: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="['deviceInspection:inspectionPlan:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="inspectionPlanList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="巡检计划id" align="center" prop="planId" />
<el-table-column label="巡检计划名称" align="center" prop="planName" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="planStatus" />
<el-table-column label="计划描述" align="center" prop="remarks" />
<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="['deviceInspection:inspectionPlan:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['deviceInspection:inspectionPlan: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="巡检计划名称" prop="planName">
<el-input v-model="form.planName" placeholder="请输入巡检计划名称" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable size="small"
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable size="small"
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="状态">
<el-radio-group v-model="form.planStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="计划描述" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入计划描述" />
</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 { listInspectionPlan, getInspectionPlan, delInspectionPlan, addInspectionPlan, updateInspectionPlan, exportInspectionPlan } from "@/api/deviceInspection/inspectionPlan";
export default {
name: "InspectionPlan",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 巡检计划表格数据
inspectionPlanList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
planName: null,
orderId: null,
startTime: null,
endTime: null,
planStatus: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询巡检计划列表 */
getList() {
this.loading = true;
listInspectionPlan(this.queryParams).then(response => {
this.inspectionPlanList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
planId: null,
planName: null,
orderId: null,
startTime: null,
endTime: null,
planStatus: "0",
updateTime: null,
createTime: null,
remarks: 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.planId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加巡检计划";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const planId = row.planId || this.ids
getInspectionPlan(planId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改巡检计划";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.planId != null) {
updateInspectionPlan(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInspectionPlan(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const planIds = row.planId || this.ids;
this.$confirm('是否确认删除巡检计划编号为"' + planIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInspectionPlan(planIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有巡检计划数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInspectionPlan(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="设备id" prop="deviceId">
<el-input
v-model="queryParams.deviceId"
placeholder="请输入设备id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input
v-model="queryParams.orderId"
placeholder="请输入工单id"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input
v-model="queryParams.longitude"
placeholder="请输入经度"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input
v-model="queryParams.latitude"
placeholder="请输入纬度"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="处理状态" prop="dealStatus">
<el-select v-model="queryParams.dealStatus" placeholder="请选择处理状态" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input
v-model="queryParams.remarks"
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="['riskManagement:hiddenTrouble: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="['riskManagement:hiddenTrouble: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="['riskManagement:hiddenTrouble: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="['riskManagement:hiddenTrouble:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="hiddenTroubleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="隐患信息id" align="center" prop="troubleId" />
<el-table-column label="设备id" align="center" prop="deviceId" />
<el-table-column label="工单id" align="center" prop="orderId" />
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="处理状态" align="center" prop="dealStatus" />
<el-table-column label="备注" align="center" prop="remarks" />
<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="['riskManagement:hiddenTrouble:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['riskManagement:hiddenTrouble: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="deviceId">
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="工单id" prop="orderId">
<el-input v-model="form.orderId" placeholder="请输入工单id" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input v-model="form.longitude" placeholder="请输入经度" />
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="处理状态">
<el-radio-group v-model="form.dealStatus">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</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 { listHiddenTrouble, getHiddenTrouble, delHiddenTrouble, addHiddenTrouble, updateHiddenTrouble, exportHiddenTrouble } from "@/api/riskManagement/hiddenTrouble";
export default {
name: "HiddenTrouble",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 隐患信息表格数据
hiddenTroubleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceId: null,
orderId: null,
longitude: null,
latitude: null,
dealStatus: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询隐患信息列表 */
getList() {
this.loading = true;
listHiddenTrouble(this.queryParams).then(response => {
this.hiddenTroubleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
troubleId: null,
deviceId: null,
orderId: null,
longitude: null,
latitude: null,
dealStatus: "0",
updateTime: null,
createTime: null,
remarks: 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.troubleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加隐患信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const troubleId = row.troubleId || this.ids
getHiddenTrouble(troubleId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改隐患信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.troubleId != null) {
updateHiddenTrouble(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addHiddenTrouble(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const troubleIds = row.troubleId || this.ids;
this.$confirm('是否确认删除隐患信息编号为"' + troubleIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delHiddenTrouble(troubleIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有隐患信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportHiddenTrouble(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</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