郑州水利调整
This commit is contained in:
parent
f237f78ebf
commit
37d6f98823
@ -25,6 +25,9 @@ public class TunnelBoringMachineStatVo {
|
||||
@ApiModelProperty(value = "隧道总里程")
|
||||
private String totalMileage;
|
||||
|
||||
@ApiModelProperty(value = "隧道总长度")
|
||||
private String totalLength;
|
||||
|
||||
@ApiModelProperty(value = "最新一条实时数据")
|
||||
private TunnelBoringMachineCurrentDataVo tunnelBoringMachineCurrentDataVo;
|
||||
|
||||
|
||||
@ -269,8 +269,8 @@ public class TunnelBoringMachineCurrentDataServiceImpl extends ServiceImpl<Tunne
|
||||
List<TunnelBoringMachineStat> machineStatList = tunnelBoringMachineStatMapper.selectList(Wrappers.<TunnelBoringMachineStat>lambdaQuery()
|
||||
.eq(TunnelBoringMachineStat::getProjectSn, projectSn)
|
||||
.eq(TunnelBoringMachineStat::getDevSn, deviceSn)
|
||||
.ge(TunnelBoringMachineStat::getCreateTime, DateUtil.beginOfMonth(new Date()))
|
||||
.le(TunnelBoringMachineStat::getCreateTime, DateUtil.endOfMonth(new Date())));
|
||||
.ge(TunnelBoringMachineStat::getCreateTime, DateUtil.offsetDay(new Date(), -16))
|
||||
.le(TunnelBoringMachineStat::getCreateTime, new Date()));
|
||||
TunnelBoringMachineStatVo tunnelBoringMachineStatVo = new TunnelBoringMachineStatVo();
|
||||
tunnelBoringMachineStatVo.setTotalMileage(tunnelBoringMachine.getTotalMileage());
|
||||
tunnelBoringMachineStatVo.setTotalNumber(tunnelBoringMachine.getTotalNumber());
|
||||
@ -278,7 +278,7 @@ public class TunnelBoringMachineCurrentDataServiceImpl extends ServiceImpl<Tunne
|
||||
tunnelBoringMachineStatVo.setNumberByMonth(lastData.getMonthNumber());
|
||||
tunnelBoringMachineStatVo.setTunnelBoringMachineCurrentDataVo(lastData);
|
||||
tunnelBoringMachineStatVo.setCompleteRatio(tunnelBoringMachine.getTotalNumber() == null ? "0" : new BigDecimal(lastData.getCurrentNumber()).divide(new BigDecimal(tunnelBoringMachine.getTotalNumber()),
|
||||
4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).toString());
|
||||
3,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100)).setScale(1).toString());
|
||||
List<String> dayList = DateUtils.getNowFewDaysAgoList(15);
|
||||
List<TunnelBoringMachineStat> resultList = new ArrayList<>();
|
||||
for (String s : dayList) {
|
||||
@ -292,12 +292,13 @@ public class TunnelBoringMachineCurrentDataServiceImpl extends ServiceImpl<Tunne
|
||||
TunnelBoringMachineStat tunnelBoringMachineStat = new TunnelBoringMachineStat();
|
||||
tunnelBoringMachineStat.setNumber(0);
|
||||
tunnelBoringMachineStat.setDevSn(tunnelBoringMachine.getDevSn());
|
||||
tunnelBoringMachineStat.setProjectSn(tunnelBoringMachineStat.getProjectSn());
|
||||
tunnelBoringMachineStat.setProjectSn(tunnelBoringMachine.getProjectSn());
|
||||
tunnelBoringMachineStat.setCreateTime(DateUtil.parseDate(s));
|
||||
resultList.add(tunnelBoringMachineStat);
|
||||
}
|
||||
}
|
||||
tunnelBoringMachineStatVo.setTunnelBoringMachineStats(resultList);
|
||||
tunnelBoringMachineStatVo.setTotalLength(new BigDecimal(tunnelBoringMachineStatVo.getTunnelBoringMachineCurrentDataVo().getCurrentNumber()).multiply(new BigDecimal(1.2)).setScale(0, BigDecimal.ROUND_HALF_UP).toString());
|
||||
return tunnelBoringMachineStatVo;
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ public class LocationApiController {
|
||||
@Autowired
|
||||
private ILocationDataService locationDataService;
|
||||
|
||||
@ApiOperation(value = "上传低电量报警数据", notes = "上传低电量报警数据", httpMethod = "POST")
|
||||
@ApiOperation(value = "上传低电量/求救/静止报警数据", notes = "上传低电量/求救/静止报警数据", httpMethod = "POST")
|
||||
@PostMapping(value = "/api/uploadTagLowVoltageAlarm")
|
||||
public JiLianDaRt uploadTagLowVoltageAlarm(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
log.info("uploadTagLowVoltageAlarm:{}", JSON.toJSONString(paramMap));
|
||||
|
||||
@ -21,6 +21,7 @@ import springfox.documentation.annotations.ApiIgnore;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@ -77,5 +78,13 @@ public class LocationTagLowVoltageAlarmController {
|
||||
return Result.success(locationTagLowVoltageAlarmService.countLocationTagLowVoltageAlarmEveryDay(paramMap));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "统计每天低电量报警数量", notes = "统计每天低电量报警数量", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "locationTunnelId", value = "定位隧道信息id", paramType = "body", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countLocationTagLowVoltageAlarmEveryDayByType")
|
||||
public Result<List<Map<String, Object>>> countLocationTagLowVoltageAlarmEveryDayByType(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(locationTagLowVoltageAlarmService.countLocationTagLowVoltageAlarmEveryDayByType(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -184,6 +184,15 @@ public class LocationData implements Serializable {
|
||||
private String tunnelId;
|
||||
@ApiModelProperty(value = "工作时长(秒)")
|
||||
private Integer workingTime;
|
||||
@Excel(name = "班组名称 ", width = 15)
|
||||
@ApiModelProperty(value = "班组名称 ")
|
||||
private String teamName;
|
||||
@Excel(name = "设备名称", width = 15)
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
@Excel(name = "电话号码", width = 15)
|
||||
@ApiModelProperty(value = "电话号码")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty(value = "工作时长中文显示")
|
||||
@TableField(exist = false)
|
||||
|
||||
@ -23,7 +23,7 @@ import java.util.Date;
|
||||
@Data
|
||||
@TableName("location_tag_low_voltage_alarm")
|
||||
@ApiModel(value = "LocationTagLowVoltageAlarm实体类", description = "LocationTagLowVoltageAlarm")
|
||||
public class LocationTagLowVoltageAlarm implements Serializable {
|
||||
public class LocationTagLowVoltageAlarm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
@ -92,6 +92,36 @@ public class LocationTagLowVoltageAlarm implements Serializable {
|
||||
@Excel(name = "当前电量 百分比", width = 15)
|
||||
@ApiModelProperty(value = "当前电量 百分比")
|
||||
private java.lang.Integer voltage;
|
||||
/**
|
||||
* 所在区域ID
|
||||
*/
|
||||
@Excel(name = "所在区域ID", width = 15)
|
||||
@ApiModelProperty(value = "所在区域ID")
|
||||
private java.lang.String regionId;
|
||||
/**
|
||||
* 所在区域名称
|
||||
*/
|
||||
@Excel(name = "所在区域名称", width = 15)
|
||||
@ApiModelProperty(value = "所在区域名称")
|
||||
private java.lang.String regionName;
|
||||
/**
|
||||
* 报警位置(米)
|
||||
*/
|
||||
@Excel(name = "报警位置(米)", width = 15)
|
||||
@ApiModelProperty(value = "报警位置(米)")
|
||||
private java.lang.String nX;
|
||||
/**
|
||||
* 位置桩号
|
||||
*/
|
||||
@Excel(name = "位置桩号", width = 15)
|
||||
@ApiModelProperty(value = "位置桩号")
|
||||
private java.lang.String pileNo;
|
||||
/**
|
||||
* 持续报警时长 单位秒
|
||||
*/
|
||||
@Excel(name = "持续报警时长 单位秒", width = 15)
|
||||
@ApiModelProperty(value = "持续报警时长 单位秒")
|
||||
private Integer durationTime;
|
||||
/**
|
||||
* 报警时间
|
||||
*/
|
||||
|
||||
@ -111,4 +111,11 @@ public class LocationTunnel implements Serializable {
|
||||
private Long realtimeId;
|
||||
@ApiModelProperty(value = "矫正人员图标x方向")
|
||||
private Integer correctorIconXDirection;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "方向(1:从左到右;2:从右到左)")
|
||||
private Integer direction;
|
||||
|
||||
@ApiModelProperty(value = "比例尺")
|
||||
private Integer scale;
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 定位低电量报警
|
||||
@ -28,4 +29,11 @@ public interface ILocationTagLowVoltageAlarmService extends IService<LocationTag
|
||||
* @return
|
||||
*/
|
||||
List<TrendOneVo> countLocationTagLowVoltageAlarmEveryDay(HashMap<String, Object> paramMap);
|
||||
|
||||
/**
|
||||
*统计每天报警类型数量
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> countLocationTagLowVoltageAlarmEveryDayByType(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -1,20 +1,30 @@
|
||||
package com.zhgd.xmgl.modules.location.service.impl;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.gexin.fastjson.JSON;
|
||||
import com.gexin.fastjson.TypeReference;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendOneVo;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TunnelBoringMachineStat;
|
||||
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
||||
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
|
||||
import com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper;
|
||||
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
|
||||
import com.zhgd.xmgl.modules.worker.entity.WorkerInfo;
|
||||
import com.zhgd.xmgl.modules.worker.mapper.WorkerInfoMapper;
|
||||
import com.zhgd.xmgl.util.DateUtils;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 定位低电量报警
|
||||
@ -25,6 +35,15 @@ import java.util.List;
|
||||
@Service
|
||||
public class LocationTagLowVoltageAlarmServiceImpl extends ServiceImpl<LocationTagLowVoltageAlarmMapper, LocationTagLowVoltageAlarm> implements ILocationTagLowVoltageAlarmService {
|
||||
|
||||
@Autowired
|
||||
private INoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
private ISystemUserService systemUserService;
|
||||
|
||||
@Autowired
|
||||
private WorkerInfoMapper workerInfoMapper;
|
||||
|
||||
@Override
|
||||
public JiLianDaRt uploadTagLowVoltageAlarm(HashMap<String, Object> paramMap) {
|
||||
String data = MapUtils.getString(paramMap, "data");
|
||||
@ -32,11 +51,33 @@ public class LocationTagLowVoltageAlarmServiceImpl extends ServiceImpl<LocationT
|
||||
});
|
||||
for (LocationTagLowVoltageAlarm alarm : alarms) {
|
||||
alarm.setProjectSn(alarm.getProjectId());
|
||||
List<WorkerInfo> workerInfoList = workerInfoMapper.selectList(Wrappers.<WorkerInfo>lambdaQuery().eq(WorkerInfo::getLocationCardno, alarm.getCardno()));
|
||||
if (workerInfoList.size() > 0) {
|
||||
String msg = "";
|
||||
String title = "";
|
||||
List<Long> systemUserList = systemUserService.list(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getSn, alarm.getProjectSn())
|
||||
.eq(SystemUser::getAccountType, 5)).stream().map(u -> u.getUserId()).collect(Collectors.toList());
|
||||
if (alarm.getAlarmType().equals("2140")) {
|
||||
title = "隧道内低电量报警提醒";
|
||||
msg = StrUtil.format("【{}】【{}】标签电量过低,请及时充电保证设备正常工作!", workerInfoList.get(0).getWorkerName(), alarm.getCardno());
|
||||
} else if (alarm.getAlarmType().equals("2430")) {
|
||||
title = "隧道内求救报警提醒";
|
||||
msg = StrUtil.format("【{}】【{}】发出一键求救报警消息,管理员需立即组织应急小组进行救援!", workerInfoList.get(0).getWorkerName(), alarm.getCardno());
|
||||
} else if (alarm.getAlarmType().equals("2490")) {
|
||||
title = "隧道内静止报警提醒";
|
||||
msg = StrUtil.format("【{}】【{}】长时间处于静止状态,管理员需及时确认人员是否安全", workerInfoList.get(0).getWorkerName(), alarm.getCardno());
|
||||
}
|
||||
noticeService.addUsersNotice(systemUserList, title, msg, "50");
|
||||
}
|
||||
baseMapper.insert(alarm);
|
||||
}
|
||||
return JiLianDaRt.success();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrendOneVo> countLocationTagLowVoltageAlarmEveryDay(HashMap<String, Object> paramMap) {
|
||||
List<TrendOneVo> list = baseMapper.countLocationTagLowVoltageAlarmEveryDay(paramMap);
|
||||
@ -45,4 +86,27 @@ public class LocationTagLowVoltageAlarmServiceImpl extends ServiceImpl<LocationT
|
||||
return trendOneVos;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> countLocationTagLowVoltageAlarmEveryDayByType(HashMap<String, Object> paramMap) {
|
||||
String locationTunnelId = MapUtils.getString(paramMap, "locationTunnelId");
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
List<LocationTagLowVoltageAlarm> locationTagLowVoltageAlarms = baseMapper.selectList(Wrappers.<LocationTagLowVoltageAlarm>lambdaQuery()
|
||||
.eq(LocationTagLowVoltageAlarm::getRegionId, locationTunnelId)
|
||||
.eq(LocationTagLowVoltageAlarm::getProjectSn, projectSn));
|
||||
List<String> dayList = DateUtils.getNowFewDaysAgoList(8);
|
||||
List<Map<String, Object>> resultList = new ArrayList<>();
|
||||
for (String s : dayList) {
|
||||
if (s.equals(DateUtil.formatDate(new Date()))) {
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("data", s);
|
||||
map.put("2140", locationTagLowVoltageAlarms.stream().filter(l -> DateUtil.formatDate(l.getCreateTime()).equals(s) && l.getAlarmType().equals("2140")).count());
|
||||
map.put("2430", locationTagLowVoltageAlarms.stream().filter(l -> DateUtil.formatDate(l.getCreateTime()).equals(s) && l.getAlarmType().equals("2430")).count());
|
||||
map.put("2490", locationTagLowVoltageAlarms.stream().filter(l -> DateUtil.formatDate(l.getCreateTime()).equals(s) && l.getAlarmType().equals("2490")).count());
|
||||
resultList.add(map);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -299,8 +299,15 @@ public class VideoItemServiceImpl extends ServiceImpl<VideoItemMapper, VideoItem
|
||||
accessToken = YsVideoUtil.getToken(projectVideoConfig.getAppId(), projectVideoConfig.getAppSecret());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(accessToken)) {
|
||||
Map<String, Object> result = YsVideoUtil.getVideoUrl(projectVideoConfig.getAppId(), projectVideoConfig.getAppSecret(), videoItem.getSerialNumber(), accessToken);
|
||||
data.put("videoInfo", result);
|
||||
// Map<String, Object> result = YsVideoUtil.getVideoUrl(projectVideoConfig.getAppId(), projectVideoConfig.getAppSecret(), videoItem.getSerialNumber(), accessToken);
|
||||
if (StringUtils.isNotBlank(videoItem.getVideoPassword())) {
|
||||
data.put("videoInfo", "ezopen://" + videoItem.getVideoPassword() +"@open.ys7.com/" + videoItem.getSerialNumber() + "/" +
|
||||
videoItem.getVerificationCode() + ".live");
|
||||
} else {
|
||||
data.put("videoInfo", "ezopen://open.ys7.com/" + videoItem.getSerialNumber() + "/" +
|
||||
videoItem.getVerificationCode() + ".live");
|
||||
}
|
||||
// data.put("videoInfo", result);
|
||||
data.put("accessToken", accessToken);
|
||||
data.put("projectVideoConfig", projectVideoConfig);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user