|
|
|
@ -34,8 +34,15 @@ public class ExamController extends Controller {
|
|
|
|
|
* @param tel
|
|
|
|
|
*/
|
|
|
|
|
@Before({POST.class})
|
|
|
|
|
@EmptyInterface({"person_name","ks","tel"})
|
|
|
|
|
@EmptyInterface({"person_name", "ks", "tel"})
|
|
|
|
|
public void addPerson(String person_name, String ks, String tel) {
|
|
|
|
|
if (!cn.hutool.core.lang.Validator.isMobile(tel)) {
|
|
|
|
|
Kv kv = Kv.create();
|
|
|
|
|
kv.set("success", false);
|
|
|
|
|
kv.set("message", "输入的手机号不正确,请检查后重新输入!");
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
Kv kv = em.addPerson(person_name, ks, tel);
|
|
|
|
|
if (kv.getBoolean("success")) {
|
|
|
|
|
CookieUtil.set(getResponse(), "person_id", kv.get("person_id").toString(), false, true);
|
|
|
|
@ -211,7 +218,7 @@ public class ExamController extends Controller {
|
|
|
|
|
JSONObject jo = FileUtil.readJsonFile(filePath);
|
|
|
|
|
//导出
|
|
|
|
|
String excelFile = excelPath + "excelTemp/" + UUID.randomUUID().toString().toUpperCase() + ".xls";
|
|
|
|
|
ExcelCommonUtil.export(list, jo, excelFile,null,"名次");
|
|
|
|
|
ExcelCommonUtil.export(list, jo, excelFile, null, "名次");
|
|
|
|
|
//提供下载
|
|
|
|
|
String filename = "排名结果.xls";
|
|
|
|
|
renderFile(new File(excelFile), filename);
|
|
|
|
|