提交代码
parent
c327578d33
commit
ff270ee0c1
|
@ -324,17 +324,17 @@
|
|||
</div>
|
||||
<div class="row-scale">
|
||||
<div class="row-scale-ctx">
|
||||
<div v-for="i in 10" :key="i" class="scale-item"></div>
|
||||
<div v-for="i in reversedList" :key="i" :class="it.scale1>=i?'scale-item-ac':'scale-item'"></div>
|
||||
</div>
|
||||
<span class="sp-data1 sp-data sp-sc">报警:{{ it.data1 }}</span>
|
||||
<span class="sp-data1 sp-data sp-sc" >报警:{{ it.data2 }}</span>
|
||||
<span
|
||||
class="sp-data2 sp-data sp-sc"
|
||||
v-if="it.data2 >= 5"
|
||||
v-if="false"
|
||||
:style="calcTop(it)"
|
||||
>
|
||||
报警:{{ it.data2 }}
|
||||
</span>
|
||||
<span class="sp-sc2 sp-sc">{{ it.scale2 }}</span>
|
||||
<span class="sp-sc2 sp-sc" :style="calcTop(it)">当前:{{ it.data1 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
@ -375,17 +375,20 @@ export default {
|
|||
},
|
||||
selDev: {},
|
||||
devBottomInfo: [
|
||||
{ title: "幅度", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "风速", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "吊重", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "倾角", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "转角", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "高度", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "幅度", data1: 0, data2: 0, scale1: 0, scale2: "0m" },
|
||||
{ title: "风速", data1: 0, data2: 0, scale1: 0, scale2: "0m" },
|
||||
{ title: "吊重", data1: 0, data2: 0, scale1: 0, scale2: "0m" },
|
||||
{ title: "倾角", data1: 0, data2: 0, scale1: 0, scale2: "0m" },
|
||||
{ title: "转角", data1: 0, data2: 0, scale1: 0, scale2: "0m" },
|
||||
{ title: "高度", data1: 0, data2: 0, scale1: 0, scale2: "0m" },
|
||||
],
|
||||
direction: "right",
|
||||
comName: "tower-crane-value-1",
|
||||
warningData: [],
|
||||
momentData: {},
|
||||
momentData: {
|
||||
'dataX':[15,20,25,30,35,40,45,50,55,60],
|
||||
'dataY':[3,3,3,3,2.59,2.2,1.9,1.66,1.46,1.3],
|
||||
},
|
||||
forIndex: 0,
|
||||
warningInterval: undefined,
|
||||
countvwInterval: undefined,
|
||||
|
@ -396,6 +399,11 @@ export default {
|
|||
dicts: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
reversedList() {
|
||||
return Array.from({ length: 10 }, (_, i) => i + 1).reverse();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.safetyApp = this;
|
||||
this.$store.dispatch("ChangeNav", 304);
|
||||
|
@ -416,9 +424,6 @@ export default {
|
|||
this.$api.dict("ssp_proble_sub_type").then((d) => {
|
||||
this.dangerTypeDict = d || [];
|
||||
});
|
||||
this.momentData = JSON.parse(
|
||||
'{"point":[[null,null]],"dataX":[15,20,25,30,35,40,45,50,55,60],"dataY":[3,3,3,3,2.59,2.2,1.9,1.66,1.46,1.3]}'
|
||||
);
|
||||
},
|
||||
created() {
|
||||
this.$api.dict("device_tower_warning").then((d) => {
|
||||
|
@ -542,7 +547,7 @@ export default {
|
|||
},
|
||||
initLimitData() {
|
||||
this.$api.tower.selectDevTowerDataLimitList(this.selProject.id,this.selDev.deviceSn).then((d) => {
|
||||
if (d.length > 0) {
|
||||
if (d.data.length > 0) {
|
||||
this.devBottomInfo[0].data2 = d.data[0].rangeLimitStart;
|
||||
this.devBottomInfo[1].data2 = d.data[0].windSpeedWarning;
|
||||
this.devBottomInfo[2].data2 = d.data[0].loadWarning;
|
||||
|
@ -566,14 +571,40 @@ export default {
|
|||
this.runData.momentPercent = d.data[0].momentPercent;
|
||||
this.runData.windSpeedPercent = d.data[0].windSpeedPercent;
|
||||
this.runData.warnings = d.data[0].warnings;
|
||||
this.devBottomInfo[0].data1 = d.data[0].range;
|
||||
this.devBottomInfo[1].data1 = d.data[0].windSpeed;
|
||||
this.devBottomInfo[2].data1 = d.data[0].load;
|
||||
this.devBottomInfo[3].data1 = d.data[0].leanAnglePercent
|
||||
? d.data[0].leanAnglePercent
|
||||
: 0;
|
||||
this.devBottomInfo[4].data1 = d.data[0].rotation;
|
||||
this.devBottomInfo[5].data1 = d.data[0].height;
|
||||
this.devBottomInfo[0].data1 = d.data[0].range||0;
|
||||
this.devBottomInfo[1].data1 = d.data[0].windSpeed||0;
|
||||
this.devBottomInfo[2].data1 = d.data[0].load||0;
|
||||
this.devBottomInfo[3].data1 = d.data[0].leanAnglePercent||0;
|
||||
this.devBottomInfo[4].data1 = d.data[0].rotation||0;
|
||||
this.devBottomInfo[5].data1 = d.data[0].height||0;
|
||||
if(this.devBottomInfo[0].data1>0 && this.devBottomInfo[0].data2>0){
|
||||
this.devBottomInfo[0].scale1 = Math.round((this.devBottomInfo[0].data1/this.devBottomInfo[0].data2)*10);
|
||||
}
|
||||
if(this.devBottomInfo[1].data1>0 && this.devBottomInfo[1].data2>0){
|
||||
this.devBottomInfo[1].scale1 = Math.round((this.devBottomInfo[1].data1/this.devBottomInfo[1].data2)*10);
|
||||
}
|
||||
if(this.devBottomInfo[2].data1>0 && this.devBottomInfo[2].data2>0){
|
||||
this.devBottomInfo[2].scale1 = Math.round((this.devBottomInfo[2].data1/this.devBottomInfo[2].data2)*10);
|
||||
}
|
||||
if(this.devBottomInfo[3].data1>0 && this.devBottomInfo[3].data2>0){
|
||||
this.devBottomInfo[3].scale1 = Math.round((this.devBottomInfo[3].data1/this.devBottomInfo[3].data2)*10);
|
||||
}
|
||||
if(this.devBottomInfo[4].data1>0 && this.devBottomInfo[4].data2>0){
|
||||
this.devBottomInfo[4].scale1 = Math.round((this.devBottomInfo[4].data1/this.devBottomInfo[4].data2)*10);
|
||||
}
|
||||
if(this.devBottomInfo[5].data1>0 && this.devBottomInfo[5].data2>0){
|
||||
this.devBottomInfo[5].scale1 = Math.round((this.devBottomInfo[5].data1/this.devBottomInfo[5].data2)*10);
|
||||
}
|
||||
let _dataX = [];
|
||||
let _dataY = [];
|
||||
let _dataList = [...d.data].reverse();
|
||||
_dataList.forEach(item => {
|
||||
_dataX.push(item.range);
|
||||
_dataY.push(item.load);
|
||||
});
|
||||
this.momentData.dataX = _dataX;
|
||||
this.momentData.dataY = _dataY;
|
||||
this.itemChartKey1++;
|
||||
}
|
||||
});
|
||||
// 查询塔机预警数据
|
||||
|
@ -587,15 +618,8 @@ export default {
|
|||
});
|
||||
},
|
||||
calcTop(d) {
|
||||
let tmp = 100 - (d.data2 * 100.0) / d.data1;
|
||||
return `top:calc(20px + ${tmp > 78 ? 78 : tmp}%)`;
|
||||
},
|
||||
getRoudValue(a, b) {
|
||||
if (a > 0) {
|
||||
return (parseFloat(a / b) * 100).toFixed(1) + "%";
|
||||
} else {
|
||||
return "0%";
|
||||
}
|
||||
let tmp = d.scale1*16;
|
||||
return `top:calc(222px - ${tmp}px)`;
|
||||
},
|
||||
safeTowerLeft() {
|
||||
this.direction = "left";
|
||||
|
@ -1070,6 +1094,13 @@ export default {
|
|||
background: #002d8d94;
|
||||
border-radius: 5%;
|
||||
}
|
||||
|
||||
.scale-item-ac {
|
||||
margin: 22% 0px;
|
||||
height: 4%;
|
||||
background: #6632fdde;
|
||||
border-radius: 5%;
|
||||
}
|
||||
}
|
||||
|
||||
.sp-sc {
|
||||
|
@ -1303,6 +1334,10 @@ export default {
|
|||
margin: 22% 0px;
|
||||
height: 4%;
|
||||
}
|
||||
.scale-item-ac {
|
||||
margin: 22% 0px;
|
||||
height: 4%;
|
||||
}
|
||||
}
|
||||
|
||||
.sp-sc {
|
||||
|
|
|
@ -68,4 +68,12 @@ public interface DevTowerDataWarningMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int findWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning);
|
||||
|
||||
/**
|
||||
* 查询塔机超载预警数据
|
||||
*
|
||||
* @param devTowerDataWarning 设备预警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int findOverloadWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning);
|
||||
}
|
||||
|
|
|
@ -272,11 +272,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="findRoundCountByDeviceKey" parameterType="DevTowerDataRound" resultType="Int">
|
||||
select count(1) as total from dev_tower_data_round
|
||||
<where>
|
||||
is_del=0
|
||||
<if test="deviceKey != null and deviceKey != ''">and cfg_id in (select dc.id from dev_tower_project_config dc where dc.device_sn=#{deviceKey}) and device_key = #{deviceKey}</if>
|
||||
<if test='activeName == "cz"'> and is_overload = 1 </if>
|
||||
<if test='activeName == "gj"'> and is_alarm = 1 </if>
|
||||
<if test="deviceKey != null and deviceKey != ''">and device_key = #{deviceKey}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and is_del = 0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -212,4 +212,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findOverloadWarningCountByDeviceKey" parameterType="DevTowerDataWarning" resultType="Int">
|
||||
select count(1) as total from dev_tower_data_warning
|
||||
<where>
|
||||
<if test="deviceKey != null and deviceKey != ''">and device_key = #{deviceKey}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and warn_type in (7,8,9,106) and is_del=0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -12,6 +12,7 @@ import com.yanzhu.manage.service.*;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -103,7 +104,7 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataRunList")
|
||||
public AjaxResult selectDevTowerDataRunList(DevTowerDataRun devTowerDataRun)
|
||||
{
|
||||
startPage(1,1);
|
||||
startPage(1,10);
|
||||
devTowerDataRun.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
|
||||
List<DevTowerDataRun> list = devTowerDataRunService.selectDevTowerDataRunList(devTowerDataRun);
|
||||
return success(list);
|
||||
|
@ -119,4 +120,5 @@ public class TowerCraneController extends BaseController {
|
|||
List<DevTowerDataWarning> list = devTowerDataWarningService.selectDevTowerDataWarningList(devTowerDataWarning);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -67,6 +69,11 @@ public class TowerCraneApiController {
|
|||
@Autowired
|
||||
private IDevTowerProjectConfigService devTowerProjectConfigService;
|
||||
|
||||
/**
|
||||
* 塔机限位数据
|
||||
*/
|
||||
private Map<String, DevTowerDataLimit> staticLimitMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 塔吊监测++
|
||||
* 限流规则[60秒内最多请求10次,限流策略IP]
|
||||
|
@ -404,6 +411,21 @@ public class TowerCraneApiController {
|
|||
if (config == null) {
|
||||
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(), HttpStatusEnum.ERROR.getCode());
|
||||
}
|
||||
String deviceKey = req.getEid().toString();
|
||||
DevTowerDataLimit devTowerDataLimit = staticLimitMap.get(deviceKey);
|
||||
if(devTowerDataLimit==null){
|
||||
DevTowerDataLimit devTowerDataLimitQuery = new DevTowerDataLimit();
|
||||
devTowerDataLimitQuery.setDeviceKey(deviceKey);
|
||||
devTowerDataLimitQuery.setProjectId(config.getProjectId());
|
||||
List<DevTowerDataLimit> limitList = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimitQuery);
|
||||
if(limitList.size()>0){
|
||||
devTowerDataLimit = limitList.get(0);
|
||||
staticLimitMap.put(deviceKey,devTowerDataLimit);
|
||||
}else{
|
||||
devTowerDataLimit = new DevTowerDataLimit();
|
||||
}
|
||||
}
|
||||
|
||||
DevTowerDataRun devTowerDataRun = new DevTowerDataRun();
|
||||
devTowerDataRun.setCfgId(config.getId());
|
||||
devTowerDataRun.setProjectId(config.getProjectId());
|
||||
|
@ -412,7 +434,9 @@ public class TowerCraneApiController {
|
|||
devTowerDataRun.setHeight(Convert.toStr(req.getHeight()));
|
||||
devTowerDataRun.setRange(Convert.toStr(req.getRange()));
|
||||
devTowerDataRun.setRotation(Convert.toStr(req.getRotation_angle()));
|
||||
devTowerDataRun.setLoad(Convert.toStr(req.getLifting_weight()));
|
||||
devTowerDataRun.setLoad(String.format("%.2f", req.getLifting_weight()/1000));
|
||||
Double limitLoad = Convert.toDouble(devTowerDataLimit.getLoadAlarm(),50.0);
|
||||
devTowerDataRun.setLoadPercent(String.format("%.2f", (req.getLifting_weight()/10)/limitLoad));
|
||||
devTowerDataRun.setWindSpeed(Convert.toStr(req.getWind_speed()));
|
||||
devTowerDataRun.setLeanAngleX(Convert.toStr(req.getAnteversion_x()));
|
||||
devTowerDataRun.setLeanAngleY(Convert.toStr(req.getAnteversion_y()));
|
||||
|
@ -456,7 +480,7 @@ public class TowerCraneApiController {
|
|||
devTowerDataRound.setEndRange(Convert.toStr(req.getEnd_range()));
|
||||
devTowerDataRound.setStartRotation(Convert.toStr(req.getStart_rotation_angle()));
|
||||
devTowerDataRound.setEndRotation(Convert.toStr(req.getEnd_rotation_angle()));
|
||||
devTowerDataRound.setMaxLoad(Convert.toStr(req.getWeight()));
|
||||
devTowerDataRound.setMaxLoad(String.format("%.2f", req.getWeight()/1000));
|
||||
devTowerDataRound.setMaxMomentPercent(Convert.toStr(req.getMoment_percent()));
|
||||
devTowerDataRoundService.insertDevTowerDataRound(devTowerDataRound);
|
||||
return AjaxResult.success();
|
||||
|
@ -490,7 +514,7 @@ public class TowerCraneApiController {
|
|||
devTowerDataWarning.setHeight(Convert.toStr(req.getHeight()));
|
||||
devTowerDataWarning.setRange(Convert.toStr(req.getRange()));
|
||||
devTowerDataWarning.setRotation(Convert.toStr(req.getRotation()));
|
||||
devTowerDataWarning.setLoad(Convert.toStr(req.getLifting_weight()));
|
||||
devTowerDataWarning.setLoad(String.format("%.2f", req.getLifting_weight()/1000));
|
||||
devTowerDataWarning.setWindSpeed(Convert.toStr(req.getWind_speed()));
|
||||
devTowerDataWarning.setLeanAngleX(Convert.toStr(req.getAnteversion_x()));
|
||||
devTowerDataWarning.setLeanAngleY(Convert.toStr(req.getAnteversion_y()));
|
||||
|
|
|
@ -131,14 +131,11 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
devTowerDataRound.setDeviceKey(deviceSn);
|
||||
int a0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("a0",a0);
|
||||
devTowerDataRound.setActiveName("cz");
|
||||
int b0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("b0",b0);
|
||||
DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning();
|
||||
devTowerDataWarning.setDeviceKey(deviceSn);
|
||||
int b0 = devTowerDataWarningMapper.findOverloadWarningCountByDeviceKey(devTowerDataWarning);
|
||||
dataMap.put("b0",b0);
|
||||
int c0 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
|
||||
//int d0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
//int e0 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("c0",c0);
|
||||
Calendar cale = Calendar.getInstance();
|
||||
// 获取当月第一天和最后一天
|
||||
|
@ -162,12 +159,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
devTowerDataWarning.setParams(params);
|
||||
int a1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("a1",a1);
|
||||
devTowerDataRound.setActiveName("cz");
|
||||
int b1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
int b1 = devTowerDataWarningMapper.findOverloadWarningCountByDeviceKey(devTowerDataWarning);
|
||||
dataMap.put("b1",b1);
|
||||
int c1 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
|
||||
//int d1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
//int e1 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("c1",c1);
|
||||
return dataMap;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue