fix:设备查询、使用记录增加字段
This commit is contained in:
@@ -122,6 +122,14 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
|
|||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
public CommonResult<DeviceInfomationWithProductVO> getDeviceInfomation(@RequestParam("id") Long id) {
|
public CommonResult<DeviceInfomationWithProductVO> getDeviceInfomation(@RequestParam("id") Long id) {
|
||||||
DeviceInfomationWithProductVO deviceInfomation = deviceInfomationService.getDeviceWithProduct(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);
|
return success(deviceInfomation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,6 +151,19 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
|
|||||||
if(!ObjectUtils.isEmpty(deviceStatus))
|
if(!ObjectUtils.isEmpty(deviceStatus))
|
||||||
pageReqVO.setDeviceStatusJson(JSON.parseObject(deviceStatus));
|
pageReqVO.setDeviceStatusJson(JSON.parseObject(deviceStatus));
|
||||||
PageResult<DeviceInfomationWithProductVO> pageResult = deviceInfomationService.getDeviceInfomationPage(pageReqVO);
|
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);
|
return success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -44,5 +45,10 @@ public class DeviceInfomationWithProductVO extends DeviceInfomationRespVO{
|
|||||||
@Schema(description = "制造商")
|
@Schema(description = "制造商")
|
||||||
private String manufacturer;
|
private String manufacturer;
|
||||||
|
|
||||||
|
@Schema(description = "其他配置")
|
||||||
|
private String customConfig;
|
||||||
|
|
||||||
|
@Schema(description = "其他配置json")
|
||||||
|
private JSONObject customConfigJson;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ public class DeviceUseRecordPageReqVO extends PageParam {
|
|||||||
@Schema(description = "使用记录")
|
@Schema(description = "使用记录")
|
||||||
private String useRemark;
|
private String useRemark;
|
||||||
|
|
||||||
|
@Schema(description = "检测项目")
|
||||||
|
private String useItem;
|
||||||
|
|
||||||
@Schema(description = "使用前状态")
|
@Schema(description = "使用前状态")
|
||||||
private String stateBefore;
|
private String stateBefore;
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ public class DeviceUseRecordRespVO {
|
|||||||
@ExcelProperty("使用记录")
|
@ExcelProperty("使用记录")
|
||||||
private String useRemark;
|
private String useRemark;
|
||||||
|
|
||||||
|
@Schema(description = "检测项目")
|
||||||
|
@ExcelProperty("检测项目")
|
||||||
|
private String useItem;
|
||||||
|
|
||||||
@Schema(description = "使用前状态")
|
@Schema(description = "使用前状态")
|
||||||
@ExcelProperty("使用前状态")
|
@ExcelProperty("使用前状态")
|
||||||
private String stateBefore;
|
private String stateBefore;
|
||||||
|
|||||||
@@ -35,6 +35,9 @@ public class DeviceUseRecordSaveReqVO {
|
|||||||
@Schema(description = "使用记录")
|
@Schema(description = "使用记录")
|
||||||
private String useRemark;
|
private String useRemark;
|
||||||
|
|
||||||
|
@Schema(description = "检测项目")
|
||||||
|
private String useItem;
|
||||||
|
|
||||||
@Schema(description = "使用前状态")
|
@Schema(description = "使用前状态")
|
||||||
private String stateBefore;
|
private String stateBefore;
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ public class DeviceUseRecordDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("USE_RMK")
|
@TableField("USE_RMK")
|
||||||
private String useRemark;
|
private String useRemark;
|
||||||
|
/**
|
||||||
|
* 检测项目
|
||||||
|
*/
|
||||||
|
@TableField("USE_ITM")
|
||||||
|
private String useItem;
|
||||||
/**
|
/**
|
||||||
* 使用前状态
|
* 使用前状态
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -59,13 +59,15 @@
|
|||||||
<result property="manufacturer" column="MFR"/>
|
<result property="manufacturer" column="MFR"/>
|
||||||
<result property="specification" column="SPEC"/>
|
<result property="specification" column="SPEC"/>
|
||||||
<result property="modelNo" column="MDL_NO"/>
|
<result property="modelNo" column="MDL_NO"/>
|
||||||
|
<result property="customConfig" column="CST_CFG"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<select id="selectPage" resultMap="deviceMap">
|
<select id="selectPage" resultMap="deviceMap">
|
||||||
SELECT d.*,
|
SELECT d.*,
|
||||||
p.MFR,
|
p.MFR,
|
||||||
p.SPEC,
|
p.SPEC,
|
||||||
p.MDL_NO
|
p.MDL_NO,
|
||||||
|
p.CST_CFG
|
||||||
from
|
from
|
||||||
T_DEV_INF d
|
T_DEV_INF d
|
||||||
LEFT JOIN T_DEV_PDT p ON d.PDT_ID = p.ID
|
LEFT JOIN T_DEV_PDT p ON d.PDT_ID = p.ID
|
||||||
|
|||||||
Reference in New Issue
Block a user