施工管控
This commit is contained in:
parent
1a88669435
commit
f2e534d7bc
|
|
@ -39,7 +39,7 @@ public class JdConfigVo {
|
||||||
/**电压等级名称*/
|
/**电压等级名称*/
|
||||||
private String voltageLevelName;
|
private String voltageLevelName;
|
||||||
/**距离*/
|
/**距离*/
|
||||||
@Pattern(regexp = "^(?:100(?:\\.0{1,2})?|[0-9]\\d?(?:\\.\\d{1,2})?)$", message = "距离格式不正确(1-100米)", groups = {Query.class})
|
@Pattern(regexp = "^(?:100(?:\\.0{1,2})?|[1-9][0-9]?(?:\\.\\d{1,2})?|1(?:\\.\\d{1,2})?)$", message = "距离为(1-100米)区间内,最多保留两位小数", groups = {Query.class})
|
||||||
private String distance;
|
private String distance;
|
||||||
|
|
||||||
public interface Query {
|
public interface Query {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,8 @@ public interface CraneMonitorMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询近电感应设备的电量值
|
* 查询近电感应设备的电量值
|
||||||
* @param vo
|
* @param devId
|
||||||
|
* @param dataCode
|
||||||
* @return String
|
* @return String
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/12 17:54
|
* @date 2024/8/12 17:54
|
||||||
|
|
@ -71,4 +72,13 @@ public interface CraneMonitorMapper {
|
||||||
* @date 2024/8/13 11:16
|
* @date 2024/8/13 11:16
|
||||||
*/
|
*/
|
||||||
List<JdConfigVo.ConfigItems> getConfigJdDevice(AppParamsDto dto);
|
List<JdConfigVo.ConfigItems> getConfigJdDevice(AppParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除近电设备配置项
|
||||||
|
* @param vo
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 18:41
|
||||||
|
*/
|
||||||
|
void delJdConfig(JdConfigVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,16 @@ import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
import com.bonus.common.entity.bracelet.vo.PersonVo;
|
||||||
import com.bonus.common.security.utils.ValidatorsUtils;
|
import com.bonus.common.security.utils.ValidatorsUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @className:CraneMonitorServiceImpl
|
* @className:CraneMonitorServiceImpl
|
||||||
|
|
@ -90,12 +93,20 @@ public class CraneMonitorServiceImpl implements ICraneMonitorService {
|
||||||
public AjaxResult configJdDevice(JdConfigVo vo) {
|
public AjaxResult configJdDevice(JdConfigVo vo) {
|
||||||
try {
|
try {
|
||||||
List<JdConfigVo.ConfigItems> configItems = vo.getConfigItems();
|
List<JdConfigVo.ConfigItems> configItems = vo.getConfigItems();
|
||||||
|
if (CollectionUtils.isEmpty(configItems)) {
|
||||||
|
return AjaxResult.error("配置项不能为空");
|
||||||
|
}
|
||||||
|
Set<JdConfigVo.ConfigItems> itemsHashSet = new HashSet<>(configItems);
|
||||||
|
if (itemsHashSet.size() != configItems.size()) {
|
||||||
|
return AjaxResult.error("配置项存在相同数据");
|
||||||
|
}
|
||||||
for (JdConfigVo.ConfigItems items : configItems) {
|
for (JdConfigVo.ConfigItems items : configItems) {
|
||||||
String validResult = validatorsUtils.valid(items, JdConfigVo.ConfigItems.Query.class);
|
String validResult = validatorsUtils.valid(items, JdConfigVo.ConfigItems.Query.class);
|
||||||
if (StringUtils.isNotBlank(validResult)) {
|
if (StringUtils.isNotBlank(validResult)) {
|
||||||
return AjaxResult.error(validResult);
|
return AjaxResult.error(validResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mapper.delJdConfig(vo);
|
||||||
mapper.addJdConfigData(vo);
|
mapper.addJdConfigData(vo);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e.toString(), e);
|
log.error(e.toString(), e);
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
)
|
)
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
<!--删除近电设备配置项-->
|
||||||
|
<delete id="delJdConfig">
|
||||||
|
DELETE FROM tb_jd_config WHERE dev_id = #{devId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<!--查询班组领用的吊装预警设备-->
|
<!--查询班组领用的吊装预警设备-->
|
||||||
<select id="getDzWarnList" resultType="com.bonus.common.entity.app.vo.DevInfoVo">
|
<select id="getDzWarnList" resultType="com.bonus.common.entity.app.vo.DevInfoVo">
|
||||||
|
|
@ -57,24 +61,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
<!--查询近电感应设备配置属性 交流/直流-->
|
<!--查询近电感应设备配置属性 交流/直流-->
|
||||||
<select id="getConfigJdDevice" resultType="com.bonus.common.entity.app.vo.JdConfigVo$ConfigItems">
|
<select id="getConfigJdDevice" resultType="com.bonus.common.entity.app.vo.JdConfigVo$ConfigItems">
|
||||||
SELECT tdc.config_type AS configType,
|
SELECT * FROM (
|
||||||
sdt.dict_name AS configTypeName,
|
SELECT tdc.id,
|
||||||
tdc.distance AS distance,
|
tdc.config_type AS configType,
|
||||||
tdc.voltage_level AS voltageLevel,
|
sdt.dict_name AS configTypeName,
|
||||||
sdd.dict_label AS voltageLevelName
|
tdc.distance AS distance,
|
||||||
FROM tb_jd_config tdc
|
tdc.voltage_level AS voltageLevel,
|
||||||
LEFT JOIN sys_dict_type sdt ON tdc.config_type = sdt.dict_type AND sdt.status = '0'
|
sdd.dict_label AS voltageLevelName
|
||||||
LEFT JOIN sys_dict_data sdd ON tdc.voltage_level = sdd.dict_value AND sdd.status = '0' AND sdd.dict_type = 'communication'
|
FROM tb_jd_config tdc
|
||||||
WHERE tdc.dev_id = #{devId} AND tdc.config_type = 'communication'
|
LEFT JOIN sys_dict_type sdt ON tdc.config_type = sdt.dict_type AND sdt.status = '0'
|
||||||
UNION ALL
|
LEFT JOIN sys_dict_data sdd ON tdc.voltage_level = sdd.dict_value AND sdd.status = '0' AND sdd.dict_type = 'communication'
|
||||||
SELECT tdc.config_type AS configType,
|
WHERE tdc.dev_id = #{devId} AND tdc.config_type = 'communication'
|
||||||
sdt.dict_name AS configTypeName,
|
UNION ALL
|
||||||
tdc.distance AS distance,
|
SELECT tdc.id,
|
||||||
tdc.voltage_level AS voltageLevel,
|
tdc.config_type AS configType,
|
||||||
sdd.dict_label AS voltageLevelName
|
sdt.dict_name AS configTypeName,
|
||||||
FROM tb_jd_config tdc
|
tdc.distance AS distance,
|
||||||
LEFT JOIN sys_dict_type sdt ON tdc.config_type = sdt.dict_type AND sdt.status = '0'
|
tdc.voltage_level AS voltageLevel,
|
||||||
LEFT JOIN sys_dict_data sdd ON tdc.voltage_level = sdd.dict_value AND sdd.status = '0' AND sdd.dict_type = 'direct_current'
|
sdd.dict_label AS voltageLevelName
|
||||||
WHERE tdc.dev_id = #{devId} AND tdc.config_type = 'direct_current'
|
FROM tb_jd_config tdc
|
||||||
|
LEFT JOIN sys_dict_type sdt ON tdc.config_type = sdt.dict_type AND sdt.status = '0'
|
||||||
|
LEFT JOIN sys_dict_data sdd ON tdc.voltage_level = sdd.dict_value AND sdd.status = '0' AND sdd.dict_type = 'direct_current'
|
||||||
|
WHERE tdc.dev_id = #{devId} AND tdc.config_type = 'direct_current'
|
||||||
|
) a
|
||||||
|
ORDER BY a.id
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.bracelet.service.IConsControlService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||||
import com.bonus.common.entity.bracelet.vo.CheckConfigVo;
|
import com.bonus.common.entity.bracelet.vo.CheckConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||||
|
|
@ -175,7 +176,44 @@ public class ConsControlController extends BaseController {
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/16 17:56
|
* @date 2024/8/16 17:56
|
||||||
*/
|
*/
|
||||||
|
@GetMapping("getJdWarnList")
|
||||||
public AjaxResult getJdWarnList(BraceletParamsDto dto){
|
public AjaxResult getJdWarnList(BraceletParamsDto dto){
|
||||||
return service.getJdWarnList(dto);
|
return service.getJdWarnList(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询近电感应设备
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 13:33
|
||||||
|
*/
|
||||||
|
@GetMapping("getJdList")
|
||||||
|
public AjaxResult getJdList(BraceletParamsDto dto){
|
||||||
|
return service.getJdList(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加近电感应设备配置
|
||||||
|
* @param vo
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 17:31
|
||||||
|
*/
|
||||||
|
@PostMapping("configJdDevice")
|
||||||
|
public AjaxResult configJdDevice(@Validated @RequestBody JdConfigVo vo){
|
||||||
|
return service.configJdDevice(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询近电感应设备配置
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 18:02
|
||||||
|
*/
|
||||||
|
@GetMapping("getConfigJdDevice")
|
||||||
|
public AjaxResult getConfigJdDevice(BraceletParamsDto dto){
|
||||||
|
return service.getConfigJdDevice(dto);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.bracelet.mapper;
|
||||||
|
|
||||||
import com.bonus.common.entity.app.vo.DevInfoVo;
|
import com.bonus.common.entity.app.vo.DevInfoVo;
|
||||||
import com.bonus.common.entity.app.vo.DevWarnVo;
|
import com.bonus.common.entity.app.vo.DevWarnVo;
|
||||||
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||||
import com.bonus.common.entity.bracelet.vo.*;
|
import com.bonus.common.entity.bracelet.vo.*;
|
||||||
import org.apache.ibatis.annotations.MapKey;
|
import org.apache.ibatis.annotations.MapKey;
|
||||||
|
|
@ -22,6 +23,7 @@ import java.util.Map;
|
||||||
public interface ConsControlMapper {
|
public interface ConsControlMapper {
|
||||||
/**
|
/**
|
||||||
* 获取球机设备列表
|
* 获取球机设备列表
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<BallTreeVo>
|
* @return List<BallTreeVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -31,6 +33,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取球机违章识别内容
|
* 获取球机违章识别内容
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return void
|
* @return void
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -40,6 +43,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 预警信息
|
* 预警信息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<WarnInfoVo>
|
* @return List<WarnInfoVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -49,6 +53,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员管控-人员树
|
* 人员管控-人员树
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<PersonTreeVo>
|
* @return List<PersonTreeVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -58,6 +63,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取今日施工班组
|
* 获取今日施工班组
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<Integer>
|
* @return List<Integer>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -67,8 +73,9 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全帽绑定信息
|
* 安全帽绑定信息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<Map<String,Object>>
|
* @return List<Map < String, Object>>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/9 13:49
|
* @date 2024/8/9 13:49
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,7 +84,8 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取杆塔坐标
|
* 获取杆塔坐标
|
||||||
* @return Map<String,Object>
|
*
|
||||||
|
* @return Map<String, Object>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/9 15:13
|
* @date 2024/8/9 15:13
|
||||||
*/
|
*/
|
||||||
|
|
@ -85,6 +93,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取施工距离
|
* 获取施工距离
|
||||||
|
*
|
||||||
* @return String
|
* @return String
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/9 15:16
|
* @date 2024/8/9 15:16
|
||||||
|
|
@ -93,8 +102,9 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取绑定手环的施工班组人员、临时人员信息
|
* 获取绑定手环的施工班组人员、临时人员信息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<Map<String,Object>>
|
* @return List<Map < String, Object>>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/9 15:23
|
* @date 2024/8/9 15:23
|
||||||
*/
|
*/
|
||||||
|
|
@ -103,8 +113,9 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取已绑手环的定位信息
|
* 获取已绑手环的定位信息
|
||||||
|
*
|
||||||
* @param map
|
* @param map
|
||||||
* @return Map<String,Object>
|
* @return Map<String, Object>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/9 16:30
|
* @date 2024/8/9 16:30
|
||||||
*/
|
*/
|
||||||
|
|
@ -113,6 +124,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据杆塔获取班组人员-已绑定手环
|
* 根据杆塔获取班组人员-已绑定手环
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<TeamPeopleTreeVo>
|
* @return List<TeamPeopleTreeVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -122,35 +134,43 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除验证时间配置项
|
* 删除验证时间配置项
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/10 15:27
|
* @date 2024/8/10 15:27
|
||||||
*/
|
*/
|
||||||
void delConfig();
|
void delConfig();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除验证时间配置内容项
|
* 删除验证时间配置内容项
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/10 15:27
|
* @date 2024/8/10 15:27
|
||||||
*/
|
*/
|
||||||
void delConfigItems();
|
void delConfigItems();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加验证时间配置项
|
* 添加验证时间配置项
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/10 15:27
|
* @date 2024/8/10 15:27
|
||||||
*/
|
*/
|
||||||
void addConfig(CheckConfigVo vo);
|
void addConfig(CheckConfigVo vo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加验证时间配置内容项
|
* 添加验证时间配置内容项
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/10 15:27
|
* @date 2024/8/10 15:27
|
||||||
*/
|
*/
|
||||||
void addConfigItems(@Param("params") CheckConfigVo vo,@Param("val") String time);
|
void addConfigItems(@Param("params") CheckConfigVo vo, @Param("val") String time);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取自动验证配置
|
* 获取自动验证配置
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<CheckConfigVo>
|
* @return List<CheckConfigVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -160,6 +180,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取人员详情数据
|
* 获取人员详情数据
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return PersonDetailVo
|
* @return PersonDetailVo
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -169,6 +190,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取人员绑定安全帽信息
|
* 获取人员绑定安全帽信息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return SafetyHat
|
* @return SafetyHat
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -178,6 +200,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取手环的预警信息
|
* 获取手环的预警信息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<PersonDetailVo.WarnInfo>
|
* @return List<PersonDetailVo.WarnInfo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -187,8 +210,9 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 人员历史轨迹
|
* 人员历史轨迹
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<Map<String,Object>>
|
* @return List<Map < String, Object>>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/16 9:55
|
* @date 2024/8/16 9:55
|
||||||
*/
|
*/
|
||||||
|
|
@ -196,6 +220,7 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 吊装预警设备列表
|
* 吊装预警设备列表
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<DevInfoVo>
|
* @return List<DevInfoVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
|
|
@ -205,10 +230,58 @@ public interface ConsControlMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 近电感应设备预警信息
|
* 近电感应设备预警信息
|
||||||
|
*
|
||||||
* @param dto
|
* @param dto
|
||||||
* @return List<DevWarnVo>
|
* @return List<DevWarnVo>
|
||||||
* @author cwchen
|
* @author cwchen
|
||||||
* @date 2024/8/16 17:57
|
* @date 2024/8/16 17:57
|
||||||
*/
|
*/
|
||||||
List<DevWarnVo> getJdWarnList(BraceletParamsDto dto);
|
List<DevWarnVo> getJdWarnList(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询近电感应设备
|
||||||
|
*
|
||||||
|
* @param dto
|
||||||
|
* @return List<DevInfoVo>
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 13:36
|
||||||
|
*/
|
||||||
|
List<DevInfoVo> getJdList(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询近电感应设备点电量
|
||||||
|
* @param devId
|
||||||
|
* @param dataCode
|
||||||
|
* @return String
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 13:37
|
||||||
|
*/
|
||||||
|
String getElectricQuantity(@Param("devId") Long devId,@Param("dataCode") String dataCode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加近电感应设备配置
|
||||||
|
* @param vo
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 17:33
|
||||||
|
*/
|
||||||
|
void addJdConfigData(JdConfigVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询近电感应设备配置
|
||||||
|
* @param dto
|
||||||
|
* @return List<ConfigItems>
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 18:03
|
||||||
|
*/
|
||||||
|
List<JdConfigVo.ConfigItems> getConfigJdDevice(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除近电配置项
|
||||||
|
* @param vo
|
||||||
|
* @return void
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 18:42
|
||||||
|
*/
|
||||||
|
void delJdConfig(JdConfigVo vo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.bracelet.service;
|
package com.bonus.bracelet.service;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||||
import com.bonus.common.entity.bracelet.vo.CheckConfigVo;
|
import com.bonus.common.entity.bracelet.vo.CheckConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||||
|
|
@ -140,4 +141,31 @@ public interface IConsControlService {
|
||||||
* @date 2024/8/16 17:57
|
* @date 2024/8/16 17:57
|
||||||
*/
|
*/
|
||||||
AjaxResult getJdWarnList(BraceletParamsDto dto);
|
AjaxResult getJdWarnList(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询近电感应设备
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 13:34
|
||||||
|
*/
|
||||||
|
AjaxResult getJdList(BraceletParamsDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加近电感应设备配置
|
||||||
|
* @param vo
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 17:31
|
||||||
|
*/
|
||||||
|
AjaxResult configJdDevice(JdConfigVo vo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加近电感应设备配置
|
||||||
|
* @param dto
|
||||||
|
* @return AjaxResult
|
||||||
|
* @author cwchen
|
||||||
|
* @date 2024/8/18 18:02
|
||||||
|
*/
|
||||||
|
AjaxResult getConfigJdDevice(BraceletParamsDto dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,11 @@ import com.bonus.common.core.utils.encryption.Sm4Utils;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.entity.app.vo.DevInfoVo;
|
import com.bonus.common.entity.app.vo.DevInfoVo;
|
||||||
import com.bonus.common.entity.app.vo.DevWarnVo;
|
import com.bonus.common.entity.app.vo.DevWarnVo;
|
||||||
|
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||||
import com.bonus.common.core.utils.BuildTreeUtil;
|
import com.bonus.common.core.utils.BuildTreeUtil;
|
||||||
import com.bonus.common.entity.bracelet.vo.*;
|
import com.bonus.common.entity.bracelet.vo.*;
|
||||||
|
import com.bonus.common.security.utils.ValidatorsUtils;
|
||||||
import com.bonus.system.api.RemoteFileService;
|
import com.bonus.system.api.RemoteFileService;
|
||||||
import com.bonus.system.api.domain.SysFile;
|
import com.bonus.system.api.domain.SysFile;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -48,6 +50,9 @@ public class ConsControlServiceImpl implements IConsControlService {
|
||||||
@Resource
|
@Resource
|
||||||
private RemoteFileService remoteFileService;
|
private RemoteFileService remoteFileService;
|
||||||
|
|
||||||
|
@Resource(name = "ValidatorsUtils")
|
||||||
|
private ValidatorsUtils validatorsUtils;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getBallDeviceLists(BraceletParamsDto dto) {
|
public AjaxResult getBallDeviceLists(BraceletParamsDto dto) {
|
||||||
JSONArray resultTree = new JSONArray();
|
JSONArray resultTree = new JSONArray();
|
||||||
|
|
@ -443,6 +448,62 @@ public class ConsControlServiceImpl implements IConsControlService {
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getJdList(BraceletParamsDto dto) {
|
||||||
|
List<DevInfoVo> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
dto.setDevType(BusinessConstants.JD);
|
||||||
|
list = mapper.getJdList(dto);
|
||||||
|
for (DevInfoVo vo : list) {
|
||||||
|
String electricQuantity = mapper.getElectricQuantity(vo.getDevId(), BusinessConstants.DL);
|
||||||
|
if (StringUtils.isNotBlank(electricQuantity) && isNumeric(electricQuantity)) {
|
||||||
|
vo.setElectricQuantity(electricQuantity);
|
||||||
|
} else {
|
||||||
|
vo.setElectricQuantity("0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult configJdDevice(JdConfigVo vo) {
|
||||||
|
try {
|
||||||
|
List<JdConfigVo.ConfigItems> configItems = vo.getConfigItems();
|
||||||
|
if (CollectionUtils.isEmpty(configItems)) {
|
||||||
|
return AjaxResult.error("配置项不能为空");
|
||||||
|
}
|
||||||
|
Set<JdConfigVo.ConfigItems> itemsHashSet = new HashSet<>(configItems);
|
||||||
|
if (itemsHashSet.size() != configItems.size()) {
|
||||||
|
return AjaxResult.error("配置项存在相同数据");
|
||||||
|
}
|
||||||
|
for (JdConfigVo.ConfigItems items : configItems) {
|
||||||
|
String validResult = validatorsUtils.valid(items, JdConfigVo.ConfigItems.Query.class);
|
||||||
|
if (StringUtils.isNotBlank(validResult)) {
|
||||||
|
return AjaxResult.error(validResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mapper.delJdConfig(vo);
|
||||||
|
mapper.addJdConfigData(vo);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(), e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult getConfigJdDevice(BraceletParamsDto dto) {
|
||||||
|
List<JdConfigVo.ConfigItems> list = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
list = mapper.getConfigJdDevice(dto);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.toString(),e);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 赋值手环设备的经纬度
|
* 赋值手环设备的经纬度
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="params.configId != null">#{params.configId},</if>
|
<if test="params.configId != null">#{params.configId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<!--添加近电感应设备配置属性-->
|
||||||
|
<insert id="addJdConfigData">
|
||||||
|
INSERT INTO tb_jd_config(id,dev_id,config_type,voltage_level,distance) VALUES
|
||||||
|
<foreach collection="configItems" separator="," item="item">
|
||||||
|
(
|
||||||
|
null,#{devId},#{item.configType},#{item.voltageLevel},#{item.distance}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
<!--删除验证时间配置项-->
|
<!--删除验证时间配置项-->
|
||||||
<delete id="delConfig">
|
<delete id="delConfig">
|
||||||
DELETE FROM tb_config
|
DELETE FROM tb_config
|
||||||
|
|
@ -31,6 +40,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<delete id="delConfigItems">
|
<delete id="delConfigItems">
|
||||||
DELETE FROM tb_config_items
|
DELETE FROM tb_config_items
|
||||||
</delete>
|
</delete>
|
||||||
|
<!--删除近电配置项-->
|
||||||
|
<delete id="delJdConfig">
|
||||||
|
DELETE FROM tb_jd_config WHERE dev_id = #{devId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<!--获取球机设备列表 项目部权限-->
|
<!--获取球机设备列表 项目部权限-->
|
||||||
<select id="getBallDeviceLists" resultType="com.bonus.common.entity.bracelet.vo.BallTreeVo">
|
<select id="getBallDeviceLists" resultType="com.bonus.common.entity.bracelet.vo.BallTreeVo">
|
||||||
|
|
@ -469,12 +482,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
FROM tb_warn tw
|
FROM tb_warn tw
|
||||||
LEFT JOIN tb_device td ON tw.dev_id = td.id
|
LEFT JOIN tb_device td ON tw.dev_id = td.id
|
||||||
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id
|
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id
|
||||||
|
LEFT JOIN tb_project tp ON tp.id = tdl.pro_id AND tp.del_flag = 0
|
||||||
WHERE td.dev_type = #{devType}
|
WHERE td.dev_type = #{devType}
|
||||||
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
||||||
AND DATE_FORMAT(tw.warn_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
|
AND DATE_FORMAT(tw.warn_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||||
|
AND tp.depart_id = -1
|
||||||
|
</if>
|
||||||
|
<if test="roleCode=='depart'">
|
||||||
|
AND tp.depart_id = #{departId}
|
||||||
|
</if>
|
||||||
|
AND tp.depart_id IS NOT NULL
|
||||||
AND tw.dev_type = 1 AND tw.del_flag = 0
|
AND tw.dev_type = 1 AND tw.del_flag = 0
|
||||||
ORDER BY tw.warn_time DESC
|
ORDER BY tw.warn_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
<!--查询近电感应设备-->
|
||||||
|
<select id="getJdList" resultType="com.bonus.common.entity.app.vo.DevInfoVo">
|
||||||
|
SELECT td.dev_code AS devCode,
|
||||||
|
td.id AS devId,
|
||||||
|
td.dev_index AS devIndex,
|
||||||
|
td.dev_name AS devName
|
||||||
|
FROM tb_device td
|
||||||
|
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id
|
||||||
|
LEFT JOIN tb_project tp ON tp.id = tdl.pro_id AND tp.del_flag = 0
|
||||||
|
WHERE td.dev_type = #{devType}
|
||||||
|
<if test="roleCode!='administrators' and roleCode!='depart'">
|
||||||
|
AND tp.depart_id = -1
|
||||||
|
</if>
|
||||||
|
<if test="roleCode=='depart'">
|
||||||
|
AND tp.depart_id = #{departId}
|
||||||
|
</if>
|
||||||
|
AND tp.depart_id IS NOT NULL
|
||||||
|
AND td.del_flag = 0
|
||||||
|
</select>
|
||||||
|
<!--查询近电感应设备的电量-->
|
||||||
|
<select id="getElectricQuantity" resultType="java.lang.String">
|
||||||
|
SELECT data_val FROM tb_dev_details WHERE dev_id = #{devId} AND data_code = #{dataCode} AND dev_type = 1 LIMIT 1
|
||||||
|
</select>
|
||||||
|
<!--查询近电感应设备配置-->
|
||||||
|
<select id="getConfigJdDevice" resultType="com.bonus.common.entity.app.vo.JdConfigVo$ConfigItems">
|
||||||
|
SELECT * FROM (
|
||||||
|
SELECT tdc.id,
|
||||||
|
tdc.config_type AS configType,
|
||||||
|
sdt.dict_name AS configTypeName,
|
||||||
|
tdc.distance AS distance,
|
||||||
|
tdc.voltage_level AS voltageLevel,
|
||||||
|
sdd.dict_label AS voltageLevelName
|
||||||
|
FROM tb_jd_config tdc
|
||||||
|
LEFT JOIN sys_dict_type sdt ON tdc.config_type = sdt.dict_type AND sdt.status = '0'
|
||||||
|
LEFT JOIN sys_dict_data sdd ON tdc.voltage_level = sdd.dict_value AND sdd.status = '0' AND sdd.dict_type = 'communication'
|
||||||
|
WHERE tdc.dev_id = #{devId} AND tdc.config_type = 'communication'
|
||||||
|
UNION ALL
|
||||||
|
SELECT tdc.id,
|
||||||
|
tdc.config_type AS configType,
|
||||||
|
sdt.dict_name AS configTypeName,
|
||||||
|
tdc.distance AS distance,
|
||||||
|
tdc.voltage_level AS voltageLevel,
|
||||||
|
sdd.dict_label AS voltageLevelName
|
||||||
|
FROM tb_jd_config tdc
|
||||||
|
LEFT JOIN sys_dict_type sdt ON tdc.config_type = sdt.dict_type AND sdt.status = '0'
|
||||||
|
LEFT JOIN sys_dict_data sdd ON tdc.voltage_level = sdd.dict_value AND sdd.status = '0' AND sdd.dict_type = 'direct_current'
|
||||||
|
WHERE tdc.dev_id = #{devId} AND tdc.config_type = 'direct_current'
|
||||||
|
) a
|
||||||
|
ORDER BY a.id
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue