修改bug

This commit is contained in:
yangjun 2024-06-07 09:46:08 +08:00
parent 38283aa4bf
commit 5d529622e5
12 changed files with 132 additions and 12 deletions

View File

@ -26,7 +26,9 @@ import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.SftpConfig;
import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.kc.detection.entity.KcDetectionDetailed;
import org.jeecg.modules.kc.detection.entity.KcDetectionMain;
import org.jeecg.modules.kc.detection.service.IKcDetectionDetailedService;
import org.jeecg.modules.kc.detection.service.IKcDetectionMainService;
import org.jeecg.modules.kc.grab.SynchronizationService.tools.ChangeTingKeTongJi;
import org.jeecg.modules.kc.jiaoshi.entity.KcJiaoshirongliang;
@ -91,6 +93,8 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
@Autowired
private IKcDetectionMainService kcDetectionMainService;
@Autowired
private IKcDetectionDetailedService kcDetectionDetailedService;
@Autowired
private IZyJxdgService zyJxdgService;
@ -432,10 +436,31 @@ public class KcKetangbiaoController extends JeecgController<KcKetangbiao, IKcKet
kdmQw.apply("create_time >= '" + nowStr + " 00:00:00' and create_time <= '" + nowStr + " 23:59:59'");
kdmQw.lambda().eq(KcDetectionMain::getRwbh,rwbh);
kdmQw.lambda().eq(KcDetectionMain::getXnxq,xqxn);
// kdmQw.eq("id","1791360521757487106");
kdmQw.last("limit 1");
KcDetectionMain detectionMain = kcDetectionMainService.getOne(kdmQw);
kcKetangbiao.setDetectionMain(detectionMain);
try {
if(detectionMain!=null){
QueryWrapper<KcDetectionDetailed> rsQw = new QueryWrapper<>();
rsQw.eq("pid",detectionMain.getId());
rsQw.orderByDesc("create_time");
rsQw.last("limit 1");
KcDetectionDetailed kcDetectionDetailed = kcDetectionDetailedService.getOne(rsQw);
kcKetangbiao.setKcDetectionDetailed(kcDetectionDetailed);
QueryWrapper<KcDetectionDetailed> rsQwList = new QueryWrapper<>();
rsQwList.eq("pid",detectionMain.getId());
rsQwList.orderByDesc("create_time");
List<KcDetectionDetailed> zqrsList = kcDetectionDetailedService.list(rsQwList);
kcKetangbiao.setZqrsList(zqrsList);
}
}catch(Exception e){
e.printStackTrace();
}
return Result.OK(kcKetangbiao);
}

View File

@ -4,10 +4,12 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.kc.detection.entity.KcDetectionDetailed;
import org.jeecg.modules.kc.detection.entity.KcDetectionMain;
import org.jeecg.modules.kc.jiaoshi.entity.KcJiaoshirongliang;
import org.jeecg.modules.kc.zyJxdg.entity.ZyJxdg;
@ -348,6 +350,10 @@ public class KcKetangbiao implements Serializable {
@TableField(exist = false)
private KcDetectionMain detectionMain;
@TableField(exist = false)
private KcDetectionDetailed kcDetectionDetailed;
@TableField(exist = false)
private List<KcDetectionDetailed> zqrsList;
@TableField(exist = false)
private ZyJxdg zyJxdg;

View File

@ -179,7 +179,8 @@
kkdw,
kcxz,
szkc,
xqxn
xqxn,
rwbh
ORDER BY xqxn desc
</select>

View File

@ -2,9 +2,11 @@ package org.jeecg.modules.kc.wjxWjxx.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
@ -258,5 +260,18 @@ public class WjxWjxxController extends JeecgController<WjxWjxx, IWjxWjxxService>
return Result.OK(res);
}
@ApiOperation(value="统计分析", notes="统计分析")
@GetMapping(value = "/wjxxTjfx")
public Result<JSONObject> wjxxTjfx(@RequestParam(name="id",required=true) String id) {
JSONObject res = wjxWjxxService.wjxxTjfx(id);
return Result.OK(res);
}
@ApiOperation(value="问卷下载", notes="问卷下载")
@GetMapping(value = "/wjxxDownLoad")
public Result<JSONObject> wjxxDownLoad(@RequestParam(name="id",required=true) String id) {
JSONObject res = wjxWjxxService.wjxxDownLoad(id);
return Result.OK(res);
}
}

View File

@ -1,9 +1,12 @@
package org.jeecg.modules.kc.wjxWjxx.service;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Map;
/**
* @Description: 问卷信息
* @Author: jeecg-boot
@ -15,4 +18,8 @@ public interface IWjxWjxxService extends IService<WjxWjxx> {
Page<WjxWjxx> findStuPage(WjxWjxx wjxWjxx,Page<WjxWjxx> page);
WjxWjxx kcxx(String rwbh,String xqxn);
String fbwj(String id,String isKs);
JSONObject wjxxTjfx(String id);
JSONObject wjxxDownLoad(String id);
}

View File

@ -1,10 +1,14 @@
package org.jeecg.modules.kc.wjxWjxx.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxx;
import org.jeecg.modules.kc.wjxDjxx.entity.WjxDjxxTmxx;
import org.jeecg.modules.kc.wjxWjxx.entity.WjxWjxx;
import org.jeecg.modules.kc.wjxWjxx.mapper.WjxWjxxMapper;
import org.jeecg.modules.kc.wjxWjxx.service.IWjxWjxxService;
@ -16,6 +20,8 @@ import org.jeecg.modules.kc.wjxWjxxTmlb.mapper.WjxWjxxTmxxMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.time.temporal.ChronoUnit;
import java.util.*;
/**
@ -290,5 +296,31 @@ public class WjxWjxxServiceImpl extends ServiceImpl<WjxWjxxMapper, WjxWjxx> impl
return "发布成功!";
}
@Override
public JSONObject wjxxTjfx(String id) {
WjxWjxx wjxWjxx = baseMapper.selectById(id);
String vid = wjxWjxx.getVid();
Map<String,Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid));
//调用接口,提交
String result = wjxUtil.openapi(map,"1001101");
JSONObject jsonResult = JSONObject.parseObject(result);
return jsonResult;
}
@Override
public JSONObject wjxxDownLoad(String id) {
WjxWjxx wjxWjxx = baseMapper.selectById(id);
String vid = wjxWjxx.getVid();
Map<String,Object> map = new HashMap<>();
map.put("vid",Integer.valueOf(vid));
map.put("suffix",2);
//调用接口,提交
String result = wjxUtil.openapi(map,"1001004");
JSONObject jsonResult = JSONObject.parseObject(result);
return jsonResult;
}
}

View File

@ -83,6 +83,10 @@ public class ZyCcjgController extends JeecgController<ZyCcjg, IZyCcjgService> {
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//查询作业查重结果
zyCcjgService.getCcjg();
QueryWrapper<ZyCcjg> queryWrapper = QueryGenerator.initQueryWrapper("a",zyCcjg, req.getParameterMap());
if(StringUtils.isEmpty(zyCcjg.getFilestateid())){
queryWrapper.in("a.filestateid",1,3);

View File

@ -194,6 +194,8 @@ public class ZyCcjgServiceImpl extends ServiceImpl<ZyCcjgMapper, ZyCcjg> impleme
Map<String,String> map = new HashMap<String,String>();
map.put("success","false");
map.put("message",object.getString("message"));
zyCcjg.setMessage(object.getString("message"));
baseMapper.updateById(zyCcjg);
return map;
}
}
@ -286,6 +288,8 @@ public class ZyCcjgServiceImpl extends ServiceImpl<ZyCcjgMapper, ZyCcjg> impleme
Map<String,String> map = new HashMap<String,String>();
map.put("success","false");
map.put("message",object.getString("message"));
zyCcjg.setMessage(object.getString("message"));
baseMapper.updateById(zyCcjg);
return map;
}
}
@ -379,6 +383,8 @@ public class ZyCcjgServiceImpl extends ServiceImpl<ZyCcjgMapper, ZyCcjg> impleme
Map<String,String> map = new HashMap<String,String>();
map.put("success","false");
map.put("message",object.getString("message"));
zyCcjg.setMessage(object.getString("message"));
baseMapper.updateById(zyCcjg);
return map;
}
}
@ -472,6 +478,8 @@ public class ZyCcjgServiceImpl extends ServiceImpl<ZyCcjgMapper, ZyCcjg> impleme
Map<String,String> map = new HashMap<String,String>();
map.put("success","false");
map.put("message",object.getString("message"));
zyCcjg.setMessage(object.getString("message"));
baseMapper.updateById(zyCcjg);
return map;
}
}

View File

@ -185,6 +185,7 @@ public class ZyDbtxController extends JeecgController<ZyDbtx, IZyDbtxService> {
UpdateWrapper<ZyDbtx> zyDbtxDeleteMapping = new UpdateWrapper<>();
zyDbtxDeleteMapping.eq("rwbh", rwbh);
zyDbtxDeleteMapping.eq("create_by", sysUser.getUsername());
zyDbtxDeleteMapping.eq("fbr", zyDbtx.getFbr());
zyDbtxService.remove(zyDbtxDeleteMapping);
return Result.OK(null);
}

View File

@ -403,6 +403,7 @@ public class ZyInfoStudentController extends JeecgController<ZyInfoStudent, IZyI
QueryWrapper<ZyInfoStudent> queryWrapper = QueryGenerator.initQueryWrapper("a",zyInfoStudent, req.getParameterMap());
queryWrapper.eq(StringUtils.isNotEmpty(zyInfoStudent.getTeacherNo()),"b.create_by",zyInfoStudent.getTeacherNo());
queryWrapper.eq(StringUtils.isNotEmpty(zyInfoStudent.getRwbh()),"b.rwbh",zyInfoStudent.getRwbh());
queryWrapper.like(StringUtils.isNotEmpty(zyInfoStudent.getZyname()),"b.title",zyInfoStudent.getZyname());
queryWrapper.isNotNull("cdlx");
Page<ZyInfoStudent> page = new Page<ZyInfoStudent>(pageNo, pageSize);

View File

@ -117,6 +117,8 @@ public class ZyInfoStudent implements Serializable {
private String zyname;
@TableField(exist = false)
private String teacherNo;
@TableField(exist = false)
private String rwbh;
@TableField(exist = false)

View File

@ -66,6 +66,10 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
@Value(value="${jeecg.uploadType}")
private String uploadType;
@Autowired
private Global global;
/**
* 分页列表查询
*
@ -111,8 +115,7 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
if(StringUtils.equals("pdf",nameLast)){
zyJxdg.setPdfPath(zyJxdg.getFilePath());
}else{
if(StringUtils.equals("local",uploadType)){
Global global = SpringContextHolder.getBean(Global.class);
if(StringUtils.equals("local",global.uploadType)){
FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String docPath = upLoadPath+ File.separator+ zyJxdg.getFilePath();
@ -120,7 +123,7 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
String pdfPath = global.getContractDickPath() + namePath;
PDFUtil.office2PDF(docPath,pdfPath);
zyJxdg.setPdfPath("contract/"+namePath);
}else if(StringUtils.equals("sftp",uploadType)){
}else if(StringUtils.equals("sftp",global.uploadType)){
}
}
@ -131,8 +134,7 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
zyJxdg.setJxrlPdfPath(zyJxdg.getJxrlFilePath());
}else{
if(StringUtils.equals("local",uploadType)){
Global global = SpringContextHolder.getBean(Global.class);
if(StringUtils.equals("local",global.uploadType)){
FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(),"yyyyMMddHHmmss");
String docPath = upLoadPath+ File.separator+ zyJxdg.getJxrlFilePath();
@ -182,7 +184,6 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
update.set("pdf_path",zyJxdg.getFilePath());
}else{
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 + zyJxdg.getFilePath();
@ -208,7 +209,6 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
update.set("jxrl_pdf_path",zyJxdg.getJxrlFilePath());
}else{
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 + zyJxdg.getJxrlFilePath();
@ -331,47 +331,65 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
@ApiOperation(value="教学大纲-上传附件", notes="教学大纲-上传附件")
@PostMapping(value = "/jxdgScfj")
public Result<ZyJxdg> jxdgScfj(@RequestBody ZyJxdg zyJxdg) {
System.out.println("------------教学大纲开始-----------------------");
boolean isAdd = false;
if(StringUtils.isEmpty(zyJxdg.getId())){
isAdd = true;
zyJxdg.setId((new DefaultIdentifierGenerator().nextId(new ZyJxdg())).toString());
}
System.out.println("------------11111111111----------------");
if(StringUtils.isNotEmpty(zyJxdg.getFilePath())){
System.out.println("------------22222222222222----------------");
String nameLast = zyJxdg.getFilePath().substring(zyJxdg.getFilePath().lastIndexOf(".")+1);
System.out.println("nameLast-----------》"+nameLast);
if(StringUtils.equals("pdf",nameLast)){
System.out.println("------------33333333333333333----------------");
zyJxdg.setPdfPath(zyJxdg.getFilePath());
}else{
if(StringUtils.equals("local",uploadType)) {
Global global = SpringContextHolder.getBean(Global.class);
System.out.println("uploadType-----------》"+global.uploadType);
if(StringUtils.equals("local",global.uploadType)) {
System.out.println("------------44444444444444444----------------");
FileUtil.mkdir(global.getContractDickPath());
String dd = DateUtils.formatDate(new Date(), "yyyyMMddHHmmss");
// String docPath = zyJxdg.getFilePath();
String docPath = upLoadPath + File.separator + zyJxdg.getFilePath();
System.out.println("docPath-----------》"+docPath);
String namePath = dd + ".pdf";
String pdfPath = global.getContractDickPath() + namePath;
System.out.println("pdfPath-----------》"+pdfPath);
// Map<String, String> map = zykService.downloadRemoteFile(docPath);
PDFUtil.office2PDF(docPath, pdfPath);
System.out.println("------------5555555555----------------");
zyJxdg.setPdfPath("contract/" + namePath);
}else if(StringUtils.equals("sftp",uploadType)){
System.out.println("------------666666666----------------"+zyJxdg.getPdfPath());
}else if(StringUtils.equals("sftp",global.uploadType)){
System.out.println("------------7777777777777----------------");
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());
System.out.println("zykInfo------------>"+zykInfo);
Map<String,String> map = zykService.saveToZykJxdg(zykInfo);
System.out.println("map------------>"+map);
String fileName = map.get("data");
System.out.println("fileName------------>"+fileName);
String pdfName = map.get("pdfData");
System.out.println("pdfName------------>"+pdfName);
zyJxdg.setFilePath(fileName);
zyJxdg.setPdfPath(pdfName);
zykService.disConnect();
}
}
}else{
System.out.println("------------8888888888888----------------");
zyJxdg.setPdfPath(null);
}
System.out.println("------------99999999999999999----------------");
if(isAdd){
System.out.println("------------00000000000000000000----------------");
KcKechengbiao kcKechengbiao = new KcKechengbiao();
kcKechengbiao.setRwbh(zyJxdg.getRwbh());
kcKechengbiao.setXqxn(zyJxdg.getXqxn());
@ -384,6 +402,7 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
}
zyJxdgService.save(zyJxdg);
}else{
System.out.println("------------aaaaaaaaaaaaaaa----------------");
UpdateWrapper<ZyJxdg> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("file_path",zyJxdg.getFilePath());
updateWrapper.set("pdf_path",zyJxdg.getPdfPath());
@ -405,7 +424,6 @@ public class ZyJxdgController extends JeecgController<ZyJxdg, IZyJxdgService> {
}else{
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 + zyJxdg.getJxrlFilePath();