提交 execl导出解析 及 告警处理增加负责人
This commit is contained in:
@@ -93,7 +93,7 @@ public class DutyRecordController extends BaseController
|
||||
/**
|
||||
* 新增交班记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('itsm:dutyRecord:add')")
|
||||
// @PreAuthorize("@ss.hasPermi('itsm:dutyRecord:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增交班记录")
|
||||
public AjaxResult add(@RequestBody DutyRecord dutyRecord)
|
||||
@@ -106,7 +106,7 @@ public class DutyRecordController extends BaseController
|
||||
/**
|
||||
* 修改交班记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('itsm:dutyRecord:edit')")
|
||||
// @PreAuthorize("@ss.hasPermi('itsm:dutyRecord:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改交班记录")
|
||||
public AjaxResult edit(@RequestBody DutyRecord dutyRecord)
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PubDocController extends BaseController
|
||||
/**
|
||||
* 查询公共档案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:pubDoc:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('iot:pubDoc:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询公共档案列表")
|
||||
public TableDataInfo list(PubDoc pubDoc)
|
||||
|
||||
@@ -5,8 +5,8 @@ spring:
|
||||
timeout: 10000
|
||||
# 以下为单机配置
|
||||
# [必须修改] Redis服务器IP, REDIS安装在本机的,使用127.0.0.1
|
||||
# host: 127.0.0.1
|
||||
host: redis
|
||||
host: 127.0.0.1
|
||||
# host: redis
|
||||
# [必须修改] 端口号
|
||||
port: 6379
|
||||
# [可选] 数据库 DB
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.xinda.iot.convert;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
/**
|
||||
* 告警详情JSON转换器
|
||||
*/
|
||||
public class AlertDetailConverter {
|
||||
|
||||
/**
|
||||
* 转换JSON字符串为指定格式
|
||||
* @param jsonStr JSON字符串
|
||||
* @return 格式化后的字符串
|
||||
*/
|
||||
public static String convert(String jsonStr) {
|
||||
if (jsonStr == null || jsonStr.trim().isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
||||
String id = jsonObject.getString("id");
|
||||
String value = jsonObject.getString("value");
|
||||
String remark = jsonObject.getString("remark");
|
||||
|
||||
// 处理null值
|
||||
id = (id == null) ? "" : id;
|
||||
value = (value == null) ? "" : value;
|
||||
remark = (remark == null) ? "" : remark;
|
||||
|
||||
return String.format("ID名称:%s,变量值:%s,备注:%s", id, value, remark);
|
||||
} catch (Exception e) {
|
||||
// 解析失败时返回原始字符串
|
||||
return jsonStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xinda.iot.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.xinda.iot.convert.AlertDetailConverter;
|
||||
import com.xinda.itsm.domain.RepairOrder;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -55,8 +56,22 @@ public class AlertLog extends BaseEntity
|
||||
|
||||
/** 告警详情 */
|
||||
@ApiModelProperty("告警详情")
|
||||
// @Excel(name = "告警值")
|
||||
private String detail;
|
||||
|
||||
/** 用于Excel导出的告警详情(转换后) */
|
||||
@Excel(name = "告警值")
|
||||
private String excelDetail;
|
||||
// 在setDetail时同步设置转换后的值
|
||||
public void setDetail(String detail) {
|
||||
this.detail = detail;
|
||||
this.excelDetail = AlertDetailConverter.convert(detail);
|
||||
}
|
||||
// 添加一个用于Excel导出的转换方法
|
||||
public String getExcelDetail() {
|
||||
return AlertDetailConverter.convert(detail);
|
||||
}
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Integer enable;
|
||||
|
||||
@@ -51,6 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productId != null "> and al.product_id = #{productId}</if>
|
||||
<if test="serialNumber != null "> and al.serial_number = #{serialNumber}</if>
|
||||
<if test="userId != null "> and al.user_id = #{userId}</if>
|
||||
<if test="deviceId != null "> and al.device_id = #{deviceId}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and al.device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="createBy != null "> and al.create_by = #{createBy}</if>
|
||||
<if test="remark != null "> and al.remark = #{remark}</if>
|
||||
<if test="respPersonId != null "> and al.resp_person_id = #{respPersonId}</if>
|
||||
@@ -252,7 +254,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="enable != null">enable =#{enable},</if>
|
||||
<if test="orderId != null">orderId =#{orderId},</if>
|
||||
<if test="respPersonId != null">resp_person_id =#{respPersonId},</if>
|
||||
<if test="procPersonName != null and procPersonName != ''">proc_person_name,</if>
|
||||
<if test="procPersonName != null and procPersonName != ''">proc_person_name =#{procPersonName},</if>
|
||||
</trim>
|
||||
where alert_log_id = #{alertLogId}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user