main
黄海 3 years ago
parent d0eaaffeba
commit f943ad6fd6

@ -10,6 +10,7 @@ import com.dsideal.FengHuang.Swagger.annotation.Api;
import com.dsideal.FengHuang.Swagger.annotation.Param;
import com.dsideal.FengHuang.Swagger.annotation.Params;
import com.dsideal.FengHuang.Base.Model.BaseModel;
import com.dsideal.FengHuang.TouPiao.Model.TouPiaoModel;
import com.dsideal.FengHuang.Util.*;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
@ -22,6 +23,7 @@ import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.jfinal.plugin.redis.Redis;
import org.apache.poi.ss.formula.functions.T;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
@ -136,7 +138,7 @@ public class LoginPersonController extends Controller {
return;
}
if (!password.equals(username.substring(username.length()-6))) {
if (!password.equals(username.substring(username.length() - 6))) {
//扩展支持连续输入用户名密码错误停用账号5分钟功能 2022.06.07
cntNum = 1;
if (Redis.use().exists(PassWordKey))
@ -160,6 +162,15 @@ public class LoginPersonController extends Controller {
renderJson(resultJson);
return;
}
//检查是不是已经投票过了?
TouPiaoModel tm = new TouPiaoModel();
if (tm.haveFinishTouPiao(username)) {
resultJson.put("success", false);
resultJson.put("msg", "您已经投票完成,不能再次进入系统!");
renderJson(resultJson);
return;
}
//去掉限制
Redis.use().del(PassWordKey);
Redis.use().del(checkCodeKey);

@ -30,6 +30,11 @@ public class TouPiaoModel {
return Db.findFirst(sql, toupiaoren_tel);
}
public boolean haveFinishTouPiao(String toupiaoren_tel) {
String sql = "select count(1) as c from t_toupiao_result where toupiaoren_tel=?";
return Db.findFirst(sql, toupiaoren_tel).getInt("c") > 0;
}
public void save(String toupiaoren_tel, String[] gaojiArray, String[] zhongjiArray) {
Record r = getTouPiaoRenInfo(toupiaoren_tel);
int toupiaoren_type_id = r.getInt("toupiaoren_type_id");

Loading…
Cancel
Save