dev #4

Merged
dashixiong merged 11 commits from dev into main 2026-04-09 01:32:13 +00:00
88 changed files with 9777 additions and 786 deletions
Showing only changes of commit 4e7d387edf - Show all commits

View File

@ -25,6 +25,10 @@ public class EmsSiteSetting extends BaseEntity
@Excel(name = "站点名称")
private String siteName;
/** 站点简称 */
@Excel(name = "站点简称")
private String siteShortName;
/** 站点地址 */
@Excel(name = "站点地址")
private String siteAddress;
@ -77,6 +81,16 @@ public class EmsSiteSetting extends BaseEntity
return siteName;
}
public void setSiteShortName(String siteShortName)
{
this.siteShortName = siteShortName;
}
public String getSiteShortName()
{
return siteShortName;
}
public void setSiteAddress(String siteAddress)
{
this.siteAddress = siteAddress;
@ -162,6 +176,7 @@ public class EmsSiteSetting extends BaseEntity
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("siteName", getSiteName())
.append("siteShortName", getSiteShortName())
.append("siteAddress", getSiteAddress())
.append("runningTime", getRunningTime())
.append("latitude", getLatitude())

View File

@ -135,6 +135,8 @@ public class DevicePointMatchDataProcessor {
return new HashMap<>();
}
return pointEnumMatchList.stream()
.filter(Objects::nonNull)
.filter(data -> StringUtils.isNotEmpty(data.getMatchField()))
.collect(Collectors.groupingBy(data -> StringUtils.toCamelCase(data.getMatchField())));
}
@ -237,8 +239,14 @@ public class DevicePointMatchDataProcessor {
* 转换字段值为配置枚举值
*/
public void convertFieldValueToEnumMatch(String siteId, String deviceCategory, Object entity) {
if (entity == null) {
return;
}
Map<String, List<EmsPointEnumMatch>> pointEnumMatchMap = this.getPointEnumMatchMap(siteId, deviceCategory);
if (pointEnumMatchMap == null || pointEnumMatchMap.isEmpty()) {
return;
}
Field[] fields = entity.getClass().getDeclaredFields();
for (Field field : fields) {
String fieldName = field.getName();
@ -252,7 +260,9 @@ public class DevicePointMatchDataProcessor {
if (CollectionUtils.isNotEmpty(pointEnumMatchList) && matchValue != null) {
String finalMatchValue = String.valueOf(matchValue).replace(".0", "");
Optional<EmsPointEnumMatch> enumMatch = pointEnumMatchList.stream()
.filter(data -> data.getDataEnumCode().equals(finalMatchValue)).findFirst();
.filter(Objects::nonNull)
.filter(data -> Objects.equals(data.getDataEnumCode(), finalMatchValue))
.findFirst();
if (enumMatch.isPresent()) {
matchValue = enumMatch.get().getEnumCode();
}

View File

@ -7,6 +7,7 @@
<resultMap type="EmsSiteSetting" id="EmsSiteSettingResult">
<result property="id" column="id" />
<result property="siteName" column="site_name" />
<result property="siteShortName" column="site_short_name" />
<result property="siteAddress" column="site_address" />
<result property="runningTime" column="running_time" />
<result property="latitude" column="latitude" />
@ -22,13 +23,14 @@
</resultMap>
<sql id="selectEmsSiteSettingVo">
select id, site_name, site_address, running_time, latitude, longitude, install_capacity, install_power, remark, create_by, update_by, create_time, update_time, site_id from ems_site_setting
select id, site_name, site_short_name, site_address, running_time, latitude, longitude, install_capacity, install_power, remark, create_by, update_by, create_time, update_time, site_id from ems_site_setting
</sql>
<select id="selectEmsSiteSettingList" parameterType="EmsSiteSetting" resultMap="EmsSiteSettingResult">
<include refid="selectEmsSiteSettingVo"/>
<where>
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
<if test="siteShortName != null and siteShortName != ''"> and site_short_name like concat('%', #{siteShortName}, '%')</if>
<if test="siteAddress != null and siteAddress != ''"> and site_address = #{siteAddress}</if>
<if test="runningTime != null "> and running_time = #{runningTime}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
@ -48,6 +50,7 @@
insert into ems_site_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="siteName != null and siteName != ''">site_name,</if>
<if test="siteShortName != null">site_short_name,</if>
<if test="siteAddress != null">site_address,</if>
<if test="runningTime != null">running_time,</if>
<if test="latitude != null">latitude,</if>
@ -63,6 +66,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteName != null and siteName != ''">#{siteName},</if>
<if test="siteShortName != null">#{siteShortName},</if>
<if test="siteAddress != null">#{siteAddress},</if>
<if test="runningTime != null">#{runningTime},</if>
<if test="latitude != null">#{latitude},</if>
@ -82,6 +86,7 @@
update ems_site_setting
<trim prefix="SET" suffixOverrides=",">
<if test="siteName != null and siteName != ''">site_name = #{siteName},</if>
<if test="siteShortName != null">site_short_name = #{siteShortName},</if>
<if test="siteAddress != null">site_address = #{siteAddress},</if>
<if test="runningTime != null">running_time = #{runningTime},</if>
<if test="latitude != null">latitude = #{latitude},</if>