Commit 0771b49f authored by wuqinghua's avatar wuqinghua

2022-4-1 吴卿华

parent 7617257a
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.SecurityUtils;
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.THiddenTroubleInfo;
import com.zehong.system.service.ITHiddenTroubleInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 燃气隐患Controller
*
* @author zehong
* @date 2022-03-31
*/
@RestController
@RequestMapping("/system/info")
public class THiddenTroubleInfoSController extends BaseController
{
@Autowired
private ITHiddenTroubleInfoService tHiddenTroubleInfoService;
/**
* 查询燃气隐患列表
*/
@PreAuthorize("@ss.hasPermi('system:info:list')")
@GetMapping("/list")
public TableDataInfo list(THiddenTroubleInfo tHiddenTroubleInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tHiddenTroubleInfo.setBeyondEnterpriseId(user.getDeptId());
startPage();
List<THiddenTroubleInfo> list = tHiddenTroubleInfoService.selectTHiddenTroubleInfoList(tHiddenTroubleInfo);
return getDataTable(list);
}
/**
* 导出燃气隐患列表
*/
@PreAuthorize("@ss.hasPermi('system:info:export')")
@Log(title = "燃气隐患", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(THiddenTroubleInfo tHiddenTroubleInfo)
{
List<THiddenTroubleInfo> list = tHiddenTroubleInfoService.selectTHiddenTroubleInfoExcelList(tHiddenTroubleInfo);
ExcelUtil<THiddenTroubleInfo> util = new ExcelUtil<THiddenTroubleInfo>(THiddenTroubleInfo.class);
return util.exportExcel(list, "燃气隐患数据");
}
/**
* 获取燃气隐患详细信息
*/
@PreAuthorize("@ss.hasPermi('system:info:query')")
@GetMapping(value = "/{hiddenTroubleId}")
public AjaxResult getInfo(@PathVariable("hiddenTroubleId") Long hiddenTroubleId)
{
return AjaxResult.success(tHiddenTroubleInfoService.selectTHiddenTroubleInfoById(hiddenTroubleId));
}
/**
* 新增燃气隐患
*/
@PreAuthorize("@ss.hasPermi('system:info:add')")
@Log(title = "燃气隐患", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody THiddenTroubleInfo tHiddenTroubleInfo)
{
//获取用户信息
SysUser user = SecurityUtils.getLoginUser().getUser();
tHiddenTroubleInfo.setBeyondEnterpriseId(user.getDeptId());
return toAjax(tHiddenTroubleInfoService.insertTHiddenTroubleInfo(tHiddenTroubleInfo));
}
/**
* 修改燃气隐患
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@Log(title = "燃气隐患", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody THiddenTroubleInfo tHiddenTroubleInfo)
{
return toAjax(tHiddenTroubleInfoService.updateTHiddenTroubleInfo(tHiddenTroubleInfo));
}
/**
* 删除燃气隐患
*/
@PreAuthorize("@ss.hasPermi('system:info:remove')")
@Log(title = "燃气隐患", businessType = BusinessType.DELETE)
@DeleteMapping("/{hiddenTroubleIds}")
public AjaxResult remove(@PathVariable Long[] hiddenTroubleIds)
{
return toAjax(tHiddenTroubleInfoService.deleteTHiddenTroubleInfoByIds(hiddenTroubleIds));
}
}
......@@ -10,7 +10,7 @@ import com.zehong.common.core.domain.BaseEntity;
/**
* 燃气隐患对象 t_hidden_trouble_info
*
*
* @author zehong
* @date 2022-03-24
*/
......@@ -21,8 +21,10 @@ public class THiddenTroubleInfo extends BaseEntity
/** 隐患id */
private Long hiddenTroubleId;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 巡检任务id */
@Excel(name = "巡检任务id")
private Long workId;
/** 隐患名称 */
......@@ -30,11 +32,11 @@ public class THiddenTroubleInfo extends BaseEntity
private String hiddenTroubleName;
/** 隐患等级: 1.I级 2.II级 3.III级 */
@Excel(name = "隐患等级: 1.I级 2.II级 3.III级")
@Excel(name = "隐患等级")
private String hiddenTroubleLevel;
/** 隐患类型: 1.漏气 2.腐蚀 3.裂缝 4.设备故障 5.安全距离不足 6.管道承重 7.其他 */
@Excel(name = "隐患类型: 1.漏气 2.腐蚀 3.裂缝 4.设备故障 5.安全距离不足 6.管道承重 7.其他")
@Excel(name = "隐患类型")
private String hiddenTroubleType;
/** 经度 */
......@@ -46,7 +48,6 @@ public class THiddenTroubleInfo extends BaseEntity
private BigDecimal latitude;
/** 图片地址 */
@Excel(name = "图片地址")
private String pictureUrl;
/** 隐患描述 */
......@@ -54,16 +55,16 @@ public class THiddenTroubleInfo extends BaseEntity
private String hiddenTroubleDescribe;
/** 上报时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date reportTime;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上报时间", width = 30, dateFormat = "yyyy-MM-dd")
private String reportTime;
/** 上报人 */
@Excel(name = "上报人")
private String reportPerson;
/** 隐患处理状态: 1.待处理 2.处理中 3.已完成 */
@Excel(name = "隐患处理状态: 1.待处理 2.处理中 3.已完成")
@Excel(name = "隐患处理状态")
private String hiddenTroubleDealStatus;
/** 隐患处理情况 */
......@@ -73,10 +74,9 @@ public class THiddenTroubleInfo extends BaseEntity
/** 隐患处理完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "隐患处理完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date hiddenTroubleDealFinishTime;
private String hiddenTroubleDealFinishTime;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
......@@ -86,6 +86,18 @@ public class THiddenTroubleInfo extends BaseEntity
/**上报人名称*/
private String reportPersonName;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public Long getBeyondEnterpriseId() {
return beyondEnterpriseId;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId) {
this.beyondEnterpriseId = beyondEnterpriseId;
}
public String getReportPersonName() {
return reportPersonName;
}
......@@ -99,165 +111,167 @@ public class THiddenTroubleInfo extends BaseEntity
this.hiddenTroubleId = hiddenTroubleId;
}
public Long getHiddenTroubleId()
public Long getHiddenTroubleId()
{
return hiddenTroubleId;
}
public void setWorkId(Long workId)
public void setWorkId(Long workId)
{
this.workId = workId;
}
public Long getWorkId()
public Long getWorkId()
{
return workId;
}
public void setHiddenTroubleName(String hiddenTroubleName)
public void setHiddenTroubleName(String hiddenTroubleName)
{
this.hiddenTroubleName = hiddenTroubleName;
}
public String getHiddenTroubleName()
public String getHiddenTroubleName()
{
return hiddenTroubleName;
}
public void setHiddenTroubleLevel(String hiddenTroubleLevel)
public void setHiddenTroubleLevel(String hiddenTroubleLevel)
{
this.hiddenTroubleLevel = hiddenTroubleLevel;
}
public String getHiddenTroubleLevel()
public String getHiddenTroubleLevel()
{
return hiddenTroubleLevel;
}
public void setHiddenTroubleType(String hiddenTroubleType)
public void setHiddenTroubleType(String hiddenTroubleType)
{
this.hiddenTroubleType = hiddenTroubleType;
}
public String getHiddenTroubleType()
public String getHiddenTroubleType()
{
return hiddenTroubleType;
}
public void setLongitude(BigDecimal longitude)
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
public BigDecimal getLatitude()
{
return latitude;
}
public void setPictureUrl(String pictureUrl)
public void setPictureUrl(String pictureUrl)
{
this.pictureUrl = pictureUrl;
}
public String getPictureUrl()
public String getPictureUrl()
{
return pictureUrl;
}
public void setHiddenTroubleDescribe(String hiddenTroubleDescribe)
public void setHiddenTroubleDescribe(String hiddenTroubleDescribe)
{
this.hiddenTroubleDescribe = hiddenTroubleDescribe;
}
public String getHiddenTroubleDescribe()
public String getHiddenTroubleDescribe()
{
return hiddenTroubleDescribe;
}
public void setReportTime(Date reportTime)
{
public String getReportTime() {
return reportTime;
}
public void setReportTime(String reportTime) {
this.reportTime = reportTime;
}
public Date getReportTime()
{
return reportTime;
public void setHiddenTroubleDealFinishTime(String hiddenTroubleDealFinishTime) {
this.hiddenTroubleDealFinishTime = hiddenTroubleDealFinishTime;
}
public void setReportPerson(String reportPerson)
public void setReportPerson(String reportPerson)
{
this.reportPerson = reportPerson;
}
public String getReportPerson()
public String getReportPerson()
{
return reportPerson;
}
public void setHiddenTroubleDealStatus(String hiddenTroubleDealStatus)
public void setHiddenTroubleDealStatus(String hiddenTroubleDealStatus)
{
this.hiddenTroubleDealStatus = hiddenTroubleDealStatus;
}
public String getHiddenTroubleDealStatus()
public String getHiddenTroubleDealStatus()
{
return hiddenTroubleDealStatus;
}
public void setHiddenTroubleDealCondition(String hiddenTroubleDealCondition)
public void setHiddenTroubleDealCondition(String hiddenTroubleDealCondition)
{
this.hiddenTroubleDealCondition = hiddenTroubleDealCondition;
}
public String getHiddenTroubleDealCondition()
public String getHiddenTroubleDealCondition()
{
return hiddenTroubleDealCondition;
}
public void setHiddenTroubleDealFinishTime(Date hiddenTroubleDealFinishTime)
{
this.hiddenTroubleDealFinishTime = hiddenTroubleDealFinishTime;
}
public Date getHiddenTroubleDealFinishTime()
{
public String getHiddenTroubleDealFinishTime() {
return hiddenTroubleDealFinishTime;
}
public void setIsDel(String isDel)
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
public String getIsDel()
{
return isDel;
}
public void setRemarks(String remarks)
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("hiddenTroubleId", getHiddenTroubleId())
.append("workId", getWorkId())
.append("hiddenTroubleName", getHiddenTroubleName())
.append("hiddenTroubleLevel", getHiddenTroubleLevel())
.append("hiddenTroubleType", getHiddenTroubleType())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("pictureUrl", getPictureUrl())
.append("hiddenTroubleDescribe", getHiddenTroubleDescribe())
.append("reportTime", getReportTime())
.append("reportPerson", getReportPerson())
.append("hiddenTroubleDealStatus", getHiddenTroubleDealStatus())
.append("hiddenTroubleDealCondition", getHiddenTroubleDealCondition())
.append("hiddenTroubleDealFinishTime", getHiddenTroubleDealFinishTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
return "THiddenTroubleInfo{" +
"hiddenTroubleId=" + hiddenTroubleId +
", beyondEnterpriseId=" + beyondEnterpriseId +
", workId=" + workId +
", hiddenTroubleName='" + hiddenTroubleName + '\'' +
", hiddenTroubleLevel='" + hiddenTroubleLevel + '\'' +
", hiddenTroubleType='" + hiddenTroubleType + '\'' +
", longitude=" + longitude +
", latitude=" + latitude +
", pictureUrl='" + pictureUrl + '\'' +
", hiddenTroubleDescribe='" + hiddenTroubleDescribe + '\'' +
", reportTime=" + reportTime +
", reportPerson='" + reportPerson + '\'' +
", hiddenTroubleDealStatus='" + hiddenTroubleDealStatus + '\'' +
", hiddenTroubleDealCondition='" + hiddenTroubleDealCondition + '\'' +
", hiddenTroubleDealFinishTime=" + hiddenTroubleDealFinishTime +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
", reportPersonName='" + reportPersonName + '\'' +
'}';
}
}
......@@ -5,15 +5,15 @@ import com.zehong.system.domain.THiddenTroubleInfo;
/**
* 燃气隐患Mapper接口
*
*
* @author zehong
* @date 2022-03-24
*/
public interface THiddenTroubleInfoMapper
public interface THiddenTroubleInfoMapper
{
/**
* 查询燃气隐患
*
*
* @param hiddenTroubleId 燃气隐患ID
* @return 燃气隐患
*/
......@@ -21,7 +21,7 @@ public interface THiddenTroubleInfoMapper
/**
* 查询燃气隐患列表
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 燃气隐患集合
*/
......@@ -29,7 +29,7 @@ public interface THiddenTroubleInfoMapper
/**
* 新增燃气隐患
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 结果
*/
......@@ -37,7 +37,7 @@ public interface THiddenTroubleInfoMapper
/**
* 修改燃气隐患
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 结果
*/
......@@ -45,7 +45,7 @@ public interface THiddenTroubleInfoMapper
/**
* 删除燃气隐患
*
*
* @param hiddenTroubleId 燃气隐患ID
* @return 结果
*/
......@@ -53,9 +53,16 @@ public interface THiddenTroubleInfoMapper
/**
* 批量删除燃气隐患
*
*
* @param hiddenTroubleIds 需要删除的数据ID
* @return 结果
*/
public int deleteTHiddenTroubleInfoByIds(Long[] hiddenTroubleIds);
/**
* Excel数据导出查询接口
* @param tHiddenTroubleInfo
* @return
*/
List<THiddenTroubleInfo> selectTHiddenTroubleInfoExcelList(THiddenTroubleInfo tHiddenTroubleInfo);
}
......@@ -5,15 +5,15 @@ import com.zehong.system.domain.THiddenTroubleInfo;
/**
* 燃气隐患Service接口
*
*
* @author zehong
* @date 2022-03-24
*/
public interface ITHiddenTroubleInfoService
public interface ITHiddenTroubleInfoService
{
/**
* 查询燃气隐患
*
*
* @param hiddenTroubleId 燃气隐患ID
* @return 燃气隐患
*/
......@@ -21,7 +21,7 @@ public interface ITHiddenTroubleInfoService
/**
* 查询燃气隐患列表
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 燃气隐患集合
*/
......@@ -29,7 +29,7 @@ public interface ITHiddenTroubleInfoService
/**
* 新增燃气隐患
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 结果
*/
......@@ -37,7 +37,7 @@ public interface ITHiddenTroubleInfoService
/**
* 修改燃气隐患
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 结果
*/
......@@ -45,7 +45,7 @@ public interface ITHiddenTroubleInfoService
/**
* 批量删除燃气隐患
*
*
* @param hiddenTroubleIds 需要删除的燃气隐患ID
* @return 结果
*/
......@@ -53,9 +53,16 @@ public interface ITHiddenTroubleInfoService
/**
* 删除燃气隐患信息
*
*
* @param hiddenTroubleId 燃气隐患ID
* @return 结果
*/
public int deleteTHiddenTroubleInfoById(Long hiddenTroubleId);
/**
* Excel数据导出查询接口
* @param tHiddenTroubleInfo
* @return
*/
List<THiddenTroubleInfo> selectTHiddenTroubleInfoExcelList(THiddenTroubleInfo tHiddenTroubleInfo);
}
......@@ -10,19 +10,19 @@ import org.springframework.transaction.annotation.Transactional;
/**
* 燃气隐患Service业务层处理
*
*
* @author zehong
* @date 2022-03-24
*/
@Service
public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
{
@Autowired
private THiddenTroubleInfoMapper tHiddenTroubleInfoMapper;
/**
* 查询燃气隐患
*
*
* @param hiddenTroubleId 燃气隐患ID
* @return 燃气隐患
*/
......@@ -34,7 +34,7 @@ public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
/**
* 查询燃气隐患列表
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 燃气隐患
*/
......@@ -46,7 +46,7 @@ public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
/**
* 新增燃气隐患
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 结果
*/
......@@ -59,7 +59,7 @@ public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
/**
* 修改燃气隐患
*
*
* @param tHiddenTroubleInfo 燃气隐患
* @return 结果
*/
......@@ -71,7 +71,7 @@ public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
/**
* 批量删除燃气隐患
*
*
* @param hiddenTroubleIds 需要删除的燃气隐患ID
* @return 结果
*/
......@@ -83,7 +83,7 @@ public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
/**
* 删除燃气隐患信息
*
*
* @param hiddenTroubleId 燃气隐患ID
* @return 结果
*/
......@@ -92,4 +92,14 @@ public class THiddenTroubleInfoServiceImpl implements ITHiddenTroubleInfoService
{
return tHiddenTroubleInfoMapper.deleteTHiddenTroubleInfoById(hiddenTroubleId);
}
/**
* Excel数据导出查询接口
* @param tHiddenTroubleInfo
* @return
*/
@Override
public List<THiddenTroubleInfo> selectTHiddenTroubleInfoExcelList(THiddenTroubleInfo tHiddenTroubleInfo) {
return tHiddenTroubleInfoMapper.selectTHiddenTroubleInfoExcelList(tHiddenTroubleInfo);
}
}
......@@ -3,9 +3,10 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.THiddenTroubleInfoMapper">
<resultMap type="THiddenTroubleInfo" id="THiddenTroubleInfoResult">
<result property="hiddenTroubleId" column="hidden_trouble_id" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="workId" column="work_id" />
<result property="hiddenTroubleName" column="hidden_trouble_name" />
<result property="hiddenTroubleLevel" column="hidden_trouble_level" />
......@@ -30,34 +31,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTHiddenTroubleInfoList" parameterType="THiddenTroubleInfo" resultMap="THiddenTroubleInfoResult">
<include refid="selectTHiddenTroubleInfoVo"/>
<where>
<if test="workId != null "> and work_id = #{workId}</if>
<where>
is_del='0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="hiddenTroubleName != null and hiddenTroubleName != ''"> and hidden_trouble_name like concat('%', #{hiddenTroubleName}, '%')</if>
<if test="hiddenTroubleLevel != null and hiddenTroubleLevel != ''"> and hidden_trouble_level = #{hiddenTroubleLevel}</if>
<if test="hiddenTroubleType != null and hiddenTroubleType != ''"> and hidden_trouble_type = #{hiddenTroubleType}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="pictureUrl != null and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
<if test="hiddenTroubleDescribe != null and hiddenTroubleDescribe != ''"> and hidden_trouble_describe = #{hiddenTroubleDescribe}</if>
<if test="reportTime != null "> and report_time = #{reportTime}</if>
<if test="reportPerson != null and reportPerson != ''"> and report_person = #{reportPerson}</if>
<if test="hiddenTroubleDealStatus != null and hiddenTroubleDealStatus != ''"> and hidden_trouble_deal_status = #{hiddenTroubleDealStatus}</if>
<if test="hiddenTroubleDealCondition != null and hiddenTroubleDealCondition != ''"> and hidden_trouble_deal_condition = #{hiddenTroubleDealCondition}</if>
<if test="hiddenTroubleDealFinishTime != null "> and hidden_trouble_deal_finish_time = #{hiddenTroubleDealFinishTime}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
group by hidden_trouble_id desc
</select>
<select id="selectTHiddenTroubleInfoById" parameterType="Long" resultMap="THiddenTroubleInfoResult">
<include refid="selectTHiddenTroubleInfoVo"/>
where hidden_trouble_id = #{hiddenTroubleId}
</select>
<!--Excel数据导出查询接口-->
<select id="selectTHiddenTroubleInfoExcelList" resultMap="THiddenTroubleInfoResult" parameterType="THiddenTroubleInfo">
select hidden_trouble_id, work_id, hidden_trouble_name,
(CASE hidden_trouble_level WHEN '1' THEN 'I级' WHEN '2' THEN 'II级'WHEN '3' THEN 'III级'end) as hidden_trouble_level,
(CASE hidden_trouble_type WHEN '1' THEN '漏气' WHEN '2' THEN '腐蚀'WHEN '3' THEN '裂缝' WHEN '4' THEN '设备故障' WHEN '5' THEN '安全距离不足' WHEN '6' THEN '管道承重'WHEN '7' THEN '其他'end) as hidden_trouble_type,
longitude, latitude, picture_url, hidden_trouble_describe,
report_time, (select u.user_name from sys_user u where u.user_id = report_person) AS report_person_name, report_person,
(CASE hidden_trouble_deal_status WHEN '1' THEN '待处理' WHEN '2' THEN '处理中'WHEN '3' THEN '已完成'end) as hidden_trouble_deal_status,
hidden_trouble_deal_condition, hidden_trouble_deal_finish_time, is_del, remarks
from t_hidden_trouble_info
<where>
is_del='0'
<if test="beyondEnterpriseId != null and beyondEnterpriseId != -2"> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="hiddenTroubleName != null and hiddenTroubleName != ''"> and hidden_trouble_name like concat('%', #{hiddenTroubleName}, '%')</if>
<if test="reportPerson != null and reportPerson != ''"> and report_person = #{reportPerson}</if>
</where>
group by hidden_trouble_id desc
</select>
<insert id="insertTHiddenTroubleInfo" parameterType="THiddenTroubleInfo" useGeneratedKeys="true" keyProperty="hiddenTroubleId">
insert into t_hidden_trouble_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workId != null">work_id,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="hiddenTroubleName != null">hidden_trouble_name,</if>
<if test="hiddenTroubleLevel != null">hidden_trouble_level,</if>
<if test="hiddenTroubleType != null">hidden_trouble_type,</if>
......@@ -70,11 +81,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenTroubleDealStatus != null">hidden_trouble_deal_status,</if>
<if test="hiddenTroubleDealCondition != null">hidden_trouble_deal_condition,</if>
<if test="hiddenTroubleDealFinishTime != null">hidden_trouble_deal_finish_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workId != null">#{workId},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="hiddenTroubleName != null">#{hiddenTroubleName},</if>
<if test="hiddenTroubleLevel != null">#{hiddenTroubleLevel},</if>
<if test="hiddenTroubleType != null">#{hiddenTroubleType},</if>
......@@ -87,7 +98,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenTroubleDealStatus != null">#{hiddenTroubleDealStatus},</if>
<if test="hiddenTroubleDealCondition != null">#{hiddenTroubleDealCondition},</if>
<if test="hiddenTroubleDealFinishTime != null">#{hiddenTroubleDealFinishTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
......@@ -114,14 +124,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where hidden_trouble_id = #{hiddenTroubleId}
</update>
<delete id="deleteTHiddenTroubleInfoById" parameterType="Long">
delete from t_hidden_trouble_info where hidden_trouble_id = #{hiddenTroubleId}
</delete>
<update id="deleteTHiddenTroubleInfoById" parameterType="Long">
update t_hidden_trouble_info set is_del='1' where hidden_trouble_id = #{hiddenTroubleId}
</update>
<delete id="deleteTHiddenTroubleInfoByIds" parameterType="String">
delete from t_hidden_trouble_info where hidden_trouble_id in
<update id="deleteTHiddenTroubleInfoByIds" parameterType="String">
update t_hidden_trouble_info set is_del='1' where hidden_trouble_id in
<foreach item="hiddenTroubleId" collection="array" open="(" separator="," close=")">
#{hiddenTroubleId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
</mapper>
import request from '@/utils/request'
// 查询燃气隐患列表
export function listInfo(query) {
return request({
url: '/system/info/list',
method: 'get',
params: query
})
}
// 查询燃气隐患详细
export function getInfo(hiddenTroubleId) {
return request({
url: '/system/info/' + hiddenTroubleId,
method: 'get'
})
}
// 新增燃气隐患
export function addInfo(data) {
return request({
url: '/system/info',
method: 'post',
data: data
})
}
// 修改燃气隐患
export function updateInfo(data) {
return request({
url: '/system/info',
method: 'put',
data: data
})
}
// 删除燃气隐患
export function delInfo(hiddenTroubleId) {
return request({
url: '/system/info/' + hiddenTroubleId,
method: 'delete'
})
}
// 导出燃气隐患
export function exportInfo(query) {
return request({
url: '/system/info/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="hiddenTroubleName">
<el-input
v-model="queryParams.hiddenTroubleName"
placeholder="请输入隐患名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="上报人" prop="reportPerson">
<el-input
v-model="queryParams.reportPerson"
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="['system:info: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="['system:info: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="['system:info: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="['system:info:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="照片" align="center" >
<template scope="List">
<img :src="List.row.pictureUrl" width="100px">
</template>
</el-table-column>
<el-table-column label="隐患名称" align="center" prop="hiddenTroubleName" >
<span slot-scope="scope" v-if="scope.row.hiddenTroubleName">{{scope.row.hiddenTroubleName}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="隐患等级" align="center" prop="hiddenTroubleLevel">
<template slot-scope="scope">
<span v-if="scope.row.hiddenTroubleLevel == 1">I级</span>
<span v-if="scope.row.hiddenTroubleLevel == 2">II级</span>
<span v-if="scope.row.hiddenTroubleLevel == 3">III级</span>
</template>
</el-table-column>
<el-table-column label="隐患类型" align="center" prop="hiddenTroubleType">
<template slot-scope="scope">
<span v-if="scope.row.hiddenTroubleType == 1">漏气</span>
<span v-if="scope.row.hiddenTroubleType == 2">腐蚀</span>
<span v-if="scope.row.hiddenTroubleType == 3">裂缝</span>
<span v-if="scope.row.hiddenTroubleType == 4">设备故障</span>
<span v-if="scope.row.hiddenTroubleType == 5">安全距离不足</span>
<span v-if="scope.row.hiddenTroubleType == 6">管道承重</span>
<span v-if="scope.row.hiddenTroubleType == 7">其他</span>
<span v-else>-</span>
</template>
</el-table-column>
<!-- <el-table-column label="经度" align="center" prop="longitude" />-->
<!-- <el-table-column label="纬度" align="center" prop="latitude" />-->
<el-table-column label="隐患描述" align="center" prop="hiddenTroubleDescribe" >
<span slot-scope="scope" v-if="scope.row.hiddenTroubleDescribe">{{scope.row.hiddenTroubleDescribe}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="上报时间" align="center" prop="reportTime" width="180">
<template slot-scope="scope" >
<span v-if="scope.row.hiddenTroubleDescribe">{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="上报人" align="center" prop="reportPerson" >
<span slot-scope="scope" v-if="scope.row.reportPerson">{{scope.row.reportPerson}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="隐患处理状态" align="center" prop="hiddenTroubleDealStatus">
<template slot-scope="scope">
<span v-if="scope.row.hiddenTroubleDealStatus == 1" style="color: #ff7272">待处理</span>
<span v-if="scope.row.hiddenTroubleDealStatus == 2" style="color: #ffba00">处理中</span>
<span v-if="scope.row.hiddenTroubleDealStatus == 3" style="color: #30B46B">已完成</span>
</template>
</el-table-column>
<el-table-column label="隐患处理情况" align="center" prop="hiddenTroubleDealCondition" >
<span slot-scope="scope" v-if="scope.row.hiddenTroubleDealCondition">{{scope.row.hiddenTroubleDealCondition}}</span>
<span v-else>-</span>
</el-table-column>
<el-table-column label="隐患处理完成时间" align="center" prop="hiddenTroubleDealFinishTime" width="180">
<template slot-scope="scope">
<span v-if="scope.row.hiddenTroubleDealFinishTime">{{ parseTime(scope.row.hiddenTroubleDealFinishTime, '{y}-{m}-{d}') }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remarks" >
<span slot-scope="scope" v-if="scope.row.remarks">{{scope.row.remarks}}</span>
<span v-else>-</span>
</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="['system:info:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:info: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="130px">
<el-row>
<el-col :span="11">
<el-form-item label="隐患等级" prop="hiddenTroubleLevel">
<el-select v-model="form.hiddenTroubleLevel" placeholder="请选择隐患等级" style="width: 100%;">
<el-option label="I级" value="1" />
<el-option label="II级" value="2" />
<el-option label="III级" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="隐患名称" prop="hiddenTroubleName">
<el-input v-model="form.hiddenTroubleName" placeholder="请输入隐患名称" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="隐患类型" prop="hiddenTroubleType">
<el-select v-model="form.hiddenTroubleType" placeholder="请选择隐患类型" style="width: 100%;">
<el-option label="漏气" value="1" />
<el-option label="腐蚀" value="2" />
<el-option label="裂缝" value="3" />
<el-option label="设备故障" value="4" />
<el-option label="安全距离不足" value="5" />
<el-option label="管道承重" value="6" />
<el-option label="其他" value="7" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="隐患描述" prop="hiddenTroubleDescribe">
<el-input v-model="form.hiddenTroubleDescribe" 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="23">
<el-form-item label="上传照片">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="上报时间" prop="reportTime">
<el-date-picker clearable size="small"
v-model="form.reportTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择上报时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="上报人" prop="reportPerson">
<el-input v-model="form.reportPerson" placeholder="请输入上报人" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="隐患处理状态" prop="hiddenTroubleDealStatus">
<el-select v-model="form.hiddenTroubleDealStatus" placeholder="请选择隐患处理状态" style="width: 100%;">
<el-option label="待处理" value="1" />
<el-option label="处理中" value="2" />
<el-option label="已完成" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="隐患处理情况" prop="hiddenTroubleDealCondition">
<el-input v-model="form.hiddenTroubleDealCondition" placeholder="请输入隐患处理情况" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="11">
<el-form-item label="隐患处理完成时间" prop="hiddenTroubleDealFinishTime">
<el-date-picker clearable size="small"
v-model="form.hiddenTroubleDealFinishTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择隐患处理完成时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="11">
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</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 { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/system/info";
import GetPos from '@/components/GetPos';
import FileUpload from '@/components/FileSuperviseUpload';
export default {
name: "Info",
components: {
FileUpload,
GetPos,
},
data() {
return {
//头像
fileList: [],
/**--------------地图使用数据---------------*/
dialogTableVisibles: false,
devicePos: [],
/**--------------地图使用数据---------------*/
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 燃气隐患表格数据
infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
hiddenTroubleName: null,
reportPerson: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
hiddenTroubleLevel: [
{ required: true, message: "请选择隐患等级", trigger: "blur" },
],
hiddenTroubleName: [
{ required: true, message: "请输入隐患名称", trigger: "blur" },
],
}
};
},
created() {
this.getList();
},
methods: {
/**上传头像*/
getFileInfo(res){
this.form.dealPlan = res.fileName;
this.form.pictureUrl = res.url;
this.form.burl=res.burl;
this.fileList.push({
name: res.fileName,
url: uploadfile,
burl:res.burl,
});
},
listRemove(e) {
this.form.dealPlan = "";
this.fileList = [];
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
},
/**
* 地图关闭方法
*/
dialogcancelFun() {
this.dialogTableVisibles = false;
},
/**
* 经纬度坐标方法
*/
MapdialogFun() {
this.dialogTableVisibles = true;
},
/**
* 经纬度 选择
* @param res
*/
getPath(res){
//确认选择经纬度
this.form.longitude = res[0];
this.form.latitude = res[1];
},
/** 查询燃气隐患列表 */
getList() {
this.loading = true;
listInfo(this.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
this.form = {
hiddenTroubleId: null,
workId: null,
hiddenTroubleName: null,
hiddenTroubleLevel: null,
hiddenTroubleType: null,
longitude: null,
latitude: null,
pictureUrl: null,
hiddenTroubleDescribe: null,
reportTime: null,
reportPerson: null,
hiddenTroubleDealStatus: null,
hiddenTroubleDealCondition: null,
hiddenTroubleDealFinishTime: null,
isDel: 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.hiddenTroubleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加燃气隐患";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.fileList=[]
this.reset();
const hiddenTroubleId = row.hiddenTroubleId || this.ids
getInfo(hiddenTroubleId).then(response => {
this.form = response.data;
this.open = true;
//图片回显
if (this.form.pictureUrl) {
this.fileList.push({
name: '照片',
url: this.form.pictureUrl,
});
}
this.title = "修改燃气隐患";
this.devicePos = [response.data.longitude, response.data.latitude];
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.hiddenTroubleId != null) {
updateInfo(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addInfo(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const hiddenTroubleIds = row.hiddenTroubleId || this.ids;
this.$confirm('是否确认删除燃气隐患编号为"' + hiddenTroubleIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delInfo(hiddenTroubleIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有燃气隐患数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportInfo(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