|
|
|
@ -1,34 +1,26 @@
|
|
|
|
|
package com.dsideal.FengHuang.Yp.Controller;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.dsideal.FengHuang.ExcelImportTemplate.StudentImportExcelUtil;
|
|
|
|
|
import com.dsideal.FengHuang.Interceptor.*;
|
|
|
|
|
import com.dsideal.FengHuang.Util.*;
|
|
|
|
|
import com.dsideal.FengHuang.Interceptor.EmptyInterface;
|
|
|
|
|
import com.dsideal.FengHuang.Interceptor.IsNumericInterface;
|
|
|
|
|
import com.dsideal.FengHuang.Util.Base64Util;
|
|
|
|
|
import com.dsideal.FengHuang.Util.CommonUtil;
|
|
|
|
|
import com.dsideal.FengHuang.Util.ExcelExportUtil;
|
|
|
|
|
import com.dsideal.FengHuang.Util.FileUtil;
|
|
|
|
|
import com.dsideal.FengHuang.Yp.Model.YpModel;
|
|
|
|
|
import com.jfinal.aop.Before;
|
|
|
|
|
import com.jfinal.core.Controller;
|
|
|
|
|
import com.jfinal.core.Path;
|
|
|
|
|
import com.jfinal.ext.interceptor.GET;
|
|
|
|
|
import com.jfinal.ext.interceptor.POST;
|
|
|
|
|
import com.jfinal.kit.Kv;
|
|
|
|
|
import com.jfinal.kit.PathKit;
|
|
|
|
|
import com.jfinal.kit.PropKit;
|
|
|
|
|
import com.jfinal.kit.StrKit;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Page;
|
|
|
|
|
import com.jfinal.plugin.activerecord.Record;
|
|
|
|
|
import com.jfinal.upload.UploadFile;
|
|
|
|
|
import org.apache.commons.codec.binary.Base64;
|
|
|
|
|
import sun.misc.BASE64Encoder;
|
|
|
|
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
|
|
import java.awt.image.BufferedImage;
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
|
|
|
|
|
public class YpController extends Controller {
|
|
|
|
@ -134,10 +126,8 @@ public class YpController extends Controller {
|
|
|
|
|
@Before(GET.class)
|
|
|
|
|
@EmptyInterface({"sfzh"})
|
|
|
|
|
public void evalBx(String sfzh) {
|
|
|
|
|
int bx_id = model.evalBx(sfzh);
|
|
|
|
|
Kv kv = Kv.by("success", true);
|
|
|
|
|
kv.set("message", "获取成功!");
|
|
|
|
|
kv.set("bx_id", bx_id);
|
|
|
|
|
Kv kv = model.evalBx(sfzh);
|
|
|
|
|
kv.set("success", true);
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -155,9 +145,9 @@ public class YpController extends Controller {
|
|
|
|
|
* @param tel
|
|
|
|
|
*/
|
|
|
|
|
@Before(POST.class)
|
|
|
|
|
@EmptyInterface({"name","xb","sfzh","address","father_name","mother_name","tel","uuid"})
|
|
|
|
|
public void save(int task_id, String name, String xb, int bx_id, String address, String father_name, String mother_name, String sfzh, String tel,String uuid) {
|
|
|
|
|
int result = model.save(task_id, name, xb, bx_id, address, father_name, mother_name, sfzh, tel,uuid);
|
|
|
|
|
@EmptyInterface({"name", "xb", "sfzh", "address", "father_name", "mother_name", "tel", "uuid"})
|
|
|
|
|
public void save(int task_id, String name, String xb, int bx_id, String address, String father_name, String mother_name, String sfzh, String tel, String uuid) {
|
|
|
|
|
int result = model.save(task_id, name, xb, bx_id, address, father_name, mother_name, sfzh, tel, uuid);
|
|
|
|
|
|
|
|
|
|
Kv kv = Kv.by("success", result);
|
|
|
|
|
if (result == 1) kv.set("message", "获取成功!");
|
|
|
|
@ -217,7 +207,7 @@ public class YpController extends Controller {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String uuid=UUID.randomUUID().toString();
|
|
|
|
|
String uuid = UUID.randomUUID().toString();
|
|
|
|
|
//判断目录是不是存在
|
|
|
|
|
File file = new File(PathKit.getWebRootPath() + "/upload");
|
|
|
|
|
if (!file.exists()) {
|
|
|
|
@ -230,7 +220,7 @@ public class YpController extends Controller {
|
|
|
|
|
Kv kv = Kv.by("success", true);
|
|
|
|
|
kv.set("message", "上传成功!");
|
|
|
|
|
kv.set("base64", base64);
|
|
|
|
|
kv.set("uuid",uuid);
|
|
|
|
|
kv.set("uuid", uuid);
|
|
|
|
|
renderJson(kv);
|
|
|
|
|
//path : /FengHuang/upload/sfzh+".jpg"
|
|
|
|
|
}
|
|
|
|
|