From 4916dea8913764bef7346f7a58318ff94b027846 Mon Sep 17 00:00:00 2001 From: Vindicator645 <45960487+Vindicator645@users.noreply.github.com> Date: Sun, 15 Mar 2020 20:25:42 +0800 Subject: [PATCH] Leaving --- .../json/request/UserLeaveRequest.java | 7 +++++ .../ase/controller/LeavesController.java | 26 ++++++------------- .../codesdream/ase/model/leaves/Leave.java | 12 ++++++++- 3 files changed, 26 insertions(+), 19 deletions(-) create mode 100644 src/main/java/com/codesdream/ase/component/json/request/UserLeaveRequest.java 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 new file mode 100644 index 0000000..485c0ce --- /dev/null +++ b/src/main/java/com/codesdream/ase/component/json/request/UserLeaveRequest.java @@ -0,0 +1,7 @@ +package com.codesdream.ase.component.json.request; + +public class UserLeaveRequest { + + + +} diff --git a/src/main/java/com/codesdream/ase/controller/LeavesController.java b/src/main/java/com/codesdream/ase/controller/LeavesController.java index 8694283..9ad7eb1 100644 --- a/src/main/java/com/codesdream/ase/controller/LeavesController.java +++ b/src/main/java/com/codesdream/ase/controller/LeavesController.java @@ -2,11 +2,10 @@ package com.codesdream.ase.controller; import com.alibaba.fastjson.JSONObject; import com.codesdream.ase.component.datamanager.JSONParameter; +import com.codesdream.ase.component.json.request.UserLeaveRequest; import com.codesdream.ase.component.json.respond.FailedSONRespond; import com.codesdream.ase.component.json.respond.JSONBaseRespondObject; import com.codesdream.ase.component.permission.ASEUsernameEncoder; -import com.codesdream.ase.component.json.request.UserLeaveChecker; -import com.codesdream.ase.component.json.respond.UserLeaveCheckerJSONRespond; import com.codesdream.ase.service.LeavesService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; @@ -41,31 +40,22 @@ public class LeavesController { return "Leave"; } + //提交请假申请 @RequestMapping(value = "/Leave/check", method = RequestMethod.POST) @ResponseBody - String checkLeave(HttpServletRequest request){ + String requestLeave(HttpServletRequest request){ // 检查是否为JSON Optional json = jsonParameter.getJSONByRequest(request); if(!json.isPresent()) return jsonParameter.getJSONString(new FailedSONRespond()); - UserLeaveChecker LeaveChecker = json.get().toJavaObject(UserLeaveChecker.class); + UserLeaveRequest LeaveChecker = json.get().toJavaObject(UserLeaveRequest.class); // 检查类型 - if(LeaveChecker.getCheckType().equals("UsernameExistChecker")){ - // 根据学号计算用户名 - String user = usernameEncoder.encode(LeaveChecker.getUsername()) ; - // 查询用户名存在状态 - boolean existStatus = userService.checkIfUserExists(user).getKey(); - // 构造返回对象 - UserLeaveCheckerJSONRespond respond = new UserLeaveCheckerJSONRespond(); - respond.setUserExist(existStatus); - return jsonParameter.getJSONString(respond); - } - else { - // 返回失败对象 - return jsonParameter.getJSONString(new JSONBaseRespondObject()); - } + } + //列出某辅导员待审核名单 + + //列出某人 } diff --git a/src/main/java/com/codesdream/ase/model/leaves/Leave.java b/src/main/java/com/codesdream/ase/model/leaves/Leave.java index 80a00ae..5cf3b32 100644 --- a/src/main/java/com/codesdream/ase/model/leaves/Leave.java +++ b/src/main/java/com/codesdream/ase/model/leaves/Leave.java @@ -17,15 +17,25 @@ public class Leave { //审批人容器 @ManyToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY) private Set userTo; + //请假原因 + @Column + private String reasonToLeave; + + //请假类型 病假,事假等 @Column(name = "type", nullable = false) private String type; //批准状态 @Column(name = "Authentication", nullable = false) - private Boolean Authentication; + private String Authentication; + + //审核备注 + @Column + private String Comment; //开始时间 @Column(nullable = false) private Date startTime; + @Column(nullable = false) private Date endTime; //申请时间