main
黄海 3 years ago
parent ab3a31499f
commit ba421989d1

@ -53,7 +53,6 @@
alt="点击图片刷新校验码" style="cursor:pointer" onclick="javascript:refreshCaptcha()"/> alt="点击图片刷新校验码" style="cursor:pointer" onclick="javascript:refreshCaptcha()"/>
</div> </div>
</div> </div>
<input id="loginBtn" class="input-button" type="button" value="登&nbsp;&nbsp;&nbsp;录"> <input id="loginBtn" class="input-button" type="button" value="登&nbsp;&nbsp;&nbsp;录">
</form> </form>
</div> </div>

@ -87,7 +87,7 @@ public class TouPiaoController extends Controller {
renderJson(kv); renderJson(kv);
return; return;
} }
tm.save(toupiaoren_tel, gaojiArray, zhongjiArray,ip); tm.save(toupiaoren_tel, gaojiArray, zhongjiArray, ip);
Kv kv = Kv.create(); Kv kv = Kv.create();
kv.set("success", true); kv.set("success", true);
kv.set("message", "投票成功 !"); kv.set("message", "投票成功 !");
@ -169,4 +169,13 @@ public class TouPiaoController extends Controller {
String filename = "投票结果.xls"; String filename = "投票结果.xls";
renderFile(new File(file3), filename); renderFile(new File(file3), filename);
} }
/*
http://10.10.11.124:9000/FengHuang/TouPiao/getTouPiaoInfo
*/
public void getTouPiaoInfo() {
List<Record> list = tm.getTouPiaoInfo();
renderJson(CommonUtil.renderJsonForLayUI(list));
}
} }

@ -34,11 +34,11 @@ public class TouPiaoModel {
public boolean haveFinishTouPiao(String toupiaoren_tel) { public boolean haveFinishTouPiao(String toupiaoren_tel) {
String sql = "select count(1) as c from t_toupiao_result where toupiaoren_tel=?"; String sql = "select count(1) as c from t_toupiao_result where toupiaoren_tel=?";
int cnt=Db.findFirst(sql, toupiaoren_tel).getInt("c"); int cnt = Db.findFirst(sql, toupiaoren_tel).getInt("c");
return cnt > 0; return cnt > 0;
} }
public void save(String toupiaoren_tel, String[] gaojiArray, String[] zhongjiArray,String ip) { public void save(String toupiaoren_tel, String[] gaojiArray, String[] zhongjiArray, String ip) {
Record r = getTouPiaoRenInfo(toupiaoren_tel); Record r = getTouPiaoRenInfo(toupiaoren_tel);
int toupiaoren_type_id = r.getInt("toupiaoren_type_id"); int toupiaoren_type_id = r.getInt("toupiaoren_type_id");
String sql = "delete from t_toupiao_result where toupiaoren_tel=?"; String sql = "delete from t_toupiao_result where toupiaoren_tel=?";
@ -56,7 +56,7 @@ public class TouPiaoModel {
record.set("toupiaoren_tel", toupiaoren_tel); record.set("toupiaoren_tel", toupiaoren_tel);
record.set("toupiaoren_name", _map.get(toupiaoren_tel).getStr("toupiaoren_name")); record.set("toupiaoren_name", _map.get(toupiaoren_tel).getStr("toupiaoren_name"));
record.set("toupiaoren_type_id", toupiaoren_type_id); record.set("toupiaoren_type_id", toupiaoren_type_id);
record.set("ip",ip); record.set("ip", ip);
saveList.add(record); saveList.add(record);
} }
for (String s : zhongjiArray) { for (String s : zhongjiArray) {
@ -68,7 +68,7 @@ public class TouPiaoModel {
record.set("toupiaoren_tel", toupiaoren_tel); record.set("toupiaoren_tel", toupiaoren_tel);
record.set("toupiaoren_name", _map.get(toupiaoren_tel).getStr("toupiaoren_name")); record.set("toupiaoren_name", _map.get(toupiaoren_tel).getStr("toupiaoren_name"));
record.set("toupiaoren_type_id", toupiaoren_type_id); record.set("toupiaoren_type_id", toupiaoren_type_id);
record.set("ip",ip); record.set("ip", ip);
saveList.add(record); saveList.add(record);
} }
Db.batchSave("t_toupiao_result", saveList, 100); Db.batchSave("t_toupiao_result", saveList, 100);
@ -93,6 +93,7 @@ public class TouPiaoModel {
res.add(r2); res.add(r2);
return res; return res;
} }
/* /*
25251015 25251015
= 1.0 * / *10 = 1.0 * / *10
@ -111,4 +112,10 @@ public class TouPiaoModel {
List<Record> list = Db.find(sq); List<Record> list = Db.find(sq);
return list; return list;
} }
public List<Record> getTouPiaoInfo() {
SqlPara sq = Db.getSqlPara("TouPiao.getTouPiaoInfo");
List<Record> list = Db.find(sq);
return list;
}
} }

@ -8,4 +8,10 @@
from t_toupiao_houxuanren as t1) as ta where ta.houxuanren_type_id=#(houxuanren_type_id) from t_toupiao_houxuanren as t1) as ta where ta.houxuanren_type_id=#(houxuanren_type_id)
order by 1.0 * ta.pingweihui_count /#(PingWeiHuiAllCount) *10 + 1.0*ta.qunzhong_count/#(QunZhongAllCount) *15 desc order by 1.0 * ta.pingweihui_count /#(PingWeiHuiAllCount) *10 + 1.0*ta.qunzhong_count/#(QunZhongAllCount) *15 desc
#end #end
#sql("getTouPiaoInfo")
select toupiaoren_tel,toupiaoren_name,toupiaoren_type_id,(
select count(1) as c from t_toupiao_result as t2 where t2.toupiaoren_tel=t1.toupiaoren_tel
) as c from t_toupiao_toupiaoren as t1 order by toupiaoren_type_id,c desc
#end
#end #end

@ -8,4 +8,10 @@
from t_toupiao_houxuanren as t1) as ta where ta.houxuanren_type_id=#(houxuanren_type_id) from t_toupiao_houxuanren as t1) as ta where ta.houxuanren_type_id=#(houxuanren_type_id)
order by 1.0 * ta.pingweihui_count /#(PingWeiHuiAllCount) *10 + 1.0*ta.qunzhong_count/#(QunZhongAllCount) *15 desc order by 1.0 * ta.pingweihui_count /#(PingWeiHuiAllCount) *10 + 1.0*ta.qunzhong_count/#(QunZhongAllCount) *15 desc
#end #end
#sql("getTouPiaoInfo")
select toupiaoren_tel,toupiaoren_name,toupiaoren_type_id,(
select count(1) as c from t_toupiao_result as t2 where t2.toupiaoren_tel=t1.toupiaoren_tel
) as c from t_toupiao_toupiaoren as t1 order by toupiaoren_type_id,c desc
#end
#end #end
Loading…
Cancel
Save