Merge branch 'dyf-device' into 6170
# Conflicts: # fys-admin/src/main/java/com/fuyuanshen/web/controller/device/DeviceShareController.java
This commit is contained in:
@ -39,7 +39,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 查询设备充放电记录列表
|
* 查询设备充放电记录列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("equipment:chargeDischarge:list")
|
// @SaCheckPermission("equipment:chargeDischarge:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<DeviceChargeDischargeVo> list(DeviceChargeDischargeBo bo, PageQuery pageQuery) {
|
public TableDataInfo<DeviceChargeDischargeVo> list(DeviceChargeDischargeBo bo, PageQuery pageQuery) {
|
||||||
return deviceChargeDischargeService.queryPageList(bo, pageQuery);
|
return deviceChargeDischargeService.queryPageList(bo, pageQuery);
|
||||||
@ -48,7 +48,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 设备充放电记录列表
|
* 设备充放电记录列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("equipment:chargeDischarge:export")
|
// @SaCheckPermission("equipment:chargeDischarge:export")
|
||||||
@Log(title = "设备充放电记录", businessType = BusinessType.EXPORT)
|
@Log(title = "设备充放电记录", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(DeviceChargeDischargeBo bo, HttpServletResponse response) {
|
public void export(DeviceChargeDischargeBo bo, HttpServletResponse response) {
|
||||||
@ -61,7 +61,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("equipment:chargeDischarge:query")
|
// @SaCheckPermission("equipment:chargeDischarge:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<DeviceChargeDischargeVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<DeviceChargeDischargeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
@ -71,7 +71,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 新增设备充放电记录
|
* 新增设备充放电记录
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("equipment:chargeDischarge:add")
|
// @SaCheckPermission("equipment:chargeDischarge:add")
|
||||||
@Log(title = "设备充放电记录", businessType = BusinessType.INSERT)
|
@Log(title = "设备充放电记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
@ -82,7 +82,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 修改设备充放电记录
|
* 修改设备充放电记录
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("equipment:chargeDischarge:edit")
|
// @SaCheckPermission("equipment:chargeDischarge:edit")
|
||||||
@Log(title = "设备充放电记录", businessType = BusinessType.UPDATE)
|
@Log(title = "设备充放电记录", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
@ -95,11 +95,13 @@ public class DeviceChargeDischargeController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param ids 主键串
|
* @param ids 主键串
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("equipment:chargeDischarge:remove")
|
// @SaCheckPermission("equipment:chargeDischarge:remove")
|
||||||
@Log(title = "设备充放电记录", businessType = BusinessType.DELETE)
|
@Log(title = "设备充放电记录", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
@PathVariable Long[] ids) {
|
@PathVariable Long[] ids) {
|
||||||
return toAjax(deviceChargeDischargeService.deleteWithValidByIds(List.of(ids), true));
|
return toAjax(deviceChargeDischargeService.deleteWithValidByIds(List.of(ids), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package com.fuyuanshen.web.controller.device;
|
|||||||
|
|
||||||
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
|
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
|
||||||
import com.fuyuanshen.common.core.domain.R;
|
import com.fuyuanshen.common.core.domain.R;
|
||||||
|
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.common.web.core.BaseController;
|
import com.fuyuanshen.common.web.core.BaseController;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceLog;
|
import com.fuyuanshen.equipment.domain.DeviceLog;
|
||||||
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
|
import com.fuyuanshen.equipment.domain.vo.DeviceAlarmVo;
|
||||||
@ -65,7 +67,7 @@ public class WEBDeviceController extends BaseController {
|
|||||||
* @param deviceId
|
* @param deviceId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "设备详情")
|
@Operation(summary = "设备用户详情")
|
||||||
@GetMapping(value = "/getDeviceUser/{deviceId}")
|
@GetMapping(value = "/getDeviceUser/{deviceId}")
|
||||||
public R<List<AppPersonnelInfoRecords>> getDeviceUser(@PathVariable Long deviceId) {
|
public R<List<AppPersonnelInfoRecords>> getDeviceUser(@PathVariable Long deviceId) {
|
||||||
List<AppPersonnelInfoRecords> device = deviceService.getDeviceUser(deviceId);
|
List<AppPersonnelInfoRecords> device = deviceService.getDeviceUser(deviceId);
|
||||||
@ -77,13 +79,18 @@ public class WEBDeviceController extends BaseController {
|
|||||||
* 设备操作记录
|
* 设备操作记录
|
||||||
*
|
*
|
||||||
* @param deviceId
|
* @param deviceId
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "设备操作记录")
|
@Operation(summary = "设备操作记录")
|
||||||
@GetMapping(value = "/getOperationRecord/{deviceId}")
|
@GetMapping(value = "/getOperationRecord/{deviceId}")
|
||||||
public R<List<DeviceLog>> getOperationRecord(@PathVariable Long deviceId) {
|
public TableDataInfo<DeviceLog> getOperationRecord(@PathVariable Long deviceId,
|
||||||
List<DeviceLog> device = deviceService.getOperationRecord(deviceId);
|
@RequestParam(required = false) String startTime,
|
||||||
return R.ok(device);
|
@RequestParam(required = false) String endTime,
|
||||||
|
PageQuery pageQuery) {
|
||||||
|
TableDataInfo<DeviceLog> device = deviceService.getOperationRecord(deviceId, startTime, endTime,pageQuery);
|
||||||
|
return device;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -91,13 +98,17 @@ public class WEBDeviceController extends BaseController {
|
|||||||
* 设备告警记录
|
* 设备告警记录
|
||||||
*
|
*
|
||||||
* @param deviceId
|
* @param deviceId
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "设备告警记录")
|
@Operation(summary = "设备告警记录")
|
||||||
@GetMapping(value = "/getAlarmRecord/{deviceId}")
|
@GetMapping(value = "/getAlarmRecord/{deviceId}")
|
||||||
public R<List<DeviceAlarmVo>> getAlarmRecord(@PathVariable Long deviceId) {
|
public TableDataInfo<DeviceAlarmVo> getAlarmRecord(@PathVariable Long deviceId,
|
||||||
List<DeviceAlarmVo> device = deviceService.getAlarmRecord(deviceId);
|
@RequestParam(required = false) String startTime,
|
||||||
return R.ok(device);
|
@RequestParam(required = false) String endTime,
|
||||||
|
PageQuery pageQuery) {
|
||||||
|
return deviceService.getAlarmRecord(deviceId, startTime, endTime, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,16 +53,21 @@ public interface WEBDeviceService extends IService<Device> {
|
|||||||
* 设备操作记录
|
* 设备操作记录
|
||||||
*
|
*
|
||||||
* @param deviceId
|
* @param deviceId
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DeviceLog> getOperationRecord(Long deviceId);
|
TableDataInfo<DeviceLog> getOperationRecord(Long deviceId, String startTime, String endTime, PageQuery pageQuery);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备告警记录
|
* 设备告警记录
|
||||||
*
|
*
|
||||||
* @param deviceId
|
* @param deviceId
|
||||||
|
* @param startTime 开始时间
|
||||||
|
* @param endTime 结束时间
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<DeviceAlarmVo> getAlarmRecord(Long deviceId);
|
TableDataInfo<DeviceAlarmVo> getAlarmRecord(Long deviceId, String startTime, String endTime, PageQuery pageQuery);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,20 @@
|
|||||||
package com.fuyuanshen.web.service.impl;
|
package com.fuyuanshen.web.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuyuanshen.app.domain.AppDeviceBindRecord;
|
import com.fuyuanshen.app.domain.AppDeviceBindRecord;
|
||||||
import com.fuyuanshen.app.domain.AppDeviceShare;
|
import com.fuyuanshen.app.domain.AppDeviceShare;
|
||||||
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
|
import com.fuyuanshen.app.domain.AppPersonnelInfoRecords;
|
||||||
import com.fuyuanshen.app.domain.vo.AppDeviceShareVo;
|
|
||||||
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
import com.fuyuanshen.app.mapper.AppDeviceBindRecordMapper;
|
||||||
import com.fuyuanshen.app.mapper.AppDeviceShareMapper;
|
import com.fuyuanshen.app.mapper.AppDeviceShareMapper;
|
||||||
import com.fuyuanshen.app.mapper.AppPersonnelInfoRecordsMapper;
|
import com.fuyuanshen.app.mapper.AppPersonnelInfoRecordsMapper;
|
||||||
|
import com.fuyuanshen.common.mybatis.core.page.PageQuery;
|
||||||
|
import com.fuyuanshen.common.mybatis.core.page.TableDataInfo;
|
||||||
import com.fuyuanshen.equipment.domain.Device;
|
import com.fuyuanshen.equipment.domain.Device;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceAlarm;
|
import com.fuyuanshen.equipment.domain.DeviceAlarm;
|
||||||
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
import com.fuyuanshen.equipment.domain.DeviceAssignments;
|
||||||
@ -23,7 +27,6 @@ import com.fuyuanshen.equipment.mapper.DeviceAssignmentsMapper;
|
|||||||
import com.fuyuanshen.equipment.mapper.DeviceLogMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceLogMapper;
|
||||||
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
import com.fuyuanshen.equipment.mapper.DeviceMapper;
|
||||||
import com.fuyuanshen.web.service.WEBDeviceService;
|
import com.fuyuanshen.web.service.WEBDeviceService;
|
||||||
import com.fuyuanshen.web.service.device.DeviceBizService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -129,11 +132,19 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceLog> getOperationRecord(Long deviceId) {
|
public TableDataInfo<DeviceLog> getOperationRecord(Long deviceId, String startTime, String endTime, PageQuery pageQuery) {
|
||||||
List<DeviceLog> logList = deviceLogMapper.selectList(
|
Page<DeviceLog> page = pageQuery.build();
|
||||||
new QueryWrapper<DeviceLog>().eq("device_id", deviceId)
|
QueryWrapper<DeviceLog> queryWrapper = new QueryWrapper<DeviceLog>().eq("device_id", deviceId);
|
||||||
.orderByDesc("create_time"));
|
|
||||||
return logList;
|
if (StrUtil.isNotEmpty(startTime)) {
|
||||||
|
queryWrapper.ge("create_time", startTime);
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(endTime)) {
|
||||||
|
queryWrapper.le("create_time", endTime);
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
IPage<DeviceLog> logList = deviceLogMapper.selectPage(page, queryWrapper);
|
||||||
|
return TableDataInfo.build(logList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,13 +155,23 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DeviceAlarmVo> getAlarmRecord(Long deviceId) {
|
public TableDataInfo getAlarmRecord(Long deviceId, String startTime, String endTime, PageQuery pageQuery) {
|
||||||
List<DeviceAlarm> alarmList = deviceAlarmMapper.selectList(
|
Page<DeviceAlarm> page = pageQuery.build();
|
||||||
new QueryWrapper<DeviceAlarm>().eq("device_id", deviceId)
|
QueryWrapper<DeviceAlarm> queryWrapper = new QueryWrapper<DeviceAlarm>().eq("device_id", deviceId);
|
||||||
.orderByDesc("create_time"));
|
|
||||||
List<DeviceAlarmVo> deviceAlarmVoList = BeanUtil.copyToList(alarmList, DeviceAlarmVo.class);
|
if (StrUtil.isNotEmpty(startTime)) {
|
||||||
return deviceAlarmVoList;
|
queryWrapper.ge("start_time", startTime);
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(endTime)) {
|
||||||
|
queryWrapper.le("start_time", endTime);
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc("start_time");
|
||||||
|
IPage<DeviceAlarm> alarmPage = deviceAlarmMapper.selectPage(page, queryWrapper);
|
||||||
|
|
||||||
|
// List<DeviceAlarmVo> deviceAlarmVoList = BeanUtil.copyToList(alarmPage.getRecords(), DeviceAlarmVo.class);
|
||||||
|
return TableDataInfo.build(alarmPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,9 @@ import com.fuyuanshen.common.tenant.core.TenantEntity;
|
|||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
@ -63,7 +65,6 @@ public class DeviceAlarm extends TenantEntity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 经度
|
* 经度
|
||||||
|
|
||||||
*/
|
*/
|
||||||
private Long longitude;
|
private Long longitude;
|
||||||
|
|
||||||
@ -90,7 +91,7 @@ public class DeviceAlarm extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 报警持续时间
|
* 报警持续时间
|
||||||
*/
|
*/
|
||||||
private Long durationTime;
|
private String durationTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0已处理,1未处理
|
* 0已处理,1未处理
|
||||||
|
Reference in New Issue
Block a user