From 02b6979e6e7680c85ed0911109d182c9a235162f Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Mon, 11 Jul 2022 16:20:36 +0800
Subject: [PATCH] fix
---
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/WebSetServiceImpl.java | 23 ++++++-----------------
1 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/WebSetServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/WebSetServiceImpl.java
index d814c95..ed8d8bc 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/WebSetServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/WebSetServiceImpl.java
@@ -25,11 +25,11 @@
@Override
public Result seeWebSetInfo() {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? 0L : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
AdminSeeWebSetInfoVo adminSeeWebSetInfoVo = new AdminSeeWebSetInfoVo();
QueryWrapper<WebSetEntity> objectQueryWrapper = new QueryWrapper<>();
- objectQueryWrapper.eq("belong_id",belongId);
- List<WebSetEntity> webSetEntities = this.baseMapper.selectList(new QueryWrapper<>());
+ objectQueryWrapper.eq("company_id",companyId);
+ List<WebSetEntity> webSetEntities = this.baseMapper.selectList(objectQueryWrapper);
if(CollUtil.isNotEmpty(webSetEntities)){
WebSetEntity webSetEntity = webSetEntities.get(0);
adminSeeWebSetInfoVo.setId(webSetEntity.getId());
@@ -44,20 +44,13 @@
@Override
public Result updateWebSet(AdminUpdateWebSetDto adminUpdateWebSetDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? 0L : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
String webTitle = adminUpdateWebSetDto.getWebTitle();
- if(StrUtil.isEmpty(webTitle)){
- return Result.fail("请输入网页标题");
- }
String webKeyword = adminUpdateWebSetDto.getWebKeyword();
- if(StrUtil.isEmpty(webKeyword)){
- return Result.fail("请输入网页关键字");
- }
Long id = adminUpdateWebSetDto.getId() == null ? 0L : adminUpdateWebSetDto.getId();
QueryWrapper<WebSetEntity> objectQueryWrapper = new QueryWrapper<>();
- objectQueryWrapper.eq("belong_id",belongId);
+ objectQueryWrapper.eq("company_id",companyId);
WebSetEntity webSetEntity = this.baseMapper.selectOne(objectQueryWrapper);
-// WebSetEntity webSetEntity = this.baseMapper.selectById(id);
if(ObjectUtil.isEmpty(webSetEntity)){
WebSetEntity webSetEntityAdd = new WebSetEntity();
webSetEntityAdd.setWebTitle(webTitle);
@@ -70,20 +63,16 @@
if(StrUtil.isNotEmpty(webPic)){
webSetEntityAdd.setWebPic(webPic);
}
- webSetEntityAdd.setBelongId(belongId);
+ webSetEntityAdd.setCompanyId(companyId);
this.baseMapper.insert(webSetEntityAdd);
return Result.ok("保存成功");
}
webSetEntity.setWebTitle(webTitle);
webSetEntity.setWebKeyword(webKeyword);
String webRemark = adminUpdateWebSetDto.getWebRemark();
- if(StrUtil.isNotEmpty(webRemark)){
webSetEntity.setWebRemark(webRemark);
- }
String webPic = adminUpdateWebSetDto.getWebPic();
- if(StrUtil.isNotEmpty(webPic)){
webSetEntity.setWebPic(webPic);
- }
this.baseMapper.updateById(webSetEntity);
return Result.ok("保存成功");
}
--
Gitblit v1.9.1