设备操作记录 分页
This commit is contained in:
@ -39,7 +39,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
||||
/**
|
||||
* 查询设备充放电记录列表
|
||||
*/
|
||||
@SaCheckPermission("equipment:chargeDischarge:list")
|
||||
// @SaCheckPermission("equipment:chargeDischarge:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DeviceChargeDischargeVo> list(DeviceChargeDischargeBo bo, PageQuery 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)
|
||||
@PostMapping("/export")
|
||||
public void export(DeviceChargeDischargeBo bo, HttpServletResponse response) {
|
||||
@ -61,7 +61,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("equipment:chargeDischarge:query")
|
||||
// @SaCheckPermission("equipment:chargeDischarge:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<DeviceChargeDischargeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@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)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
@ -82,7 +82,7 @@ public class DeviceChargeDischargeController extends BaseController {
|
||||
/**
|
||||
* 修改设备充放电记录
|
||||
*/
|
||||
@SaCheckPermission("equipment:chargeDischarge:edit")
|
||||
// @SaCheckPermission("equipment:chargeDischarge:edit")
|
||||
@Log(title = "设备充放电记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
@ -95,11 +95,13 @@ public class DeviceChargeDischargeController extends BaseController {
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("equipment:chargeDischarge:remove")
|
||||
// @SaCheckPermission("equipment:chargeDischarge:remove")
|
||||
@Log(title = "设备充放电记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(deviceChargeDischargeService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -85,11 +85,12 @@ public class WEBDeviceController extends BaseController {
|
||||
*/
|
||||
@Operation(summary = "设备操作记录")
|
||||
@GetMapping(value = "/getOperationRecord/{deviceId}")
|
||||
public R<List<DeviceLog>> getOperationRecord(@PathVariable Long deviceId,
|
||||
public TableDataInfo<DeviceLog> getOperationRecord(@PathVariable Long deviceId,
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime) {
|
||||
List<DeviceLog> device = deviceService.getOperationRecord(deviceId, startTime, endTime);
|
||||
return R.ok(device);
|
||||
@RequestParam(required = false) String endTime,
|
||||
PageQuery pageQuery) {
|
||||
TableDataInfo<DeviceLog> device = deviceService.getOperationRecord(deviceId, startTime, endTime,pageQuery);
|
||||
return device;
|
||||
}
|
||||
|
||||
|
||||
@ -111,8 +112,6 @@ public class WEBDeviceController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,7 +57,7 @@ public interface WEBDeviceService extends IService<Device> {
|
||||
* @param endTime 结束时间
|
||||
* @return
|
||||
*/
|
||||
List<DeviceLog> getOperationRecord(Long deviceId, String startTime, String endTime);
|
||||
TableDataInfo<DeviceLog> getOperationRecord(Long deviceId, String startTime, String endTime, PageQuery pageQuery);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -132,20 +132,19 @@ public class WEBDeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impl
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<DeviceLog> getOperationRecord(Long deviceId, String startTime, String endTime) {
|
||||
public TableDataInfo<DeviceLog> getOperationRecord(Long deviceId, String startTime, String endTime, PageQuery pageQuery) {
|
||||
Page<DeviceLog> page = pageQuery.build();
|
||||
QueryWrapper<DeviceLog> queryWrapper = new QueryWrapper<DeviceLog>().eq("device_id", deviceId);
|
||||
|
||||
if (StrUtil.isNotEmpty(startTime)) {
|
||||
queryWrapper.ge("create_time", startTime);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(endTime)) {
|
||||
queryWrapper.le("create_time", endTime);
|
||||
}
|
||||
|
||||
List<DeviceLog> logList = deviceLogMapper.selectList(
|
||||
queryWrapper.orderByDesc("create_time"));
|
||||
return logList;
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
IPage<DeviceLog> logList = deviceLogMapper.selectPage(page, queryWrapper);
|
||||
return TableDataInfo.build(logList);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user