fix:设备查询、使用记录增加字段

This commit is contained in:
FCL
2026-03-04 15:39:46 +08:00
parent 11d1deff3b
commit 787a6c12a0
7 changed files with 45 additions and 1 deletions

View File

@@ -122,6 +122,14 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<DeviceInfomationWithProductVO> getDeviceInfomation(@RequestParam("id") Long id) {
DeviceInfomationWithProductVO deviceInfomation = deviceInfomationService.getDeviceWithProduct(id);
String customConfig = deviceInfomation.getCustomConfig();
if(!ObjectUtils.isEmpty(customConfig)){
try{
deviceInfomation.setCustomConfigJson(JSON.parseObject(customConfig));
}catch (Exception e){
e.printStackTrace();
}
}
return success(deviceInfomation);
}
@@ -143,6 +151,19 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
if(!ObjectUtils.isEmpty(deviceStatus))
pageReqVO.setDeviceStatusJson(JSON.parseObject(deviceStatus));
PageResult<DeviceInfomationWithProductVO> pageResult = deviceInfomationService.getDeviceInfomationPage(pageReqVO);
List<DeviceInfomationWithProductVO> list = pageResult.getList();
for(DeviceInfomationWithProductVO vo : list){
String customConfig = vo.getCustomConfig();
if(!ObjectUtils.isEmpty(customConfig)){
try{
vo.setCustomConfigJson(JSON.parseObject(customConfig));
}catch (Exception e){
e.printStackTrace();
}
}
}
return success(pageResult);
}

View File

@@ -1,6 +1,7 @@
package com.zt.plat.module.qms.resource.device.controller.vo;
import com.alibaba.fastjson.JSONObject;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@@ -44,5 +45,10 @@ public class DeviceInfomationWithProductVO extends DeviceInfomationRespVO{
@Schema(description = "制造商")
private String manufacturer;
@Schema(description = "其他配置")
private String customConfig;
@Schema(description = "其他配置json")
private JSONObject customConfigJson;
}

View File

@@ -33,6 +33,9 @@ public class DeviceUseRecordPageReqVO extends PageParam {
@Schema(description = "使用记录")
private String useRemark;
@Schema(description = "检测项目")
private String useItem;
@Schema(description = "使用前状态")
private String stateBefore;

View File

@@ -40,6 +40,10 @@ public class DeviceUseRecordRespVO {
@ExcelProperty("使用记录")
private String useRemark;
@Schema(description = "检测项目")
@ExcelProperty("检测项目")
private String useItem;
@Schema(description = "使用前状态")
@ExcelProperty("使用前状态")
private String stateBefore;

View File

@@ -35,6 +35,9 @@ public class DeviceUseRecordSaveReqVO {
@Schema(description = "使用记录")
private String useRemark;
@Schema(description = "检测项目")
private String useItem;
@Schema(description = "使用前状态")
private String stateBefore;

View File

@@ -61,6 +61,11 @@ public class DeviceUseRecordDO extends BusinessBaseDO {
*/
@TableField("USE_RMK")
private String useRemark;
/**
* 检测项目
*/
@TableField("USE_ITM")
private String useItem;
/**
* 使用前状态
*/

View File

@@ -59,13 +59,15 @@
<result property="manufacturer" column="MFR"/>
<result property="specification" column="SPEC"/>
<result property="modelNo" column="MDL_NO"/>
<result property="customConfig" column="CST_CFG"/>
</resultMap>
<select id="selectPage" resultMap="deviceMap">
SELECT d.*,
p.MFR,
p.SPEC,
p.MDL_NO
p.MDL_NO,
p.CST_CFG
from
T_DEV_INF d
LEFT JOIN T_DEV_PDT p ON d.PDT_ID = p.ID