修改bug

This commit is contained in:
yangjun 2024-05-29 16:53:08 +08:00
parent fcc7a963c8
commit be2465685e
10 changed files with 225 additions and 43 deletions

View File

@ -62,12 +62,12 @@ public class WjxDjxx {
@Excel(name = "总分", width = 15)
@ApiModelProperty(value = "总分")
private double totalScore;
@Excel(name = "答卷时间", width = 15)
@Excel(name = "答卷时间", width = 15,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 Date openTime;
@Excel(name = "交卷时间", width = 15)
@Excel(name = "交卷时间", width = 15,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 = "交卷时间")

View File

@ -4,6 +4,7 @@ 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.WjxDjxxDj;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
import java.util.List;
@ -29,4 +30,10 @@ public interface WjxDjxxMapper extends BaseMapper<WjxDjxx> {
List<WjxDjxx> findDjjgsPage(Page<WjxDjxx> page, WjxDjxx params);
List<WjxDjxx> findUnDjjgsPage(Page<WjxDjxx> page, WjxDjxx params);
List<WjxDjxx> findAllDjjgsPage(Page<WjxDjxx> page, WjxDjxx params);
List<WjxDjxxDj> findDjjgsDjPage(WjxDjxxDj params);
List<WjxDjxxDj> findUnDjjgsDJPage(WjxDjxxDj params);
List<WjxDjxxDj> findAllDjjgsDjPage(WjxDjxxDj params);
}

View File

@ -169,4 +169,63 @@
</if>
order by b.total_score desc
</select>
<select id="findDjjgsDjPage" parameterType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxDj">
select a.atype,b.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 = #{id}
<if test="userId!=null and userId != ''">
and b.user_id like concat('%',#{userId},'%')
</if>
<if test="userName!=null and userName != ''">
and b.user_name like concat('%',#{userName},'%')
</if>
order by b.user_id
</select>
<select id="findUnDjjgsDJPage" parameterType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxDj">
select x.atype,x.id,x.xqxn,x.kcmc,x.start_time,x.end_time,x.title,x.content,'' as vid,'' as jid,y.xh as user_id,y.xm as user_name,0 as score,0 as total_score,'' as answerSfm
from wjx_wjxx x
inner join (
select a.xh,a.xm,b.KCAPZBBH
from xxhbbks a
inner join xxhbxsxkb b on a.xh = b.xh and b.KCAPZBBH = #{rwbh}
) y
on y.KCAPZBBH = x.rwbh
WHERE x.id = #{id}
<if test="userId!=null and userId != ''">
and y.xh like concat('%',#{userId},'%')
</if>
<if test="userName!=null and userName != ''">
and y.xm like concat('%',#{userName},'%')
</if>
and y.xh not in(
select user_id from wjx_djxx c where c.vid = x.vid
)
order by y.xh
</select>
<select id="findAllDjjgsDjPage" parameterType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx" resultType="org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxDj">
select a.atype,b.id,a.xqxn,a.kcmc,a.start_time,a.end_time,a.title,a.content,b.vid,b.jid,y.xh as user_id,y.xm as user_name,b.open_time,b.commit_time,b.score,b.total_score,ifnull(b.answer_seconds,-1) as answer_seconds
from wjx_wjxx a
inner join (
select a.xh,a.xm,b.KCAPZBBH
from xxhbbks a
inner join xxhbxsxkb b on a.xh = b.xh and b.KCAPZBBH = #{rwbh}
) y
on y.KCAPZBBH = a.rwbh
left join wjx_djxx b on a.vid = b.vid and y.xh = b.user_id
where a.id = #{id}
<if test="userId!=null and userId != ''">
and y.xh like concat('%',#{userId},'%')
</if>
<if test="userName!=null and userName != ''">
and y.xm like concat('%',#{userName},'%')
</if>
order by b.total_score desc
</select>
</mapper>

View File

@ -2,6 +2,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.WjxDjxxDj;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmlbPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -20,4 +21,6 @@ public interface IWjxDjxxService extends IService<WjxDjxx> {
Page<WjxDjxx> findDjjgsPage(WjxDjxx wjxDjxx, Page<WjxDjxx> page);
List<WjxDjxx> exportList(WjxDjxx wjxDjxx);
List<WjxDjxxDj> exportDjXls(WjxDjxxDj wjxDjxxdj);
}

View File

@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxDj;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmlbPage;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
import org.jeecg.modules.kc.wjxDjxx.mapper.WjxDjxxMapper;
@ -428,4 +429,28 @@ public class WjxDjxxServiceImpl extends ServiceImpl<WjxDjxxMapper, WjxDjxx> impl
return list;
}
@Override
public List<WjxDjxxDj> exportDjXls(WjxDjxxDj wjxDjxxdj) {
List<WjxDjxxDj> list = new ArrayList<>();
if(StringUtils.equals("1",wjxDjxxdj.getIsFinished())){
//完成答卷的
list = baseMapper.findDjjgsDjPage(wjxDjxxdj);
for(WjxDjxxDj djxx:list){
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
}
}else if(StringUtils.equals("0",wjxDjxxdj.getIsFinished())){
//未完成答卷的
list = baseMapper.findUnDjjgsDJPage(wjxDjxxdj);
}else{
//全部
list = baseMapper.findAllDjjgsDjPage(wjxDjxxdj);
for(WjxDjxxDj djxx:list){
if(djxx.getAnswerSeconds()!=-1){
djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
}
}
}
return list;
}
}

View File

@ -15,6 +15,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxDj;
import org.jeecg.modules.kc.wjxDjxx.service.IWjxDjxxService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import org.jeecg.modules.kc.zyInfoStudent.service.IZyInfoStudentService;
@ -238,46 +239,33 @@ public class WjxWjxxTmlbController extends JeecgController<WjxWjxxTmlb, IWjxWjxx
public ModelAndView exportXls(HttpServletRequest request, WjxDjxx wjxDjxx) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//Step.2 获取导出数据
// if(StringUtils.equals("1",wjxDjxx.getIsFinished())){
// //完成答卷的
// List<WjxDjxx> list = baseMapper.findDjjgsPage(page,wjxDjxx);
// for(WjxDjxx djxx:list){
// djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
// }
// }else if(StringUtils.equals("0",wjxDjxx.getIsFinished())){
// //未完成答卷的
// List<WjxDjxx> list = baseMapper.findUnDjjgsPage(page,wjxDjxx);
// }else{
// //全部
// List<WjxDjxx> list = baseMapper.findAllDjjgsPage(page,wjxDjxx);
// for(WjxDjxx djxx:list){
// if(djxx.getAnswerSeconds()!=-1){
// djxx.setAnswerSfm(convertSecondsToHMS(djxx.getAnswerSeconds()));
// }
// }
// }
List<WjxDjxx> pageList = wjxDjxxService.exportList(wjxDjxx);
// Step.3 组装pageList
// List<WjxWjxxTmlbPage> pageList = new ArrayList<WjxWjxxTmlbPage>();
// for (WjxWjxxTmlb main : wjxWjxxTmlbList) {
// WjxWjxxTmlbPage vo = new WjxWjxxTmlbPage();
// BeanUtils.copyProperties(main, vo);
// List<WjxWjxxTmxx> wjxWjxxTmxxList = wjxWjxxTmxxService.selectByMainId(main.getId());
// vo.setWjxWjxxTmxxList(wjxWjxxTmxxList);
// pageList.add(vo);
// }
// Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "问卷信息");
mv.addObject(NormalExcelConstants.FILE_NAME, "测验信息");
mv.addObject(NormalExcelConstants.CLASS, WjxDjxx.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("问卷信息", "导出人:"+sysUser.getRealname(), "问卷信息"));
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("测验信息", "导出人:"+sysUser.getRealname(), "测验信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
@RequestMapping(value = "/exportDjXls")
public ModelAndView exportDjXls(HttpServletRequest request, WjxDjxxDj wjxDjxxdj) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<WjxDjxxDj> pageList = wjxDjxxService.exportDjXls(wjxDjxxdj);
// Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "问卷信息");
mv.addObject(NormalExcelConstants.CLASS, WjxDjxxDj.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("问卷信息", "导出人:"+sysUser.getRealname(), "问卷信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*

View File

@ -84,7 +84,7 @@ public class ZyCcjgServiceImpl extends ServiceImpl<ZyCcjgMapper, ZyCcjg> impleme
}else if(StringUtils.equals(par.getCcType(), "2")){
aigcCxjcjg(par);
}else if(StringUtils.equals(par.getCcType(), "3")){
xfwbdCxjcjg(par);
xnCxjcjg(par);
}
}
}
@ -366,6 +366,99 @@ public class ZyCcjgServiceImpl extends ServiceImpl<ZyCcjgMapper, ZyCcjg> impleme
}
}
//小范围比对查询检测结果
public Map<String,String> xnCxjcjg(ZyCcjg zyCcjg) {
String url = "https://vims.fanyu.com/toole/smallcheck/searchCheckStatus";
//文件路径文件存在不存在的话需要先下载下来
String paperid = zyCcjg.getPaperid();
Map<String, String> textMap = new HashMap<String, String>();
//可以设置多个input的namevalue
String sign = getSign();
textMap.put("userid", weipuId);
textMap.put("sign", sign);
textMap.put("cateid", zyCcjg.getBdkbs());//比对库的id
textMap.put("dataids", paperid);//资源id
String contentType = "";//image/png
Map<String, String> fileMap = new HashMap<String, String>();
String ret = formUpload(url, textMap, fileMap,contentType);
System.out.println("1-------->"+ret);
JSONObject object= JSONObject.parseObject(ret);
if("true".equals(object.getString("success"))){
//{"success":true,"message":"查询成功", "datalist":[{"dataid":568,"message":"","paperguid":"5c384d6bd69y9ba9","papertitle":"","filestateid":2,"paperword":1958,"percentage":0,"duplicatepercentage":0,"quotepercentage":0,"paichupercentage":0,"selfyypercentage":0,"ownpercentage":100,"authorpercentage":0,"checkdate":"2024-04-13 13:51:51","paperviewurl":"https://vims.fanyu.com/toole/smallcheck/getonlineurl?guid=5c384d6bd69y9ba9","paperdownurl":"https://vims.fanyu.com/toole/smallcheck/getdownloadurl?guid=5c384d6bd69y9ba9"}]}
//filestateid 检测状态{0未检测,1检测中,2检测完成, 3检测失败}
String listpaper = object.getString("datalist");
JSONArray jsonArray = (JSONArray) JSONArray.parse(listpaper);
JSONObject object2= jsonArray.getJSONObject(0);
String filestateid = object2.getString("filestateid");
if(StringUtils.equals(filestateid,"0")){
System.out.println(paperid+":未检测");
}else if(StringUtils.equals(filestateid,"1")){
System.out.println(paperid+":检测中");
}else if(StringUtils.equals(filestateid,"2")){
System.out.println(paperid+":检测完成");
}else if(StringUtils.equals(filestateid,"3")){
System.out.println(paperid+":检测失败;"+object2.getString("message"));
}else{
System.out.println(paperid+":当前状态:"+filestateid+""+object2.getString("message"));
}
System.out.println("listpaper----->"+listpaper);//结果结合
System.out.println("object2----->"+object2);//实际单挑数据结果
Map<String,String> map = new HashMap<String,String>();
zyCcjg.setPaperguid(object2.getString("paperguid"));//报告编号
zyCcjg.setPapertitle(object2.getString("papertitle"));//论文标题
zyCcjg.setFilestateid(object2.getString("filestateid"));//检测状态0:未检测1:检测中2:检测完成3:检测失败
zyCcjg.setCheckdate(object2.getString("checkdate"));//检测时间
zyCcjg.setPaperword(object2.getString("paperword"));//论文字数
zyCcjg.setPaperviewurl(object2.getString("paperviewurl"));//报告在线查看地址
zyCcjg.setPaperdownurl(object2.getString("paperdownurl"));//报告下载地址
zyCcjg.setMessage(object2.getString("message"));
zyCcjg.setDuplicatepercentage(object2.getString("duplicatepercentage"));//复写率
zyCcjg.setPaichupercentage(object2.getString("paichupercentage"));//他引率
zyCcjg.setOwnpercentage(object2.getString("ownpercentage"));//自写率
zyCcjg.setPercentage(object2.getString("percentage"));//相似率
zyCcjg.setQuotepercentage(object2.getString("quotepercentage"));//引用率
zyCcjg.setSelfquoterate(object2.getString("selfyypercentage"));//自引率
zyCcjg.setAuthorpercentage(object2.getString("authorpercentage"));//专业术语率
baseMapper.updateById(zyCcjg);
//----------计算通过率--------------
if(StringUtils.equals("2",object2.getString("filestateid"))) {
String stuId = zyCcjg.getZyStuId();
ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId);
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
Double tgl = 0.0;
if (zyInfo.getNwtgl() > 0) {
tgl = zyInfo.getNwtgl();
}
Double cctgl = 0.0;
if (StringUtils.isNotEmpty(object2.getString("percentage"))) {
cctgl = Double.parseDouble(object2.getString("percentage"));
}
if (tgl > cctgl || tgl == 0) {
zyInfoStudent.setXnsftg("通过");
} else {
zyInfoStudent.setXnsftg("未通过");
}
zyInfoStudent.setXnxsl(cctgl + "");
zyInfoStudentService.updateById(zyInfoStudent);
}
//----------计算通过率--------------
map.put("success","true");
map.put("message",object.getString("message"));
return map;
}else{
System.out.println("3-------->");
Map<String,String> map = new HashMap<String,String>();
map.put("success","false");
map.put("message",object.getString("message"));
return map;
}
}
//生成sign
public static String getSign() {
String userid = weipuId;

View File

@ -12,7 +12,7 @@
SELECT
id, create_by, create_time, update_by, update_time, title, zy_type,
content, start_time, end_time, zy_status, xnxq,
wwcc, wwtgl, nwcc, nwtgl, aigccc, aigctgl, rwbh, file_path, xkxs,
wwcc, wwtgl, nwcc, nwtgl, aigccc, aigctgl,xncc, xntgl, rwbh, file_path, xkxs,
ifnull(b.num,0) as wtjnum,ifnull(c.num,0) as ytjnum,ifnull(d.num,0) as wpynum,ifnull(e.num,0) as ypynum
FROM
zy_info a

View File

@ -89,6 +89,13 @@ public class ZyInfoStudent implements Serializable {
/**aigc是否通过*/
@ApiModelProperty(value = "aigc是否通过")
private java.lang.String aigcsftg;
/**校内是否通过*/
@ApiModelProperty(value = "校内是否通过")
private java.lang.String xnsftg;
/**校内相似律*/
@Excel(name = "校内相似律", width = 15)
@ApiModelProperty(value = "校内相似律")
private java.lang.String xnxsl;
private java.lang.String pdfPath;
private String scoreFabu;

View File

@ -93,14 +93,14 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
zyInfoStudent = baseMapper.selectById(zyInfoStudent.getId());
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
String rwbh = zyInfo.getRwbh();
QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
kcKechengbiaoQueryWrapper.eq("xqxn",zyInfo.getXnxq());
kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
kcKechengbiaoQueryWrapper.last("limit 1");
KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
String cateid = kcKechengbiao.getKcbh()+""+kcKechengbiao.getKcmc();
String catename = kcKechengbiao.getKcmc();
// String rwbh = zyInfo.getRwbh();
// QueryWrapper<KcKechengbiao> kcKechengbiaoQueryWrapper = new QueryWrapper<>();
// kcKechengbiaoQueryWrapper.eq("xqxn",zyInfo.getXnxq());
// kcKechengbiaoQueryWrapper.eq("rwbh",rwbh);
// kcKechengbiaoQueryWrapper.last("limit 1");
// KcKechengbiao kcKechengbiao = kcKechengbiaoService.getOne(kcKechengbiaoQueryWrapper);
String cateid = zyInfo.getId()+""+zyInfo.getTitle();
String catename = zyInfo.getTitle();
zyInfoStudent.setCateid(cateid);
zyInfoStudent.setCatename(catename);
//外网查重及提交检测