问卷星:试卷页面调整、学生答卷结果查询

This commit is contained in:
曹磊 2024-05-10 21:16:00 +08:00
parent 6925f971ba
commit 5c72fc090a
12 changed files with 107 additions and 9 deletions

View File

@ -1,19 +1,25 @@
package org.jeecg.modules.kc.wjxDjxx.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.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmlbPage;
import org.jeecg.modules.kc.wjxDjxx.service.IWjxDjxxService;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
@ -48,4 +54,14 @@ public class WjxDjxxController extends JeecgController<WjxDjxx, IWjxDjxxService>
return Result.OK(wjxDjxx);
}
@ApiOperation(value="选项信息主表ID查询", notes="选项信息-通主表ID查询")
@GetMapping(value = "/djjglist")
public Result<IPage<WjxDjxx>> djjglist(WjxDjxx wjxDjxx,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<WjxDjxx> pageList = wjxDjxxService.findDjjgsPage(wjxDjxx,new Page<>(pageNo, pageSize));
return Result.OK(pageList);
}
}

View File

@ -75,10 +75,31 @@ public class WjxDjxx {
@ApiModelProperty(value = "问卷名称")
@TableField(exist = false)
private String title;
@Excel(name = "问卷描述", width = 15)
@ApiModelProperty(value = "问卷描述")
@TableField(exist = false)
private java.lang.String content;
@ApiModelProperty(value = "问卷作答用时时分秒")
private String answerSfm;
@TableField(exist = false)
private List<WjxDjxxTmxx> wjxDjxxTmxxList;
@ApiModelProperty(value = "学期学年")
@TableField(exist = false)
private String xqxn;
@ApiModelProperty(value = "课程名称")
@TableField(exist = false)
private String kcmc;
@ApiModelProperty(value = "开始时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date startTime;
@ApiModelProperty(value = "结束时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@TableField(exist = false)
private Date endTime;
}

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.kc.wjxDjxx.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
@ -25,5 +26,5 @@ public interface WjxDjxxMapper extends BaseMapper<WjxDjxx> {
void addDjTmxx(WjxDjxxTmxx wjxDjxxTmxx);
WjxDjxx findDjxx(@Param("id")String id,@Param("userId")String userId);
List<WjxDjxxTmxx> findDjtmxx(@Param("vid")String vid,@Param("jid")String jid);
List<WjxDjxx> findDjjgsPage(Page<WjxDjxx> page, WjxDjxx params);
}

View File

@ -86,7 +86,7 @@
</insert>
<select id="findDjxx" parameterType="String" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx">
select b.atype,b.title,a.vid,a.user_id,a.open_time,a.commit_time,a.jid,a.score,a.total_score,a.answer_seconds
select b.atype,b.title,a.vid,a.user_id,a.open_time,a.commit_time,a.jid,a.score,a.total_score,a.answer_seconds,a.user_id,a.user_name
from wjx_djxx a
inner join wjx_wjxx b on a.vid = b.vid and b.id = #{id}
where a.flag = '1'
@ -114,4 +114,12 @@
order by x.wj_index
</select>
<select id="findDjjgsPage" parameterType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx">
select a.id,a.xqxn,a.kcmc,a.start_time,a.end_time,a.title,a.content,b.vid,b.jid,b.user_id,b.user_name,b.open_time,b.commit_time,b.score,b.total_score,b.answer_seconds
from wjx_wjxx a
inner join wjx_djxx b on a.vid = b.vid
where a.id = #{params.id}
order by b.open_time
</select>
</mapper>

View File

@ -3,8 +3,7 @@ package org.jeecg.modules.kc.wjxDjxx.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmlbPage;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
@ -18,4 +17,6 @@ public interface IWjxDjxxService extends IService<WjxDjxx> {
String djtj(List<WjxDjxxTmlbPage> list);
void doDjSelect();
WjxDjxx queryByMainId(String id);
Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page);
}

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.kc.wjxDjxx.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
@ -12,9 +13,7 @@ import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
import org.jeecg.modules.kc.wjxDjxx.mapper.WjxDjxxMapper;
import org.jeecg.modules.kc.wjxDjxx.service.IWjxDjxxService;
import org.jeecg.modules.kc.wjxWjxx.utils.WjxUtil;
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb;
import org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmxx;
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper;
import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -36,8 +35,6 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
@Autowired
private WjxUtil wjxUtil;
@Autowired
private WjxWjxxTmlbMapper wjxWjxxTmlbMapper;
@Autowired
private WjxWjxxTmxxMapper wjxWjxxTmxxMapper;
/**
@ -299,4 +296,14 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
return String.format("%02d:%02d:%02d", hours, minutes, remainingSeconds);
}
@Override
public Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page){
List<WjxDjxx> list = baseMapper.findDjjgsPage(page,wjxDjxx);
for(WjxDjxx djxx:list){
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
}
page.setRecords(list);
return page;
}
}

View File

@ -57,6 +57,8 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<WjxWjxx> queryWrapper = QueryGenerator.initQueryWrapper(wjxWjxx, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
queryWrapper.orderByAsc("start_time");
Page<WjxWjxx> page = new Page<WjxWjxx>(pageNo, pageSize);
IPage<WjxWjxx> pageList = wjxWjxxService.page(page, queryWrapper);
return Result.OK(pageList);
@ -174,10 +176,18 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
return Result.OK(null);
}
@ApiOperation(value="获取课程信息", notes="获取课程信息")
@GetMapping(value = "/kcxx")
public Result<WjxWjxx> kcxx(@RequestParam(name="rwbh",required=true) String rwbh,@RequestParam(name="xqxn",required=true) String xqxn) {
WjxWjxx wjxWjxx = wjxWjxxService.kcxx(rwbh,xqxn);
return Result.OK(wjxWjxx);
}
@ApiOperation(value="发布问卷", notes="发布问卷")
@GetMapping(value = "/fbwj")
public Result<String> fbwj(@RequestParam(name="id",required=true) String id) {
String res = wjxWjxxService.fbwj(id);
return Result.OK(res);
}
}
}

View File

@ -82,4 +82,23 @@ public class WjxWjxx implements Serializable {
@ApiModelProperty(value = "题目列表")
private java.lang.String questions;
@ApiModelProperty(value = "问卷编号")
private String vid;
@ApiModelProperty(value = "学期学年")
private String xqxn;
@ApiModelProperty(value = "任务编号")
private String rwbh;
@ApiModelProperty(value = "课程名称")
private String kcmc;
@ApiModelProperty(value = "选课人数")
private String xkrs;
@ApiModelProperty(value = "开始时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date startTime;
@ApiModelProperty(value = "结束时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date endTime;
}

View File

@ -13,5 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @Version: V1.0
*/
public interface WjxWjxxMapper extends BaseMapper<WjxWjxx> {
WjxWjxx kcxx(@Param("rwbh")String rwbh,@Param("xqxn")String xqxn);
void updateVid(@Param("id")String id,@Param("vid")String vid);
}

View File

@ -1,6 +1,14 @@
<?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.wjxWjxx.mapper.WjxWjxxMapper">
<select id="kcxx" parameterType="String" resultType="org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx">
select distinct kcmc,xkrs
from kc_kechengbiao
where rwbh = #{rwbh}
and xqxn = #{xqxn}
</select>
<update id="updateVid" parameterType="String">
update wjx_wjxx
set vid = #{vid},

View File

@ -11,5 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IWjxWjxxService extends IService<WjxWjxx> {
WjxWjxx kcxx(String rwbh,String xqxn);
String fbwj(String id);
}

View File

@ -205,6 +205,11 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
// }
// }
@Override
public WjxWjxx kcxx(String rwbh,String xqxn){
return baseMapper.kcxx(rwbh,xqxn);
}
@Override
public String fbwj(String id) {