mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-18 17:38:48 +08:00
设备运营统计
This commit is contained in:
parent
9291fb145e
commit
d3cbd62e44
@ -175,7 +175,9 @@ public class EqDeviceController extends BaseController {
|
||||
if (CollectionUtils.isEmpty(eqEquipmentVos)) return;
|
||||
EqEquipmentVo eqEquipmentVo = eqEquipmentVos.get(0);
|
||||
eqEquipmentBo.setEquipmentId(eqEquipmentVo.getEquipmentId());
|
||||
|
||||
eqEquipmentLogBo.setUserId(eqEquipmentVo.getUserId());
|
||||
eqEquipmentLogBo.setUserName(eqEquipmentVo.getUserName());
|
||||
eqEquipmentLogBo.setNickName(eqEquipmentVo.getNickName());
|
||||
Date createTime = eqEquipmentLogBo.getCreateTime();
|
||||
if (createTime == null) {
|
||||
createTime = new Date();
|
||||
|
||||
@ -0,0 +1,105 @@
|
||||
package org.dromara.web.controller.show;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.web.domain.vo.EqEquipmentLogVo;
|
||||
import org.dromara.web.domain.bo.EqEquipmentLogBo;
|
||||
import org.dromara.web.service.IEqEquipmentLogService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 设备状态日志
|
||||
*
|
||||
* @author zzc
|
||||
* @date 2024-08-14
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/device/showEquipmentLog")
|
||||
public class EqShowEquipmentLogController extends BaseController {
|
||||
|
||||
private final IEqEquipmentLogService eqEquipmentLogService;
|
||||
|
||||
/**
|
||||
* 查询设备状态日志列表
|
||||
*/
|
||||
@SaCheckPermission("device:showEquipmentLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<EqEquipmentLogVo> list(EqEquipmentLogBo bo, PageQuery pageQuery) {
|
||||
return eqEquipmentLogService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/* *//**
|
||||
* 导出设备状态日志列表
|
||||
*//*
|
||||
@SaCheckPermission("device:showEquipmentLog:export")
|
||||
@Log(title = "设备状态日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(EqEquipmentLogBo bo, HttpServletResponse response) {
|
||||
List<EqEquipmentLogVo> list = eqEquipmentLogService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "设备状态日志", EqEquipmentLogVo.class, response);
|
||||
}
|
||||
|
||||
*//**
|
||||
* 获取设备状态日志详细信息
|
||||
*
|
||||
* @param logId 主键
|
||||
*//*
|
||||
@SaCheckPermission("device:showEquipmentLog:query")
|
||||
@GetMapping("/{logId}")
|
||||
public R<EqEquipmentLogVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long logId) {
|
||||
return R.ok(eqEquipmentLogService.queryById(logId));
|
||||
}
|
||||
|
||||
*//**
|
||||
* 新增设备状态日志
|
||||
*//*
|
||||
@SaCheckPermission("device:showEquipmentLog:add")
|
||||
@Log(title = "设备状态日志", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqEquipmentLogBo bo) {
|
||||
return toAjax(eqEquipmentLogService.insertByBo(bo));
|
||||
}
|
||||
|
||||
*//**
|
||||
* 修改设备状态日志
|
||||
*//*
|
||||
@SaCheckPermission("device:showEquipmentLog:edit")
|
||||
@Log(title = "设备状态日志", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqEquipmentLogBo bo) {
|
||||
return toAjax(eqEquipmentLogService.updateByBo(bo));
|
||||
}
|
||||
|
||||
*//**
|
||||
* 删除设备状态日志
|
||||
*
|
||||
* @param logIds 主键串
|
||||
*//*
|
||||
@SaCheckPermission("device:showEquipmentLog:remove")
|
||||
@Log(title = "设备状态日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{logIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] logIds) {
|
||||
return toAjax(eqEquipmentLogService.deleteWithValidByIds(List.of(logIds), true));
|
||||
}*/
|
||||
}
|
||||
@ -2,7 +2,6 @@ package org.dromara.web.controller.show;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.web.domain.bo.EqAppHomeBo;
|
||||
@ -25,7 +24,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/device/showUser")
|
||||
public class EqUserEquipmentController extends BaseController {
|
||||
public class EqShowUserEquipmentController extends BaseController {
|
||||
|
||||
private final IEqEquipmentService eqEquipmentService;
|
||||
|
||||
@ -34,6 +34,16 @@ public class EqEquipmentLog extends BaseEntity {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
|
||||
@ -34,6 +34,16 @@ public class EqEquipmentLogBo extends BaseEntity {
|
||||
@NotNull(message = "用户id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
|
||||
@ -42,6 +42,16 @@ public class EqEquipmentLogVo implements Serializable {
|
||||
@ExcelProperty(value = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
|
||||
@ -53,7 +53,7 @@ public class EqEquipmentVo implements Serializable {
|
||||
* 登录账号
|
||||
*/
|
||||
@ExcelProperty(value = "登录账号ID")
|
||||
private String userId;
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 登录账号
|
||||
|
||||
@ -81,8 +81,10 @@ public class EqEquipmentLogServiceImpl implements IEqEquipmentLogService {
|
||||
lqw.eq(bo.getCreatedYearDay() != null, EqEquipmentLog::getCreatedYearDay, bo.getCreatedYearDay());
|
||||
lqw.eq(bo.getCreatedHourSecond() != null, EqEquipmentLog::getCreatedHourSecond, bo.getCreatedHourSecond());
|
||||
lqw.eq(bo.getDayOfWeek() != null, EqEquipmentLog::getDayOfWeek, bo.getDayOfWeek());
|
||||
lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
EqEquipmentLog::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
// lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
||||
// EqEquipmentLog::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
EqEquipmentLog::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(EqEquipmentLog::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user