mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-19 01:48:47 +08:00
代码优化
This commit is contained in:
parent
fc4b5ca1ff
commit
70128d7b10
@ -3,6 +3,7 @@ package org.dromara.web.controller.app;
|
|||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
import cn.dev33.satoken.annotation.SaIgnore;
|
||||||
import cn.dev33.satoken.secure.BCrypt;
|
import cn.dev33.satoken.secure.BCrypt;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
@ -325,6 +326,17 @@ public class EqHomeController extends BaseController {
|
|||||||
@Log(title = "分布管理", businessType = BusinessType.DELETE)
|
@Log(title = "分布管理", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/areaIdsDelete/{areaIds}")
|
@DeleteMapping("/areaIdsDelete/{areaIds}")
|
||||||
public R<Void> areaIdsDelete(@NotEmpty(message = "主键不能为空") @PathVariable Long[] areaIds) {
|
public R<Void> areaIdsDelete(@NotEmpty(message = "主键不能为空") @PathVariable Long[] areaIds) {
|
||||||
|
if (areaIds.length>1) return R.fail("请选择一条数据进行删除");
|
||||||
|
EqEquipmentBo eqEquipmentBo = new EqEquipmentBo();
|
||||||
|
eqEquipmentBo.setAreaId(areaIds[0]);
|
||||||
|
List<EqEquipmentVo> eqEquipmentVos = eqEquipmentService.queryList(eqEquipmentBo);
|
||||||
|
if (!eqEquipmentVos.isEmpty()){
|
||||||
|
List<EqEquipmentBo> bos = BeanUtil.copyToList(eqEquipmentVos, EqEquipmentBo.class);
|
||||||
|
for (EqEquipmentBo bo : bos) {
|
||||||
|
bo.setAreaId(null);
|
||||||
|
eqEquipmentService.updateByBo(bo);
|
||||||
|
}
|
||||||
|
}
|
||||||
return toAjax(eqAreaService.deleteWithValidByIds(List.of(areaIds), true));
|
return toAjax(eqAreaService.deleteWithValidByIds(List.of(areaIds), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -259,6 +259,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EqEquipmentDetailVo getDeviceMsg(EqAppHomeBo bo) {
|
public EqEquipmentDetailVo getDeviceMsg(EqAppHomeBo bo) {
|
||||||
|
log.info("OpenStatusText开合状态:{},{}",MessageUtils.message("openStatus.name0"),MessageUtils.message("openStatus.name1"));
|
||||||
EqEquipmentDetailVo result = new EqEquipmentDetailVo();
|
EqEquipmentDetailVo result = new EqEquipmentDetailVo();
|
||||||
result.setEquipmentId(bo.getEquipmentId());
|
result.setEquipmentId(bo.getEquipmentId());
|
||||||
result.setEquipmentCode(bo.getEquipmentCode());
|
result.setEquipmentCode(bo.getEquipmentCode());
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
@ -65,7 +66,7 @@ public class WebSocketBusinessHandler implements WebSocketApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// EqEquipmentDetailVo data = deviceMsg.getData();
|
// EqEquipmentDetailVo data = deviceMsg.getData();
|
||||||
sendMsg = JSON.toJSONString(deviceMsg);
|
sendMsg = JsonUtils.toJsonString(deviceMsg);
|
||||||
log.info("socket详情发送:{}",sendMsg);
|
log.info("socket详情发送:{}",sendMsg);
|
||||||
sendMsg(sendMsg,loginUser.getUserId());
|
sendMsg(sendMsg,loginUser.getUserId());
|
||||||
}
|
}
|
||||||
@ -99,7 +100,7 @@ public class WebSocketBusinessHandler implements WebSocketApi {
|
|||||||
log.error("获取设备列表失败:{}",e.getMessage());
|
log.error("获取设备列表失败:{}",e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sendMsg = isTure?JSON.toJSONString(list):sendMsg;
|
sendMsg = isTure? JsonUtils.toJsonString(list):sendMsg;
|
||||||
log.info("socket列表发送:{}",sendMsg);
|
log.info("socket列表发送:{}",sendMsg);
|
||||||
sendMsg(sendMsg,loginUser.getUserId());
|
sendMsg(sendMsg,loginUser.getUserId());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user