添加基础功能

This commit is contained in:
yangjun 2023-04-02 14:40:41 +08:00
parent 19cbaae9f9
commit efdd4af4c7
18 changed files with 1349 additions and 0 deletions

View File

@ -0,0 +1,178 @@
package org.jeecg.modules.kc.kcNotice.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.kcNotice.entity.KcNotice;
import org.jeecg.modules.kc.kcNotice.service.IKcNoticeService;
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_notice
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Api(tags="kc_notice")
@RestController
@RequestMapping("/kcNotice/kcNotice")
@Slf4j
public class KcNoticeController extends JeecgController<KcNotice, IKcNoticeService> {
@Autowired
private IKcNoticeService kcNoticeService;
/**
* 分页列表查询
*
* @param kcNotice
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "kc_notice-分页列表查询")
@ApiOperation(value="kc_notice-分页列表查询", notes="kc_notice-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<KcNotice>> queryPageList(KcNotice kcNotice,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcNotice> queryWrapper = QueryGenerator.initQueryWrapper(kcNotice, req.getParameterMap());
Page<KcNotice> page = new Page<KcNotice>(pageNo, pageSize);
IPage<KcNotice> pageList = kcNoticeService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param kcNotice
* @return
*/
@AutoLog(value = "kc_notice-添加")
@ApiOperation(value="kc_notice-添加", notes="kc_notice-添加")
@RequiresPermissions("kcNotice:kc_notice:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody KcNotice kcNotice) {
kcNoticeService.save(kcNotice);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param kcNotice
* @return
*/
@AutoLog(value = "kc_notice-编辑")
@ApiOperation(value="kc_notice-编辑", notes="kc_notice-编辑")
@RequiresPermissions("kcNotice:kc_notice:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody KcNotice kcNotice) {
kcNoticeService.updateById(kcNotice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "kc_notice-通过id删除")
@ApiOperation(value="kc_notice-通过id删除", notes="kc_notice-通过id删除")
@RequiresPermissions("kcNotice:kc_notice:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
kcNoticeService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "kc_notice-批量删除")
@ApiOperation(value="kc_notice-批量删除", notes="kc_notice-批量删除")
@RequiresPermissions("kcNotice:kc_notice:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.kcNoticeService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "kc_notice-通过id查询")
@ApiOperation(value="kc_notice-通过id查询", notes="kc_notice-通过id查询")
@GetMapping(value = "/queryById")
public Result<KcNotice> queryById(@RequestParam(name="id",required=true) String id) {
KcNotice kcNotice = kcNoticeService.getById(id);
if(kcNotice==null) {
return Result.error("未找到对应数据");
}
return Result.OK(kcNotice);
}
/**
* 导出excel
*
* @param request
* @param kcNotice
*/
@RequiresPermissions("kcNotice:kc_notice:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, KcNotice kcNotice) {
return super.exportXls(request, kcNotice, KcNotice.class, "kc_notice");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("kcNotice:kc_notice:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, KcNotice.class);
}
}

View File

@ -0,0 +1,97 @@
package org.jeecg.modules.kc.kcNotice.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_notice
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Data
@TableName("kc_notice")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="kc_notice对象", description="kc_notice")
public class KcNotice implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Integer id;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String ntitle;
/**类型 0外部链接 1富文本 */
@Excel(name = "类型 0外部链接 1富文本 ", width = 15, dicCode = "ntype")
@Dict(dicCode = "ntype")
@ApiModelProperty(value = "类型 0外部链接 1富文本 ")
private java.lang.Integer ntype;
/**状态 0不可用 1可用*/
@Excel(name = "状态 0不可用 1可用", width = 15, dicCode = "nstatus")
@Dict(dicCode = "nstatus")
@ApiModelProperty(value = "状态 0不可用 1可用")
private java.lang.Integer nstatus;
/**内容*/
@Excel(name = "内容", width = 15)
private transient java.lang.String ncontentString;
private byte[] ncontent;
public byte[] getNcontent(){
if(ncontentString==null){
return null;
}
try {
return ncontentString.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return null;
}
public String getNcontentString(){
if(ncontent==null || ncontent.length==0){
return "";
}
try {
return new String(ncontent,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return "";
}
/**链接*/
@Excel(name = "链接", width = 15)
@ApiModelProperty(value = "链接")
private java.lang.String nlink;
/**发布日期*/
@Excel(name = "发布日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "发布日期")
private java.util.Date ndate;
/**是否置顶0否 1置顶*/
@Excel(name = "是否置顶0否 1置顶", width = 15, dicCode = "ontop")
@Dict(dicCode = "ontop")
@ApiModelProperty(value = "是否置顶0否 1置顶")
private java.lang.Integer ontop;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.kcNotice.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.kcNotice.entity.KcNotice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: kc_notice
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
public interface KcNoticeMapper extends BaseMapper<KcNotice> {
}

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.kcNotice.mapper.KcNoticeMapper">
</mapper>

View File

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

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.kcNotice.service.impl;
import org.jeecg.modules.kc.kcNotice.entity.KcNotice;
import org.jeecg.modules.kc.kcNotice.mapper.KcNoticeMapper;
import org.jeecg.modules.kc.kcNotice.service.IKcNoticeService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: kc_notice
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Service
public class KcNoticeServiceImpl extends ServiceImpl<KcNoticeMapper, KcNotice> implements IKcNoticeService {
}

View File

@ -0,0 +1,174 @@
package org.jeecg.modules.kc.kcTplb.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.kcTplb.entity.KcTplb;
import org.jeecg.modules.kc.kcTplb.service.IKcTplbService;
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: 图片轮播
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Api(tags="图片轮播")
@RestController
@RequestMapping("/kcTplb/kcTplb")
@Slf4j
public class KcTplbController extends JeecgController<KcTplb, IKcTplbService> {
@Autowired
private IKcTplbService kcTplbService;
/**
* 分页列表查询
*
* @param kcTplb
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "图片轮播-分页列表查询")
@ApiOperation(value="图片轮播-分页列表查询", notes="图片轮播-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<KcTplb>> queryPageList(KcTplb kcTplb,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcTplb> queryWrapper = QueryGenerator.initQueryWrapper(kcTplb, req.getParameterMap());
Page<KcTplb> page = new Page<KcTplb>(pageNo, pageSize);
IPage<KcTplb> pageList = kcTplbService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param kcTplb
* @return
*/
@AutoLog(value = "图片轮播-添加")
@ApiOperation(value="图片轮播-添加", notes="图片轮播-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody KcTplb kcTplb) {
kcTplbService.save(kcTplb);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param kcTplb
* @return
*/
@AutoLog(value = "图片轮播-编辑")
@ApiOperation(value="图片轮播-编辑", notes="图片轮播-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody KcTplb kcTplb) {
kcTplbService.updateById(kcTplb);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "图片轮播-通过id删除")
@ApiOperation(value="图片轮播-通过id删除", notes="图片轮播-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
kcTplbService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "图片轮播-批量删除")
@ApiOperation(value="图片轮播-批量删除", notes="图片轮播-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.kcTplbService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "图片轮播-通过id查询")
@ApiOperation(value="图片轮播-通过id查询", notes="图片轮播-通过id查询")
@GetMapping(value = "/queryById")
public Result<KcTplb> queryById(@RequestParam(name="id",required=true) String id) {
KcTplb kcTplb = kcTplbService.getById(id);
if(kcTplb==null) {
return Result.error("未找到对应数据");
}
return Result.OK(kcTplb);
}
/**
* 导出excel
*
* @param request
* @param kcTplb
*/
@RequiresPermissions("kcTplb:kc_tplb:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, KcTplb kcTplb) {
return super.exportXls(request, kcTplb, KcTplb.class, "图片轮播");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("kcTplb:kc_tplb:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, KcTplb.class);
}
}

View File

@ -0,0 +1,70 @@
package org.jeecg.modules.kc.kcTplb.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: 图片轮播
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Data
@TableName("kc_tplb")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="kc_tplb对象", description="图片轮播")
public class KcTplb implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private java.lang.String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private java.lang.String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private java.lang.String sysOrgCode;
/**标题*/
@Excel(name = "标题", width = 15)
@ApiModelProperty(value = "标题")
private java.lang.String title;
/**图片地址*/
@Excel(name = "图片地址", width = 15)
@ApiModelProperty(value = "图片地址")
private java.lang.String picPath;
/**内容*/
@Excel(name = "内容", width = 15)
@ApiModelProperty(value = "内容")
private java.lang.String content;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.kcTplb.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.kcTplb.entity.KcTplb;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 图片轮播
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
public interface KcTplbMapper extends BaseMapper<KcTplb> {
}

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.kcTplb.mapper.KcTplbMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.kcTplb.service;
import org.jeecg.modules.kc.kcTplb.entity.KcTplb;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 图片轮播
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
public interface IKcTplbService extends IService<KcTplb> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.kcTplb.service.impl;
import org.jeecg.modules.kc.kcTplb.entity.KcTplb;
import org.jeecg.modules.kc.kcTplb.mapper.KcTplbMapper;
import org.jeecg.modules.kc.kcTplb.service.IKcTplbService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 图片轮播
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Service
public class KcTplbServiceImpl extends ServiceImpl<KcTplbMapper, KcTplb> implements IKcTplbService {
}

View File

@ -0,0 +1,196 @@
package org.jeecg.modules.kc.pktj.controller;
import java.util.Arrays;
import java.util.List;
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.modules.kc.pktj.entity.KcEvaluation;
import org.jeecg.modules.kc.pktj.service.IKcEvaluationService;
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.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
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_evaluation
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Api(tags="kc_evaluation")
@RestController
@RequestMapping("/kcEvaluation/kcEvaluation")
@Slf4j
public class KcEvaluationController extends JeecgController<KcEvaluation, IKcEvaluationService> {
@Autowired
private IKcEvaluationService kcEvaluationService;
/**
* 分页列表查询
*
* @param kcEvaluation
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "kc_evaluation-分页列表查询")
@ApiOperation(value="kc_evaluation-分页列表查询", notes="kc_evaluation-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<KcEvaluation>> queryPageList(KcEvaluation kcEvaluation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<KcEvaluation> queryWrapper = QueryGenerator.initQueryWrapper(kcEvaluation, req.getParameterMap());
Page<KcEvaluation> page = new Page<KcEvaluation>(pageNo, pageSize);
IPage<KcEvaluation> pageList = kcEvaluationService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param kcEvaluation
* @return
*/
@AutoLog(value = "kc_evaluation-添加")
@ApiOperation(value="kc_evaluation-添加", notes="kc_evaluation-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody KcEvaluation kcEvaluation) {
kcEvaluationService.save(kcEvaluation);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param kcEvaluation
* @return
*/
@AutoLog(value = "kc_evaluation-编辑")
@ApiOperation(value="kc_evaluation-编辑", notes="kc_evaluation-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody KcEvaluation kcEvaluation) {
kcEvaluationService.updateById(kcEvaluation);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "kc_evaluation-通过id删除")
@ApiOperation(value="kc_evaluation-通过id删除", notes="kc_evaluation-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
kcEvaluationService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "kc_evaluation-批量删除")
@ApiOperation(value="kc_evaluation-批量删除", notes="kc_evaluation-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.kcEvaluationService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "kc_evaluation-通过id查询")
@ApiOperation(value="kc_evaluation-通过id查询", notes="kc_evaluation-通过id查询")
@GetMapping(value = "/queryById")
public Result<KcEvaluation> queryById(@RequestParam(name="id",required=true) String id) {
KcEvaluation kcEvaluation = kcEvaluationService.getById(id);
if(kcEvaluation==null) {
return Result.error("未找到对应数据");
}
return Result.OK(kcEvaluation);
}
/**
* 导出excel
*
* @param request
* @param kcEvaluation
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, KcEvaluation kcEvaluation) {
return super.exportXls(request, kcEvaluation, KcEvaluation.class, "kc_evaluation");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("kcEvaluation:kc_evaluation:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, KcEvaluation.class);
}
@ApiOperation(value="kc_evaluation-评课统计表分页列表查询", notes="kc_evaluation-评课统计表分页列表查询")
@GetMapping(value = "/getPktjbList")
public Result<IPage<KcEvaluation>> getPktjbList(KcEvaluation kcEvaluation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<KcEvaluation> page = new Page<KcEvaluation>(pageNo, pageSize);
IPage<KcEvaluation> pageList = kcEvaluationService.getPktjbList(page, kcEvaluation);
return Result.OK(pageList);
}
@ApiOperation(value="kc_evaluation-评课明细表分页列表查询", notes="kc_evaluation-评课明细表分页列表查询")
@GetMapping(value = "/getPkmxbList")
public Result<IPage<KcEvaluation>> getPkmxbList(KcEvaluation kcEvaluation,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<KcEvaluation> page = new Page<KcEvaluation>(pageNo, pageSize);
IPage<KcEvaluation> pageList = kcEvaluationService.getPkmxbList(page, kcEvaluation);
return Result.OK(pageList);
}
@ApiOperation(value="kc_evaluation-评课周统计图查询", notes="kc_evaluation-评课周统计图查询")
@GetMapping(value = "/getPkztjTjt")
public Result<List<KcEvaluation>> getPkztjTjt(KcEvaluation kcEvaluation) {
List<KcEvaluation> list = kcEvaluationService.getPkztjTjt(kcEvaluation);
return Result.OK(list);
}
@ApiOperation(value="kc_evaluation-评课覆盖率统计图查询", notes="kc_evaluation-评课覆盖率统计图查询")
@GetMapping(value = "/getPkfglTjt")
public Result<List<KcEvaluation>> getPkfglTjt(KcEvaluation kcEvaluation) {
List<KcEvaluation> list = kcEvaluationService.getPkfglTjt(kcEvaluation);
return Result.OK(list);
}
}

View File

@ -0,0 +1,174 @@
package org.jeecg.modules.kc.pktj.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: kc_evaluation
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Data
@TableName("kc_evaluation")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="kc_evaluation对象", description="kc_evaluation")
public class KcEvaluation implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Integer id;
/**上传日期*/
@Excel(name = "上传日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "上传日期")
private java.util.Date upDate;
/**上传时间*/
@Excel(name = "上传时间", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "上传时间")
private java.util.Date upTime;
/**答案*/
@Excel(name = "答案", width = 15)
@ApiModelProperty(value = "答案")
private java.lang.String answer1;
/**上传人*/
@Excel(name = "上传人", width = 15)
@ApiModelProperty(value = "上传人")
private java.lang.String upuser;
/**上传人id*/
@Excel(name = "上传人id", width = 15)
@ApiModelProperty(value = "上传人id")
private java.lang.Integer upuserid;
/**上传时间戳*/
@Excel(name = "上传时间戳", width = 15)
@ApiModelProperty(value = "上传时间戳")
private java.lang.String upTimestamp;
/**课程最小id*/
@Excel(name = "课程最小id", width = 15)
@ApiModelProperty(value = "课程最小id")
private java.lang.Integer minkcid;
/**答案2*/
@Excel(name = "答案2", width = 15)
@ApiModelProperty(value = "答案2")
private java.lang.String answer2;
/**答案3*/
@Excel(name = "答案3", width = 15)
@ApiModelProperty(value = "答案3")
private java.lang.String answer3;
/**答案4*/
@Excel(name = "答案4", width = 15)
@ApiModelProperty(value = "答案4")
private java.lang.String answer4;
/**答案5*/
@Excel(name = "答案5", width = 15)
@ApiModelProperty(value = "答案5")
private java.lang.String answer5;
/**答案6*/
@Excel(name = "答案6", width = 15)
@ApiModelProperty(value = "答案6")
private java.lang.String answer6;
/**答案7*/
@Excel(name = "答案7", width = 15)
@ApiModelProperty(value = "答案7")
private java.lang.String answer7;
/**答案8*/
@Excel(name = "答案8", width = 15)
@ApiModelProperty(value = "答案8")
private java.lang.String answer8;
/**答案9*/
@Excel(name = "答案9", width = 15)
@ApiModelProperty(value = "答案9")
private java.lang.String answer9;
/**答案10*/
@Excel(name = "答案10", width = 15)
@ApiModelProperty(value = "答案10")
private java.lang.String answer10;
/**答案11*/
@Excel(name = "答案11", width = 15)
@ApiModelProperty(value = "答案11")
private java.lang.String answer11;
/**问卷版本*/
@Excel(name = "问卷版本", width = 15)
@ApiModelProperty(value = "问卷版本")
private java.lang.Integer evaluationver;
@TableField(exist = false)
private String startTime;
@TableField(exist = false)
private String endTime;
@TableField(exist = false)
private java.lang.String userid;
@TableField(exist = false)
private java.lang.String username;
@TableField(exist = false)
private java.lang.String tksf1;
@TableField(exist = false)
private java.lang.String tkyq;
@TableField(exist = false)
private java.lang.String sjtksl;
@TableField(exist = false)
private java.lang.String mltksl;
@TableField(exist = false)
private java.lang.String tkdw;
@TableField(exist = false)
private java.lang.String kcxz;
@TableField(exist = false)
private java.lang.String kkdw;
@TableField(exist = false)
private java.lang.String szdw;
@TableField(exist = false)
private java.lang.String tksf;
@TableField(exist = false)
private java.lang.String college;
@TableField(exist = false)
private java.lang.String kcmc;
@TableField(exist = false)
private java.lang.String skjs;
@TableField(exist = false)
private java.lang.String zc;
@TableField(exist = false)
private java.lang.String jc;
@TableField(exist = false)
private java.lang.String evaId;
@TableField(exist = false)
private java.lang.String skrq;
@TableField(exist = false)
private java.lang.String kssl;
@TableField(exist = false)
private java.lang.String tkkts;
@TableField(exist = false)
private java.lang.String tkrcs;
@TableField(exist = false)
private java.lang.String dwjc;
@TableField(exist = false)
private java.lang.String ljtkv;
@TableField(exist = false)
private java.lang.String avgtkv;
@TableField(exist = false)
private java.lang.String jrtkv;
@TableField(exist = false)
private java.lang.String jravgtkv;
@TableField(exist = false)
private java.lang.String xsid;
}

View File

@ -0,0 +1,25 @@
package org.jeecg.modules.kc.pktj.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.pktj.entity.KcEvaluation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
* @Description: kc_evaluation
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
public interface KcEvaluationMapper extends BaseMapper<KcEvaluation> {
IPage<KcEvaluation> getPktjbList(Page<KcEvaluation> page, KcEvaluation kcEvaluation);
IPage<KcEvaluation> getPkmxbList(Page<KcEvaluation> page, KcEvaluation kcEvaluation);
List<KcEvaluation> getPkztjTjt(KcEvaluation kcEvaluation);
List<KcEvaluation> getPkfglTjt(KcEvaluation kcEvaluation);
}

View File

@ -0,0 +1,258 @@
<?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.pktj.mapper.KcEvaluationMapper">
<select id="getPktjbList" parameterType="org.jeecg.modules.kc.pktj.entity.KcEvaluation" resultType="org.jeecg.modules.kc.pktj.entity.KcEvaluation">
SELECT
tk.upuserid AS userid, tk.upuser AS username, tksf1, tkyq, sjtksl, mltksl, tkdw
FROM (
SELECT ev.upuserid, ev.upuser, count( ev.id ) sjtksl, count( CASE WHEN kt.kkdw = '马列教研室' THEN 1 END ) mltksl, college AS tkdw
FROM
kc_evaluation ev,
kc_ketangbiao kt,
kc_casusers cu
WHERE ev.minkcid = kt.id AND ev.upuserid = cu.`user`
<if test="kcEvaluation.startTime != null and kcEvaluation.startTime != ''">
and kt.skrq &gt;= #{kcEvaluation.startTime}
</if>
<if test="kcEvaluation.endTime != null and kcEvaluation.endTime != ''">
and kt.skrq &lt;= #{kcEvaluation.endTime}
</if>
<if test="kcEvaluation.kcxz != null and kcEvaluation.kcxz != ''">
and kcxz = #{kcEvaluation.kcxz}
</if>
<if test="kcEvaluation.kkdw != null and kcEvaluation.kkdw != ''">
and kkdw = #{kcEvaluation.kkdw}
</if>
<if test="kcEvaluation.szdw != null and kcEvaluation.szdw != ''">
and college = #{kcEvaluation.szdw}
</if>
GROUP BY ev.upuserid, ev.upuser, cu.college
) tk,
( SELECT usercode, username, GROUP_CONCAT( assess1 SEPARATOR ',' ) tksf1, GROUP_CONCAT( assess2 SEPARATOR ',' ) tksf2, max( tkyq ) tkyq
FROM kc_assessuser WHERE 1 = 1
<if test="kcEvaluation.tksf != null and kcEvaluation.tksf != ''">
AND assesscode = #{kcEvaluation.tksf}
</if>
GROUP BY usercode, username ) au
WHERE tk.upuserid = au.usercode
ORDER BY sjtksl DESC
</select>
<select id="getPkmxbList" parameterType="org.jeecg.modules.kc.pktj.entity.KcEvaluation" resultType="org.jeecg.modules.kc.pktj.entity.KcEvaluation">
SELECT
k.id, c.user as userid, c.cn as username, c.college, a.assess1 as tksf , k.kkdw, k.kcmc, k.kcxz, k.skjs, k.week as zc, k.hh as jc,p.evaluationver ,
p.up_date, p.up_time, p.id AS evaId
FROM
kc_ketangbiao k, kc_evaluation p, kc_casusers c, kc_assessuser a
WHERE
k.id = p.minkcid
AND p.upuserid = c.USER
AND p.upuserid = a.usercode
<if test="kcEvaluation.startTime != null and kcEvaluation.startTime != ''">
and p.up_date &gt;= #{kcEvaluation.startTime}
</if>
<if test="kcEvaluation.endTime != null and kcEvaluation.endTime != ''">
and p.up_date &lt;= #{kcEvaluation.endTime}
</if>
<if test="kcEvaluation.kcxz != null and kcEvaluation.kcxz != ''">
and k.kcxz = #{kcEvaluation.kcxz}
</if>
<if test="kcEvaluation.kkdw != null and kcEvaluation.kkdw != ''">
and k.kkdw = #{kcEvaluation.kkdw}
</if>
<if test="kcEvaluation.szdw != null and kcEvaluation.szdw != ''">
and c.college = #{kcEvaluation.szdw}
</if>
<if test="kcEvaluation.tksf != null and kcEvaluation.tksf != ''">
AND assesscode = #{kcEvaluation.tksf}
</if>
ORDER BY
up_date DESC,
up_time DESC
</select>
<select id="getPkztjTjt" parameterType="org.jeecg.modules.kc.pktj.entity.KcEvaluation" resultType="org.jeecg.modules.kc.pktj.entity.KcEvaluation">
SELECT
t2.skrq,
t2.kssl,
ifnull( t1.tkkts, 0 ) tkkts,
ifnull( t1.tkrcs, 0 ) tkrcs
FROM
(
SELECT
count( id ) kssl,
skrq
FROM
kc_ketangbiao kt
WHERE 1=1
<if test="startTime != null and startTime != ''">
and skrq &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and skrq &lt;= #{endTime}
</if>
<if test="kcxz != null and kcxz != ''">
and kcxz = #{kcxz}
</if>
<if test="kkdw != null and kkdw != ''">
and kt.kkdw = #{kkdw}
</if>
GROUP BY
skrq
) t2
LEFT JOIN (
SELECT
skrq,
count( DISTINCT kt.id ) tkkts,
count( ev.id ) tkrcs
FROM
kc_ketangbiao kt,
kc_kkdw dw,
kc_evaluation ev,
kc_assessuser au,
kc_casusers cu
WHERE
kt.kkdw = dw.kkdw
<if test="startTime != null and startTime != ''">
and skrq &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and skrq &lt;= #{endTime}
</if>
<if test="kcxz != null and kcxz != ''">
and kcxz = #{kcxz}
</if>
<if test="kkdw != null and kkdw != ''">
and kt.kkdw = #{kkdw}
</if>
<if test="szdw != null and szdw != ''">
and cu.college = #{szdw}
</if>
<if test="tksf != null and tksf != ''">
AND assesscode = #{tksf}
</if>
AND au.usercode = ev.upuserid
AND kt.id = ev.minkcid
AND ev.upuserid = cu.USER
GROUP BY
skrq
) t1 ON t2.skrq = t1.skrq
ORDER BY
t2.skrq
</select>
<select id="getPkfglTjt" parameterType="org.jeecg.modules.kc.pktj.entity.KcEvaluation" resultType="org.jeecg.modules.kc.pktj.entity.KcEvaluation">
SELECT
xsmc AS dwjc,ljtkv, avgtkv, jrtkv, jravgtkv, xsid FROM
(
SELECT
xsid, xsmc, format( tkzs / kcsl * 100, 2 ) AS ljtkv, format( jrtks / jrkcsl * 100, 2 ) AS jrtkv FROM
(
SELECT
dw.id, dw.xsid, dw.xsmc, count( DISTINCT kt.id ) tkzs,
count( DISTINCT CASE WHEN up_date = #{endTime} THEN kt.id END ) jrtks
FROM
kc_evaluation ev,kc_assessuser au, kc_casusers cu, kc_ketangbiao kt,kc_kkdw dw
WHERE
ev.minkcid = kt.id
AND ev.upuserid = au.usercode
AND ev.upuserid = cu.USER
AND kt.kkdw = dw.kkdw
<if test="kcxz != null and kcxz != ''">
and kcxz = #{kcxz}
</if>
<if test="szdw != null and szdw != ''">
and cu.college = #{szdw}
</if>
<if test="tksf != null and tksf != ''">
AND assesscode = #{tksf}
</if>
GROUP BY
dw.id,
dw.xsid,
dw.xsmc
) tk,
(
SELECT
kkdwid,
count( kt.id ) AS kcsl,
count( CASE WHEN skrq = #{endTime} THEN 1 END ) AS jrkcsl
FROM
kc_ketangbiao kt
WHERE 1=1
<if test="startTime != null and startTime != ''">
and skrq &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and skrq &lt;= #{endTime}
</if>
<if test="kcxz != null and kcxz != ''">
and kcxz = #{kcxz}
</if>
GROUP BY
kkdwid
) kt
WHERE
tk.id = kt.kkdwid
GROUP BY
xsid,
xsmc,
ljtkv,
jrtkv
ORDER BY
xsid
) t1,
(
SELECT
format( tkzs / kcsl * 100, 2 ) AS avgtkv,
format( jrtks / jrkcsl * 100, 2 ) AS jravgtkv
FROM
(
SELECT
count( DISTINCT kt.id ) tkzs,
count( DISTINCT CASE WHEN up_date = #{endTime} THEN kt.id END ) jrtks
FROM
kc_evaluation ev,
kc_assessuser au,
kc_casusers cu,
kc_ketangbiao kt
WHERE
ev.minkcid = kt.id
AND ev.upuserid = au.usercode
AND ev.upuserid = cu.USER
<if test="kcxz != null and kcxz != ''">
and kcxz = #{kcxz}
</if>
<if test="szdw != null and szdw != ''">
and cu.college = #{szdw}
</if>
<if test="tksf != null and tksf != ''">
AND assesscode = #{tksf}
</if>
) tk,
(
SELECT
count( kt.id ) AS kcsl,
count( CASE WHEN skrq = #{endTime} THEN 1 END ) AS jrkcsl
FROM
kc_ketangbiao kt
WHERE 1=1
<if test="startTime != null and startTime != ''">
and skrq &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and skrq &lt;= #{endTime}
</if>
<if test="kcxz != null and kcxz != ''">
and kcxz = #{kcxz}
</if>
) kt
) t2
</select>
</mapper>

View File

@ -0,0 +1,25 @@
package org.jeecg.modules.kc.pktj.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.pktj.entity.KcEvaluation;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: kc_evaluation
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
public interface IKcEvaluationService extends IService<KcEvaluation> {
IPage<KcEvaluation> getPktjbList(Page<KcEvaluation> page, KcEvaluation kcEvaluation);
IPage<KcEvaluation> getPkmxbList(Page<KcEvaluation> page, KcEvaluation kcEvaluation);
List<KcEvaluation> getPkztjTjt(KcEvaluation kcEvaluation);
List<KcEvaluation> getPkfglTjt(KcEvaluation kcEvaluation);
}

View File

@ -0,0 +1,42 @@
package org.jeecg.modules.kc.pktj.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.pktj.entity.KcEvaluation;
import org.jeecg.modules.kc.pktj.mapper.KcEvaluationMapper;
import org.jeecg.modules.kc.pktj.service.IKcEvaluationService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/**
* @Description: kc_evaluation
* @Author: jeecg-boot
* @Date: 2023-04-02
* @Version: V1.0
*/
@Service
public class KcEvaluationServiceImpl extends ServiceImpl<KcEvaluationMapper, KcEvaluation> implements IKcEvaluationService {
@Override
public IPage<KcEvaluation> getPktjbList(Page<KcEvaluation> page, KcEvaluation kcEvaluation) {
return baseMapper.getPktjbList(page,kcEvaluation);
}
@Override
public IPage<KcEvaluation> getPkmxbList(Page<KcEvaluation> page, KcEvaluation kcEvaluation) {
return baseMapper.getPkmxbList(page,kcEvaluation);
}
@Override
public List<KcEvaluation> getPkztjTjt(KcEvaluation kcEvaluation) {
return baseMapper.getPkztjTjt(kcEvaluation);
}
@Override
public List<KcEvaluation> getPkfglTjt(KcEvaluation kcEvaluation) {
return baseMapper.getPkfglTjt(kcEvaluation);
}
}