修改bug

This commit is contained in:
yangjun 2024-08-05 10:03:09 +08:00
parent 42f4e12faa
commit 1305e9ba76
17 changed files with 267 additions and 104 deletions

View File

@ -96,6 +96,8 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/common/pdf/**", "anon");//pdf预览
filterChainDefinitionMap.put("/generic/**", "anon");//pdf预览需要文件
filterChainDefinitionMap.put("/wxpay/**", "anon");//微信接口
filterChainDefinitionMap.put("/temp/**", "anon");//微信接口
filterChainDefinitionMap.put("/kczx/**", "anon");//微信接口
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码

View File

@ -269,6 +269,7 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
if(pageList.getRecords().size()>0){
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(sysUser.getUsername());
zyDbtx.setFlag("0");
List<ZyDbtx> dbtxList = zyDbtxService.getDbtxList(zyDbtx);
for(KcKechengbiao par:pageList.getRecords()){
int i = 0;
@ -306,6 +307,7 @@ public class KcKechengbiaoController extends JeecgController<KcKechengbiao, IKcK
if(pageList.getRecords().size()>0){
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(sysUser.getUsername());
zyDbtx.setFlag("0");
List<ZyDbtx> dbtxList = zyDbtxService.getDbtxList(zyDbtx);
for(KcKechengbiao par:pageList.getRecords()){
for(ZyDbtx txPar : dbtxList){

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.kc.wjxDjxx.entity.*;
import org.jeecg.modules.kc.wjxDjxx.mapper.WjxDjxxMapper;
import org.jeecg.modules.kc.wjxDjxx.service.IWjxDjxxService;
@ -233,11 +234,11 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
String content = "";
if(StringUtils.equals("6",wjxWjxx.getAtype())){
type = "6";
content = "["+wjxWjxx.getTitle()+"]"+user.getRealname()+"提交了一篇测验待查阅";
content = user.getRealname()+"学生提交了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间为:"+ DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd HH:mm")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd HH:mm")+",请及时查看。学生提交时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss");
}else{
type = "7";
content = "["+wjxWjxx.getTitle()+"]"+user.getRealname()+"提交了一篇问卷待查阅";
content = user.getRealname()+"学生提交了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间为:"+ DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd HH:mm")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd HH:mm")+",请及时查看。学生提交时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss");
}
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.kc.wjxWjxx.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
@ -12,12 +13,15 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import org.jeecg.modules.kc.wjxWjxx.entity.KccyglSys;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.wjxWjxx.service.IWjxWjxxService;
@ -78,6 +82,8 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
@Value("${jeecg.path.upload}")
private String upLoadPath;
@Autowired
private IKcKechengbiaoService kcKechengbiaoService;
/**
* 分页列表查询
*
@ -270,10 +276,10 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if(StringUtils.equals(wjlx,"6")){
type = "2";
content = " ["+wjxWjxx.getKcmc()+"] "+sysUser.getRealname()+" 发布了一篇新的测验,请及时提交!";
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”测验,该测验完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
}else{
type = "3";
content = " ["+wjxWjxx.getKcmc()+"] "+sysUser.getRealname()+" 发布了一篇新的问卷,请及时提交!";
content = sysUser.getRealname()+"教师发起了["+wjxWjxx.getKcmc()+"]课程“"+wjxWjxx.getTitle()+"”问卷,该问卷完成时间: "+DateUtils.formatDate(wjxWjxx.getStartTime(),"yyyy-MM-dd")+" ~ "+DateUtils.formatDate(wjxWjxx.getEndTime(),"yyyy-MM-dd")+",请及时完成";
}
for(Xxhbbks xxhbbks:list){

View File

@ -211,4 +211,17 @@ public class ZyCcjgController extends JeecgController<ZyCcjg, IZyCcjgService> {
return Result.OK(pageList);
}
@ApiOperation(value="查重结果-分页列表查询", notes="查重结果-分页列表查询")
@GetMapping(value = "/getCcjg")
public Result<ZyCcjg> getCcjg(ZyCcjg zyCcjg, HttpServletRequest req) {
QueryWrapper<ZyCcjg> queryWrapper = QueryGenerator.initQueryWrapper(zyCcjg, req.getParameterMap());
// queryWrapper.eq("zy_stu_id",zyCcjg.getZyStuId());
// queryWrapper.eq("cc_type",zyCcjg.getCcType());
queryWrapper.orderByDesc("checkdate");
queryWrapper.last("limit 1");
ZyCcjg par = zyCcjgService.getOne(queryWrapper);
return Result.OK(par);
}
}

View File

@ -72,6 +72,7 @@ public class ZyDbtxController extends JeecgController<ZyDbtx, IZyDbtxService> {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyDbtx> queryWrapper = QueryGenerator.initQueryWrapper(zyDbtx, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<ZyDbtx> page = new Page<ZyDbtx>(pageNo, pageSize);
IPage<ZyDbtx> pageList = zyDbtxService.page(page, queryWrapper);
return Result.OK(pageList);
@ -176,25 +177,27 @@ public class ZyDbtxController extends JeecgController<ZyDbtx, IZyDbtxService> {
}
@AutoLog(value = "代办提醒-通过rwbh")
@ApiOperation(value="代办提醒-通过rwbh删除", notes="代办提醒-通过rwbh删除")
@AutoLog(value = "代办提醒-通过rwbh修改已阅")
@ApiOperation(value="代办提醒-通过rwbh修改已阅", notes="代办提醒-通过rwbh修改已阅")
@PostMapping(value = "/deleteByRwbhCreate")
public Result<ZyDbtx> deleteByRwbhCreate(@RequestBody ZyDbtx zyDbtx) {
String rwbh = zyDbtx.getRwbh();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
UpdateWrapper<ZyDbtx> zyDbtxDeleteMapping = new UpdateWrapper<>();
zyDbtxDeleteMapping.set("flag","1");
zyDbtxDeleteMapping.eq("rwbh", rwbh);
zyDbtxDeleteMapping.eq("create_by", sysUser.getUsername());
zyDbtxDeleteMapping.eq("fbr", zyDbtx.getFbr());
zyDbtxService.remove(zyDbtxDeleteMapping);
// zyDbtxDeleteMapping.eq("fbr", zyDbtx.getFbr());
zyDbtxService.update(zyDbtxDeleteMapping);
return Result.OK(null);
}
@AutoLog(value = "代办提醒-通过id删除")
@ApiOperation(value="代办提醒-通过id删除", notes="代办提醒-通过id删除")
@AutoLog(value = "代办提醒-阅读信息")
@ApiOperation(value="代办提醒-阅读信息", notes="代办提醒-阅读信息")
@PostMapping(value = "/deleteById")
public Result<ZyDbtx> deleteById(@RequestBody ZyDbtx zyDbtx) {
zyDbtxService.removeById(zyDbtx.getId());
zyDbtx.setFlag("1");
zyDbtxService.updateById(zyDbtx);
return Result.OK(null);
}
}

View File

@ -3,6 +3,10 @@
<mapper namespace="org.jeecg.modules.kc.zyDbtx.mapper.ZyDbtxMapper">
<select id="getDbtxList" resultType="org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx">
select rwbh,GROUP_CONCAT(type) as type,fbr from zy_dbtx where create_by = #{createBy} GROUP BY rwbh,fbr
select rwbh,GROUP_CONCAT(type) as type,fbr from zy_dbtx where create_by = #{createBy}
<if test="flag != null and flag != ''">
and flag = #{flag}
</if>
GROUP BY rwbh,fbr
</select>
</mapper>

View File

@ -11,6 +11,7 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
import org.jeecg.modules.kc.grab.imports.service.IXxhbbksService;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
@ -111,6 +112,9 @@ public class ZyGonggaoController extends JeecgController<ZyGonggao, IZyGonggaoSe
queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",par.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
for(Xxhbbks xxhbbks:list){
//作业代办提醒
@ -119,9 +123,8 @@ public class ZyGonggaoController extends JeecgController<ZyGonggao, IZyGonggaoSe
zyDbtx.setType("9");//0发布作业 1评分 2测验 3问卷 4讨论 9通知通告
zyDbtx.setMainId(par.getId());
zyDbtx.setRwbh(par.getRwbh());
zyDbtx.setContent(" ["+par.getKcmc()+"] "+par.getSkjs()+" 发布了一篇新的通告,请及时查阅!");
zyDbtx.setContent(user.getRealname()+"教师发布了["+par.getKcmc()+"]课程“"+par.getTitle()+"”的通知公告,发布时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
zyDbtx.setFlag("0");
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
zyDbtx.setFbr(user.getUsername());
zyDbtxService.save(zyDbtx);

View File

@ -14,6 +14,7 @@ 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.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
import org.jeecg.modules.kc.grab.imports.entity.Xxhbbks;
@ -104,6 +105,15 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
queryWrapper2.eq("zy_status","0");
queryWrapper2.le("start_time",new Date());
List<ZyInfo> list2 = zyInfoService.list(queryWrapper2);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
kcKechengbiaoQueryWrapper.eq("jgh",user.getUsername());
kcKechengbiaoQueryWrapper.eq("xqxn",zyInfo.getXnxq());
kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
for(ZyInfo par:list2){
par.setZyStatus("1");
zyInfoService.updateById(par);
@ -128,9 +138,13 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
zyDbtx.setType("0");//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(zyInfo2.getId());
zyDbtx.setRwbh(zyInfo2.getRwbh());
zyDbtx.setContent(" ["+zyInfo2.getKcmc()+"] "+zyInfo2.getSkjs()+" 发布了一篇作业,请及时完成!");
String hpts = "";
if(StringUtils.equals(zyInfo2.getXshpkg(),"1")){
hpts = "此作业需要进行互评,互评时间:"+DateUtils.formatDate(zyInfo2.getXshpkssj(),"yyyy-MM-dd HH:mm")+" ~ "+ DateUtils.formatDate(zyInfo2.getXshpjssj(),"yyyy-MM-dd HH:mm");
}
zyDbtx.setContent(user.getRealname()+"老师["+kcKechengbiao.getKcmc()+"]课程于"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss")+"发布了一篇题目为“"+zyInfo2.getTitle()+"”的作业,该作业完成时间为:"+ DateUtils.formatDate(zyInfo2.getStartTime(),"yyyy-MM-dd HH:mm")+" ~ "+ DateUtils.formatDate(zyInfo2.getEndTime(),"yyyy-MM-dd HH:mm")+",请按时完成! "+hpts);
zyDbtx.setFlag("0");
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
zyDbtx.setFbr(user.getUsername());
zyDbtxService.save(zyDbtx);
@ -242,6 +256,16 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
queryWrapper.eq("b.KCAPZBBH",zyInfo.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
zyInfoStudentService.deleteMainId(zyInfo.getId());
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
kcKechengbiaoQueryWrapper.eq("jgh",zyInfo.getCreateBy());
kcKechengbiaoQueryWrapper.eq("xqxn",zyInfo.getXnxq());
kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
for(Xxhbbks xxhbbks:list){
ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
zyInfoStudent.setMainId(zyInfo.getId());
@ -255,9 +279,14 @@ public class ZyInfoController extends JeecgController<ZyInfo, IZyInfoService> {
zyDbtx.setType("0");//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(zyInfo.getId());
zyDbtx.setRwbh(zyInfo.getRwbh());
zyDbtx.setContent(" ["+zyInfo.getKcmc()+"] "+zyInfo.getSkjs()+" 发布了一篇作业,请及时完成!");
// 郭坤老师战略管理课程发布了一篇题目为xxxx的作业作业完成时间为2024-07-18 20:00 ~ 2024-07-20 23:59请按时完成 作业发布时间
String hpts = "";
if(StringUtils.equals(zyInfo.getXshpkg(),"1")){
hpts = "此作业需要进行互评,互评时间:"+DateUtils.formatDate(zyInfo.getXshpkssj(),"yyyy-MM-dd HH:mm")+" ~ "+ DateUtils.formatDate(zyInfo.getXshpjssj(),"yyyy-MM-dd HH:mm");
}
zyDbtx.setContent(user.getRealname()+"老师["+kcKechengbiao.getKcmc()+"]课程于"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss")+"发布了一篇题目为“"+zyInfo.getTitle()+"”的作业,该作业完成时间为:"+ DateUtils.formatDate(zyInfo.getStartTime(),"yyyy-MM-dd HH:mm")+" ~ "+ DateUtils.formatDate(zyInfo.getEndTime(),"yyyy-MM-dd HH:mm")+",请按时完成! "+hpts);
// zyDbtx.setContent(" ["+zyInfo.getKcmc()+"] "+zyInfo.getSkjs()+" 发布了一篇作业,请及时完成!");
zyDbtx.setFlag("0");
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
zyDbtx.setFbr(user.getUsername());
zyDbtxService.save(zyDbtx);

View File

@ -133,8 +133,12 @@ public class ZyInfo implements Serializable {
private Integer sort;//序号
private java.lang.String xshpkg;//学生互评开关
private java.lang.String xshprsq;//学生互评人数
private java.lang.String xshpkssj;//学生互评开始时间
private java.lang.String xshpjssj;//学生互评结束时间
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
private java.util.Date xshpkssj;//学生互评开始时间
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
private java.util.Date xshpjssj;//学生互评结束时间
private java.lang.String sfzzcj;//是否最终成绩1是 0否
private java.lang.String xssfck;//学生是否查看1是 0否
private java.lang.String hpsfwcone;//第1次互评是否完成1是 0否
@ -185,5 +189,11 @@ public class ZyInfo implements Serializable {
private String aigcsftg;
@TableField(exist = false)
private String xnsftg;
@TableField(exist = false)
private String zzdf;
@TableField(exist = false)
private String xshpfs;
@TableField(exist = false)
private String jxfs;
}

View File

@ -3,8 +3,8 @@
<mapper namespace="org.jeecg.modules.kc.zyInfo.mapper.ZyInfoMapper">
<select id="stuList" resultType="org.jeecg.modules.kc.zyInfo.entity.ZyInfo">
select a.*,b.id as stuId ,b.file_path as stuFilePath,b.score as stuscore,b.wwxsl,b.nwxsl,b.aigcxsl,b.xnxsl,b.pdf_path as stuPdfPath,
b.wwsftg,b.nwsftg,b.aigcsftg,b.xnsftg
select a.*,b.id as stuId ,b.file_path as stuFilePath,b.score as stuscore,b.wwxsl,b.nwxsl,b.aigcxsl,b.xnxsl,b.pdf_path as stuPdfPath,b.zzdf,b.xshpfs,
b.wwsftg,b.nwsftg,b.aigcsftg,b.xnsftg,ifnull(b.jxfs,'0') + ifnull(b.jxfs2,'0') as jxfs
from zy_info a ,zy_info_student b
${ew.customSqlSegment}

View File

@ -26,6 +26,8 @@ import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
import org.jeecg.modules.kc.kcSysConfig.entity.KcSysConfig;
import org.jeecg.modules.kc.kcSysConfig.service.IKcSysConfigService;
import org.jeecg.modules.kc.ktgl.entity.KcKechengbiao;
import org.jeecg.modules.kc.ktgl.service.IKcKechengbiaoService;
import org.jeecg.modules.kc.zyCcjg.service.IZyCcjgService;
import org.jeecg.modules.kc.zyDbtx.entity.ZyDbtx;
import org.jeecg.modules.kc.zyDbtx.service.IZyDbtxService;
@ -43,6 +45,8 @@ import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.kc.zyInfoStudentHp.entity.ZyInfoStudentHp;
import org.jeecg.modules.kc.zyInfoStudentHp.service.IZyInfoStudentHpService;
import org.jeecg.modules.kc.zyInfoStudentPcz.service.IZyInfoStudentPczService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecg.modules.tools.DictUtils;
import org.jeecg.modules.tools.Global;
@ -114,6 +118,11 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@Autowired
private IZyInfoStudentPczService zyInfoStudentPczService;
@Autowired
private IKcKechengbiaoService kcKechengbiaoService;
@Autowired
private ISysUserService sysUserService;
/**
* 分页列表查询
@ -242,7 +251,11 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
if(StringUtils.isNotEmpty(hprInfo.getJxfs())){
jxcj = Double.parseDouble(hprInfo.getJxfs());//获取教师的互评成绩
}
double zzcj = hpcj + jxcj;
double jxcj2 = 0.0;//获取教师的互评成绩
if(StringUtils.isNotEmpty(hprInfo.getJxfs2())){
jxcj2 = Double.parseDouble(hprInfo.getJxfs2());//获取教师的互评成绩
}
double zzcj = hpcj + jxcj + jxcj2;
hprInfo.setZzdf(String.format("%.1f",zzcj));
}
zyInfoStudentService.updateById(hprInfo);
@ -387,6 +400,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper(object, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
ZyInfo zyInfo = zyInfoService.getById(object.getMainId());
SysUser teacher = sysUserService.getUserByName(zyInfo.getCreateBy());
// 过滤选中数据
String selections = request.getParameter("selections");
if (oConvertUtils.isNotEmpty(selections)) {
@ -402,7 +418,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
mv.addObject(NormalExcelConstants.FILE_NAME, title);
mv.addObject(NormalExcelConstants.CLASS, clazz);
//update-begin--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams(title + "报表", "导出人:" + sysUser.getRealname(), title);
// 课程名称:毕业论文 考试类型:考试-期末考试 打印日期:2024-05-11
String twoTitle = "课程名称:"+zyInfo.getTitle()+" 授课教师:"+teacher.getRealname()+" 作业占比:"+zyInfo.getScore()+"% 打印日期:"+ DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss");
ExportParams exportParams=new ExportParams("[第"+zyInfo.getSort()+"次作业] "+title + "报表", twoTitle+" 导出人:" + sysUser.getRealname(), title);
exportParams.setImageBasePath(upLoadPath);
//update-end--Author:liusq Date:20210126 for图片导出报错ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
@ -467,6 +485,12 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
if(bol == false){
return Result.error("文件存储失败,请重新上传作业!");
}
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("rwbh",zyInfo.getRwbh());
kcKechengbiaoQueryWrapper.eq("jgh",zyInfo.getCreateBy());
kcKechengbiaoQueryWrapper.eq("xqxn",zyInfo.getXnxq());
kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
//作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(zyInfo.getCreateBy());
@ -474,7 +498,7 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
zyDbtx.setMainId(zyInfo.getId());
zyDbtx.setRwbh(zyInfo.getRwbh());
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
zyDbtx.setContent("["+zyInfo.getTitle()+"]"+user.getRealname()+"提交了一篇作业需要您进行审批!");
zyDbtx.setContent(user.getRealname()+"学生提交了["+kcKechengbiao.getKcmc()+"]课程“"+zyInfo.getTitle()+"”作业,该作业完成时间为:"+DateUtils.formatDate(zyInfo.getEndTime(),"yyyy-MM-dd HH:mm")+",请及时查看。学生提交时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
zyDbtx.setFlag("0");
zyDbtx.setFbr(zyInfo.getCreateBy());
zyDbtxService.save(zyDbtx);
@ -507,9 +531,24 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
updateWrapper.set("nwxsl",null);
updateWrapper.set("aigcxsl",null);
updateWrapper.set("xnxsl",null);
updateWrapper.set("hpcs","0");
updateWrapper.set("xshpfs",null);
updateWrapper.set("jxfs",null);
updateWrapper.set("jxfs2",null);
updateWrapper.set("zzdf",null);
updateWrapper.set("score",null);
updateWrapper.eq("id",zyInfoStudent.getId());
zyInfoStudentService.update(updateWrapper);
zyInfoStudentHpService.remove(new QueryWrapper<ZyInfoStudentHp>().eq("zy_stu_id",zyInfoStudent.getId()));
//查重前删除原来的查重数据
// zyCcjgService.deleteByZystuid(zyInfoStudent.getId(),response);
return Result.OK("作业驳回成功!");
@ -659,11 +698,11 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
String minhpcs = dictUtils.translateDictValue("hpcjsz","4");
QueryWrapper<ZyInfoStudentHp> zyInfoStudentHpQueryWrapper = new QueryWrapper<>();
zyInfoStudentHpQueryWrapper.eq("main_id",zyInfoStudent.getMainId());
zyInfoStudentHpQueryWrapper.eq("stu_id",user.getUsername());
List<ZyInfoStudentHp> hplist = zyInfoStudentHpService.list(zyInfoStudentHpQueryWrapper);
String minhpcs = dictUtils.translateDictValue("hpcjsz","4");
pageSize = Integer.parseInt(minhpcs);
if(hplist.size()>0){
pageSize = pageSize - hplist.size();
@ -681,7 +720,7 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
queryWrapper.ne("a.create_by",user.getUsername());
queryWrapper.like(StringUtils.isNotEmpty(zyInfoStudent.getZytitle()),"a.title",zyInfoStudent.getZytitle());
queryWrapper.eq(StringUtils.isNotEmpty(zyInfoStudent.getRwbh()),"a.rwbh",zyInfoStudent.getRwbh());
queryWrapper.apply("a.hpcs - 0 < "+pageSize);
queryWrapper.apply("a.hpcs - 0 < "+minhpcs);
queryWrapper.orderByAsc("a.hpcs - 0 ");
IPage<ZyInfoStudent> pageList = zyInfoStudentService.getHpxxList(page, queryWrapper,user.getUsername());
return Result.OK(pageList);

View File

@ -50,6 +50,10 @@ public class ZyInfoStudent implements Serializable {
@Excel(name = "学生学号", width = 15)
@ApiModelProperty(value = "createBy")
private java.lang.String createBy;
@Excel(name = "专业名称", width = 15)
@ApiModelProperty(value = "zymc")
@TableField(exist = false)
private java.lang.String zymc;
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ -90,7 +94,7 @@ public class ZyInfoStudent implements Serializable {
// @Excel(name = "校内查重(%", width = 15)
@ApiModelProperty(value = "校内查重(%")
private java.lang.String xnxsl;
@Excel(name = "标记作业", width = 15,dicCode = "cdlx")
// @Excel(name = "标记作业", width = 15,dicCode = "cdlx")
@Dict(dicCode = "cdlx")
private String cdlx;//存档类型
@ -195,5 +199,11 @@ public class ZyInfoStudent implements Serializable {
private String sfpf;//是否评分
@TableField(exist = false)
private String zytitle;//作业名称
@TableField(exist = false)
private String stuScore;//作业名称
@TableField(exist = false)
private String pfbz;//评分标准
@TableField(exist = false)
private String sturead;//评分标准是否允许学生查看
}

View File

@ -12,9 +12,10 @@
${ew.customSqlSegment}
</select>
<select id="selectList" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
select a.*,round(IFNULL(a.jxfs,'0') + IFNULL(a.jxfs2,'0'),2) as jxzf,b.wwcc,b.nwcc,b.aigccc,b.xncc,b.title as zyname, GREATEST(ifnull(a.wwxsl,0),ifnull(a.nwxsl,0),ifnull(a.aigcxsl,0),ifnull(a.xnxsl,0)) as zgccl,b.wwtgl as alltgl
select a.*,round(IFNULL(a.jxfs,'0') + IFNULL(a.jxfs2,'0'),2) as jxzf,b.wwcc,b.nwcc,b.aigccc,b.xncc,b.title as zyname, GREATEST(ifnull(a.wwxsl,0),ifnull(a.nwxsl,0),ifnull(a.aigcxsl,0),ifnull(a.xnxsl,0)) as zgccl,b.wwtgl as alltgl,c.zymc
from zy_info_student a
left join zy_info b on a.main_id = b.id
left join zy_info b on a.main_id = b.id
left join xxhbbks c on a.create_by = c.xh
${ew.customSqlSegment}
</select>
@ -138,7 +139,7 @@
</select>
<select id="getHpxxList" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
select * from (
select a.*,if(c.id is null ,'0','1') as sfpf,b.title as zytitle,b.xshpkg,b.xshpkssj,b.xshpjssj,b.hpsfwctwo,b.title,b.rwbh from zy_info_student a
select a.*,if(c.id is null ,'0','1') as sfpf,b.title as zytitle,b.xshpkg,b.xshpkssj,b.xshpjssj,b.hpsfwctwo,b.title,b.rwbh,c.stu_score,b.sturead,b.pfbz from zy_info_student a
inner join zy_info b on a.main_id = b.id
LEFT JOIN zy_info_student_hp c on a.id = c.zy_stu_id AND c.stu_id = #{zyStuId}
) a
@ -146,7 +147,7 @@
</select>
<update id="updateJxfs2">
update zy_info_student set jxfs2 = '0' where main_id=#{id}
update zy_info_student set jxfs2 = '0' where main_id=#{id} and create_by = #{createBy}
</update>
</mapper>

View File

@ -215,7 +215,8 @@ public class ZyInfoStudentHpController extends JeecgController<ZyInfoStudentHp,
zyInfoStudentHp.setStuName(sysUser.getRealname());
zyInfoStudentHpService.save(zyInfoStudentHp);
//createBy是被评学生的id
//stuId 是评价学生的的id
ZyInfoStudent zyInfoStudentPar = zyInfoStudentService.getById(zyStuId);
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudentPar.getMainId());
@ -226,33 +227,22 @@ public class ZyInfoStudentHpController extends JeecgController<ZyInfoStudentHp,
ZyInfoStudent zyInfoStudent = new ZyInfoStudent();
zyInfoStudent.setHpcs(list2.size()+"");
zyInfoStudent.setId(zyStuId);
// zyInfoStudentService.updateById(zyInfoStudent);
//计算互评分数
if(list2.size() == 3){
//三个数的平均分去掉差值最大的剩余两个取平均分
ArrayList<Integer> numbers = new ArrayList<>();
int[] numbers = new int[3];
int i=0;
// 假设有一个整数数组numbers
for(ZyInfoStudentHp par:list2){
numbers.add(Integer.parseInt(par.getStuScore()));
numbers[i] =(Integer.parseInt(par.getStuScore()));
i++;
}
// 去掉最大值
int max = Integer.MIN_VALUE;
int sum = 0;
for (int num : numbers) {
max = Math.max(max, num);
sum += num;
}
sum -= max ;
double averageWithoutOutlier = calculateAverageWithoutOutlier(numbers);
// 计算平均值
double average = (double) sum / (numbers.size() - 1);
zyInfoStudent.setXshpfs(average+"");
zyInfoStudent.setXshpfs(String.format("%.1f",averageWithoutOutlier));
}else if(list2.size() > 3){
//去掉做高分和最低分 取平均值
ArrayList<Integer> numbers = new ArrayList<>();
// 假设有一个整数数组numbers
for(ZyInfoStudentHp par:list2){
@ -275,53 +265,56 @@ public class ZyInfoStudentHpController extends JeecgController<ZyInfoStudentHp,
}
//判断互评成绩是否为最终成绩
if(StringUtils.equals(zyInfo.getSfzzcj(),"1")){
if(StringUtils.equals(zyInfo.getSfzzcj(),"1") && list2.size()>=3){
zyInfoStudent.setScore(zyInfoStudent.getXshpfs());
}
zyInfoStudentService.updateById(zyInfoStudent);
Integer hpcjjl = Integer.parseInt(dictUtils.translateDictValue("hpcjsz","1"));
//计算评分人的互评次数计算互评人的绩效分数
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>();
zyInfoStudentQueryWrapper.eq("a.main_id",zyInfoStudentPar.getMainId());
zyInfoStudentQueryWrapper.eq("a.create_by",sysUser.getUsername());
List<ZyInfoStudent> listPfr = zyInfoStudentService.list(zyInfoStudentQueryWrapper);
if(listPfr.size()>0){
ZyInfoStudent hprInfo = listPfr.get(0);
//计算绩效分数
QueryWrapper<ZyInfoStudentHp> zyInfoStudentHpQueryWrapper3 = new QueryWrapper<>();
zyInfoStudentHpQueryWrapper3.eq("main_id",hprInfo.getMainId());
zyInfoStudentHpQueryWrapper3.eq("stu_id",sysUser.getUsername());
List<ZyInfoStudentHp> list3 = zyInfoStudentHpService.list(zyInfoStudentHpQueryWrapper3);
if(list3.size()>4){
if(StringUtils.isNotEmpty(hprInfo.getScore())){
double hpcj = Double.parseDouble(hprInfo.getScore());//获取教师的互评成绩
double jxcj = hpcj * hpcjjl / 100;
hprInfo.setJxfs(String.format("%.1f",jxcj));
}
}
//计算最终得分
if(StringUtils.isNotEmpty(hprInfo.getScore())){
double hpcj = Double.parseDouble(hprInfo.getScore());//获取教师的互评成绩
double jxcj = 0.0;//获取教师的互评成绩
if(StringUtils.isNotEmpty(hprInfo.getJxfs())){
jxcj = Double.parseDouble(hprInfo.getJxfs());//获取教师的互评成绩
}
double zzcj = hpcj + jxcj;
hprInfo.setZzdf(String.format("%.1f",zzcj));
}
zyInfoStudentService.updateById(hprInfo);
}
//计算二次绩效奖励
ZyInfo jspc = new ZyInfo();
jspc.setId(zyInfoStudentPar.getMainId());
jspc.setCreateBy(sysUser.getUsername());
zyInfoStudentPczService.calculationPcz(jspc);
//计算所有人的最终得分
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper2 = new QueryWrapper<>();
zyInfoStudentQueryWrapper2.eq("a.main_id",zyInfoStudentPar.getMainId());
zyInfoStudentQueryWrapper2.isNotNull("a.score");
List<ZyInfoStudent> stulist = zyInfoStudentService.list(zyInfoStudentQueryWrapper2);
for(ZyInfoStudent par:stulist){
//计算绩效分数
QueryWrapper<ZyInfoStudentHp> zyInfoStudentHpQueryWrapper3 = new QueryWrapper<>();
zyInfoStudentHpQueryWrapper3.eq("main_id",par.getMainId());
zyInfoStudentHpQueryWrapper3.eq("stu_id",par.getCreateBy());
List<ZyInfoStudentHp> list3 = zyInfoStudentHpService.list(zyInfoStudentHpQueryWrapper3);
if(list3.size()>4){
if(StringUtils.isNotEmpty(par.getScore())){
double hpcj = Double.parseDouble(par.getScore());//获取教师的互评成绩
double jxcj = hpcj * hpcjjl / 100;
par.setJxfs(String.format("%.1f",jxcj));
}
}else{
par.setJxfs("");
}
//计算最终得分
if(StringUtils.isNotEmpty(par.getScore())){
double hpcj = Double.parseDouble(par.getScore());//获取教师的互评成绩
double jxcj = 0.0;//获取教师的互评成绩
if(StringUtils.isNotEmpty(par.getJxfs())){
jxcj = Double.parseDouble(par.getJxfs());//获取教师的互评成绩
}
double jxcj2 = 0.0;//获取教师的互评成绩
if(StringUtils.isNotEmpty(par.getJxfs2())){
jxcj2 = Double.parseDouble(par.getJxfs2());//获取教师的互评成绩
}
double zzcj = hpcj + jxcj + jxcj2;
par.setZzdf(String.format("%.1f",zzcj));
}
zyInfoStudentService.updateById(par);
}
return Result.OK("互评成功!");
}
}else{
@ -330,6 +323,47 @@ public class ZyInfoStudentHpController extends JeecgController<ZyInfoStudentHp,
}
public static double calculateAverageWithoutOutlier(int[] scores) {
Arrays.sort(scores); // 将分数数组排序
int n = scores.length;
//三个数的计算方式
double bsum = 0;
double baverage;
for (int i = 0; i < n; i++) {
bsum += scores[i];
}
baverage = bsum / n;
double c = 0;//分差
int djg = 0;
for (int i = 0; i < n; i++){
if(c<Math.abs(baverage - scores[i])){
c = Math.abs(baverage - scores[i]);
djg = i;
}
}
int[] scores2 = removeElement(scores, djg);
double sum = 0;
double average;
// 去掉一个最高或最低的分数
sum = (scores2[0] + scores2[1]);
// 计算剩下分数的平均值
average = (sum / 2);
return average;
}
public static int[] removeElement(int[] array, int n) {
if (array == null || n < 0 || n >= array.length) {
throw new IllegalArgumentException("Invalid input");
}
int[] newArray = new int[array.length - 1];
System.arraycopy(array, 0, newArray, 0, n);
System.arraycopy(array, n + 1, newArray, n, array.length - n - 1);
return newArray;
}
@AutoLog(value = "学生成绩第二次互评-添加")
@ApiOperation(value="学生成绩第二次互评-添加", notes="学生成绩第二次互评-添加")
@PostMapping(value = "/saveTwo")

View File

@ -6,6 +6,8 @@ import org.jeecg.common.util.text.StringUtils;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.kc.zyInfoStudent.mapper.ZyInfoStudentMapper;
import org.jeecg.modules.kc.zyInfoStudentHp.entity.ZyInfoStudentHp;
import org.jeecg.modules.kc.zyInfoStudentHp.service.IZyInfoStudentHpService;
import org.jeecg.modules.kc.zyInfoStudentPcz.entity.ZyInfoStudentPcz;
import org.jeecg.modules.kc.zyInfoStudentPcz.mapper.ZyInfoStudentPczMapper;
import org.jeecg.modules.kc.zyInfoStudentPcz.service.IZyInfoStudentPczService;
@ -25,7 +27,8 @@ import java.util.List;
*/
@Service
public class ZyInfoStudentPczServiceImpl extends ServiceImpl<ZyInfoStudentPczMapper, ZyInfoStudentPcz> implements IZyInfoStudentPczService {
@Autowired
private IZyInfoStudentHpService zyInfoStudentHpService;
@Autowired
private ZyInfoStudentMapper zyInfoStudentMapper;
@ -41,7 +44,7 @@ public class ZyInfoStudentPczServiceImpl extends ServiceImpl<ZyInfoStudentPczMap
//删除所有方差作业数据
baseMapper.delete(new QueryWrapper<ZyInfoStudentPcz>().eq("zy_id",jspc.getId()));
//修改原来的绩效数据
//修改原来的绩效数据 将原来的第二次绩效修改成0
zyInfoStudentMapper.updateJxfs2(jspc);
//查询方差数据并重新插入到数据库中
@ -69,22 +72,22 @@ public class ZyInfoStudentPczServiceImpl extends ServiceImpl<ZyInfoStudentPczMap
wrapper.last("limit 1");
ZyInfoStudent zyInfoStudent = zyInfoStudentMapper.selectOne(wrapper);
String score = zyInfoStudent.getScore();
if(StringUtils.isEmpty(score)){
score = "0";
QueryWrapper<ZyInfoStudentHp> zyInfoStudentHpQueryWrapper3 = new QueryWrapper<>();
zyInfoStudentHpQueryWrapper3.eq("main_id",zyInfoStudentPcz.getZyId());
zyInfoStudentHpQueryWrapper3.eq("stu_id",zyInfoStudentPcz.getStuId());
List<ZyInfoStudentHp> list3 = zyInfoStudentHpService.list(zyInfoStudentHpQueryWrapper3);
if(list3.size()>4){
if(com.baomidou.mybatisplus.core.toolkit.StringUtils.isNotEmpty(zyInfoStudent.getScore())){
String score = zyInfoStudent.getScore();
if(StringUtils.isEmpty(score)){
score = "0";
}
Double jxfs2 = Double.parseDouble(score) * Double.parseDouble(bfbFs) /100;
zyInfoStudent.setJxfs2(String.format("%.1f",jxfs2));//第二次绩效
zyInfoStudentMapper.updateById(zyInfoStudent);
}
}
Double jxfs2 = Double.parseDouble(score) * Double.parseDouble(bfbFs) /100;
zyInfoStudent.setJxfs2(String.format("%.1f",jxfs2));//第二次绩效
String jxfs = zyInfoStudent.getJxfs();
if(StringUtils.isEmpty(jxfs)){
jxfs = "0";
}
Double zdf = Double.parseDouble(score) + Double.parseDouble(jxfs) + jxfs2;
zyInfoStudent.setZzdf(String.format("%.1f",zdf));
zyInfoStudentMapper.updateById(zyInfoStudent);
}
}
public static int roundToInteger(double value) {
return (int) Math.round(value);

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.kc.zyTlq.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -15,6 +16,7 @@ import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.config.entity.KcExportConfigTpkwcqkjzglx;
import org.jeecg.modules.kc.config.service.IKcExportConfigTpkwcqkjzglxService;
@ -216,6 +218,7 @@ public class ZyTlqController extends JeecgController<ZyTlq, IZyTlqService> {
queryWrapper.apply("a.xh = b.xh");
queryWrapper.eq("b.KCAPZBBH",par.getRwbh());
List<Xxhbbks> list = xxhbbksService.getXsxkbAllList(queryWrapper);
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
for(Xxhbbks xxhbbks:list){
//作业代办提醒
@ -224,9 +227,9 @@ public class ZyTlqController extends JeecgController<ZyTlq, IZyTlqService> {
zyDbtx.setType("4");//0发布作业 1评分 2测验 3问卷 4讨论
zyDbtx.setMainId(par.getId());
zyDbtx.setRwbh(par.getRwbh());
zyDbtx.setContent(" ["+par.getKcmc()+"] "+par.getSkjs()+" 发布了一篇新的讨论,请及时参与!");
// zyDbtx.setContent(" ["+par.getKcmc()+"] "+par.getSkjs()+" 发布了一篇新的讨论,请及时参与!");
zyDbtx.setContent(user.getRealname()+"教师发起了["+par.getKcmc()+"]课程“"+par.getTitle()+"”的讨论,请及时参与讨论。发布时间:"+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
zyDbtx.setFlag("0");
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
zyDbtx.setFbr(user.getUsername());
zyDbtxService.save(zyDbtx);