提交代码
parent
35cb63c315
commit
db811c27f4
|
@ -54,11 +54,8 @@ public class SecurityCheckDetail extends BaseEntity
|
|||
@Excel(name = "整改时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date rectificationTime;
|
||||
|
||||
|
||||
|
||||
private String responsibleLoginName;
|
||||
|
||||
|
||||
/** 删除状态(0未删除1已删除) */
|
||||
private Integer delFlag;
|
||||
|
||||
|
@ -72,8 +69,6 @@ public class SecurityCheckDetail extends BaseEntity
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getResponsibleLoginName() {
|
||||
return responsibleLoginName;
|
||||
}
|
||||
|
|
|
@ -51,8 +51,6 @@ public class SmcTypeInfo extends TreeEntity
|
|||
@Excel(name = "数据更新人的标识")
|
||||
private String updateuserId;
|
||||
|
||||
|
||||
|
||||
public void setTypeId(Long typeId)
|
||||
{
|
||||
this.typeId = typeId;
|
||||
|
|
|
@ -92,9 +92,6 @@ public class SysApplication extends BaseEntity {
|
|||
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,6 @@ public class SysServiceReg extends BaseEntity
|
|||
/** 数据更新用户角色属性名称 */
|
||||
private String roleParam;
|
||||
|
||||
|
||||
private String postParam;
|
||||
|
||||
public String getAppName() {
|
||||
|
|
|
@ -0,0 +1,494 @@
|
|||
package com.yanzhu.xd.system.controller;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.yanzhu.xd.system.domain.DevTowerProjectConfig;
|
||||
import com.yanzhu.xd.system.domain.TowerReqVo;
|
||||
import com.yanzhu.xd.system.emuns.CacheConstants;
|
||||
import com.yanzhu.xd.system.emuns.TowerTypeEnums;
|
||||
import com.yanzhu.xd.system.service.IDevTowerProjectConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 塔吊监测APIController
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/desApi/towerCrane")
|
||||
public class TowerCraneApiController {
|
||||
|
||||
@Autowired
|
||||
private IDevTowerProjectConfigService configService;
|
||||
|
||||
private final String HOST = "https://aqzg.makalu.cc";
|
||||
private final String DEVSOURCE = "YF";
|
||||
|
||||
private Map<String, Object> cacheMap;
|
||||
|
||||
{
|
||||
cacheMap = new HashMap<>();
|
||||
}
|
||||
/**
|
||||
* 塔吊监测++
|
||||
* 限流规则[60秒内最多请求10次,限流策略IP]
|
||||
* @param req 请求信息
|
||||
* @author JiangYuQi
|
||||
* @date 2024-01-13
|
||||
*/
|
||||
@PostMapping("/v1/push")
|
||||
public AjaxResult pushData(@Validated @RequestBody TowerReqVo req) {
|
||||
if(Objects.isNull(cacheMap.get("tower_cfg_"+req.getContent().getDeviceKey()))){
|
||||
DevTowerProjectConfig config = configService.selectDevTowerProjectConfigById(Convert.toLong(req.getContent().getDeviceKey()));
|
||||
if(config==null){
|
||||
throw new ServiceException("设备序列号错误,请联系管理员配置序列号...");
|
||||
}
|
||||
cacheMap.put("tower_cfg_"+req.getContent().getDeviceKey(),config);
|
||||
}
|
||||
if(req.getType() == TowerTypeEnums.BASE.getCode()){
|
||||
this.pushConfigData(req);
|
||||
}else if(req.getType() == TowerTypeEnums.RUN.getCode()){
|
||||
this.pushRunData(req);
|
||||
}else if(req.getType() == TowerTypeEnums.ROUND.getCode()){
|
||||
this.pushRoundData(req);
|
||||
}else if(req.getType() == TowerTypeEnums.COLLIDE.getCode()){
|
||||
this.pushCollideData(req);
|
||||
}else if(req.getType() == TowerTypeEnums.LIMIT.getCode()){
|
||||
this.pushLimitData(req);
|
||||
}else if(req.getType() == TowerTypeEnums.LOCAL.getCode()){
|
||||
this.pushLocalData(req);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机上报基本信息
|
||||
* @param req
|
||||
*/
|
||||
private void pushConfigData(TowerReqVo req){
|
||||
String sn = req.getContent().getDeviceKey();
|
||||
Map<String, Object> dataContent = req.getContent().getDataContent();
|
||||
|
||||
//将数据同步至马卡鲁安管平台
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("data_source",DEVSOURCE);
|
||||
dataMap.put("device_sn",sn);
|
||||
double rate = Convert.toInt(cacheMap.get("rate_"+sn),2);
|
||||
dataMap.put("base",rate);
|
||||
dataMap.put("coordX",dataContent.get("coordinateX"));
|
||||
dataMap.put("coordY",dataContent.get("coordinateY"));
|
||||
dataMap.put("foreArmLength",dataContent.get("frontBrachium"));
|
||||
dataMap.put("postArmLength",dataContent.get("afterBrachium"));
|
||||
dataMap.put("hatHeight",dataContent.get("towerCapHeight"));
|
||||
double remotePullRod = Convert.toDouble(cacheMap.get("remotePullRod_"+sn),0.00);
|
||||
double nearPullRod = Convert.toDouble(cacheMap.get("nearPullRod_"+sn),0.00);
|
||||
double postPullRod = Convert.toDouble(cacheMap.get("postPullRod_"+sn),0.00);
|
||||
dataMap.put("remotePullRod",remotePullRod);
|
||||
dataMap.put("nearPullRod",nearPullRod);
|
||||
dataMap.put("postPullRod",postPullRod);
|
||||
dataMap.put("downHeight",dataContent.get("towerSectionHeight"));
|
||||
dataMap.put("updateTime", DateUtils.getTime());
|
||||
|
||||
HttpUtil.post(HOST+"/api/device/baseInfo",dataMap,-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机上报实时数据
|
||||
* @param req
|
||||
*/
|
||||
private void pushRunData(TowerReqVo req){
|
||||
String sn = req.getContent().getDeviceKey();
|
||||
Map<String, Object> dataContent = req.getContent().getDataContent();
|
||||
|
||||
// 将数据同步至马卡鲁安管平台
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("data_source",DEVSOURCE);
|
||||
dataMap.put("deviceSn",sn);
|
||||
dataMap.put("thisTime",System.currentTimeMillis());
|
||||
dataMap.put("weightData",dataContent.get("load"));
|
||||
dataMap.put("tiltData",dataContent.get("leanAngleY"));
|
||||
dataMap.put("windSpeedData",dataContent.get("windSpeed"));
|
||||
String height = Convert.toStr(dataContent.get("height"));
|
||||
dataMap.put("heightData",height);
|
||||
dataMap.put("ampData",dataContent.get("range"));
|
||||
dataMap.put("torqueData",dataContent.get("momentPercent"));
|
||||
dataMap.put("angleData",dataContent.get("rotation"));
|
||||
String dingShengData = Convert.toStr(cacheMap.get("highLimitWarning_"+sn),height);
|
||||
dataMap.put("dingShengData",dingShengData);
|
||||
dataMap.put("walkData",dataContent.get("range"));
|
||||
|
||||
// 将报警数据同步至马卡鲁安管平台
|
||||
if(dataContent.get("warnings")!=null){
|
||||
this.pushWarnData(req);
|
||||
}
|
||||
HttpUtil.post(HOST+"/api/device/runInfo",dataMap,-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机上报循环数据
|
||||
* @param req
|
||||
*/
|
||||
private void pushRoundData(TowerReqVo req){
|
||||
String sn = req.getContent().getDeviceKey();
|
||||
Map<String, Object> dataContent = req.getContent().getDataContent();
|
||||
|
||||
// 将数据同步至马卡鲁安管平台
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("data_source",DEVSOURCE);
|
||||
dataMap.put("deviceSn",sn);
|
||||
dataMap.put("dataId",System.currentTimeMillis());
|
||||
dataMap.put("startTime",dataContent.get("workStartTime"));
|
||||
dataMap.put("endTime",dataContent.get("workEndTime"));
|
||||
dataMap.put("maxWeight",dataContent.get("maxLoad"));
|
||||
dataMap.put("maxTorque",dataContent.get("maxMomentPercent"));
|
||||
dataMap.put("maxHeight",dataContent.get("maxHeight"));
|
||||
dataMap.put("minHeight",dataContent.get("minHeight"));
|
||||
dataMap.put("maxAmptitude",dataContent.get("maxRange"));
|
||||
dataMap.put("minAmptitude",dataContent.get("minRange"));
|
||||
dataMap.put("maxRotateAngle",dataContent.get("endRotation"));
|
||||
dataMap.put("minRotateAngle",dataContent.get("startRotation"));
|
||||
dataMap.put("createTime",System.currentTimeMillis());
|
||||
|
||||
HttpUtil.post(HOST+"/api/device/roundInfo",dataMap,-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机上报碰撞信息
|
||||
* @param req
|
||||
*/
|
||||
private void pushCollideData(TowerReqVo req){
|
||||
String sn = req.getContent().getDeviceKey();
|
||||
|
||||
// 将数据同步至马卡鲁安管平台
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("data_source",DEVSOURCE);
|
||||
dataMap.put("deviceSn",sn);
|
||||
dataMap.put("warn_name","none");
|
||||
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","注意碰撞!注意碰撞!");
|
||||
dataMap.put("warn_note","注意碰撞!注意碰撞!");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("collisionAngleAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("collisionAngleAlarm_"+sn),"0"));
|
||||
dataMap.put("warn_time",DateUtils.getTime());
|
||||
|
||||
HttpUtil.post(HOST+"/api/device/warnRecord",dataMap,-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机推送预警信息
|
||||
* @param req
|
||||
*/
|
||||
private void pushWarnData(TowerReqVo req){
|
||||
String sn = req.getContent().getDeviceKey();
|
||||
Map<String, Object> dataContent = req.getContent().getDataContent();
|
||||
|
||||
// 将数据同步至马卡鲁安管平台
|
||||
Map<String, Object> dataMap = new HashMap<>();
|
||||
dataMap.put("data_source",DEVSOURCE);
|
||||
dataMap.put("deviceSn",sn);
|
||||
dataMap.put("warn_name","none");
|
||||
if(dataContent.get("warnings")!=null){
|
||||
List<String> warnings = (List<String>)dataContent.get("warnings");
|
||||
for(String warning:warnings){
|
||||
switch (warning){
|
||||
case "1":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","高限位");
|
||||
dataMap.put("warn_note","高限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("highLimitWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("highLimitWarning_"+sn),"0"));
|
||||
break;
|
||||
case "2":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","低限位");
|
||||
dataMap.put("warn_note","低限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("lowLimitWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("lowLimitWarning_"+sn),"0"));
|
||||
break;
|
||||
case "3":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","远方限位");
|
||||
dataMap.put("warn_note","远方限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("frontLimitWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("frontLimitWarning_"+sn),"0"));
|
||||
break;
|
||||
case "4":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","近方限位");
|
||||
dataMap.put("warn_note","近方限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("backLimitWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("backLimitWarning_"+sn),"0"));
|
||||
break;
|
||||
case "5":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","左转限位");
|
||||
dataMap.put("warn_note","左转限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("leftLimitWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("leftLimitWarning_"+sn),"0"));
|
||||
break;
|
||||
case "6":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","右转限位");
|
||||
dataMap.put("warn_note","右转限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("rightLimitWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("rightLimitWarning_"+sn),"0"));
|
||||
break;
|
||||
case "7":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","重量预警 1");
|
||||
dataMap.put("warn_note","重量预警 1");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("loadWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("loadWarning_"+sn),"0"));
|
||||
break;
|
||||
case "8":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","重量预警 2");
|
||||
dataMap.put("warn_note","重量预警 2");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("loadWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("loadWarning_"+sn),"0"));
|
||||
break;
|
||||
case "9":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","重量预警 3");
|
||||
dataMap.put("warn_note","重量预警 3");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("loadWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("loadWarning_"+sn),"0"));
|
||||
break;
|
||||
case "10":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","力矩预警 1");
|
||||
dataMap.put("warn_note","力矩预警 1");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("momentWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("momentWarning_"+sn),"0"));
|
||||
break;
|
||||
case "11":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","力矩预警 2");
|
||||
dataMap.put("warn_note","力矩预警 2");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("momentWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("momentWarning_"+sn),"0"));
|
||||
break;
|
||||
case "12":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","力矩预警 3");
|
||||
dataMap.put("warn_note","力矩预警 3");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("momentWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("momentWarning_"+sn),"0"));
|
||||
break;
|
||||
case "13":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","风速过大");
|
||||
dataMap.put("warn_note","风速过大");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("windSpeedWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("windSpeedWarning_"+sn),"0"));
|
||||
break;
|
||||
case "14":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","倾角过大");
|
||||
dataMap.put("warn_note","倾角过大");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("leanWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("leanWarning_"+sn),"0"));
|
||||
break;
|
||||
case "15":
|
||||
dataMap.put("warn_type","1");
|
||||
dataMap.put("warn_context","碰撞预警");
|
||||
dataMap.put("warn_note","碰撞预警");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("collisionDistanceWarning_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("collisionDistanceWarning_"+sn),"0"));
|
||||
break;
|
||||
case "101":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","高限位");
|
||||
dataMap.put("warn_note","高限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("highLimitAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("highLimitAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "102":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","远方限位");
|
||||
dataMap.put("warn_note","远方限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("frontLimitAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("frontLimitAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "103":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","近方限位");
|
||||
dataMap.put("warn_note","近方限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("backLimitAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("backLimitAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "104":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","左转限位");
|
||||
dataMap.put("warn_note","左转限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("leftLimitAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("leftLimitAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "105":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","右转限位");
|
||||
dataMap.put("warn_note","右转限位");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("rightLimitAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("rightLimitAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "106":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","重量超重!重量限制最大值");
|
||||
dataMap.put("warn_note","重量超重!重量限制最大值");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("loadAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("loadAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "107":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","力矩超载!力矩限制最大值");
|
||||
dataMap.put("warn_note","力矩超载!力矩限制最大值");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("momentAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("momentAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "108":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","风速过大");
|
||||
dataMap.put("warn_note","风速过大");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("windSpeedAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("windSpeedAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "109":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","倾角过大");
|
||||
dataMap.put("warn_note","倾角过大");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("leanAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("leanAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "110":
|
||||
dataMap.put("warn_type","2");
|
||||
dataMap.put("warn_context","碰撞报警");
|
||||
dataMap.put("warn_note","碰撞报警");
|
||||
dataMap.put("warn_data",Convert.toStr(cacheMap.get("collisionDistanceAlarm_"+sn),"0"));
|
||||
dataMap.put("real_data",Convert.toStr(cacheMap.get("collisionDistanceAlarm_"+sn),"0"));
|
||||
break;
|
||||
case "201":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","风速仪数据异常");
|
||||
dataMap.put("warn_note","风速仪数据异常");
|
||||
break;
|
||||
case "202":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","高度数据异常");
|
||||
dataMap.put("warn_note","高度数据异常");
|
||||
break;
|
||||
case "203":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","幅度数据异常");
|
||||
dataMap.put("warn_note","幅度数据异常");
|
||||
break;
|
||||
case "204":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","回转数据异常");
|
||||
dataMap.put("warn_note","回转数据异常");
|
||||
break;
|
||||
case "205":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","重量数据异常");
|
||||
dataMap.put("warn_note","重量数据异常");
|
||||
break;
|
||||
case "207":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","力矩数据异常");
|
||||
dataMap.put("warn_note","力矩数据异常");
|
||||
break;
|
||||
case "208":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","人脸识别摄像头异常");
|
||||
dataMap.put("warn_note","人脸识别摄像头异常");
|
||||
break;
|
||||
case "301":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","抽烟警报");
|
||||
dataMap.put("warn_note","抽烟警报");
|
||||
break;
|
||||
case "302":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","打电话警报");
|
||||
dataMap.put("warn_note","打电话警报");
|
||||
break;
|
||||
case "303":
|
||||
dataMap.put("warn_type","3");
|
||||
dataMap.put("warn_context","疲劳警报");
|
||||
dataMap.put("warn_note","疲劳警报");
|
||||
break;
|
||||
default:
|
||||
dataMap.put("warn_type",null);
|
||||
break;
|
||||
}
|
||||
dataMap.put("warn_time",DateUtils.getTime());
|
||||
|
||||
if(Objects.nonNull(dataMap.get("warn_type"))){
|
||||
HttpUtil.post(HOST+"/api/device/warnRecord",dataMap,-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机上报限位信息
|
||||
* @param req
|
||||
*/
|
||||
private void pushLimitData(TowerReqVo req){
|
||||
String sn = req.getContent().getDeviceKey();
|
||||
Map<String, Object> dataContent = req.getContent().getDataContent();
|
||||
|
||||
cacheMap.put("loadWarning_"+sn,dataContent.get("loadWarning"));
|
||||
cacheMap.put("highLimitWarning_"+sn,dataContent.get("highLimitWarning"));
|
||||
cacheMap.put("windSpeedWarning_"+sn,dataContent.get("windSpeedWarning"));
|
||||
cacheMap.put("windSpeedAlarm_"+sn,dataContent.get("windSpeedAlarm"));
|
||||
cacheMap.put("loadAlarm_"+sn,dataContent.get("loadAlarm"));
|
||||
cacheMap.put("momentWarning_"+sn,dataContent.get("momentWarning"));
|
||||
cacheMap.put("momentAlarm_"+sn,dataContent.get("momentAlarm"));
|
||||
cacheMap.put("highLimitAlarm_"+sn,dataContent.get("highLimitAlarm"));
|
||||
cacheMap.put("lowLimitWarning_"+sn,dataContent.get("lowLimitWarning"));
|
||||
cacheMap.put("lowLimitAlarm_"+sn,dataContent.get("lowLimitAlarm"));
|
||||
cacheMap.put("leftLimitWarning_"+sn,dataContent.get("leftLimitWarning"));
|
||||
cacheMap.put("leftLimitAlarm_"+sn,dataContent.get("leftLimitAlarm"));
|
||||
cacheMap.put("rightLimitWarning_"+sn,dataContent.get("rightLimitWarning"));
|
||||
cacheMap.put("rightLimitAlarm_"+sn,dataContent.get("rightLimitAlarm"));
|
||||
cacheMap.put("frontLimitWarning_"+sn,dataContent.get("frontLimitWarning"));
|
||||
cacheMap.put("frontLimitAlarm_"+sn,dataContent.get("frontLimitAlarm"));
|
||||
cacheMap.put("backLimitWarning_"+sn,dataContent.get("backLimitWarning"));
|
||||
cacheMap.put("backLimitAlarm_"+sn,dataContent.get("backLimitAlarm"));
|
||||
cacheMap.put("collisionAngleWarning_"+sn,dataContent.get("collisionAngleWarning"));
|
||||
cacheMap.put("collisionAngleAlarm_"+sn,dataContent.get("collisionAngleAlarm"));
|
||||
cacheMap.put("collisionDistanceWarning_"+sn,dataContent.get("collisionDistanceWarning"));
|
||||
cacheMap.put("collisionDistanceAlarm_"+sn,dataContent.get("collisionDistanceAlarm"));
|
||||
cacheMap.put("hDistanceWarning_"+sn,dataContent.get("hDistanceWarning"));
|
||||
cacheMap.put("hDistanceAlarm_"+sn,dataContent.get("hDistanceAlarm"));
|
||||
cacheMap.put("vDistanceWarning_"+sn,dataContent.get("vDistanceWarning"));
|
||||
cacheMap.put("vDistanceAlarm_"+sn,dataContent.get("vDistanceAlarm"));
|
||||
cacheMap.put("leanWarning_"+sn,dataContent.get("leanWarning"));
|
||||
cacheMap.put("leanAlarm_"+sn,dataContent.get("leanAlarm"));
|
||||
cacheMap.put("rangeLimitStart_"+sn,dataContent.get("rangeLimitStart"));
|
||||
cacheMap.put("rangeLimitEnd_"+sn,dataContent.get("rangeLimitEnd"));
|
||||
cacheMap.put("heightLimitStart_"+sn,dataContent.get("heightLimitStart"));
|
||||
cacheMap.put("heightLimitEnd_"+sn,dataContent.get("heightLimitEnd"));
|
||||
cacheMap.put("rotationLimitStart_"+sn,dataContent.get("rotationLimitStart"));
|
||||
cacheMap.put("rotationLimitEnd_"+sn,dataContent.get("rotationLimitEnd"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 塔机上报标定位信息
|
||||
* @param req
|
||||
*/
|
||||
private void pushLocalData(TowerReqVo req){}
|
||||
}
|
|
@ -0,0 +1,339 @@
|
|||
package com.yanzhu.xd.system.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 塔基检测配置对象 dev_tower_project_config
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-08-04
|
||||
*/
|
||||
public class DevTowerProjectConfig extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 项目主键 */
|
||||
private Long projectId;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
/** 总包单位主键 */
|
||||
private Long deptId;
|
||||
|
||||
/** 总包单位名称 */
|
||||
@Excel(name = "总包单位名称")
|
||||
private String deptName;
|
||||
|
||||
/** 设备序列号 */
|
||||
@Excel(name = "设备序列号")
|
||||
private String deviceSn;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
/** 设备来源 */
|
||||
@Excel(name = "设备来源")
|
||||
private String deviceSource;
|
||||
|
||||
/** 塔机编号 */
|
||||
@Excel(name = "塔机编号")
|
||||
private String towerId;
|
||||
|
||||
/** 塔机类型 */
|
||||
@Excel(name = "塔机类型")
|
||||
private String towerType;
|
||||
|
||||
/** 塔机坐标x */
|
||||
@Excel(name = "塔机坐标x")
|
||||
private String coordinateX;
|
||||
|
||||
/** 塔机坐标y */
|
||||
@Excel(name = "塔机坐标y")
|
||||
private String coordinateY;
|
||||
|
||||
/** 前臂长度 */
|
||||
@Excel(name = "前臂长度")
|
||||
private String frontBrachium;
|
||||
|
||||
/** 平衡臂长度 */
|
||||
@Excel(name = "平衡臂长度")
|
||||
private String afterBrachium;
|
||||
|
||||
/** 塔身高度 */
|
||||
@Excel(name = "塔身高度")
|
||||
private String towerBodyHeight;
|
||||
|
||||
/** 塔帽高度 */
|
||||
@Excel(name = "塔帽高度")
|
||||
private String towerCapHeight;
|
||||
|
||||
/** 塔节高度 */
|
||||
@Excel(name = "塔节高度")
|
||||
private String towerSectionHeight;
|
||||
|
||||
/** 设备状态 */
|
||||
@Excel(name = "设备状态")
|
||||
private String online;
|
||||
|
||||
/** 司机名称 */
|
||||
@Excel(name = "司机名称")
|
||||
private String driName;
|
||||
|
||||
/** 司机电话 */
|
||||
@Excel(name = "司机电话")
|
||||
private String driPhone;
|
||||
|
||||
/** 安全员名称 */
|
||||
@Excel(name = "安全员名称")
|
||||
private String safName;
|
||||
|
||||
/** 安全员电话 */
|
||||
@Excel(name = "安全员电话")
|
||||
private String safPhone;
|
||||
|
||||
/** 是否有效 */
|
||||
@Excel(name = "是否有效")
|
||||
private Long isDel;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setProjectId(Long projectId)
|
||||
{
|
||||
this.projectId = projectId;
|
||||
}
|
||||
|
||||
public Long getProjectId()
|
||||
{
|
||||
return projectId;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setDeviceSn(String deviceSn)
|
||||
{
|
||||
this.deviceSn = deviceSn;
|
||||
}
|
||||
|
||||
public String getDeviceSn()
|
||||
{
|
||||
return deviceSn;
|
||||
}
|
||||
|
||||
public String getDeviceName() {
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceName(String deviceName) {
|
||||
this.deviceName = deviceName;
|
||||
}
|
||||
|
||||
public void setDeviceSource(String deviceSource)
|
||||
{
|
||||
this.deviceSource = deviceSource;
|
||||
}
|
||||
|
||||
public String getDeviceSource()
|
||||
{
|
||||
return deviceSource;
|
||||
}
|
||||
|
||||
public String getTowerId() {
|
||||
return towerId;
|
||||
}
|
||||
|
||||
public void setTowerId(String towerId) {
|
||||
this.towerId = towerId;
|
||||
}
|
||||
|
||||
public void setTowerType(String towerType)
|
||||
{
|
||||
this.towerType = towerType;
|
||||
}
|
||||
|
||||
public String getTowerType()
|
||||
{
|
||||
return towerType;
|
||||
}
|
||||
public void setCoordinateX(String coordinateX)
|
||||
{
|
||||
this.coordinateX = coordinateX;
|
||||
}
|
||||
|
||||
public String getCoordinateX()
|
||||
{
|
||||
return coordinateX;
|
||||
}
|
||||
public void setCoordinateY(String coordinateY)
|
||||
{
|
||||
this.coordinateY = coordinateY;
|
||||
}
|
||||
|
||||
public String getCoordinateY()
|
||||
{
|
||||
return coordinateY;
|
||||
}
|
||||
public void setFrontBrachium(String frontBrachium)
|
||||
{
|
||||
this.frontBrachium = frontBrachium;
|
||||
}
|
||||
|
||||
public String getFrontBrachium()
|
||||
{
|
||||
return frontBrachium;
|
||||
}
|
||||
public void setAfterBrachium(String afterBrachium)
|
||||
{
|
||||
this.afterBrachium = afterBrachium;
|
||||
}
|
||||
|
||||
public String getAfterBrachium()
|
||||
{
|
||||
return afterBrachium;
|
||||
}
|
||||
public void setTowerBodyHeight(String towerBodyHeight)
|
||||
{
|
||||
this.towerBodyHeight = towerBodyHeight;
|
||||
}
|
||||
|
||||
public String getTowerBodyHeight()
|
||||
{
|
||||
return towerBodyHeight;
|
||||
}
|
||||
public void setTowerCapHeight(String towerCapHeight)
|
||||
{
|
||||
this.towerCapHeight = towerCapHeight;
|
||||
}
|
||||
|
||||
public String getTowerCapHeight()
|
||||
{
|
||||
return towerCapHeight;
|
||||
}
|
||||
public void setTowerSectionHeight(String towerSectionHeight)
|
||||
{
|
||||
this.towerSectionHeight = towerSectionHeight;
|
||||
}
|
||||
|
||||
public String getTowerSectionHeight()
|
||||
{
|
||||
return towerSectionHeight;
|
||||
}
|
||||
|
||||
public String getOnline() {
|
||||
return online;
|
||||
}
|
||||
|
||||
public void setOnline(String online) {
|
||||
this.online = online;
|
||||
}
|
||||
|
||||
public String getDriName() {
|
||||
return driName;
|
||||
}
|
||||
|
||||
public void setDriName(String driName) {
|
||||
this.driName = driName;
|
||||
}
|
||||
|
||||
public String getDriPhone() {
|
||||
return driPhone;
|
||||
}
|
||||
|
||||
public void setDriPhone(String driPhone) {
|
||||
this.driPhone = driPhone;
|
||||
}
|
||||
|
||||
public String getSafName() {
|
||||
return safName;
|
||||
}
|
||||
|
||||
public void setSafName(String safName) {
|
||||
this.safName = safName;
|
||||
}
|
||||
|
||||
public String getSafPhone() {
|
||||
return safPhone;
|
||||
}
|
||||
|
||||
public void setSafPhone(String safPhone) {
|
||||
this.safPhone = safPhone;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
public void setProjectName(String projectName) {
|
||||
this.projectName = projectName;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("projectId", getProjectId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("deviceSn", getDeviceSn())
|
||||
.append("deviceName", getDeviceName())
|
||||
.append("deviceSource", getDeviceSource())
|
||||
.append("towerType", getTowerType())
|
||||
.append("coordinateX", getCoordinateX())
|
||||
.append("coordinateY", getCoordinateY())
|
||||
.append("frontBrachium", getFrontBrachium())
|
||||
.append("afterBrachium", getAfterBrachium())
|
||||
.append("towerBodyHeight", getTowerBodyHeight())
|
||||
.append("towerCapHeight", getTowerCapHeight())
|
||||
.append("towerSectionHeight", getTowerSectionHeight())
|
||||
.append("online", getOnline())
|
||||
.append("driName", getDriName())
|
||||
.append("driPhone", getDriPhone())
|
||||
.append("safName", getSafName())
|
||||
.append("safPhone", getSafPhone())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
package com.yanzhu.xd.system.domain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 塔吊检测推送信息 请求内容
|
||||
*
|
||||
* @author: JiangYuQi
|
||||
* @date: 2024/01/13 12:21
|
||||
*/
|
||||
public class TowerContentReqVo {
|
||||
|
||||
/**
|
||||
* 数据产生的时间戳
|
||||
*/
|
||||
private Long time;
|
||||
|
||||
/**
|
||||
* 数据类型
|
||||
*/
|
||||
private String dataType;
|
||||
|
||||
/**
|
||||
* 设备序列号,唯一标识 84E0*****
|
||||
*/
|
||||
private String deviceKey;
|
||||
|
||||
/**
|
||||
* 上报内容
|
||||
*/
|
||||
private Map<String, Object> dataContent;
|
||||
|
||||
/**
|
||||
* 碰撞信息
|
||||
*/
|
||||
private Map<String, Object> localDeviceInfo;
|
||||
|
||||
/**
|
||||
* 碰撞塔吊设备信息
|
||||
*/
|
||||
private List<Map<String, Object>> collideTowers;
|
||||
|
||||
public Long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(Long time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getDataType() {
|
||||
return dataType;
|
||||
}
|
||||
|
||||
public void setDataType(String dataType) {
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getDeviceKey() {
|
||||
return deviceKey;
|
||||
}
|
||||
|
||||
public void setDeviceKey(String deviceKey) {
|
||||
this.deviceKey = deviceKey;
|
||||
}
|
||||
|
||||
public Map<String, Object> getDataContent() {
|
||||
return dataContent;
|
||||
}
|
||||
|
||||
public void setDataContent(Map<String, Object> dataContent) {
|
||||
this.dataContent = dataContent;
|
||||
}
|
||||
|
||||
public Map<String, Object> getLocalDeviceInfo() {
|
||||
return localDeviceInfo;
|
||||
}
|
||||
|
||||
public void setLocalDeviceInfo(Map<String, Object> localDeviceInfo) {
|
||||
this.localDeviceInfo = localDeviceInfo;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getCollideTowers() {
|
||||
return collideTowers;
|
||||
}
|
||||
|
||||
public void setCollideTowers(List<Map<String, Object>> collideTowers) {
|
||||
this.collideTowers = collideTowers;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.yanzhu.xd.system.domain;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 塔吊检测推送信息 请求参数
|
||||
*
|
||||
* @author: JiangYuQi
|
||||
* @date: 2024/01/13 12:21
|
||||
*/
|
||||
public class TowerReqVo {
|
||||
|
||||
/**
|
||||
* 上报类型
|
||||
*/
|
||||
@NotNull(message = "上报类型不能为空")
|
||||
private int type;
|
||||
|
||||
/**
|
||||
* 上报内容
|
||||
*/
|
||||
@NotNull(message = "上报内容不能为空")
|
||||
private TowerContentReqVo content;
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public TowerContentReqVo getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(TowerContentReqVo content) {
|
||||
this.content = content;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.yanzhu.xd.system.emuns;
|
||||
|
||||
/**
|
||||
* 缓存的key 常量
|
||||
*
|
||||
* @author JiangYuQi
|
||||
*/
|
||||
public class CacheConstants {
|
||||
|
||||
/**
|
||||
* yanzhu设备塔吊检测 redis key
|
||||
*/
|
||||
public static final String YANZHU_DEVICE_TOWER = "device.tower_cfg:";
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.yanzhu.xd.system.emuns;
|
||||
|
||||
/**
|
||||
* 塔吊数据类型
|
||||
*/
|
||||
public enum TowerTypeEnums {
|
||||
|
||||
BASE(118,"塔机上报基本信息"),
|
||||
RUN(111,"塔机上报实时数据"),
|
||||
ROUND(119,"塔机上报工作循环数据"),
|
||||
COLLIDE(116,"塔机上报碰撞信息"),
|
||||
LIMIT(120,"塔机上报限位信息"),
|
||||
LOCAL(121,"塔机上报标定位信息");
|
||||
|
||||
private final int code;
|
||||
private final String info;
|
||||
|
||||
TowerTypeEnums(int code, String info)
|
||||
{
|
||||
this.code = code;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getInfo()
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.yanzhu.xd.system.mapper;
|
||||
|
||||
import com.yanzhu.xd.system.domain.DevTowerProjectConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 塔基检测配置Mapper接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-08-04
|
||||
*/
|
||||
public interface DevTowerProjectConfigMapper
|
||||
{
|
||||
/**
|
||||
* 查询塔基检测配置
|
||||
*
|
||||
* @param id 塔基检测配置主键
|
||||
* @return 塔基检测配置
|
||||
*/
|
||||
public DevTowerProjectConfig selectDevTowerProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询塔基检测配置列表
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 塔基检测配置集合
|
||||
*/
|
||||
public List<DevTowerProjectConfig> selectDevTowerProjectConfigList(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 新增塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevTowerProjectConfig(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 修改塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevTowerProjectConfig(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 删除塔基检测配置
|
||||
*
|
||||
* @param id 塔基检测配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevTowerProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除塔基检测配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevTowerProjectConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 根据设备状态统计设备
|
||||
* @param devTowerProjectConfig
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findtowerConfigGroupOnline(DevTowerProjectConfig devTowerProjectConfig);
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.yanzhu.xd.system.service;
|
||||
|
||||
import com.yanzhu.xd.system.domain.DevTowerProjectConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 塔基检测配置Service接口
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-08-04
|
||||
*/
|
||||
public interface IDevTowerProjectConfigService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询塔基检测配置
|
||||
*
|
||||
* @param id 塔基检测配置主键
|
||||
* @return 塔基检测配置
|
||||
*/
|
||||
public DevTowerProjectConfig selectDevTowerProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 查询塔基检测配置列表
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 塔基检测配置集合
|
||||
*/
|
||||
public List<DevTowerProjectConfig> selectDevTowerProjectConfigList(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 新增塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDevTowerProjectConfig(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 修改塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevTowerProjectConfig(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 修改塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDevTowerProjectConfigNoCache(DevTowerProjectConfig devTowerProjectConfig);
|
||||
|
||||
/**
|
||||
* 批量删除塔基检测配置
|
||||
*
|
||||
* @param ids 需要删除的塔基检测配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevTowerProjectConfigByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除塔基检测配置信息
|
||||
*
|
||||
* @param id 塔基检测配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDevTowerProjectConfigById(Long id);
|
||||
|
||||
/**
|
||||
* 根据设备状态统计设备
|
||||
* @param devTowerProjectConfig
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findtowerConfigGroupOnline(DevTowerProjectConfig devTowerProjectConfig);
|
||||
}
|
|
@ -0,0 +1,128 @@
|
|||
package com.yanzhu.xd.system.service.impl;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.ShiroUtils;
|
||||
import com.yanzhu.xd.system.domain.DevTowerProjectConfig;
|
||||
import com.yanzhu.xd.system.mapper.DevTowerProjectConfigMapper;
|
||||
import com.yanzhu.xd.system.service.IDevTowerProjectConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 塔基检测配置Service业务层处理
|
||||
*
|
||||
* @author JiangYuQi
|
||||
* @date 2024-08-04
|
||||
*/
|
||||
@Service
|
||||
public class DevTowerProjectConfigServiceImpl implements IDevTowerProjectConfigService
|
||||
{
|
||||
|
||||
@Autowired
|
||||
private DevTowerProjectConfigMapper devTowerProjectConfigMapper;
|
||||
|
||||
/**
|
||||
* 查询塔基检测配置
|
||||
*
|
||||
* @param id 塔基检测配置主键
|
||||
* @return 塔基检测配置
|
||||
*/
|
||||
@Override
|
||||
public DevTowerProjectConfig selectDevTowerProjectConfigById(Long id)
|
||||
{
|
||||
return devTowerProjectConfigMapper.selectDevTowerProjectConfigById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询塔基检测配置列表
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 塔基检测配置
|
||||
*/
|
||||
@Override
|
||||
public List<DevTowerProjectConfig> selectDevTowerProjectConfigList(DevTowerProjectConfig devTowerProjectConfig)
|
||||
{
|
||||
return devTowerProjectConfigMapper.selectDevTowerProjectConfigList(devTowerProjectConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDevTowerProjectConfig(DevTowerProjectConfig devTowerProjectConfig)
|
||||
{
|
||||
devTowerProjectConfig.setCreateBy(ShiroUtils.getLoginName());
|
||||
devTowerProjectConfig.setCreateTime(DateUtils.getNowDate());
|
||||
int res = devTowerProjectConfigMapper.insertDevTowerProjectConfig(devTowerProjectConfig);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDevTowerProjectConfig(DevTowerProjectConfig devTowerProjectConfig)
|
||||
{
|
||||
devTowerProjectConfig.setUpdateBy(ShiroUtils.getLoginName());
|
||||
devTowerProjectConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
int res = devTowerProjectConfigMapper.updateDevTowerProjectConfig(devTowerProjectConfig);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改塔基检测配置
|
||||
*
|
||||
* @param devTowerProjectConfig 塔基检测配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDevTowerProjectConfigNoCache(DevTowerProjectConfig devTowerProjectConfig)
|
||||
{
|
||||
devTowerProjectConfig.setUpdateTime(DateUtils.getNowDate());
|
||||
return devTowerProjectConfigMapper.updateDevTowerProjectConfig(devTowerProjectConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除塔基检测配置
|
||||
*
|
||||
* @param ids 需要删除的塔基检测配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDevTowerProjectConfigByIds(Long[] ids)
|
||||
{
|
||||
int res = devTowerProjectConfigMapper.deleteDevTowerProjectConfigByIds(ids);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除塔基检测配置信息
|
||||
*
|
||||
* @param id 塔基检测配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDevTowerProjectConfigById(Long id)
|
||||
{
|
||||
int res = devTowerProjectConfigMapper.deleteDevTowerProjectConfigById(id);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备状态统计设备
|
||||
* @param devTowerProjectConfig
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String, Object>> findtowerConfigGroupOnline(DevTowerProjectConfig devTowerProjectConfig){
|
||||
return devTowerProjectConfigMapper.findtowerConfigGroupOnline(devTowerProjectConfig);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
<?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.yanzhu.xd.system.mapper.DevTowerProjectConfigMapper">
|
||||
|
||||
<resultMap type="DevTowerProjectConfig" id="DevTowerProjectConfigResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="projectName" column="projectName" />
|
||||
<result property="deptId" column="dept_id" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="deviceSn" column="device_sn" />
|
||||
<result property="deviceName" column="device_name" />
|
||||
<result property="deviceSource" column="device_source" />
|
||||
<result property="towerId" column="tower_id" />
|
||||
<result property="towerType" column="tower_type" />
|
||||
<result property="coordinateX" column="coordinate_x" />
|
||||
<result property="coordinateY" column="coordinate_y" />
|
||||
<result property="frontBrachium" column="front_brachium" />
|
||||
<result property="afterBrachium" column="after_brachium" />
|
||||
<result property="towerBodyHeight" column="tower_body_height" />
|
||||
<result property="towerCapHeight" column="tower_cap_height" />
|
||||
<result property="towerSectionHeight" column="tower_section_height" />
|
||||
<result property="online" column="online" />
|
||||
<result property="driName" column="dri_name" />
|
||||
<result property="driPhone" column="dri_phone" />
|
||||
<result property="safName" column="saf_name" />
|
||||
<result property="safPhone" column="saf_phone" />
|
||||
<result property="isDel" column="is_del" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDevTowerProjectConfigVo">
|
||||
select dtpc.id, dtpc.project_id, dtpc.dept_id, sp.projectName, sd.dept_name, dtpc.device_sn, dtpc.device_name, dtpc.device_source, dtpc.tower_id, dtpc.tower_type, dtpc.coordinate_x, dtpc.coordinate_y, dtpc.front_brachium, dtpc.after_brachium, dtpc.tower_body_height, dtpc.tower_cap_height, dtpc.tower_section_height, dtpc.online, dtpc.dri_name, dtpc.dri_phone, dtpc.saf_name, dtpc.saf_phone, dtpc.is_del, dtpc.create_by, dtpc.create_time, dtpc.update_by, dtpc.update_time, dtpc.remark from dev_tower_project_config dtpc
|
||||
left join sur_project sp on sp.id = dtpc.project_id
|
||||
left join sys_dept sd on sd.dept_id = dtpc.dept_id
|
||||
</sql>
|
||||
|
||||
<select id="selectDevTowerProjectConfigList" parameterType="DevTowerProjectConfig" resultMap="DevTowerProjectConfigResult">
|
||||
<include refid="selectDevTowerProjectConfigVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and dtpc.project_id = #{projectId}</if>
|
||||
<if test="projectName != null and projectName != ''"> and sp.projectName like concat('%', #{projectName}, '%')</if>
|
||||
<if test="deptId != null "> and dtpc.dept_id = #{deptId}</if>
|
||||
<if test="deptName != null and deptName != ''"> and sd.dept_name like concat('%', #{deptName}, '%')</if>
|
||||
<if test="deviceSn != null and deviceSn != ''"> and dtpc.device_sn = #{deviceSn}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and dtpc.device_name like concat('%', #{deviceName}, '%')</if>
|
||||
<if test="deviceSource != null and deviceSource != ''"> and dtpc.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtpc.tower_id = #{towerId}</if>
|
||||
<if test="towerType != null and towerType != ''"> and dtpc.tower_type = #{towerType}</if>
|
||||
<if test="isDel != null "> and dtpc.is_del = #{isDel}</if>
|
||||
</where>
|
||||
order by dtpc.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectDevTowerProjectConfigById" parameterType="Long" resultMap="DevTowerProjectConfigResult">
|
||||
<include refid="selectDevTowerProjectConfigVo"/>
|
||||
where dtpc.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertDevTowerProjectConfig" parameterType="DevTowerProjectConfig" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into dev_tower_project_config
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
<if test="deviceSn != null">device_sn,</if>
|
||||
<if test="deviceName != null">device_name,</if>
|
||||
<if test="deviceSource != null">device_source,</if>
|
||||
<if test="towerType != null">tower_type,</if>
|
||||
<if test="towerId != null">tower_id,</if>
|
||||
<if test="coordinateX != null">coordinate_x,</if>
|
||||
<if test="coordinateY != null">coordinate_y,</if>
|
||||
<if test="frontBrachium != null">front_brachium,</if>
|
||||
<if test="afterBrachium != null">after_brachium,</if>
|
||||
<if test="towerBodyHeight != null">tower_body_height,</if>
|
||||
<if test="towerCapHeight != null">tower_cap_height,</if>
|
||||
<if test="towerSectionHeight != null">tower_section_height,</if>
|
||||
<if test="online != null">online,</if>
|
||||
<if test="driName != null">dri_name,</if>
|
||||
<if test="driPhone != null">dri_phone,</if>
|
||||
<if test="safName != null">saf_name,</if>
|
||||
<if test="safPhone != null">saf_phone,</if>
|
||||
<if test="isDel != null">is_del,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
<if test="deviceSn != null">#{deviceSn},</if>
|
||||
<if test="deviceName != null">#{deviceName},</if>
|
||||
<if test="deviceSource != null">#{deviceSource},</if>
|
||||
<if test="towerType != null">#{towerType},</if>
|
||||
<if test="towerId != null">#{towerId},</if>
|
||||
<if test="coordinateX != null">#{coordinateX},</if>
|
||||
<if test="coordinateY != null">#{coordinateY},</if>
|
||||
<if test="frontBrachium != null">#{frontBrachium},</if>
|
||||
<if test="afterBrachium != null">#{afterBrachium},</if>
|
||||
<if test="towerBodyHeight != null">#{towerBodyHeight},</if>
|
||||
<if test="towerCapHeight != null">#{towerCapHeight},</if>
|
||||
<if test="towerSectionHeight != null">#{towerSectionHeight},</if>
|
||||
<if test="online != null">#{online},</if>
|
||||
<if test="driName != null">#{driName},</if>
|
||||
<if test="driPhone != null">#{driPhone},</if>
|
||||
<if test="safName != null">#{safName},</if>
|
||||
<if test="safPhone != null">#{safPhone},</if>
|
||||
<if test="isDel != null">#{isDel},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDevTowerProjectConfig" parameterType="DevTowerProjectConfig">
|
||||
update dev_tower_project_config
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="deptId != null">dept_id = #{deptId},</if>
|
||||
<if test="deviceSn != null">device_sn = #{deviceSn},</if>
|
||||
<if test="deviceName != null">device_name = #{deviceName},</if>
|
||||
<if test="deviceSource != null">device_source = #{deviceSource},</if>
|
||||
<if test="towerType != null">tower_type = #{towerType},</if>
|
||||
<if test="towerId != null">tower_id = #{towerId},</if>
|
||||
<if test="coordinateX != null">coordinate_x = #{coordinateX},</if>
|
||||
<if test="coordinateY != null">coordinate_y = #{coordinateY},</if>
|
||||
<if test="frontBrachium != null">front_brachium = #{frontBrachium},</if>
|
||||
<if test="afterBrachium != null">after_brachium = #{afterBrachium},</if>
|
||||
<if test="towerBodyHeight != null">tower_body_height = #{towerBodyHeight},</if>
|
||||
<if test="towerCapHeight != null">tower_cap_height = #{towerCapHeight},</if>
|
||||
<if test="towerSectionHeight != null">tower_section_height = #{towerSectionHeight},</if>
|
||||
<if test="online != null">online = #{online},</if>
|
||||
<if test="driName != null">dri_name = #{driName},</if>
|
||||
<if test="driPhone != null">dri_phone = #{driPhone},</if>
|
||||
<if test="safName != null">saf_name = #{safName},</if>
|
||||
<if test="safPhone != null">saf_phone = #{safPhone},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</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>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteDevTowerProjectConfigById" parameterType="Long">
|
||||
update dev_tower_project_config set is_del=1 where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteDevTowerProjectConfigByIds" parameterType="String">
|
||||
update dev_tower_project_config set is_del=1 where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="findtowerConfigGroupOnline" parameterType="DevTowerProjectConfig" resultType="Map">
|
||||
select online, count(1) as total from dev_tower_project_config
|
||||
<where>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="deptId != null "> and dept_id = #{deptId}</if>
|
||||
</where>
|
||||
group by online
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue