修改bug

This commit is contained in:
yangjun 2024-07-20 15:03:04 +08:00
parent e049a36116
commit 664767407f
7 changed files with 65 additions and 21 deletions

View File

@ -1,20 +1,16 @@
package org.jeecg.modules.kc.detection.entity; package org.jeecg.modules.kc.detection.entity;
import java.io.Serializable; import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date; import java.util.Date;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.Data; import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao; import org.jeecg.modules.kc.ktgl.entity.KcKetangbiao;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;

View File

@ -117,6 +117,14 @@ public class KcTeachingUnitContentThreeController extends JeecgController<KcTeac
zykInfo.setFileName(kcTeachingUnitContentThree.getFilePath()); zykInfo.setFileName(kcTeachingUnitContentThree.getFilePath());
Map<String,String> map = zykService.saveToZykJxdg(zykInfo); Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
zykService.disConnect(); zykService.disConnect();
}else{
ZykInfo zykInfo = new ZykInfo();
zykInfo.setBizId(kcTeachingUnitContentThree.getId());
zykInfo.setBizTable("kc_teaching_unit_content_three");
zykInfo.setWjlx(WjlxEnum.JXDY.getType());
zykInfo.setRwbh(kcTeachingUnitContentThree.getRwbh());
zykInfo.setFileName(kcTeachingUnitContentThree.getFilePath());
zykService.saveLocal(zykInfo);
} }

View File

@ -126,6 +126,19 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfoStudent, req.getParameterMap()); QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfoStudent, req.getParameterMap());
Page<ZyInfoStudent> page = new Page<ZyInfoStudent>(pageNo, pageSize); Page<ZyInfoStudent> page = new Page<ZyInfoStudent>(pageNo, pageSize);
if(StringUtils.isNotEmpty(zyInfoStudent.getQueryType())){
if(StringUtils.equals("1",zyInfoStudent.getQueryType())){//未提交
queryWrapper.isNull("a.file_path");
}else if(StringUtils.equals("2",zyInfoStudent.getQueryType())){//已提交
queryWrapper.isNotNull("a.file_path");
}else if(StringUtils.equals("3",zyInfoStudent.getQueryType())){//未评阅
queryWrapper.isNull("a.score");
}else if(StringUtils.equals("4",zyInfoStudent.getQueryType())){//已评阅
queryWrapper.isNotNull("a.score");
}
}
IPage<ZyInfoStudent> pageList = zyInfoStudentService.page(page, queryWrapper); IPage<ZyInfoStudent> pageList = zyInfoStudentService.page(page, queryWrapper);
for(ZyInfoStudent ZyInfoStudentPar:pageList.getRecords()){ for(ZyInfoStudent ZyInfoStudentPar:pageList.getRecords()){
List<ZyInfoStudent> list = zyInfoStudentService.getCcjg(ZyInfoStudentPar); List<ZyInfoStudent> list = zyInfoStudentService.getCcjg(ZyInfoStudentPar);

View File

@ -171,4 +171,6 @@ public class ZyInfoStudent implements Serializable {
private String xxfilestateid;//学校状态 private String xxfilestateid;//学校状态
@TableField(exist = false) @TableField(exist = false)
private String xxmessage;//学校说明 private String xxmessage;//学校说明
@TableField(exist = false)
private String queryType;//作业状态查询
} }

View File

@ -351,51 +351,45 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
@ApiOperation(value="教学大纲-上传附件", notes="教学大纲-上传附件") @ApiOperation(value="教学大纲-上传附件", notes="教学大纲-上传附件")
@PostMapping(value = "/jxdgScfj") @PostMapping(value = "/jxdgScfj")
public Result<ZyJxdg> jxdgScfj(@RequestBody ZyJxdg zyJxdg) { public Result<ZyJxdg> jxdgScfj(@RequestBody ZyJxdg zyJxdg) {
System.out.println("------------教学大纲开始-----------------------");
boolean isAdd = false; boolean isAdd = false;
if(StringUtils.isEmpty(zyJxdg.getId())){ if(StringUtils.isEmpty(zyJxdg.getId())){
isAdd = true; isAdd = true;
zyJxdg.setId((new DefaultIdentifierGenerator().nextId(new ZyJxdg())).toString()); zyJxdg.setId((new DefaultIdentifierGenerator().nextId(new ZyJxdg())).toString());
} }
System.out.println("------------11111111111----------------");
if(StringUtils.isNotEmpty(zyJxdg.getFilePath())){ if(StringUtils.isNotEmpty(zyJxdg.getFilePath())){
System.out.println("------------22222222222222----------------");
String nameLast = zyJxdg.getFilePath().substring(zyJxdg.getFilePath().lastIndexOf(".")+1); String nameLast = zyJxdg.getFilePath().substring(zyJxdg.getFilePath().lastIndexOf(".")+1);
System.out.println("nameLast-----------》"+nameLast);
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
System.out.println("------------33333333333333333----------------");
zyJxdg.setPdfPath(zyJxdg.getFilePath()); zyJxdg.setPdfPath(zyJxdg.getFilePath());
}else{ }else{
System.out.println("uploadType-----------》"+global.uploadType);
if(StringUtils.equals("local",global.uploadType)) { if(StringUtils.equals("local",global.uploadType)) {
System.out.println("------------44444444444444444----------------");
FileUtil.mkdir(global.getContractDickPath()); FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss"); String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
// String docPath = zyJxdg.getFilePath();
String docPath = upLoadPath + File.separator + zyJxdg.getFilePath(); String docPath = upLoadPath + File.separator + zyJxdg.getFilePath();
System.out.println("docPath-----------》"+docPath);
String namePath = dd + ".pdf"; String namePath = dd + ".pdf";
String pdfPath = global.getContractDickPath() + namePath; String pdfPath = global.getContractDickPath() + namePath;
System.out.println("pdfPath-----------》"+pdfPath); System.out.println("pdfPath-----------》"+pdfPath);
// Map<String, String> map = zykService.downloadRemoteFile(docPath);
PDFUtil.office2PDF(docPath, pdfPath); PDFUtil.office2PDF(docPath, pdfPath);
System.out.println("------------5555555555----------------");
zyJxdg.setPdfPath("contract/" + namePath); zyJxdg.setPdfPath("contract/" + namePath);
System.out.println("------------666666666----------------"+zyJxdg.getPdfPath());
}else if(StringUtils.equals("sftp",global.uploadType)){ ZykInfo zykInfo = new ZykInfo();
System.out.println("------------7777777777777----------------"); zykInfo.setBizId(zyJxdg.getId());
zykInfo.setBizTable("zy_jxdg");
zykInfo.setWjlx(WjlxEnum.JXDG.getType());
zykInfo.setRwbh(zyJxdg.getRwbh());
zykInfo.setFileName(zyJxdg.getFilePath());
zykInfo.setPdfName(zyJxdg.getPdfPath());
zykService.saveLocal(zykInfo);
}else if(StringUtils.equals("sftp",global.uploadType)){
ZykInfo zykInfo = new ZykInfo(); ZykInfo zykInfo = new ZykInfo();
zykInfo.setBizId(zyJxdg.getId()); zykInfo.setBizId(zyJxdg.getId());
zykInfo.setBizTable("zy_jxdg"); zykInfo.setBizTable("zy_jxdg");
zykInfo.setWjlx(WjlxEnum.JXDG.getType()); zykInfo.setWjlx(WjlxEnum.JXDG.getType());
zykInfo.setRwbh(zyJxdg.getRwbh()); zykInfo.setRwbh(zyJxdg.getRwbh());
zykInfo.setFileName(zyJxdg.getFilePath()); zykInfo.setFileName(zyJxdg.getFilePath());
System.out.println("zykInfo------------>"+zykInfo);
Map<String,String> map = zykService.saveToZykJxdg(zykInfo); Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
System.out.println("map------------>"+map);
String fileName = map.get("data"); String fileName = map.get("data");
System.out.println("fileName------------>"+fileName);
String pdfName = map.get("pdfData"); String pdfName = map.get("pdfData");
System.out.println("pdfName------------>"+pdfName); System.out.println("pdfName------------>"+pdfName);
zyJxdg.setFilePath(fileName); zyJxdg.setFilePath(fileName);
@ -451,6 +445,18 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
String pdfPath = global.getContractDickPath() + namePath; String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath, pdfPath); PDFUtil.office2PDF(docPath, pdfPath);
zyJxdg.setJxrlPdfPath("contract/" + namePath); zyJxdg.setJxrlPdfPath("contract/" + namePath);
ZykInfo zykInfo = new ZykInfo();
zykInfo.setBizId(zyJxdg.getId());
zykInfo.setBizTable("zy_jxdg");
zykInfo.setWjlx(WjlxEnum.JXRL.getType());
zykInfo.setRwbh(zyJxdg.getRwbh());
zykInfo.setFileName(zyJxdg.getJxrlFilePath());
zykInfo.setPdfName(zyJxdg.getJxrlPdfPath());
zykService.saveLocal(zykInfo);
}else if(StringUtils.equals("sftp",uploadType)){ }else if(StringUtils.equals("sftp",uploadType)){
ZykInfo zykInfo = new ZykInfo(); ZykInfo zykInfo = new ZykInfo();
zykInfo.setBizId(zyJxdg.getId()); zykInfo.setBizId(zyJxdg.getId());

View File

@ -58,4 +58,5 @@ public interface IZykService extends IService<ZykInfo> {
void disConnect(); void disConnect();
void saveLocal(ZykInfo zykInfo);
} }

View File

@ -337,4 +337,22 @@ public class ZykServiceImpl extends ServiceImpl<ZykMapper, ZykInfo> implements I
public void disConnect(){ public void disConnect(){
fileHandleUtil.disConnect(); fileHandleUtil.disConnect();
} }
@Override
public void saveLocal(ZykInfo zykInfo) {
KcKechengbiao kcb = new KcKechengbiao();
kcb.setRwbh(zykInfo.getRwbh());
kcb = kcKechengbiaoService.getKcbhByRwbh(kcb);
zykInfo.setXqxn(kcb.getXqxn());
zykInfo.setKkdw(kcb.getKkdw());
zykInfo.setKcmc(kcb.getKcmc());
zykInfo.setSkjs(kcb.getSkjs());
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
zykInfo.setCreateBy(user.getUsername());
zykInfo.setCreateTime(new Date());
Long id = new DefaultIdentifierGenerator().nextId(new ZykInfo());
zykInfo.setId(id.toString());
zykMapper.addInfo(zykInfo);
}
} }