同步论文考核数据

This commit is contained in:
曹磊 2024-09-07 15:07:31 +08:00
parent 6ec9ee92ce
commit 8576177e2a
13 changed files with 472 additions and 3 deletions

View File

@ -30,16 +30,71 @@ public class LwKhcl implements Serializable {
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**毕业年份*/
@Excel(name = "毕业年份", width = 15)
@ApiModelProperty(value = "毕业年份")
private String bynf;
/**所属院系名称*/
@Excel(name = "所属院系名称", width = 25)
@ApiModelProperty(value = "所属院系名称")
private String ssyxmc;
/**所属校内专业(大类)名称*/
@Excel(name = "所属校内专业(大类)名称", width = 35)
@ApiModelProperty(value = "所属校内专业(大类)名称")
private String ssxnzymc;
@ApiModelProperty(value = "学生学号")
private String xsxh;
@ApiModelProperty(value = "学生姓名")
private String xsxm;
@ApiModelProperty(value = "班级")
private String bj;
@ApiModelProperty(value = "毕业论文(设计)题目")
private String bylwTm;
@ApiModelProperty(value = "毕业论文(设计)类别")
private String bylwLb;
@ApiModelProperty(value = "毕业论文(设计)成绩")
private String bylwCj;
@ApiModelProperty(value = "指导教师姓名")
private String zdjsxm;
@ApiModelProperty(value = "指导教师职称")
private String zdjszc;
@ApiModelProperty(value = "是否实现电子化管理")
private String sfsxdzhgl;
@ApiModelProperty(value = "关键词")
private String gjc;
@ApiModelProperty(value = "查重结果")
private String ccjg;
@ApiModelProperty(value = "开题报告")
private String ktbg;
@ApiModelProperty(value = "开题报告审核意见")
private String ktbgshyj;
@ApiModelProperty(value = "中期检查")
private String zqjc;
@ApiModelProperty(value = "论文终稿")
private String lwzg;
@ApiModelProperty(value = "论文终稿Pdf")
private String lwzgPdf;
@ApiModelProperty(value = "检测报告等材料")
private String jcbgdcl;
@ApiModelProperty(value = "入库日期")
private String createTime;
}

View File

@ -0,0 +1,49 @@
package org.jeecg.modules.demo.lwKhcl.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: 论文考核原始视图-附件信息
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
@Data
@TableName("v_file_up_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="v_file_up_info对象", description="v_file_up_info")
public class LwKhclFileInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "学生学号")
private String xsxh;
@ApiModelProperty(value = "文件类型")
private String fileType;
@ApiModelProperty(value = "上传日期")
private String uploadDateTime;
@ApiModelProperty(value = "文件路径")
private String filePath;
@ApiModelProperty(value = "文件名称")
private String fileName;
}

View File

@ -0,0 +1,75 @@
package org.jeecg.modules.demo.lwKhcl.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: 论文考核原始视图-学生信息
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
@Data
@TableName("v_student_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="v_student_info对象", description="v_student_info")
public class LwKhclStudentInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "学生学号")
private String xsxh;
@ApiModelProperty(value = "学生姓名")
private String xsxm;
@ApiModelProperty(value = "毕业年份")
private String bynf;
@ApiModelProperty(value = "班级")
private String bj;
@ApiModelProperty(value = "毕业论文(设计)题目")
private String bylwTm;
@ApiModelProperty(value = "毕业论文(设计)类别")
private String bylwLb;
@ApiModelProperty(value = "毕业论文(设计)成绩")
private String bylwCj;
@ApiModelProperty(value = "指导教师姓名")
private String zdjsxm;
@ApiModelProperty(value = "指导教师职称")
private String zdjszc;
@ApiModelProperty(value = "所属院系名称")
private String ssyxmc;
@ApiModelProperty(value = "所属校内专业(大类)名称")
private String ssxnzymc;
@ApiModelProperty(value = "关键词")
private String gjc;
@ApiModelProperty(value = "查重结果")
private String ccjg;
@ApiModelProperty(value = "入库日期")
private String createTime;
}

View File

@ -70,6 +70,9 @@ public class LwKhclXq implements Serializable {
// @Excel(name = "论文终稿", width = 30)
@ApiModelProperty(value = "论文终稿")
private String lwzg;
// @Excel(name = "论文终稿Pdf", width = 30)
@ApiModelProperty(value = "论文终稿Pdf")
private String lwzgPdf;
/**检测报告等材料*/
// @Excel(name = "检测报告等材料", width = 30)
@ApiModelProperty(value = "检测报告等材料")

View File

@ -0,0 +1,16 @@
package org.jeecg.modules.demo.lwKhcl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclFileInfo;
import java.util.List;
/**
* @Description: lw_khcl
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
public interface LwKhclFileInfoMapper extends BaseMapper<LwKhclFileInfo> {
List<LwKhclFileInfo> getList(@Param("createTime")String createTime,@Param("xsxh")String xsxh);
}

View File

@ -0,0 +1,18 @@
package org.jeecg.modules.demo.lwKhcl.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclFileInfo;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclStudentInfo;
import java.util.List;
/**
* @Description: lw_khcl
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
public interface LwKhclStudentInfoMapper extends BaseMapper<LwKhclStudentInfo> {
List<LwKhclStudentInfo> getList(@Param("createTime")String createTime);
}

View File

@ -0,0 +1,17 @@
<?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.demo.lwKhcl.mapper.LwKhclFileInfoMapper">
<select id="getList" parameterType="String" resultType="org.jeecg.modules.demo.lwKhcl.entity.LwKhclFileInfo">
select *
from v_file_up_info
where 1=1
<if test="createTime!=null and createTime!=''">
and DATE_FORMAT(upload_date_time,'%Y-%m-%d %H:%i:%s') > DATE_FORMAT(#{createTime},'%Y-%m-%d %H:%i:%s')
</if>
<if test="xsxh!=null and xsxh!=''">
and xsxh = #{xsxh}
</if>
</select>
</mapper>

View File

@ -0,0 +1,16 @@
<?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.demo.lwKhcl.mapper.LwKhclStudentInfoMapper">
<select id="getList" parameterType="String" resultType="org.jeecg.modules.demo.lwKhcl.entity.LwKhclStudentInfo">
select a.*
from v_student_info a
<if test="createTime!=null and createTime!=''">
where a.xsxh in (
select distinct xsxh from v_file_up_info b
where DATE_FORMAT(b.upload_date_time,'%Y-%m-%d %H:%i:%s') > DATE_FORMAT(#{createTime},'%Y-%m-%d %H:%i:%s')
)
</if>
</select>
</mapper>

View File

@ -0,0 +1,16 @@
package org.jeecg.modules.demo.lwKhcl.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclFileInfo;
import java.util.List;
/**
* @Description: lw_khcl
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
public interface ILwKhclFileInfoService extends IService<LwKhclFileInfo> {
List<LwKhclFileInfo> getList(String createTime, String xsxh);
}

View File

@ -0,0 +1,16 @@
package org.jeecg.modules.demo.lwKhcl.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclStudentInfo;
import java.util.List;
/**
* @Description: lw_khcl
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
public interface ILwKhclStudentInfoService extends IService<LwKhclStudentInfo> {
List<LwKhclStudentInfo> getList(String createTime);
}

View File

@ -0,0 +1,25 @@
package org.jeecg.modules.demo.lwKhcl.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclFileInfo;
import org.jeecg.modules.demo.lwKhcl.mapper.LwKhclFileInfoMapper;
import org.jeecg.modules.demo.lwKhcl.service.ILwKhclFileInfoService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description: lw_khcl
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
@Service
public class LwKhclFileInfoServiceImpl extends ServiceImpl<LwKhclFileInfoMapper, LwKhclFileInfo> implements ILwKhclFileInfoService {
@Override
public List<LwKhclFileInfo> getList(String createTime,String xsxh){
return baseMapper.getList(createTime,xsxh);
}
}

View File

@ -0,0 +1,25 @@
package org.jeecg.modules.demo.lwKhcl.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhcl;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclStudentInfo;
import org.jeecg.modules.demo.lwKhcl.mapper.LwKhclStudentInfoMapper;
import org.jeecg.modules.demo.lwKhcl.service.ILwKhclStudentInfoService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description: lw_khcl
* @Author: jeecg-boot
* @Date: 2024-09-05
* @Version: V1.0
*/
@Service
public class LwKhclStudentInfoServiceImpl extends ServiceImpl<LwKhclStudentInfoMapper, LwKhclStudentInfo> implements ILwKhclStudentInfoService {
@Override
public List<LwKhclStudentInfo> getList(String createTime){
return baseMapper.getList(createTime);
}
}

View File

@ -0,0 +1,138 @@
package org.jeecg.modules.demo.sync;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhcl;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclFileInfo;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclStudentInfo;
import org.jeecg.modules.demo.lwKhcl.service.ILwKhclFileInfoService;
import org.jeecg.modules.demo.lwKhcl.service.ILwKhclService;
import org.jeecg.modules.demo.lwKhcl.service.ILwKhclStudentInfoService;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 同步论文信息
*/
@Slf4j
public class SyncLwhk extends BaseSync {
@Autowired
private ILwKhclStudentInfoService lwKhclStudentInfoService;
@Autowired
private ILwKhclFileInfoService lwKhclFileInfoService;
@Autowired
private ILwKhclService lwKhclService;
/**
* 若参数变量名修改 QuartzJobController中也需对应修改
*/
@Override
public void execute(JobExecutionContext jobExecutionContext) {
start();
run(getParamMap());
end();
}
/**
* 有参定时任务实现
* @param param
*/
public void run(Map<String, Object> param){
String createTime = "";
//查询数据
QueryWrapper eqw1 = new QueryWrapper();
eqw1.select("MAX(create_time) as createTime");
LwKhcl maxLwKhcl = lwKhclService.getOne(eqw1);
if(maxLwKhcl!=null){
createTime = maxLwKhcl.getCreateTime();
}
List<LwKhclStudentInfo> studentList = lwKhclStudentInfoService.getList(createTime);
for(LwKhclStudentInfo sv: studentList){
QueryWrapper eqw2 = new QueryWrapper();
eqw2.eq("xsxh",sv.getXsxh());
LwKhcl lwKhcl = lwKhclService.getOne(eqw2);
if(lwKhcl == null){
lwKhcl = new LwKhcl();
lwKhcl.setXsxh(sv.getXsxh());
lwKhcl.setXsxm(sv.getXsxm());
lwKhcl.setBynf(sv.getBynf());
lwKhcl.setBj(sv.getBj());
lwKhcl.setBylwTm(sv.getBylwTm());
lwKhcl.setBylwLb(sv.getBylwLb());
lwKhcl.setBylwCj(sv.getBylwCj());
lwKhcl.setZdjsxm(sv.getZdjsxm());
lwKhcl.setZdjszc(sv.getZdjszc());
lwKhcl.setSsyxmc(sv.getSsyxmc());
lwKhcl.setSsxnzymc(sv.getSsxnzymc());
lwKhcl.setSfsxdzhgl("");
lwKhcl.setGjc(sv.getGjc());
lwKhcl.setCcjg(sv.getCcjg());
}
String maxTimeStr = "";
List<LwKhclFileInfo> fileList = lwKhclFileInfoService.getList(createTime,sv.getXsxh());
for(LwKhclFileInfo fv: fileList){
int index = -1;
String fileType = fv.getFileType();
String uploadDateTimeStr = fv.getUploadDateTime();
if(maxTimeStr.equals("")){
maxTimeStr = uploadDateTimeStr;
}
Date uploadDateTime = DateUtil.parse(uploadDateTimeStr,"yyyy-MM-dd HH:mm:ss");
Date maxTime = DateUtil.parse(maxTimeStr,"yyyy-MM-dd HH:mm:ss");
if(maxTime.getTime() <= uploadDateTime.getTime()){
maxTimeStr = uploadDateTimeStr;
}
index = fileType.indexOf("开题报告审核");
if(index > -1){
lwKhcl.setKtbgshyj(fv.getFilePath());
continue;
}
index = fileType.indexOf("开题报告");
if(index > -1){
lwKhcl.setKtbg(fv.getFilePath());
continue;
}
index = fileType.indexOf("中期检查");
if(index > -1){
lwKhcl.setZqjc(fv.getFilePath());
continue;
}
index = fileType.indexOf("论文终稿");
if(index > -1){
if(fileType.toLowerCase().indexOf("doc")>-1){
lwKhcl.setLwzg(fv.getFilePath());
continue;
}
if(fileType.toLowerCase().indexOf("pdf")>-1){
lwKhcl.setLwzgPdf(fv.getFilePath());
continue;
}
}
index = fileType.indexOf("检测报告");
if(index > -1){
lwKhcl.setJcbgdcl(fv.getFilePath());
continue;
}
}
lwKhcl.setCreateTime(maxTimeStr);
lwKhclService.saveOrUpdate(lwKhcl);
}
}
/**
* 无参定时任务实现
*/
public void run(){
run(null);
}
}