收藏
This commit is contained in:
+33
-16
@@ -93,14 +93,20 @@ public class SysDictItemController {
|
||||
public Result<SysDictItem> edit(@RequestBody SysDictItem sysDictItem) {
|
||||
Result<SysDictItem> result = new Result<SysDictItem>();
|
||||
SysDictItem sysdict = sysDictItemService.getById(sysDictItem.getId());
|
||||
if(sysdict==null) {
|
||||
if (sysdict == null) {
|
||||
result.error500("未找到对应实体");
|
||||
}else {
|
||||
sysDictItem.setUpdateTime(new Date());
|
||||
boolean ok = sysDictItemService.updateById(sysDictItem);
|
||||
//TODO 返回false说明什么?
|
||||
if(ok) {
|
||||
result.success("编辑成功!");
|
||||
} else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(sysDictItem.getIsReadOnly()))) {
|
||||
if (sysDictItem.getIsReadOnly() == 1) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
sysDictItem.setUpdateTime(new Date());
|
||||
boolean ok = sysDictItemService.updateById(sysDictItem);
|
||||
//TODO 返回false说明什么?
|
||||
if (ok) {
|
||||
result.success("编辑成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -118,14 +124,19 @@ public class SysDictItemController {
|
||||
public Result<SysDictItem> delete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<SysDictItem> result = new Result<SysDictItem>();
|
||||
SysDictItem joinSystem = sysDictItemService.getById(id);
|
||||
if(joinSystem==null) {
|
||||
if (joinSystem == null) {
|
||||
result.error500("未找到对应实体");
|
||||
}/*else if(joinSystem.getIsReadOnly()==1||joinSystem.getIsTagDict()==1){
|
||||
result.error("固定字段,不可修改");
|
||||
}*/else {
|
||||
boolean ok = sysDictItemService.removeById(id);
|
||||
if(ok) {
|
||||
result.success("删除成功!");
|
||||
}else {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(joinSystem.getIsReadOnly()))) {
|
||||
if (joinSystem.getIsReadOnly() == 1) {
|
||||
result.error500("固定字段,不可删除");
|
||||
}
|
||||
else {
|
||||
boolean ok = sysDictItemService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -147,8 +158,14 @@ public class SysDictItemController {
|
||||
result.error500("参数不识别!");
|
||||
}
|
||||
else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("批量删除成功!");
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(String.valueOf(sysDictItem.getIsReadOnly()))) {
|
||||
if (sysDictItem.getIsReadOnly() == 1) {
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
this.sysDictItemService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("批量删除成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
+24
-3
@@ -9,6 +9,8 @@ import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
||||
import com.jero.modules.document.controller.BussDocumentLibraryEOController;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -34,6 +36,8 @@ import java.util.List;
|
||||
public class OnlCgformCollectionController extends JeroController<OnlCgformCollection, IOnlCgformCollectionService> {
|
||||
@Autowired
|
||||
private IOnlCgformCollectionService onlCgformCollectionService;
|
||||
@Autowired
|
||||
BussDocumentLibraryEOController BussDocumentLibraryEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -73,14 +77,14 @@ public class OnlCgformCollectionController extends JeroController<OnlCgformColle
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @param bussDocumentLibraryEO
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-添加")
|
||||
@ApiOperation(value="我的收藏-添加", notes="我的收藏-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformCollection onlCgformCollection) {
|
||||
onlCgformCollectionService.add(onlCgformCollection);
|
||||
public Result<?> add(@Validated @RequestBody BussDocumentLibraryEO bussDocumentLibraryEO) {
|
||||
onlCgformCollectionService.add(bussDocumentLibraryEO);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@@ -128,4 +132,21 @@ public class OnlCgformCollectionController extends JeroController<OnlCgformColle
|
||||
}
|
||||
return Result.OK(onlCgformCollection);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的收藏-通过文档库id查询
|
||||
*
|
||||
* @param documentId
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "我的收藏-通过文档库id查询")
|
||||
@ApiOperation(value="我的收藏-通过文档库id查询", notes="我的收藏-通过文档库id查询")
|
||||
@GetMapping(value = "/queryDocumentById")
|
||||
public Result<?> queryDocumentById(@RequestParam(name="id",required=true) String documentId) {
|
||||
OnlCgformCollection onlCgformCollection = onlCgformCollectionService.queryById(documentId);
|
||||
if(onlCgformCollection==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(onlCgformCollection);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-3
@@ -2,6 +2,7 @@ package com.jero.modules.collection.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -16,10 +17,10 @@ public interface IOnlCgformCollectionService extends IService<OnlCgformCollectio
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @param bussDocumentLibraryEO
|
||||
* @return
|
||||
*/
|
||||
void add(OnlCgformCollection onlCgformCollection);
|
||||
void add(BussDocumentLibraryEO bussDocumentLibraryEO);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
@@ -45,7 +46,15 @@ public interface IOnlCgformCollectionService extends IService<OnlCgformCollectio
|
||||
*/
|
||||
OnlCgformCollection queryById(String id);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param documentId
|
||||
* @return
|
||||
*/
|
||||
//OnlCgformCollection queryByDocumentId(String documentId);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
|
||||
+16
-5
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.collection.entity.OnlCgformCollection;
|
||||
import com.jero.modules.collection.mapper.OnlCgformCollectionMapper;
|
||||
import com.jero.modules.collection.service.IOnlCgformCollectionService;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
@@ -23,14 +23,14 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl<OnlCgformCollect
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param onlCgformCollection
|
||||
* @param bussDocumentLibraryEO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformCollection onlCgformCollection) {
|
||||
public void add(BussDocumentLibraryEO bussDocumentLibraryEO) {
|
||||
Date now = new Date();
|
||||
onlCgformCollection.setCreateTime(now);
|
||||
save(onlCgformCollection);
|
||||
bussDocumentLibraryEO.setCreateTime(now);
|
||||
save((OnlCgformCollection) bussDocumentLibraryEO);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,17 @@ public class OnlCgformCollectionServiceImpl extends ServiceImpl<OnlCgformCollect
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过documentId查询
|
||||
*
|
||||
* @param documentId
|
||||
* @return
|
||||
*/
|
||||
/* @Override
|
||||
public OnlCgformCollection queryByDocumentId(String documentId) {
|
||||
return getById(documentId);
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user