dev #2
@ -16,6 +16,7 @@ import com.xzzn.common.core.controller.BaseController;
|
||||
import com.xzzn.common.core.domain.AjaxResult;
|
||||
import com.xzzn.common.enums.BusinessType;
|
||||
import com.xzzn.ems.domain.EmsPointMatch;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchExportVo;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchVo;
|
||||
import com.xzzn.ems.domain.vo.ImportPointDataRequest;
|
||||
import com.xzzn.ems.service.IEmsPointMatchService;
|
||||
@ -43,8 +44,8 @@ public class EmsPointMatchController extends BaseController
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, EmsPointMatch emsPointMatch)
|
||||
{
|
||||
List<EmsPointMatch> list = emsPointMatchService.selectEmsPointMatchList(emsPointMatch);
|
||||
ExcelUtil<EmsPointMatch> util = new ExcelUtil<EmsPointMatch>(EmsPointMatch.class);
|
||||
List<DevicePointMatchExportVo> list = emsPointMatchService.selectEmsPointMatchList(emsPointMatch);
|
||||
ExcelUtil<DevicePointMatchExportVo> util = new ExcelUtil<>(DevicePointMatchExportVo.class);
|
||||
util.exportExcel(response, list, "点位匹配数据");
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
package com.xzzn.ems.domain.vo;
|
||||
|
||||
import com.xzzn.common.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 点位清单导出参数
|
||||
*/
|
||||
public class DevicePointMatchExportVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 点位匹配字段 */
|
||||
@Excel(name = "点位匹配字段")
|
||||
private String matchField;
|
||||
|
||||
/** 存储点位名称 */
|
||||
@Excel(name = "点位匹配字段名称")
|
||||
private String pointName;
|
||||
|
||||
/** 数据点位 */
|
||||
@Excel(name = "数据点位")
|
||||
private String dataPoint;
|
||||
|
||||
/** 数据点位名称 */
|
||||
@Excel(name = "数据点位名称")
|
||||
private String dataPointName;
|
||||
|
||||
/** 数据单位 */
|
||||
@Excel(name = "数据单位")
|
||||
private String dataUnit;
|
||||
|
||||
/** 是否告警点位 */
|
||||
@Excel(name = "是否告警点位", readConverterExp = "0=否,1=是")
|
||||
private String isAlarm;
|
||||
|
||||
/** 寄存器地址 */
|
||||
@Excel(name = "寄存器地址")
|
||||
private String ipAddress;
|
||||
|
||||
public String getPointName() {
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName) {
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getMatchField() {
|
||||
return matchField;
|
||||
}
|
||||
|
||||
public void setMatchField(String matchField) {
|
||||
this.matchField = matchField;
|
||||
}
|
||||
|
||||
public String getDataPoint() {
|
||||
return dataPoint;
|
||||
}
|
||||
|
||||
public void setDataPoint(String dataPoint) {
|
||||
this.dataPoint = dataPoint;
|
||||
}
|
||||
|
||||
public String getDataPointName() {
|
||||
return dataPointName;
|
||||
}
|
||||
|
||||
public void setDataPointName(String dataPointName) {
|
||||
this.dataPointName = dataPointName;
|
||||
}
|
||||
|
||||
public String getDataUnit() {
|
||||
return dataUnit;
|
||||
}
|
||||
|
||||
public void setDataUnit(String dataUnit) {
|
||||
this.dataUnit = dataUnit;
|
||||
}
|
||||
|
||||
public String getIsAlarm() {
|
||||
return isAlarm;
|
||||
}
|
||||
|
||||
public void setIsAlarm(String isAlarm) {
|
||||
this.isAlarm = isAlarm;
|
||||
}
|
||||
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,6 +14,10 @@ public class DevicePointMatchVo implements Serializable {
|
||||
@Excel(name = "点位匹配字段")
|
||||
private String matchField;
|
||||
|
||||
/** 存储点位名称 */
|
||||
@Excel(name = "点位匹配字段名称")
|
||||
private String pointName;
|
||||
|
||||
/** 数据点位 */
|
||||
@Excel(name = "数据点位")
|
||||
private String dataPoint;
|
||||
@ -29,10 +33,6 @@ public class DevicePointMatchVo implements Serializable {
|
||||
/** 是否告警点位 */
|
||||
@Excel(name = "是否告警点位", readConverterExp = "0=否,1=是")
|
||||
private String isAlarm;
|
||||
//
|
||||
// /** 数据点位来源设备 */
|
||||
// @Excel(name = "数据点位来源设备")
|
||||
// private String dataDevice;
|
||||
|
||||
/** 寄存器地址 */
|
||||
@Excel(name = "寄存器地址")
|
||||
@ -42,6 +42,14 @@ public class DevicePointMatchVo implements Serializable {
|
||||
@Excel(name = "错误信息")
|
||||
private String errorMsg;
|
||||
|
||||
public String getPointName() {
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName) {
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getMatchField() {
|
||||
return matchField;
|
||||
}
|
||||
@ -74,15 +82,6 @@ public class DevicePointMatchVo implements Serializable {
|
||||
this.dataUnit = dataUnit;
|
||||
}
|
||||
|
||||
// public String getDataDevice() {
|
||||
// return dataDevice;
|
||||
// }
|
||||
//
|
||||
// public void setDataDevice(String dataDevice) {
|
||||
// this.dataDevice = dataDevice;
|
||||
// }
|
||||
|
||||
|
||||
public String getIsAlarm() {
|
||||
return isAlarm;
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.xzzn.ems.domain.EmsPointMatch;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchExportVo;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchVo;
|
||||
import com.xzzn.ems.domain.vo.GeneralQueryDataVo;
|
||||
import com.xzzn.ems.domain.vo.PointQueryResponse;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -146,4 +148,6 @@ public interface EmsPointMatchMapper
|
||||
EmsPointMatch getOnePointMatch(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory, @Param("dataPoint") String dataPoint);
|
||||
|
||||
List<EmsPointMatch> getDevicePointMatchList(@Param("siteId") String siteId, @Param("deviceCategory") String deviceCategory);
|
||||
|
||||
List<DevicePointMatchExportVo> selectEmsPointMatchExportList(EmsPointMatch emsPointMatch);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.xzzn.ems.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.xzzn.ems.domain.EmsPointMatch;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchExportVo;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchVo;
|
||||
import com.xzzn.ems.domain.vo.ImportPointDataRequest;
|
||||
|
||||
@ -20,7 +21,7 @@ public interface IEmsPointMatchService
|
||||
* @param emsPointMatch 点位匹配
|
||||
* @return 点位匹配集合
|
||||
*/
|
||||
public List<EmsPointMatch> selectEmsPointMatchList(EmsPointMatch emsPointMatch);
|
||||
public List<DevicePointMatchExportVo> selectEmsPointMatchList(EmsPointMatch emsPointMatch);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -28,6 +28,7 @@ import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.xzzn.common.utils.poi.ExcelUtil;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchExportVo;
|
||||
import com.xzzn.ems.domain.vo.DevicePointMatchVo;
|
||||
import com.xzzn.ems.domain.vo.ImportPointDataRequest;
|
||||
import com.xzzn.ems.enums.DeviceMatchTable;
|
||||
@ -62,9 +63,9 @@ public class EmsPointMatchServiceImpl implements IEmsPointMatchService
|
||||
* @return 点位匹配
|
||||
*/
|
||||
@Override
|
||||
public List<EmsPointMatch> selectEmsPointMatchList(EmsPointMatch emsPointMatch)
|
||||
public List<DevicePointMatchExportVo> selectEmsPointMatchList(EmsPointMatch emsPointMatch)
|
||||
{
|
||||
return emsPointMatchMapper.selectEmsPointMatchList(emsPointMatch);
|
||||
return emsPointMatchMapper.selectEmsPointMatchExportList(emsPointMatch);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -196,9 +197,6 @@ public class EmsPointMatchServiceImpl implements IEmsPointMatchService
|
||||
if (StringUtils.isBlank(pointMatch.getDataPointName())) {
|
||||
errorMsg.append("数据点位名称不能为空;");
|
||||
}
|
||||
// if (StringUtils.isBlank(pointMatch.getDataDevice())) {
|
||||
// errorMsg.append("数据点位来源设备不能为空;");
|
||||
// }
|
||||
if (errorMsg.length() > 0) {
|
||||
pointMatch.setErrorMsg(errorMsg.toString());
|
||||
errorList.add(pointMatch);
|
||||
|
||||
@ -450,4 +450,22 @@
|
||||
where site_id = #{siteId}
|
||||
and device_category = #{deviceCategory}
|
||||
</select>
|
||||
|
||||
<select id="selectEmsPointMatchExportList" parameterType="EmsPointMatch" resultType="com.xzzn.ems.domain.vo.DevicePointMatchExportVo">
|
||||
select
|
||||
point_name as pointName,
|
||||
match_field as matchField,
|
||||
data_point as dataPoint,
|
||||
data_point_name as dataPointName,
|
||||
data_unit as dataUnit,
|
||||
is_alarm as isAlarm,
|
||||
ip_address as ipAddress
|
||||
from
|
||||
ems_point_match
|
||||
<where>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceCategory != null and deviceCategory != ''"> and device_category = #{deviceCategory}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user