后台视频识别配置,GLL设备类
This commit is contained in:
parent
8ae4663fdb
commit
9130e4fe84
|
|
@ -151,6 +151,11 @@ public class Constants {
|
|||
*/
|
||||
public static final Integer SHIFT_KEY = 134;
|
||||
|
||||
/**
|
||||
* GLL通管设备类
|
||||
*/
|
||||
public static final Integer GLL_KEY = 137;
|
||||
|
||||
/**
|
||||
* 禁止特殊字符正则表达式
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.base.basic.controller;
|
|||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
import com.bonus.base.basic.config.Constants;
|
||||
import com.bonus.base.basic.domain.TbWarnConfig;
|
||||
import com.bonus.base.basic.entity.WarnSpaceVo;
|
||||
import com.bonus.base.basic.service.TbWarnConfigService;
|
||||
import com.bonus.base.basic.vo.*;
|
||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
||||
|
|
@ -97,6 +98,14 @@ public class TbWarnConfigController extends BaseController {
|
|||
}
|
||||
|
||||
}
|
||||
if (tbWarnConfig.getConfiguType().equals(Constants.GLL_KEY)) {
|
||||
List<GLLVo> list = tbWarnConfigService.queryGllVoByPage(tbWarnConfig);
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
return AjaxResult.success(list.get(0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return AjaxResult.success("暂无数据");
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +194,32 @@ public class TbWarnConfigController extends BaseController {
|
|||
ExcelUtil<ShiftVo> util = new ExcelUtil<>(ShiftVo.class);
|
||||
util.exportExcel(response, list, "预警配置位移监测类导出");
|
||||
}
|
||||
if (tbWarnConfig.getConfiguType().equals(Constants.GLL_KEY)) {
|
||||
List<GLLVo> list = tbWarnConfigService.queryGllVoByPage(tbWarnConfig);
|
||||
ExcelUtil<GLLVo> util = new ExcelUtil<>(GLLVo.class);
|
||||
util.exportExcel(response, list, "预警配置GLL通管设备类导出");
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询受限空间违章类型")
|
||||
@RequiresPermissions("base:warn:list")
|
||||
@GetMapping("/getWarnSpaceType")
|
||||
@SysLog(title = "预警配置管理", businessType = OperaType.QUERY, module = "大屏->查询受限空间违章类型")
|
||||
public AjaxResult getWarnSpaceType(Long id) {
|
||||
return tbWarnConfigService.getWarnSpaceType(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param vo 实体
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@ApiOperation(value = "保存")
|
||||
@PostMapping("/saveWarnSpaceType")
|
||||
@SysLog(title = "预警配置管理", businessType = OperaType.UPDATE, module = "基础管理->预警配置管理")
|
||||
public AjaxResult saveWarnSpaceType(@RequestBody @Valid WarnSpaceVo vo) {
|
||||
return tbWarnConfigService.saveWarnSpaceType(vo);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ public class WarnSpaceVo {
|
|||
// 预警时间
|
||||
private String warnTime;
|
||||
|
||||
private Integer isCheck;
|
||||
|
||||
private int[] ids;
|
||||
|
||||
// 年份
|
||||
private String year;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.bonus.base.basic.mapper;
|
||||
|
||||
import com.bonus.base.basic.domain.TbWarnConfig;
|
||||
import com.bonus.base.basic.entity.WarnSpaceVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -42,4 +44,10 @@ public interface TbWarnConfigMapper {
|
|||
TbWarnConfig selectByName(TbWarnConfig record);
|
||||
|
||||
int queryByDeviceId(Long id);
|
||||
|
||||
List<WarnSpaceVo> getWarnSpaceType(Long id);
|
||||
|
||||
void saveWarnSpaceClean();
|
||||
|
||||
void saveWarnSpaceType( int id);
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.base.basic.service;
|
||||
|
||||
import com.bonus.base.basic.domain.TbWarnConfig;
|
||||
import com.bonus.base.basic.entity.WarnSpaceVo;
|
||||
import com.bonus.base.basic.vo.*;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
|
||||
|
|
@ -72,4 +73,21 @@ public interface TbWarnConfigService{
|
|||
*/
|
||||
List<ShiftVo> queryShiftVoByPage(TbWarnConfig tbWarnConfig);
|
||||
|
||||
|
||||
/**
|
||||
* GLL通管设备类
|
||||
* @param tbWarnConfig
|
||||
* @return
|
||||
*/
|
||||
List<GLLVo> queryGllVoByPage(TbWarnConfig tbWarnConfig);
|
||||
|
||||
|
||||
/**
|
||||
* 查询受限空间违章类型
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getWarnSpaceType(Long id);
|
||||
|
||||
AjaxResult saveWarnSpaceType(WarnSpaceVo vo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.bonus.base.basic.service.impl;
|
|||
|
||||
import com.bonus.base.basic.config.Constants;
|
||||
import com.bonus.base.basic.domain.TbWarnConfig;
|
||||
import com.bonus.base.basic.entity.WarnSpaceVo;
|
||||
import com.bonus.base.basic.mapper.TbWarnConfigMapper;
|
||||
import com.bonus.base.basic.service.TbWarnConfigService;
|
||||
import com.bonus.base.basic.config.ExceptionEnum;
|
||||
|
|
@ -9,8 +10,10 @@ import com.bonus.base.basic.vo.*;
|
|||
import com.bonus.common.core.utils.StringUtils;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
|
@ -23,6 +26,7 @@ import java.util.Objects;
|
|||
*@version : 1.0
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TbWarnConfigServiceImpl implements TbWarnConfigService {
|
||||
|
||||
@Autowired
|
||||
|
|
@ -286,6 +290,31 @@ public class TbWarnConfigServiceImpl implements TbWarnConfigService {
|
|||
return shiftVos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询GLL通管设备类预警
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<GLLVo> queryGllVoByPage(TbWarnConfig record) {
|
||||
List<TbWarnConfig> list = tbWarnConfigMapper.getAll(record);
|
||||
ArrayList<GLLVo> gllVos = new ArrayList<>();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (TbWarnConfig tbWarnConfig : list) {
|
||||
setConfigStr(tbWarnConfig);
|
||||
GLLVo gllVo = new GLLVo();
|
||||
gllVo.setConfigName(tbWarnConfig.getConfigName());
|
||||
gllVo.setDevId(tbWarnConfig.getDevId());
|
||||
gllVo.setTempThreshold(tbWarnConfig.getConfigVal1Str());
|
||||
gllVo.setPartElectThreshold(tbWarnConfig.getConfigVal2Str());
|
||||
gllVo.setWaterThreshold(tbWarnConfig.getConfigVal3Str());
|
||||
gllVo.setAirPreThreshold(tbWarnConfig.getConfigVal4Str());
|
||||
gllVos.add(gllVo);
|
||||
}
|
||||
}
|
||||
return gllVos;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置阈值组合
|
||||
* @param tbWarnConfig
|
||||
|
|
@ -310,4 +339,33 @@ public class TbWarnConfigServiceImpl implements TbWarnConfigService {
|
|||
tbWarnConfig.setConfigVal6Str(tbWarnConfig.getConfigVal6Min() + "~" + tbWarnConfig.getConfigVal6Max());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询受限空间违章类型
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getWarnSpaceType(Long id) {
|
||||
List<WarnSpaceVo> list = tbWarnConfigMapper.getWarnSpaceType(id);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult saveWarnSpaceType(WarnSpaceVo vo) {
|
||||
try {
|
||||
tbWarnConfigMapper.saveWarnSpaceClean();
|
||||
if(vo.getIds().length>0){
|
||||
for (int i = 0; i < vo.getIds().length; i++) {
|
||||
int id = vo.getIds()[i];
|
||||
tbWarnConfigMapper.saveWarnSpaceType(id);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return AjaxResult.error("保存失败");
|
||||
}
|
||||
return AjaxResult.success("保存成功");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
package com.bonus.base.basic.vo;
|
||||
|
||||
import com.bonus.base.basic.domain.TbWarnConfig;
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 基坑检测类返回vo
|
||||
* @Author hongchoa
|
||||
* @create 2025/1/3 15:14
|
||||
*/
|
||||
@Data
|
||||
public class GLLVo extends TbWarnConfig {
|
||||
|
||||
@ApiModelProperty(value="温度阈值")
|
||||
@Excel(name = "温度阈值")
|
||||
private String tempThreshold;
|
||||
|
||||
@ApiModelProperty(value="局部放电阈值")
|
||||
@Excel(name = "局部放电阈值")
|
||||
private String partElectThreshold;
|
||||
|
||||
@ApiModelProperty(value="微水阈值")
|
||||
@Excel(name = "微水阈值")
|
||||
private String waterThreshold;
|
||||
|
||||
@ApiModelProperty(value="气压阈值")
|
||||
@Excel(name = "气压阈值")
|
||||
private String airPreThreshold;
|
||||
}
|
||||
|
|
@ -423,4 +423,23 @@
|
|||
where del_flag = 0 and config_id = #{id}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getWarnSpaceType" resultType="com.bonus.base.basic.entity.WarnSpaceVo">
|
||||
select
|
||||
id,config_name as warnType,line_value as isCheck
|
||||
from tb_warn_config as twc
|
||||
where twc.configu_type = 135 and del_flag = 0
|
||||
</select>
|
||||
|
||||
<update id="saveWarnSpaceClean">
|
||||
UPDATE tb_warn_config as twc
|
||||
SET line_value = 0
|
||||
where twc.configu_type = 135 and del_flag = 0
|
||||
</update>
|
||||
|
||||
<update id="saveWarnSpaceType">
|
||||
UPDATE tb_warn_config as twc
|
||||
SET line_value = 1
|
||||
where id = #{id} and del_flag = 0 and twc.configu_type = 135
|
||||
</update>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue