From f36b70b8b9a67b3e9c42eda6df22b690dbcb8dc9 Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Thu, 11 Jul 2024 22:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B90711=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../KcTeachingUnitContentThreeController.java | 38 ++++++++++++++++++- .../service/impl/ZyCcjgServiceImpl.java | 32 ++++++++++++---- .../modules/kc/zyInfo/entity/ZyInfo.java | 12 ++++++ .../kc/zyInfo/mapper/xml/ZyInfoMapper.xml | 7 ++-- .../controller/ZyInfoStudentController.java | 6 +-- 5 files changed, 78 insertions(+), 17 deletions(-) diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java index 0e51aed9..0d41d360 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/teachingunitcontent/controller/KcTeachingUnitContentThreeController.java @@ -1,6 +1,8 @@ package org.jeecg.modules.kc.teachingunitcontent.controller; +import java.io.File; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -9,8 +11,12 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import cn.hutool.core.io.FileUtil; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentOne; import org.jeecg.modules.kc.teachingunitcontent.entity.KcTeachingUnitContentThree; @@ -21,6 +27,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.tools.Global; +import org.jeecg.modules.tools.pdf.PDFUtil; +import org.jeecg.modules.zyk.entity.ZykInfo; +import org.jeecg.modules.zyk.service.IZykService; +import org.jeecg.modules.zyk.utils.WjlxEnum; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.ExportParams; @@ -28,6 +39,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; @@ -51,8 +63,17 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class KcTeachingUnitContentThreeController extends JeecgController { @Autowired private IKcTeachingUnitContentThreeService kcTeachingUnitContentThreeService; - - /** + + @Value("${jeecg.path.upload}") + private String upLoadPath; + @Autowired + private IZykService zykService; + @Autowired + private Global global; + @Value(value="${jeecg.uploadType}") + private String uploadType; + + /** * 分页列表查询 * * @param kcTeachingUnitContentThree @@ -86,6 +107,19 @@ public class KcTeachingUnitContentThreeController extends JeecgController add(@RequestBody KcTeachingUnitContentThree kcTeachingUnitContentThree) { kcTeachingUnitContentThreeService.save(kcTeachingUnitContentThree); + + if(StringUtils.equals("sftp",uploadType)){ + 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()); + Map map = zykService.saveToZykJxdg(zykInfo); + zykService.disConnect(); + } + + Result r = Result.OK("添加成功!"); r.setResult(kcTeachingUnitContentThree); return r; diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyCcjg/service/impl/ZyCcjgServiceImpl.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyCcjg/service/impl/ZyCcjgServiceImpl.java index 6f427055..8a961d82 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyCcjg/service/impl/ZyCcjgServiceImpl.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyCcjg/service/impl/ZyCcjgServiceImpl.java @@ -167,9 +167,9 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme baseMapper.updateById(zyCcjg); //----------计算通过率-------------- + String stuId = zyCcjg.getZyStuId(); + ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); if(StringUtils.equals("2",object2.getString("filestateid"))){ - String stuId = zyCcjg.getZyStuId(); - ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId()); Double tgl = 0.0; if(zyInfo.getAigctgl()>0){ @@ -186,6 +186,10 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme } zyInfoStudent.setAigcxsl(cctgl+""); zyInfoStudentService.updateById(zyInfoStudent); + }else if(StringUtils.equals("3",object2.getString("filestateid"))){ + zyInfoStudent.setWwsftg("失败:"+object.getString("message")); + }else{ + zyInfoStudent.setWwsftg("检测中"); } //----------计算通过率-------------- @@ -262,9 +266,9 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme baseMapper.updateById(zyCcjg); //----------计算通过率-------------- + String stuId = zyCcjg.getZyStuId(); + ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); if(StringUtils.equals("2",object2.getString("filestateid"))) { - String stuId = zyCcjg.getZyStuId(); - ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId()); Double tgl = 0.0; if (zyInfo.getWwtgl() > 0) { @@ -281,6 +285,10 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme } zyInfoStudent.setWwxsl(cctgl + ""); zyInfoStudentService.updateById(zyInfoStudent); + }else if(StringUtils.equals("3",object2.getString("filestateid"))){ + zyInfoStudent.setWwsftg("失败:"+object.getString("message")); + }else{ + zyInfoStudent.setWwsftg("检测中"); } //----------计算通过率-------------- @@ -357,9 +365,9 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme baseMapper.updateById(zyCcjg); //----------计算通过率-------------- + String stuId = zyCcjg.getZyStuId(); + ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); if(StringUtils.equals("2",object2.getString("filestateid"))) { - String stuId = zyCcjg.getZyStuId(); - ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId()); Double tgl = 0.0; if (zyInfo.getNwtgl() > 0) { @@ -376,6 +384,10 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme } zyInfoStudent.setNwxsl(cctgl + ""); zyInfoStudentService.updateById(zyInfoStudent); + }else if(StringUtils.equals("3",object2.getString("filestateid"))){ + zyInfoStudent.setWwsftg("失败:"+object.getString("message")); + }else{ + zyInfoStudent.setWwsftg("检测中"); } //----------计算通过率-------------- @@ -452,9 +464,9 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme baseMapper.updateById(zyCcjg); //----------计算通过率-------------- + String stuId = zyCcjg.getZyStuId(); + ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); if(StringUtils.equals("2",object2.getString("filestateid"))) { - String stuId = zyCcjg.getZyStuId(); - ZyInfoStudent zyInfoStudent = zyInfoStudentService.selectById(stuId); ZyInfo zyInfo = zyInfoService.getById(zyInfoStudent.getMainId()); Double tgl = 0.0; if (zyInfo.getNwtgl() > 0) { @@ -471,6 +483,10 @@ public class ZyCcjgServiceImpl extends ServiceImpl impleme } zyInfoStudent.setXnxsl(cctgl + ""); zyInfoStudentService.updateById(zyInfoStudent); + }else if(StringUtils.equals("3",object2.getString("filestateid"))){ + zyInfoStudent.setWwsftg("失败:"+object.getString("message")); + }else{ + zyInfoStudent.setWwsftg("检测中"); } //----------计算通过率-------------- diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/entity/ZyInfo.java b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/entity/ZyInfo.java index a6321e10..a263f452 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/entity/ZyInfo.java +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/entity/ZyInfo.java @@ -151,13 +151,25 @@ public class ZyInfo implements Serializable { @TableField(exist = false) private String aigcxsl; @TableField(exist = false) + private String xnxsl; + @TableField(exist = false) private String teano; @TableField(exist = false) private String kcmc; @TableField(exist = false) private String skjs; + @TableField(exist = false) + private String stuscore; + @TableField(exist = false) + private String wwsftg; + @TableField(exist = false) + private String nwsftg; + @TableField(exist = false) + private String aigcsftg; + @TableField(exist = false) + private String xnsftg; } diff --git a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/mapper/xml/ZyInfoMapper.xml b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/mapper/xml/ZyInfoMapper.xml index 04a58d57..f67d570d 100644 --- a/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/mapper/xml/ZyInfoMapper.xml +++ b/jeecg-module-main/src/main/java/org/jeecg/modules/kc/zyInfo/mapper/xml/ZyInfoMapper.xml @@ -3,16 +3,15 @@