zhczyx 1 day ago
parent
commit
9aff5eeaf6
  1. 46
      data-center-business-controller/src/main/resources/db/migration/V112__f10_journal_log_sendTs.sql
  2. 20
      data-center-business-controller/src/main/resources/db/migration/V113__idx_alert_history_search.sql
  3. 3
      data-center-business-controller/src/main/resources/db/migration/V114__building_alias.sql
  4. 3
      data-center-business-controller/src/main/resources/db/migration/V115__ap_ip_port.sql
  5. 42
      data-center-business-dao/src/main/resources/mappers/auto/ApGatewayMapper.xml
  6. 27
      data-center-business-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml
  7. 27
      data-center-business-dao/src/main/resources/mappers/auto/F10JournalLogMapper.xml
  8. 4
      data-center-business-dao/src/main/resources/mappers/ex/ApGatewayMapperExt.xml
  9. 1
      data-center-business-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml
  10. 7
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayAddParam.java
  11. 6
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayEditParam.java
  12. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/building/OptBuildingParams.java
  13. 68
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGateway.java
  14. 130
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGatewayExample.java
  15. 34
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java
  16. 70
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java
  17. 34
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLog.java
  18. 60
      data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLogExample.java
  19. 3
      data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/building/BuildingPageVO.java
  20. 2
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/AccountServiceImpl.java
  21. 4
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/ApGatewayServiceImpl.java
  22. 6
      data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/BuildingServiceImpl.java

46
data-center-business-controller/src/main/resources/db/migration/V112__f10_journal_log_sendTs.sql

@ -0,0 +1,46 @@
-- 1. 添加字段
ALTER TABLE f10_journal_log
ADD COLUMN send_timestamp bigint DEFAULT NULL COMMENT 'send_date+send_time的毫秒级时间戳'
AFTER receive_timestamp;
-- 2. 回填日本时间 -> UTC毫秒时间戳
UPDATE f10_journal_log
SET send_timestamp =
UNIX_TIMESTAMP(
CONVERT_TZ(
STR_TO_DATE(
CONCAT(send_date, send_time),
'%Y%m%d%H%i%s'
),
'Asia/Tokyo',
'+00:00'
)
) * 1000
WHERE send_date IS NOT NULL
AND send_time IS NOT NULL;
-- 3. 删除重复,保留id最大
DELETE t1
FROM f10_journal_log t1
JOIN f10_journal_log t2
ON t1.device_id = t2.device_id
AND t1.instruction_flag = t2.instruction_flag
AND t1.send_timestamp = t2.send_timestamp
AND t1.id < t2.id;
-- 4. 删除旧唯一索引
ALTER TABLE f10_journal_log
DROP INDEX uk_device_alarm_ts;
-- 5. 创建新唯一索引
ALTER TABLE f10_journal_log
ADD UNIQUE KEY uk_device_instruction_send_time
(
device_id,
instruction_flag,
send_timestamp
) USING BTREE;

20
data-center-business-controller/src/main/resources/db/migration/V113__idx_alert_history_search.sql

@ -0,0 +1,20 @@
-- 判断索引是否存在
SET @index_exists = (
SELECT COUNT(*)
FROM information_schema.statistics
WHERE table_schema = DATABASE()
AND table_name = 'alert_history'
AND index_name = 'idx_alert_history_search'
);
-- 根据判断结果生成 SQL
SET @sql = IF(
@index_exists = 0,
'CREATE INDEX idx_alert_history_search ON alert_history (block_flag, source_type, handle_status)',
'SELECT "Index idx_alert_history_search already exists." AS message'
);
-- 执行 SQL
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

3
data-center-business-controller/src/main/resources/db/migration/V114__building_alias.sql

@ -0,0 +1,3 @@
ALTER TABLE `basic_building` add `alias` varchar(255) DEFAULT NULL COMMENT '别名';
update basic_building set alias = name;

3
data-center-business-controller/src/main/resources/db/migration/V115__ap_ip_port.sql

@ -0,0 +1,3 @@
ALTER TABLE `ap_gateway`
ADD `ip` varchar(255) DEFAULT NULL COMMENT 'ip',
ADD `port` int(6) DEFAULT NULL COMMENT '端口';

42
data-center-business-dao/src/main/resources/mappers/auto/ApGatewayMapper.xml

@ -24,6 +24,8 @@
<result column="downlink_id" jdbcType="VARCHAR" property="downlinkId" />
<result column="auth_user_id" jdbcType="VARCHAR" property="authUserId" />
<result column="auth_pwd" jdbcType="VARCHAR" property="authPwd" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="port" jdbcType="INTEGER" property="port" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
@ -98,7 +100,7 @@
-->
ap_gateway_id, model, imei, mac, create_ts, update_ts, address, gps, latest_heartbeat_ts,
online_status, battery, flag, company_id, offline_interval, ack_flag, downlink_id,
auth_user_id, auth_pwd
auth_user_id, auth_pwd, ip, port
</sql>
<select id="selectByExample" parameterType="com.techsor.datacenter.business.model.ApGatewayExample" resultMap="BaseResultMap">
<!--
@ -160,13 +162,15 @@
gps, latest_heartbeat_ts, online_status,
battery, flag, company_id,
offline_interval, ack_flag, downlink_id,
auth_user_id, auth_pwd)
auth_user_id, auth_pwd, ip,
port)
values (#{model,jdbcType=VARCHAR}, #{imei,jdbcType=VARCHAR}, #{mac,jdbcType=VARCHAR},
#{createTs,jdbcType=BIGINT}, #{updateTs,jdbcType=BIGINT}, #{address,jdbcType=VARCHAR},
#{gps,jdbcType=VARCHAR}, #{latestHeartbeatTs,jdbcType=BIGINT}, #{onlineStatus,jdbcType=INTEGER},
#{battery,jdbcType=DECIMAL}, #{flag,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT},
#{offlineInterval,jdbcType=INTEGER}, #{ackFlag,jdbcType=INTEGER}, #{downlinkId,jdbcType=VARCHAR},
#{authUserId,jdbcType=VARCHAR}, #{authPwd,jdbcType=VARCHAR})
#{authUserId,jdbcType=VARCHAR}, #{authPwd,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR},
#{port,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.ApGateway">
<!--
@ -229,6 +233,12 @@
<if test="authPwd != null">
auth_pwd,
</if>
<if test="ip != null">
ip,
</if>
<if test="port != null">
port,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="model != null">
@ -282,6 +292,12 @@
<if test="authPwd != null">
#{authPwd,jdbcType=VARCHAR},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="port != null">
#{port,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.techsor.datacenter.business.model.ApGatewayExample" resultType="java.lang.Long">
@ -355,6 +371,12 @@
<if test="record.authPwd != null">
auth_pwd = #{record.authPwd,jdbcType=VARCHAR},
</if>
<if test="record.ip != null">
ip = #{record.ip,jdbcType=VARCHAR},
</if>
<if test="record.port != null">
port = #{record.port,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -383,7 +405,9 @@
ack_flag = #{record.ackFlag,jdbcType=INTEGER},
downlink_id = #{record.downlinkId,jdbcType=VARCHAR},
auth_user_id = #{record.authUserId,jdbcType=VARCHAR},
auth_pwd = #{record.authPwd,jdbcType=VARCHAR}
auth_pwd = #{record.authPwd,jdbcType=VARCHAR},
ip = #{record.ip,jdbcType=VARCHAR},
port = #{record.port,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -446,6 +470,12 @@
<if test="authPwd != null">
auth_pwd = #{authPwd,jdbcType=VARCHAR},
</if>
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="port != null">
port = #{port,jdbcType=INTEGER},
</if>
</set>
where ap_gateway_id = #{apGatewayId,jdbcType=BIGINT}
</update>
@ -471,7 +501,9 @@
ack_flag = #{ackFlag,jdbcType=INTEGER},
downlink_id = #{downlinkId,jdbcType=VARCHAR},
auth_user_id = #{authUserId,jdbcType=VARCHAR},
auth_pwd = #{authPwd,jdbcType=VARCHAR}
auth_pwd = #{authPwd,jdbcType=VARCHAR},
ip = #{ip,jdbcType=VARCHAR},
port = #{port,jdbcType=INTEGER}
where ap_gateway_id = #{apGatewayId,jdbcType=BIGINT}
</update>
</mapper>

27
data-center-business-dao/src/main/resources/mappers/auto/BasicBuildingMapper.xml

@ -28,6 +28,7 @@
<result column="king_contract_no" jdbcType="VARCHAR" property="kingContractNo" />
<result column="kvm_url" jdbcType="VARCHAR" property="kvmUrl" />
<result column="camera_enabled" jdbcType="INTEGER" property="cameraEnabled" />
<result column="alias" jdbcType="VARCHAR" property="alias" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.techsor.datacenter.business.model.BasicBuilding">
<!--
@ -112,7 +113,7 @@
building_id, company_id, `name`, address, flag, create_time, creator_id, modify_time,
modifier_id, udf_building_id, building_bucket, thumbnail_num, show_switch_2d3d, brief_introduction,
latitude, longitude, retain_alert, salesforce_primary_id, site_manager, king_contract_no,
kvm_url, camera_enabled
kvm_url, camera_enabled, `alias`
</sql>
<sql id="Blob_Column_List">
<!--
@ -206,7 +207,7 @@
brief_introduction, latitude, longitude,
retain_alert, salesforce_primary_id, site_manager,
king_contract_no, kvm_url, camera_enabled,
floor_info_list, picture_introduction,
`alias`, floor_info_list, picture_introduction,
special_notes)
values (#{companyId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{flag,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{creatorId,jdbcType=BIGINT},
@ -215,7 +216,7 @@
#{briefIntroduction,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR},
#{retainAlert,jdbcType=INTEGER}, #{salesforcePrimaryId,jdbcType=BIGINT}, #{siteManager,jdbcType=VARCHAR},
#{kingContractNo,jdbcType=VARCHAR}, #{kvmUrl,jdbcType=VARCHAR}, #{cameraEnabled,jdbcType=INTEGER},
#{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR},
#{alias,jdbcType=VARCHAR}, #{floorInfoList,jdbcType=LONGVARCHAR}, #{pictureIntroduction,jdbcType=LONGVARCHAR},
#{specialNotes,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.BasicBuilding">
@ -291,6 +292,9 @@
<if test="cameraEnabled != null">
camera_enabled,
</if>
<if test="alias != null">
`alias`,
</if>
<if test="floorInfoList != null">
floor_info_list,
</if>
@ -365,6 +369,9 @@
<if test="cameraEnabled != null">
#{cameraEnabled,jdbcType=INTEGER},
</if>
<if test="alias != null">
#{alias,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
#{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -459,6 +466,9 @@
<if test="record.cameraEnabled != null">
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER},
</if>
<if test="record.alias != null">
`alias` = #{record.alias,jdbcType=VARCHAR},
</if>
<if test="record.floorInfoList != null">
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -501,6 +511,7 @@
king_contract_no = #{record.kingContractNo,jdbcType=VARCHAR},
kvm_url = #{record.kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER},
`alias` = #{record.alias,jdbcType=VARCHAR},
floor_info_list = #{record.floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{record.pictureIntroduction,jdbcType=LONGVARCHAR},
special_notes = #{record.specialNotes,jdbcType=LONGVARCHAR}
@ -535,7 +546,8 @@
site_manager = #{record.siteManager,jdbcType=VARCHAR},
king_contract_no = #{record.kingContractNo,jdbcType=VARCHAR},
kvm_url = #{record.kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER}
camera_enabled = #{record.cameraEnabled,jdbcType=INTEGER},
`alias` = #{record.alias,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -610,6 +622,9 @@
<if test="cameraEnabled != null">
camera_enabled = #{cameraEnabled,jdbcType=INTEGER},
</if>
<if test="alias != null">
`alias` = #{alias,jdbcType=VARCHAR},
</if>
<if test="floorInfoList != null">
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
</if>
@ -649,6 +664,7 @@
king_contract_no = #{kingContractNo,jdbcType=VARCHAR},
kvm_url = #{kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{cameraEnabled,jdbcType=INTEGER},
`alias` = #{alias,jdbcType=VARCHAR},
floor_info_list = #{floorInfoList,jdbcType=LONGVARCHAR},
picture_introduction = #{pictureIntroduction,jdbcType=LONGVARCHAR},
special_notes = #{specialNotes,jdbcType=LONGVARCHAR}
@ -680,7 +696,8 @@
site_manager = #{siteManager,jdbcType=VARCHAR},
king_contract_no = #{kingContractNo,jdbcType=VARCHAR},
kvm_url = #{kvmUrl,jdbcType=VARCHAR},
camera_enabled = #{cameraEnabled,jdbcType=INTEGER}
camera_enabled = #{cameraEnabled,jdbcType=INTEGER},
`alias` = #{alias,jdbcType=VARCHAR}
where building_id = #{buildingId,jdbcType=BIGINT}
</update>
</mapper>

27
data-center-business-dao/src/main/resources/mappers/auto/F10JournalLogMapper.xml

@ -49,6 +49,7 @@
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
<result column="receive_timestamp" jdbcType="BIGINT" property="receiveTimestamp" />
<result column="send_timestamp" jdbcType="BIGINT" property="sendTimestamp" />
<result column="expired_flag" jdbcType="INTEGER" property="expiredFlag" />
<result column="alert_history_id" jdbcType="BIGINT" property="alertHistoryId" />
</resultMap>
@ -137,7 +138,7 @@
phone, remark, display_color, error_reason, line_type, area_name, send_date, send_time,
customer_no, display_data1, display_data2, instruction_flag, signal_code, card_no,
card_type, mansion_building, mansion_room, option_field, created_at, created_time,
receive_timestamp, expired_flag, alert_history_id
receive_timestamp, send_timestamp, expired_flag, alert_history_id
</sql>
<sql id="Blob_Column_List">
<!--
@ -238,8 +239,8 @@
signal_code, card_no, card_type,
mansion_building, mansion_room, option_field,
created_at, created_time, receive_timestamp,
expired_flag, alert_history_id, raw_hex,
raw_text)
send_timestamp, expired_flag, alert_history_id,
raw_hex, raw_text)
values (#{deviceId,jdbcType=VARCHAR}, #{companyId,jdbcType=BIGINT}, #{serialNo,jdbcType=VARCHAR},
#{mode,jdbcType=VARCHAR}, #{signalSeq,jdbcType=VARCHAR}, #{receiveDate,jdbcType=VARCHAR},
#{receiveTime,jdbcType=VARCHAR}, #{channelNo,jdbcType=VARCHAR}, #{testFlag,jdbcType=VARCHAR},
@ -254,8 +255,8 @@
#{signalCode,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, #{cardType,jdbcType=VARCHAR},
#{mansionBuilding,jdbcType=VARCHAR}, #{mansionRoom,jdbcType=VARCHAR}, #{optionField,jdbcType=VARCHAR},
#{createdAt,jdbcType=BIGINT}, #{createdTime,jdbcType=TIMESTAMP}, #{receiveTimestamp,jdbcType=BIGINT},
#{expiredFlag,jdbcType=INTEGER}, #{alertHistoryId,jdbcType=BIGINT}, #{rawHex,jdbcType=LONGVARCHAR},
#{rawText,jdbcType=LONGVARCHAR})
#{sendTimestamp,jdbcType=BIGINT}, #{expiredFlag,jdbcType=INTEGER}, #{alertHistoryId,jdbcType=BIGINT},
#{rawHex,jdbcType=LONGVARCHAR}, #{rawText,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.techsor.datacenter.business.model.F10JournalLog">
<!--
@ -393,6 +394,9 @@
<if test="receiveTimestamp != null">
receive_timestamp,
</if>
<if test="sendTimestamp != null">
send_timestamp,
</if>
<if test="expiredFlag != null">
expired_flag,
</if>
@ -533,6 +537,9 @@
<if test="receiveTimestamp != null">
#{receiveTimestamp,jdbcType=BIGINT},
</if>
<if test="sendTimestamp != null">
#{sendTimestamp,jdbcType=BIGINT},
</if>
<if test="expiredFlag != null">
#{expiredFlag,jdbcType=INTEGER},
</if>
@ -693,6 +700,9 @@
<if test="record.receiveTimestamp != null">
receive_timestamp = #{record.receiveTimestamp,jdbcType=BIGINT},
</if>
<if test="record.sendTimestamp != null">
send_timestamp = #{record.sendTimestamp,jdbcType=BIGINT},
</if>
<if test="record.expiredFlag != null">
expired_flag = #{record.expiredFlag,jdbcType=INTEGER},
</if>
@ -759,6 +769,7 @@
created_at = #{record.createdAt,jdbcType=BIGINT},
created_time = #{record.createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{record.receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{record.sendTimestamp,jdbcType=BIGINT},
expired_flag = #{record.expiredFlag,jdbcType=INTEGER},
alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT},
raw_hex = #{record.rawHex,jdbcType=LONGVARCHAR},
@ -816,6 +827,7 @@
created_at = #{record.createdAt,jdbcType=BIGINT},
created_time = #{record.createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{record.receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{record.sendTimestamp,jdbcType=BIGINT},
expired_flag = #{record.expiredFlag,jdbcType=INTEGER},
alert_history_id = #{record.alertHistoryId,jdbcType=BIGINT}
<if test="_parameter != null">
@ -955,6 +967,9 @@
<if test="receiveTimestamp != null">
receive_timestamp = #{receiveTimestamp,jdbcType=BIGINT},
</if>
<if test="sendTimestamp != null">
send_timestamp = #{sendTimestamp,jdbcType=BIGINT},
</if>
<if test="expiredFlag != null">
expired_flag = #{expiredFlag,jdbcType=INTEGER},
</if>
@ -1018,6 +1033,7 @@
created_at = #{createdAt,jdbcType=BIGINT},
created_time = #{createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{sendTimestamp,jdbcType=BIGINT},
expired_flag = #{expiredFlag,jdbcType=INTEGER},
alert_history_id = #{alertHistoryId,jdbcType=BIGINT},
raw_hex = #{rawHex,jdbcType=LONGVARCHAR},
@ -1072,6 +1088,7 @@
created_at = #{createdAt,jdbcType=BIGINT},
created_time = #{createdTime,jdbcType=TIMESTAMP},
receive_timestamp = #{receiveTimestamp,jdbcType=BIGINT},
send_timestamp = #{sendTimestamp,jdbcType=BIGINT},
expired_flag = #{expiredFlag,jdbcType=INTEGER},
alert_history_id = #{alertHistoryId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}

4
data-center-business-dao/src/main/resources/mappers/ex/ApGatewayMapperExt.xml

@ -20,7 +20,9 @@
ack_flag as ackFlag,
flag as flag,
auth_user_id,
auth_pwd
auth_pwd,
ip,
port
from
ap_gateway
<where>

1
data-center-business-dao/src/main/resources/mappers/ex/BasicBuildingMapperExt.xml

@ -35,6 +35,7 @@
bcomp.company_name companyName,
bbuilding.name buildingName,
bbuilding.address,
bbuilding.alias,
bbuilding.udf_building_id udfBuildingId,
bbuilding.building_bucket,
bbuilding.floor_info_list,

7
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayAddParam.java

@ -38,6 +38,13 @@ public class ApGatewayAddParam {
private String authUserId;
@Schema(description ="auth password", example = "csdj")
private String authPwd;
@Schema(description ="ip", example = "124.7.8.99")
private String ip;
@Schema(description ="port", example = "111")
private Integer port;
// @Schema(description ="flag", example = "111")
// private Integer flag;
// @Schema(description ="online_status", example = "111")

6
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/apgateway/ApGatewayEditParam.java

@ -40,4 +40,10 @@ public class ApGatewayEditParam {
private String authUserId;
@Schema(description ="authUserId", example = "csdj")
private String authPwd;
@Schema(description ="ip", example = "124.7.8.99")
private String ip;
@Schema(description ="port", example = "111")
private Integer port;
}

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/dto/building/OptBuildingParams.java

@ -21,6 +21,9 @@ public class OptBuildingParams{
@Schema(description ="Building name", example = "testBuilding1", required = true)
private String buildingName;
@Schema(description ="Building alias", example = "testalias", required = false)
private String alias;
@Schema(description ="Address", example = "Abiko City, Japan", required = true)
private String address;

68
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGateway.java

@ -166,6 +166,24 @@ public class ApGateway implements Serializable {
*/
private String authPwd;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ap_gateway.ip
*
* @mbg.generated
*/
private String ip;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ap_gateway.port
*
* @mbg.generated
*/
private Integer port;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ap_gateway
@ -606,6 +624,54 @@ public class ApGateway implements Serializable {
this.authPwd = authPwd == null ? null : authPwd.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ap_gateway.ip
*
* @return the value of ap_gateway.ip
*
* @mbg.generated
*/
public String getIp() {
return ip;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column ap_gateway.ip
*
* @param ip the value for ap_gateway.ip
*
* @mbg.generated
*/
public void setIp(String ip) {
this.ip = ip == null ? null : ip.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column ap_gateway.port
*
* @return the value of ap_gateway.port
*
* @mbg.generated
*/
public Integer getPort() {
return port;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column ap_gateway.port
*
* @param port the value for ap_gateway.port
*
* @mbg.generated
*/
public void setPort(Integer port) {
this.port = port;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ap_gateway
@ -636,6 +702,8 @@ public class ApGateway implements Serializable {
sb.append(", downlinkId=").append(downlinkId);
sb.append(", authUserId=").append(authUserId);
sb.append(", authPwd=").append(authPwd);
sb.append(", ip=").append(ip);
sb.append(", port=").append(port);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();

130
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/ApGatewayExample.java

@ -1354,6 +1354,136 @@ public class ApGatewayExample {
addCriterion("auth_pwd not between", value1, value2, "authPwd");
return (Criteria) this;
}
public Criteria andIpIsNull() {
addCriterion("ip is null");
return (Criteria) this;
}
public Criteria andIpIsNotNull() {
addCriterion("ip is not null");
return (Criteria) this;
}
public Criteria andIpEqualTo(String value) {
addCriterion("ip =", value, "ip");
return (Criteria) this;
}
public Criteria andIpNotEqualTo(String value) {
addCriterion("ip <>", value, "ip");
return (Criteria) this;
}
public Criteria andIpGreaterThan(String value) {
addCriterion("ip >", value, "ip");
return (Criteria) this;
}
public Criteria andIpGreaterThanOrEqualTo(String value) {
addCriterion("ip >=", value, "ip");
return (Criteria) this;
}
public Criteria andIpLessThan(String value) {
addCriterion("ip <", value, "ip");
return (Criteria) this;
}
public Criteria andIpLessThanOrEqualTo(String value) {
addCriterion("ip <=", value, "ip");
return (Criteria) this;
}
public Criteria andIpLike(String value) {
addCriterion("ip like", value, "ip");
return (Criteria) this;
}
public Criteria andIpNotLike(String value) {
addCriterion("ip not like", value, "ip");
return (Criteria) this;
}
public Criteria andIpIn(List<String> values) {
addCriterion("ip in", values, "ip");
return (Criteria) this;
}
public Criteria andIpNotIn(List<String> values) {
addCriterion("ip not in", values, "ip");
return (Criteria) this;
}
public Criteria andIpBetween(String value1, String value2) {
addCriterion("ip between", value1, value2, "ip");
return (Criteria) this;
}
public Criteria andIpNotBetween(String value1, String value2) {
addCriterion("ip not between", value1, value2, "ip");
return (Criteria) this;
}
public Criteria andPortIsNull() {
addCriterion("port is null");
return (Criteria) this;
}
public Criteria andPortIsNotNull() {
addCriterion("port is not null");
return (Criteria) this;
}
public Criteria andPortEqualTo(Integer value) {
addCriterion("port =", value, "port");
return (Criteria) this;
}
public Criteria andPortNotEqualTo(Integer value) {
addCriterion("port <>", value, "port");
return (Criteria) this;
}
public Criteria andPortGreaterThan(Integer value) {
addCriterion("port >", value, "port");
return (Criteria) this;
}
public Criteria andPortGreaterThanOrEqualTo(Integer value) {
addCriterion("port >=", value, "port");
return (Criteria) this;
}
public Criteria andPortLessThan(Integer value) {
addCriterion("port <", value, "port");
return (Criteria) this;
}
public Criteria andPortLessThanOrEqualTo(Integer value) {
addCriterion("port <=", value, "port");
return (Criteria) this;
}
public Criteria andPortIn(List<Integer> values) {
addCriterion("port in", values, "port");
return (Criteria) this;
}
public Criteria andPortNotIn(List<Integer> values) {
addCriterion("port not in", values, "port");
return (Criteria) this;
}
public Criteria andPortBetween(Integer value1, Integer value2) {
addCriterion("port between", value1, value2, "port");
return (Criteria) this;
}
public Criteria andPortNotBetween(Integer value1, Integer value2) {
addCriterion("port not between", value1, value2, "port");
return (Criteria) this;
}
}
/**

34
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuilding.java

@ -201,6 +201,15 @@ public class BasicBuilding implements Serializable {
*/
private Integer cameraEnabled;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column basic_building.alias
*
* @mbg.generated
*/
private String alias;
/**
*
* This field was generated by MyBatis Generator.
@ -764,6 +773,30 @@ public class BasicBuilding implements Serializable {
this.cameraEnabled = cameraEnabled;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.alias
*
* @return the value of basic_building.alias
*
* @mbg.generated
*/
public String getAlias() {
return alias;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column basic_building.alias
*
* @param alias the value for basic_building.alias
*
* @mbg.generated
*/
public void setAlias(String alias) {
this.alias = alias == null ? null : alias.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column basic_building.floor_info_list
@ -870,6 +903,7 @@ public class BasicBuilding implements Serializable {
sb.append(", kingContractNo=").append(kingContractNo);
sb.append(", kvmUrl=").append(kvmUrl);
sb.append(", cameraEnabled=").append(cameraEnabled);
sb.append(", alias=").append(alias);
sb.append(", floorInfoList=").append(floorInfoList);
sb.append(", pictureIntroduction=").append(pictureIntroduction);
sb.append(", specialNotes=").append(specialNotes);

70
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/BasicBuildingExample.java

@ -1613,6 +1613,76 @@ public class BasicBuildingExample {
addCriterion("camera_enabled not between", value1, value2, "cameraEnabled");
return (Criteria) this;
}
public Criteria andAliasIsNull() {
addCriterion("`alias` is null");
return (Criteria) this;
}
public Criteria andAliasIsNotNull() {
addCriterion("`alias` is not null");
return (Criteria) this;
}
public Criteria andAliasEqualTo(String value) {
addCriterion("`alias` =", value, "alias");
return (Criteria) this;
}
public Criteria andAliasNotEqualTo(String value) {
addCriterion("`alias` <>", value, "alias");
return (Criteria) this;
}
public Criteria andAliasGreaterThan(String value) {
addCriterion("`alias` >", value, "alias");
return (Criteria) this;
}
public Criteria andAliasGreaterThanOrEqualTo(String value) {
addCriterion("`alias` >=", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLessThan(String value) {
addCriterion("`alias` <", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLessThanOrEqualTo(String value) {
addCriterion("`alias` <=", value, "alias");
return (Criteria) this;
}
public Criteria andAliasLike(String value) {
addCriterion("`alias` like", value, "alias");
return (Criteria) this;
}
public Criteria andAliasNotLike(String value) {
addCriterion("`alias` not like", value, "alias");
return (Criteria) this;
}
public Criteria andAliasIn(List<String> values) {
addCriterion("`alias` in", values, "alias");
return (Criteria) this;
}
public Criteria andAliasNotIn(List<String> values) {
addCriterion("`alias` not in", values, "alias");
return (Criteria) this;
}
public Criteria andAliasBetween(String value1, String value2) {
addCriterion("`alias` between", value1, value2, "alias");
return (Criteria) this;
}
public Criteria andAliasNotBetween(String value1, String value2) {
addCriterion("`alias` not between", value1, value2, "alias");
return (Criteria) this;
}
}
/**

34
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLog.java

@ -391,6 +391,15 @@ public class F10JournalLog implements Serializable {
*/
private Long receiveTimestamp;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column f10_journal_log.send_timestamp
*
* @mbg.generated
*/
private Long sendTimestamp;
/**
*
* This field was generated by MyBatis Generator.
@ -1467,6 +1476,30 @@ public class F10JournalLog implements Serializable {
this.receiveTimestamp = receiveTimestamp;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column f10_journal_log.send_timestamp
*
* @return the value of f10_journal_log.send_timestamp
*
* @mbg.generated
*/
public Long getSendTimestamp() {
return sendTimestamp;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column f10_journal_log.send_timestamp
*
* @param sendTimestamp the value for f10_journal_log.send_timestamp
*
* @mbg.generated
*/
public void setSendTimestamp(Long sendTimestamp) {
this.sendTimestamp = sendTimestamp;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column f10_journal_log.expired_flag
@ -1618,6 +1651,7 @@ public class F10JournalLog implements Serializable {
sb.append(", createdAt=").append(createdAt);
sb.append(", createdTime=").append(createdTime);
sb.append(", receiveTimestamp=").append(receiveTimestamp);
sb.append(", sendTimestamp=").append(sendTimestamp);
sb.append(", expiredFlag=").append(expiredFlag);
sb.append(", alertHistoryId=").append(alertHistoryId);
sb.append(", rawHex=").append(rawHex);

60
data-center-business-model/src/main/java/com/techsor/datacenter/business/model/F10JournalLogExample.java

@ -3155,6 +3155,66 @@ public class F10JournalLogExample {
return (Criteria) this;
}
public Criteria andSendTimestampIsNull() {
addCriterion("send_timestamp is null");
return (Criteria) this;
}
public Criteria andSendTimestampIsNotNull() {
addCriterion("send_timestamp is not null");
return (Criteria) this;
}
public Criteria andSendTimestampEqualTo(Long value) {
addCriterion("send_timestamp =", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampNotEqualTo(Long value) {
addCriterion("send_timestamp <>", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampGreaterThan(Long value) {
addCriterion("send_timestamp >", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampGreaterThanOrEqualTo(Long value) {
addCriterion("send_timestamp >=", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampLessThan(Long value) {
addCriterion("send_timestamp <", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampLessThanOrEqualTo(Long value) {
addCriterion("send_timestamp <=", value, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampIn(List<Long> values) {
addCriterion("send_timestamp in", values, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampNotIn(List<Long> values) {
addCriterion("send_timestamp not in", values, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampBetween(Long value1, Long value2) {
addCriterion("send_timestamp between", value1, value2, "sendTimestamp");
return (Criteria) this;
}
public Criteria andSendTimestampNotBetween(Long value1, Long value2) {
addCriterion("send_timestamp not between", value1, value2, "sendTimestamp");
return (Criteria) this;
}
public Criteria andExpiredFlagIsNull() {
addCriterion("expired_flag is null");
return (Criteria) this;

3
data-center-business-model/src/main/java/com/techsor/datacenter/business/vo/building/BuildingPageVO.java

@ -26,6 +26,9 @@ public class BuildingPageVO{
@Schema(description = "Building name", example = "testBuilding1", required = true)
private String buildingName;
@Schema(description ="Building alias", example = "testalias", required = false)
private String alias;
@Schema(description = "Address", example = "日本我孙子市", required = true)
private String address;

2
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/AccountServiceImpl.java

@ -253,7 +253,7 @@ public class AccountServiceImpl implements AccountService {
Map<String, DashboardTreeMenusDTO> allMenuMap = allMenus.stream()
.collect(Collectors.toMap(DashboardTreeMenusDTO::getMenuId, m -> m));
// 🔥 提前构建 parent -> children 映射(性能优化)
// 提前构建 parent -> children 映射(性能优化)
Map<String, List<DashboardTreeMenusDTO>> childrenMap = new HashMap<>();
for (DashboardTreeMenusDTO menu : allMenus) {
childrenMap

4
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/ApGatewayServiceImpl.java

@ -114,6 +114,8 @@ public class ApGatewayServiceImpl implements ApGatewayService {
} else {
insertObj.setAuthPwd(param.getAuthPwd());
}
insertObj.setIp(param.getIp());
insertObj.setPort(param.getPort());
this.apGatewayMapperExt.insert(insertObj);
@ -173,6 +175,8 @@ public class ApGatewayServiceImpl implements ApGatewayService {
} else {
insertObj.setAuthPwd(param.getAuthPwd());
}
insertObj.setIp(param.getIp());
insertObj.setPort(param.getPort());
//Verify if the imei is dumplicate
ApGatewayExample dumpCheckExample = new ApGatewayExample();

6
data-center-business-service/src/main/java/com/techsor/datacenter/business/service/impl/BuildingServiceImpl.java

@ -138,6 +138,9 @@ public class BuildingServiceImpl implements BuildingService {
if (CollectionUtils.isNotEmpty(optBuildingParams.getFloorInfoList())) {
basicBuilding.setFloorInfoList(JSON.toJSONString(optBuildingParams.getFloorInfoList()));;
}
if (StringUtils.isBlank(optBuildingParams.getAlias())) {
basicBuilding.setAlias(optBuildingParams.getBuildingName());
}
String storageS3PathImage = Constants.S3_PDF_IAMGE_PATH + optBuildingParams.getUdfBuildingId()+ "/images/";
if (pictureIntroduction != null && !pictureIntroduction.isEmpty()) {
@ -311,6 +314,9 @@ public class BuildingServiceImpl implements BuildingService {
if (StringUtils.isBlank(optBuildingParams.getKvmUrl())) {
basicBuilding.setKvmUrl("");
}
if (StringUtils.isBlank(optBuildingParams.getAlias())) {
basicBuilding.setAlias(optBuildingParams.getBuildingName());
}
BasicBuildingExample example = new BasicBuildingExample();
BasicBuildingExample.Criteria criteria = example.createCriteria();

Loading…
Cancel
Save