修改bug

This commit is contained in:
yangjun 2024-05-27 15:03:58 +08:00
parent f28653e020
commit 78e307e262
5 changed files with 147 additions and 131 deletions

View File

@ -3,7 +3,7 @@
<mapper namespace="org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper"> <mapper namespace="org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmlbMapper">
<select id="distinctList" resultType="org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb"> <select id="distinctList" resultType="org.jeecg.modules.kc.wjxWjxxTmlb.entity.WjxWjxxTmlb">
select distinct max(id) id,wj_title,wj_score,wj_sytype,wj_type from wjx_wjxx_tmlb select distinct max(id) id,wj_title,wj_score,wj_sytype,wj_type,wj_answer from wjx_wjxx_tmlb
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>

View File

@ -84,6 +84,11 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
@Value("${jeecg.path.upload}") @Value("${jeecg.path.upload}")
private String upLoadPath; private String upLoadPath;
@Value(value="${jeecg.uploadType}")
private String uploadType;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -262,37 +267,34 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath()); zyInfoStudent.setPdfPath(zyInfoStudent.getFilePath());
}else{ }else{
// Global global = SpringContextHolder.getBean(Global.class); if(StringUtils.equals("local",uploadType)){
// FileUtil.mkdir(global.getContractDickPath()); Global global = SpringContextHolder.getBean(Global.class);
// String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); FileUtil.mkdir(global.getContractDickPath());
// String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath(); String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
// String namePath = dd + ".pdf"; String docPath = upLoadPath+ File.separator+ zyInfoStudent.getFilePath();
// String pdfPath = global.getContractDickPath() + namePath; String namePath = dd + ".pdf";
// System.out.println("filPath:"+zyInfoStudent.getFilePath()); String pdfPath = global.getContractDickPath() + namePath;
// System.out.println("docPath:"+docPath); System.out.println("filPath:"+zyInfoStudent.getFilePath());
// System.out.println("pdfPath:"+pdfPath); System.out.println("docPath:"+docPath);
// PDFUtil.office2PDF(docPath,pdfPath); System.out.println("pdfPath:"+pdfPath);
// zyInfoStudent.setPdfPath("contract/"+namePath); PDFUtil.office2PDF(docPath,pdfPath);
zyInfoStudent.setPdfPath("contract/"+namePath);
}else{
ZykInfo zykInfo = new ZykInfo(); ZykInfo zykInfo = new ZykInfo();
zykInfo.setBizId(zyInfoStudent.getId()); zykInfo.setBizId(zyInfoStudent.getId());
zykInfo.setBizTable("zy_jxdg"); zykInfo.setBizTable("zy_jxdg");
zykInfo.setWjlx(WjlxEnum.JXDG.getType()); zykInfo.setWjlx(WjlxEnum.JXDG.getType());
zykInfo.setRwbh(zyInfo.getRwbh()); zykInfo.setRwbh(zyInfo.getRwbh());
zykInfo.setFileName(zyInfoStudent.getFilePath()); zykInfo.setFileName(zyInfoStudent.getFilePath());
Map<String,String> map = zykService.saveToZykJxdg(zykInfo); Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
String fileName = map.get("data"); String fileName = map.get("data");
String pdfName = map.get("pdfData"); String pdfName = map.get("pdfData");
zyInfoStudent.setFilePath(fileName); zyInfoStudent.setFilePath(fileName);
zyInfoStudent.setPdfPath(pdfName); zyInfoStudent.setPdfPath(pdfName);
}
} }
zyInfoStudentService.updateById(zyInfoStudent); zyInfoStudentService.updateById(zyInfoStudent);
//作业代办提醒 //作业代办提醒
ZyDbtx zyDbtx = new ZyDbtx(); ZyDbtx zyDbtx = new ZyDbtx();
zyDbtx.setCreateBy(zyInfo.getCreateBy()); zyDbtx.setCreateBy(zyInfo.getCreateBy());

View File

@ -62,6 +62,10 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
private String upLoadPath; private String upLoadPath;
@Autowired @Autowired
private IZykService zykService; private IZykService zykService;
@Value(value="${jeecg.uploadType}")
private String uploadType;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -107,17 +111,20 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setPdfPath(zyJxdg.getFilePath()); zyJxdg.setPdfPath(zyJxdg.getFilePath());
}else{ }else{
Global global = SpringContextHolder.getBean(Global.class);
FileUtil.mkdir(global.getContractDickPath()); if(StringUtils.equals("local",uploadType)){
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); Global global = SpringContextHolder.getBean(Global.class);
String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath(); FileUtil.mkdir(global.getContractDickPath());
String namePath = dd + ".pdf"; String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String pdfPath = global.getContractDickPath() + namePath; String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath();
System.out.println("filPath:"+zyJxdg.getFilePath()); String namePath = dd + ".pdf";
System.out.println("docPath:"+docPath); String pdfPath = global.getContractDickPath() + namePath;
System.out.println("pdfPath:"+pdfPath); PDFUtil.office2PDF(docPath,pdfPath);
PDFUtil.office2PDF(docPath,pdfPath); zyJxdg.setPdfPath("contract/"+namePath);
zyJxdg.setPdfPath("contract/"+namePath); }else{
}
} }
}else if(StringUtils.isNotEmpty(zyJxdg.getJxrlFilePath())){ }else if(StringUtils.isNotEmpty(zyJxdg.getJxrlFilePath())){
@ -126,14 +133,20 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setJxrlPdfPath(zyJxdg.getJxrlFilePath()); zyJxdg.setJxrlPdfPath(zyJxdg.getJxrlFilePath());
}else{ }else{
Global global = SpringContextHolder.getBean(Global.class);
FileUtil.mkdir(global.getContractDickPath()); if(StringUtils.equals("local",uploadType)){
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); Global global = SpringContextHolder.getBean(Global.class);
String docPath = upLoadPath+ File.separator+ zyJxdg.getJxrlFilePath(); FileUtil.mkdir(global.getContractDickPath());
String namePath = dd + ".pdf"; String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String pdfPath = global.getContractDickPath() + namePath; String docPath = upLoadPath+ File.separator+ zyJxdg.getJxrlFilePath();
PDFUtil.office2PDF(docPath,pdfPath); String namePath = dd + ".pdf";
zyJxdg.setJxrlPdfPath("contract/"+namePath); String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath,pdfPath);
zyJxdg.setJxrlPdfPath("contract/"+namePath);
}else{
}
} }
} }
@ -170,17 +183,22 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
update.set("file_path",zyJxdg.getFilePath()); update.set("file_path",zyJxdg.getFilePath());
update.set("pdf_path",zyJxdg.getFilePath()); update.set("pdf_path",zyJxdg.getFilePath());
}else{ }else{
Global global = SpringContextHolder.getBean(Global.class);
FileUtil.mkdir(global.getContractDickPath()); if(StringUtils.equals("local",uploadType)) {
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); Global global = SpringContextHolder.getBean(Global.class);
String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath(); FileUtil.mkdir(global.getContractDickPath());
String namePath = dd + ".pdf"; String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
String pdfPath = global.getContractDickPath() + namePath; String docPath = upLoadPath + File.separator + zyJxdg.getFilePath();
System.out.println("filPath:"+zyJxdg.getFilePath()); String namePath = dd + ".pdf";
System.out.println("docPath:"+docPath); String pdfPath = global.getContractDickPath() + namePath;
System.out.println("pdfPath:"+pdfPath); System.out.println("filPath:" + zyJxdg.getFilePath());
PDFUtil.office2PDF(docPath,pdfPath); System.out.println("docPath:" + docPath);
zyJxdg.setPdfPath("contract/"+namePath); System.out.println("pdfPath:" + pdfPath);
PDFUtil.office2PDF(docPath, pdfPath);
zyJxdg.setPdfPath("contract/" + namePath);
}else {
}
update.set("file_path",zyJxdg.getFilePath()); update.set("file_path",zyJxdg.getFilePath());
update.set("pdf_path",zyJxdg.getPdfPath()); update.set("pdf_path",zyJxdg.getPdfPath());
@ -193,14 +211,18 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
update.set("jxrl_file_path",zyJxdg.getJxrlFilePath()); update.set("jxrl_file_path",zyJxdg.getJxrlFilePath());
update.set("jxrl_pdf_path",zyJxdg.getJxrlFilePath()); update.set("jxrl_pdf_path",zyJxdg.getJxrlFilePath());
}else{ }else{
Global global = SpringContextHolder.getBean(Global.class); if(StringUtils.equals("local",uploadType)) {
FileUtil.mkdir(global.getContractDickPath()); Global global = SpringContextHolder.getBean(Global.class);
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); FileUtil.mkdir(global.getContractDickPath());
String docPath = upLoadPath+ File.separator+ zyJxdg.getJxrlFilePath(); String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
String namePath = dd + ".pdf"; String docPath = upLoadPath + File.separator + zyJxdg.getJxrlFilePath();
String pdfPath = global.getContractDickPath() + namePath; String namePath = dd + ".pdf";
PDFUtil.office2PDF(docPath,pdfPath); String pdfPath = global.getContractDickPath() + namePath;
zyJxdg.setJxrlPdfPath("contract/"+namePath); PDFUtil.office2PDF(docPath, pdfPath);
zyJxdg.setJxrlPdfPath("contract/" + namePath);
}else {
}
update.set("jxrl_file_path",zyJxdg.getJxrlFilePath()); update.set("jxrl_file_path",zyJxdg.getJxrlFilePath());
update.set("jxrl_pdf_path",zyJxdg.getJxrlPdfPath()); update.set("jxrl_pdf_path",zyJxdg.getJxrlPdfPath());
@ -323,50 +345,37 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setPdfPath(zyJxdg.getFilePath()); zyJxdg.setPdfPath(zyJxdg.getFilePath());
}else{ }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 docPath = zyJxdg.getFilePath();
// String namePath = dd + ".pdf";
// String pdfPath = global.getContractDickPath() + namePath;
// Map<String,String> map = zykService.downloadRemoteFile(docPath);
// PDFUtil.office2PDF(map.get("data"),pdfPath);
// zyJxdg.setPdfPath("contract/"+namePath);
ZykInfo zykInfo = new ZykInfo(); if(StringUtils.equals("local",uploadType)) {
zykInfo.setBizId(zyJxdg.getId()); Global global = SpringContextHolder.getBean(Global.class);
zykInfo.setBizTable("zy_jxdg"); FileUtil.mkdir(global.getContractDickPath());
zykInfo.setWjlx(WjlxEnum.JXDG.getType()); String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
zykInfo.setRwbh(zyJxdg.getRwbh()); // String docPath = zyJxdg.getFilePath();
zykInfo.setFileName(zyJxdg.getFilePath()); String docPath = upLoadPath + File.separator + zyJxdg.getFilePath();
Map<String,String> map = zykService.saveToZykJxdg(zykInfo); String namePath = dd + ".pdf";
String fileName = map.get("data"); String pdfPath = global.getContractDickPath() + namePath;
String pdfName = map.get("pdfData"); // Map<String, String> map = zykService.downloadRemoteFile(docPath);
zyJxdg.setFilePath(fileName); PDFUtil.office2PDF(docPath, pdfPath);
zyJxdg.setPdfPath(pdfName); zyJxdg.setPdfPath("contract/" + namePath);
}else {
ZykInfo zykInfo = new ZykInfo();
zykInfo.setBizId(zyJxdg.getId());
zykInfo.setBizTable("zy_jxdg");
zykInfo.setWjlx(WjlxEnum.JXDG.getType());
zykInfo.setRwbh(zyJxdg.getRwbh());
zykInfo.setFileName(zyJxdg.getFilePath());
Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
String fileName = map.get("data");
String pdfName = map.get("pdfData");
zyJxdg.setFilePath(fileName);
zyJxdg.setPdfPath(pdfName);
}
} }
}else{ }else{
zyJxdg.setPdfPath(null); zyJxdg.setPdfPath(null);
} }
//--------上传ftp工具---------------
// Map<String,String> saveToZyk(ZykInfo zykInfo);
// if(StringUtils.isNotEmpty(zyJxdg.getFilePath())){
// ZykInfo zykInfo = new ZykInfo();
// 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());
// Map<String,String> map = zykService.saveToZyk(zykInfo);
// String fileName = map.get("data");
// String pdfName = map.get("pdfData");
// zyJxdg.setFilePath(fileName);
// zyJxdg.setPdfPath(pdfName);
// }
//--------上传ftp工具---------------
if(isAdd){ if(isAdd){
zyJxdgService.save(zyJxdg); zyJxdgService.save(zyJxdg);
@ -390,28 +399,32 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
if(StringUtils.equals("pdf",nameLast)){ if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setJxrlPdfPath(zyJxdg.getJxrlFilePath()); zyJxdg.setJxrlPdfPath(zyJxdg.getJxrlFilePath());
}else{ }else{
// Global global = SpringContextHolder.getBean(Global.class);
// FileUtil.mkdir(global.getContractDickPath()); if(StringUtils.equals("local",uploadType)) {
// String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss"); Global global = SpringContextHolder.getBean(Global.class);
// String docPath = upLoadPath+ File.separator+ zyJxdg.getJxrlFilePath(); FileUtil.mkdir(global.getContractDickPath());
// String namePath = dd + ".pdf"; String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
// String pdfPath = global.getContractDickPath() + namePath; String docPath = upLoadPath + File.separator + zyJxdg.getJxrlFilePath();
// PDFUtil.office2PDF(docPath,pdfPath); String namePath = dd + ".pdf";
// zyJxdg.setJxrlPdfPath("contract/"+namePath); String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath, pdfPath);
zyJxdg.setJxrlPdfPath("contract/" + namePath);
}else{
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());
Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
String fileName = map.get("data");
String pdfName = map.get("pdfData");
zyJxdg.setJxrlFilePath(fileName);
zyJxdg.setJxrlPdfPath(pdfName);
}
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());
Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
String fileName = map.get("data");
String pdfName = map.get("pdfData");
zyJxdg.setJxrlFilePath(fileName);
zyJxdg.setJxrlPdfPath(pdfName);
} }
}else{ }else{

View File

@ -136,6 +136,7 @@ spring:
url: jdbc:mysql://127.0.0.1:3306/course_information_center_jeecg_db?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai url: jdbc:mysql://127.0.0.1:3306/course_information_center_jeecg_db?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root username: root
password: root password: root
# password: ABCabc@123
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置 # 多数据源配置
# multi-oracle: # multi-oracle:
@ -176,8 +177,8 @@ jeecg:
# 签名拦截接口 # 签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
#local、minio、alioss #local、minio、alioss
# uploadType: local uploadType: local
uploadType: sftp # uploadType: sftp
# 前端访问地址 # 前端访问地址
domainUrl: domainUrl:
pc: http://localhost:3100 pc: http://localhost:3100

View File

@ -175,8 +175,8 @@ jeecg:
# 签名拦截接口 # 签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
#local\minio\alioss #local\minio\alioss
# uploadType: local uploadType: local
uploadType: sftp # uploadType: sftp
# 前端访问地址 # 前端访问地址
domainUrl: domainUrl:
pc: http://210.47.17.166 pc: http://210.47.17.166
@ -347,10 +347,10 @@ wjx:
url: https://www.wjx.cn/openapi/default.aspx url: https://www.wjx.cn/openapi/default.aspx
#SFTP #SFTP
sftp: sftp:
hostname: 192.168.2.200 hostname: 210.47.29.99
port: 22 port: 22
username: sftp username: sftp
password: sftp password: Nenujwc@99
timeout: 1000 timeout: 1000
uploadpath: /kczx uploadpath: /kczx
fullpath: /home/sftp fullpath: /home/sftp