Browse Source

提交地磅计量初始化

chenxiaofei 4 tháng trước cách đây
mục cha
commit
9dd7cdacd4

+ 77 - 0
iot-platform-manager/src/main/java/com/platform/entity/WeighbridgeRecord.java

@@ -0,0 +1,77 @@
+package com.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * 地磅过磅记录表实体类
+ *
+ * @author Auto Generated
+ */
+@Data
+@TableName("weighbridge_records")
+public class WeighbridgeRecord {
+
+    /**
+     * 主键ID
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 地磅名称
+     */
+    @TableField("weighbridge_name")
+    private String weighbridgeName;
+
+    /**
+     * 地磅编码
+     */
+    @TableField("weighbridge_code")
+    private String weighbridgeCode;
+
+    /**
+     * 车牌号
+     */
+    @TableField("license_plate")
+    private String licensePlate;
+
+    /**
+     * 重量(吨)
+     */
+    @TableField("weight")
+    private BigDecimal weight;
+
+    /**
+     * 过磅时间
+     */
+    @TableField("weigh_time")
+    private LocalDateTime weighTime;
+
+    /**
+     * 过磅照片,存储图片 URL 数组
+     */
+    @TableField("photo_urls")
+    private String photoUrls;
+
+    /**
+     * 处理标签,用于指定处理方向
+     */
+    @TableField("tag")
+    private String tag;
+
+    /**
+     * 记录创建时间
+     */
+    @TableField(value = "created_at")
+    private LocalDateTime createdAt;
+
+    /**
+     * 记录更新时间
+     */
+    @TableField(value = "updated_at")
+    private LocalDateTime updatedAt;
+}

+ 15 - 0
iot-platform-manager/src/main/java/com/platform/mapper/WeighbridgeRecordMapper.java

@@ -0,0 +1,15 @@
+package com.platform.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.platform.entity.WeighbridgeRecord;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * @Author: Auto Generated
+ * @CreateTime: 2026-01-21
+ * @Description: 地磅过磅记录Mapper接口
+ * @Version: 1.0
+ */
+@Mapper
+public interface WeighbridgeRecordMapper extends BaseMapper<WeighbridgeRecord> {
+}

+ 13 - 0
iot-platform-manager/src/main/java/com/platform/service/WeighbridgeRecordService.java

@@ -0,0 +1,13 @@
+package com.platform.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.platform.entity.WeighbridgeRecord;
+
+/**
+ * @Author: Auto Generated
+ * @CreateTime: 2026-01-21
+ * @Description: 地磅过磅记录Service接口
+ * @Version: 1.0
+ */
+public interface WeighbridgeRecordService extends IService<WeighbridgeRecord> {
+}

+ 17 - 0
iot-platform-manager/src/main/java/com/platform/service/impl/WeighbridgeRecordServiceImpl.java

@@ -0,0 +1,17 @@
+package com.platform.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.platform.entity.WeighbridgeRecord;
+import com.platform.mapper.WeighbridgeRecordMapper;
+import com.platform.service.WeighbridgeRecordService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @Author: Auto Generated
+ * @CreateTime: 2026-01-21
+ * @Description: 地磅过磅记录Service实现类
+ * @Version: 1.0
+ */
+@Service
+public class WeighbridgeRecordServiceImpl extends ServiceImpl<WeighbridgeRecordMapper, WeighbridgeRecord> implements WeighbridgeRecordService {
+}

+ 16 - 0
sql/2026/01/create_cxf.sql

@@ -0,0 +1,16 @@
+CREATE TABLE weighbridge_records (
+                                     `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键ID',
+                                     weighbridge_name VARCHAR(50) NOT NULL DEFAULT '' COMMENT '地磅名称',
+                                     weighbridge_code VARCHAR(20) NOT NULL DEFAULT '' COMMENT '地磅编码',
+                                     license_plate VARCHAR(20) NOT NULL DEFAULT '' COMMENT '车牌号',
+                                     weight DECIMAL(10,2) NOT NULL DEFAULT 0.00 COMMENT '重量(吨)',
+                                     weigh_time DATETIME NOT NULL DEFAULT '1000-01-01 00:00:00' COMMENT '过磅时间',
+                                     photo_urls JSON DEFAULT JSON_ARRAY() COMMENT '过磅照片,存储图片 URL 数组',
+                                     tag VARCHAR(255) NOT NULL DEFAULT '' COMMENT '处理标签,用于指定处理方向',
+                                     created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT '记录创建时间',
+                                     updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '记录更新时间',
+                                     PRIMARY KEY (`id`),
+                                     KEY `idx_weighbridge_code` (`weighbridge_code`),
+                                     KEY `idx_weighbridge_name` (`weighbridge_name`),
+                                     KEY `idx_license_plate` (`license_plate`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='地磅过磅记录表';