点位清单-导入导出

This commit is contained in:
2025-11-06 15:32:33 +08:00
parent c2682f38a8
commit 72c7c0c3e0
3 changed files with 11 additions and 7 deletions

View File

@ -139,5 +139,5 @@ public interface EmsPointMatchMapper
@Param("ipPort")Integer ipPort); @Param("ipPort")Integer ipPort);
// 根据站点,设备类别,点位,获取唯一数据 // 根据站点,设备类别,点位,获取唯一数据
public EmsPointMatch getUniquePoint(String siteId, String deviceCategory, String dataPoint); public EmsPointMatch getUniquePoint(@Param("siteId")String siteId, @Param("deviceCategory")String deviceCategory, @Param("dataPoint")String dataPoint);
} }

View File

@ -56,10 +56,8 @@ public class EmsPointMatchServiceImpl implements IEmsPointMatchService
int failureNum = 0; int failureNum = 0;
StringBuilder successMsg = new StringBuilder(); StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder(); StringBuilder failureMsg = new StringBuilder();
for (EmsPointMatch pointMatch : pointMatchList) for (EmsPointMatch pointMatch : pointMatchList) {
{ try {
try
{
// 验证点位是否存在 // 验证点位是否存在
EmsPointMatch point = emsPointMatchMapper.getUniquePoint(pointMatch.getSiteId(), EmsPointMatch point = emsPointMatchMapper.getUniquePoint(pointMatch.getSiteId(),
pointMatch.getDeviceCategory(),pointMatch.getDataPoint()); pointMatch.getDeviceCategory(),pointMatch.getDataPoint());
@ -79,8 +77,7 @@ public class EmsPointMatchServiceImpl implements IEmsPointMatchService
failureNum++; failureNum++;
failureMsg.append("<br/>" + failureNum + "、站点" + pointMatch.getSiteId() + "、点位 " + pointMatch.getDataPoint() + " 已存在"); failureMsg.append("<br/>" + failureNum + "、站点" + pointMatch.getSiteId() + "、点位 " + pointMatch.getDataPoint() + " 已存在");
} }
} } catch (Exception e) {
catch (Exception e) {
failureNum++; failureNum++;
String msg = "<br/>" + failureNum + "、站点" + pointMatch.getSiteId() + "、点位 " + pointMatch.getDataPoint() + " 导入失败:"; String msg = "<br/>" + failureNum + "、站点" + pointMatch.getSiteId() + "、点位 " + pointMatch.getDataPoint() + " 导入失败:";
failureMsg.append(msg + e.getMessage()); failureMsg.append(msg + e.getMessage());

View File

@ -419,4 +419,11 @@
and tmp.ipPort = #{ipPort} and tmp.ipPort = #{ipPort}
</if> </if>
</select> </select>
<select id="getUniquePoint" resultMap="EmsPointMatchResult">
<include refid="selectEmsPointMatchVo"/>
where site_id = #{siteId}
and device_category = #{deviceCategory}
and data_point = #{dataPoint}
</select>
</mapper> </mapper>