小修改

This commit is contained in:
zhangzhicheng 2024-08-20 14:22:48 +08:00
parent 63040e39f2
commit e33337b9c1
2 changed files with 7 additions and 6 deletions

View File

@ -1,5 +1,6 @@
package org.dromara.web.controller.app; package org.dromara.web.controller.app;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
@ -147,6 +148,7 @@ public class EqDeviceController extends BaseController {
if (zoneId.contains(" ")) zoneId = zoneId.replace(" ", "+"); if (zoneId.contains(" ")) zoneId = zoneId.replace(" ", "+");
EqEquipmentLogBo eqEquipmentLogBo = new EqEquipmentLogBo(); EqEquipmentLogBo eqEquipmentLogBo = new EqEquipmentLogBo();
eqEquipmentLogBo.setEquipmentId(bo.getEquipmentId()); eqEquipmentLogBo.setEquipmentId(bo.getEquipmentId());
BeanUtil.copyProperties(bo, eqEquipmentLogBo);
TableDataInfo<EqEquipmentLogVo> data = logService.queryPageList(eqEquipmentLogBo, pageQuery); TableDataInfo<EqEquipmentLogVo> data = logService.queryPageList(eqEquipmentLogBo, pageQuery);
List<EqEquipmentLogVo> rows = data.getRows(); List<EqEquipmentLogVo> rows = data.getRows();
if (CollUtil.isEmpty(rows)) return new HashMap<>(); if (CollUtil.isEmpty(rows)) return new HashMap<>();

View File

@ -44,7 +44,6 @@ public class EqHomeController extends BaseController {
private final IEqAreaService eqAreaService; private final IEqAreaService eqAreaService;
private final IEqFamilyService eqFamilyService; private final IEqFamilyService eqFamilyService;
private final IEqEquipmentService eqEquipmentService; private final IEqEquipmentService eqEquipmentService;
private final IEqShareService shareService; private final IEqShareService shareService;
private final ISysUserService userService; private final ISysUserService userService;
private final IEqUserConfigService eqUserConfigService; private final IEqUserConfigService eqUserConfigService;
@ -249,9 +248,9 @@ public class EqHomeController extends BaseController {
} }
bo.setSharedUserId(sysUserVo.getUserId()); bo.setSharedUserId(sysUserVo.getUserId());
bo.setSharedUserName(sysUserVo.getUserName()); bo.setSharedUserName(sysUserVo.getUserName());
List<EqShareVo> eqShareVos = eqShareService.queryList(bo); List<EqShareVo> eqShareVos = shareService.queryList(bo);
if (!eqShareVos.isEmpty()) throw new RuntimeException("该成员已被分享"); if (!eqShareVos.isEmpty()) throw new RuntimeException("该成员已被分享");
return toAjax(eqShareService.insertByBo(bo)); return toAjax(shareService.insertByBo(bo));
} }
/** /**
@ -263,7 +262,7 @@ public class EqHomeController extends BaseController {
@DeleteMapping("/deleteFamily/{sharedId}") @DeleteMapping("/deleteFamily/{sharedId}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable String sharedId) { @PathVariable String sharedId) {
return toAjax(eqShareService.deleteBySharedId(sharedId)); return toAjax(shareService.deleteBySharedId(sharedId));
} }
/** /**
@ -275,7 +274,7 @@ public class EqHomeController extends BaseController {
@DeleteMapping("/deleteMember/{shareId}") @DeleteMapping("/deleteMember/{shareId}")
public R<Void> removeShare(@NotEmpty(message = "主键不能为空") public R<Void> removeShare(@NotEmpty(message = "主键不能为空")
@PathVariable String shareId) { @PathVariable String shareId) {
return toAjax(eqShareService.deleteByShareId(shareId)); return toAjax(shareService.deleteByShareId(shareId));
} }
/** /**
@ -379,7 +378,7 @@ public class EqHomeController extends BaseController {
} }
private final IEqShareService eqShareService;
} }