标签管理
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
@Autowired
|
||||
private IOnlCgformAreaService onlCgformAreaService;
|
||||
//TODO 这里不允许定义变量
|
||||
List<OnlCgformArea> list;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package com.jero.modules.tag.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.IOnlCgformFieldService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 标签管理
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="标签管理")
|
||||
@RestController
|
||||
@RequestMapping("/Field/onlCgformField")
|
||||
@Slf4j
|
||||
public class OnlCgformTagController extends JeroController<OnlCgformField, IOnlCgformFieldService> {
|
||||
@Autowired
|
||||
private IOnlCgformFieldService onlCgformFieldService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param onlCgformField
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-分页列表查询")
|
||||
@ApiOperation(value="标签管理-分页列表查询", notes="标签管理-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(OnlCgformField onlCgformField,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OnlCgformField> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformField, req.getParameterMap());
|
||||
Page<OnlCgformField> page = new Page<OnlCgformField>(pageNo, pageSize);
|
||||
IPage<OnlCgformField> pageList = onlCgformFieldService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-列表查询")
|
||||
@ApiOperation(value="标签管理-列表查询", notes="标签管理-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<OnlCgformField>> queryList() {
|
||||
List<OnlCgformField> list = onlCgformFieldService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param onlCgformField
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-添加")
|
||||
@ApiOperation(value="标签管理-添加", notes="标签管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformField onlCgformField) {
|
||||
onlCgformFieldService.add(onlCgformField);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param onlCgformField
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-编辑")
|
||||
@ApiOperation(value="标签管理-编辑", notes="标签管理-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody OnlCgformField onlCgformField) {
|
||||
onlCgformFieldService.editById(onlCgformField);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-通过id删除")
|
||||
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
onlCgformFieldService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-批量删除")
|
||||
@ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.onlCgformFieldService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "标签管理-通过id查询")
|
||||
@ApiOperation(value="标签管理-通过id查询", notes="标签管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
OnlCgformField onlCgformField = onlCgformFieldService.queryById(id);
|
||||
if(onlCgformField==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(onlCgformField);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param onlCgformField
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, OnlCgformField onlCgformField) {
|
||||
return super.exportXls(request, onlCgformField, OnlCgformField.class, "标签管理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, OnlCgformField.class);
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -58,9 +58,9 @@ public class OnlCgformArea implements Serializable {
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**展示区域*/
|
||||
@Excel(name = "展示区域", width = 15)
|
||||
@ApiModelProperty(value = "展示区域")
|
||||
/**展示区域(1基本信息,2文本信息,3关联关系)*/
|
||||
@Excel(name = "展示区域(1基本信息,2文本信息,3关联关系)", width = 15)
|
||||
@ApiModelProperty(value = "展示区域(1基本信息,2文本信息,3关联关系)")
|
||||
private java.lang.String showArea;
|
||||
|
||||
/**英文名称*/
|
||||
|
||||
Reference in New Issue
Block a user