标签+收藏修改

This commit is contained in:
xiejunyu
2022-02-25 17:59:59 +08:00
parent 33986145b1
commit 5367bd3bbe
7 changed files with 28 additions and 37 deletions
@@ -112,8 +112,17 @@ public class OnlCgformCollectionController extends JeroController<OnlCgformColle
@ApiOperation(value="我的收藏-添加", notes="我的收藏-添加") @ApiOperation(value="我的收藏-添加", notes="我的收藏-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OnlCgformCollection onlCgformCollection) { public Result<?> add(@Validated @RequestBody OnlCgformCollection onlCgformCollection) {
onlCgformCollectionService.add(onlCgformCollection); LambdaQueryWrapper<OnlCgformCollection> lambdaQueryWrapper= new LambdaQueryWrapper<>();
return Result.OK("添加成功!"); 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("该值不可重复添加,系统中已存在!");
}
} }
/** /**
@@ -15,7 +15,7 @@ import java.util.List;
*/ */
public interface OnlCgformCollectionMapper extends BaseMapper<OnlCgformCollection> { public interface OnlCgformCollectionMapper extends BaseMapper<OnlCgformCollection> {
@Select("select * from buss_document_library as document LEFT JOIN onl_cgform_collection\n" + @Select("select * from buss_document_library as document LEFT JOIN onl_cgform_collection as collection\n" +
"as collection on document.id= collection.document_id;") " on document.id= collection.document_id;")
List<OnlCgformCollection> queryListByDocumentId(@Param("document_id") String document_id); List<OnlCgformCollection> queryListByDocumentId(@Param("document_id") String document_id);
} }
@@ -1,5 +1,6 @@
package com.jero.modules.subscribe.controller; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -110,8 +111,17 @@ public class OnlCgformSubscribeController extends JeroController<OnlCgformSubscr
@ApiOperation(value="我的订阅-添加", notes="我的订阅-添加") @ApiOperation(value="我的订阅-添加", notes="我的订阅-添加")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody OnlCgformSubscribe onlCgformSubscribe) { public Result<?> add(@Validated @RequestBody OnlCgformSubscribe onlCgformSubscribe) {
onlCgformSubscribeService.add(onlCgformSubscribe); LambdaQueryWrapper<OnlCgformSubscribe> lambdaQueryWrapper = new LambdaQueryWrapper<>();
return Result.OK("添加成功!"); 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("该值不可重复添加,系统中已存在");
}
} }
/** /**
@@ -58,9 +58,6 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
onlCgformTagService.selectShowAreaById(onlCgformTag.getArea_id());
QueryWrapper<OnlCgformTag> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformTag, req.getParameterMap()); QueryWrapper<OnlCgformTag> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformTag, req.getParameterMap());
Page<OnlCgformTag> page = new Page<OnlCgformTag>(pageNo, pageSize); Page<OnlCgformTag> page = new Page<OnlCgformTag>(pageNo, pageSize);
IPage<OnlCgformTag> pageList = onlCgformTagService.page(page, queryWrapper); IPage<OnlCgformTag> pageList = onlCgformTagService.page(page, queryWrapper);
@@ -122,17 +122,11 @@ public class OnlCgformTag implements Serializable {
private java.lang.Integer isReadOnly; private java.lang.Integer isReadOnly;
/**展示区域*/ /**展示区域*/
@Excel(name = "展示区域", width = 15, 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 = "show_area") @Dict(dictTable = "onl_cgform_area", dicText = "show_area", dicCode = "id")
@ApiModelProperty(value = "展示区域") @ApiModelProperty(value = "展示区域")
private java.lang.String showArea; 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是*/ /**是否查询条件0否 1是*/
@Excel(name = "是否查询条件0否 1是", width = 15, dictTable = "onl_cgform_field", dicText = "is_query", dicCode = "is_query") @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") @Dict(dictTable = "onl_cgform_field", dicText = "is_query", dicCode = "is_query")
@@ -56,13 +56,6 @@ public interface IOnlCgformTagService extends IService<OnlCgformTag> {
*/ */
OnlCgformTag queryById(String id); OnlCgformTag queryById(String id);
/**
* 通过area_id查询展示区域
*
* @param area_id
* @return
*/
List<OnlCgformTag> selectShowAreaById(String area_id);
/** /**
* 列表查询 * 列表查询
@@ -1,7 +1,6 @@
package com.jero.modules.tag.service.impl; package com.jero.modules.tag.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
@@ -94,18 +93,7 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
return getById(id); return getById(id);
} }
/**
* 通过area_id查询展示区域
*
* @param area_id
* @return
*/
@Override
public List<OnlCgformTag> selectShowAreaById(String area_id) {
QueryWrapper<OnlCgformTag> queryWrapper=new QueryWrapper<>();
queryWrapper.select("show_area").eq("id",area_id);
return list(queryWrapper);
}
/** /**
* 列表查询 * 列表查询
* *