From 27f6f1f89118e4b86b67f38164cb7b28b35e3434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Mon, 24 Apr 2023 09:10:56 +0800 Subject: [PATCH] 'commit' --- .../dsideal/FengHuang/Yp/Model/YpModel.java | 8 +++- 测试文档.txt | 41 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dsideal/FengHuang/Yp/Model/YpModel.java b/src/main/java/com/dsideal/FengHuang/Yp/Model/YpModel.java index 26bbe7c..937798e 100644 --- a/src/main/java/com/dsideal/FengHuang/Yp/Model/YpModel.java +++ b/src/main/java/com/dsideal/FengHuang/Yp/Model/YpModel.java @@ -161,6 +161,7 @@ public class YpModel { //是不是满了呢? int applyCount = applyCount(task_id, bx_id); int limit_count = limitCount(task_id, bx_id); + if (limit_count == 0) break; if (applyCount >= limit_count) { kv.set("bx_id", -3); kv.set("bx_name", "人数已满!"); @@ -182,6 +183,7 @@ public class YpModel { /** * 功能:指定任务+指定班型的已申请人数 + * * @param task_id * @param bx_id * @return @@ -194,13 +196,16 @@ public class YpModel { /** * 功能:查看指定任务+指定班型的人数限制 + * * @param task_id * @param bx_id * @return */ public int limitCount(int task_id, int bx_id) { String sql = "select * from t_yp_task_bx_limit where task_id=? and bx_id=?"; - int limit_count = Db.findFirst(sql, task_id, bx_id).getInt("limit"); + List list = Db.find(sql, task_id, bx_id); + if (list.size() == 0) return 0; + int limit_count = list.get(0).getInt("limit"); return limit_count; } @@ -293,6 +298,7 @@ public class YpModel { /** * 功能:任务列表 + * * @param page * @param limit * @return diff --git a/测试文档.txt b/测试文档.txt index 56ce7f6..d82564d 100644 --- a/测试文档.txt +++ b/测试文档.txt @@ -7,3 +7,44 @@ http://10.10.21.20:9000/FengHuang/admin # 业务管理员 admin 123456 + +# 2019年出生的学生测试用身份证号 +110101201903077278 +110101201903078457 +110101201903074990 +110101201903077219 +110101201903074659 +110101201903072936 +110101201903073031 +110101201903073955 +110101201903072936 +110101201903073517 + +# 2020年出生的学生测试用身份证号 +110101202003074439 +110101202003074412 +110101202003071115 +110101202003074295 +110101202003079053 +110101202003071174 +110101202003078595 +110101202003070518 +110101202003078536 +110101202003072951 + +# 2021年出生的学生测试用身份证号 +110101202103077311 +110101202103074858 +110101202103076132 +110101202103078031 +11010120210307003X +11010120210307927X +11010120210307425X +110101202103075535 +110101202103077397 +110101202103076212 + +# 清库脚本 +truncate table t_yp_task; +truncate table t_yp_record; +truncate table t_yp_task_bx_limit;