定位bug修复
This commit is contained in:
parent
8992b5ab35
commit
06f191ca4e
@ -17,7 +17,15 @@ public class TrendVo {
|
|||||||
private String x;
|
private String x;
|
||||||
private String y;
|
private String y;
|
||||||
|
|
||||||
public static List<TrendVo> getTrendVos(List<TrendVo> list, List<String> days, String format) {
|
/**
|
||||||
|
* 补充空的日期和初始值
|
||||||
|
*
|
||||||
|
* @param list 数据的list
|
||||||
|
* @param days 日期的list
|
||||||
|
* @param format 需要转换的时间格式
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<TrendVo> fillTrendVos(List<TrendVo> list, List<String> days, String format) {
|
||||||
Map<String, TrendVo> voMap = list.stream().collect(Collectors.toMap(TrendVo::getX, Function.identity()));
|
Map<String, TrendVo> voMap = list.stream().collect(Collectors.toMap(TrendVo::getX, Function.identity()));
|
||||||
List<TrendVo> rtList = new ArrayList<>();
|
List<TrendVo> rtList = new ArrayList<>();
|
||||||
for (String day : days) {
|
for (String day : days) {
|
||||||
|
|||||||
@ -73,7 +73,7 @@ public class GantryCraneAlarmServiceImpl extends ServiceImpl<GantryCraneAlarmMap
|
|||||||
throw new OpenAlertException("查询时间不能为空");
|
throw new OpenAlertException("查询时间不能为空");
|
||||||
}
|
}
|
||||||
List<String> days = DateUtil.getBetweenDays(startTime, endTime, "yyyy-MM-dd");
|
List<String> days = DateUtil.getBetweenDays(startTime, endTime, "yyyy-MM-dd");
|
||||||
return TrendVo.getTrendVos(list, days, "MM-dd");
|
return TrendVo.fillTrendVos(list, days, "MM-dd");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -20,8 +20,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 龙门吊工作循环
|
* @Description: 龙门吊工作循环
|
||||||
@ -75,6 +73,6 @@ public class GantryCraneWorkCycleServiceImpl extends ServiceImpl<GantryCraneWork
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return TrendVo.getTrendVos(trendVos, days, "MM-dd");
|
return TrendVo.fillTrendVos(trendVos, days, "MM-dd");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,11 +26,11 @@ public class LocationApiController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ILocationDataService locationDataService;
|
private ILocationDataService locationDataService;
|
||||||
|
|
||||||
@ApiOperation(value = "上传气体报警数据", notes = "上传气体报警数据", httpMethod = "POST")
|
@ApiOperation(value = "上传低电量报警数据", notes = "上传低电量报警数据", httpMethod = "POST")
|
||||||
@PostMapping(value = "/api/uploadSensorAlarm")
|
@PostMapping(value = "/api/uploadTagLowVoltageAlarm")
|
||||||
public JiLianDaRt uploadSensorAlarm(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
public JiLianDaRt uploadTagLowVoltageAlarm(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
log.info("uploadSensorAlarm:{}", JSON.toJSONString(paramMap));
|
log.info("uploadTagLowVoltageAlarm:{}", JSON.toJSONString(paramMap));
|
||||||
return locationTagLowVoltageAlarmService.uploadSensorAlarm(paramMap);
|
return locationTagLowVoltageAlarmService.uploadTagLowVoltageAlarm(paramMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "上传全量人员定位实时数据", notes = "上传全量人员定位实时数据", httpMethod = "POST")
|
@ApiOperation(value = "上传全量人员定位实时数据", notes = "上传全量人员定位实时数据", httpMethod = "POST")
|
||||||
|
|||||||
@ -65,72 +65,6 @@ public class LocationDataController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表查询
|
|
||||||
*
|
|
||||||
* @param locationData
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "列表查询定位数据信息", notes = "列表查询定位数据信息", httpMethod = "GET")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<List<LocationData>> queryList(LocationData locationData,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<LocationData> queryWrapper = QueryGenerator.initQueryWrapper(locationData, req.getParameterMap());
|
|
||||||
return Result.success(locationDataService.list(queryWrapper));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param locationData
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "添加定位数据信息", notes = "添加定位数据信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<LocationData> add(@RequestBody LocationData locationData) {
|
|
||||||
locationDataService.save(locationData);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param locationData
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "编辑定位数据信息", notes = "编辑定位数据信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<LocationData> edit(@RequestBody LocationData locationData) {
|
|
||||||
locationDataService.updateById(locationData);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除定位数据信息", notes = "删除定位数据信息", httpMethod = "POST")
|
|
||||||
@ApiImplicitParam(name = "id", value = "定位数据ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
|
||||||
@PostMapping(value = "/delete")
|
|
||||||
public Result<LocationData> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
|
||||||
String id = MapUtils.getString(map, "id");
|
|
||||||
Result<LocationData> result = new Result<LocationData>();
|
|
||||||
LocationData locationData = locationDataService.getById(id);
|
|
||||||
if (locationData == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
boolean ok = locationDataService.removeById(id);
|
|
||||||
if (ok) {
|
|
||||||
result.success("删除成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id查询
|
* 通过id查询
|
||||||
*
|
*
|
||||||
@ -156,6 +90,7 @@ public class LocationDataController {
|
|||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "body", required = true, dataType = "String"),
|
||||||
@ApiImplicitParam(name = "locationTunnelId", value = "定位隧道信息id", paramType = "body", required = true, dataType = "String"),
|
@ApiImplicitParam(name = "locationTunnelId", value = "定位隧道信息id", paramType = "body", required = true, dataType = "String"),
|
||||||
|
@ApiImplicitParam(name = "queryStr", value = "卡号或姓名", paramType = "body", required = false, dataType = "String"),
|
||||||
})
|
})
|
||||||
@PostMapping(value = "/countRealTimeLocationWorker")
|
@PostMapping(value = "/countRealTimeLocationWorker")
|
||||||
public Result<List<RealTimeLocationWorkerVo>> countRealTimeLocationWorker(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
public Result<List<RealTimeLocationWorkerVo>> countRealTimeLocationWorker(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
|
|||||||
@ -1,39 +1,26 @@
|
|||||||
package com.zhgd.xmgl.modules.location.controller;
|
package com.zhgd.xmgl.modules.location.controller;
|
||||||
|
|
||||||
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLDecoder;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
import com.zhgd.jeecg.common.api.vo.Result;
|
|
||||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
|
||||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
|
||||||
import org.apache.commons.collections.MapUtils;
|
|
||||||
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.zhgd.jeecg.common.api.vo.Result;
|
||||||
|
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||||
|
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
||||||
|
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
||||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
||||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Title: Controller
|
* @Title: Controller
|
||||||
@ -78,91 +65,14 @@ public class LocationTagLowVoltageAlarmController {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@ApiOperation(value = "统计每天低电量报警数量", notes = "统计每天低电量报警数量", httpMethod = "POST")
|
||||||
* 列表查询
|
@ApiImplicitParams({
|
||||||
*
|
@ApiImplicitParam(name = "locationTunnelId", value = "定位隧道信息id", paramType = "body", required = true, dataType = "String"),
|
||||||
* @param locationTagLowVoltageAlarm
|
@ApiImplicitParam(name = "type", value = "1一个星期", paramType = "body", required = true, dataType = "String"),
|
||||||
* @param req
|
})
|
||||||
* @return
|
@PostMapping(value = "/countLocationTagLowVoltageAlarmEveryDay")
|
||||||
*/
|
public Result<List<TrendVo>> countLocationTagLowVoltageAlarmEveryDay(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||||
@ApiOperation(value = "列表查询定位低电量报警信息", notes = "列表查询定位低电量报警信息", httpMethod = "GET")
|
return Result.success(locationTagLowVoltageAlarmService.countLocationTagLowVoltageAlarmEveryDay(paramMap));
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<List<LocationTagLowVoltageAlarm>> queryList(LocationTagLowVoltageAlarm locationTagLowVoltageAlarm,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<LocationTagLowVoltageAlarm> queryWrapper = QueryGenerator.initQueryWrapper(locationTagLowVoltageAlarm, req.getParameterMap());
|
|
||||||
return Result.success(locationTagLowVoltageAlarmService.list(queryWrapper));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param locationTagLowVoltageAlarm
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "添加定位低电量报警信息", notes = "添加定位低电量报警信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<LocationTagLowVoltageAlarm> add(@RequestBody LocationTagLowVoltageAlarm locationTagLowVoltageAlarm) {
|
|
||||||
locationTagLowVoltageAlarmService.save(locationTagLowVoltageAlarm);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param locationTagLowVoltageAlarm
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "编辑定位低电量报警信息", notes = "编辑定位低电量报警信息", httpMethod = "POST")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<LocationTagLowVoltageAlarm> edit(@RequestBody LocationTagLowVoltageAlarm locationTagLowVoltageAlarm) {
|
|
||||||
locationTagLowVoltageAlarmService.updateById(locationTagLowVoltageAlarm);
|
|
||||||
return Result.ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除定位低电量报警信息", notes = "删除定位低电量报警信息", httpMethod = "POST")
|
|
||||||
@ApiImplicitParam(name = "id", value = "定位低电量报警ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
|
|
||||||
@PostMapping(value = "/delete")
|
|
||||||
public Result<LocationTagLowVoltageAlarm> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
|
|
||||||
String id = MapUtils.getString(map, "id");
|
|
||||||
Result<LocationTagLowVoltageAlarm> result = new Result<LocationTagLowVoltageAlarm>();
|
|
||||||
LocationTagLowVoltageAlarm locationTagLowVoltageAlarm = locationTagLowVoltageAlarmService.getById(id);
|
|
||||||
if (locationTagLowVoltageAlarm == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
boolean ok = locationTagLowVoltageAlarmService.removeById(id);
|
|
||||||
if (ok) {
|
|
||||||
result.success("删除成功!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "通过id查询定位低电量报警信息", notes = "通过id查询定位低电量报警信息", httpMethod = "GET")
|
|
||||||
@ApiImplicitParam(name = "id", value = "定位低电量报警ID", paramType = "query", required = true, dataType = "Integer")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<LocationTagLowVoltageAlarm> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
||||||
Result<LocationTagLowVoltageAlarm> result = new Result<LocationTagLowVoltageAlarm>();
|
|
||||||
LocationTagLowVoltageAlarm locationTagLowVoltageAlarm = locationTagLowVoltageAlarmService.getById(id);
|
|
||||||
if (locationTagLowVoltageAlarm == null) {
|
|
||||||
result.error500("未找到对应实体");
|
|
||||||
} else {
|
|
||||||
result.setResult(locationTagLowVoltageAlarm);
|
|
||||||
result.setSuccess(true);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.zhgd.xmgl.modules.location.entity;
|
package com.zhgd.xmgl.modules.location.entity;
|
||||||
|
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@ -13,7 +12,6 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.Field;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -249,8 +247,13 @@ public class LocationData implements Serializable {
|
|||||||
@ApiModelProperty(value = "实时数据id")
|
@ApiModelProperty(value = "实时数据id")
|
||||||
private Long realtimeId;
|
private Long realtimeId;
|
||||||
@ApiModelProperty(value = "隧道ID")
|
@ApiModelProperty(value = "隧道ID")
|
||||||
private String tunnel_id;
|
private String tunnelId;
|
||||||
|
@ApiModelProperty(value = "工作时长(秒)")
|
||||||
|
private Integer workingTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作时长中文显示")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String workingTimeName;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String projectId;
|
private String projectId;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
|
|||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 定位低电量报警
|
* @Description: 定位低电量报警
|
||||||
@ -96,7 +97,9 @@ public class LocationTagLowVoltageAlarm implements Serializable {
|
|||||||
*/
|
*/
|
||||||
@Excel(name = "报警时间", width = 15)
|
@Excel(name = "报警时间", width = 15)
|
||||||
@ApiModelProperty(value = "报警时间")
|
@ApiModelProperty(value = "报警时间")
|
||||||
private java.lang.String updateTime;
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date updateTime;
|
||||||
/**
|
/**
|
||||||
* 项目sn
|
* 项目sn
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,9 +1,13 @@
|
|||||||
package com.zhgd.xmgl.modules.location.mapper;
|
package com.zhgd.xmgl.modules.location.mapper;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 定位低电量报警
|
* @Description: 定位低电量报警
|
||||||
* @author: pds
|
* @author: pds
|
||||||
@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface LocationTagLowVoltageAlarmMapper extends BaseMapper<LocationTagLowVoltageAlarm> {
|
public interface LocationTagLowVoltageAlarmMapper extends BaseMapper<LocationTagLowVoltageAlarm> {
|
||||||
|
|
||||||
|
List<TrendVo> countLocationTagLowVoltageAlarmEveryDay(HashMap<String, Object> paramMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,6 +13,10 @@
|
|||||||
<if test="projectSn != null and projectSn != ''">
|
<if test="projectSn != null and projectSn != ''">
|
||||||
and d.project_sn = #{projectSn}
|
and d.project_sn = #{projectSn}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="queryStr != null and queryStr != ''">
|
||||||
|
and (wi.worker_name like concat('%', #{queryStr}, '%') or
|
||||||
|
wi.location_cardno like concat('%', #{queryStr}, '%'))
|
||||||
|
</if>
|
||||||
group by i.id
|
group by i.id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?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">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper">
|
<mapper namespace="com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper">
|
||||||
|
<select id="countLocationTagLowVoltageAlarmEveryDay" resultType="com.zhgd.xmgl.base.entity.vo.TrendVo">
|
||||||
|
select date_format(update_time, '%Y-%m-%d') x, count(*) y
|
||||||
|
from location_tag_low_voltage_alarm
|
||||||
|
where 1 = 1
|
||||||
|
<if test="type == '1'.toString()">
|
||||||
|
and update_time >= date_sub(now(), interval 7 day)
|
||||||
|
</if>
|
||||||
|
group by x
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
package com.zhgd.xmgl.modules.location.service;
|
package com.zhgd.xmgl.modules.location.service;
|
||||||
|
|
||||||
|
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||||
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
|
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 定位低电量报警
|
* @Description: 定位低电量报警
|
||||||
@ -14,6 +16,7 @@ import java.util.HashMap;
|
|||||||
*/
|
*/
|
||||||
public interface ILocationTagLowVoltageAlarmService extends IService<LocationTagLowVoltageAlarm> {
|
public interface ILocationTagLowVoltageAlarmService extends IService<LocationTagLowVoltageAlarm> {
|
||||||
|
|
||||||
JiLianDaRt uploadSensorAlarm(HashMap<String, Object> paramMap);
|
JiLianDaRt uploadTagLowVoltageAlarm(HashMap<String, Object> paramMap);
|
||||||
|
|
||||||
|
List<TrendVo> countLocationTagLowVoltageAlarmEveryDay(HashMap<String, Object> paramMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.location.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.codec.Base64;
|
import cn.hutool.core.codec.Base64;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
@ -19,6 +20,7 @@ import com.zhgd.xmgl.modules.location.mapper.LocationDataMapper;
|
|||||||
import com.zhgd.xmgl.modules.location.mapper.LocationTunnelMapper;
|
import com.zhgd.xmgl.modules.location.mapper.LocationTunnelMapper;
|
||||||
import com.zhgd.xmgl.modules.location.service.ILocationDataService;
|
import com.zhgd.xmgl.modules.location.service.ILocationDataService;
|
||||||
import com.zhgd.xmgl.util.RefUtil;
|
import com.zhgd.xmgl.util.RefUtil;
|
||||||
|
import com.zhgd.xmgl.util.TimeUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -46,7 +48,13 @@ public class LocationDataServiceImpl extends ServiceImpl<LocationDataMapper, Loc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<LocationData> getRealTimeLocationWorker(HashMap<String, Object> paramMap) {
|
public List<LocationData> getRealTimeLocationWorker(HashMap<String, Object> paramMap) {
|
||||||
return baseMapper.getRealTimeLocationWorker(paramMap);
|
List<LocationData> locationDataList = baseMapper.getRealTimeLocationWorker(paramMap);
|
||||||
|
for (LocationData locationData : locationDataList) {
|
||||||
|
if (locationData.getWorkingTime() != null) {
|
||||||
|
locationData.setWorkingTimeName(TimeUtil.toHourMinSecond(locationData.getWorkingTime()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return locationDataList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -71,7 +79,12 @@ public class LocationDataServiceImpl extends ServiceImpl<LocationDataMapper, Loc
|
|||||||
}
|
}
|
||||||
locationData.setProjectSn(locationData.getProjectId());
|
locationData.setProjectSn(locationData.getProjectId());
|
||||||
locationData.setRealtimeId(l);
|
locationData.setRealtimeId(l);
|
||||||
locationData.setTunnel_id(locationData.getRegionId());
|
locationData.setTunnelId(locationData.getRegionId());
|
||||||
|
try {
|
||||||
|
locationData.setPY(Double.valueOf(RandomUtil.randomInt(tunnel.getYValueRandomRangeStart(), tunnel.getYValueRandomRangeEnd())));
|
||||||
|
} catch (Exception e) {
|
||||||
|
locationData.setPY(Double.valueOf(tunnel.getYValueRandomRangeStart()));
|
||||||
|
}
|
||||||
baseMapper.insert(locationData);
|
baseMapper.insert(locationData);
|
||||||
tunnel.setRealtimeId(l);
|
tunnel.setRealtimeId(l);
|
||||||
locationTunnelMapper.updateById(tunnel);
|
locationTunnelMapper.updateById(tunnel);
|
||||||
|
|||||||
@ -3,14 +3,18 @@ package com.zhgd.xmgl.modules.location.service.impl;
|
|||||||
import cn.hutool.core.codec.Base64;
|
import cn.hutool.core.codec.Base64;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gexin.fastjson.JSON;
|
import com.gexin.fastjson.JSON;
|
||||||
|
import com.gexin.fastjson.TypeReference;
|
||||||
|
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||||
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
import com.zhgd.xmgl.modules.location.entity.LocationTagLowVoltageAlarm;
|
||||||
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
|
import com.zhgd.xmgl.modules.location.entity.dto.JiLianDaRt;
|
||||||
import com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper;
|
import com.zhgd.xmgl.modules.location.mapper.LocationTagLowVoltageAlarmMapper;
|
||||||
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
|
import com.zhgd.xmgl.modules.location.service.ILocationTagLowVoltageAlarmService;
|
||||||
|
import com.zhgd.xmgl.util.DateUtil;
|
||||||
import org.apache.commons.collections.MapUtils;
|
import org.apache.commons.collections.MapUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 定位低电量报警
|
* @Description: 定位低电量报警
|
||||||
@ -22,12 +26,23 @@ import java.util.HashMap;
|
|||||||
public class LocationTagLowVoltageAlarmServiceImpl extends ServiceImpl<LocationTagLowVoltageAlarmMapper, LocationTagLowVoltageAlarm> implements ILocationTagLowVoltageAlarmService {
|
public class LocationTagLowVoltageAlarmServiceImpl extends ServiceImpl<LocationTagLowVoltageAlarmMapper, LocationTagLowVoltageAlarm> implements ILocationTagLowVoltageAlarmService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JiLianDaRt uploadSensorAlarm(HashMap<String, Object> paramMap) {
|
public JiLianDaRt uploadTagLowVoltageAlarm(HashMap<String, Object> paramMap) {
|
||||||
String data = MapUtils.getString(paramMap, "data");
|
String data = MapUtils.getString(paramMap, "data");
|
||||||
LocationTagLowVoltageAlarm alarm = JSON.parseObject(Base64.decodeStr(data), LocationTagLowVoltageAlarm.class);
|
List<LocationTagLowVoltageAlarm> alarms = JSON.parseObject(Base64.decodeStr(data), new TypeReference<List<LocationTagLowVoltageAlarm>>() {
|
||||||
alarm.setProjectSn(alarm.getProjectId());
|
});
|
||||||
baseMapper.insert(alarm);
|
for (LocationTagLowVoltageAlarm alarm : alarms) {
|
||||||
|
alarm.setProjectSn(alarm.getProjectId());
|
||||||
|
baseMapper.insert(alarm);
|
||||||
|
}
|
||||||
return JiLianDaRt.success();
|
return JiLianDaRt.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TrendVo> countLocationTagLowVoltageAlarmEveryDay(HashMap<String, Object> paramMap) {
|
||||||
|
List<TrendVo> list = baseMapper.countLocationTagLowVoltageAlarmEveryDay(paramMap);
|
||||||
|
List<String> days = DateUtil.getDaysBetweenLastWeek();
|
||||||
|
List<TrendVo> trendVos = TrendVo.fillTrendVos(list, days, "MM-dd");
|
||||||
|
return trendVos;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -239,8 +239,10 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/xmgl/poisonousGasDevCurrentData/add").permitAll()
|
.antMatchers("/xmgl/poisonousGasDevCurrentData/add").permitAll()
|
||||||
.antMatchers("/xmgl/concreteMonitorAlarm/add").permitAll()
|
.antMatchers("/xmgl/concreteMonitorAlarm/add").permitAll()
|
||||||
.antMatchers("/api/uploadLocationDataList").permitAll()
|
.antMatchers("/api/uploadLocationDataList").permitAll()
|
||||||
.antMatchers("/api/uploadSensorAlarm").permitAll()
|
.antMatchers("/api/uploadTagLowVoltageAlarm").permitAll()
|
||||||
.antMatchers("/xmgl/towerJackingRecord/add").permitAll()
|
.antMatchers("/xmgl/towerJackingRecord/add").permitAll()
|
||||||
|
.antMatchers("/xmgl/sjSafeEnvironmentFile/uploadfile").permitAll()
|
||||||
|
.antMatchers("/api/uploadTagLowVoltageAlarm").permitAll()
|
||||||
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
|
||||||
.anyRequest().authenticated() // 剩下所有的验证都需要验证
|
.anyRequest().authenticated() // 剩下所有的验证都需要验证
|
||||||
.and()
|
.and()
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
package com.zhgd.xmgl.util;
|
package com.zhgd.xmgl.util;
|
||||||
|
|
||||||
public class TimeUtil {
|
public class TimeUtil {
|
||||||
|
/**
|
||||||
|
* 获取时分秒中文显示
|
||||||
|
*
|
||||||
|
* @param second
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public static String toHourMinSecond(Integer second) {
|
public static String toHourMinSecond(Integer second) {
|
||||||
if (second == null) {
|
if (second == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user