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); }