From 671b522fe0180f53f7d3c50293062239934e8108 Mon Sep 17 00:00:00 2001 From: dongsk Date: Tue, 30 Apr 2024 14:03:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/provider/impl/BasicApiServiceImpl.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java index 99f5e66..2b1bf11 100644 --- a/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java +++ b/demo-athenaopt_backend/develop/src/main/java/com/digiwin/athena/app/provider/impl/BasicApiServiceImpl.java @@ -72,6 +72,24 @@ public class BasicApiServiceImpl implements BasicApiService { @Override public Object layoutConfig(LayoutConfig layoutConfig) throws Exception { + LambdaQueryChainWrapper lambdaQuery = layoutConfigService.lambdaQuery() + .eq(LayoutConfig::getUserId, layoutConfig.getUserId()) + .eq(LayoutConfig::getTenantId, layoutConfig.getTenantId()) + .eq(LayoutConfig::getSysId, layoutConfig.getSysId()); + if (lambdaQuery.exists()) { + layoutConfigService.lambdaUpdate() + .set(LayoutConfig::getTop, layoutConfig.getTop()) + .set(LayoutConfig::getLeft, layoutConfig.getLeft()) + .set(LayoutConfig::getWidth, layoutConfig.getWidth()) + .set(LayoutConfig::getHeight, layoutConfig.getHeight()) + .eq(LayoutConfig::getUserId, layoutConfig.getUserId()) + .eq(LayoutConfig::getTenantId, layoutConfig.getTenantId()) + .eq(LayoutConfig::getSysId, layoutConfig.getSysId()) + .update(); + } else { + layoutConfigService.save(layoutConfig); + } + return layoutConfigService.saveOrUpdate(layoutConfig); }