From 5367bd3bbe36adf8765d939a32419fdd6fbcad01 Mon Sep 17 00:00:00 2001 From: xiejunyu Date: Fri, 25 Feb 2022 17:59:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=87=E7=AD=BE+=E6=94=B6=E8=97=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/OnlCgformCollectionController.java | 13 +++++++++++-- .../mapper/OnlCgformCollectionMapper.java | 4 ++-- .../controller/OnlCgformSubscribeController.java | 14 ++++++++++++-- .../tag/controller/OnlCgformTagController.java | 3 --- .../com/jero/modules/tag/entity/OnlCgformTag.java | 10 ++-------- .../modules/tag/service/IOnlCgformTagService.java | 7 ------- .../tag/service/impl/OnlCgformTagServiceImpl.java | 14 +------------- 7 files changed, 28 insertions(+), 37 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java index b3e96d815..a646eb742 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/controller/OnlCgformCollectionController.java @@ -112,8 +112,17 @@ public class OnlCgformCollectionController extends JeroController add(@Validated @RequestBody OnlCgformCollection onlCgformCollection) { - onlCgformCollectionService.add(onlCgformCollection); - return Result.OK("添加成功!"); + LambdaQueryWrapper lambdaQueryWrapper= new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(OnlCgformCollection::getId,onlCgformCollection.getDocumentId()) + .eq(OnlCgformCollection::getDocumentId,onlCgformCollection.getDocumentId()); + int count=onlCgformCollectionService.count(lambdaQueryWrapper); + if(count==0){ + onlCgformCollectionService.add(onlCgformCollection); + return Result.OK("添加成功!"); + } + else{ + return Result.error("该值不可重复添加,系统中已存在!"); + } } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/OnlCgformCollectionMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/OnlCgformCollectionMapper.java index 13131eac5..03d9add50 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/OnlCgformCollectionMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/collection/mapper/OnlCgformCollectionMapper.java @@ -15,7 +15,7 @@ import java.util.List; */ public interface OnlCgformCollectionMapper extends BaseMapper { - @Select("select * from buss_document_library as document LEFT JOIN onl_cgform_collection\n" + - "as collection on document.id= collection.document_id;") + @Select("select * from buss_document_library as document LEFT JOIN onl_cgform_collection as collection\n" + + " on document.id= collection.document_id;") List queryListByDocumentId(@Param("document_id") String document_id); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/OnlCgformSubscribeController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/OnlCgformSubscribeController.java index 2f9fa92e5..c94c21906 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/OnlCgformSubscribeController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/subscribe/controller/OnlCgformSubscribeController.java @@ -1,5 +1,6 @@ package com.jero.modules.subscribe.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -110,8 +111,17 @@ public class OnlCgformSubscribeController extends JeroController add(@Validated @RequestBody OnlCgformSubscribe onlCgformSubscribe) { - onlCgformSubscribeService.add(onlCgformSubscribe); - return Result.OK("添加成功!"); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(OnlCgformSubscribe::getDocumentId, onlCgformSubscribe.getDocumentId()) + .eq(OnlCgformSubscribe::getId, onlCgformSubscribe.getId()); + int count = onlCgformSubscribeService.count(lambdaQueryWrapper); + if (count == 0) { + onlCgformSubscribeService.add(onlCgformSubscribe); + return Result.OK("添加成功!"); + } + else{ + return Result.error("该值不可重复添加,系统中已存在"); + } } /** diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java index b9d10855b..97d3f4a47 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/controller/OnlCgformTagController.java @@ -58,9 +58,6 @@ public class OnlCgformTagController extends JeroController queryWrapper = QueryGenerator.initQueryWrapper(onlCgformTag, req.getParameterMap()); Page page = new Page(pageNo, pageSize); IPage pageList = onlCgformTagService.page(page, queryWrapper); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/entity/OnlCgformTag.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/entity/OnlCgformTag.java index 562174417..11f314608 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/entity/OnlCgformTag.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/entity/OnlCgformTag.java @@ -122,17 +122,11 @@ public class OnlCgformTag implements Serializable { private java.lang.Integer isReadOnly; /**展示区域*/ - @Excel(name = "展示区域", width = 15, dictTable = "onl_cgform_area", dicText = "show_area", dicCode = "show_area") - @Dict(dictTable = "onl_cgform_area", dicText = "show_area", dicCode = "show_area") + @Excel(name = "展示区域", width = 15, dictTable = "onl_cgform_area", dicText = "show_area", dicCode = "id") + @Dict(dictTable = "onl_cgform_area", dicText = "show_area", dicCode = "id") @ApiModelProperty(value = "展示区域") private java.lang.String showArea; - /**展示区域*/ - @Excel(name = "展示区域", width = 15, dictTable = "onl_cgform_area", dicText = "id", dicCode = "id") - @Dict(dictTable = "onl_cgform_area", dicText = "id", dicCode = "id") - @ApiModelProperty(value = "展示区域") - private java.lang.String area_id; - /**是否查询条件0否 1是*/ @Excel(name = "是否查询条件0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "is_query", dicCode = "is_query") @Dict(dictTable = "onl_cgform_field", dicText = "is_query", dicCode = "is_query") diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/IOnlCgformTagService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/IOnlCgformTagService.java index 46a46c20e..d102f3488 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/IOnlCgformTagService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/IOnlCgformTagService.java @@ -56,13 +56,6 @@ public interface IOnlCgformTagService extends IService { */ OnlCgformTag queryById(String id); - /** - * 通过area_id查询展示区域 - * - * @param area_id - * @return - */ - List selectShowAreaById(String area_id); /** * 列表查询 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/impl/OnlCgformTagServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/impl/OnlCgformTagServiceImpl.java index fa92c1907..0135dea4f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/impl/OnlCgformTagServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/tag/service/impl/OnlCgformTagServiceImpl.java @@ -1,7 +1,6 @@ package com.jero.modules.tag.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.common.api.vo.Result; @@ -94,18 +93,7 @@ public class OnlCgformTagServiceImpl extends ServiceImpl selectShowAreaById(String area_id) { - QueryWrapper queryWrapper=new QueryWrapper<>(); - queryWrapper.select("show_area").eq("id",area_id); - return list(queryWrapper); - } + /** * 列表查询 *