修改小组提交报错的问题
This commit is contained in:
parent
251c5ff791
commit
d64edd51ef
|
@ -337,18 +337,22 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
||||||
|
|
||||||
ZyInfoStudent zyInfoStudentPar = zyInfoStudentService.getById(zyInfoStudent.getId());
|
ZyInfoStudent zyInfoStudentPar = zyInfoStudentService.getById(zyInfoStudent.getId());
|
||||||
if(StringUtils.isNotEmpty(score)){
|
if(StringUtils.isNotEmpty(score)){
|
||||||
ZyInfo zyInfo = zyInfoService.getKechengById(zyInfoStudentPar.getMainId());
|
try {
|
||||||
//作业代办提醒
|
ZyInfo zyInfo = zyInfoService.getKechengById(zyInfoStudentPar.getMainId());
|
||||||
ZyDbtx zyDbtx = new ZyDbtx();
|
//作业代办提醒
|
||||||
zyDbtx.setCreateBy(zyInfoStudentPar.getCreateBy());
|
ZyDbtx zyDbtx = new ZyDbtx();
|
||||||
zyDbtx.setType("1");//0发布作业 1评分 2测验 3问卷 4讨论
|
zyDbtx.setCreateBy(zyInfoStudentPar.getCreateBy());
|
||||||
zyDbtx.setMainId(zyInfoStudentPar.getId());
|
zyDbtx.setType("1");//0发布作业 1评分 2测验 3问卷 4讨论
|
||||||
zyDbtx.setRwbh(zyInfo.getRwbh());
|
zyDbtx.setMainId(zyInfoStudentPar.getId());
|
||||||
zyDbtx.setContent(" ["+zyInfo.getKcmc()+"] "+zyInfo.getSkjs()+" 对作业进行了评分,请及时查看!");
|
zyDbtx.setRwbh(zyInfo.getRwbh());
|
||||||
zyDbtx.setFlag("0");
|
zyDbtx.setContent(" ["+zyInfo.getKcmc()+"] "+zyInfo.getSkjs()+" 对作业进行了评分,请及时查看!");
|
||||||
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
zyDbtx.setFlag("0");
|
||||||
zyDbtx.setFbr(user.getUsername());
|
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
zyDbtxService.save(zyDbtx);
|
zyDbtx.setFbr(user.getUsername());
|
||||||
|
zyDbtxService.save(zyDbtx);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrappertt = new QueryWrapper<>();
|
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrappertt = new QueryWrapper<>();
|
||||||
|
@ -840,6 +844,124 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "学生作业上传")
|
||||||
|
@ApiOperation(value="学生作业上传", notes="学生作业上传")
|
||||||
|
@RequestMapping(value = "/zyscStuBatch", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<Object> zyscStuBatch(@RequestBody ZyInfoStudent zyInfoStudent, HttpServletResponse response) {
|
||||||
|
|
||||||
|
//20241107新增判断,看原来是否有数据,防止重复添加
|
||||||
|
QueryWrapper<ZyInfoStudent> zyInfoStudentQueryWrapper = new QueryWrapper<>();
|
||||||
|
zyInfoStudentQueryWrapper.eq("a.create_by",zyInfoStudent.getStuId());
|
||||||
|
zyInfoStudentQueryWrapper.eq("a.main_id",zyInfoStudent.getMainId());
|
||||||
|
zyInfoStudentQueryWrapper.last("limit 1");
|
||||||
|
ZyInfoStudent stuPar = zyInfoStudentService.getOne(zyInfoStudentQueryWrapper);
|
||||||
|
ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId());
|
||||||
|
SysUser user = sysUserService.getUserByName(zyInfoStudent.getStuId());
|
||||||
|
if(stuPar==null) {
|
||||||
|
|
||||||
|
ZyInfoStudent zyInfoStudent1 = new ZyInfoStudent();
|
||||||
|
zyInfoStudent1.setMainId(zyInfo.getId());
|
||||||
|
zyInfoStudent1.setCreateBy(user.getUsername());
|
||||||
|
zyInfoStudent1.setCreateTime(new Date());
|
||||||
|
zyInfoStudent1.setFilePath(zyInfoStudent.getFilePath());
|
||||||
|
zyInfoStudent1.setStudentName(user.getRealname());
|
||||||
|
zyInfoStudentService.save(zyInfoStudent1);
|
||||||
|
stuPar =zyInfoStudent1;
|
||||||
|
zyInfoStudent =zyInfoStudent1;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
// if(StringUtils.isNotEmpty(stuPar.getFilePath())){
|
||||||
|
// return Result.error("您已上传了作业,请刷新后尝试");
|
||||||
|
// }
|
||||||
|
stuPar.setFilePath(zyInfoStudent.getFilePath());
|
||||||
|
|
||||||
|
zyInfoStudent =stuPar;
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断是否可以取消代办xshpkg
|
||||||
|
if(StringUtils.equals("0",zyInfo.getXshpkg())){
|
||||||
|
UpdateWrapper<ZyDbtx> zyDbtx = new UpdateWrapper<>();
|
||||||
|
zyDbtx.set("flag","1");
|
||||||
|
zyDbtx.eq("main_id",zyInfo.getId());
|
||||||
|
zyDbtx.eq("create_by",stuPar.getCreateBy());
|
||||||
|
zyDbtx.eq("type","0");
|
||||||
|
zyDbtxService.update(zyDbtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<ZyInfoStudentHp> zyInfoStudentHpQueryWrapper3 = new QueryWrapper<>();
|
||||||
|
zyInfoStudentHpQueryWrapper3.eq("main_id",stuPar.getMainId());
|
||||||
|
zyInfoStudentHpQueryWrapper3.eq("stu_id",stuPar.getCreateBy());
|
||||||
|
List<ZyInfoStudentHp> list3 = zyInfoStudentHpService.list(zyInfoStudentHpQueryWrapper3);
|
||||||
|
if(list3.size()>4){
|
||||||
|
UpdateWrapper<ZyDbtx> zyDbtx = new UpdateWrapper<>();
|
||||||
|
zyDbtx.set("flag","1");
|
||||||
|
zyDbtx.eq("main_id",stuPar.getMainId());
|
||||||
|
zyDbtx.eq("create_by",stuPar.getCreateBy());
|
||||||
|
zyDbtx.eq("type","0");
|
||||||
|
zyDbtxService.update(zyDbtx);
|
||||||
|
}
|
||||||
|
|
||||||
|
String nameLast = zyInfoStudent.getFilePath().substring(zyInfoStudent.getFilePath().lastIndexOf(".")+1);
|
||||||
|
if(StringUtils.equals("pdf",nameLast)){
|
||||||
|
zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath());
|
||||||
|
}else if(StringUtils.equals("doc",nameLast) || StringUtils.equals("docx",nameLast)){
|
||||||
|
if(StringUtils.equals("local",uploadType)){
|
||||||
|
Global global = SpringContextHolder.getBean(Global.class);
|
||||||
|
FileUtil.mkdir(global.getContractDickPath());
|
||||||
|
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
|
||||||
|
String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath();
|
||||||
|
String namePath = dd + ".pdf";
|
||||||
|
String pdfPath = global.getContractDickPath() + namePath;
|
||||||
|
System.out.println("filPath:"+zyInfoStudent.getFilePath());
|
||||||
|
System.out.println("docPath:"+docPath);
|
||||||
|
System.out.println("pdfPath:"+pdfPath);
|
||||||
|
PDFUtil.office2PDF(docPath,pdfPath);
|
||||||
|
zyInfoStudent.setPdfPath("contract/"+namePath);
|
||||||
|
}else{
|
||||||
|
ZykInfo zykInfo = new ZykInfo();
|
||||||
|
zykInfo.setBizId(zyInfoStudent.getId());
|
||||||
|
zykInfo.setBizTable("zy_jxdg");
|
||||||
|
zykInfo.setWjlx(WjlxEnum.JXDG.getType());
|
||||||
|
zykInfo.setRwbh(zyInfo.getRwbh());
|
||||||
|
zykInfo.setFileName(zyInfoStudent.getFilePath());
|
||||||
|
Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
|
||||||
|
String fileName = map.get("data");
|
||||||
|
String pdfName = map.get("pdfData");
|
||||||
|
zyInfoStudent.setFilePath(fileName);
|
||||||
|
zyInfoStudent.setPdfPath(pdfName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
zyInfoStudent.setPublishTime(new Date());
|
||||||
|
boolean bol = zyInfoStudentService.updateById(zyInfoStudent, response);
|
||||||
|
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);
|
||||||
|
try {
|
||||||
|
//作业代办提醒
|
||||||
|
ZyDbtx zyDbtx = new ZyDbtx();
|
||||||
|
zyDbtx.setCreateBy(zyInfo.getCreateBy());
|
||||||
|
zyDbtx.setType("5");//0发布作业 1评分 2测验 3问卷 4讨论 5学生提交作业 6学生提交测验 7学生提交问卷
|
||||||
|
zyDbtx.setMainId(zyInfo.getId());
|
||||||
|
zyDbtx.setRwbh(zyInfo.getRwbh());
|
||||||
|
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);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.OK(zyInfoStudent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@AutoLog(value = "学生作业开始检测")
|
@AutoLog(value = "学生作业开始检测")
|
||||||
@ApiOperation(value="学生作业开始检测", notes="学生作业开始检测")
|
@ApiOperation(value="学生作业开始检测", notes="学生作业开始检测")
|
||||||
@RequestMapping(value = "/stuWpKsjc", method = {RequestMethod.PUT,RequestMethod.POST})
|
@RequestMapping(value = "/stuWpKsjc", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
|
|
@ -189,9 +189,9 @@ jeecg:
|
||||||
app: http://localhost:8051
|
app: http://localhost:8051
|
||||||
path:
|
path:
|
||||||
#文件上传根目录 设置
|
#文件上传根目录 设置
|
||||||
upload: /data/jeecg-boot/upload
|
upload: /data/opt/jeecg-boot/upload
|
||||||
#webapp文件路径
|
#webapp文件路径
|
||||||
webapp: /data/jeecg-boot/webapp
|
webapp: /data/opt/jeecg-boot/webapp
|
||||||
shiro:
|
shiro:
|
||||||
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo
|
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo
|
||||||
#阿里云oss存储和大鱼短信秘钥配置
|
#阿里云oss存储和大鱼短信秘钥配置
|
||||||
|
|
Loading…
Reference in New Issue