Skip to content

Commit

Permalink
HRManagement除微信小程序打卡功能,基本完成。
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexYY0 committed Mar 15, 2020
1 parent 901c51b commit 784cc28
Show file tree
Hide file tree
Showing 102 changed files with 3,675 additions and 1,088 deletions.
245 changes: 189 additions & 56 deletions .idea/workspace.xml

Large diffs are not rendered by default.

482 changes: 0 additions & 482 deletions HRManagement.sql

This file was deleted.

9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
Expand Down Expand Up @@ -99,6 +103,11 @@
<artifactId>qiniu-java-sdk</artifactId>
<version>7.2.28</version>
</dependency>
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>1.21</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emperorws.hrmanagement.controller;

import com.emperorws.hrmanagement.logger.SystemControllerLog;
import com.emperorws.hrmanagement.model.RespBean;
import com.emperorws.hrmanagement.model.User;
import com.emperorws.hrmanagement.service.UserService;
Expand All @@ -24,11 +25,13 @@ public class UserInfoController {
UserService userService;

@GetMapping("/info")
@SystemControllerLog(description="获取当前系统用户信息")
public User getCurrentUser(Authentication authentication) {
return ((User) authentication.getPrincipal());
}

@PutMapping("/info")
@SystemControllerLog(description="修改当前的系统用户信息")
public RespBean updateUser(@RequestBody User user, Authentication authentication) {
if (userService.updateUser(user) == 1) {
SecurityContextHolder.getContext().setAuthentication(new UsernamePasswordAuthenticationToken(user, authentication.getCredentials(), authentication.getAuthorities()));
Expand All @@ -38,6 +41,7 @@ public RespBean updateUser(@RequestBody User user, Authentication authentication
}

@PutMapping("/password")
@SystemControllerLog(description="修改当前的系统用户密码信息")
public RespBean updateUserPassword(@RequestBody Map<String, Object> info,Authentication authentication) {
String oldpassword = (String) info.get("oldpassword");
String password = (String) info.get("password");
Expand All @@ -49,16 +53,19 @@ public RespBean updateUserPassword(@RequestBody Map<String, Object> info,Authent
}

@GetMapping("/check/username/{username}")
@SystemControllerLog(description="通过用户名获取系统用户信息")
public Boolean getUserByUsername(@PathVariable String username){
return userService.getUserByUsername(username);
}

@GetMapping("/check/password")
@SystemControllerLog(description="获取当前的系统用户密码信息")
public Boolean getUserByPassword(String password,Integer userid){
return userService.getUserByPassword(password,userid);
}

@GetMapping("/token")
@SystemControllerLog(description="获取上传文件到云端的令牌")
public String getToken(){
String accessKey = "HHpVv8wj2T-IGv8JrjZFArdSUy6QGMxuo10k7Hnd";
String secretKey = "qoAkFOku7m6wouAwum45Ef-SiCTrOarj5QTgZQ3y";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.emperorws.hrmanagement.controller.attendance;

import com.emperorws.hrmanagement.logger.SystemControllerLog;
import com.emperorws.hrmanagement.model.*;
import com.emperorws.hrmanagement.service.AppattService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;
import java.util.Date;
import java.util.List;

Expand All @@ -21,24 +23,28 @@ public class AppattController {
AppattService appattService;

@GetMapping("/uncommittedappatt")
@SystemControllerLog(description="获取员工本人未提交的考勤事务申请")
public RespPageBean getUncommittedAppattByWorkid(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Authentication authentication) {
User user=(User) authentication.getPrincipal();
return appattService.getAppattByWorkid(page, size, false, null, user.getWorkid());
}

@GetMapping("/inhandappatt")
@SystemControllerLog(description="获取员工本人流程中的考勤事务申请")
public RespPageBean getInhandAppattByWorkidAndPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Authentication authentication) {
User user=(User) authentication.getPrincipal();
return appattService.getAppattByWorkid(page, size, true, null, user.getWorkid());
}

@GetMapping("/overappatt")
@SystemControllerLog(description="获取员工本人已完成的考勤事务申请")
public RespPageBean getOverAppattByWorkidAndPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Authentication authentication) {
User user=(User) authentication.getPrincipal();
return appattService.getAppattByWorkid(page, size, true, true, user.getWorkid());
}

@DeleteMapping("/{aatid}")
@SystemControllerLog(description="删除员工本人未提交的考勤事务申请")
public RespBean deleteUncommittedAppattById(@PathVariable Integer aatid,Authentication authentication){
User user=(User) authentication.getPrincipal();
if (appattService.deleteUncommittedAppattById(aatid,user.getWorkid()) == 1) {
Expand All @@ -48,6 +54,7 @@ public RespBean deleteUncommittedAppattById(@PathVariable Integer aatid,Authenti
}

@PostMapping("/deleteappatts")
@SystemControllerLog(description="批量删除员工本人未提交的考勤事务申请")
public RespBean deleteUncommittedAppatts(@RequestBody List<Appatt> appatts,Authentication authentication){
User user=(User) authentication.getPrincipal();
if(appattService.deleteUncommittedAppatts(appatts,user.getWorkid())==appatts.size()){
Expand All @@ -57,6 +64,7 @@ public RespBean deleteUncommittedAppatts(@RequestBody List<Appatt> appatts,Authe
}

@PostMapping("/")
@SystemControllerLog(description="添加员工本人未提交的考勤事务申请")
public RespBean addUncommittedAppatt(@RequestBody Appatt appatt,Authentication authentication){
User user=(User) authentication.getPrincipal();
appatt.setWorkid(user.getWorkid());
Expand All @@ -67,6 +75,7 @@ public RespBean addUncommittedAppatt(@RequestBody Appatt appatt,Authentication a
}

@PutMapping("/")
@SystemControllerLog(description="更新员工本人未提交的考勤事务申请")
public RespBean updateUncommittedAppatt(@RequestBody Appatt appatt,Authentication authentication){
User user=(User) authentication.getPrincipal();
appatt.setWorkid(user.getWorkid());
Expand All @@ -75,4 +84,11 @@ public RespBean updateUncommittedAppatt(@RequestBody Appatt appatt,Authenticatio
}
return RespBean.error("更新失败!");
}

@GetMapping("/calcappatttime")
@SystemControllerLog(description="计算员工本人考勤事务申请的时间")
public double calcAppattTime(@RequestParam(defaultValue = " ",value = "leavedaterange", required = false) Date[] leavedaterange,Authentication authentication) throws ParseException {
User user=(User) authentication.getPrincipal();
return appattService.calcAppattTime(user.getWorkid(),leavedaterange);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.emperorws.hrmanagement.controller.attendance;

import com.emperorws.hrmanagement.logger.SystemControllerLog;
import com.emperorws.hrmanagement.model.*;
import com.emperorws.hrmanagement.service.AttelogdayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
* @Author: EmperorWS
* @Date: 2020/3/12 21:21
* @Description: 每日考勤管理控制层
**/
@RestController
@RequestMapping("/attendance/managementofday")
public class AttelogdayController {
@Autowired
AttelogdayService attelogdayService;

@GetMapping("/")
@SystemControllerLog(description="获取员工的每日考勤数据")
public RespPageBean getAttelogdayByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Employee employee, Date[] clockinday) {
return attelogdayService.getAttelogdayByPage(page, size, employee, clockinday);
}

@PutMapping("/")
@SystemControllerLog(description="修改旧的员工每日考勤数据")
public RespBean updateAttelogday(@RequestBody Attelogday attelogday){
if (attelogdayService.updateAttelogday(attelogday) == 1) {
return RespBean.ok("修改成功!");
}
return RespBean.error("修改失败!");
}

@DeleteMapping("/{attelogdayid}")
@SystemControllerLog(description="删除旧的员工每日考勤数据")
public RespBean deleteAttelogdayById(@PathVariable Integer attelogdayid){
if (attelogdayService.deleteAttelogdayById(attelogdayid) == 1) {
return RespBean.ok("删除成功!");
}
return RespBean.error("删除失败!");
}

@PostMapping("/deleteattedays")
@SystemControllerLog(description="批量删除旧的员工每日考勤数据")
public RespBean deleteAttelogdays(@RequestBody List<Attelogday> attelogdays){
if(attelogdayService.deleteAttelogdays(attelogdays)==attelogdays.size()){
return RespBean.ok("批量删除成功!");
}
return RespBean.error("批量删除失败!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.emperorws.hrmanagement.controller.attendance;

import com.emperorws.hrmanagement.logger.SystemControllerLog;
import com.emperorws.hrmanagement.model.*;
import com.emperorws.hrmanagement.service.AttelogmonService;
import com.emperorws.hrmanagement.utils.AttelogmonPOIUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
* @Author: EmperorWS
* @Date: 2020/3/10 16:51
* @Description: 考勤月度统计控制层
**/
@RestController
@RequestMapping("/attendance/managementofmonth")
public class AttelogmonController {
@Autowired
AttelogmonService attelogmonService;

@GetMapping("/")
@SystemControllerLog(description="获取员工的历史月度考勤统计数据")
public RespPageBean getAttelogmonByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Employee employee, Date[] caldate) {
return attelogmonService.getAttelogmonByPage(page, size, employee, caldate);
}

@DeleteMapping("/{attelogmonid}")
@SystemControllerLog(description="删除旧的员工历史月度考勤统计数据")
public RespBean deleteAttelogmonById(@PathVariable Integer attelogmonid){
if (attelogmonService.deleteAttelogmonById(attelogmonid) == 1) {
return RespBean.ok("删除成功!");
}
return RespBean.error("删除失败!");
}

@PutMapping("/")
@SystemControllerLog(description="修改旧的员工历史月度考勤统计数据")
public RespBean updateAttelogmon(@RequestBody Attelogmon attelogmon){
if (attelogmonService.updateAttelogmon(attelogmon) == 1) {
return RespBean.ok("更新成功!");
}
return RespBean.error("更新失败!");
}

@PostMapping("/deleteattemons")
@SystemControllerLog(description="批量删除旧的员工历史月度考勤统计数据")
public RespBean deleteAttelogmons(@RequestBody List<Attelogmon> attelogmons){
if(attelogmonService.deleteAttelogmons(attelogmons)==attelogmons.size()){
return RespBean.ok("批量删除成功!");
}
return RespBean.error("批量删除失败!");
}

@GetMapping("/calcall")
@SystemControllerLog(description="自动统计所有员工的上月考勤数据")
public RespBean statisticsAll(Date[] monthday){
if(attelogmonService.statisticsAll(monthday)){
return RespBean.ok("统计所有员工的考勤数据成功!");
}
return RespBean.error("统计所有员工的考勤数据失败!");
}

@GetMapping("/calcbydepid")
@SystemControllerLog(description="自动统计所选部门的所有员工的上月考勤数据")
public RespBean statisticsByDepid(Integer depid,Date[] monthday){
if(attelogmonService.statisticsByDepid(depid,monthday)){
return RespBean.ok("统计所选部门的所有员工的考勤数据成功!");
}
return RespBean.error("统计所选部门的所有员工的考勤数据失败!");
}

@PostMapping("/calcbyworkid")
@SystemControllerLog(description="自动统计所选部门的所有员工的上月考勤数据")
public RespBean statisticsByWorkid(@RequestParam Date[] monthday,@RequestBody List<Employee> employees){
if(attelogmonService.statisticsByWorkid(employees,monthday)){
return RespBean.ok("统计所选员工的考勤数据成功!");
}
return RespBean.error("统计所选员工的考勤数据失败!");
}

@PostMapping("/export")
@SystemControllerLog(description="批量导出员工的考勤月度统计信息")
public ResponseEntity<byte[]> exportData(@RequestBody List<Attelogmon> list) {
return AttelogmonPOIUtils.attelogmon2Excel(list);
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.emperorws.hrmanagement.controller.attendance;

import com.emperorws.hrmanagement.logger.SystemControllerLog;
import com.emperorws.hrmanagement.model.Employee;
import com.emperorws.hrmanagement.model.RespPageBean;
import com.emperorws.hrmanagement.service.TransactioninfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
Expand All @@ -24,7 +24,8 @@ public class TransactioninfoController {
TransactioninfoService transactioninfoService;

@GetMapping("/")
public RespPageBean getTransactioninfoByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Employee employee, Date[] appdata){
return transactioninfoService.getTransactioninfoByPage(page, size, employee, appdata);
@SystemControllerLog(description="获取所有的考勤事务申请")
public RespPageBean getTransactioninfoByPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Employee employee, Date[] appdate){
return transactioninfoService.getTransactioninfoByPage(page, size, employee, appdate);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.emperorws.hrmanagement.controller.attendance;

import com.emperorws.hrmanagement.logger.SystemControllerLog;
import com.emperorws.hrmanagement.model.Appatt;
import com.emperorws.hrmanagement.model.RespBean;
import com.emperorws.hrmanagement.model.RespPageBean;
Expand All @@ -9,6 +10,8 @@
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;

/**
* @Author: EmperorWS
* @Date: 2020/3/5 22:04
Expand All @@ -21,19 +24,22 @@ public class TransactionmanagementController {
TransactionmanagementService transactionmanagementService;

@GetMapping("/readydoapp")
@SystemControllerLog(description="领导获取员工流程中的考勤事务申请")
public RespPageBean getReadyDoAppByWorkidAndPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Authentication authentication) {
User user=(User) authentication.getPrincipal();
return transactionmanagementService.getManaAppByWorkidAndPage(page, size, null ,user.getWorkid());
}

@GetMapping("/finishedapp")
@SystemControllerLog(description="领导获取员工已完成的考勤事务申请")
public RespPageBean getFinishedAppByWorkidAndPage(@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer size, Authentication authentication) {
User user=(User) authentication.getPrincipal();
return transactionmanagementService.getManaAppByWorkidAndPage(page, size, true, user.getWorkid());
}

@PutMapping("/")
public RespBean updateManaApp(@RequestBody Appatt appatt, Authentication authentication){
@SystemControllerLog(description="领导同意或拒绝员工的考勤事务申请")
public RespBean updateManaApp(@RequestBody Appatt appatt, Authentication authentication) throws ParseException {
User user=(User) authentication.getPrincipal();
if (transactionmanagementService.updateManaApp(appatt,user.getWorkid()) == 1) {
return RespBean.ok("更新成功!");
Expand Down
Loading

0 comments on commit 784cc28

Please sign in to comment.