作者 lixiang

去掉按钮开关

... ... @@ -136,18 +136,18 @@ public class AiragButtonController extends JeecgController<AiragButton, IAiragBu
}
// 检查按钮开关是否为开启状态
if ("Y".equals(airagButton.getButtonSwitch())) {
// 查询当前已开启的按钮数量(排除自身)
QueryWrapper<AiragButton> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("button_switch", "Y")
.ne("id", airagButton.getId()); // 排除当前正在编辑的按钮
long openedButtonCount = airagButtonService.count(queryWrapper);
// 如果已开启的按钮数量超过或等于5个,则返回错误提示
if (openedButtonCount >= 5) {
return Result.error("按钮超过五个,请先关闭一个按钮");
}
}
// if ("Y".equals(airagButton.getButtonSwitch())) {
// // 查询当前已开启的按钮数量(排除自身)
// QueryWrapper<AiragButton> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("button_switch", "Y")
// .ne("id", airagButton.getId()); // 排除当前正在编辑的按钮
// long openedButtonCount = airagButtonService.count(queryWrapper);
//
// // 如果已开启的按钮数量超过或等于5个,则返回错误提示
// if (openedButtonCount >= 5) {
// return Result.error("按钮超过五个,请先关闭一个按钮");
// }
// }
airagButtonService.updateById(airagButton);
return Result.OK("编辑成功!");
}
... ...