2023年4月19日 添加代码

This commit is contained in:
bai 2023-04-19 19:57:52 +08:00
parent 24c869345f
commit 4aefea4bf7
6 changed files with 274 additions and 0 deletions

View File

@ -0,0 +1,162 @@
package org.jeecg.modules.kc.qa.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 io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
import org.jeecg.modules.kc.qa.service.IKcEvaluationstudentService;
import org.springframework.beans.factory.annotation.Autowired;
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;
/**
* @Description: kc_evaluationstudent
* @Author: jeecg-boot
* @Date: 2023-04-19
* @Version: V1.0
*/
@Api(tags="kc_evaluationstudent")
@RestController
@RequestMapping("/qa/kcEvaluationstudent")
@Slf4j
public class KcEvaluationstudentController extends JeecgController<KcEvaluationstudent, IKcEvaluationstudentService> {
@Autowired
private IKcEvaluationstudentService kcEvaluationstudentService;
/**
* 分页列表查询
*
* @param kcEvaluationstudent
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "kc_evaluationstudent-分页列表查询")
@ApiOperation(value="kc_evaluationstudent-分页列表查询", notes="kc_evaluationstudent-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<KcEvaluationstudent>> queryPageList(KcEvaluationstudent kcEvaluationstudent,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcEvaluationstudent> queryWrapper = QueryGenerator.initQueryWrapper(kcEvaluationstudent, req.getParameterMap());
Page<KcEvaluationstudent> page = new Page<KcEvaluationstudent>(pageNo, pageSize);
IPage<KcEvaluationstudent> pageList = kcEvaluationstudentService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param kcEvaluationstudent
* @return
*/
@AutoLog(value = "kc_evaluationstudent-添加")
@ApiOperation(value="kc_evaluationstudent-添加", notes="kc_evaluationstudent-添加")
@RequiresPermissions("qa:kc_evaluationstudent:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody KcEvaluationstudent kcEvaluationstudent) {
kcEvaluationstudentService.save(kcEvaluationstudent);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param kcEvaluationstudent
* @return
*/
@AutoLog(value = "kc_evaluationstudent-编辑")
@ApiOperation(value="kc_evaluationstudent-编辑", notes="kc_evaluationstudent-编辑")
@RequiresPermissions("qa:kc_evaluationstudent:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody KcEvaluationstudent kcEvaluationstudent) {
kcEvaluationstudentService.updateById(kcEvaluationstudent);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "kc_evaluationstudent-通过id删除")
@ApiOperation(value="kc_evaluationstudent-通过id删除", notes="kc_evaluationstudent-通过id删除")
@RequiresPermissions("qa:kc_evaluationstudent:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
kcEvaluationstudentService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "kc_evaluationstudent-批量删除")
@ApiOperation(value="kc_evaluationstudent-批量删除", notes="kc_evaluationstudent-批量删除")
@RequiresPermissions("qa:kc_evaluationstudent:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.kcEvaluationstudentService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "kc_evaluationstudent-通过id查询")
@ApiOperation(value="kc_evaluationstudent-通过id查询", notes="kc_evaluationstudent-通过id查询")
@GetMapping(value = "/queryById")
public Result<KcEvaluationstudent> queryById(@RequestParam(name="id",required=true) String id) {
KcEvaluationstudent kcEvaluationstudent = kcEvaluationstudentService.getById(id);
if(kcEvaluationstudent==null) {
return Result.error("未找到对应数据");
}
return Result.OK(kcEvaluationstudent);
}
/**
* 导出excel
*
* @param request
* @param kcEvaluationstudent
*/
@RequiresPermissions("qa:kc_evaluationstudent:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, KcEvaluationstudent kcEvaluationstudent) {
return super.exportXls(request, kcEvaluationstudent, KcEvaluationstudent.class, "kc_evaluationstudent");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("qa:kc_evaluationstudent:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, KcEvaluationstudent.class);
}
}

View File

@ -0,0 +1,61 @@
package org.jeecg.modules.kc.qa.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: kc_evaluationstudent
* @Author: jeecg-boot
* @Date: 2023-04-19
* @Version: V1.0
*/
@Data
@TableName("kc_evaluationstudent")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="kc_evaluationstudent对象", description="kc_evaluationstudent")
public class KcEvaluationstudent implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**课堂表id*/
@Excel(name = "课堂表id", width = 15)
@ApiModelProperty(value = "课堂表id")
private java.lang.String ketangbiaoid;
/**学生学号*/
@Excel(name = "学生学号", width = 15)
@ApiModelProperty(value = "学生学号")
private java.lang.String sid;
/**学生姓名*/
@Excel(name = "学生姓名", width = 15)
@ApiModelProperty(value = "学生姓名")
private java.lang.String sname;
/**提交时间*/
@Excel(name = "提交时间", width = 15)
@ApiModelProperty(value = "提交时间")
private java.lang.String uptime;
/**提交文本内容*/
@Excel(name = "提交文本内容", width = 15)
@ApiModelProperty(value = "提交文本内容")
private java.lang.String textdeail;
/**是否匿名 0 是 1否*/
@Excel(name = "是否匿名 0 是 1否", width = 15)
@ApiModelProperty(value = "是否匿名 0 是 1否")
private java.lang.String sfnm;
/**星级*/
@Excel(name = "星级", width = 15)
@ApiModelProperty(value = "星级")
private java.lang.Integer stars;
}

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.qa.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
/**
* @Description: kc_evaluationstudent
* @Author: jeecg-boot
* @Date: 2023-04-19
* @Version: V1.0
*/
public interface KcEvaluationstudentMapper extends BaseMapper<KcEvaluationstudent> {
}

View File

@ -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.qa.mapper.KcEvaluationstudentMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.qa.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
/**
* @Description: kc_evaluationstudent
* @Author: jeecg-boot
* @Date: 2023-04-19
* @Version: V1.0
*/
public interface IKcEvaluationstudentService extends IService<KcEvaluationstudent> {
}

View File

@ -0,0 +1,18 @@
package org.jeecg.modules.kc.qa.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.kc.qa.entity.KcEvaluationstudent;
import org.jeecg.modules.kc.qa.mapper.KcEvaluationstudentMapper;
import org.jeecg.modules.kc.qa.service.IKcEvaluationstudentService;
import org.springframework.stereotype.Service;
/**
* @Description: kc_evaluationstudent
* @Author: jeecg-boot
* @Date: 2023-04-19
* @Version: V1.0
*/
@Service
public class KcEvaluationstudentServiceImpl extends ServiceImpl<KcEvaluationstudentMapper, KcEvaluationstudent> implements IKcEvaluationstudentService {
}