Commit bca02f50 authored by wuqinghua's avatar wuqinghua

2022-2-10 吴卿华

parent b09841f4
package com.zehong.web.controller.supervise;
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.TDetectorUser;
import com.zehong.system.service.ITDetectorUserService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 燃气用户Controller
*
* @author zehong
* @date 2022-02-07
*/
@RestController
@RequestMapping("/supervise/user")
public class TDetectorUserController extends BaseController
{
@Autowired
private ITDetectorUserService tDetectorUserService;
/**
* 查询燃气用户列表
*/
@PreAuthorize("@ss.hasPermi('supervise:user:list')")
@GetMapping("/list")
public TableDataInfo list(TDetectorUser tDetectorUser)
{
startPage();
List<TDetectorUser> list = tDetectorUserService.selectTDetectorUserList(tDetectorUser);
return getDataTable(list);
}
/**
* 导出燃气用户列表
*/
@PreAuthorize("@ss.hasPermi('supervise:user:export')")
@Log(title = "燃气用户", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TDetectorUser tDetectorUser)
{
List<TDetectorUser> list = tDetectorUserService.selectTDetectorUserList(tDetectorUser);
ExcelUtil<TDetectorUser> util = new ExcelUtil<TDetectorUser>(TDetectorUser.class);
return util.exportExcel(list, "燃气用户数据");
}
/**
* 获取燃气用户详细信息
*/
@PreAuthorize("@ss.hasPermi('supervise:user:query')")
@GetMapping(value = "/{userId}")
public AjaxResult getInfo(@PathVariable("userId") Long userId)
{
return AjaxResult.success(tDetectorUserService.selectTDetectorUserById(userId));
}
/**
* 新增燃气用户
*/
@PreAuthorize("@ss.hasPermi('supervise:user:add')")
@Log(title = "燃气用户", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TDetectorUser tDetectorUser)
{
return toAjax(tDetectorUserService.insertTDetectorUser(tDetectorUser));
}
/**
* 修改燃气用户
*/
@PreAuthorize("@ss.hasPermi('supervise:user:edit')")
@Log(title = "燃气用户", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TDetectorUser tDetectorUser)
{
return toAjax(tDetectorUserService.updateTDetectorUser(tDetectorUser));
}
/**
* 删除燃气用户
*/
@PreAuthorize("@ss.hasPermi('supervise:user:remove')")
@Log(title = "燃气用户", businessType = BusinessType.DELETE)
@DeleteMapping("/{userIds}")
public AjaxResult remove(@PathVariable Long[] userIds)
{
return toAjax(tDetectorUserService.deleteTDetectorUserByIds(userIds));
}
}
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.system.domain.Listaw;
import com.zehong.system.domain.TDeviceInfoS;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
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.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 设备信息Controller
*
* @author zehong
* @date 2022-01-27
*/
@RestController
@RequestMapping("/device/device")
public class TDeviceInfoController extends BaseController
{
@Autowired
private ITDeviceInfoService tDeviceInfoService;
@Autowired
private ITEmployedPeopleInfoService tEmployedPeopleInfoService;
/**
* 查询设备信息列表
*/
@PreAuthorize("@ss.hasPermi('device:device:list')")
@GetMapping("/list")
public TableDataInfo list(TDeviceInfo tDeviceInfo)
{
startPage();
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
return getDataTable(list);
}
/**
* 导出设备信息列表
*/
@PreAuthorize("@ss.hasPermi('device:device:export')")
@Log(title = "设备信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TDeviceInfo tDeviceInfo)
{
List<TDeviceInfo> list = tDeviceInfoService.selectTDeviceInfoList(tDeviceInfo);
ExcelUtil<TDeviceInfo> util = new ExcelUtil<TDeviceInfo>(TDeviceInfo.class);
return util.exportExcel(list, "设备信息数据");
}
/**
* 获取设备信息详细信息
*/
@PreAuthorize("@ss.hasPermi('device:device:query')")
@GetMapping(value = "/{deviceId}")
public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
{
return AjaxResult.success(tDeviceInfoService.selectTDeviceInfoById(deviceId));
}
/**
* 新增设备信息
*/
@PreAuthorize("@ss.hasPermi('device:device:add')")
@Log(title = "设备信息", businessType = BusinessType.INSERT)
@PostMapping
public void add(@RequestBody Listaw listaw)
{
//添加设备信息表数据 并且返回新增id
tDeviceInfoService.insertTDeviceInfo(listaw.gettDeviceInfo());
Long deviceId = listaw.gettDeviceInfo().getDeviceId();
if (listaw.gettDeviceInfoS().size()!=0){
//添加 关联设备表 设备id添加
for (int i=0;i<listaw.gettDeviceInfoS().size();i++){
listaw.gettDeviceInfoS().get(i).setRelationDeviceId(Math.toIntExact(deviceId));
}
//添加关联设备信息表数据
tDeviceInfoService.insertDeviceDetailInfo(listaw.gettDeviceInfoS());
}
// TDeviceInfo tDeviceInfo = new TDeviceInfo();
// //根据企业id查询企业名称
// String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId());
// tDeviceInfo.setBeyondEnterpriseName(EnterpriseName);
}
/**
* 修改设备信息
*/
@PreAuthorize("@ss.hasPermi('device:device:edit')")
@Log(title = "设备信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TDeviceInfo tDeviceInfo)
{
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId());
tDeviceInfo.setBeyondEnterpriseName(EnterpriseName);
return toAjax(tDeviceInfoService.updateTDeviceInfo(tDeviceInfo));
}
/**
* 删除设备信息
*/
@PreAuthorize("@ss.hasPermi('device:device:remove')")
@Log(title = "设备信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{deviceIds}")
public AjaxResult remove(@PathVariable Long[] deviceIds)
{
return toAjax(tDeviceInfoService.deleteTDeviceInfoByIds(deviceIds));
}
/**
* 获取设备详细信息列表
*/
@PreAuthorize("@ss.hasPermi('device:device:deviceDetailInfo')")
@GetMapping(value = "/{getdeviceDetailInfo}")
public AjaxResult getdeviceDetailInfo(@PathVariable("deviceId") Long deviceId)
{
List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoService.getdeviceDetailInfo(deviceId);
System.out.println("111111111");
System.out.println(tDeviceInfoS+"111111111");
return AjaxResult.success(tDeviceInfoS);
}
}
package com.zehong.web.controller.supervise; package com.zehong.web.controller.supervise;
import java.util.List; import java.util.List;
import com.zehong.system.service.ITEmployedPeopleInfoService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -33,6 +33,9 @@ public class TPipeInfoController extends BaseController ...@@ -33,6 +33,9 @@ public class TPipeInfoController extends BaseController
@Autowired @Autowired
private ITPipeInfoService tPipeInfoService; private ITPipeInfoService tPipeInfoService;
@Autowired
private ITEmployedPeopleInfoService tEmployedPeopleInfoService;
/** /**
* 查询管道信息列表 * 查询管道信息列表
*/ */
...@@ -74,8 +77,10 @@ public class TPipeInfoController extends BaseController ...@@ -74,8 +77,10 @@ public class TPipeInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('supervise:pipe:add')") @PreAuthorize("@ss.hasPermi('supervise:pipe:add')")
@Log(title = "管道信息", businessType = BusinessType.INSERT) @Log(title = "管道信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TPipeInfo tPipeInfo) public AjaxResult add(@RequestBody TPipeInfo tPipeInfo) {
{ //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tPipeInfo.getBeyondEnterpriseId());
tPipeInfo.setBeyondEnterpriseName(EnterpriseName);
return toAjax(tPipeInfoService.insertTPipeInfo(tPipeInfo)); return toAjax(tPipeInfoService.insertTPipeInfo(tPipeInfo));
} }
...@@ -85,8 +90,10 @@ public class TPipeInfoController extends BaseController ...@@ -85,8 +90,10 @@ public class TPipeInfoController extends BaseController
@PreAuthorize("@ss.hasPermi('supervise:pipe:edit')") @PreAuthorize("@ss.hasPermi('supervise:pipe:edit')")
@Log(title = "管道信息", businessType = BusinessType.UPDATE) @Log(title = "管道信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TPipeInfo tPipeInfo) public AjaxResult edit(@RequestBody TPipeInfo tPipeInfo) {
{ //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tPipeInfo.getBeyondEnterpriseId());
tPipeInfo.setBeyondEnterpriseName(EnterpriseName);
return toAjax(tPipeInfoService.updateTPipeInfo(tPipeInfo)); return toAjax(tPipeInfoService.updateTPipeInfo(tPipeInfo));
} }
......
package com.zehong.web.controller.supervise;
import java.util.List;
import com.zehong.system.service.ITEmployedPeopleInfoService;
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.TSiteStationInfo;
import com.zehong.system.service.ITSiteStationInfoService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 场站信息Controller
*
* @author zehong
* @date 2022-01-27
*/
@RestController
@RequestMapping("/supervise/station")
public class TSiteStationInfoController extends BaseController {
@Autowired
private ITSiteStationInfoService tSiteStationInfoService;
@Autowired
private ITEmployedPeopleInfoService tEmployedPeopleInfoService;
/**
* 查询场站信息列表
*/
@PreAuthorize("@ss.hasPermi('supervise:station:list')")
@GetMapping("/list")
public TableDataInfo list(TSiteStationInfo tSiteStationInfo)
{
startPage();
List<TSiteStationInfo> list = tSiteStationInfoService.selectTSiteStationInfoList(tSiteStationInfo);
return getDataTable(list);
}
/**
* 导出场站信息列表
*/
@PreAuthorize("@ss.hasPermi('supervise:station:export')")
@Log(title = "场站信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TSiteStationInfo tSiteStationInfo)
{
List<TSiteStationInfo> list = tSiteStationInfoService.selectTSiteStationInfoList(tSiteStationInfo);
ExcelUtil<TSiteStationInfo> util = new ExcelUtil<TSiteStationInfo>(TSiteStationInfo.class);
return util.exportExcel(list, "场站信息数据");
}
/**
* 获取场站信息详细信息
*/
@PreAuthorize("@ss.hasPermi('supervise:station:query')")
@GetMapping(value = "/{siteStationId}")
public AjaxResult getInfo(@PathVariable("siteStationId") Long siteStationId)
{
return AjaxResult.success(tSiteStationInfoService.selectTSiteStationInfoById(siteStationId));
}
/**
* 新增场站信息
*/
@PreAuthorize("@ss.hasPermi('supervise:station:add')")
@Log(title = "场站信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSiteStationInfo tSiteStationInfo)
{
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tSiteStationInfo.getBeyondEnterpriseId());
tSiteStationInfo.setBeyondEnterpriseName(EnterpriseName);
return toAjax(tSiteStationInfoService.insertTSiteStationInfo(tSiteStationInfo));
}
/**
* 修改场站信息
*/
@PreAuthorize("@ss.hasPermi('supervise:station:edit')")
@Log(title = "场站信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSiteStationInfo tSiteStationInfo)
{
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tSiteStationInfo.getBeyondEnterpriseId());
tSiteStationInfo.setBeyondEnterpriseName(EnterpriseName);
return toAjax(tSiteStationInfoService.updateTSiteStationInfo(tSiteStationInfo));
}
/**
* 删除场站信息
*/
@PreAuthorize("@ss.hasPermi('supervise:station:remove')")
@Log(title = "场站信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{siteStationIds}")
public AjaxResult remove(@PathVariable Long[] siteStationIds)
{
return toAjax(tSiteStationInfoService.deleteTSiteStationInfoByIds(siteStationIds));
}
}
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_detector_user
*
* @author zehong
* @date 2022-02-07
*/
public class TDetectorUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 用户id */
private Long userId;
/** 用户账号 */
@Excel(name = "用户账号")
private String username;
/** 用户名称 */
@Excel(name = "用户名称")
private String nickName;
/** 用户类型(1居民用户,2商业用户,3工业用户) */
@Excel(name = "用户类型", readConverterExp = "1=居民用户,2商业用户,3工业用户")
private String userType;
/** 地址 */
@Excel(name = "地址")
private String address;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 联系人 */
@Excel(name = "联系人")
private String linkman;
/** 电话 */
@Excel(name = "电话")
private String phone;
/** 邮箱 */
@Excel(name = "邮箱")
private String email;
/** 是否删除(0正常,1删除) */
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setUsername(String username)
{
this.username = username;
}
public String getUsername()
{
return username;
}
public void setNickName(String nickName)
{
this.nickName = nickName;
}
public String getNickName()
{
return nickName;
}
public void setUserType(String userType)
{
this.userType = userType;
}
public String getUserType()
{
return userType;
}
public void setAddress(String address)
{
this.address = address;
}
public String getAddress()
{
return address;
}
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 setLinkman(String linkman)
{
this.linkman = linkman;
}
public String getLinkman()
{
return linkman;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setEmail(String email)
{
this.email = email;
}
public String getEmail()
{
return email;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
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("userId", getUserId())
.append("username", getUsername())
.append("nickName", getNickName())
.append("userType", getUserType())
.append("address", getAddress())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("linkman", getLinkman())
.append("phone", getPhone())
.append("email", getEmail())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 设备信息对象 t_device_info
*
* @author zehong
* @date 2022-01-27
*/
public class TDeviceInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 设备id */
private Long deviceId;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备编号 */
@Excel(name = "设备编号")
private String deviceCode;
/** 所在地址 */
@Excel(name = "所在地址")
private String deviceAddr;
/** 设备型号 */
@Excel(name = "设备型号")
private String deviceModel;
/** 设备类型:1.阀井 2.调压箱 3.巡检员 4.视频 */
@Excel(name = "设备类型:1.阀井 2.调压箱 3.巡检员 4.视频")
private String deviceType;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 权属单位名称 */
@Excel(name = "权属单位名称")
private String beyondEnterpriseName;
/** 经度 */
private BigDecimal longitude;
/** 纬度 */
private BigDecimal latitude;
/** 设备图片路径 */
private String iconUrl;
/** 联系人 */
private String linkman;
/** 电话 */
private String phone;
/** 安装时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "安装时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date installationTime;
/** 最后巡检时间 */
private Date inspectionTime;
/** 是否删除(0正常,1删除) */
private String isDel;
/** 备注 */
private String remarks;
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
{
return deviceName;
}
public void setDeviceCode(String deviceCode)
{
this.deviceCode = deviceCode;
}
public String getDeviceCode()
{
return deviceCode;
}
public void setDeviceAddr(String deviceAddr)
{
this.deviceAddr = deviceAddr;
}
public String getDeviceAddr()
{
return deviceAddr;
}
public void setDeviceModel(String deviceModel)
{
this.deviceModel = deviceModel;
}
public String getDeviceModel()
{
return deviceModel;
}
public void setDeviceType(String deviceType)
{
this.deviceType = deviceType;
}
public String getDeviceType()
{
return deviceType;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public Long getBeyondEnterpriseId()
{
return beyondEnterpriseId;
}
public void setBeyondEnterpriseName(String beyondEnterpriseName)
{
this.beyondEnterpriseName = beyondEnterpriseName;
}
public String getBeyondEnterpriseName()
{
return beyondEnterpriseName;
}
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 setIconUrl(String iconUrl)
{
this.iconUrl = iconUrl;
}
public String getIconUrl()
{
return iconUrl;
}
public void setLinkman(String linkman)
{
this.linkman = linkman;
}
public String getLinkman()
{
return linkman;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setInstallationTime(Date installationTime)
{
this.installationTime = installationTime;
}
public Date getInstallationTime()
{
return installationTime;
}
public void setInspectionTime(Date inspectionTime)
{
this.inspectionTime = inspectionTime;
}
public Date getInspectionTime()
{
return inspectionTime;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
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("deviceId", getDeviceId())
.append("deviceName", getDeviceName())
.append("deviceCode", getDeviceCode())
.append("deviceAddr", getDeviceAddr())
.append("deviceModel", getDeviceModel())
.append("deviceType", getDeviceType())
.append("beyondEnterpriseId", getBeyondEnterpriseId())
.append("beyondEnterpriseName", getBeyondEnterpriseName())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("iconUrl", getIconUrl())
.append("linkman", getLinkman())
.append("phone", getPhone())
.append("installationTime", getInstallationTime())
.append("inspectionTime", getInspectionTime())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain;
import com.zehong.common.core.domain.BaseEntity;
/**
* 关联设备封装类
*/
public class TDeviceInfoS extends BaseEntity {
/**
* 关联设备详情ID
*/
private Integer relationDeviceDetailId;
/**
* 关联设备id
*/
private Integer relationDeviceId;
/**
* 设备名称
*/
private String deviceName;
/**
* 设备型号
*/
private String deviceModel;
/**
* 设备类型:1.压力表 2.流量计
*/
private Integer deviceType;
/**
* 物联网编号
*/
private String iotNo;
/**
* 备注
*/
private String remarksn;
public Integer getRelationDeviceDetailId() {
return relationDeviceDetailId;
}
public void setRelationDeviceDetailId(Integer relationDeviceDetailId) {
this.relationDeviceDetailId = relationDeviceDetailId;
}
public Integer getRelationDeviceId() {
return relationDeviceId;
}
public void setRelationDeviceId(Integer relationDeviceId) {
this.relationDeviceId = relationDeviceId;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceModel() {
return deviceModel;
}
public void setDeviceModel(String deviceModel) {
this.deviceModel = deviceModel;
}
public Integer getDeviceType() {
return deviceType;
}
public void setDeviceType(Integer deviceType) {
this.deviceType = deviceType;
}
public String getIotNo() {
return iotNo;
}
public void setIotNo(String iotNo) {
this.iotNo = iotNo;
}
public String getRemarksn() {
return remarksn;
}
public void setRemarksn(String remarksn) {
this.remarksn = remarksn;
}
@Override
public String toString() {
return "TDeviceInfoS{" +
"relationDeviceDetailId=" + relationDeviceDetailId +
", relationDeviceId=" + relationDeviceId +
", deviceName='" + deviceName + '\'' +
", deviceModel='" + deviceModel + '\'' +
", deviceType=" + deviceType +
", iotNo='" + iotNo + '\'' +
", remarksn='" + remarksn + '\'' +
'}';
}
}
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_site_station_info
*
* @author zehong
* @date 2022-01-27
*/
public class TSiteStationInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 场站id */
private Long siteStationId;
/** 场站类型:1.加气站 2.门站 3.调压站 4.储备站 5.气化站 */
@Excel(name = "场站类型")
private String siteStationType;
/** 场站名称 */
@Excel(name = "场站名称")
private String siteStationName;
/** 建设年代 */
@Excel(name = "建设年代")
private String buildDate;
/** 建设单位 */
@Excel(name = "建设单位")
private String buildUnit;
/** 权属单位 */
private Long beyondEnterpriseId;
/** 权属单位名称 */
@Excel(name = "权属单位名称")
private String beyondEnterpriseName;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 是否删除(0正常,1删除) */
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setSiteStationId(Long siteStationId)
{
this.siteStationId = siteStationId;
}
public Long getSiteStationId()
{
return siteStationId;
}
public void setSiteStationType(String siteStationType)
{
this.siteStationType = siteStationType;
}
public String getSiteStationType()
{
return siteStationType;
}
public void setSiteStationName(String siteStationName)
{
this.siteStationName = siteStationName;
}
public String getSiteStationName()
{
return siteStationName;
}
public void setBuildDate(String buildDate)
{
this.buildDate = buildDate;
}
public String getBuildDate()
{
return buildDate;
}
public void setBuildUnit(String buildUnit)
{
this.buildUnit = buildUnit;
}
public String getBuildUnit()
{
return buildUnit;
}
public void setBeyondEnterpriseId(Long beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public Long getBeyondEnterpriseId()
{
return beyondEnterpriseId;
}
public void setBeyondEnterpriseName(String beyondEnterpriseName)
{
this.beyondEnterpriseName = beyondEnterpriseName;
}
public String getBeyondEnterpriseName()
{
return beyondEnterpriseName;
}
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 setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
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("siteStationId", getSiteStationId())
.append("siteStationType", getSiteStationType())
.append("siteStationName", getSiteStationName())
.append("buildDate", getBuildDate())
.append("buildUnit", getBuildUnit())
.append("beyondEnterpriseId", getBeyondEnterpriseId())
.append("beyondEnterpriseName", getBeyondEnterpriseName())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TDetectorUser;
/**
* 燃气用户Mapper接口
*
* @author zehong
* @date 2022-02-07
*/
public interface TDetectorUserMapper
{
/**
* 查询燃气用户
*
* @param userId 燃气用户ID
* @return 燃气用户
*/
public TDetectorUser selectTDetectorUserById(Long userId);
/**
* 查询燃气用户列表
*
* @param tDetectorUser 燃气用户
* @return 燃气用户集合
*/
public List<TDetectorUser> selectTDetectorUserList(TDetectorUser tDetectorUser);
/**
* 新增燃气用户
*
* @param tDetectorUser 燃气用户
* @return 结果
*/
public int insertTDetectorUser(TDetectorUser tDetectorUser);
/**
* 修改燃气用户
*
* @param tDetectorUser 燃气用户
* @return 结果
*/
public int updateTDetectorUser(TDetectorUser tDetectorUser);
/**
* 删除燃气用户
*
* @param userId 燃气用户ID
* @return 结果
*/
public int deleteTDetectorUserById(Long userId);
/**
* 批量删除燃气用户
*
* @param userIds 需要删除的数据ID
* @return 结果
*/
public int deleteTDetectorUserByIds(Long[] userIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceInfoS;
/**
* 设备信息Mapper接口
*
* @author zehong
* @date 2022-01-27
*/
public interface TDeviceInfoMapper
{
/**
* 查询设备信息
*
* @param deviceId 设备信息ID
* @return 设备信息
*/
public TDeviceInfo selectTDeviceInfoById(Long deviceId);
/**
* 查询设备信息列表
*
* @param tDeviceInfo 设备信息
* @return 设备信息集合
*/
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
* 新增设备信息
*
* @param tDeviceInfo 设备信息
* @return 结果
*/
public int insertTDeviceInfo(TDeviceInfo tDeviceInfo);
/**
* 修改设备信息
*
* @param tDeviceInfo 设备信息
* @return 结果
*/
public int updateTDeviceInfo(TDeviceInfo tDeviceInfo);
/**
* 删除设备信息
*
* @param deviceId 设备信息ID
* @return 结果
*/
public int deleteTDeviceInfoById(Long deviceId);
/**
* 批量删除设备信息
*
* @param deviceIds 需要删除的数据ID
* @return 结果
*/
public int deleteTDeviceInfoByIds(Long[] deviceIds);
/**
* 添加关联设备信息表数据
* @param gettDeviceInfoS
*/
void insertDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS);
/**
* 获取设备详细信息列表
* @param deviceId
* @return
*/
List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TSiteStationInfo;
/**
* 场站信息Mapper接口
*
* @author zehong
* @date 2022-01-27
*/
public interface TSiteStationInfoMapper
{
/**
* 查询场站信息
*
* @param siteStationId 场站信息ID
* @return 场站信息
*/
public TSiteStationInfo selectTSiteStationInfoById(Long siteStationId);
/**
* 查询场站信息列表
*
* @param tSiteStationInfo 场站信息
* @return 场站信息集合
*/
public List<TSiteStationInfo> selectTSiteStationInfoList(TSiteStationInfo tSiteStationInfo);
/**
* 新增场站信息
*
* @param tSiteStationInfo 场站信息
* @return 结果
*/
public int insertTSiteStationInfo(TSiteStationInfo tSiteStationInfo);
/**
* 修改场站信息
*
* @param tSiteStationInfo 场站信息
* @return 结果
*/
public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo);
/**
* 删除场站信息
*
* @param siteStationId 场站信息ID
* @return 结果
*/
public int deleteTSiteStationInfoById(Long siteStationId);
/**
* 批量删除场站信息
*
* @param siteStationIds 需要删除的数据ID
* @return 结果
*/
public int deleteTSiteStationInfoByIds(Long[] siteStationIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TDetectorUser;
/**
* 燃气用户Service接口
*
* @author zehong
* @date 2022-02-07
*/
public interface ITDetectorUserService
{
/**
* 查询燃气用户
*
* @param userId 燃气用户ID
* @return 燃气用户
*/
public TDetectorUser selectTDetectorUserById(Long userId);
/**
* 查询燃气用户列表
*
* @param tDetectorUser 燃气用户
* @return 燃气用户集合
*/
public List<TDetectorUser> selectTDetectorUserList(TDetectorUser tDetectorUser);
/**
* 新增燃气用户
*
* @param tDetectorUser 燃气用户
* @return 结果
*/
public int insertTDetectorUser(TDetectorUser tDetectorUser);
/**
* 修改燃气用户
*
* @param tDetectorUser 燃气用户
* @return 结果
*/
public int updateTDetectorUser(TDetectorUser tDetectorUser);
/**
* 批量删除燃气用户
*
* @param userIds 需要删除的燃气用户ID
* @return 结果
*/
public int deleteTDetectorUserByIds(Long[] userIds);
/**
* 删除燃气用户信息
*
* @param userId 燃气用户ID
* @return 结果
*/
public int deleteTDetectorUserById(Long userId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.domain.TDeviceInfoS;
/**
* 设备信息Service接口
*
* @author zehong
* @date 2022-01-27
*/
public interface ITDeviceInfoService
{
/**
* 查询设备信息
*
* @param deviceId 设备信息ID
* @return 设备信息
*/
public TDeviceInfo selectTDeviceInfoById(Long deviceId);
/**
* 查询设备信息列表
*
* @param tDeviceInfo 设备信息
* @return 设备信息集合
*/
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo);
/**
* 新增设备信息
*
* @param tDeviceInfo 设备信息
* @return 结果
*/
public int insertTDeviceInfo(TDeviceInfo tDeviceInfo);
/**
* 修改设备信息
*
* @param tDeviceInfo 设备信息
* @return 结果
*/
public int updateTDeviceInfo(TDeviceInfo tDeviceInfo);
/**
* 批量删除设备信息
*
* @param deviceIds 需要删除的设备信息ID
* @return 结果
*/
public int deleteTDeviceInfoByIds(Long[] deviceIds);
/**
* 删除设备信息信息
*
* @param deviceId 设备信息ID
* @return 结果
*/
public int deleteTDeviceInfoById(Long deviceId);
/**
* 添加关联设备信息表数据
* @param gettDeviceInfoS
*/
void insertDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS);
/**
* 获取设备详细信息列表
* @param deviceId
* @return
*/
List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TSiteStationInfo;
/**
* 场站信息Service接口
*
* @author zehong
* @date 2022-01-27
*/
public interface ITSiteStationInfoService
{
/**
* 查询场站信息
*
* @param siteStationId 场站信息ID
* @return 场站信息
*/
public TSiteStationInfo selectTSiteStationInfoById(Long siteStationId);
/**
* 查询场站信息列表
*
* @param tSiteStationInfo 场站信息
* @return 场站信息集合
*/
public List<TSiteStationInfo> selectTSiteStationInfoList(TSiteStationInfo tSiteStationInfo);
/**
* 新增场站信息
*
* @param tSiteStationInfo 场站信息
* @return 结果
*/
public int insertTSiteStationInfo(TSiteStationInfo tSiteStationInfo);
/**
* 修改场站信息
*
* @param tSiteStationInfo 场站信息
* @return 结果
*/
public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo);
/**
* 批量删除场站信息
*
* @param siteStationIds 需要删除的场站信息ID
* @return 结果
*/
public int deleteTSiteStationInfoByIds(Long[] siteStationIds);
/**
* 删除场站信息信息
*
* @param siteStationId 场站信息ID
* @return 结果
*/
public int deleteTSiteStationInfoById(Long siteStationId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDetectorUserMapper;
import com.zehong.system.domain.TDetectorUser;
import com.zehong.system.service.ITDetectorUserService;
/**
* 燃气用户Service业务层处理
*
* @author zehong
* @date 2022-02-07
*/
@Service
public class TDetectorUserServiceImpl implements ITDetectorUserService
{
@Autowired
private TDetectorUserMapper tDetectorUserMapper;
/**
* 查询燃气用户
*
* @param userId 燃气用户ID
* @return 燃气用户
*/
@Override
public TDetectorUser selectTDetectorUserById(Long userId)
{
return tDetectorUserMapper.selectTDetectorUserById(userId);
}
/**
* 查询燃气用户列表
*
* @param tDetectorUser 燃气用户
* @return 燃气用户
*/
@Override
public List<TDetectorUser> selectTDetectorUserList(TDetectorUser tDetectorUser)
{
return tDetectorUserMapper.selectTDetectorUserList(tDetectorUser);
}
/**
* 新增燃气用户
*
* @param tDetectorUser 燃气用户
* @return 结果
*/
@Override
public int insertTDetectorUser(TDetectorUser tDetectorUser)
{
return tDetectorUserMapper.insertTDetectorUser(tDetectorUser);
}
/**
* 修改燃气用户
*
* @param tDetectorUser 燃气用户
* @return 结果
*/
@Override
public int updateTDetectorUser(TDetectorUser tDetectorUser)
{
return tDetectorUserMapper.updateTDetectorUser(tDetectorUser);
}
/**
* 批量删除燃气用户
*
* @param userIds 需要删除的燃气用户ID
* @return 结果
*/
@Override
public int deleteTDetectorUserByIds(Long[] userIds)
{
return tDetectorUserMapper.deleteTDetectorUserByIds(userIds);
}
/**
* 删除燃气用户信息
*
* @param userId 燃气用户ID
* @return 结果
*/
@Override
public int deleteTDetectorUserById(Long userId)
{
return tDetectorUserMapper.deleteTDetectorUserById(userId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.TDeviceInfoS;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TDeviceInfoMapper;
import com.zehong.system.domain.TDeviceInfo;
import com.zehong.system.service.ITDeviceInfoService;
/**
* 设备信息Service业务层处理
*
* @author zehong
* @date 2022-01-27
*/
@Service
public class TDeviceInfoServiceImpl implements ITDeviceInfoService
{
@Autowired
private TDeviceInfoMapper tDeviceInfoMapper;
/**
* 查询设备信息
*
* @param deviceId 设备信息ID
* @return 设备信息
*/
@Override
public TDeviceInfo selectTDeviceInfoById(Long deviceId)
{
return tDeviceInfoMapper.selectTDeviceInfoById(deviceId);
}
/**
* 查询设备信息列表
*
* @param tDeviceInfo 设备信息
* @return 设备信息
*/
@Override
public List<TDeviceInfo> selectTDeviceInfoList(TDeviceInfo tDeviceInfo)
{
return tDeviceInfoMapper.selectTDeviceInfoList(tDeviceInfo);
}
/**
* 新增设备信息
*
* @param tDeviceInfo 设备信息
* @return 结果
*/
@Override
public int insertTDeviceInfo(TDeviceInfo tDeviceInfo)
{
tDeviceInfo.setCreateTime(DateUtils.getNowDate());
return tDeviceInfoMapper.insertTDeviceInfo(tDeviceInfo);
}
/**
* 修改设备信息
*
* @param tDeviceInfo 设备信息
* @return 结果
*/
@Override
public int updateTDeviceInfo(TDeviceInfo tDeviceInfo)
{
tDeviceInfo.setUpdateTime(DateUtils.getNowDate());
return tDeviceInfoMapper.updateTDeviceInfo(tDeviceInfo);
}
/**
* 批量删除设备信息
*
* @param deviceIds 需要删除的设备信息ID
* @return 结果
*/
@Override
public int deleteTDeviceInfoByIds(Long[] deviceIds)
{
return tDeviceInfoMapper.deleteTDeviceInfoByIds(deviceIds);
}
/**
* 删除设备信息信息
*
* @param deviceId 设备信息ID
* @return 结果
*/
@Override
public int deleteTDeviceInfoById(Long deviceId)
{
return tDeviceInfoMapper.deleteTDeviceInfoById(deviceId);
}
/**
* 添加关联设备信息表数据
* @param gettDeviceInfoS
*/
@Override
public void insertDeviceDetailInfo(List<TDeviceInfoS> gettDeviceInfoS) {
tDeviceInfoMapper.insertDeviceDetailInfo(gettDeviceInfoS);
}
/**
* 获取设备详细信息列表
* @param deviceId
* @return
*/
@Override
public List<TDeviceInfoS> getdeviceDetailInfo(Long deviceId) {
List<TDeviceInfoS> tDeviceInfoS = tDeviceInfoMapper.getdeviceDetailInfo(deviceId);
return tDeviceInfoS;
}
}
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.TSiteStationInfoMapper;
import com.zehong.system.domain.TSiteStationInfo;
import com.zehong.system.service.ITSiteStationInfoService;
/**
* 场站信息Service业务层处理
*
* @author zehong
* @date 2022-01-27
*/
@Service
public class TSiteStationInfoServiceImpl implements ITSiteStationInfoService
{
@Autowired
private TSiteStationInfoMapper tSiteStationInfoMapper;
/**
* 查询场站信息
*
* @param siteStationId 场站信息ID
* @return 场站信息
*/
@Override
public TSiteStationInfo selectTSiteStationInfoById(Long siteStationId)
{
return tSiteStationInfoMapper.selectTSiteStationInfoById(siteStationId);
}
/**
* 查询场站信息列表
*
* @param tSiteStationInfo 场站信息
* @return 场站信息
*/
@Override
public List<TSiteStationInfo> selectTSiteStationInfoList(TSiteStationInfo tSiteStationInfo)
{
return tSiteStationInfoMapper.selectTSiteStationInfoList(tSiteStationInfo);
}
/**
* 新增场站信息
*
* @param tSiteStationInfo 场站信息
* @return 结果
*/
@Override
public int insertTSiteStationInfo(TSiteStationInfo tSiteStationInfo)
{
tSiteStationInfo.setCreateTime(DateUtils.getNowDate());
return tSiteStationInfoMapper.insertTSiteStationInfo(tSiteStationInfo);
}
/**
* 修改场站信息
*
* @param tSiteStationInfo 场站信息
* @return 结果
*/
@Override
public int updateTSiteStationInfo(TSiteStationInfo tSiteStationInfo)
{
tSiteStationInfo.setUpdateTime(DateUtils.getNowDate());
return tSiteStationInfoMapper.updateTSiteStationInfo(tSiteStationInfo);
}
/**
* 批量删除场站信息
*
* @param siteStationIds 需要删除的场站信息ID
* @return 结果
*/
@Override
public int deleteTSiteStationInfoByIds(Long[] siteStationIds)
{
return tSiteStationInfoMapper.deleteTSiteStationInfoByIds(siteStationIds);
}
/**
* 删除场站信息信息
*
* @param siteStationId 场站信息ID
* @return 结果
*/
@Override
public int deleteTSiteStationInfoById(Long siteStationId)
{
return tSiteStationInfoMapper.deleteTSiteStationInfoById(siteStationId);
}
}
<?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.TDetectorUserMapper">
<resultMap type="TDetectorUser" id="TDetectorUserResult">
<result property="userId" column="user_id" />
<result property="username" column="username" />
<result property="nickName" column="nick_name" />
<result property="userType" column="user_type" />
<result property="address" column="address" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="linkman" column="linkman" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTDetectorUserVo">
select user_id, username, nick_name, user_type, address, longitude, latitude, linkman, phone, email, is_del, remarks from t_detector_user
</sql>
<select id="selectTDetectorUserList" parameterType="TDetectorUser" resultMap="TDetectorUserResult">
select user_id, username, nick_name, (CASE user_type WHEN '1' THEN '居民用户' WHEN '2' THEN '商业用户'WHEN '3' THEN '工业用户'end) as user_type , address, longitude, latitude, linkman, phone, email, is_del, remarks from t_detector_user
<where>
<if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
</where>
</select>
<select id="selectTDetectorUserById" parameterType="Long" resultMap="TDetectorUserResult">
<include refid="selectTDetectorUserVo"/>
where user_id = #{userId}
</select>
<insert id="insertTDetectorUser" parameterType="TDetectorUser" useGeneratedKeys="true" keyProperty="userId">
insert into t_detector_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="username != null">username,</if>
<if test="nickName != null">nick_name,</if>
<if test="userType != null">user_type,</if>
<if test="address != null">address,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="linkman != null">linkman,</if>
<if test="phone != null">phone,</if>
<if test="email != null">email,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="username != null">#{username},</if>
<if test="nickName != null">#{nickName},</if>
<if test="userType != null">#{userType},</if>
<if test="address != null">#{address},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="linkman != null">#{linkman},</if>
<if test="phone != null">#{phone},</if>
<if test="email != null">#{email},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTDetectorUser" parameterType="TDetectorUser">
update t_detector_user
<trim prefix="SET" suffixOverrides=",">
<if test="username != null">username = #{username},</if>
<if test="nickName != null">nick_name = #{nickName},</if>
<if test="userType != null">user_type = #{userType},</if>
<if test="address != null">address = #{address},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="linkman != null">linkman = #{linkman},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where user_id = #{userId}
</update>
<delete id="deleteTDetectorUserById" parameterType="Long">
delete from t_detector_user where user_id = #{userId}
</delete>
<delete id="deleteTDetectorUserByIds" parameterType="String">
delete from t_detector_user where user_id in
<foreach item="userId" collection="array" open="(" separator="," close=")">
#{userId}
</foreach>
</delete>
</mapper>
<?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.TDeviceInfoMapper">
<resultMap type="TDeviceInfo" id="TDeviceInfoResult">
<result property="deviceId" column="device_id" />
<result property="deviceName" column="device_name" />
<result property="deviceCode" column="device_code" />
<result property="deviceAddr" column="device_addr" />
<result property="deviceModel" column="device_model" />
<result property="deviceType" column="device_type" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="beyondEnterpriseName" column="beyond_enterprise_name" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="iconUrl" column="icon_url" />
<result property="linkman" column="linkman" />
<result property="phone" column="phone" />
<result property="installationTime" column="installation_time" />
<result property="inspectionTime" column="inspection_time" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<!--关联设备map-->
<resultMap type="TDeviceInfoS" id="TDeviceInfoResultS">
<result property="relationDeviceDetailId" column="relation_device_detail_id" />
<result property="relationDeviceId" column="relation_device_id" />
<result property="deviceName" column="device_name" />
<result property="deviceModel" column="device_model" />
<result property="deviceType" column="device_type" />
<result property="iotNo" column="iot_no" />
<result property="remarksn" column="remarks" />
</resultMap>
<sql id="selectTDeviceInfoVo">
select a.device_id, a.device_name, a.device_code, a.device_addr, a.device_model,
(CASE a.device_type WHEN '1' THEN '阀井' WHEN '2' THEN '调压箱'WHEN '3' THEN '巡检员' WHEN '4' THEN '视频' end) as device_type ,
a.beyond_enterprise_id, a.longitude, a.latitude, a.icon_url, a.linkman, a.phone, a.installation_time, a.inspection_time, a.create_by, a.create_time, a.update_by, a.update_time, a.is_del, a.remarks
,b.enterprise_name as beyond_enterprise_name
from t_device_info a left join t_enterprise_info b on a.beyond_enterprise_id=b.enterprise_id
</sql>
<select id="selectTDeviceInfoList" parameterType="TDeviceInfo" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/>
<where>
a.is_del='0'
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceCode != null and deviceCode != ''"> and device_code = #{deviceCode}</if>
<if test="deviceAddr != null and deviceAddr != ''"> and device_addr = #{deviceAddr}</if>
</where>
</select>
<select id="selectTDeviceInfoById" parameterType="Long" resultMap="TDeviceInfoResult">
select device_id, device_name, device_code, device_addr, device_model,device_type,
beyond_enterprise_id, beyond_enterprise_name, longitude, latitude, icon_url, linkman, phone, installation_time, inspection_time, create_by, create_time, update_by, update_time, is_del, remarks from t_device_info
where device_id = #{deviceId} and is_del='0'
</select>
<insert id="insertTDeviceInfo" parameterType="TDeviceInfo" useGeneratedKeys="true" keyProperty="deviceId">
insert into t_device_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceName != null">device_name,</if>
<if test="deviceCode != null">device_code,</if>
<if test="deviceAddr != null">device_addr,</if>
<if test="deviceModel != null">device_model,</if>
<if test="deviceType != null">device_type,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="iconUrl != null">icon_url,</if>
<if test="linkman != null">linkman,</if>
<if test="phone != null">phone,</if>
<if test="installationTime != null">installation_time,</if>
<if test="inspectionTime != null">inspection_time,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceCode != null">#{deviceCode},</if>
<if test="deviceAddr != null">#{deviceAddr},</if>
<if test="deviceModel != null">#{deviceModel},</if>
<if test="deviceType != null">#{deviceType},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">#{beyondEnterpriseName},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="iconUrl != null">#{iconUrl},</if>
<if test="linkman != null">#{linkman},</if>
<if test="phone != null">#{phone},</if>
<if test="installationTime != null">#{installationTime},</if>
<if test="inspectionTime != null">#{inspectionTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTDeviceInfo" parameterType="TDeviceInfo">
update t_device_info
<trim prefix="SET" suffixOverrides=",">
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceCode != null">device_code = #{deviceCode},</if>
<if test="deviceAddr != null">device_addr = #{deviceAddr},</if>
<if test="deviceModel != null">device_model = #{deviceModel},</if>
<if test="deviceType != null">device_type = #{deviceType},</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name = #{beyondEnterpriseName},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="iconUrl != null">icon_url = #{iconUrl},</if>
<if test="linkman != null">linkman = #{linkman},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="installationTime != null">installation_time = #{installationTime},</if>
<if test="inspectionTime != null">inspection_time = #{inspectionTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where device_id = #{deviceId}
</update>
<update id="deleteTDeviceInfoById" parameterType="Long">
update t_device_info set is_del='1' where device_id = #{deviceId}
</update>
<update id="deleteTDeviceInfoByIds" parameterType="String">
update t_device_info set is_del='1' where device_id in
<foreach item="deviceId" collection="array" open="(" separator="," close=")">
#{deviceId}
</foreach>
</update>
<!--添加关联设备信息表数据-->
<insert id="insertDeviceDetailInfo" parameterType="java.util.List">
INSERT INTO t_relation_device_detail_info (relation_device_id,device_name,device_model,device_type,iot_no)
VALUES
<foreach collection="list" item="item" index="key" separator=",">
(#{item.relationDeviceId},#{item.deviceName},#{item.deviceModel},#{item.deviceType},#{item.iotNo})
</foreach>
</insert>
<!--获取设备详细信息列表-->
<select id="getdeviceDetailInfo" resultMap="TDeviceInfoResultS">
select relation_device_detail_id,relation_device_id,device_name,device_model,device_type,iot_no,remarks
from t_relation_device_detail_info where relation_device_id =#{deviceId}
</select>
</mapper>
<?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.TSiteStationInfoMapper">
<resultMap type="TSiteStationInfo" id="TSiteStationInfoResult">
<result property="siteStationId" column="site_station_id" />
<result property="siteStationType" column="site_station_type" />
<result property="siteStationName" column="site_station_name" />
<result property="buildDate" column="build_date" />
<result property="buildUnit" column="build_unit" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="beyondEnterpriseName" column="beyond_enterprise_name" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTSiteStationInfoVo">
select site_station_id,(CASE site_station_type WHEN '1' THEN '加气站' WHEN '2' THEN '门站'WHEN '3' THEN '调压站' WHEN '4' THEN '储备站'WHEN '5' THEN '气化站'end ) as site_station_type,
site_station_name, build_date, build_unit, beyond_enterprise_id, beyond_enterprise_name, longitude, latitude,
create_by, create_time, update_by, update_time, is_del, remarks from t_site_station_info
</sql>
<select id="selectTSiteStationInfoList" parameterType="TSiteStationInfo" resultMap="TSiteStationInfoResult">
<include refid="selectTSiteStationInfoVo"/>
<where>
is_del='0'
<if test="siteStationName != null and siteStationName != ''"> and site_station_name like concat('%', #{siteStationName}, '%')</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTSiteStationInfoById" parameterType="Long" resultMap="TSiteStationInfoResult">
select site_station_id,site_station_type,
site_station_name, build_date, build_unit, beyond_enterprise_id, beyond_enterprise_name, longitude, latitude,
create_by, create_time, update_by, update_time, is_del, remarks from t_site_station_info
where site_station_id = #{siteStationId} and is_del='0'
</select>
<insert id="insertTSiteStationInfo" parameterType="TSiteStationInfo" useGeneratedKeys="true" keyProperty="siteStationId">
insert into t_site_station_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteStationType != null">site_station_type,</if>
<if test="siteStationName != null">site_station_name,</if>
<if test="buildDate != null">build_date,</if>
<if test="buildUnit != null">build_unit,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteStationType != null">#{siteStationType},</if>
<if test="siteStationName != null">#{siteStationName},</if>
<if test="buildDate != null">#{buildDate},</if>
<if test="buildUnit != null">#{buildUnit},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">#{beyondEnterpriseName},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTSiteStationInfo" parameterType="TSiteStationInfo">
update t_site_station_info
<trim prefix="SET" suffixOverrides=",">
<if test="siteStationType != null">site_station_type = #{siteStationType},</if>
<if test="siteStationName != null">site_station_name = #{siteStationName},</if>
<if test="buildDate != null">build_date = #{buildDate},</if>
<if test="buildUnit != null">build_unit = #{buildUnit},</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name = #{beyondEnterpriseName},</if>
<if test="longitude != null">longitude = #{longitude},</if>
<if test="latitude != null">latitude = #{latitude},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where site_station_id = #{siteStationId}
</update>
<update id="deleteTSiteStationInfoById" parameterType="Long">
update t_site_station_info set is_del='1' where site_station_id = #{siteStationId}
</update>
<update id="deleteTSiteStationInfoByIds" parameterType="String">
update t_site_station_info set is_del='1' where site_station_id in
<foreach item="siteStationId" collection="array" open="(" separator="," close=")">
#{siteStationId}
</foreach>
</update>
</mapper>
import request from '@/utils/request'
// 查询设备信息列表
export function listDevice(query) {
return request({
url: '/device/device/list',
method: 'get',
params: query
})
}
// 查询设备信息详细
export function getDevice(deviceId) {
return request({
url: '/device/device/' + deviceId,
method: 'get'
})
}
// 新增设备信息
export function addDevice(data) {
return request({
url: '/device/device',
method: 'post',
data: data
})
}
// 修改设备信息
export function updateDevice(data) {
return request({
url: '/device/device',
method: 'put',
data: data
})
}
// 删除设备信息
export function delDevice(deviceId) {
return request({
url: '/device/device/' + deviceId,
method: 'delete'
})
}
// 导出设备信息
export function exportDevice(query) {
return request({
url: '/device/device/export',
method: 'get',
params: query
})
}
// 企业信息查询(下拉框)
export function selectTEnterprise() {
return request({
url: '/regulation/supervise/selectTEnterprise',
method: 'get'
})
}
// 关联设备详情信息
export function getDdeviceDetailInfo(deviceId) {
return request({
url: '/device/device/getdeviceDetailInfo' + deviceId,
method: 'get'
})
}
...@@ -51,3 +51,11 @@ export function exportPipe(query) { ...@@ -51,3 +51,11 @@ export function exportPipe(query) {
params: query params: query
}) })
} }
// 企业信息查询(下拉框)
export function selectTEnterprise() {
return request({
url: '/regulation/supervise/selectTEnterprise',
method: 'get'
})
}
import request from '@/utils/request'
// 查询场站信息列表
export function listStation(query) {
return request({
url: '/supervise/station/list',
method: 'get',
params: query
})
}
// 查询场站信息详细
export function getStation(siteStationId) {
return request({
url: '/supervise/station/' + siteStationId,
method: 'get'
})
}
// 新增场站信息
export function addStation(data) {
return request({
url: '/supervise/station',
method: 'post',
data: data
})
}
// 修改场站信息
export function updateStation(data) {
return request({
url: '/supervise/station',
method: 'put',
data: data
})
}
// 删除场站信息
export function delStation(siteStationId) {
return request({
url: '/supervise/station/' + siteStationId,
method: 'delete'
})
}
// 导出场站信息
export function exportStation(query) {
return request({
url: '/supervise/station/export',
method: 'get',
params: query
})
}
// 企业信息查询(下拉框)
export function selectTEnterprise() {
return request({
url: '/regulation/supervise/selectTEnterprise',
method: 'get'
})
}
import request from '@/utils/request'
// 查询燃气用户列表
export function listUser(query) {
return request({
url: '/supervise/user/list',
method: 'get',
params: query
})
}
// 查询燃气用户详细
export function getUser(userId) {
return request({
url: '/supervise/user/' + userId,
method: 'get'
})
}
// 新增燃气用户
export function addUser(data) {
return request({
url: '/supervise/user',
method: 'post',
data: data
})
}
// 修改燃气用户
export function updateUser(data) {
return request({
url: '/supervise/user',
method: 'put',
data: data
})
}
// 删除燃气用户
export function delUser(userId) {
return request({
url: '/supervise/user/' + userId,
method: 'delete'
})
}
// 导出燃气用户
export function exportUser(query) {
return request({
url: '/supervise/user/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="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编号" prop="deviceCode">
<el-input
v-model="queryParams.deviceCode"
placeholder="请输入设备编号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所在地址" prop="deviceAddr">
<el-input
v-model="queryParams.deviceAddr"
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="['device:device: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="['device:device: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="['device:device: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="['device:device:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="设备id" align="center" prop="deviceId" />-->
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="所在地址" align="center" prop="deviceAddr" />
<el-table-column label="设备型号" align="center" prop="deviceModel" />
<el-table-column label="设备类型" align="center" prop="deviceType" />
<el-table-column label="权属单位名称" align="center" prop="beyondEnterpriseName" />
<el-table-column label="安装时间" align="center" prop="installationTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.installationTime, '{y}-{m}-{d}') }}</span>
</template>
</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="['device:device:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['device:device: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="deviceName">
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备编号" prop="deviceCode">
<el-input v-model="form.deviceCode" placeholder="请输入设备编号" />
</el-form-item>
<el-form-item label="所在地址" prop="deviceAddr">
<el-input v-model="form.deviceAddr" placeholder="请输入所在地址" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="form.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="form.deviceType" placeholder="请选择设备类型">
<el-option label="阀井" value="1" />
<el-option label="调压箱" value="2" />
<el-option label="巡检员" value="3" />
<el-option label="视频" value="4" />
</el-select>
</el-form-item>
<!-- <el-form-item label="权属单位" prop="beyondEnterpriseId">-->
<!-- <el-input v-model="form.beyondEnterpriseId" placeholder="请输入权属单位" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="权属单位名称" prop="beyondEnterpriseName">-->
<!-- <el-input v-model="form.beyondEnterpriseName" placeholder="请输入权属单位名称" />-->
<!-- </el-form-item>-->
<el-form-item label="权属单位" prop="beyondEnterpriseName">
<el-select v-model="form.beyondEnterpriseId" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable>
<el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.longitude" placeholder="请输入经度" />
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="设备图片路径" prop="iconUrl">
<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="安装时间" prop="installationTime">
<el-date-picker clearable size="small"
v-model="form.installationTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择安装时间">
</el-date-picker>
</el-form-item>
<el-form-item label="最后巡检时间" prop="inspectionTime">
<el-date-picker clearable size="small"
v-model="form.inspectionTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择最后巡检时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" placeholder="请输入备注" />
</el-form-item>
</el-form>
<!--自增关联设备信息-->
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic" >
<div v-for="(domain, index) in dynamicValidateForm.domains" :key="domain.key">
<el-divider content-position="left">关联设备</el-divider>
<el-form-item label="设备名称" prop="deviceModel">
<el-input v-model="domain.deviceName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备型号" prop="deviceModel">
<el-input v-model="domain.deviceModel" placeholder="请输入设备型号" />
</el-form-item>
<el-form-item label="设备类型" prop="deviceModel" >
<el-select v-model="domain.deviceType" placeholder="请选择设备类型">
<el-option label="压力表" value="1" />
<el-option label="流量计" value="2" />
</el-select>
</el-form-item>
<el-form-item label="物联网编号" prop="deviceModel">
<el-input v-model="domain.iotNo" placeholder="请输入物联网编号" />
</el-form-item>
<el-form-item label="备注" prop="remarks" >
<el-input v-model="domain.remarksn" placeholder="请输入备注" />
</el-form-item>
<el-button @click.prevent="removeDomain(domain)">删除</el-button>
</div>
<el-form-item>
<el-button type="primary" @click="submitForm('dynamicValidateForm')">提交</el-button>
<el-button @click="addDomain">新增关联设备</el-button>
</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 { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice, selectTEnterprise } from "@/api/regulation/device";
export default {
name: "Device",
components: {
},
data() {
return {
dynamicValidateForm: {
domains: [{
deviceName: '',
deviceModel:'',
deviceType:'',
iotNo:'',
remarksn:''
}],
},
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 设备信息表格数据
deviceList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
deviceName: null,
deviceCode: null,
deviceAddr: null,
},
// 表单参数
form: {},
// 关联设备表单参数
forms: {},
//下拉列表数据
test: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备信息列表 */
getList() {
this.loading = true;
listDevice(this.queryParams).then(response => {
this.deviceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
deviceId: null,
deviceName: null,
deviceCode: null,
deviceAddr: null,
deviceModel: null,
deviceType: null,
beyondEnterpriseId: null,
beyondEnterpriseName: null,
longitude: null,
latitude: null,
iconUrl: null,
linkman: null,
phone: null,
installationTime: null,
inspectionTime: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.forms = {
deviceName:null,
deviceModel:null,
deviceType:null,
iotNo:null,
remarksn: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.deviceId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.test = response.data;
});
this.reset();
this.open = true;
this.title = "添加设备信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.test = response.data;
});
//查询关联设备信息数据
getDdeviceDetailInfo().then(response => {
this.dynamicValidateForm.domains = response.data;
});
this.reset();
const deviceId = row.deviceId || this.ids
getDevice(deviceId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备信息";
});
},
/** 删除按钮操作 */
handleDelete(row) {
const deviceIds = row.deviceId || this.ids;
this.$confirm('是否确认删除设备信息编号为"' + deviceIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delDevice(deviceIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有设备信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportDevice(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
/**动态添加输入框方法*/
addDomain() {
this.dynamicValidateForm.domains.push({
deviceName: '',
deviceModel:'',
deviceType:'',
iotNo:'',
remarksn:'',
});
},
/**动态删除输入框方法*/
removeDomain(item) {
var index = this.dynamicValidateForm.domains.indexOf(item)
if (index !== -1) {
this.dynamicValidateForm.domains.splice(index, 1)
}
},
/**提交数据方法*/
submitForm(formName) {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.deviceId != null) {
updateDevice(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.$refs[formName].validate((valid) => {
if (valid) {
var tDeviceInfon={
tDeviceInfo:this.form,
tDeviceInfoS:this.dynamicValidateForm.domains
}
addDevice(JSON.stringify(tDeviceInfon)).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
} else {
console.log('error submit!!');
return false;
}
});
}
}
});
},
}
};
</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="username">
<el-input
v-model="queryParams.username"
placeholder="请输入用户账号"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="nickName">
<el-input
v-model="queryParams.nickName"
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="['supervise:user: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="['supervise:user: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="['supervise:user: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="['supervise:user:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户id" align="center" prop="userId" />
<el-table-column label="用户账号" align="center" prop="username" />
<el-table-column label="用户名称" align="center" prop="nickName" />
<el-table-column label="用户类型" align="center" prop="userType" />
<el-table-column label="地址" align="center" prop="address" />
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="联系人" align="center" prop="linkman" />
<el-table-column label="电话" align="center" prop="phone" />
<el-table-column label="邮箱" align="center" prop="email" />
<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="['supervise:user:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['supervise:user: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="username">
<el-input v-model="form.username" placeholder="请输入用户账号" />
</el-form-item>
<el-form-item label="用户名称" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户名称" />
</el-form-item>
<el-form-item label="用户类型" prop="userType">
<el-select v-model="form.userType" placeholder="请选择用户类型">
<el-option label="居民用户" value="1" />
<el-option label="商业用户" value="2" />
<el-option label="工业用户" value="3" />
</el-select>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" placeholder="请输入地址" />
</el-form-item>
<el-form-item label="经度" prop="longitude">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.longitude" placeholder="请输入经度" />
</el-form-item>
<el-form-item label="纬度" prop="latitude">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="联系人" prop="linkman">
<el-input v-model="form.linkman" placeholder="请输入联系人" />
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.phone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入邮箱" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input v-model="form.remarks" type="textarea" 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 { listUser, getUser, delUser, addUser, updateUser, exportUser } from "@/api/regulation/user";
export default {
name: "User",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 燃气用户表格数据
userList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
username: null,
nickName: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询燃气用户列表 */
getList() {
this.loading = true;
listUser(this.queryParams).then(response => {
this.userList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
userId: null,
username: null,
nickName: null,
userType: null,
address: null,
longitude: null,
latitude: null,
linkman: null,
phone: null,
email: 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.userId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加燃气用户";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const userId = row.userId || this.ids
getUser(userId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改燃气用户";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.userId != null) {
updateUser(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addUser(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const userIds = row.userId || this.ids;
this.$confirm('是否确认删除燃气用户编号为"' + userIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delUser(userIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有燃气用户数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportUser(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
<el-table-column label="人员类型" align="center" prop="peopleOccupation" /> <el-table-column label="人员类型" align="center" prop="peopleOccupation" />
<el-table-column label="建设年代" align="center" prop="buildDate" /> <el-table-column label="建设年代" align="center" prop="buildDate" />
<el-table-column label="建设单位" align="center" prop="buildUnit" /> <el-table-column label="建设单位" align="center" prop="buildUnit" />
<el-table-column label="权属单位" align="center" prop="beyondEnterpriseId" /> <el-table-column label="权属单位" align="center" prop="beyondEnterpriseName" />
<el-table-column label="坐标" align="center" prop="coordinates" /> <el-table-column label="坐标" align="center" prop="coordinates" />
<el-table-column label="备注" align="center" prop="remarks" /> <el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
...@@ -160,12 +160,23 @@ ...@@ -160,12 +160,23 @@
<el-form-item label="建设单位" prop="buildUnit"> <el-form-item label="建设单位" prop="buildUnit">
<el-input v-model="form.buildUnit" placeholder="请输入建设单位" /> <el-input v-model="form.buildUnit" placeholder="请输入建设单位" />
</el-form-item> </el-form-item>
<el-form-item label="权属单位" prop="beyondEnterpriseId">
<el-input v-model="form.beyondEnterpriseId" placeholder="请输入权属单位" />
</el-form-item> <!-- <el-form-item label="权属单位" prop="beyondEnterpriseId">-->
<el-form-item label="权属单位名称" prop="beyondEnterpriseName"> <!-- <el-input v-model="form.beyondEnterpriseId" placeholder="请输入权属单位" />-->
<el-input v-model="form.beyondEnterpriseName" placeholder="请输入权属单位名称" /> <!-- </el-form-item>-->
<!-- <el-form-item label="权属单位名称" prop="beyondEnterpriseName">-->
<!-- <el-input v-model="form.beyondEnterpriseName" placeholder="请输入权属单位名称" />-->
<!-- </el-form-item>-->
<el-form-item label="权属单位" prop="beyondEnterpriseName">
<el-select v-model="form.beyondEnterpriseId" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable>
<el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="坐标" prop="coordinates"> <el-form-item label="坐标" prop="coordinates">
<el-input v-model="form.coordinates" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.coordinates" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
...@@ -182,7 +193,7 @@ ...@@ -182,7 +193,7 @@
</template> </template>
<script> <script>
import { listPipe, getPipe, delPipe, addPipe, updatePipe, exportPipe } from "@/api/regulation/pipe"; import { listPipe, getPipe, delPipe, addPipe, updatePipe, exportPipe, selectTEnterprise} from "@/api/regulation/pipe";
export default { export default {
name: "Pipe", name: "Pipe",
...@@ -210,6 +221,8 @@ export default { ...@@ -210,6 +221,8 @@ export default {
title: "", title: "",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
//下拉框数据
test:{},
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -231,6 +244,8 @@ export default { ...@@ -231,6 +244,8 @@ export default {
}, },
// 表单参数 // 表单参数
form: {}, form: {},
//下拉列表数据
test: {},
// 表单校验 // 表单校验
rules: { rules: {
} }
...@@ -297,12 +312,20 @@ export default { ...@@ -297,12 +312,20 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.test = response.data;
});
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加管道信息"; this.title = "添加管道信息";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.test = response.data;
});
this.reset(); this.reset();
const pipeId = row.pipeId || this.ids const pipeId = row.pipeId || this.ids
getPipe(pipeId).then(response => { getPipe(pipeId).then(response => {
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="场站名称" prop="siteStationName">
<el-input
v-model="queryParams.siteStationName"
placeholder="请输入场站名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="权属单位名称" prop="beyondEnterpriseName">
<el-input
v-model="queryParams.beyondEnterpriseName"
placeholder="请输入权属单位名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</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="['supervise:station: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="['supervise:station: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="['supervise:station: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="['supervise:station:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="stationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="场站id" align="center" prop="siteStationId" />
<el-table-column label="场站类型" align="center" prop="siteStationType" />
<el-table-column label="场站名称" align="center" prop="siteStationName" />
<el-table-column label="建设年代" align="center" prop="buildDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.buildDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="建设单位" align="center" prop="buildUnit" />
<el-table-column label="权属单位" align="center" prop="beyondEnterpriseId" />
<el-table-column label="权属单位名称" align="center" prop="beyondEnterpriseName" />
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<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="['supervise:station:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['supervise:station: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="siteStationType">
<el-select v-model="form.siteStationType" placeholder="请选择场站类型">
<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-select>
</el-form-item>
<el-form-item label="场站名称" prop="siteStationName">
<el-input v-model="form.siteStationName" placeholder="请输入场站名称" />
</el-form-item>
<el-form-item label="建设年代" prop="buildDate">
<el-date-picker clearable size="small"
v-model="form.buildDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择建设年代">
</el-date-picker>
</el-form-item>
<el-form-item label="建设单位" prop="buildUnit">
<el-input v-model="form.buildUnit" placeholder="请输入建设单位" />
</el-form-item>
<!-- <el-form-item label="权属单位" prop="beyondEnterpriseId">-->
<!-- <el-input v-model="form.beyondEnterpriseId" placeholder="请输入权属单位" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="权属单位名称" prop="beyondEnterpriseName">-->
<!-- <el-input v-model="form.beyondEnterpriseName" placeholder="请输入权属单位名称" />-->
<!-- </el-form-item>-->
<el-form-item label="权属单位" prop="beyondEnterpriseName">
<el-select v-model="form.beyondEnterpriseId" placeholder="请在下拉框中选择权属单位" maxlength="255" :disabled="false" clearable>
<el-option v-for="item in test" :key="item.enterpriseId" :label="item.enterpriseName" :value="item.enterpriseId">
</el-option>
</el-select>
</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 onkeyup="this.value=this.value.replace(/\D/g,'')" v-model="form.latitude" placeholder="请输入纬度" />
</el-form-item>
<el-form-item label="备注" prop="remarks">
<el-input onkeyup="this.value=this.value.replace(/\D/g,'')" 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 { listStation, getStation, delStation, addStation, updateStation, exportStation ,selectTEnterprise} from "@/api/regulation/station";
export default {
name: "Station",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 场站信息表格数据
stationList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 场站类型:1.加气站 2.门站 3.调压站 4.储备站 5.气化站字典
siteStationTypeOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
siteStationName: null,
beyondEnterpriseName: null,
remarks: null
},
// 表单参数
form: {},
// 动态下拉
test: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
this.getDicts("site_station_type").then(response => {
this.siteStationTypeOptions = response.data;
});
},
methods: {
/** 查询场站信息列表 */
getList() {
this.loading = true;
listStation(this.queryParams).then(response => {
this.stationList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 场站类型:1.加气站 2.门站 3.调压站 4.储备站 5.气化站字典翻译
siteStationTypeFormat(row, column) {
return this.selectDictLabel(this.siteStationTypeOptions, row.siteStationType);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
siteStationId: null,
siteStationType: null,
siteStationName: null,
buildDate: null,
buildUnit: null,
beyondEnterpriseId: null,
beyondEnterpriseName: null,
longitude: null,
latitude: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: 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.siteStationId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.test = response.data;
});
this.reset();
this.open = true;
this.title = "添加场站信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
//查询企业名称下拉框数据
selectTEnterprise().then(response => {
this.test = response.data;
});
this.reset();
const siteStationId = row.siteStationId || this.ids
getStation(siteStationId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改场站信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.siteStationId != null) {
updateStation(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStation(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const siteStationIds = row.siteStationId || this.ids;
this.$confirm('是否确认删除场站信息编号为"' + siteStationIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delStation(siteStationIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有场站信息数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportStation(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