修改bug

This commit is contained in:
yangjun 2024-05-24 15:32:07 +08:00
parent 31338c9b68
commit afc111a847
7 changed files with 135 additions and 5 deletions

View File

@ -20,6 +20,7 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.DateUtils;
import org.jeecg.common.util.SpringContextHolder;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.zyCcjg.service.IZyCcjgService;
import org.jeecg.modules.kc.zyInfo.entity.ZyInfo;
import org.jeecg.modules.kc.zyInfo.service.IZyInfoService;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
@ -67,6 +68,9 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@Autowired
private IZyInfoService zyInfoService;
@Autowired
private IZyCcjgService zyCcjgService;
@Value("${jeecg.path.upload}")
private String upLoadPath;
/**
@ -85,6 +89,10 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//查询作业查重结果
zyCcjgService.getCcjg();
QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfoStudent, req.getParameterMap());
Page<ZyInfoStudent> page = new Page<ZyInfoStudent>(pageNo, pageSize);
IPage<ZyInfoStudent> pageList = zyInfoStudentService.page(page, queryWrapper);
@ -260,4 +268,31 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
return Result.OK("编辑成功!");
}
@AutoLog(value = "设置作业存档类型")
@ApiOperation(value="设置作业存档类型", notes="设置作业存档类型")
@RequestMapping(value = "/editCdlx", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> editCdlx(@RequestBody ZyInfoStudent zyInfoStudent) {
UpdateWrapper<ZyInfoStudent> par = new UpdateWrapper<>();
par.eq("id",zyInfoStudent.getId());
par.set("cdlx",zyInfoStudent.getCdlx());
zyInfoStudentService.update(par);
return Result.OK("设置存档类型成功!");
}
@ApiOperation(value="获取存档信息", notes="获取存档信息")
@GetMapping(value = "/cdxxlist")
public Result<IPage<ZyInfoStudent>> cdxxlist(ZyInfoStudent zyInfoStudent,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfoStudent, req.getParameterMap());
queryWrapper.eq(StringUtils.isNotEmpty(zyInfoStudent.getTeacherNo()),"b.create_by",zyInfoStudent.getTeacherNo());
queryWrapper.like(StringUtils.isNotEmpty(zyInfoStudent.getZyname()),"b.title",zyInfoStudent.getZyname());
queryWrapper.isNotNull("cdlx");
Page<ZyInfoStudent> page = new Page<ZyInfoStudent>(pageNo, pageSize);
IPage<ZyInfoStudent> pageList = zyInfoStudentService.cdxxlist(page, queryWrapper);
return Result.OK(pageList);
}
}

View File

@ -86,6 +86,8 @@ public class ZyInfoStudent implements Serializable {
private java.lang.String score;
private java.lang.String pdfPath;
private String scoreFabu;
@Dict(dicCode = "cdlx")
private String cdlx;//存档类型
@TableField(exist = false)
private String catename;
@ -98,5 +100,8 @@ public class ZyInfoStudent implements Serializable {
private String nwcc;
@TableField(exist = false)
private String aigccc;
@TableField(exist = false)
private String zyname;
@TableField(exist = false)
private String teacherNo;
}

View File

@ -1,10 +1,12 @@
package org.jeecg.modules.kc.zyInfoStudent.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 学生提交作业
@ -15,4 +17,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface ZyInfoStudentMapper extends BaseMapper<ZyInfoStudent> {
void deleteMainId(@Param("mainId") String id);
IPage<ZyInfoStudent> cdxxlist(Page<ZyInfoStudent> page,@Param(Constants.WRAPPER) QueryWrapper<ZyInfoStudent> queryWrapper);
}

View File

@ -6,7 +6,13 @@
delete from zy_info_student where main_id = #{mainId}
</delete>
<select id="selectPage" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
select a.*,b.wwcc,b.nwcc,b.aigccc from zy_info_student a
select a.*,b.wwcc,b.nwcc,b.aigccc,b.title as zyname from zy_info_student a
left join zy_info b on a.main_id = b.id
${ew.customSqlSegment}
</select>
<select id="cdxxlist" resultType="org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent">
select a.*,b.wwcc,b.nwcc,b.aigccc,b.title as zyname from zy_info_student a
left join zy_info b on a.main_id = b.id
${ew.customSqlSegment}
</select>

View File

@ -1,5 +1,8 @@
package org.jeecg.modules.kc.zyInfoStudent.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.kc.zyInfoStudent.entity.ZyInfoStudent;
import com.baomidou.mybatisplus.extension.service.IService;
@ -18,4 +21,6 @@ public interface IZyInfoStudentService extends IService<ZyInfoStudent> {
public boolean updateById(ZyInfoStudent zyInfoStudent);
void editFabu(ZyInfoStudent zyInfoStudent);
IPage<ZyInfoStudent> cdxxlist(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper);
}

View File

@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
@ -124,6 +126,11 @@ public class ZyInfoStudentServiceImpl extends ServiceImpl<ZyInfoStudentMapper, Z
baseMapper.updateById(zyInfoStudent);
}
@Override
public IPage<ZyInfoStudent> cdxxlist(Page<ZyInfoStudent> page, QueryWrapper<ZyInfoStudent> queryWrapper) {
return baseMapper.cdxxlist(page,queryWrapper);
}
//aigc提交
private void aigcSave(ZyInfoStudent zyInfoStudent) {
String url = "https://vims.fanyu.com/tool/AIGCCheck/paperSubmit";

View File

@ -285,4 +285,72 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
return Result.OK("引用成功!");
}
@AutoLog(value = "教学大纲-上传附件")
@ApiOperation(value="教学大纲-上传附件", notes="教学大纲-上传附件")
@PostMapping(value = "/jxdgScfj")
public Result<ZyJxdg> jxdgScfj(@RequestBody ZyJxdg zyJxdg) {
if(StringUtils.isNotEmpty(zyJxdg.getFilePath())){
String nameLast = zyJxdg.getFilePath().substring(zyJxdg.getFilePath().lastIndexOf(".")+1);
if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setPdfPath(zyJxdg.getFilePath());
}else{
Global global = SpringContextHolder.getBean(Global.class);
FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath();
String namePath = dd + ".pdf";
String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath,pdfPath);
zyJxdg.setPdfPath("contract/"+namePath);
}
}else{
zyJxdg.setPdfPath(null);
}
if(StringUtils.isEmpty(zyJxdg.getId())){
zyJxdgService.save(zyJxdg);
}else{
UpdateWrapper<ZyJxdg> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("file_path",zyJxdg.getFilePath());
updateWrapper.set("pdf_path",zyJxdg.getPdfPath());
updateWrapper.eq("id",zyJxdg.getId());
zyJxdgService.update(updateWrapper);
}
return Result.OK(zyJxdg);
}
@AutoLog(value = "教学日历-上传附件")
@ApiOperation(value="教学日历-上传附件", notes="教学日历-上传附件")
@PostMapping(value = "/jxrlScfj")
public Result<ZyJxdg> jxrlScfj(@RequestBody ZyJxdg zyJxdg) {
if(StringUtils.isNotEmpty(zyJxdg.getJxrlFilePath())){
String nameLast = zyJxdg.getJxrlFilePath().substring(zyJxdg.getJxrlFilePath().lastIndexOf(".")+1);
if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setJxrlPdfPath(zyJxdg.getJxrlFilePath());
}else{
Global global = SpringContextHolder.getBean(Global.class);
FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String docPath = upLoadPath+ File.separator+ zyJxdg.getJxrlFilePath();
String namePath = dd + ".pdf";
String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath,pdfPath);
zyJxdg.setJxrlPdfPath("contract/"+namePath);
}
}else{
zyJxdg.setJxrlPdfPath(null);
}
if(StringUtils.isEmpty(zyJxdg.getId())){
zyJxdgService.save(zyJxdg);
}else{
UpdateWrapper<ZyJxdg> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("jxrl_file_path",zyJxdg.getJxrlFilePath());
updateWrapper.set("jxrl_pdf_path",zyJxdg.getJxrlPdfPath());
updateWrapper.eq("id",zyJxdg.getId());
zyJxdgService.update(updateWrapper);
}
return Result.OK(zyJxdg);
}
}