施工管控
This commit is contained in:
parent
1a88669435
commit
f2e534d7bc
|
|
@ -39,7 +39,7 @@ public class JdConfigVo {
|
|||
/**电压等级名称*/
|
||||
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;
|
||||
|
||||
public interface Query {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ public interface CraneMonitorMapper {
|
|||
|
||||
/**
|
||||
* 查询近电感应设备的电量值
|
||||
* @param vo
|
||||
* @param devId
|
||||
* @param dataCode
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/8/12 17:54
|
||||
|
|
@ -71,4 +72,13 @@ public interface CraneMonitorMapper {
|
|||
* @date 2024/8/13 11:16
|
||||
*/
|
||||
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.security.utils.ValidatorsUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @className:CraneMonitorServiceImpl
|
||||
|
|
@ -90,12 +93,20 @@ public class CraneMonitorServiceImpl implements ICraneMonitorService {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
)
|
||||
</foreach>
|
||||
</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">
|
||||
|
|
@ -57,24 +61,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<!--查询近电感应设备配置属性 交流/直流-->
|
||||
<select id="getConfigJdDevice" resultType="com.bonus.common.entity.app.vo.JdConfigVo$ConfigItems">
|
||||
SELECT 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.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'
|
||||
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>
|
||||
|
|
@ -4,6 +4,7 @@ import com.bonus.bracelet.service.IConsControlService;
|
|||
import com.bonus.common.core.web.controller.BaseController;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
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.vo.CheckConfigVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
|
|
@ -175,7 +176,44 @@ public class ConsControlController extends BaseController {
|
|||
* @author cwchen
|
||||
* @date 2024/8/16 17:56
|
||||
*/
|
||||
@GetMapping("getJdWarnList")
|
||||
public AjaxResult getJdWarnList(BraceletParamsDto 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.DevWarnVo;
|
||||
import com.bonus.common.entity.app.vo.JdConfigVo;
|
||||
import com.bonus.common.entity.bracelet.BraceletParamsDto;
|
||||
import com.bonus.common.entity.bracelet.vo.*;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Map;
|
|||
public interface ConsControlMapper {
|
||||
/**
|
||||
* 获取球机设备列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<BallTreeVo>
|
||||
* @author cwchen
|
||||
|
|
@ -31,6 +33,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取球机违章识别内容
|
||||
*
|
||||
* @param dto
|
||||
* @return void
|
||||
* @author cwchen
|
||||
|
|
@ -40,6 +43,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 预警信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<WarnInfoVo>
|
||||
* @author cwchen
|
||||
|
|
@ -49,6 +53,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 人员管控-人员树
|
||||
*
|
||||
* @param dto
|
||||
* @return List<PersonTreeVo>
|
||||
* @author cwchen
|
||||
|
|
@ -58,6 +63,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取今日施工班组
|
||||
*
|
||||
* @param dto
|
||||
* @return List<Integer>
|
||||
* @author cwchen
|
||||
|
|
@ -67,8 +73,9 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 安全帽绑定信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<Map<String,Object>>
|
||||
* @return List<Map < String, Object>>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 13:49
|
||||
*/
|
||||
|
|
@ -77,7 +84,8 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取杆塔坐标
|
||||
* @return Map<String,Object>
|
||||
*
|
||||
* @return Map<String, Object>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:13
|
||||
*/
|
||||
|
|
@ -85,6 +93,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取施工距离
|
||||
*
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:16
|
||||
|
|
@ -93,8 +102,9 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取绑定手环的施工班组人员、临时人员信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<Map<String,Object>>
|
||||
* @return List<Map < String, Object>>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 15:23
|
||||
*/
|
||||
|
|
@ -103,8 +113,9 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取已绑手环的定位信息
|
||||
*
|
||||
* @param map
|
||||
* @return Map<String,Object>
|
||||
* @return Map<String, Object>
|
||||
* @author cwchen
|
||||
* @date 2024/8/9 16:30
|
||||
*/
|
||||
|
|
@ -113,6 +124,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 根据杆塔获取班组人员-已绑定手环
|
||||
*
|
||||
* @param dto
|
||||
* @return List<TeamPeopleTreeVo>
|
||||
* @author cwchen
|
||||
|
|
@ -122,35 +134,43 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 删除验证时间配置项
|
||||
*
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/8/10 15:27
|
||||
*/
|
||||
void delConfig();
|
||||
|
||||
/**
|
||||
* 删除验证时间配置内容项
|
||||
*
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/8/10 15:27
|
||||
*/
|
||||
void delConfigItems();
|
||||
|
||||
/**
|
||||
* 添加验证时间配置项
|
||||
*
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/8/10 15:27
|
||||
*/
|
||||
void addConfig(CheckConfigVo vo);
|
||||
|
||||
/**
|
||||
* 添加验证时间配置内容项
|
||||
*
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @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
|
||||
* @return List<CheckConfigVo>
|
||||
* @author cwchen
|
||||
|
|
@ -160,6 +180,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取人员详情数据
|
||||
*
|
||||
* @param dto
|
||||
* @return PersonDetailVo
|
||||
* @author cwchen
|
||||
|
|
@ -169,6 +190,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取人员绑定安全帽信息
|
||||
*
|
||||
* @param dto
|
||||
* @return SafetyHat
|
||||
* @author cwchen
|
||||
|
|
@ -178,6 +200,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 获取手环的预警信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<PersonDetailVo.WarnInfo>
|
||||
* @author cwchen
|
||||
|
|
@ -187,8 +210,9 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 人员历史轨迹
|
||||
*
|
||||
* @param dto
|
||||
* @return List<Map<String,Object>>
|
||||
* @return List<Map < String, Object>>
|
||||
* @author cwchen
|
||||
* @date 2024/8/16 9:55
|
||||
*/
|
||||
|
|
@ -196,6 +220,7 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 吊装预警设备列表
|
||||
*
|
||||
* @param dto
|
||||
* @return List<DevInfoVo>
|
||||
* @author cwchen
|
||||
|
|
@ -205,10 +230,58 @@ public interface ConsControlMapper {
|
|||
|
||||
/**
|
||||
* 近电感应设备预警信息
|
||||
*
|
||||
* @param dto
|
||||
* @return List<DevWarnVo>
|
||||
* @author cwchen
|
||||
* @date 2024/8/16 17:57
|
||||
*/
|
||||
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;
|
||||
|
||||
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.vo.CheckConfigVo;
|
||||
import com.bonus.common.entity.bracelet.vo.WarnInfoVo;
|
||||
|
|
@ -140,4 +141,31 @@ public interface IConsControlService {
|
|||
* @date 2024/8/16 17:57
|
||||
*/
|
||||
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.entity.app.vo.DevInfoVo;
|
||||
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.core.utils.BuildTreeUtil;
|
||||
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.domain.SysFile;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -48,6 +50,9 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
@Resource
|
||||
private RemoteFileService remoteFileService;
|
||||
|
||||
@Resource(name = "ValidatorsUtils")
|
||||
private ValidatorsUtils validatorsUtils;
|
||||
|
||||
@Override
|
||||
public AjaxResult getBallDeviceLists(BraceletParamsDto dto) {
|
||||
JSONArray resultTree = new JSONArray();
|
||||
|
|
@ -443,6 +448,62 @@ public class ConsControlServiceImpl implements IConsControlService {
|
|||
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>
|
||||
</trim>
|
||||
</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 FROM tb_config
|
||||
|
|
@ -31,6 +40,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<delete id="delConfigItems">
|
||||
DELETE FROM tb_config_items
|
||||
</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">
|
||||
|
|
@ -469,12 +482,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
FROM tb_warn tw
|
||||
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_project tp ON tp.id = tdl.pro_id AND tp.del_flag = 0
|
||||
WHERE td.dev_type = #{devType}
|
||||
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
|
||||
AND DATE_FORMAT(tw.warn_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
|
||||
</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
|
||||
ORDER BY tw.warn_time DESC
|
||||
</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>
|
||||
Loading…
Reference in New Issue