4.17冲刺记录
今日进一步完善设备台账的数据模型,对各台账的字段进行精细化调整,确保能够准确记录设备从采购到报废全生命周期的各类信息。同时,启动后端接口开发工作,基于 Spring Boot 框架,搭建了设备信息新增、基础查询功能的接口框架。在代码编写过程中,遇到不同台账数据结构差异导致接口复用性差的问题,通过抽象出通用的设备信息接口,再针对各台账特殊需求进行扩展,成功解决该问题。
此外,在定义接口参数时,由于需求理解偏差,部分参数未能准确反映业务逻辑,经过与产品经理再次确认需求,重新调整参数设计。目前,设备信息新增接口已完成初步功能开发,明日将继续完善设备查询接口,并着手开发前端页面的数据展示功能。
package com.example.devicemanagesystem.entity;
import lombok.Data;
import java.util.Date;
@Data
public class Device {
private Long id;
private String deviceCode;
private String deviceName;
private String deviceType;
private Date purchaseDate;
private Integer warrantyPeriod;
private String manufacturer;
private String model;
private String status;
private String location;
private String maintenanceType;
private Date createdAt;
private Date updatedAt;
public Device() {
}
public Device(Long id, String deviceCode, String deviceName, String deviceType, Date purchaseDate, Integer warrantyPeriod, String manufacturer, String model, String status, String location, String maintenanceType, Date createdAt, Date updatedAt) {
this.id = id;
this.deviceCode = deviceCode;
this.deviceName = deviceName;
this.deviceType = deviceType;
this.purchaseDate = purchaseDate;
this.warrantyPeriod = warrantyPeriod;
this.manufacturer = manufacturer;
this.model = model;
this.status = status;
this.location = location;
this.maintenanceType = maintenanceType;
this.createdAt = createdAt;
this.updatedAt = updatedAt;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(String deviceCode) {
this.deviceCode = deviceCode;
}
public String getDeviceName() {
return deviceName;
}
public void setDeviceName(String deviceName) {
this.deviceName = deviceName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Date getPurchaseDate() {
return purchaseDate;
}
public void setPurchaseDate(Date purchaseDate) {
this.purchaseDate = purchaseDate;
}
public Integer getWarrantyPeriod() {
return warrantyPeriod;
}
public void setWarrantyPeriod(Integer warrantyPeriod) {
this.warrantyPeriod = warrantyPeriod;
}
public String getManufacturer() {
return manufacturer;
}
public void setManufacturer(String manufacturer) {
this.manufacturer = manufacturer;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getMaintenanceType() {
return maintenanceType;
}
public void setMaintenanceType(String maintenanceType) {
this.maintenanceType = maintenanceType;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
}
package com.example.devicemanagesystem.entity;
import lombok.Data;
@Data
public class CustomerServiceDevice {
private Long id;
private Long deviceId;
private String serviceType;
private String serviceScope;
public CustomerServiceDevice() {
}
public CustomerServiceDevice(Long id, Long deviceId, String serviceType, String serviceScope) {
this.id = id;
this.deviceId = deviceId;
this.serviceType = serviceType;
this.serviceScope = serviceScope;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDeviceId() {
return deviceId;
}
public void setDeviceId(Long deviceId) {
this.deviceId = deviceId;
}
public String getServiceType() {
return serviceType;
}
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
public String getServiceScope() {
return serviceScope;
}
public void setServiceScope(String serviceScope) {
this.serviceScope = serviceScope;
}
}
package com.example.devicemanagesystem.entity;
import lombok.Data;
import java.util.Date;
@Data
public class FireFightingDevice {
private Long id;
private Integer inspectionCycle;
private Date lastInspectionDate;
private Date nextInspectionDate;
public FireFightingDevice() {
}
public FireFightingDevice(Long id, Integer inspectionCycle, Date lastInspectionDate, Date nextInspectionDate) {
this.id = id;
this.inspectionCycle = inspectionCycle;
this.lastInspectionDate = lastInspectionDate;
this.nextInspectionDate = nextInspectionDate;
}
// 省略 getters 和 setters
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getInspectionCycle() {
return inspectionCycle;
}
public void setInspectionCycle(Integer inspectionCycle) {
this.inspectionCycle = inspectionCycle;
}
public Date getLastInspectionDate() {
return lastInspectionDate;
}
public void setLastInspectionDate(Date lastInspectionDate) {
this.lastInspectionDate = lastInspectionDate;
}
public Date getNextInspectionDate() {
return nextInspectionDate;
}
public void setNextInspectionDate(Date nextInspectionDate) {
this.nextInspectionDate = nextInspectionDate;
}
}

浙公网安备 33010602011771号