From 089f77fc53b619f4e00f706370a9ade523221f5d Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Mon, 13 Jun 2022 16:45:26 +0800
Subject: [PATCH] 20220606
---
src/main/java/com/xcong/farmer/cms/modules/system/entity/WebSetEntity.java | 2
src/main/resources/mapper/CompanyMapper.xml | 6
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java | 3
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeCompanyInfoVo.java | 2
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddCompanyDto.java | 6
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/UserServiceImpl.java | 14
src/main/java/com/xcong/farmer/cms/modules/system/service/ICompanyService.java | 24 ++
src/main/java/com/xcong/farmer/cms/modules/system/entity/ColumnEntity.java | 2
src/main/resources/mapper/UserMapper.xml | 4
src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java | 4
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddColumnDto.java | 4
src/main/java/com/xcong/farmer/cms/modules/system/entity/CompanyEntity.java | 4
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/RoleServiceImpl.java | 8
src/main/java/com/xcong/farmer/cms/modules/system/entity/NavigationBarEntity.java | 2
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/WebSetServiceImpl.java | 10
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/NavigationBarServiceImpl.java | 36 --
src/main/resources/mapper/NavigationBarMapper.xml | 6
src/main/resources/mapper/RoleMapper.xml | 2
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBarDto.java | 3
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateMenuDto.java | 5
src/main/resources/mapper/ArticleMapper.xml | 2
src/main/java/com/xcong/farmer/cms/modules/system/mapper/CompanyMapper.java | 14 +
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java | 36 --
src/main/resources/mapper/ColumnMapper.xml | 4
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateColumnDto.java | 4
src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminCompanyVo.java | 2
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CompanyServiceImpl.java | 156 ++++++++++++++
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddMenuDto.java | 5
/dev/null | 175 ---------------
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/MenuServiceImpl.java | 13 -
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java | 3
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java | 3
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateCompanyDto.java | 6
src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBarDto.java | 3
src/main/java/com/xcong/farmer/cms/modules/system/entity/UserEntity.java | 2
src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java | 31 --
src/main/java/com/xcong/farmer/cms/modules/system/entity/RoleEntity.java | 2
src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminCompanyController.java | 20
38 files changed, 311 insertions(+), 317 deletions(-)
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminBelongController.java b/src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminCompanyController.java
similarity index 77%
rename from src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminBelongController.java
rename to src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminCompanyController.java
index 0fc3f60..8348ce8 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminBelongController.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/controller/AdminCompanyController.java
@@ -2,8 +2,8 @@
import com.xcong.farmer.cms.common.response.Result;
import com.xcong.farmer.cms.modules.system.dto.*;
-import com.xcong.farmer.cms.modules.system.service.IBelongService;
-import com.xcong.farmer.cms.modules.system.vo.AdminBelongVo;
+import com.xcong.farmer.cms.modules.system.service.ICompanyService;
+import com.xcong.farmer.cms.modules.system.vo.AdminCompanyVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
@@ -18,20 +18,20 @@
@RequestMapping(value = "/api/belong")
@Slf4j
@Api(value = "系统所属公司", tags = "系统所属公司")
-public class AdminBelongController {
+public class AdminCompanyController {
@Resource
- private IBelongService iBelongService;
+ private ICompanyService iBelongService;
@ApiOperation(value = "系统所属公司分页列表", notes = "系统所属公司分页列表")
- @ApiResponses({@ApiResponse(code = 200, message = "ok", response = AdminBelongVo.class)})
+ @ApiResponses({@ApiResponse(code = 200, message = "ok", response = AdminCompanyVo.class)})
@PostMapping(value = "/belongInPage")
public Result getBelongInPage(@RequestBody @Valid AdminBelongDto adminBelongDto) {
return iBelongService.getBelongInPage(adminBelongDto);
}
@ApiOperation(value = "系统所属公司列表", notes = "系统所属公司列表")
- @ApiResponses({@ApiResponse(code = 200, message = "ok", response = AdminBelongVo.class)})
+ @ApiResponses({@ApiResponse(code = 200, message = "ok", response = AdminCompanyVo.class)})
@GetMapping(value = "/belongInList")
public Result getBelongInList() {
return iBelongService.getBelongInList();
@@ -39,8 +39,8 @@
@ApiOperation(value = "添加系统所属公司", notes = "添加系统所属公司")
@PostMapping(value = "/addBelong")
- public Result addBelong(@RequestBody @Valid AdminAddBelongDto adminAddBelongDto) {
- return iBelongService.addBelong(adminAddBelongDto);
+ public Result addBelong(@RequestBody @Valid AdminAddCompanyDto adminAddCompanyDto) {
+ return iBelongService.addBelong(adminAddCompanyDto);
}
@ApiOperation(value = "查看系统所属公司", notes = "查看系统所属公司")
@@ -51,8 +51,8 @@
@ApiOperation(value = "更新系统所属公司", notes = "更新系统所属公司")
@PostMapping(value = "/updateBelong")
- public Result updateBelong(@RequestBody @Valid AdminUpdateBelongDto adminUpdateBelongDto) {
- return iBelongService.updateBelong(adminUpdateBelongDto);
+ public Result updateBelong(@RequestBody @Valid AdminUpdateCompanyDto adminUpdateCompanyDto) {
+ return iBelongService.updateBelong(adminUpdateCompanyDto);
}
@ApiOperation(value = "删除系统所属公司", notes = "删除系统所属公司")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java
index 9f54cd4..6f6f5ab 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddArticleDto.java
@@ -51,4 +51,7 @@
@ApiModelProperty(value = "文章详情")
private String articleDetails;
+
+ @ApiModelProperty(value = "上传附件")
+ private String uploadFile;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBarDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBarDto.java
index b2240d1..f9a17c1 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBarDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBarDto.java
@@ -4,11 +4,14 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
@Data
@ApiModel(value = "AdminAddBarDto", description = "参数接收类")
public class AdminAddBarDto {
//导航栏标题
@ApiModelProperty(value = "导航栏标题")
+ @NotBlank(message = "请输入导航栏标题")
private String barName;
//链接地址
@ApiModelProperty(value = "链接地址")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddColumnDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddColumnDto.java
index 8a73c9d..05219dd 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddColumnDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddColumnDto.java
@@ -4,14 +4,18 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
@Data
@ApiModel(value = "AdminAddColumnDto", description = "参数接收类")
public class AdminAddColumnDto {
@ApiModelProperty(value = "栏目名称")
+ @NotBlank(message = "请输入栏目名称")
private String columnName;
@ApiModelProperty(value = "栏目编码")
+ @NotBlank(message = "请输入栏目编码")
private String columnCode;
@ApiModelProperty(value = "描述")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBelongDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddCompanyDto.java
similarity index 76%
rename from src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBelongDto.java
rename to src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddCompanyDto.java
index 760e55e..ee329f7 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddBelongDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddCompanyDto.java
@@ -4,14 +4,18 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
@Data
@ApiModel(value = "AdminAddBelongDto", description = "参数接收类")
-public class AdminAddBelongDto {
+public class AdminAddCompanyDto {
@ApiModelProperty(value = "名称")
+ @NotBlank(message = "请输入文章标题")
private String name;
@ApiModelProperty(value = "编码")
+ @NotBlank(message = "请输入编码")
private String code;
@ApiModelProperty(value = "网址")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddMenuDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddMenuDto.java
index 6a742ec..ade590c 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddMenuDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminAddMenuDto.java
@@ -4,14 +4,19 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
@Data
@ApiModel(value = "AdminAddMenuDto", description = "参数接收类")
public class AdminAddMenuDto {
@ApiModelProperty(value = "菜单按钮标题")
+ @NotBlank(message = "请输入菜单名称")
private String menuName;
@ApiModelProperty(value = "菜单类型 1:菜单 2:按钮")
+ @NotNull(message = "请输入菜单类型")
private Integer menuType;
@ApiModelProperty(value = "路由地址")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java
index 8f82420..ab9d7b7 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateArticleDto.java
@@ -55,4 +55,7 @@
@ApiModelProperty(value = "文章详情")
private String articleDetails;
+
+ @ApiModelProperty(value = "上传附件")
+ private String uploadFile;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBarDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBarDto.java
index 9a1e2eb..430a529 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBarDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBarDto.java
@@ -4,12 +4,15 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
@Data
@ApiModel(value = "AdminUpdateBarDto", description = "参数接收类")
public class AdminUpdateBarDto {
private Long id;
//导航栏标题
@ApiModelProperty(value = "导航栏标题")
+ @NotBlank(message = "请输入导航栏标题")
private String barName;
//链接地址
@ApiModelProperty(value = "链接地址")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateColumnDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateColumnDto.java
index 24aab84..c7382d1 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateColumnDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateColumnDto.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
@Data
@ApiModel(value = "AdminUpdateColumnDto", description = "参数接收类")
public class AdminUpdateColumnDto {
@@ -11,9 +13,11 @@
private Long id;
@ApiModelProperty(value = "栏目名称")
+ @NotBlank(message = "请输入栏目名称")
private String columnName;
@ApiModelProperty(value = "栏目编码")
+ @NotBlank(message = "请输入栏目编码")
private String columnCode;
@ApiModelProperty(value = "描述")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBelongDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateCompanyDto.java
similarity index 77%
rename from src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBelongDto.java
rename to src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateCompanyDto.java
index a305a9c..c4eae73 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateBelongDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateCompanyDto.java
@@ -4,16 +4,20 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+
@Data
@ApiModel(value = "AdminUpdateBelongDto", description = "参数接收类")
-public class AdminUpdateBelongDto {
+public class AdminUpdateCompanyDto {
private Long id;
@ApiModelProperty(value = "名称")
+ @NotBlank(message = "请输入文章标题")
private String name;
@ApiModelProperty(value = "编码")
+ @NotBlank(message = "请输入编码")
private String code;
@ApiModelProperty(value = "网址")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateMenuDto.java b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateMenuDto.java
index c624a07..a60ec42 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateMenuDto.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/dto/AdminUpdateMenuDto.java
@@ -4,6 +4,9 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+
@Data
@ApiModel(value = "AdminUpdateMenuDto", description = "参数接收类")
public class AdminUpdateMenuDto {
@@ -12,9 +15,11 @@
private Long id;
@ApiModelProperty(value = "菜单按钮标题")
+ @NotBlank(message = "请输入菜单名称")
private String menuName;
@ApiModelProperty(value = "菜单类型 1:菜单 2:按钮")
+ @NotNull(message = "请输入菜单类型")
private Integer menuType;
@ApiModelProperty(value = "路由地址")
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
index daecf72..0e724c9 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/ArticleEntity.java
@@ -59,9 +59,11 @@
private Integer releaseStatus;
//文章详情
private String articleDetails;
+ //上传附件
+ private String uploadFile;
//是否删除 0:已删除 1:未删除
private Integer delStatus;
//所属ID
- private Long belongId;
+ private Long companyId;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/ColumnEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/ColumnEntity.java
index 314d22f..e13666a 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/ColumnEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/ColumnEntity.java
@@ -28,5 +28,5 @@
//上级类目ID
private Long parentId;
//所属ID
- private Long belongId;
+ private Long companyId;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/BelongEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/CompanyEntity.java
similarity index 91%
rename from src/main/java/com/xcong/farmer/cms/modules/system/entity/BelongEntity.java
rename to src/main/java/com/xcong/farmer/cms/modules/system/entity/CompanyEntity.java
index 16bd355..62a5418 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/BelongEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/CompanyEntity.java
@@ -9,8 +9,8 @@
* 所属公司范围表
*/
@Data
-@TableName("t_belong")
-public class BelongEntity {
+@TableName("t_company")
+public class CompanyEntity {
//ID
@TableId(value = "id",type = IdType.AUTO)
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/NavigationBarEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/NavigationBarEntity.java
index ec6af4b..71d20ee 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/NavigationBarEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/NavigationBarEntity.java
@@ -28,6 +28,6 @@
//上级类目ID
private Long parentId;
//所属ID
- private Long belongId;
+ private Long companyId;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/RoleEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/RoleEntity.java
index d6542b2..7902ff9 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/RoleEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/RoleEntity.java
@@ -26,5 +26,5 @@
//拓展备注
private String remark;
//所属ID
- private Long belongId;
+ private Long companyId;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/UserEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/UserEntity.java
index 6179e1c..6c43a8e 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/UserEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/UserEntity.java
@@ -47,7 +47,7 @@
//拓展备注
private String remark;
//所属ID
- private Long belongId;
+ private Long companyId;
@TableField(exist = false)
private String roleName;
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/entity/WebSetEntity.java b/src/main/java/com/xcong/farmer/cms/modules/system/entity/WebSetEntity.java
index 24d6a2c..451d831 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/entity/WebSetEntity.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/entity/WebSetEntity.java
@@ -24,5 +24,5 @@
//网页LOGO
private String webPic;
//所属ID
- private Long belongId;
+ private Long companyId;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/mapper/BelongMapper.java b/src/main/java/com/xcong/farmer/cms/modules/system/mapper/BelongMapper.java
deleted file mode 100644
index 5b4473f..0000000
--- a/src/main/java/com/xcong/farmer/cms/modules/system/mapper/BelongMapper.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.xcong.farmer.cms.modules.system.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.xcong.farmer.cms.modules.system.entity.BelongEntity;
-import com.xcong.farmer.cms.modules.system.vo.AdminBelongVo;
-import org.apache.ibatis.annotations.Param;
-
-public interface BelongMapper extends BaseMapper<BelongEntity> {
-
- IPage<AdminBelongVo> selectAdminBelongInPage(Page<AdminBelongVo> page, @Param("record")BelongEntity belongEntity);
-
-}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/mapper/CompanyMapper.java b/src/main/java/com/xcong/farmer/cms/modules/system/mapper/CompanyMapper.java
new file mode 100644
index 0000000..11e89ca
--- /dev/null
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/mapper/CompanyMapper.java
@@ -0,0 +1,14 @@
+package com.xcong.farmer.cms.modules.system.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xcong.farmer.cms.modules.system.entity.CompanyEntity;
+import com.xcong.farmer.cms.modules.system.vo.AdminCompanyVo;
+import org.apache.ibatis.annotations.Param;
+
+public interface CompanyMapper extends BaseMapper<CompanyEntity> {
+
+ IPage<AdminCompanyVo> selectAdminBelongInPage(Page<AdminCompanyVo> page, @Param("record") CompanyEntity companyEntity);
+
+}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/IBelongService.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/IBelongService.java
deleted file mode 100644
index 0af4ad2..0000000
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/IBelongService.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.xcong.farmer.cms.modules.system.service;
-
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.xcong.farmer.cms.common.response.Result;
-import com.xcong.farmer.cms.modules.system.dto.AdminAddBelongDto;
-import com.xcong.farmer.cms.modules.system.dto.AdminBelongDto;
-import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto;
-import com.xcong.farmer.cms.modules.system.dto.AdminUpdateBelongDto;
-import com.xcong.farmer.cms.modules.system.entity.BelongEntity;
-
-public interface IBelongService extends IService<BelongEntity> {
-
- Result getBelongInPage(AdminBelongDto adminBelongDto);
-
- Result addBelong(AdminAddBelongDto adminAddBelongDto);
-
- Result seeBelongInfo(Long id);
-
- Result updateBelong(AdminUpdateBelongDto adminUpdateBelongDto);
-
- Result getBelongInList();
-
- Result delObjs(AdminDeleteDto adminDeleteDto);
-}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/ICompanyService.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/ICompanyService.java
new file mode 100644
index 0000000..151258a
--- /dev/null
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/ICompanyService.java
@@ -0,0 +1,24 @@
+package com.xcong.farmer.cms.modules.system.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.xcong.farmer.cms.common.response.Result;
+import com.xcong.farmer.cms.modules.system.dto.AdminAddCompanyDto;
+import com.xcong.farmer.cms.modules.system.dto.AdminBelongDto;
+import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto;
+import com.xcong.farmer.cms.modules.system.dto.AdminUpdateCompanyDto;
+import com.xcong.farmer.cms.modules.system.entity.CompanyEntity;
+
+public interface ICompanyService extends IService<CompanyEntity> {
+
+ Result getBelongInPage(AdminBelongDto adminBelongDto);
+
+ Result addBelong(AdminAddCompanyDto adminAddCompanyDto);
+
+ Result seeBelongInfo(Long id);
+
+ Result updateBelong(AdminUpdateCompanyDto adminUpdateCompanyDto);
+
+ Result getBelongInList();
+
+ Result delObjs(AdminDeleteDto adminDeleteDto);
+}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
index 60e4ea5..7de2ada 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ArticleServiceImpl.java
@@ -43,7 +43,7 @@
@Override
public Result getArticleInPage(AdminArticleDto adminArticleDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
Page<AdminArticleVo> page = new Page<>(adminArticleDto.getPageNum(), adminArticleDto.getPageSize());
ArticleEntity articleEntity = new ArticleEntity();
Long columnId = adminArticleDto.getColumnId() == null ? 0L : adminArticleDto.getColumnId();
@@ -54,8 +54,8 @@
if(StrUtil.isNotEmpty(title)){
articleEntity.setTitle(title);
}
- if(UserEntity.USER_BELONG_TOP != belongId){
- articleEntity.setBelongId(belongId);
+ if(UserEntity.USER_BELONG_TOP != companyId){
+ articleEntity.setCompanyId(companyId);
}
IPage<AdminArticleVo> list = this.baseMapper.selectAdminArticleInPage(page,articleEntity);
return Result.ok(list);
@@ -65,27 +65,19 @@
@Transactional
public Result addArticle(AdminAddArticleDto adminAddArticleDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
ArticleEntity articleEntity = new ArticleEntity();
- articleEntity.setBelongId(belongId);
+ articleEntity.setCompanyId(companyId);
String title = adminAddArticleDto.getTitle();
articleEntity.setTitle(title);
String childTitle = adminAddArticleDto.getChildTitle();
- if(StrUtil.isNotEmpty(childTitle)){
articleEntity.setChildTitle(childTitle);
- }
String author = adminAddArticleDto.getAuthor();
- if(StrUtil.isNotEmpty(author)){
articleEntity.setAuthor(author);
- }
String authorBelong = adminAddArticleDto.getAuthorBelong();
- if(StrUtil.isNotEmpty(authorBelong)){
articleEntity.setAuthorBelong(authorBelong);
- }
String remark = adminAddArticleDto.getRemark();
- if(StrUtil.isNotEmpty(remark)){
articleEntity.setRemark(remark);
- }
long columnId = adminAddArticleDto.getColumnId() == null ? 0L : adminAddArticleDto.getColumnId();
ColumnEntity columnEntity = columnMapper.selectById(columnId);
if(ObjectUtil.isEmpty(columnEntity)){
@@ -95,24 +87,17 @@
Integer visits = adminAddArticleDto.getVisits() == null ? 0 : adminAddArticleDto.getVisits();
articleEntity.setVisits(visits);
String mainDiagram = adminAddArticleDto.getMainDiagram();
- if(StrUtil.isNotEmpty(mainDiagram)){
articleEntity.setMainDiagram(mainDiagram);
- }
String atlas = adminAddArticleDto.getAtlas();
- if(StrUtil.isNotEmpty(atlas)){
articleEntity.setAtlas(atlas);
- }
Date releaseTime = adminAddArticleDto.getReleaseTime();
- if(ObjectUtil.isNotEmpty(releaseTime)){
articleEntity.setReleaseTime(releaseTime);
- }
Integer releaseStatus = adminAddArticleDto.getReleaseStatus();
articleEntity.setReleaseStatus(releaseStatus);
String articleDetails = adminAddArticleDto.getArticleDetails();
- if(StrUtil.isNotEmpty(articleDetails)){
articleEntity.setArticleDetails(articleDetails);
- }
-
+ String uploadFile = adminAddArticleDto.getUploadFile();
+ articleEntity.setUploadFile(uploadFile);
this.baseMapper.insert(articleEntity);
return Result.ok("添加成功");
}
@@ -180,6 +165,8 @@
articleEntity.setReleaseStatus(releaseStatus);
String articleDetails = adminUpdateArticleDto.getArticleDetails();
articleEntity.setArticleDetails(articleDetails);
+ String uploadFile = adminUpdateArticleDto.getUploadFile();
+ articleEntity.setUploadFile(uploadFile);
this.baseMapper.updateById(articleEntity);
return Result.ok("更新成功");
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/BelongServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/BelongServiceImpl.java
deleted file mode 100644
index 9caa730..0000000
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/BelongServiceImpl.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package com.xcong.farmer.cms.modules.system.service.Impl;
-
-import cn.hutool.core.util.StrUtil;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.xcong.farmer.cms.common.response.Result;
-import com.xcong.farmer.cms.modules.system.dto.AdminAddBelongDto;
-import com.xcong.farmer.cms.modules.system.dto.AdminBelongDto;
-import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto;
-import com.xcong.farmer.cms.modules.system.dto.AdminUpdateBelongDto;
-import com.xcong.farmer.cms.modules.system.entity.BelongEntity;
-import com.xcong.farmer.cms.modules.system.entity.UserEntity;
-import com.xcong.farmer.cms.modules.system.entity.UserRoleEntity;
-import com.xcong.farmer.cms.modules.system.mapper.BelongMapper;
-import com.xcong.farmer.cms.modules.system.service.IBelongService;
-import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
-import com.xcong.farmer.cms.modules.system.vo.AdminBelongVo;
-import com.xcong.farmer.cms.modules.system.vo.AdminSeeBelongInfoVo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-import java.util.ArrayList;
-import java.util.List;
-import cn.hutool.core.collection.CollUtil;
-
-import cn.hutool.core.util.ObjectUtil;
-import org.springframework.transaction.annotation.Transactional;
-
-@Service
-@Slf4j
-public class BelongServiceImpl extends ServiceImpl<BelongMapper, BelongEntity> implements IBelongService {
- @Override
- public Result getBelongInPage(AdminBelongDto adminBelongDto) {
- UserEntity userlogin = LoginUserUtil.getLoginUser();
- Long belongId = userlogin.getBelongId();
- Page<AdminBelongVo> page = new Page<>(adminBelongDto.getPageNum(), adminBelongDto.getPageSize());
- BelongEntity belongEntity = new BelongEntity();
- String name = adminBelongDto.getName();
- if(StrUtil.isNotEmpty(name)){
- belongEntity.setName(name);
- }
- if(belongId != UserEntity.USER_BELONG_TOP){
- belongEntity.setId(belongId);
- }
- IPage<AdminBelongVo> list = this.baseMapper.selectAdminBelongInPage(page,belongEntity);
- return Result.ok(list);
- }
-
- @Override
- @Transactional
- public Result addBelong(AdminAddBelongDto adminAddBelongDto) {
- String name = adminAddBelongDto.getName();
- if(StrUtil.isEmpty(name)){
- return Result.fail("请输入名称");
- }
- String code = adminAddBelongDto.getCode();
- if(StrUtil.isEmpty(code)){
- return Result.fail("请输入编码");
- }
- QueryWrapper<BelongEntity> objectQueryWrapper = new QueryWrapper<>();
- objectQueryWrapper.eq("code",code);
- List<BelongEntity> belongEntities = this.baseMapper.selectList(objectQueryWrapper);
- if(CollUtil.isNotEmpty(belongEntities)){
- return Result.fail("编码已存在,请重新输入");
- }
- BelongEntity belongEntity = new BelongEntity();
- belongEntity.setName(name);
- belongEntity.setCode(code);
- String webAddress = adminAddBelongDto.getWebAddress();
- if(StrUtil.isNotEmpty(webAddress)){
- belongEntity.setWebAddress(webAddress);
- }
- String remark = adminAddBelongDto.getRemark();
- if(StrUtil.isNotEmpty(remark)){
- belongEntity.setRemark(remark);
- }
- String pic = adminAddBelongDto.getPic();
- if(StrUtil.isNotEmpty(pic)){
- belongEntity.setPic(pic);
- }
- this.baseMapper.insert(belongEntity);
- return Result.ok("添加成功");
- }
-
- @Override
- public Result seeBelongInfo(Long id) {
- BelongEntity belongEntity = this.baseMapper.selectById(id);
- if(ObjectUtil.isEmpty(belongEntity)){
- Result.fail("所属公司不存在");
- }
- AdminSeeBelongInfoVo adminSeeBelongInfoVo = new AdminSeeBelongInfoVo();
- adminSeeBelongInfoVo.setId(belongEntity.getId());
- adminSeeBelongInfoVo.setName(belongEntity.getName());
- adminSeeBelongInfoVo.setCode(belongEntity.getCode());
- adminSeeBelongInfoVo.setRemark(belongEntity.getRemark());
- adminSeeBelongInfoVo.setWebAddress(belongEntity.getWebAddress());
- adminSeeBelongInfoVo.setPic(belongEntity.getPic());
- return Result.ok(adminSeeBelongInfoVo);
- }
-
- @Override
- @Transactional
- public Result updateBelong(AdminUpdateBelongDto adminUpdateBelongDto) {
- Long id = adminUpdateBelongDto.getId();
- BelongEntity belongEntity = this.baseMapper.selectById(id);
- if(ObjectUtil.isEmpty(belongEntity)){
- Result.fail("所属公司不存在");
- }
- String name = adminUpdateBelongDto.getName();
- if(StrUtil.isEmpty(name)){
- return Result.fail("请输入名称");
- }
- belongEntity.setName(name);
- String code = adminUpdateBelongDto.getCode();
- if(StrUtil.isEmpty(code)){
- return Result.fail("请输入编码");
- }
- if(!belongEntity.getCode().equals(code)){
- QueryWrapper<BelongEntity> objectQueryWrapper = new QueryWrapper<>();
- objectQueryWrapper.eq("code",code);
- List<BelongEntity> belongEntities = this.baseMapper.selectList(objectQueryWrapper);
- if(CollUtil.isNotEmpty(belongEntities)){
- return Result.fail("编码已存在,请重新输入");
- }
- belongEntity.setCode(code);
- }
- belongEntity.setWebAddress(adminUpdateBelongDto.getWebAddress());
- belongEntity.setRemark(adminUpdateBelongDto.getRemark());
- belongEntity.setPic(adminUpdateBelongDto.getPic());
- this.baseMapper.updateById(belongEntity);
- return Result.ok("更新成功");
- }
-
- @Override
- public Result getBelongInList() {
- UserEntity userlogin = LoginUserUtil.getLoginUser();
- Long belongId = userlogin.getBelongId();
- QueryWrapper<BelongEntity> objectQueryWrapper = new QueryWrapper<>();
- if(belongId != UserEntity.USER_BELONG_TOP){
- objectQueryWrapper.eq("id",belongId);
- }
- List<BelongEntity> belongEntities = this.baseMapper.selectList(objectQueryWrapper);
- List<AdminBelongVo> adminBelongVos = new ArrayList<>();
- if(CollUtil.isNotEmpty(belongEntities)){
- for(BelongEntity belongEntity : belongEntities){
- AdminBelongVo adminBelongVo = new AdminBelongVo();
- adminBelongVo.setId(belongEntity.getId());
- adminBelongVo.setName(belongEntity.getName());
- adminBelongVo.setCode(belongEntity.getCode());
- adminBelongVos.add(adminBelongVo);
- }
- }
- return Result.ok(adminBelongVos);
- }
-
- @Override
- public Result delObjs(AdminDeleteDto adminDeleteDto) {
- String ids = adminDeleteDto.getIds();
- UserEntity userlogin = LoginUserUtil.getLoginUser();
- if(userlogin.getBelongId() != UserEntity.USER_BELONG_TOP){
- return Result.fail("没有删除权限");
- }
- if(StrUtil.isNotEmpty(ids)){
- String[] belongIds = ids.split(StringPool.COMMA);
- for(String belongIdStr : belongIds){
- Long belongId = Long.valueOf(belongIdStr);
- this.baseMapper.deleteById(belongId);
- }
- }
- return Result.ok("删除成功");
- }
-}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java
index 6458285..ad1f443 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/ColumnServiceImpl.java
@@ -35,10 +35,10 @@
@Override
public Result getColumnInPage(AdminColumnDto adminColumnDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
Page<AdminColumnVo> page = new Page<>(adminColumnDto.getPageNum(), adminColumnDto.getPageSize());
ColumnEntity columnEntity = new ColumnEntity();
- columnEntity.setBelongId(belongId);
+ columnEntity.setCompanyId(companyId);
columnEntity.setParentId(ColumnEntity.PARENTID_DEFAULT);
IPage<AdminColumnVo> list = this.baseMapper.selectAdminColumnVoInPage(page,columnEntity);
List<AdminColumnVo> records = list.getRecords();
@@ -47,7 +47,7 @@
Long id = adminColumnVo.getId();
QueryWrapper<ColumnEntity> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("parent_id",id);
- objectQueryWrapper.eq("belong_id",belongId);
+ objectQueryWrapper.eq("company_id",companyId);
List<ColumnEntity> columnEntities = this.baseMapper.selectList(objectQueryWrapper);
List<AdminColumnVo> adminColumnVoChilds = new ArrayList<>();
if(CollUtil.isNotEmpty(columnEntities)){
@@ -72,18 +72,12 @@
@Transactional
public Result addColumn(AdminAddColumnDto adminAddColumnDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
ColumnEntity columnEntity = new ColumnEntity();
- columnEntity.setBelongId(belongId);
+ columnEntity.setCompanyId(companyId);
String columnName = adminAddColumnDto.getColumnName();
- if(StrUtil.isEmpty(columnName)){
- return Result.fail("请输入栏目名称");
- }
columnEntity.setColumnName(columnName);
String columnCode = adminAddColumnDto.getColumnCode();
- if(StrUtil.isEmpty(columnCode)){
- return Result.fail("请输入栏目编码");
- }
QueryWrapper<ColumnEntity> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("column_code",columnCode);
List<ColumnEntity> columnEntities = this.baseMapper.selectList(objectQueryWrapper);
@@ -92,13 +86,9 @@
}
columnEntity.setColumnCode(columnCode);
String remark = adminAddColumnDto.getRemark();
- if(StrUtil.isNotEmpty(remark)){
columnEntity.setRemark(remark);
- }
String pic = adminAddColumnDto.getPic();
- if(StrUtil.isNotEmpty(pic)){
columnEntity.setPic(pic);
- }
Integer orderNum = adminAddColumnDto.getOrderNum();
if(ObjectUtil.isNotEmpty(orderNum)){
columnEntity.setOrderNum(orderNum);
@@ -159,14 +149,8 @@
return Result.fail("栏目不存在");
}
String columnName = adminUpdateColumnDto.getColumnName();
- if(StrUtil.isEmpty(columnName)){
- return Result.fail("请输入栏目名称");
- }
columnEntity.setColumnName(columnName);
String columnCode = adminUpdateColumnDto.getColumnCode();
- if(StrUtil.isEmpty(columnCode)){
- return Result.fail("请输入栏目编码");
- }
QueryWrapper<ColumnEntity> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("column_code",columnCode);
List<ColumnEntity> columnEntities = this.baseMapper.selectList(objectQueryWrapper);
@@ -175,13 +159,9 @@
}
columnEntity.setColumnCode(columnCode);
String remark = adminUpdateColumnDto.getRemark();
- if(StrUtil.isNotEmpty(remark)){
columnEntity.setRemark(remark);
- }
String pic = adminUpdateColumnDto.getPic();
- if(StrUtil.isNotEmpty(pic)){
columnEntity.setPic(pic);
- }
Integer orderNum = adminUpdateColumnDto.getOrderNum();
if(ObjectUtil.isNotEmpty(orderNum)){
columnEntity.setOrderNum(orderNum);
@@ -199,14 +179,14 @@
@Override
public Result getColumnInList() {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
- List<AdminColumnVo> records = this.baseMapper.selectColumnInListByParentId(ColumnEntity.PARENTID_DEFAULT,belongId);
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
+ List<AdminColumnVo> records = this.baseMapper.selectColumnInListByParentId(ColumnEntity.PARENTID_DEFAULT,companyId);
if(CollUtil.isNotEmpty(records)){
for(AdminColumnVo adminColumnVo : records){
Long id = adminColumnVo.getId();
QueryWrapper<ColumnEntity> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("parent_id",id);
- objectQueryWrapper.eq("belong_id",belongId);
+ objectQueryWrapper.eq("company_id",companyId);
List<ColumnEntity> columnEntities = this.baseMapper.selectList(objectQueryWrapper);
List<AdminColumnVo> adminColumnVoChilds = new ArrayList<>();
if(CollUtil.isNotEmpty(columnEntities)){
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CompanyServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CompanyServiceImpl.java
new file mode 100644
index 0000000..27a5279
--- /dev/null
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/CompanyServiceImpl.java
@@ -0,0 +1,156 @@
+package com.xcong.farmer.cms.modules.system.service.Impl;
+
+import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xcong.farmer.cms.common.response.Result;
+import com.xcong.farmer.cms.modules.system.dto.AdminAddCompanyDto;
+import com.xcong.farmer.cms.modules.system.dto.AdminBelongDto;
+import com.xcong.farmer.cms.modules.system.dto.AdminDeleteDto;
+import com.xcong.farmer.cms.modules.system.dto.AdminUpdateCompanyDto;
+import com.xcong.farmer.cms.modules.system.entity.CompanyEntity;
+import com.xcong.farmer.cms.modules.system.entity.UserEntity;
+import com.xcong.farmer.cms.modules.system.mapper.CompanyMapper;
+import com.xcong.farmer.cms.modules.system.service.ICompanyService;
+import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
+import com.xcong.farmer.cms.modules.system.vo.AdminCompanyVo;
+import com.xcong.farmer.cms.modules.system.vo.AdminSeeCompanyInfoVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import cn.hutool.core.collection.CollUtil;
+
+import cn.hutool.core.util.ObjectUtil;
+import org.springframework.transaction.annotation.Transactional;
+
+@Service
+@Slf4j
+public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, CompanyEntity> implements ICompanyService {
+ @Override
+ public Result getBelongInPage(AdminBelongDto adminBelongDto) {
+ UserEntity userlogin = LoginUserUtil.getLoginUser();
+ Long belongId = userlogin.getCompanyId();
+ Page<AdminCompanyVo> page = new Page<>(adminBelongDto.getPageNum(), adminBelongDto.getPageSize());
+ CompanyEntity companyEntity = new CompanyEntity();
+ String name = adminBelongDto.getName();
+ if(StrUtil.isNotEmpty(name)){
+ companyEntity.setName(name);
+ }
+ if(belongId != UserEntity.USER_BELONG_TOP){
+ companyEntity.setId(belongId);
+ }
+ IPage<AdminCompanyVo> list = this.baseMapper.selectAdminBelongInPage(page, companyEntity);
+ return Result.ok(list);
+ }
+
+ @Override
+ @Transactional
+ public Result addBelong(AdminAddCompanyDto adminAddCompanyDto) {
+ String name = adminAddCompanyDto.getName();
+ String code = adminAddCompanyDto.getCode();
+ QueryWrapper<CompanyEntity> objectQueryWrapper = new QueryWrapper<>();
+ objectQueryWrapper.eq("code",code);
+ List<CompanyEntity> belongEntities = this.baseMapper.selectList(objectQueryWrapper);
+ if(CollUtil.isNotEmpty(belongEntities)){
+ return Result.fail("编码已存在,请重新输入");
+ }
+ CompanyEntity companyEntity = new CompanyEntity();
+ companyEntity.setName(name);
+ companyEntity.setCode(code);
+ String webAddress = adminAddCompanyDto.getWebAddress();
+ companyEntity.setWebAddress(webAddress);
+ String remark = adminAddCompanyDto.getRemark();
+ companyEntity.setRemark(remark);
+ String pic = adminAddCompanyDto.getPic();
+ companyEntity.setPic(pic);
+ this.baseMapper.insert(companyEntity);
+ return Result.ok("添加成功");
+ }
+
+ @Override
+ public Result seeBelongInfo(Long id) {
+ CompanyEntity companyEntity = this.baseMapper.selectById(id);
+ if(ObjectUtil.isEmpty(companyEntity)){
+ Result.fail("所属公司不存在");
+ }
+ AdminSeeCompanyInfoVo adminSeeCompanyInfoVo = new AdminSeeCompanyInfoVo();
+ adminSeeCompanyInfoVo.setId(companyEntity.getId());
+ adminSeeCompanyInfoVo.setName(companyEntity.getName());
+ adminSeeCompanyInfoVo.setCode(companyEntity.getCode());
+ adminSeeCompanyInfoVo.setRemark(companyEntity.getRemark());
+ adminSeeCompanyInfoVo.setWebAddress(companyEntity.getWebAddress());
+ adminSeeCompanyInfoVo.setPic(companyEntity.getPic());
+ return Result.ok(adminSeeCompanyInfoVo);
+ }
+
+ @Override
+ @Transactional
+ public Result updateBelong(AdminUpdateCompanyDto adminUpdateCompanyDto) {
+ Long id = adminUpdateCompanyDto.getId();
+ CompanyEntity companyEntity = this.baseMapper.selectById(id);
+ if(ObjectUtil.isEmpty(companyEntity)){
+ Result.fail("所属公司不存在");
+ }
+ String name = adminUpdateCompanyDto.getName();
+ companyEntity.setName(name);
+ String code = adminUpdateCompanyDto.getCode();
+ if(!companyEntity.getCode().equals(code)){
+ QueryWrapper<CompanyEntity> objectQueryWrapper = new QueryWrapper<>();
+ objectQueryWrapper.eq("code",code);
+ List<CompanyEntity> belongEntities = this.baseMapper.selectList(objectQueryWrapper);
+ if(CollUtil.isNotEmpty(belongEntities)){
+ return Result.fail("编码已存在,请重新输入");
+ }
+ companyEntity.setCode(code);
+ }
+ companyEntity.setWebAddress(adminUpdateCompanyDto.getWebAddress());
+ companyEntity.setRemark(adminUpdateCompanyDto.getRemark());
+ companyEntity.setPic(adminUpdateCompanyDto.getPic());
+ this.baseMapper.updateById(companyEntity);
+ return Result.ok("更新成功");
+ }
+
+ @Override
+ public Result getBelongInList() {
+ UserEntity userlogin = LoginUserUtil.getLoginUser();
+ Long companyId = userlogin.getCompanyId();
+ QueryWrapper<CompanyEntity> objectQueryWrapper = new QueryWrapper<>();
+ if(companyId != UserEntity.USER_BELONG_TOP){
+ objectQueryWrapper.eq("id",companyId);
+ }
+ List<CompanyEntity> belongEntities = this.baseMapper.selectList(objectQueryWrapper);
+ List<AdminCompanyVo> adminCompanyVos = new ArrayList<>();
+ if(CollUtil.isNotEmpty(belongEntities)){
+ for(CompanyEntity companyEntity : belongEntities){
+ AdminCompanyVo adminCompanyVo = new AdminCompanyVo();
+ adminCompanyVo.setId(companyEntity.getId());
+ adminCompanyVo.setName(companyEntity.getName());
+ adminCompanyVo.setCode(companyEntity.getCode());
+ adminCompanyVos.add(adminCompanyVo);
+ }
+ }
+ return Result.ok(adminCompanyVos);
+ }
+
+ @Override
+ public Result delObjs(AdminDeleteDto adminDeleteDto) {
+ String ids = adminDeleteDto.getIds();
+ UserEntity userlogin = LoginUserUtil.getLoginUser();
+ if(userlogin.getCompanyId() != UserEntity.USER_BELONG_TOP){
+ return Result.fail("没有删除权限");
+ }
+ if(StrUtil.isNotEmpty(ids)){
+ String[] companyIds = ids.split(StringPool.COMMA);
+ for(String companyIdStr : companyIds){
+ Long companyId = Long.valueOf(companyIdStr);
+ this.baseMapper.deleteById(companyId);
+ }
+ }
+ return Result.ok("删除成功");
+ }
+}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/MenuServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/MenuServiceImpl.java
index 179b0e4..fcc7874 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/MenuServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/MenuServiceImpl.java
@@ -80,13 +80,7 @@
public Result addMenu(AdminAddMenuDto adminAddMenuDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
String menuName = adminAddMenuDto.getMenuName();
- if(StrUtil.isEmpty(menuName)){
- return Result.fail("请输入菜单名称");
- }
Integer menuType = adminAddMenuDto.getMenuType();
- if(ObjectUtil.isEmpty(menuType)){
- return Result.fail("请输入菜单类型");
- }
MenuEntity menuEntity = new MenuEntity();
menuEntity.setMenuName(menuName);
menuEntity.setMenuType(menuType);
@@ -151,14 +145,8 @@
return Result.fail("菜单不存在");
}
String menuName = adminUpdateMenuDto.getMenuName();
- if(StrUtil.isEmpty(menuName)){
- return Result.fail("请输入菜单名称");
- }
menuEntity.setMenuName(menuName);
Integer menuType = adminUpdateMenuDto.getMenuType();
- if(ObjectUtil.isEmpty(menuType)){
- return Result.fail("请输入菜单类型");
- }
menuEntity.setMenuType(menuType);
String routeUrl = adminUpdateMenuDto.getRouteUrl();
if(StrUtil.isNotEmpty(routeUrl)){
@@ -207,7 +195,6 @@
Long id = adminMenuVo.getId();
QueryWrapper<MenuEntity> objectQueryWrapper = new QueryWrapper<>();
objectQueryWrapper.eq("parent_id",id);
-// objectQueryWrapper.eq("belong_id",belongId);
List<MenuEntity> menuEntities = this.baseMapper.selectList(objectQueryWrapper);
List<AdminMenuVo> adminMenuVoChilds = new ArrayList<>();
if(CollUtil.isNotEmpty(menuEntities)){
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/NavigationBarServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/NavigationBarServiceImpl.java
index 7868294..6b70765 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/NavigationBarServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/NavigationBarServiceImpl.java
@@ -42,11 +42,11 @@
@Override
public Result getBarInPage(AdminNavigationBarDto adminNavigationBarDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
Page<AdminNavigationBarVo> page = new Page<>(adminNavigationBarDto.getPageNum(), adminNavigationBarDto.getPageSize());
NavigationBarEntity navigationBarEntity = new NavigationBarEntity();
navigationBarEntity.setParentId(NavigationBarEntity.PARENTID_DEFAULT);
- navigationBarEntity.setBelongId(belongId);
+ navigationBarEntity.setCompanyId(companyId);
IPage<AdminNavigationBarVo> list = navigationBarMapper.selectAdminNavigationBarVoInPage(page,navigationBarEntity);
List<AdminNavigationBarVo> records = list.getRecords();
if(CollUtil.isNotEmpty(records)){
@@ -78,13 +78,10 @@
@Transactional
public Result addBar(AdminAddBarDto adminAddBarDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
NavigationBarEntity navigationBarEntity = new NavigationBarEntity();
- navigationBarEntity.setBelongId(belongId);
+ navigationBarEntity.setCompanyId(companyId);
String barName = adminAddBarDto.getBarName();
- if(StrUtil.isEmpty(barName)){
- return Result.fail("请输入导航栏标题");
- }
navigationBarEntity.setBarName(barName);
Long parentId = adminAddBarDto.getParentId();
if(ObjectUtil.isEmpty(parentId)){
@@ -93,21 +90,13 @@
navigationBarEntity.setParentId(parentId);
}
String linkUrl = adminAddBarDto.getLinkUrl();
- if(StrUtil.isNotEmpty(linkUrl)){
navigationBarEntity.setLinkUrl(linkUrl);
- }
Integer orderNum = adminAddBarDto.getOrderNum();
- if(ObjectUtil.isNotEmpty(orderNum)){
navigationBarEntity.setOrderNum(orderNum);
- }
String pic = adminAddBarDto.getPic();
- if(StrUtil.isNotEmpty(pic)){
navigationBarEntity.setPic(pic);
- }
String remark = adminAddBarDto.getRemark();
- if(StrUtil.isNotEmpty(remark)){
navigationBarEntity.setRemark(remark);
- }
navigationBarMapper.insert(navigationBarEntity);
return Result.ok("添加成功");
}
@@ -158,9 +147,6 @@
return Result.fail("导航栏不存在");
}
String barName = adminUpdateMenuDto.getBarName();
- if(StrUtil.isEmpty(barName)){
- return Result.fail("请输入导航栏标题");
- }
navigationBarEntity.setBarName(barName);
Long parentId = adminUpdateMenuDto.getParentId();
if(ObjectUtil.isEmpty(parentId)){
@@ -169,21 +155,13 @@
navigationBarEntity.setParentId(parentId);
}
String linkUrl = adminUpdateMenuDto.getLinkUrl();
- if(StrUtil.isNotEmpty(linkUrl)){
navigationBarEntity.setLinkUrl(linkUrl);
- }
Integer orderNum = adminUpdateMenuDto.getOrderNum();
- if(ObjectUtil.isNotEmpty(orderNum)){
navigationBarEntity.setOrderNum(orderNum);
- }
String pic = adminUpdateMenuDto.getPic();
- if(StrUtil.isNotEmpty(pic)){
navigationBarEntity.setPic(pic);
- }
String remark = adminUpdateMenuDto.getRemark();
- if(StrUtil.isNotEmpty(remark)){
navigationBarEntity.setRemark(remark);
- }
navigationBarMapper.updateById(navigationBarEntity);
return Result.ok("更新成功");
}
@@ -191,12 +169,12 @@
@Override
public Result getBarInList() {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
- List<AdminNavigationBarVo> records = navigationBarMapper.selectAdminNavigationBarVoByParentId(NavigationBarEntity.PARENTID_DEFAULT,belongId);
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
+ List<AdminNavigationBarVo> records = navigationBarMapper.selectAdminNavigationBarVoByParentId(NavigationBarEntity.PARENTID_DEFAULT,companyId);
if(CollUtil.isNotEmpty(records)){
for(AdminNavigationBarVo adminNavigationBarVo : records){
Long id = adminNavigationBarVo.getId();
- List<NavigationBarEntity> navigationBarEntities = navigationBarMapper.selectListByParentId(id,belongId);
+ List<NavigationBarEntity> navigationBarEntities = navigationBarMapper.selectListByParentId(id,companyId);
List<AdminNavigationBarVo> adminNavigationBarVoChilds = new ArrayList<>();
if(CollUtil.isNotEmpty(navigationBarEntities)){
for(NavigationBarEntity navigationBarEntityChild : navigationBarEntities){
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/RoleServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/RoleServiceImpl.java
index 6c8a2ad..216f8ad 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/RoleServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/RoleServiceImpl.java
@@ -50,12 +50,12 @@
UserEntity userlogin = LoginUserUtil.getLoginUser();
Page<AdminRoleVo> page = new Page<>(adminRoleDto.getPageNum(), adminRoleDto.getPageSize());
RoleEntity roleEntity = new RoleEntity();
- Long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ Long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
if(StrUtil.isNotEmpty(adminRoleDto.getRoleName())){
roleEntity.setRoleName(adminRoleDto.getRoleName());
}
- if(belongId > UserEntity.USER_BELONG_TOP){
- roleEntity.setBelongId(belongId);
+ if(companyId > UserEntity.USER_BELONG_TOP){
+ roleEntity.setCompanyId(companyId);
}
IPage<AdminRoleVo> list = this.baseMapper.selectAdminRoleVoInPage(page,roleEntity);
return Result.ok(list);
@@ -73,7 +73,7 @@
roleEntity.setRemark(remark);
}
roleEntity.setRoleName(roleName);
- roleEntity.setBelongId(userlogin.getBelongId() == null?UserEntity.USER_BELONG_TOP:userlogin.getBelongId());
+ roleEntity.setCompanyId(userlogin.getCompanyId() == null?UserEntity.USER_BELONG_TOP:userlogin.getCompanyId());
int insert = this.baseMapper.insert(roleEntity);
if(insert > 0){
saveRoleMenus(menuIds,roleEntity.getId());
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/UserServiceImpl.java b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/UserServiceImpl.java
index af97f37..04baff4 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/UserServiceImpl.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/service/Impl/UserServiceImpl.java
@@ -43,11 +43,11 @@
UserEntity userlogin = LoginUserUtil.getLoginUser();
Page<AdminUserVo> page = new Page<>(adminUserDto.getPageNum(), adminUserDto.getPageSize());
UserEntity userEntity = new UserEntity();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
- if(belongId > UserEntity.USER_BELONG_TOP){
- userEntity.setBelongId(belongId);
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
+ if(companyId > UserEntity.USER_BELONG_TOP){
+ userEntity.setCompanyId(companyId);
userEntity.setRoleName(RoleEntity.ROLE_ADMIN_NAME);
- }else if(belongId == UserEntity.USER_BELONG_TOP){
+ }else if(companyId == UserEntity.USER_BELONG_TOP){
userEntity.setRoleName(RoleEntity.ROLE_SUPER_NAME);
}
if(StrUtil.isNotEmpty(adminUserDto.getUsername())){
@@ -105,7 +105,7 @@
}
userEntity.setPassword(SecureUtil.md5(UserEntity.PASSWORD_DEFAULT));
userEntity.setStatus(UserEntity.STATUS_ENABLE);
- userEntity.setBelongId(belongId);
+ userEntity.setCompanyId(belongId);
int insert = this.baseMapper.insert(userEntity);
if(insert > 0){
saveUserRole(roleIds,userEntity.getId());
@@ -165,7 +165,7 @@
adminSeeUserInfoVo.setNickname(userEntity.getNickname());
adminSeeUserInfoVo.setPhone(userEntity.getPhone());
adminSeeUserInfoVo.setEmail(userEntity.getEmail());
- adminSeeUserInfoVo.setBelongId(userEntity.getBelongId());
+ adminSeeUserInfoVo.setBelongId(userEntity.getCompanyId());
List<AdminRoleVo> adminRoleVos = new ArrayList<>();
QueryWrapper<UserRoleEntity> objectQueryWrapper = new QueryWrapper<>();
@@ -207,7 +207,7 @@
if(ObjectUtil.isEmpty(userEntity)){
return Result.fail("用户不存在");
}
- userEntity.setBelongId(belongId);
+ userEntity.setCompanyId(belongId);
userEntity.setUsername(username);
userEntity.setPhone(phone);
if(StrUtil.isNotEmpty(adminUpdateUserDto.getNickname())){
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 b01fafc..bd64743 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,10 +25,10 @@
@Override
public Result seeWebSetInfo() {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : 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);
+ objectQueryWrapper.eq("company_id",companyId);
List<WebSetEntity> webSetEntities = this.baseMapper.selectList(new QueryWrapper<>());
if(CollUtil.isNotEmpty(webSetEntities)){
WebSetEntity webSetEntity = webSetEntities.get(0);
@@ -44,12 +44,12 @@
@Override
public Result updateWebSet(AdminUpdateWebSetDto adminUpdateWebSetDto) {
UserEntity userlogin = LoginUserUtil.getLoginUser();
- long belongId = userlogin.getBelongId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getBelongId();
+ long companyId = userlogin.getCompanyId() == null ? UserEntity.USER_BELONG_TOP : userlogin.getCompanyId();
String webTitle = adminUpdateWebSetDto.getWebTitle();
String webKeyword = adminUpdateWebSetDto.getWebKeyword();
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);
if(ObjectUtil.isEmpty(webSetEntity)){
WebSetEntity webSetEntityAdd = new WebSetEntity();
@@ -63,7 +63,7 @@
if(StrUtil.isNotEmpty(webPic)){
webSetEntityAdd.setWebPic(webPic);
}
- webSetEntityAdd.setBelongId(belongId);
+ webSetEntityAdd.setCompanyId(companyId);
this.baseMapper.insert(webSetEntityAdd);
return Result.ok("保存成功");
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminBelongVo.java b/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminCompanyVo.java
similarity index 94%
rename from src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminBelongVo.java
rename to src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminCompanyVo.java
index 0661cb3..eb05ac3 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminBelongVo.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminCompanyVo.java
@@ -6,7 +6,7 @@
@Data
@ApiModel(value = "AdminBelongVo", description = "所属公司列表返回")
-public class AdminBelongVo {
+public class AdminCompanyVo {
private Long id;
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java b/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java
index 564fcb7..a753394 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeArticleInfoVo.java
@@ -48,4 +48,7 @@
@ApiModelProperty(value = "文章详情")
private String articleDetails;
+
+ @ApiModelProperty(value = "附件")
+ private String uploadFile;
}
diff --git a/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeBelongInfoVo.java b/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeCompanyInfoVo.java
similarity index 93%
rename from src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeBelongInfoVo.java
rename to src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeCompanyInfoVo.java
index 272bb51..abf56f8 100644
--- a/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeBelongInfoVo.java
+++ b/src/main/java/com/xcong/farmer/cms/modules/system/vo/AdminSeeCompanyInfoVo.java
@@ -6,7 +6,7 @@
@Data
@ApiModel(value = "AdminSeeBelongInfoVo", description = "所属公司返回")
-public class AdminSeeBelongInfoVo {
+public class AdminSeeCompanyInfoVo {
private Long id;
diff --git a/src/main/resources/mapper/ArticleMapper.xml b/src/main/resources/mapper/ArticleMapper.xml
index 5fb25f7..ef9352b 100644
--- a/src/main/resources/mapper/ArticleMapper.xml
+++ b/src/main/resources/mapper/ArticleMapper.xml
@@ -16,7 +16,7 @@
and a.column_id = #{record.columnId}
</if>
<if test="record.belongId != null">
- and a.belong_id = #{record.belongId}
+ and a.company_id = #{record.belongId}
</if>
<if test="record.title!=null">
and a.title like concat ('%',#{record.title},'%')
diff --git a/src/main/resources/mapper/ColumnMapper.xml b/src/main/resources/mapper/ColumnMapper.xml
index 81380ce..3fdb807 100644
--- a/src/main/resources/mapper/ColumnMapper.xml
+++ b/src/main/resources/mapper/ColumnMapper.xml
@@ -13,7 +13,7 @@
and a.parent_id = #{record.parentId}
</if>
<if test="record.belongId != null">
- and a.belong_id = #{record.belongId}
+ and a.company_id = #{record.belongId}
</if>
</if>
</where>
@@ -25,7 +25,7 @@
a.*
FROM
t_column a
- where a.parent_id = #{parentId} and a.belong_id = #{belongId}
+ where a.parent_id = #{parentId} and a.company_id = #{belongId}
order by a.create_time desc
</select>
diff --git a/src/main/resources/mapper/BelongMapper.xml b/src/main/resources/mapper/CompanyMapper.xml
similarity index 81%
rename from src/main/resources/mapper/BelongMapper.xml
rename to src/main/resources/mapper/CompanyMapper.xml
index 06bc4fb..ab6601a 100644
--- a/src/main/resources/mapper/BelongMapper.xml
+++ b/src/main/resources/mapper/CompanyMapper.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.xcong.farmer.cms.modules.system.mapper.BelongMapper">
+<mapper namespace="com.xcong.farmer.cms.modules.system.mapper.CompanyMapper">
- <select id="selectAdminBelongInPage" resultType="com.xcong.farmer.cms.modules.system.vo.AdminBelongVo">
+ <select id="selectAdminBelongInPage" resultType="com.xcong.farmer.cms.modules.system.vo.AdminCompanyVo">
SELECT
a.*
FROM
- t_belong a
+ t_company a
<where>
<if test="record != null" >
<if test="record.name!=null">
diff --git a/src/main/resources/mapper/NavigationBarMapper.xml b/src/main/resources/mapper/NavigationBarMapper.xml
index 347307a..1893c71 100644
--- a/src/main/resources/mapper/NavigationBarMapper.xml
+++ b/src/main/resources/mapper/NavigationBarMapper.xml
@@ -13,7 +13,7 @@
and a.parent_id = #{record.parentId}
</if>
<if test="record.belongId != null">
- and a.belong_id = #{record.belongId}
+ and a.company_id = #{record.belongId}
</if>
</if>
</where>
@@ -26,7 +26,7 @@
FROM
t_navigation_bar a
where a.parent_id = #{parentId}
- and a.belong_id = #{belongId}
+ and a.company_id = #{belongId}
order by a.create_time desc
</select>
@@ -36,7 +36,7 @@
FROM
t_navigation_bar a
where a.parent_id = #{parentId}
- and a.belong_id = #{belongId}
+ and a.company_id = #{belongId}
order by a.create_time desc
</select>
diff --git a/src/main/resources/mapper/RoleMapper.xml b/src/main/resources/mapper/RoleMapper.xml
index 8757072..2d4e3a5 100644
--- a/src/main/resources/mapper/RoleMapper.xml
+++ b/src/main/resources/mapper/RoleMapper.xml
@@ -13,7 +13,7 @@
and a.role_name like concat ('%',#{record.roleName},'%')
</if>
<if test="record.belongId!=null">
- and a.belong_id = #{record.belongId}
+ and a.company_id = #{record.belongId}
</if>
</if>
</where>
diff --git a/src/main/resources/mapper/UserMapper.xml b/src/main/resources/mapper/UserMapper.xml
index f419216..c406e22 100644
--- a/src/main/resources/mapper/UserMapper.xml
+++ b/src/main/resources/mapper/UserMapper.xml
@@ -7,7 +7,7 @@
a.*
FROM
t_user a
- left join t_belong b on a.belong_id = b.id
+ left join t_company b on a.company_id = b.id
<where>
and a.id not in (
SELECT b.user_id FROM t_user_role b
@@ -18,7 +18,7 @@
and a.username like concat ('%',#{record.username},'%')
</if>
<if test="record.belongId!=null">
- and a.belong_id = #{record.belongId}
+ and a.company_id = #{record.belongId}
</if>
</if>
</where>
--
Gitblit v1.9.1