Browse Source

统计表格,异常处理。

小么熊🐻 1 year ago
parent
commit
fee73e3610

+ 9 - 7
jsjp-admin/src/main/java/com/miaxis/app/controller/tms/TmsStudentInfoController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.sql.SQLException;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -134,11 +135,7 @@ public class TmsStudentInfoController extends BaseController {
     @GetMapping("/updateStudentAppCoachIdById")
     @ApiOperation("根据学员ID绑定APP教练员")
     public Response updateStuAppCoachIdById(TmsStudentInfoQrDTO studentInfoQrDTO) {
-        try {
-            return Response.success(studentInfoService.upStuAppCoachIdById(studentInfoQrDTO));
-        } catch (Exception e) {
-            return Response.success("系统开小差了,请重试");
-        }
+        return Response.success(studentInfoService.upStuAppCoachIdById(studentInfoQrDTO));
     }
 
 
@@ -150,8 +147,13 @@ public class TmsStudentInfoController extends BaseController {
      */
     @GetMapping("/getStatisticsStuCountBySchoolId")
     @ApiOperation("根据驾校ID 报名统计")
-    public Response<TmsBmVo> getStatisticsStuCountBySchoolId(TmsBmDTO bmDTO) {
-        return Response.success(studentInfoService.getStatisticsStuCountBySchoolId(bmDTO));
+    public Response getStatisticsStuCountBySchoolId(TmsBmDTO bmDTO) {
+        try {
+            return Response.success(studentInfoService.getStatisticsStuCountBySchoolId(bmDTO));
+        } catch (SQLException e) {
+            e.printStackTrace();
+            return Response.success("数据库开小差,请一会再试");
+        }
     }
 
 

+ 2 - 1
jsjp-service/src/main/java/com/miaxis/tms/service/ITmsStudentInfoService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.miaxis.tms.dto.*;
 import com.miaxis.tms.vo.*;
 
+import java.sql.SQLException;
 import java.util.List;
 
 /**
@@ -31,7 +32,7 @@ public interface ITmsStudentInfoService extends IService<TmsStudentInfoVo> {
 
     List<TmsSignVo> getTmsSignListByStuId(TmsStudentInfoIdDTO studentInfoIdDTO);
 
-    TmsBmVo getStatisticsStuCountBySchoolId(TmsBmDTO bmDTO);
+    TmsBmVo getStatisticsStuCountBySchoolId(TmsBmDTO bmDTO) throws SQLException;
 
     List<TmsBmCountVo> getEveryDayStuCountBySchoolId(TmsBmDayListDTO dayListDTO);
 

+ 2 - 1
jsjp-service/src/main/java/com/miaxis/tms/service/impl/TmsStudentInfoServiceImpl.java

@@ -11,6 +11,7 @@ import com.miaxis.tms.vo.*;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+import java.sql.SQLException;
 import java.util.List;
 
 /**
@@ -69,7 +70,7 @@ public class TmsStudentInfoServiceImpl extends ServiceImpl<TmsStudentInfoMapper,
 
 
     @Override
-    public TmsBmVo getStatisticsStuCountBySchoolId(TmsBmDTO bmDTO) {
+    public TmsBmVo getStatisticsStuCountBySchoolId(TmsBmDTO bmDTO) throws SQLException {
 
         TmsBmDayDTO dayDTO = new TmsBmDayDTO();
         BeanUtils.copyProperties(bmDTO,dayDTO);