添加功能
This commit is contained in:
parent
30a881ff70
commit
85a283d8db
|
@ -0,0 +1,174 @@
|
||||||
|
package org.jeecg.modules.kc.kcGongkaike.controller;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.entity.KcGongkaike;
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.service.IKcGongkaikeService;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: kc_gongkaike
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="kc_gongkaike")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/kcGongkaike/kcGongkaike")
|
||||||
|
@Slf4j
|
||||||
|
public class KcGongkaikeController extends JeecgController<KcGongkaike, IKcGongkaikeService> {
|
||||||
|
@Autowired
|
||||||
|
private IKcGongkaikeService kcGongkaikeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param kcGongkaike
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "kc_gongkaike-分页列表查询")
|
||||||
|
@ApiOperation(value="kc_gongkaike-分页列表查询", notes="kc_gongkaike-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<KcGongkaike>> queryPageList(KcGongkaike kcGongkaike,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<KcGongkaike> queryWrapper = QueryGenerator.initQueryWrapper(kcGongkaike, req.getParameterMap());
|
||||||
|
Page<KcGongkaike> page = new Page<KcGongkaike>(pageNo, pageSize);
|
||||||
|
IPage<KcGongkaike> pageList = kcGongkaikeService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param kcGongkaike
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "kc_gongkaike-添加")
|
||||||
|
@ApiOperation(value="kc_gongkaike-添加", notes="kc_gongkaike-添加")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody KcGongkaike kcGongkaike) {
|
||||||
|
kcGongkaikeService.save(kcGongkaike);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param kcGongkaike
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "kc_gongkaike-编辑")
|
||||||
|
@ApiOperation(value="kc_gongkaike-编辑", notes="kc_gongkaike-编辑")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody KcGongkaike kcGongkaike) {
|
||||||
|
kcGongkaikeService.updateById(kcGongkaike);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "kc_gongkaike-通过id删除")
|
||||||
|
@ApiOperation(value="kc_gongkaike-通过id删除", notes="kc_gongkaike-通过id删除")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
kcGongkaikeService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "kc_gongkaike-批量删除")
|
||||||
|
@ApiOperation(value="kc_gongkaike-批量删除", notes="kc_gongkaike-批量删除")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.kcGongkaikeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "kc_gongkaike-通过id查询")
|
||||||
|
@ApiOperation(value="kc_gongkaike-通过id查询", notes="kc_gongkaike-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<KcGongkaike> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
KcGongkaike kcGongkaike = kcGongkaikeService.getById(id);
|
||||||
|
if(kcGongkaike==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(kcGongkaike);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param kcGongkaike
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("kcGongkaike:kc_gongkaike:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, KcGongkaike kcGongkaike) {
|
||||||
|
return super.exportXls(request, kcGongkaike, KcGongkaike.class, "kc_gongkaike");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("kcGongkaike:kc_gongkaike:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, KcGongkaike.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
package org.jeecg.modules.kc.kcGongkaike.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: kc_gongkaike
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("kc_gongkaike")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="kc_gongkaike对象", description="kc_gongkaike")
|
||||||
|
public class KcGongkaike implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**id*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**学院*/
|
||||||
|
@Excel(name = "学院", width = 15)
|
||||||
|
@ApiModelProperty(value = "学院")
|
||||||
|
private java.lang.String xy;
|
||||||
|
/**候选人*/
|
||||||
|
@Excel(name = "候选人", width = 15)
|
||||||
|
@ApiModelProperty(value = "候选人")
|
||||||
|
private java.lang.String hxr;
|
||||||
|
/**职称*/
|
||||||
|
@Excel(name = "职称", width = 15)
|
||||||
|
@ApiModelProperty(value = "职称")
|
||||||
|
private java.lang.String zc;
|
||||||
|
/**日期*/
|
||||||
|
@Excel(name = "日期", width = 15)
|
||||||
|
@ApiModelProperty(value = "日期")
|
||||||
|
private java.lang.String rq;
|
||||||
|
/**开始时间*/
|
||||||
|
@Excel(name = "开始时间", width = 15)
|
||||||
|
@ApiModelProperty(value = "开始时间")
|
||||||
|
private java.lang.String kssj;
|
||||||
|
/**结束时间*/
|
||||||
|
@Excel(name = "结束时间", width = 15)
|
||||||
|
@ApiModelProperty(value = "结束时间")
|
||||||
|
private java.lang.String jssj;
|
||||||
|
/**课程名称*/
|
||||||
|
@Excel(name = "课程名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "课程名称")
|
||||||
|
private java.lang.String kcmc;
|
||||||
|
/**课堂主题*/
|
||||||
|
@Excel(name = "课堂主题", width = 15)
|
||||||
|
@ApiModelProperty(value = "课堂主题")
|
||||||
|
private java.lang.String ktzt;
|
||||||
|
/**课程链接*/
|
||||||
|
@Excel(name = "课程链接", width = 15)
|
||||||
|
@ApiModelProperty(value = "课程链接")
|
||||||
|
private java.lang.String kclj;
|
||||||
|
/**图片名称*/
|
||||||
|
@Excel(name = "图片名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "图片名称")
|
||||||
|
private java.lang.String tpmc;
|
||||||
|
/**教师介绍链接*/
|
||||||
|
@Excel(name = "教师介绍链接", width = 15)
|
||||||
|
@ApiModelProperty(value = "教师介绍链接")
|
||||||
|
private java.lang.String jslj;
|
||||||
|
/**当前状态*/
|
||||||
|
@Excel(name = "当前状态", width = 15)
|
||||||
|
@ApiModelProperty(value = "当前状态")
|
||||||
|
private java.lang.String dqzt;
|
||||||
|
/**当前状态排序 1 正在上课 2公开课预告 3 已下课*/
|
||||||
|
@Excel(name = "当前状态排序 1 正在上课 2公开课预告 3 已下课", width = 15, dicCode = "dqztpx")
|
||||||
|
@Dict(dicCode = "dqztpx")
|
||||||
|
@ApiModelProperty(value = "当前状态排序 1 正在上课 2公开课预告 3 已下课")
|
||||||
|
private java.lang.String dqztpx;
|
||||||
|
/**是否显示 1 显示 0 不显示*/
|
||||||
|
@Excel(name = "是否显示 1 显示 0 不显示", width = 15, dicCode = "sfxs")
|
||||||
|
@Dict(dicCode = "sfxs")
|
||||||
|
@ApiModelProperty(value = "是否显示 1 显示 0 不显示")
|
||||||
|
private java.lang.String sfxs;
|
||||||
|
/**类别*/
|
||||||
|
@Excel(name = "类别", width = 15)
|
||||||
|
@ApiModelProperty(value = "类别")
|
||||||
|
private java.lang.String hxrlb;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.jeecg.modules.kc.kcGongkaike.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.entity.KcGongkaike;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: kc_gongkaike
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface KcGongkaikeMapper extends BaseMapper<KcGongkaike> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.jeecg.modules.kc.kcGongkaike.mapper.KcGongkaikeMapper">
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.kc.kcGongkaike.service;
|
||||||
|
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.entity.KcGongkaike;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: kc_gongkaike
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface IKcGongkaikeService extends IService<KcGongkaike> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.modules.kc.kcGongkaike.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.entity.KcGongkaike;
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.mapper.KcGongkaikeMapper;
|
||||||
|
import org.jeecg.modules.kc.kcGongkaike.service.IKcGongkaikeService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: kc_gongkaike
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2023-04-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class KcGongkaikeServiceImpl extends ServiceImpl<KcGongkaikeMapper, KcGongkaike> implements IKcGongkaikeService {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue