|
|
|
@ -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<Record> 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
|
|
|
|
|