修改告警导出 新增公共档案
This commit is contained in:
@@ -27,7 +27,8 @@ public class AlertLog extends BaseEntity
|
||||
/** 告警ID */
|
||||
@ApiModelProperty("告警ID")
|
||||
private Long alertLogId;
|
||||
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
/** 告警名称 */
|
||||
@ApiModelProperty("告警名称")
|
||||
@Excel(name = "告警名称")
|
||||
@@ -35,17 +36,17 @@ public class AlertLog extends BaseEntity
|
||||
|
||||
/** 告警级别(1=提醒通知,2=轻微问题,3=严重警告,4=场景联动) */
|
||||
@ApiModelProperty("告警级别(1=提醒通知,2=轻微问题,3=严重警告,4=场景联动)")
|
||||
@Excel(name = "告警级别", readConverterExp = "1==提醒通知,2=轻微问题,3=严重警告,4=场景联动")
|
||||
private Long alertLevel;
|
||||
@Excel(name = "告警级别", readConverterExp = "1=提醒通知,2=轻微问题,3=严重警告,4=场景联动")
|
||||
private String alertLevel;
|
||||
|
||||
/** 处理状态(1=不需要处理,2=未处理,3=已处理) */
|
||||
@ApiModelProperty("处理状态(1=不需要处理,2=未处理,3=已处理)")
|
||||
@Excel(name = "处理状态(1=不需要处理,2=未处理,3=已处理)")
|
||||
private Integer status;
|
||||
@Excel(name = "处理状态", readConverterExp ="1=不需要处理,2=未处理,3=已处理)")
|
||||
private String status;
|
||||
|
||||
/** 产品ID */
|
||||
@ApiModelProperty("产品ID")
|
||||
@Excel(name = "产品ID")
|
||||
// @Excel(name = "产品ID")
|
||||
private Long productId;
|
||||
|
||||
/** 设备编号 */
|
||||
@@ -62,7 +63,7 @@ public class AlertLog extends BaseEntity
|
||||
private Long orderId;
|
||||
private RepairOrder order;
|
||||
|
||||
private String deviceName;
|
||||
|
||||
|
||||
private Long deviceId;
|
||||
private Long sceneId;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.xinda.iot.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.xinda.common.annotation.Excel;
|
||||
import com.xinda.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 公共档案对象 iot_pub_doc
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@ApiModel(value = "PubDoc",description = "公共档案 iot_pub_doc")
|
||||
@Data
|
||||
public class PubDoc extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id唯一标识 */
|
||||
private Long id;
|
||||
|
||||
/** 机构id */
|
||||
@Excel(name = "机构id")
|
||||
@ApiModelProperty("机构id")
|
||||
private Long deptId;
|
||||
|
||||
/** 机构名称 */
|
||||
@Excel(name = "机构名称")
|
||||
@ApiModelProperty("机构名称")
|
||||
private String deptName;
|
||||
|
||||
/** 文件名称 */
|
||||
@Excel(name = "文件名称")
|
||||
@ApiModelProperty("文件名称")
|
||||
private String fileName;
|
||||
|
||||
/** 资源请求路径 */
|
||||
@Excel(name = "资源请求路径")
|
||||
@ApiModelProperty("资源请求路径")
|
||||
private String resourceUrl;
|
||||
|
||||
/** 租户id */
|
||||
@Excel(name = "租户id")
|
||||
@ApiModelProperty("租户id")
|
||||
private Long tenantId;
|
||||
|
||||
/** 租户名称 */
|
||||
@Excel(name = "租户名称")
|
||||
@ApiModelProperty("租户名称")
|
||||
private String tenantName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xinda.iot.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.iot.domain.PubDoc;
|
||||
|
||||
/**
|
||||
* 公共档案Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
public interface PubDocMapper
|
||||
{
|
||||
/**
|
||||
* 查询公共档案
|
||||
*
|
||||
* @param id 公共档案主键
|
||||
* @return 公共档案
|
||||
*/
|
||||
public PubDoc selectPubDocById(Long id);
|
||||
|
||||
/**
|
||||
* 查询公共档案列表
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 公共档案集合
|
||||
*/
|
||||
public List<PubDoc> selectPubDocList(PubDoc pubDoc);
|
||||
|
||||
/**
|
||||
* 新增公共档案
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPubDoc(PubDoc pubDoc);
|
||||
|
||||
/**
|
||||
* 修改公共档案
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePubDoc(PubDoc pubDoc);
|
||||
|
||||
/**
|
||||
* 删除公共档案
|
||||
*
|
||||
* @param id 公共档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePubDocById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除公共档案
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePubDocByIds(Long[] ids);
|
||||
}
|
||||
@@ -29,7 +29,7 @@ public class AlertSceneSendVO {
|
||||
/**
|
||||
* 告警级别(1=提醒通知,2=轻微问题,3=严重警告)
|
||||
*/
|
||||
private Long alertLevel;
|
||||
private String alertLevel;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public interface IAlertLogService
|
||||
* @return 设备告警集合
|
||||
*/
|
||||
public List<AlertLog> selectAlertLogList(AlertLog alertLog);
|
||||
public List<AlertLog> selectAlertLogListByCreateBy(String createBy, String remark, Integer status);
|
||||
public List<AlertLog> selectAlertLogListByCreateBy(String createBy, String remark, String status);
|
||||
/**
|
||||
* 查询设备告警列表总数
|
||||
*
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.xinda.iot.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.iot.domain.PubDoc;
|
||||
|
||||
/**
|
||||
* 公共档案Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
public interface IPubDocService
|
||||
{
|
||||
/**
|
||||
* 查询公共档案
|
||||
*
|
||||
* @param id 公共档案主键
|
||||
* @return 公共档案
|
||||
*/
|
||||
public PubDoc selectPubDocById(Long id);
|
||||
|
||||
/**
|
||||
* 查询公共档案列表
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 公共档案集合
|
||||
*/
|
||||
public List<PubDoc> selectPubDocList(PubDoc pubDoc);
|
||||
|
||||
/**
|
||||
* 新增公共档案
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertPubDoc(PubDoc pubDoc);
|
||||
|
||||
/**
|
||||
* 修改公共档案
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 结果
|
||||
*/
|
||||
public int updatePubDoc(PubDoc pubDoc);
|
||||
|
||||
/**
|
||||
* 批量删除公共档案
|
||||
*
|
||||
* @param ids 需要删除的公共档案主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePubDocByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除公共档案信息
|
||||
*
|
||||
* @param id 公共档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deletePubDocById(Long id);
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class AlertLogServiceImpl implements IAlertLogService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AlertLog> selectAlertLogListByCreateBy(String createBy, String remark, Integer status) {
|
||||
public List<AlertLog> selectAlertLogListByCreateBy(String createBy, String remark, String status) {
|
||||
AlertLog alertLog = new AlertLog();
|
||||
alertLog.setCreateBy(createBy);
|
||||
alertLog.setStatus(status);
|
||||
@@ -187,7 +187,7 @@ public class AlertLogServiceImpl implements IAlertLogService {
|
||||
alertLog.setUpdateTime(DateUtils.getNowDate());
|
||||
if (alertLog.getRemark().length() > 0) {
|
||||
// 1=不需要处理,2=未处理,3=已处理
|
||||
alertLog.setStatus(3);
|
||||
alertLog.setStatus("3");
|
||||
}
|
||||
if (alertLog.getEnable()==1) {
|
||||
RepairOrder order = alertLog.getOrder();
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.xinda.iot.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.xinda.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.xinda.iot.mapper.PubDocMapper;
|
||||
import com.xinda.iot.domain.PubDoc;
|
||||
import com.xinda.iot.service.IPubDocService;
|
||||
|
||||
/**
|
||||
* 公共档案Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2025-08-02
|
||||
*/
|
||||
@Service
|
||||
public class PubDocServiceImpl implements IPubDocService
|
||||
{
|
||||
@Autowired
|
||||
private PubDocMapper pubDocMapper;
|
||||
|
||||
/**
|
||||
* 查询公共档案
|
||||
*
|
||||
* @param id 公共档案主键
|
||||
* @return 公共档案
|
||||
*/
|
||||
@Override
|
||||
public PubDoc selectPubDocById(Long id)
|
||||
{
|
||||
return pubDocMapper.selectPubDocById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公共档案列表
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 公共档案
|
||||
*/
|
||||
@Override
|
||||
public List<PubDoc> selectPubDocList(PubDoc pubDoc)
|
||||
{
|
||||
return pubDocMapper.selectPubDocList(pubDoc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公共档案
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertPubDoc(PubDoc pubDoc)
|
||||
{
|
||||
pubDoc.setCreateTime(DateUtils.getNowDate());
|
||||
return pubDocMapper.insertPubDoc(pubDoc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公共档案
|
||||
*
|
||||
* @param pubDoc 公共档案
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updatePubDoc(PubDoc pubDoc)
|
||||
{
|
||||
pubDoc.setUpdateTime(DateUtils.getNowDate());
|
||||
return pubDocMapper.updatePubDoc(pubDoc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除公共档案
|
||||
*
|
||||
* @param ids 需要删除的公共档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePubDocByIds(Long[] ids)
|
||||
{
|
||||
return pubDocMapper.deletePubDocByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公共档案信息
|
||||
*
|
||||
* @param id 公共档案主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deletePubDocById(Long id)
|
||||
{
|
||||
return pubDocMapper.deletePubDocById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinda.iot.mapper.PubDocMapper">
|
||||
|
||||
<resultMap type="PubDoc" id="PubDocResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="fileName" column="file_name" />
|
||||
<result property="resourceUrl" column="resource_url" />
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPubDocVo">
|
||||
select id, dept_id, dept_name, file_name, resource_url, tenant_id, tenant_name, create_by, create_time, update_by, update_time from iot_pub_doc
|
||||
</sql>
|
||||
|
||||
<select id="selectPubDocList" parameterType="PubDoc" resultMap="PubDocResult">
|
||||
<include refid="selectPubDocVo"/>
|
||||
<where>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
|
||||
<if test="resourceUrl != null and resourceUrl != ''"> and resource_url = #{resourceUrl}</if>
|
||||
<if test="tenantId != null "> and tenant_id = #{tenantId}</if>
|
||||
<if test="tenantName != null and tenantName != ''"> and tenant_name like concat('%', #{tenantName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPubDocById" parameterType="Long" resultMap="PubDocResult">
|
||||
<include refid="selectPubDocVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertPubDoc" parameterType="PubDoc" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into iot_pub_doc
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="deptName != null">dept_name,</if>
|
||||
<if test="fileName != null">file_name,</if>
|
||||
<if test="resourceUrl != null">resource_url,</if>
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null">tenant_name,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deptName != null">#{deptName},</if>
|
||||
<if test="fileName != null">#{fileName},</if>
|
||||
<if test="resourceUrl != null">#{resourceUrl},</if>
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null">#{tenantName},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updatePubDoc" parameterType="PubDoc">
|
||||
update iot_pub_doc
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deptName != null">dept_name = #{deptName},</if>
|
||||
<if test="fileName != null">file_name = #{fileName},</if>
|
||||
<if test="resourceUrl != null">resource_url = #{resourceUrl},</if>
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null">tenant_name = #{tenantName},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deletePubDocById" parameterType="Long">
|
||||
delete from iot_pub_doc where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePubDocByIds" parameterType="String">
|
||||
delete from iot_pub_doc where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user