diff --git a/pom.xml b/pom.xml
index 900747a..c36beed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -177,6 +177,12 @@
2.9.2
+
+ com.github.java-json-tools
+ json-patch
+ 1.12
+
+
diff --git a/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java b/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java
index 67c90b9..38b079a 100644
--- a/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java
+++ b/src/main/java/com/codesdream/ase/component/activity/ActivityConverter.java
@@ -1,21 +1,18 @@
package com.codesdream.ase.component.activity;
import com.alibaba.fastjson.JSONObject;
-import com.codesdream.ase.exception.DataInvalidFormatException;
+import com.codesdream.ase.exception.innerservererror.DataInvalidFormatException;
import com.codesdream.ase.model.activity.Activity;
import com.codesdream.ase.model.activity.Attendance;
import com.codesdream.ase.model.activity.Period;
import com.codesdream.ase.model.permission.User;
-import com.codesdream.ase.repository.activity.ActivityRepository;
import com.codesdream.ase.service.ActivityService;
import com.codesdream.ase.service.AttendanceService;
import com.codesdream.ase.service.PeriodService;
import com.codesdream.ase.service.UserService;
-import javafx.util.converter.LocalDateTimeStringConverter;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
-import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@@ -24,9 +21,6 @@ import java.util.*;
@Component
public class ActivityConverter {
- @Resource
- ActivityService activityService;
-
@Resource
UserService userService;
@@ -43,14 +37,14 @@ public class ActivityConverter {
Activity activity = new Activity();
JSONObject jsonObject = json.get();
- String username = (String) jsonObject.get("creator");
- Optional creator = userService.findUserByUsername(username);
+ int userId = (int) jsonObject.get("creator");
+ Optional creator = userService.findUserById(userId);
activity.setCreator(creator.get());
- List participateGroupFromJson = (List) jsonObject.get("participate-group");
+ List participateGroupFromJson = (List) jsonObject.get("participate-group");
Set participateGroup = new HashSet<>();
- for (String name : participateGroupFromJson) {
- Optional user = userService.findUserByUsername(name);
+ for (int id : participateGroupFromJson) {
+ Optional user = userService.findUserById(id);
participateGroup.add(user.get());
}
activity.setParticipateGroup(participateGroup);
@@ -58,14 +52,14 @@ public class ActivityConverter {
String title = (String) jsonObject.get("title");
activity.setTitle(title);
- String chiefManagerName = (String) jsonObject.get("chief-manager");
- Optional chiefManager = userService.findUserByUsername(chiefManagerName);
+ int chiefManagerId = (int) jsonObject.get("chief-manager");
+ Optional chiefManager = userService.findUserById(chiefManagerId);
activity.setChiefManager(chiefManager.get());
- List assistManagerFromJSON = (List) jsonObject.get("assist-manager");
+ List assistManagersFromJSON = (List) jsonObject.get("assist-managers");
Set assistManager = new HashSet<>();
- for (String name : assistManagerFromJSON) {
- Optional user = userService.findUserByUsername(name);
+ for (int id : assistManagersFromJSON) {
+ Optional user = userService.findUserById(id);
assistManager.add(user.get());
}
activity.setAssistManagers(assistManager);
@@ -88,26 +82,31 @@ public class ActivityConverter {
String description = (String) jsonObject.get("description");
activity.setDescription(description);
- List signGroupFromJSON = (List) jsonObject.get("sign-group");
+ List signGroupFromJSON = (List) jsonObject.get("sign-group");
Set signGroup = new HashSet<>();
- for (String name : signGroupFromJSON) {
- Optional user = userService.findUserByUsername(name);
+ for (int id : signGroupFromJSON) {
+ Optional user = userService.findUserById(id);
signGroup.add(user.get());
}
activity.setSignGroup(signGroup);
- List informGroupFromJSON = (List) jsonObject.get("inform-group");
+ List informGroupFromJSON = (List) jsonObject.get("inform-group");
+ if (informGroupFromJSON == null) {
+ participateGroupFromJson.removeAll(signGroupFromJSON);
+ participateGroupFromJson.addAll(signGroupFromJSON);
+ informGroupFromJSON = participateGroupFromJson;
+ }
Set informGroup = new HashSet<>();
- for (String name : informGroupFromJSON) {
- Optional user = userService.findUserByUsername(name);
+ for (int id : informGroupFromJSON) {
+ Optional user = userService.findUserById(id);
informGroup.add(user.get());
}
activity.setInformGroup(informGroup);
- List visibleGroupFromJSON = (List) jsonObject.get("visible-group");
+ List visibleGroupFromJSON = (List) jsonObject.get("visible-group");
Set visibleGroup = new HashSet<>();
- for (String name : visibleGroupFromJSON) {
- Optional user = userService.findUserByUsername(name);
+ for (int id : visibleGroupFromJSON) {
+ Optional user = userService.findUserById(id);
visibleGroup.add(user.get());
}
activity.setVisibleGroup(informGroup);
diff --git a/src/main/java/com/codesdream/ase/component/activity/FileUtils.java b/src/main/java/com/codesdream/ase/component/activity/FileUtils.java
new file mode 100644
index 0000000..656d3d2
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/activity/FileUtils.java
@@ -0,0 +1,129 @@
+package com.codesdream.ase.component.activity;
+
+import org.springframework.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.imageio.ImageIO;
+import javax.imageio.stream.ImageOutputStream;
+import java.awt.image.BufferedImage;
+import java.io.*;
+
+@Component
+public class FileUtils {
+ /**
+ * 得到图片字节流 数组大小
+ */
+ public static byte[] readStream(InputStream inStream) throws Exception {
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ byte[] buffer = new byte[1024];
+ int len = -1;
+ while ((len = inStream.read(buffer)) != -1) {
+ outStream.write(buffer, 0, len);
+ }
+ outStream.close();
+ inStream.close();
+ return outStream.toByteArray();
+ }
+
+ /**
+ * 将文件转换成Byte数组
+ *
+ * @param file
+ * @return
+ */
+ public static byte[] getBytesByFile(File file) {
+ try {
+ FileInputStream fis = new FileInputStream(file);
+ ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
+ byte[] b = new byte[1000];
+ int n;
+ while ((n = fis.read(b)) != -1) {
+ bos.write(b, 0, n);
+ }
+ fis.close();
+ byte[] data = bos.toByteArray();
+ bos.close();
+ return data;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ /**
+ * MultipartFile转File
+ *
+ * @param param
+ * @return
+ */
+ public static File transfer(MultipartFile param) {
+ if (!param.isEmpty()) {
+ File file = null;
+ try {
+ InputStream in = param.getInputStream();
+ file = new File(param.getOriginalFilename());
+ OutputStream out = new FileOutputStream(file);
+ int bytesRead = 0;
+ byte[] buffer = new byte[8192];
+ while ((bytesRead = in.read(buffer, 0, 8192)) != -1) {
+ out.write(buffer, 0, bytesRead);
+ }
+ in.close();
+ out.close();
+ return file;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return file;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * 获取指定文件的输入流
+ *
+ * @param logoPath 文件的路径
+ * @return
+ */
+ public static InputStream getResourceAsStream(String logoPath) {
+ return FileUtils.class.getResourceAsStream(logoPath);
+ }
+
+ /**
+ * 将InputStream写入到File中
+ *
+ * @param ins
+ * @param file
+ * @throws IOException
+ */
+ public void inputStreamToFile(InputStream ins, File file) throws IOException {
+ OutputStream os = new FileOutputStream(file);
+ int bytesRead = 0;
+ byte[] buffer = new byte[8192];
+ while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
+ os.write(buffer, 0, bytesRead);
+ }
+ os.close();
+ ins.close();
+ }
+
+ /**
+ * 将图片转化成输入流
+ *
+ * @param image 图片
+ * @return inputStream 图片转化之后的输入流
+ */
+ public static InputStream getImageStream(BufferedImage image) {
+ InputStream inputStream = null;
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ ImageOutputStream imageOutputStream;
+ try {
+ imageOutputStream = ImageIO.createImageOutputStream(byteArrayOutputStream);
+ ImageIO.write(image, "jpg", imageOutputStream);
+ inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return inputStream;
+ }
+}
diff --git a/src/main/java/com/codesdream/ase/component/activity/QrCodeUtils.java b/src/main/java/com/codesdream/ase/component/activity/QrCodeUtils.java
new file mode 100644
index 0000000..4389f67
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/activity/QrCodeUtils.java
@@ -0,0 +1,227 @@
+package com.codesdream.ase.component.activity;
+
+import com.google.zxing.BarcodeFormat;
+import com.google.zxing.EncodeHintType;
+import com.google.zxing.MultiFormatWriter;
+import com.google.zxing.common.BitMatrix;
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+import jdk.internal.util.xml.impl.Input;
+import org.springframework.stereotype.Component;
+
+import javax.imageio.ImageIO;
+import javax.imageio.stream.ImageOutputStream;
+import java.awt.*;
+import java.awt.geom.RoundRectangle2D;
+import java.awt.image.BufferedImage;
+import java.io.*;
+import java.util.Hashtable;
+import java.util.Random;
+
+/**
+ * 二维码生成工具类
+ */
+@Component
+public class QrCodeUtils {
+ private static final String CHARSET = "utf-8";
+ public static final String FORMAT = "JPG";
+ // 二维码尺寸
+ private static final int QRCODE_SIZE = 300;
+ // LOGO宽度
+ private static final int LOGO_WIDTH = 60;
+ // LOGO高度
+ private static final int LOGO_HEIGHT = 60;
+
+ /**
+ * 生成二维码
+ *
+ * @param content 二维码内容
+ * @param logoPath logo地址
+ * @param needCompress 是否压缩logo
+ * @return 图片
+ * @throws Exception
+ */
+ public static BufferedImage createImage(String content, String logoPath, boolean needCompress) throws Exception {
+ Hashtable hints = new Hashtable<>();
+ hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H);
+ hints.put(EncodeHintType.CHARACTER_SET, CHARSET);
+ hints.put(EncodeHintType.MARGIN, 1);
+ BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE,
+ hints);
+ int width = bitMatrix.getWidth();
+ int height = bitMatrix.getHeight();
+ BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+ for (int x = 0; x < width; x++) {
+ for (int y = 0; y < height; y++) {
+ image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF);
+ }
+ }
+ if (logoPath == null || "".equals(logoPath)) {
+ return image;
+ }
+ // 插入图片
+ QrCodeUtils.insertImage(image, logoPath, needCompress);
+ return image;
+ }
+
+ /**
+ * 插入LOGO
+ *
+ * @param source 二维码图片
+ * @param logoPath LOGO图片地址
+ * @param needCompress 是否压缩
+ * @throws IOException
+ */
+ private static void insertImage(BufferedImage source, String logoPath, boolean needCompress) throws IOException {
+ InputStream inputStream = null;
+ try {
+ inputStream = FileUtils.getResourceAsStream(logoPath);
+ Image src = ImageIO.read(inputStream);
+ int width = src.getWidth(null);
+ int height = src.getHeight(null);
+ if (needCompress) { // 压缩LOGO
+ if (width > LOGO_WIDTH) {
+ width = LOGO_WIDTH;
+ }
+ if (height > LOGO_HEIGHT) {
+ height = LOGO_HEIGHT;
+ }
+ Image image = src.getScaledInstance(width, height, Image.SCALE_SMOOTH);
+ BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+ Graphics g = tag.getGraphics();
+ g.drawImage(image, 0, 0, null); // 绘制缩小后的图
+ g.dispose();
+ src = image;
+ }
+ // 插入LOGO
+ Graphics2D graph = source.createGraphics();
+ int x = (QRCODE_SIZE - width) / 2;
+ int y = (QRCODE_SIZE - height) / 2;
+ graph.drawImage(src, x, y, width, height, null);
+ Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6);
+ graph.setStroke(new BasicStroke(3f));
+ graph.draw(shape);
+ graph.dispose();
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ } finally {
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ }
+ }
+
+ /**
+ * 生成二维码(内嵌LOGO)
+ * 二维码文件名随机,文件名可能会有重复
+ *
+ * @param content 内容
+ * @param logoPath LOGO地址
+ * @param destPath 存放目录
+ * @param needCompress 是否压缩LOGO
+ * @throws Exception
+ */
+ public static String encode(String content, String logoPath, String destPath, boolean needCompress) throws Exception {
+ BufferedImage image = QrCodeUtils.createImage(content, logoPath, needCompress);
+ mkdirs(destPath);
+ String fileName = new Random().nextInt(99999999) + "." + FORMAT.toLowerCase();
+ ImageIO.write(image, FORMAT, new File(destPath + "/" + fileName));
+ return fileName;
+ }
+
+ /**
+ * 生成二维码(内嵌LOGO)
+ * 调用者指定二维码文件名
+ *
+ * @param content 内容
+ * @param logoPath LOGO地址
+ * @param destPath 存放目录
+ * @param fileName 二维码文件名
+ * @param needCompress 是否压缩LOGO
+ * @throws Exception
+ */
+ public static String encode(String content, String logoPath, String destPath, String fileName, boolean needCompress) throws Exception {
+ BufferedImage image = QrCodeUtils.createImage(content, logoPath, needCompress);
+ mkdirs(destPath);
+ fileName = fileName.substring(0, fileName.indexOf(".") > 0 ? fileName.indexOf(".") : fileName.length())
+ + "." + FORMAT.toLowerCase();
+ ImageIO.write(image, FORMAT, new File(destPath + "/" + fileName));
+ return fileName;
+ }
+
+ /**
+ * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.
+ * (mkdir如果父目录不存在则会抛出异常)
+ *
+ * @param destPath 存放目录
+ */
+ public static void mkdirs(String destPath) {
+ File file = new File(destPath);
+ if (!file.exists() && !file.isDirectory()) {
+ file.mkdirs();
+ }
+ }
+
+ /**
+ * 生成二维码(内嵌LOGO)
+ *
+ * @param content 内容
+ * @param logoPath LOGO地址
+ * @param destPath 存储地址
+ * @throws Exception
+ */
+ public static String encode(String content, String logoPath, String destPath) throws Exception {
+ return QrCodeUtils.encode(content, logoPath, destPath, false);
+ }
+
+ /**
+ * 生成二维码
+ *
+ * @param content 内容
+ * @param destPath 存储地址
+ * @param needCompress 是否压缩LOGO
+ * @throws Exception
+ */
+ public static String encode(String content, String destPath, boolean needCompress) throws Exception {
+ return QrCodeUtils.encode(content, null, destPath, needCompress);
+ }
+
+ /**
+ * 生成二维码
+ *
+ * @param content 内容
+ * @param destPath 存储地址
+ * @throws Exception
+ */
+ public static String encode(String content, String destPath) throws Exception {
+ return QrCodeUtils.encode(content, null, destPath, false);
+ }
+
+ /**
+ * 生成二维码(内嵌LOGO)
+ *
+ * @param content 内容
+ * @param logoPath LOGO地址
+ * @param output 输出流
+ * @param needCompress 是否压缩LOGO
+ * @throws Exception
+ */
+ public static void encode(String content, String logoPath, OutputStream output, boolean needCompress)
+ throws Exception {
+ BufferedImage image = QrCodeUtils.createImage(content, logoPath, needCompress);
+ ImageIO.write(image, FORMAT, output);
+ }
+
+ /**
+ * 生成二维码
+ *
+ * @param content 内容
+ * @param output 输出流
+ * @throws Exception
+ */
+ public static void encode(String content, OutputStream output) throws Exception {
+ QrCodeUtils.encode(content, null, output, false);
+ }
+
+
+}
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java
index 83c1948..c11d01b 100644
--- a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java
+++ b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelGenerator.java
@@ -1,7 +1,7 @@
package com.codesdream.ase.component.datamanager;
import com.codesdream.ase.exception.notfound.DataFileNotFoundException;
-import com.codesdream.ase.exception.DataIOException;
+import com.codesdream.ase.exception.innerservererror.DataIOException;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java
index f5471f2..794f8c3 100644
--- a/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java
+++ b/src/main/java/com/codesdream/ase/component/datamanager/DataExcelReader.java
@@ -2,6 +2,9 @@ package com.codesdream.ase.component.datamanager;
import com.codesdream.ase.exception.*;
+import com.codesdream.ase.exception.innerservererror.DataIOException;
+import com.codesdream.ase.exception.innerservererror.DataIllegalTableFormatException;
+import com.codesdream.ase.exception.innerservererror.DataInvalidFormatException;
import com.codesdream.ase.exception.notfound.DataFileNotFoundException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.ss.usermodel.*;
@@ -48,7 +51,7 @@ public class DataExcelReader implements DataReader {
Row titleRow = sheet.getRow(0);
colNumber = titleRow.getLastCellNum();
// 表头项目个数不可为0
- if(colNumber == 0) throw new DataIllegalTableFormatException();
+ if(colNumber == 0) throw new DataIllegalTableFormatException();
Collection title = new ArrayList<>();
for(int cellIdx = 0; cellIdx < colNumber; cellIdx++){
title.add(readCell(titleRow.getCell(cellIdx)));
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java b/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java
index cf1217c..97d04f5 100644
--- a/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java
+++ b/src/main/java/com/codesdream/ase/component/datamanager/DataTable.java
@@ -1,11 +1,9 @@
package com.codesdream.ase.component.datamanager;
-import com.codesdream.ase.exception.DataIllegalTableFormatException;
+import com.codesdream.ase.exception.innerservererror.DataIllegalTableFormatException;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Table;
-import javax.swing.text.html.Option;
import java.util.*;
// 描述一张数据表
diff --git a/src/main/java/com/codesdream/ase/component/datamanager/JsonPathParameter.java b/src/main/java/com/codesdream/ase/component/datamanager/JsonPathParameter.java
new file mode 100644
index 0000000..64b719b
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/datamanager/JsonPathParameter.java
@@ -0,0 +1,23 @@
+package com.codesdream.ase.component.datamanager;
+
+import com.codesdream.ase.exception.innerservererror.HandlingErrorsException;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.fge.jsonpatch.JsonPatch;
+import com.github.fge.jsonpatch.JsonPatchException;
+import org.springframework.stereotype.Controller;
+
+@Controller
+public class JsonPathParameter {
+ public T parsePathToObject(JsonPatch patch, T object){
+ try {
+ ObjectMapper mapper = new ObjectMapper();
+ JsonNode patched = patch.apply(mapper.convertValue(object, JsonNode.class));
+ return (T) mapper.treeToValue(patched, object.getClass());
+ } catch (JsonPatchException | JsonProcessingException e) {
+ throw new HandlingErrorsException(e.getMessage());
+ }
+
+ }
+}
diff --git a/src/main/java/com/codesdream/ase/component/json/model/JsonablePCCList.java b/src/main/java/com/codesdream/ase/component/json/model/JsonablePCCList.java
new file mode 100644
index 0000000..870743e
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/json/model/JsonablePCCList.java
@@ -0,0 +1,22 @@
+package com.codesdream.ase.component.json.model;
+
+import com.codesdream.ase.model.permission.PermissionContainersCollection;
+import com.codesdream.ase.model.permission.Tag;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.List;
+
+@Data
+@NoArgsConstructor
+@ApiModel("权限容器集合列表")
+public class JsonablePCCList {
+ List pccIdList;
+
+ public JsonablePCCList(Tag tag){
+ for(PermissionContainersCollection pcc : tag.getPermissionContainersCollections()){
+ pccIdList.add(pcc.getId());
+ }
+ }
+}
diff --git a/src/main/java/com/codesdream/ase/component/json/model/JsonableTagUserList.java b/src/main/java/com/codesdream/ase/component/json/model/JsonableUserList.java
similarity index 87%
rename from src/main/java/com/codesdream/ase/component/json/model/JsonableTagUserList.java
rename to src/main/java/com/codesdream/ase/component/json/model/JsonableUserList.java
index 523c61e..e91c3cb 100644
--- a/src/main/java/com/codesdream/ase/component/json/model/JsonableTagUserList.java
+++ b/src/main/java/com/codesdream/ase/component/json/model/JsonableUserList.java
@@ -12,13 +12,13 @@ import java.util.List;
@Data
@NoArgsConstructor
@ApiModel("标签所属用户集合")
-public class JsonableTagUserList {
+public class JsonableUserList {
@ApiModelProperty(name = "用户列表")
private List users;
- public JsonableTagUserList(Tag tag){
+ public JsonableUserList(Tag tag){
for(User user : tag.getUsers()){
users.add(user.getId());
}
diff --git a/src/main/java/com/codesdream/ase/component/json/request/UserLeaveAuth.java b/src/main/java/com/codesdream/ase/component/json/request/UserLeaveAuth.java
new file mode 100644
index 0000000..92452c6
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/json/request/UserLeaveAuth.java
@@ -0,0 +1,16 @@
+package com.codesdream.ase.component.json.request;
+
+import lombok.Data;
+
+@Data
+public class UserLeaveAuth {
+ /*
+ 备注
+ */
+ private int id;
+ private String Comment;
+ /*
+ 审核结果
+ */
+ private String newStat;
+}
diff --git a/src/main/java/com/codesdream/ase/component/json/request/UserLeaveRequest.java b/src/main/java/com/codesdream/ase/component/json/request/UserLeaveRequest.java
index 485c0ce..df05547 100644
--- a/src/main/java/com/codesdream/ase/component/json/request/UserLeaveRequest.java
+++ b/src/main/java/com/codesdream/ase/component/json/request/UserLeaveRequest.java
@@ -1,7 +1,15 @@
package com.codesdream.ase.component.json.request;
+import lombok.Data;
+
+import java.util.Date;
+@Data
public class UserLeaveRequest {
-
-
+ private String UserId;//用户名
+ private String Type;//请假类型
+ private String Reason;//请假原因
+ private String Addon;//附件
+ private Date Starttime;//开始时间
+ private Date EndTime;//结束时间
}
diff --git a/src/main/java/com/codesdream/ase/component/json/request/UserSGettudentLeaveListRequest.java b/src/main/java/com/codesdream/ase/component/json/request/UserSGettudentLeaveListRequest.java
new file mode 100644
index 0000000..b97c771
--- /dev/null
+++ b/src/main/java/com/codesdream/ase/component/json/request/UserSGettudentLeaveListRequest.java
@@ -0,0 +1,8 @@
+package com.codesdream.ase.component.json.request;
+
+import lombok.Data;
+
+@Data
+public class UserSGettudentLeaveListRequest {
+ private int studentId;
+}
diff --git a/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java b/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java
index bdddf30..281ced4 100644
--- a/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java
+++ b/src/main/java/com/codesdream/ase/controller/ASEControllerAdvice.java
@@ -3,7 +3,11 @@ package com.codesdream.ase.controller;
import com.codesdream.ase.component.api.QuickJSONRespond;
import com.codesdream.ase.component.json.respond.ErrorInfoJSONRespond;
import com.codesdream.ase.exception.badrequest.AlreadyExistException;
+import com.codesdream.ase.exception.badrequest.IllegalException;
import com.codesdream.ase.exception.conflict.RelatedObjectsExistException;
+import com.codesdream.ase.exception.innerservererror.FormatException;
+import com.codesdream.ase.exception.innerservererror.HandlingErrorsException;
+import com.codesdream.ase.exception.innerservererror.RuntimeIOException;
import com.codesdream.ase.exception.notfound.NotFoundException;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -21,7 +25,8 @@ public class ASEControllerAdvice {
@ExceptionHandler(value = {
NullPointerException.class,
- AlreadyExistException.class
+ AlreadyExistException.class,
+ IllegalException.class
})
public ResponseEntity