添加常见问题等功能

This commit is contained in:
yangjun 2024-05-13 09:03:52 +08:00
parent 96953edb99
commit 327f102b65
14 changed files with 619 additions and 7 deletions

View File

@ -273,13 +273,16 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
public WjxDjxx queryByMainId(String id) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
WjxDjxx djxx = baseMapper.findDjxx(id,user.getUsername());
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx(djxx.getVid(),djxx.getJid());
for(WjxDjxxTmxx wjxDjxxTmxx:list){
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
wjxDjxxTmxx.setWjxWjxxTmxxList(list2);
if(djxx != null){
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
List<WjxDjxxTmxx> list = baseMapper.findDjtmxx(djxx.getVid(),djxx.getJid());
for(WjxDjxxTmxx wjxDjxxTmxx:list){
List<WjxWjxxTmxx> list2= wjxWjxxTmxxMapper.selectByMainId(wjxDjxxTmxx.getId());
wjxDjxxTmxx.setWjxWjxxTmxxList(list2);
}
djxx.setWjxDjxxTmxxList(list);
}
djxx.setWjxDjxxTmxxList(list);
return djxx;
}

View File

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

View File

@ -0,0 +1,71 @@
package org.jeecg.modules.kc.zyCjwt.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: 2024-05-11
* @Version: V1.0
*/
@Data
@TableName("zy_cjwt")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_cjwt对象", description="常见问题")
public class ZyCjwt implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**createBy*/
@ApiModelProperty(value = "createBy")
private java.lang.String createBy;
/**createTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "createTime")
private java.util.Date createTime;
/**updateBy*/
@ApiModelProperty(value = "updateBy")
private java.lang.String updateBy;
/**updateTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "updateTime")
private java.util.Date updateTime;
/**任务编号*/
@Excel(name = "任务编号", width = 15)
@ApiModelProperty(value = "任务编号")
private java.lang.String rwbh;
/**学期学年*/
@Excel(name = "学期学年", width = 15)
@ApiModelProperty(value = "学期学年")
private java.lang.String xqxn;
/**问题*/
@Excel(name = "问题", width = 15)
@ApiModelProperty(value = "问题")
private java.lang.String question;
/**答案*/
@Excel(name = "答案", width = 15)
@ApiModelProperty(value = "答案")
private java.lang.String answer;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.zyCjwt.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyCjwt.entity.ZyCjwt;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 常见问题
* @Author: jeecg-boot
* @Date: 2024-05-11
* @Version: V1.0
*/
public interface ZyCjwtMapper extends BaseMapper<ZyCjwt> {
}

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.zyCjwt.mapper.ZyCjwtMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.zyCjwt.service;
import org.jeecg.modules.kc.zyCjwt.entity.ZyCjwt;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 常见问题
* @Author: jeecg-boot
* @Date: 2024-05-11
* @Version: V1.0
*/
public interface IZyCjwtService extends IService<ZyCjwt> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.zyCjwt.service.impl;
import org.jeecg.modules.kc.zyCjwt.entity.ZyCjwt;
import org.jeecg.modules.kc.zyCjwt.mapper.ZyCjwtMapper;
import org.jeecg.modules.kc.zyCjwt.service.IZyCjwtService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 常见问题
* @Author: jeecg-boot
* @Date: 2024-05-11
* @Version: V1.0
*/
@Service
public class ZyCjwtServiceImpl extends ServiceImpl<ZyCjwtMapper, ZyCjwt> implements IZyCjwtService {
}

View File

@ -0,0 +1,174 @@
package org.jeecg.modules.kc.zyJxdg.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.zyJxdg.entity.ZyJxdg;
import org.jeecg.modules.kc.zyJxdg.service.IZyJxdgService;
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: 2024-05-11
* @Version: V1.0
*/
@Api(tags="教学大纲")
@RestController
@RequestMapping("/zyJxdg/zyJxdg")
@Slf4j
public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
@Autowired
private IZyJxdgService zyJxdgService;
/**
* 分页列表查询
*
* @param zyJxdg
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "教学大纲-分页列表查询")
@ApiOperation(value="教学大纲-分页列表查询", notes="教学大纲-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<ZyJxdg>> queryPageList(ZyJxdg zyJxdg,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyJxdg> queryWrapper = QueryGenerator.initQueryWrapper(zyJxdg, req.getParameterMap());
Page<ZyJxdg> page = new Page<ZyJxdg>(pageNo, pageSize);
IPage<ZyJxdg> pageList = zyJxdgService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param zyJxdg
* @return
*/
@AutoLog(value = "教学大纲-添加")
@ApiOperation(value="教学大纲-添加", notes="教学大纲-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ZyJxdg zyJxdg) {
zyJxdgService.save(zyJxdg);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param zyJxdg
* @return
*/
@AutoLog(value = "教学大纲-编辑")
@ApiOperation(value="教学大纲-编辑", notes="教学大纲-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ZyJxdg zyJxdg) {
zyJxdgService.updateById(zyJxdg);
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) {
zyJxdgService.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.zyJxdgService.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<ZyJxdg> queryById(@RequestParam(name="id",required=true) String id) {
ZyJxdg zyJxdg = zyJxdgService.getById(id);
if(zyJxdg==null) {
return Result.error("未找到对应数据");
}
return Result.OK(zyJxdg);
}
/**
* 导出excel
*
* @param request
* @param zyJxdg
*/
@RequiresPermissions("zyJxdg:zy_jxdg:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ZyJxdg zyJxdg) {
return super.exportXls(request, zyJxdg, ZyJxdg.class, "教学大纲");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("zyJxdg:zy_jxdg:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ZyJxdg.class);
}
}

View File

@ -0,0 +1,75 @@
package org.jeecg.modules.kc.zyJxdg.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: 2024-05-11
* @Version: V1.0
*/
@Data
@TableName("zy_jxdg")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="zy_jxdg对象", description="教学大纲")
public class ZyJxdg implements Serializable {
private static final long serialVersionUID = 1L;
/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.String id;
/**createBy*/
@ApiModelProperty(value = "createBy")
private java.lang.String createBy;
/**createTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "createTime")
private java.util.Date createTime;
/**updateBy*/
@ApiModelProperty(value = "updateBy")
private java.lang.String updateBy;
/**updateTime*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "updateTime")
private java.util.Date updateTime;
/**任务编号*/
@Excel(name = "任务编号", width = 15)
@ApiModelProperty(value = "任务编号")
private java.lang.String rwbh;
/**学习学年*/
@Excel(name = "学习学年", width = 15)
@ApiModelProperty(value = "学习学年")
private java.lang.String xqxn;
/**授课教师*/
@Excel(name = "授课教师", width = 15)
@ApiModelProperty(value = "授课教师")
private java.lang.String skjs;
/**附件*/
@Excel(name = "附件", width = 15)
@ApiModelProperty(value = "附件")
private java.lang.String filePath;
/**pdf附件*/
@Excel(name = "pdf附件", width = 15)
@ApiModelProperty(value = "pdf附件")
private java.lang.String pdfPath;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.kc.zyJxdg.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyJxdg.entity.ZyJxdg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 教学大纲
* @Author: jeecg-boot
* @Date: 2024-05-11
* @Version: V1.0
*/
public interface ZyJxdgMapper extends BaseMapper<ZyJxdg> {
}

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.zyJxdg.mapper.ZyJxdgMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.kc.zyJxdg.service;
import org.jeecg.modules.kc.zyJxdg.entity.ZyJxdg;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 教学大纲
* @Author: jeecg-boot
* @Date: 2024-05-11
* @Version: V1.0
*/
public interface IZyJxdgService extends IService<ZyJxdg> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.kc.zyJxdg.service.impl;
import org.jeecg.modules.kc.zyJxdg.entity.ZyJxdg;
import org.jeecg.modules.kc.zyJxdg.mapper.ZyJxdgMapper;
import org.jeecg.modules.kc.zyJxdg.service.IZyJxdgService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 教学大纲
* @Author: jeecg-boot
* @Date: 2024-05-11
* @Version: V1.0
*/
@Service
public class ZyJxdgServiceImpl extends ServiceImpl<ZyJxdgMapper, ZyJxdg> implements IZyJxdgService {
}

View File

@ -339,4 +339,8 @@ ffmpeg:
# 维普检测接口
weipu:
userId: 765996
userKey: 330ed91f6c7e4600a454a6a5216723bf
userKey: 330ed91f6c7e4600a454a6a5216723bf
wjx:
appid: 1321039
appkey: 55328ebd11964fc8b40c10011bcb425d
url: https://www.wjx.cn/openapi/default.aspx