标签管理
This commit is contained in:
+21
-4
@@ -5,13 +5,14 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.jero.generater.modules.online.cgform.link.LinkDown;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformHead;
|
||||
import com.jero.generater.modules.online.cgform.link.LinkDown;
|
||||
import com.jero.generater.modules.online.cgform.model.TreeModel;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IOnlCgformFieldService extends IService<OnlCgformField> {
|
||||
Map<String, Object> queryAutolistPage(String var1, String var2, Map<String, Object> var3, List<String> var4);
|
||||
@@ -73,4 +74,20 @@ public interface IOnlCgformFieldService extends IService<OnlCgformField> {
|
||||
String queryTreeChildIds(OnlCgformHead var1, String var2);
|
||||
|
||||
String queryTreePids(OnlCgformHead var1, String var2);
|
||||
|
||||
/**
|
||||
* 以下为标签管理方法
|
||||
* @return
|
||||
*/
|
||||
List<OnlCgformField> queryList();
|
||||
|
||||
void add(OnlCgformField onlCgformField);
|
||||
|
||||
void editById(OnlCgformField onlCgformField);
|
||||
|
||||
void deleteById(String id);
|
||||
|
||||
void deleteByIds(List<String> asList);
|
||||
|
||||
OnlCgformField queryById(String id);
|
||||
}
|
||||
|
||||
+82
-14
@@ -7,35 +7,30 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jero.common.constant.enums.TableEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.system.util.JeroDataAutorUtils;
|
||||
import com.jero.generater.modules.online.auth.mapper.OnlAuthDataMapper;
|
||||
import com.jero.generater.modules.online.auth.service.IOnlAuthPageService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.constant.enums.TableEnum;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.util.JeroDataAutorUtils;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.generater.modules.online.cgform.link.LinkDown;
|
||||
import com.jero.generater.modules.online.auth.mapper.OnlAuthDataMapper;
|
||||
import com.jero.generater.modules.online.auth.service.IOnlAuthPageService;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformHead;
|
||||
import com.jero.generater.modules.online.cgform.link.LinkDown;
|
||||
import com.jero.generater.modules.online.cgform.mapper.OnlCgformFieldMapper;
|
||||
import com.jero.generater.modules.online.cgform.mapper.OnlCgformHeadMapper;
|
||||
import com.jero.generater.modules.online.cgform.model.TreeModel;
|
||||
import com.jero.generater.modules.online.cgform.service.IOnlCgformFieldService;
|
||||
import com.jero.generater.modules.online.cgform.util.CgformUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service("onlCgformFieldServiceImpl")
|
||||
public class OnlCgformFieldServiceImpl extends ServiceImpl<OnlCgformFieldMapper, OnlCgformField> implements IOnlCgformFieldService {
|
||||
@@ -824,4 +819,77 @@ public class OnlCgformFieldServiceImpl extends ServiceImpl<OnlCgformFieldMapper,
|
||||
}
|
||||
return fieldList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param onlCgformField
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformField onlCgformField) {
|
||||
Date now = new Date();
|
||||
onlCgformField.setCreateTime(now);
|
||||
onlCgformField.setUpdateTime(now);
|
||||
save(onlCgformField);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param onlCgformField
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(OnlCgformField onlCgformField) {
|
||||
Date now = new Date();
|
||||
onlCgformField.setUpdateTime(now);
|
||||
saveOrUpdate(onlCgformField);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public OnlCgformField queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<OnlCgformField> queryList(){
|
||||
return list();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+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