From 0f8397fe03c531b6b619b393590c3495789e4f87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=B6=E4=B8=9C?= <1654135867@qq.com> Date: Fri, 26 Jan 2024 10:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E5=88=86=E5=A4=8D=E8=AF=84bug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/TongfenCompController.java | 12 +++++------ .../controller/TongfenCompinfoController.java | 21 ++++++++++++------- .../mapper/TongfenCompinfoMapper.java | 4 ++++ .../service/ITongfenCompinfoService.java | 2 ++ .../impl/TongfenCompinfoServiceImpl.java | 5 +++++ .../components/TongfenCompinfoForm.vue | 8 +++---- 6 files changed, 35 insertions(+), 17 deletions(-) diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenComp/controller/TongfenCompController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenComp/controller/TongfenCompController.java index 30769d0f..f778e1b1 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenComp/controller/TongfenCompController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenComp/controller/TongfenCompController.java @@ -81,7 +81,7 @@ public class TongfenCompController extends JeecgController add(@RequestBody TongfenComp tongfenComp) { tongfenCompService.save(tongfenComp); @@ -96,7 +96,7 @@ public class TongfenCompController extends JeecgController edit(@RequestBody TongfenComp tongfenComp) { tongfenCompService.updateById(tongfenComp); @@ -111,7 +111,7 @@ public class TongfenCompController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { tongfenCompService.removeById(id); @@ -126,7 +126,7 @@ public class TongfenCompController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.tongfenCompService.removeByIds(Arrays.asList(ids.split(","))); @@ -156,7 +156,7 @@ public class TongfenCompController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, TongfenComp.class); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/controller/TongfenCompinfoController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/controller/TongfenCompinfoController.java index 9855124d..df53b97e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/controller/TongfenCompinfoController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/controller/TongfenCompinfoController.java @@ -81,7 +81,7 @@ public class TongfenCompinfoController extends JeecgController add(@RequestBody TongfenCompinfo tongfenCompinfo) { tongfenCompinfoService.save(tongfenCompinfo); @@ -96,11 +96,18 @@ public class TongfenCompinfoController extends JeecgController edit(@RequestBody TongfenCompinfo tongfenCompinfo) { - tongfenCompinfoService.updateById(tongfenCompinfo); + /*tongfenCompinfoService.updateById(tongfenCompinfo);*/ + Integer a = tongfenCompinfoService.updateScore(tongfenCompinfo.getScore(),tongfenCompinfo.getCcode()); + if (a>0){ + tongfenCompinfoService.removeById(tongfenCompinfo.getId()); + }else { + return Result.error("成绩表存在数据缺失"); + } return Result.OK("编辑成功!"); + } /** @@ -111,7 +118,7 @@ public class TongfenCompinfoController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { tongfenCompinfoService.removeById(id); @@ -126,7 +133,7 @@ public class TongfenCompinfoController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.tongfenCompinfoService.removeByIds(Arrays.asList(ids.split(","))); @@ -156,7 +163,7 @@ public class TongfenCompinfoController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, TongfenCompinfo.class); diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/mapper/TongfenCompinfoMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/mapper/TongfenCompinfoMapper.java index 18697eec..f95bc712 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/mapper/TongfenCompinfoMapper.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/mapper/TongfenCompinfoMapper.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.TongfenCompinfo.mapper; import java.util.List; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.Update; import org.jeecg.modules.demo.TongfenCompinfo.entity.TongfenCompinfo; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; @@ -20,4 +21,7 @@ public interface TongfenCompinfoMapper extends BaseMapper { @Select("select url from upfile_persion where apply_code=#{enrollCode}") String geturl(String enrollCode); + + @Update("UPDATE score_persion SET score=#{score} where enroll_code =#{ccode}") + Integer updateScore(String score, String ccode); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/ITongfenCompinfoService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/ITongfenCompinfoService.java index df764d80..5ab23bb2 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/ITongfenCompinfoService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/ITongfenCompinfoService.java @@ -17,4 +17,6 @@ public interface ITongfenCompinfoService extends IService { List getscorePersionList(String id); String geturl(String enrollCode); + + Integer updateScore(String score, String ccode); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/impl/TongfenCompinfoServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/impl/TongfenCompinfoServiceImpl.java index 12340bcd..7026c698 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/impl/TongfenCompinfoServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/TongfenCompinfo/service/impl/TongfenCompinfoServiceImpl.java @@ -45,4 +45,9 @@ public class TongfenCompinfoServiceImpl extends ServiceImpl - + - + - + @@ -24,7 +24,7 @@ - +