Compare commits
No commits in common. "master" and "main" have entirely different histories.
28
.gitignore
vendored
28
.gitignore
vendored
@ -1,2 +1,26 @@
|
||||
target
|
||||
.idea
|
||||
# ---> Java
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
|
||||
20
LICENSE
20
LICENSE
@ -1,20 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 evo
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 清理工程target生成路径。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean
|
||||
|
||||
pause
|
||||
@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 打包Web工程,生成war/jar包文件。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
call mvn clean package -Dmaven.test.skip=true
|
||||
|
||||
pause
|
||||
14
bin/run.bat
14
bin/run.bat
@ -1,14 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 使用Jar命令运行Web工程。
|
||||
echo.
|
||||
|
||||
cd %~dp0
|
||||
cd ../ruoyi-admin/target
|
||||
|
||||
set JAVA_OPTS=-Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||
|
||||
java -jar %JAVA_OPTS% ruoyi-admin.jar
|
||||
|
||||
cd bin
|
||||
pause
|
||||
@ -1,277 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>evo</artifactId>
|
||||
<groupId>com.evo</groupId>
|
||||
<version>3.8.8</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>evo-tech</artifactId>
|
||||
|
||||
<description>
|
||||
web服务入口
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.4.3.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>2.1.1</version>
|
||||
</dependency>
|
||||
<!-- spring-boot-devtools -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional> <!-- 表示依赖不会传递 -->
|
||||
</dependency>
|
||||
|
||||
<!-- swagger3-->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Mysql驱动包 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot Web容器 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringBoot 拦截器 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里数据库连接池 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
<artifactId>oshi-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- velocity代码生成使用模板 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring框架基本的核心工具 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringWeb模块 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- spring security 安全认证 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- 自定义验证注解 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--常用工具类 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- JSON工具类 -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 阿里JSON解析器 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- io常用工具类 -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- excel工具 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- PDF -->
|
||||
<dependency>
|
||||
<groupId>com.itextpdf</groupId>
|
||||
<artifactId>itextpdf</artifactId>
|
||||
<version>5.5.13</version>
|
||||
</dependency>
|
||||
<!-- pdf转为图片 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
<artifactId>fontbox</artifactId>
|
||||
<version>2.0.9</version>
|
||||
</dependency>
|
||||
|
||||
<!-- yml解析器 -->
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Token生成与解析-->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Jaxb -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- redis 缓存操作 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- pool 对象池 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-pool2</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 解析客户端操作系统、浏览器等 -->
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- servlet包 -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- websocket -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.openjdk.nashorn</groupId>
|
||||
<artifactId>nashorn-core</artifactId>
|
||||
<version>15.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 金蝶 -->
|
||||
<dependency>
|
||||
<groupId>com.kingdee.bos</groupId>
|
||||
<artifactId>k3cloud-webapi-sdk-java11</artifactId>
|
||||
<version>v8.2.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/lib/k3cloud-webapi-sdk-java11-v8.2.0.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.9</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-http</artifactId>
|
||||
<version>5.8.35</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.15</version>
|
||||
<configuration>
|
||||
<fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<failOnMissingWebXml>false</failOnMissingWebXml>
|
||||
<warName>${project.artifactId}</warName>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@ -1,24 +0,0 @@
|
||||
package com.evo;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 启动程序
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
@EnableScheduling
|
||||
@MapperScan({"com.evo.**.mapper.**.**"})
|
||||
public class EvoApplication
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
SpringApplication.run(EvoApplication.class, args);
|
||||
System.out.println("(♥◠‿◠)ノ゙ ***************************************************************************************************************************** ERP 启动成功 ************************************************************************************************************************ ლ(´ڡ`ლ)゙ \n");
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.evo;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* web容器中进行部署
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class EvoServletInitializer extends SpringBootServletInitializer
|
||||
{
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
|
||||
{
|
||||
return application.sources(EvoApplication.class);
|
||||
}
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import com.evo.attendance.service.PunchTheClockService;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1")
|
||||
public class PunchTheClockController {
|
||||
|
||||
@Resource
|
||||
private PunchTheClockService punchTheClockService;
|
||||
|
||||
/**
|
||||
* 刷脸获取打卡按钮权限
|
||||
* sn 设备号
|
||||
* type 设备识别类型
|
||||
* user_id 用户id
|
||||
* card 人员信息中的卡号
|
||||
* confidence 人脸算法识别到的相识度
|
||||
* temperature 测量到的温度,未开启测温的设备为空
|
||||
*
|
||||
* 响应: Result 返回请求类型:0:可以打卡,其它值表示无法打卡
|
||||
* Msg 对应 Result 的状态,可为空
|
||||
* Content 识别后返回的详细信息
|
||||
* button 9位长度的字符串,0 表示不可以点击 1 表示可以点击
|
||||
*
|
||||
* String sn,String type,String userId,String card,String confidence
|
||||
*/
|
||||
@RequestMapping("/verify_user")
|
||||
public String verifyUser(@RequestBody String json){
|
||||
return punchTheClockService.returnMessage(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户点击打卡按钮后请求的接口
|
||||
* sn 设备号
|
||||
* user_id 人员id
|
||||
* user_name 用户名
|
||||
* user_type 用户类型,对应下发人员时的 user_type
|
||||
* card_number 卡号
|
||||
* recog_type 识别类型: face - 为人脸识别 、card - 刷卡开门,人脸或卡模式
|
||||
* recog_time 识别时间(时间格式yyyy-MM-dd HH:mm:ss)
|
||||
* photo 识别照片,服务端收到后转换成图片步骤请查看 2、服务规范 - 照片解码流程
|
||||
* body_temperature 体温
|
||||
* confidence 通过的置信度
|
||||
* button 1~9 表示点击的是第几个按钮
|
||||
*
|
||||
* 响应:Result 返回请求类型:0成功,其它失败
|
||||
* Msg 对应 Result 的文本信息
|
||||
*
|
||||
* String sn,String userId,String userName,String userType,String cardNumber,String recog_type,String recog_time,String photo,String body_temperature,String confidence,String button
|
||||
*/
|
||||
@RequestMapping("/record/face")
|
||||
public String face(@RequestBody String json) throws UnsupportedEncodingException {
|
||||
return punchTheClockService.recordFace(json);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.attendance.domain.RzAbnormal;
|
||||
import com.evo.attendance.service.IRzAbnormalService;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 考勤异常Controller
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/abnormal")
|
||||
public class RzAbnormalController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRzAbnormalService rzAbnormalService;
|
||||
|
||||
/**
|
||||
* 查询考勤异常列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormal:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzAbnormal rzAbnormal)
|
||||
{
|
||||
startPage();
|
||||
List<RzAbnormal> list = rzAbnormalService.selectRzAbnormalList(rzAbnormal);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出考勤异常列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormal:export')")
|
||||
@Log(title = "考勤异常", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzAbnormal rzAbnormal)
|
||||
{
|
||||
List<RzAbnormal> list = rzAbnormalService.selectRzAbnormalList(rzAbnormal);
|
||||
ExcelUtil<RzAbnormal> util = new ExcelUtil<RzAbnormal>(RzAbnormal.class);
|
||||
util.exportExcel(response, list, "考勤异常数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤异常详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormal:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzAbnormalService.selectRzAbnormalById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤异常
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormal:edit')")
|
||||
@Log(title = "考勤异常", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzAbnormal rzAbnormal)
|
||||
{
|
||||
return toAjax(rzAbnormalService.updateRzAbnormal(rzAbnormal));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤异常
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormal:remove')")
|
||||
@Log(title = "考勤异常", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(rzAbnormalService.deleteRzAbnormalById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常详情
|
||||
* @param rzAbnormal
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/listAbnormalDetails")
|
||||
public List<RzAbnormalDetail> listAbnormalDetails(RzAbnormal rzAbnormal)
|
||||
{
|
||||
return rzAbnormalService.listAbnormalDetails(rzAbnormal);
|
||||
}
|
||||
}
|
||||
@ -1,89 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
import com.evo.attendance.service.IRzAbnormalDetailService;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 考勤异常详情Controller
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/abnormalDetail")
|
||||
public class RzAbnormalDetailController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRzAbnormalDetailService rzAbnormalDetailService;
|
||||
|
||||
/**
|
||||
* 查询考勤异常详情列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormalDetail:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzAbnormalDetail rzAbnormalDetail) {
|
||||
|
||||
startPage();
|
||||
List<RzAbnormalDetail> list = rzAbnormalDetailService.selectRzAbnormalDetailList(rzAbnormalDetail);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出考勤异常详情列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormalDetail:export')")
|
||||
@Log(title = "考勤异常详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzAbnormalDetail rzAbnormalDetail)
|
||||
{
|
||||
List<RzAbnormalDetail> list = rzAbnormalDetailService.selectRzAbnormalDetailList(rzAbnormalDetail);
|
||||
ExcelUtil<RzAbnormalDetail> util = new ExcelUtil<RzAbnormalDetail>(RzAbnormalDetail.class);
|
||||
util.exportExcel(response, list, "考勤异常详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤异常详情详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormalDetail:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzAbnormalDetailService.selectRzAbnormalDetailById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤异常详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormalDetail:edit')")
|
||||
@Log(title = "考勤异常详情", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzAbnormalDetail rzAbnormalDetail)
|
||||
{
|
||||
return toAjax(rzAbnormalDetailService.updateRzAbnormalDetail(rzAbnormalDetail));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤异常详情
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormalDetail:remove')")
|
||||
@Log(title = "考勤异常详情", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(rzAbnormalDetailService.deleteRzAbnormalDetailById(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,128 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailVO;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.SysUser;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.service.IRzAttendanceService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤记录Controller
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/attendance")
|
||||
public class RzAttendanceController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private IRzAttendanceService rzAttendanceService;
|
||||
@Resource
|
||||
private RzAttendanceDetailService rzAttendanceDetailService;
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:attendance:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzAttendance rzAttendance)
|
||||
{
|
||||
startPage();
|
||||
List<RzAttendance> list = rzAttendanceService.selectRzAttendanceList(rzAttendance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出考勤记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:attendance:export')")
|
||||
@Log(title = "考勤记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzAttendance rzAttendance)
|
||||
{
|
||||
List<RzAttendance> list = rzAttendanceService.selectRzAttendanceList(rzAttendance);
|
||||
ExcelUtil<RzAttendance> util = new ExcelUtil<RzAttendance>(RzAttendance.class);
|
||||
util.exportExcel(response, list, "考勤记录");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:attendance:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzAttendanceService.selectRzAttendanceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:attendance:edit')")
|
||||
@Log(title = "考勤记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzAttendance rzAttendance)
|
||||
{
|
||||
return toAjax(rzAttendanceService.updateRzAttendance(rzAttendance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 每日上班打卡统计
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/attendenceCount")
|
||||
public int attendenceCount()
|
||||
{
|
||||
return rzAttendanceService.attendenceCount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改考勤记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:attendance:edit')")
|
||||
@Log(title = "考勤记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping(value = "/updateBatchAttendance")
|
||||
public AjaxResult updateBatchAttendance(@RequestBody RzAttendance rzAttendance)
|
||||
{
|
||||
return rzAttendanceService.updateBatchAttendance(rzAttendance);
|
||||
}
|
||||
|
||||
@GetMapping("/listAttendanceByParams")
|
||||
public TableDataInfo listAttendanceByParams(RzAttendance rzAttendance)
|
||||
{
|
||||
startPage();
|
||||
List<RzAttendance> list = rzAttendanceService.listAttendanceByParams(rzAttendance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
@Log(title = "导入补卡记录", businessType = BusinessType.IMPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:attendance:importData')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception
|
||||
{
|
||||
ExcelUtil<RzAttendanceDetailVO> util = new ExcelUtil<>(RzAttendanceDetailVO.class);
|
||||
List<RzAttendanceDetailVO> attendanceList = util.importExcel(file.getInputStream());
|
||||
|
||||
return rzAttendanceService.importAttendance(attendanceList);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/detail/list/{id}")
|
||||
public AjaxResult findDetailList(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzAttendanceDetailService.selectListByAttendanceId(id));
|
||||
}
|
||||
}
|
||||
@ -1,130 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.annotation.RepeatSubmit;
|
||||
import com.evo.common.constant.HttpStatus;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.attendance.service.IRzAttendanceStatisticalService;
|
||||
import com.evo.finance.service.IRzSalaryStatisticsService;
|
||||
import com.evo.system.service.ISysStatisticalOperationLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤统计Controller
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/statistical")
|
||||
public class RzAttendanceStatisticalController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private IRzAttendanceStatisticalService rzAttendanceStatisticalService;
|
||||
@Autowired
|
||||
private IRzSalaryStatisticsService rzSalaryStatisticsService;
|
||||
@Resource
|
||||
private ISysStatisticalOperationLogService sysStatisticalOperationLogService;
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
||||
/**
|
||||
* 查询考勤统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzAttendanceStatistical rzAttendanceStatistical)
|
||||
{
|
||||
startPage();
|
||||
List<RzAttendanceStatistical> list = rzAttendanceStatisticalService.selectRzAttendanceStatisticalList(rzAttendanceStatistical);
|
||||
List<String> createMonth = rzSalaryStatisticsService.selectMonthList();
|
||||
list.stream().forEach(data ->{
|
||||
data.setAllowAdjustment(createMonth.contains(sdf.format(data.getMonth())));
|
||||
});
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出考勤统计列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:export')")
|
||||
@Log(title = "考勤统计", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzAttendanceStatistical rzAttendanceStatistical)
|
||||
{
|
||||
List<RzAttendanceStatistical> list = rzAttendanceStatisticalService.selectRzAttendanceStatisticalList(rzAttendanceStatistical);
|
||||
ExcelUtil<RzAttendanceStatistical> util = new ExcelUtil<RzAttendanceStatistical>(RzAttendanceStatistical.class);
|
||||
util.exportExcel(response, list, "考勤统计数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤统计详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzAttendanceStatisticalService.selectRzAttendanceStatisticalById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤统计
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:edit')")
|
||||
@Log(title = "考勤统计", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzAttendanceStatistical rzAttendanceStatistical)
|
||||
{
|
||||
return toAjax(rzAttendanceStatisticalService.updateRzAttendanceStatistical(rzAttendanceStatistical));
|
||||
}
|
||||
|
||||
/**
|
||||
* 校正数据
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:correct')")
|
||||
@RequestMapping(value = "correct")
|
||||
@RepeatSubmit
|
||||
public AjaxResult correct(@RequestBody RzAttendanceStatistical rzAttendanceStatistical)
|
||||
{
|
||||
if (StringUtils.isNull(rzAttendanceStatistical) || StringUtils.isNull(rzAttendanceStatistical.getMonth())) {
|
||||
return AjaxResult.error("请输入校正日期!!");
|
||||
}
|
||||
AjaxResult result = rzAttendanceStatisticalService.autoCalculateTheDayBeforeAttendance(rzAttendanceStatistical.getMonth());
|
||||
//如果操作记录成功, 则打开统计的操作记录, 不写在service的原因是有定时器, 每天在执行
|
||||
if(Integer.parseInt(String.valueOf(result.get(AjaxResult.CODE_TAG))) == HttpStatus.SUCCESS){
|
||||
ParamUtils.updateLogOperation(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:import')")
|
||||
@PostMapping("/importData")
|
||||
public AjaxResult importData(MultipartFile file) throws Exception
|
||||
{
|
||||
ExcelUtil<RzAttendanceStatistical> util = new ExcelUtil<RzAttendanceStatistical>(RzAttendanceStatistical.class);
|
||||
List<RzAttendanceStatistical> attList = util.importExcel(file.getInputStream());
|
||||
return rzAttendanceStatisticalService.importRzAttendanceStatistical(attList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取考勤统计的操作记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:statistical:oper')")
|
||||
@GetMapping(value = "/oper/{id}")
|
||||
public AjaxResult getOper(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysStatisticalOperationLogService.getOperationByBusinessId(id, RzAttendanceStatistical.class));
|
||||
}
|
||||
}
|
||||
@ -1,104 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.evo.attendance.domain.RzSpecialAttendance;
|
||||
import com.evo.attendance.service.IRzSpecialAttendanceService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 加班考勤记录Controller
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/specialAttendance")
|
||||
public class RzSpecialAttendanceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRzSpecialAttendanceService rzSpecialAttendanceService;
|
||||
|
||||
/**
|
||||
* 查询加班考勤记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialAttendance:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
startPage();
|
||||
List<RzSpecialAttendance> list = rzSpecialAttendanceService.selectRzSpecialAttendanceList(rzSpecialAttendance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出加班考勤记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialAttendance:export')")
|
||||
@Log(title = "加班考勤记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
List<RzSpecialAttendance> list = rzSpecialAttendanceService.selectRzSpecialAttendanceList(rzSpecialAttendance);
|
||||
ExcelUtil<RzSpecialAttendance> util = new ExcelUtil<RzSpecialAttendance>(RzSpecialAttendance.class);
|
||||
util.exportExcel(response, list, "加班考勤记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取加班考勤记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialAttendance:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzSpecialAttendanceService.selectRzSpecialAttendanceById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增加班考勤记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialAttendance:add')")
|
||||
@Log(title = "加班考勤记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
return toAjax(rzSpecialAttendanceService.insertRzSpecialAttendance(rzSpecialAttendance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改加班考勤记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialAttendance:edit')")
|
||||
@Log(title = "加班考勤记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
return toAjax(rzSpecialAttendanceService.updateRzSpecialAttendance(rzSpecialAttendance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除加班考勤记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialAttendance:remove')")
|
||||
@Log(title = "加班考勤记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(rzSpecialAttendanceService.deleteRzSpecialAttendanceById(id));
|
||||
}
|
||||
}
|
||||
@ -1,104 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.evo.attendance.domain.RzSpecialOverTime;
|
||||
import com.evo.attendance.service.IRzSpecialOverTimeService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 特殊加班管理Controller
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/specialTime")
|
||||
public class RzSpecialOverTimeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRzSpecialOverTimeService rzSpecialOverTimeService;
|
||||
|
||||
/**
|
||||
* 查询特殊加班管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialTime:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
startPage();
|
||||
List<RzSpecialOverTime> list = rzSpecialOverTimeService.selectRzSpecialOverTimeList(rzSpecialOverTime);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出特殊加班管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialTime:export')")
|
||||
@Log(title = "特殊加班管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
List<RzSpecialOverTime> list = rzSpecialOverTimeService.selectRzSpecialOverTimeList(rzSpecialOverTime);
|
||||
ExcelUtil<RzSpecialOverTime> util = new ExcelUtil<RzSpecialOverTime>(RzSpecialOverTime.class);
|
||||
util.exportExcel(response, list, "特殊加班管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特殊加班管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialTime:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzSpecialOverTimeService.selectRzSpecialOverTimeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特殊加班管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialTime:add')")
|
||||
@Log(title = "特殊加班管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
return toAjax(rzSpecialOverTimeService.insertRzSpecialOverTime(rzSpecialOverTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特殊加班管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialTime:edit')")
|
||||
@Log(title = "特殊加班管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
return toAjax(rzSpecialOverTimeService.updateRzSpecialOverTime(rzSpecialOverTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除特殊加班管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:specialTime:remove')")
|
||||
@Log(title = "特殊加班管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult remove(@PathVariable Long id)
|
||||
{
|
||||
return toAjax(rzSpecialOverTimeService.deleteRzSpecialOverTimeById(id));
|
||||
}
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.evo.common.annotation.Log;
|
||||
import com.evo.common.core.controller.BaseController;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.attendance.domain.RzSysParam;
|
||||
import com.evo.attendance.service.IRzSysParamService;
|
||||
import com.evo.common.utils.poi.ExcelUtil;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 参数配置Controller
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attendance/param")
|
||||
public class RzSysParamController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IRzSysParamService rzSysParamService;
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:params:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzSysParam rzSysParam)
|
||||
{
|
||||
startPage();
|
||||
List<RzSysParam> list = rzSysParamService.selectRzSysParamList(rzSysParam);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出参数配置列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:params:export')")
|
||||
@Log(title = "参数配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RzSysParam rzSysParam)
|
||||
{
|
||||
List<RzSysParam> list = rzSysParamService.selectRzSysParamList(rzSysParam);
|
||||
ExcelUtil<RzSysParam> util = new ExcelUtil<RzSysParam>(RzSysParam.class);
|
||||
util.exportExcel(response, list, "参数配置数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取参数配置详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:params:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(rzSysParamService.selectRzSysParamById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('param:params:add')")
|
||||
@Log(title = "参数配置", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody RzSysParam rzSysParam)
|
||||
{
|
||||
return toAjax(rzSysParamService.insertRzSysParam(rzSysParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:params:edit')")
|
||||
@Log(title = "参数配置", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody RzSysParam rzSysParam)
|
||||
{
|
||||
return toAjax(rzSysParamService.updateRzSysParam(rzSysParam));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:params:remove')")
|
||||
@Log(title = "参数配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(rzSysParamService.deleteRzSysParamByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/allow/adjustment")
|
||||
public AjaxResult getAllowAdjustment()
|
||||
{
|
||||
return success(ParamUtils.checkLogOperation());
|
||||
}
|
||||
}
|
||||
@ -1,152 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 考勤异常对象 rz_abnormal
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public class RzAbnormal extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 部门 */
|
||||
@Excel(name = "部门")
|
||||
private Long deptId;
|
||||
|
||||
private String deptName;
|
||||
|
||||
/** 员工ID */
|
||||
@Excel(name = "员工ID")
|
||||
private Long userId;
|
||||
|
||||
/** 员工姓名 */
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
/** 月份 */
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
@Excel(name = "月份", width = 30, dateFormat = "yyyy-MM")
|
||||
private Date month;
|
||||
|
||||
/** 次数 */
|
||||
@Excel(name = "次数")
|
||||
private Long number;
|
||||
|
||||
/** 金额 */
|
||||
@Excel(name = "金额")
|
||||
private BigDecimal money;
|
||||
|
||||
/** 删除标识 */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public Date getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(Date month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public void setNumber(Long number)
|
||||
{
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public Long getNumber()
|
||||
{
|
||||
return number;
|
||||
}
|
||||
public void setMoney(BigDecimal money)
|
||||
{
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public BigDecimal getMoney()
|
||||
{
|
||||
return money;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("userId", getUserId())
|
||||
.append("name", getName())
|
||||
.append("month", getMonth())
|
||||
.append("number", getNumber())
|
||||
.append("money", getMoney())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,153 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 考勤异常详情对象 rz_abnormal_detail
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public class RzAbnormalDetail extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 异常ID
|
||||
*/
|
||||
@Excel(name = "异常ID")
|
||||
private Long abnormalId;
|
||||
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "考勤时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date clockDate;
|
||||
|
||||
private String clockType;
|
||||
|
||||
|
||||
/**
|
||||
* 打卡时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date abnormalTime;
|
||||
|
||||
/**
|
||||
* 激励金额
|
||||
*/
|
||||
@Excel(name = "激励金额")
|
||||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
private String remarks;
|
||||
|
||||
|
||||
public Date getClockDate() {
|
||||
return clockDate;
|
||||
}
|
||||
|
||||
public void setClockDate(Date clockDate) {
|
||||
this.clockDate = clockDate;
|
||||
}
|
||||
|
||||
public String getClockType() {
|
||||
return clockType;
|
||||
}
|
||||
|
||||
public void setClockType(String clockType) {
|
||||
this.clockType = clockType;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Long getAbnormalId() {
|
||||
return abnormalId;
|
||||
}
|
||||
|
||||
public void setAbnormalId(Long abnormalId) {
|
||||
this.abnormalId = abnormalId;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setAbnormalTime(Date abnormalTime) {
|
||||
this.abnormalTime = abnormalTime;
|
||||
}
|
||||
|
||||
public Date getAbnormalTime() {
|
||||
return abnormalTime;
|
||||
}
|
||||
|
||||
public void setMoney(BigDecimal money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RzAbnormalDetail{" +
|
||||
"id=" + id +
|
||||
", abnormalId=" + abnormalId +
|
||||
", name='" + name + '\'' +
|
||||
", clockDate=" + clockDate +
|
||||
", clockType='" + clockType + '\'' +
|
||||
", abnormalTime=" + abnormalTime +
|
||||
", money=" + money +
|
||||
", delFlag='" + delFlag + '\'' +
|
||||
", remarks='" + remarks + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public BigDecimal getMoney() {
|
||||
return money;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 考勤记录对象 rz_attendance
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("rz_attendance")
|
||||
public class RzAttendance extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 统计id
|
||||
*/
|
||||
private Long staffId;
|
||||
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@Excel(name = "所属部门")
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 考勤日期
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "考勤日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date attendanceDate;
|
||||
|
||||
/**
|
||||
* 考勤规则
|
||||
*/
|
||||
@Excel(name = "考勤规则")
|
||||
private String rules;
|
||||
|
||||
private String ycsFlag;
|
||||
|
||||
private String ycxFlag;
|
||||
|
||||
/**
|
||||
* 上班时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上班时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date workStartTime;
|
||||
|
||||
/**
|
||||
* 下班时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "下班时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date workEndTime;
|
||||
|
||||
/**
|
||||
* 工作时长
|
||||
*/
|
||||
@Excel(name = "工作时长")
|
||||
private BigDecimal workSum;
|
||||
@Excel(name = "考勤时长")
|
||||
private BigDecimal workHours;
|
||||
/**
|
||||
* 夜班次数
|
||||
*/
|
||||
private int nightNumber;
|
||||
|
||||
/**
|
||||
* 中班次数
|
||||
*/
|
||||
private int middleShiftNumber;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注")
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
/***
|
||||
* 请假类型
|
||||
*/
|
||||
private Long holidayType;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private Date startTime;
|
||||
@TableField(exist = false)
|
||||
private Date endTime;
|
||||
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 考勤明细对象 rz_attendance_detail
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-14
|
||||
*/
|
||||
@Data
|
||||
public class RzAttendanceDetail extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long staffId;
|
||||
|
||||
/** 考勤记录Id */
|
||||
@Excel(name = "考勤记录Id")
|
||||
private Long attendanceId;
|
||||
|
||||
/** 姓名 */
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
|
||||
/** 设备编号 */
|
||||
@Excel(name = "设备编号")
|
||||
private String equipmentCode;
|
||||
|
||||
/** 按钮类型 */
|
||||
@Excel(name = "按钮类型")
|
||||
private String buttonType;
|
||||
|
||||
/** 时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date dateTime;
|
||||
|
||||
/** 周六标识 */
|
||||
private String remark;
|
||||
|
||||
private String photo;
|
||||
|
||||
/** 删除标记 */
|
||||
private String delFlag;
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("staffId", getStaffId())
|
||||
.append("name", getName())
|
||||
.append("equipmentCode", getEquipmentCode())
|
||||
.append("buttonType", getButtonType())
|
||||
.append("dateTime", getDateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,126 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤统计对象 rz_attendance_statistical
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@Data
|
||||
public class RzAttendanceStatistical extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@Excel(name = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 员工ID */
|
||||
private Long staffId;
|
||||
|
||||
/** 所属月份 */
|
||||
@Excel(name = "所属月份", width = 30, dateFormat = "yyyy-MM")
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
private Date month;
|
||||
|
||||
/** 所属部门 */
|
||||
private Long deptId;
|
||||
@TableField(exist = false)
|
||||
private List<Long> deptIds;
|
||||
@Excel(name = "所属部门")
|
||||
@TableField(exist = false)
|
||||
private String deptName;
|
||||
|
||||
/** 员工姓名 */
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
/** 应出勤(小时) */
|
||||
@Excel(name = "应出勤(小时)")
|
||||
private BigDecimal shouldAttendance;
|
||||
|
||||
/** 实出勤(小时) */
|
||||
@Excel(name = "实出勤(小时)")
|
||||
private BigDecimal realAttendance;
|
||||
|
||||
/** 打卡时长(小时) */
|
||||
@Excel(name = "打卡时长(小时)")
|
||||
private BigDecimal essentialAttendance;
|
||||
|
||||
/** 加班时长(小时) */
|
||||
@Excel(name = "加班时长(小时)")
|
||||
private BigDecimal workOvertimeNumber;
|
||||
|
||||
/** 请假时长(小时) */
|
||||
@Excel(name = "请假时长(小时)")
|
||||
private BigDecimal absenteeism;
|
||||
|
||||
/** 特殊加班(小时) */
|
||||
@Excel(name = "特殊加班(小时)")
|
||||
private BigDecimal overTimeHours;
|
||||
|
||||
/** 异常次数 */
|
||||
@Excel(name = "异常次数")
|
||||
private Long lateNumber;
|
||||
|
||||
/** 早退次数 */
|
||||
//@Excel(name = "早退次数")
|
||||
private Long leaveEarly;
|
||||
|
||||
/** 缺卡次数 */
|
||||
//@Excel(name = "缺卡次数")
|
||||
private Long lessNumber;
|
||||
|
||||
/** 夜班次数 */
|
||||
@Excel(name = "夜班次数")
|
||||
private Long nightNumber;
|
||||
|
||||
/** 中班次数 */
|
||||
@Excel(name = "中班次数")
|
||||
private Long middleShiftNumber;
|
||||
|
||||
/** 删除标识 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String delFlag;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Boolean allowAdjustment;
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("staffId", getStaffId())
|
||||
.append("month", getMonth())
|
||||
.append("deptId", getDeptId())
|
||||
.append("name", getName())
|
||||
.append("shouldAttendance", getShouldAttendance())
|
||||
.append("realAttendance", getRealAttendance())
|
||||
.append("essentialAttendance", getEssentialAttendance())
|
||||
.append("workOvertimeNumber", getWorkOvertimeNumber())
|
||||
.append("absenteeism", getAbsenteeism())
|
||||
.append("lateNumber", getLateNumber())
|
||||
.append("leaveEarly", getLeaveEarly())
|
||||
.append("lessNumber", getLessNumber())
|
||||
.append("nightNumber", getNightNumber())
|
||||
.append("middleShiftNumber", getMiddleShiftNumber())
|
||||
.append("delFlag", getDelFlag())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,172 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 加班考勤记录对象 rz_special_attendance
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
public class RzSpecialAttendance extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 员工ID */
|
||||
@Excel(name = "员工ID")
|
||||
private Long staffId;
|
||||
|
||||
/** 员工姓名 */
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
/** 所属部门 */
|
||||
@Excel(name = "所属部门")
|
||||
private Long deptId;
|
||||
|
||||
/** 考勤日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "考勤日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date attendanceDate;
|
||||
|
||||
/** 上班时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "上班时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date workStartTime;
|
||||
|
||||
/** 下班时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "下班时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date workEndTime;
|
||||
|
||||
/** 考勤时长 */
|
||||
@Excel(name = "考勤时长")
|
||||
private BigDecimal workHours;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remarks;
|
||||
|
||||
/** 删除标识 */
|
||||
private String delFlag;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setStaffId(Long staffId)
|
||||
{
|
||||
this.staffId = staffId;
|
||||
}
|
||||
|
||||
public Long getStaffId()
|
||||
{
|
||||
return staffId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setAttendanceDate(Date attendanceDate)
|
||||
{
|
||||
this.attendanceDate = attendanceDate;
|
||||
}
|
||||
|
||||
public Date getAttendanceDate()
|
||||
{
|
||||
return attendanceDate;
|
||||
}
|
||||
public void setWorkStartTime(Date workStartTime)
|
||||
{
|
||||
this.workStartTime = workStartTime;
|
||||
}
|
||||
|
||||
public Date getWorkStartTime()
|
||||
{
|
||||
return workStartTime;
|
||||
}
|
||||
public void setWorkEndTime(Date workEndTime)
|
||||
{
|
||||
this.workEndTime = workEndTime;
|
||||
}
|
||||
|
||||
public Date getWorkEndTime()
|
||||
{
|
||||
return workEndTime;
|
||||
}
|
||||
public void setWorkHours(BigDecimal workHours)
|
||||
{
|
||||
this.workHours = workHours;
|
||||
}
|
||||
|
||||
public BigDecimal getWorkHours()
|
||||
{
|
||||
return workHours;
|
||||
}
|
||||
public void setRemarks(String remarks)
|
||||
{
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public String getRemarks()
|
||||
{
|
||||
return remarks;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("staffId", getStaffId())
|
||||
.append("name", getName())
|
||||
.append("deptId", getDeptId())
|
||||
.append("attendanceDate", getAttendanceDate())
|
||||
.append("workStartTime", getWorkStartTime())
|
||||
.append("workEndTime", getWorkEndTime())
|
||||
.append("workHours", getWorkHours())
|
||||
.append("remarks", getRemarks())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,135 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 特殊加班管理对象 rz_special_over_time
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-16
|
||||
*/
|
||||
public class RzSpecialOverTime extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 员工ID */
|
||||
@Excel(name = "员工ID")
|
||||
private Long userId;
|
||||
|
||||
/** 部门 */
|
||||
private Long deptId;
|
||||
@Excel(name = "部门")
|
||||
private String deptName;
|
||||
/** 员工姓名 */
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
/** 加班月份(到月) */
|
||||
@Excel(name = "加班月份", readConverterExp = "到=月")
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
private Date overDate;
|
||||
|
||||
/** 加班时长(小时) */
|
||||
@Excel(name = "加班时长", readConverterExp = "小=时")
|
||||
private BigDecimal sickHours;
|
||||
|
||||
/** 删除标识 */
|
||||
private String delFlag;
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public Date getOverDate() {
|
||||
return overDate;
|
||||
}
|
||||
|
||||
public void setOverDate(Date overDate) {
|
||||
this.overDate = overDate;
|
||||
}
|
||||
|
||||
public void setSickHours(BigDecimal sickHours)
|
||||
{
|
||||
this.sickHours = sickHours;
|
||||
}
|
||||
|
||||
public BigDecimal getSickHours()
|
||||
{
|
||||
return sickHours;
|
||||
}
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("name", getName())
|
||||
.append("sickHours", getSickHours())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,97 +0,0 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 参数配置对象 rz_sys_param
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public class RzSysParam extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
private Long id;
|
||||
|
||||
/** 参数名 */
|
||||
@Excel(name = "参数名")
|
||||
private String paramName;
|
||||
|
||||
/** 参数码 */
|
||||
@Excel(name = "参数码")
|
||||
private String paramCode;
|
||||
|
||||
/** 参数值 */
|
||||
@Excel(name = "参数值")
|
||||
private String paramValue;
|
||||
|
||||
/** 说明 */
|
||||
@Excel(name = "说明")
|
||||
private String description;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setParamName(String paramName)
|
||||
{
|
||||
this.paramName = paramName;
|
||||
}
|
||||
|
||||
public String getParamName()
|
||||
{
|
||||
return paramName;
|
||||
}
|
||||
public void setParamCode(String paramCode)
|
||||
{
|
||||
this.paramCode = paramCode;
|
||||
}
|
||||
|
||||
public String getParamCode()
|
||||
{
|
||||
return paramCode;
|
||||
}
|
||||
public void setParamValue(String paramValue)
|
||||
{
|
||||
this.paramValue = paramValue;
|
||||
}
|
||||
|
||||
public String getParamValue()
|
||||
{
|
||||
return paramValue;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("paramName", getParamName())
|
||||
.append("paramCode", getParamCode())
|
||||
.append("paramValue", getParamValue())
|
||||
.append("description", getDescription())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
package com.evo.attendance.domain.vo;
|
||||
|
||||
public class RzAttendanceData {
|
||||
|
||||
private String button;
|
||||
|
||||
public String getButton() {
|
||||
return button;
|
||||
}
|
||||
|
||||
public RzAttendanceData() {
|
||||
}
|
||||
|
||||
public RzAttendanceData(String button) {
|
||||
this.button = button;
|
||||
}
|
||||
|
||||
public void setButton(String button) {
|
||||
this.button = button;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RzAttendanceData [button=" + button + "]";
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
package com.evo.attendance.domain.vo;
|
||||
|
||||
import com.evo.common.constant.Constants;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 打卡详情时间线
|
||||
*
|
||||
* @ClassName:RzAttendanceDetailTimeLineVO
|
||||
* @date: 2025年07月17日 10:35
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
public class RzAttendanceDetailTimeLineVO {
|
||||
|
||||
String content;
|
||||
|
||||
String photo;
|
||||
|
||||
String timestamp;
|
||||
|
||||
String type;
|
||||
|
||||
String icon;
|
||||
|
||||
String size = "large";
|
||||
|
||||
public RzAttendanceDetailTimeLineVO(String content, String photo, String timestamp, String delFlag) {
|
||||
this.content = content;
|
||||
this.photo = photo;
|
||||
this.timestamp = timestamp;
|
||||
TimeLineEnum timeLine = TimeLineEnum.get(content, delFlag);
|
||||
this.type = timeLine.type;
|
||||
this.icon = timeLine.icon;
|
||||
}
|
||||
|
||||
enum TimeLineEnum{
|
||||
UP("上班", "primary","el-icon-caret-top"),
|
||||
OVERTIME("加班", "success","el-icon-plus"),
|
||||
DOWN("下班", "warning","el-icon-caret-bottom"),
|
||||
REVOKE("撤销", "danger","el-icon-close"),
|
||||
DEFAULT("", "",""),
|
||||
|
||||
;
|
||||
|
||||
String typeWork;
|
||||
String type;
|
||||
String icon;
|
||||
|
||||
TimeLineEnum(String typeWork, String type, String icon) {
|
||||
this.typeWork = typeWork;
|
||||
this.type = type;
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public static TimeLineEnum get(String typeWork, String delFlag){
|
||||
if(Constants.DELETE_FLAG_1.equals(delFlag)){
|
||||
return REVOKE;
|
||||
}
|
||||
for (TimeLineEnum timeLine : TimeLineEnum.values()){
|
||||
if(typeWork.contains(timeLine.typeWork)){
|
||||
return timeLine;
|
||||
}
|
||||
}
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.evo.attendance.domain.vo;
|
||||
|
||||
import com.evo.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
@Data
|
||||
public class RzAttendanceDetailVO {
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
@Excel(name = "员工姓名")
|
||||
private String employeeName;
|
||||
/**
|
||||
* 补卡时间
|
||||
*/
|
||||
@Excel(name = "补卡日期", dateFormat = "yyyy-MM-dd")
|
||||
private String replacementTime;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@Excel(name = "类型")
|
||||
private String type;
|
||||
/**
|
||||
* 补卡类型
|
||||
*/
|
||||
@Excel(name = "补卡类型")
|
||||
private String reissueType;
|
||||
|
||||
@Excel(name = "补卡时间", dateFormat = "HH:mm:ss")
|
||||
private String reissueTime;
|
||||
/**
|
||||
* 补卡时长
|
||||
*/
|
||||
@Excel(name = "补班时长")
|
||||
private Integer reissueDuration;
|
||||
|
||||
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package com.evo.attendance.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RzAttendanceVo {
|
||||
|
||||
private int Result;
|
||||
private String Msg;
|
||||
private RzAttendanceData Content;
|
||||
|
||||
public RzAttendanceVo() {
|
||||
}
|
||||
|
||||
public RzAttendanceVo(int result, String msg) {
|
||||
Result = result;
|
||||
Msg = msg;
|
||||
}
|
||||
|
||||
public RzAttendanceVo(int result, String msg, RzAttendanceData content) {
|
||||
Result = result;
|
||||
Msg = msg;
|
||||
Content = content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RzAttendanceVo [Result=" + Result + ", Msg=" + Msg + ", Content=" + Content + "]";
|
||||
}
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
package com.evo.attendance.domain.vo;
|
||||
|
||||
import com.evo.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/*
|
||||
* @Author :tzy
|
||||
* @Description :用于导入销售提成
|
||||
*/
|
||||
@Data
|
||||
public class RzSalaryVo {
|
||||
|
||||
@Excel(name = "姓名")
|
||||
private String name;
|
||||
@Excel(name = "提成金额")
|
||||
private BigDecimal sale;
|
||||
@Excel(name = "日期", width = 30, dateFormat = "yyyy-MM")
|
||||
private Date date;
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
|
||||
/**
|
||||
* 考勤异常详情Mapper接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public interface RzAbnormalDetailMapper
|
||||
{
|
||||
/**
|
||||
* 查询考勤异常详情
|
||||
*
|
||||
* @param id 考勤异常详情主键
|
||||
* @return 考勤异常详情
|
||||
*/
|
||||
public RzAbnormalDetail selectRzAbnormalDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤异常详情列表
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 考勤异常详情集合
|
||||
*/
|
||||
public List<RzAbnormalDetail> selectRzAbnormalDetailList(RzAbnormalDetail rzAbnormalDetail);
|
||||
|
||||
/**
|
||||
* 新增考勤异常详情
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzAbnormalDetail(RzAbnormalDetail rzAbnormalDetail);
|
||||
|
||||
/**
|
||||
* 修改考勤异常详情
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAbnormalDetail(RzAbnormalDetail rzAbnormalDetail);
|
||||
|
||||
/**
|
||||
* 查询考勤异常详情
|
||||
* @return 考勤异常详情
|
||||
*/
|
||||
public List<RzAbnormalDetail> selectRzAbnormalDetailByAbnormalId(Long abnormalId);
|
||||
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzAbnormal;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 考勤异常Mapper接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public interface RzAbnormalMapper
|
||||
{
|
||||
/**
|
||||
* 查询考勤异常
|
||||
*
|
||||
* @param id 考勤异常主键
|
||||
* @return 考勤异常
|
||||
*/
|
||||
public RzAbnormal selectRzAbnormalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤异常列表
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 考勤异常集合
|
||||
*/
|
||||
public List<RzAbnormal> selectRzAbnormalList(RzAbnormal rzAbnormal);
|
||||
|
||||
/**
|
||||
* 新增考勤异常
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzAbnormal(RzAbnormal rzAbnormal);
|
||||
|
||||
/**
|
||||
* 修改考勤异常
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAbnormal(RzAbnormal rzAbnormal);
|
||||
|
||||
/**
|
||||
* 查询当月迟到情况
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public RzAbnormal selectRzAbnormalByUserId(@Param("userId") Long userId,@Param("month") Date month);
|
||||
|
||||
}
|
||||
@ -1,79 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤明细Mapper接口
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-14
|
||||
*/
|
||||
public interface RzAttendanceDetailMapper extends BaseMapper<RzAttendanceDetail>
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询员工最后一次打卡明细 ,按钮切换使用
|
||||
*
|
||||
* @param staffId
|
||||
* @return 考勤明细集合
|
||||
*/
|
||||
public RzAttendanceDetail selectLastRzAttendanceDetail(@Param("staffId") Long staffId);
|
||||
|
||||
/**
|
||||
* 新增考勤明细
|
||||
*
|
||||
* @param rzAttendanceDetail 考勤明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzAttendanceDetail(RzAttendanceDetail rzAttendanceDetail);
|
||||
|
||||
/**
|
||||
* 修改考勤明细
|
||||
* @param rzAttendanceDetail
|
||||
* @return
|
||||
*/
|
||||
public int updateRzAttendanceDetail(RzAttendanceDetail rzAttendanceDetail);
|
||||
|
||||
/**
|
||||
* 查询员工最后一次上班打卡 计算工时 其他地方不可使用
|
||||
*
|
||||
* @param staffId
|
||||
* @return 考勤明细集合
|
||||
*/
|
||||
public RzAttendanceDetail selectRzAttendanceDetailByStaffId(@Param("staffId") Long staffId);
|
||||
|
||||
/**
|
||||
* 查询员工最后一次上班卡. 只要上班卡, 其他地方可不使用
|
||||
*
|
||||
* @param staffId
|
||||
* @return 考勤明细集合
|
||||
*/
|
||||
public RzAttendanceDetail selectLastWorkCardByStaffId(@Param("staffId") Long staffId);
|
||||
|
||||
|
||||
public List<RzAttendanceDetail> selectRzAttendanceDetailByMonth(Date date);
|
||||
|
||||
/***
|
||||
* 检查加班情况
|
||||
* @param userId
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
Long checkOverTimeCard(@Param("userId") Long userId, @Param("date") Date date);
|
||||
|
||||
/**
|
||||
* 查询员工最后一次上班卡. 只要上班卡, 其他地方可不使用
|
||||
*
|
||||
* @param staffId
|
||||
* @return 考勤明细集合
|
||||
*/
|
||||
public RzAttendanceDetail selectLastRzAttendanceDetailByBk(@Param("staffId") Long staffId, @Param("buttonType") String buttonType, @Param("startDateTime") Date startDateTime, @Param("endDateTime") Date endDateTime);
|
||||
|
||||
List<Map<String,Object>> getThreeDayNotCheck();
|
||||
}
|
||||
@ -1,89 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.Mapper;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤记录Mapper接口
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
public interface RzAttendanceMapper extends BaseMapper<RzAttendance> {
|
||||
/**
|
||||
* 查询考勤记录
|
||||
*
|
||||
* @param id 考勤记录主键
|
||||
* @return 考勤记录
|
||||
*/
|
||||
public RzAttendance selectRzAttendanceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> selectRzAttendanceList(RzAttendance rzAttendance);
|
||||
/**
|
||||
* 修改考勤记录
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAttendance(RzAttendance rzAttendance);
|
||||
/**
|
||||
* 根据统计ID和时间查询当天的打卡记录
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public RzAttendance queryNowDayAttendanceByStatisticalIdAndDate(@Param("staffId") Long staffId,@Param("date") Date date);
|
||||
/**
|
||||
* 每日上班打卡统计
|
||||
* @return
|
||||
*/
|
||||
public List<RzAttendance> attendenceCount();
|
||||
/**
|
||||
* 根据员工ID查询最后一次考勤上班记录
|
||||
*
|
||||
* @param staffId 考勤统计ID
|
||||
* @return 考勤记录
|
||||
*/
|
||||
public RzAttendance selectLastRzAttendanceByStaffId(Long staffId);
|
||||
/**
|
||||
* 查询员工的考勤(根据月份)
|
||||
* @param staffId
|
||||
* @return
|
||||
*/
|
||||
public List<RzAttendance> queryMonthAttendanceByStaffId(@Param("staffId") Long staffId,@Param("date") Date date);
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> listAttendanceByParams(RzAttendance rzAttendance);
|
||||
/**
|
||||
* 批量新增考勤记录
|
||||
*
|
||||
* @param list 考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBatchRzAttendance(List<RzAttendance> list);
|
||||
|
||||
/**
|
||||
* 查询当天的考勤
|
||||
* @return
|
||||
*/
|
||||
public List<RzAttendance> currentDateAllAttendance();
|
||||
|
||||
List<Map<String,Object>> getAttendanceHour(@Param("date") Date date);
|
||||
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 考勤统计Mapper接口
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
public interface RzAttendanceStatisticalMapper extends BaseMapper<RzAttendanceStatistical>
|
||||
{
|
||||
/**
|
||||
* 查询考勤统计
|
||||
*
|
||||
* @param id 考勤统计主键
|
||||
* @return 考勤统计
|
||||
*/
|
||||
public RzAttendanceStatistical selectRzAttendanceStatisticalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤统计列表
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 考勤统计集合
|
||||
*/
|
||||
public List<RzAttendanceStatistical> selectRzAttendanceStatisticalList(RzAttendanceStatistical rzAttendanceStatistical);
|
||||
|
||||
/**
|
||||
* 新增考勤统计
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzAttendanceStatistical(RzAttendanceStatistical rzAttendanceStatistical);
|
||||
|
||||
/**
|
||||
* 修改考勤统计
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAttendanceStatistical(RzAttendanceStatistical rzAttendanceStatistical);
|
||||
|
||||
/**
|
||||
* 根据员工ID,时间查询统计信息
|
||||
* @param staffId
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
public RzAttendanceStatistical getRzAttendanceStatisticalByDateAndName(@Param("staffId") Long staffId,@Param("month") Date month);
|
||||
|
||||
/**
|
||||
* 查询考勤月的考勤统计信息 *
|
||||
* @return 考勤统计集合
|
||||
*/
|
||||
public List<RzAttendanceStatistical> queryStatisticalByMonth(Date month);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,55 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.attendance.domain.RzSpecialAttendance;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 加班考勤记录Mapper接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
public interface RzSpecialAttendanceMapper extends BaseMapper<RzSpecialAttendance>
|
||||
{
|
||||
/**
|
||||
* 查询加班考勤记录
|
||||
*
|
||||
* @param id 加班考勤记录主键
|
||||
* @return 加班考勤记录
|
||||
*/
|
||||
public RzSpecialAttendance selectRzSpecialAttendanceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询加班考勤记录列表
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 加班考勤记录集合
|
||||
*/
|
||||
public List<RzSpecialAttendance> selectRzSpecialAttendanceList(RzSpecialAttendance rzSpecialAttendance);
|
||||
|
||||
/**
|
||||
* 新增加班考勤记录
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzSpecialAttendance(RzSpecialAttendance rzSpecialAttendance);
|
||||
|
||||
/**
|
||||
* 修改加班考勤记录
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzSpecialAttendance(RzSpecialAttendance rzSpecialAttendance);
|
||||
|
||||
public RzSpecialAttendance selectRzSpecialAttendanceByUserIdAndDate(@Param("staffId") Long staffId,@Param("date") Date date);
|
||||
|
||||
|
||||
List<Map<String,Object>> getSpecialAttendanceHour(@Param("date") Date date);
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.evo.attendance.domain.RzSpecialOverTime;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特殊加班管理Mapper接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-16
|
||||
*/
|
||||
public interface RzSpecialOverTimeMapper
|
||||
{
|
||||
/**
|
||||
* 查询特殊加班管理
|
||||
*
|
||||
* @param id 特殊加班管理主键
|
||||
* @return 特殊加班管理
|
||||
*/
|
||||
public RzSpecialOverTime selectRzSpecialOverTimeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询特殊加班管理列表
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 特殊加班管理集合
|
||||
*/
|
||||
public List<RzSpecialOverTime> selectRzSpecialOverTimeList(RzSpecialOverTime rzSpecialOverTime);
|
||||
|
||||
/**
|
||||
* 新增特殊加班管理
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzSpecialOverTime(RzSpecialOverTime rzSpecialOverTime);
|
||||
|
||||
/**
|
||||
* 修改特殊加班管理
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzSpecialOverTime(RzSpecialOverTime rzSpecialOverTime);
|
||||
|
||||
public RzSpecialOverTime selectRzSpecialOverTimeByUserIdAndDate(@Param("userId") Long userId,@Param("date") Date date);
|
||||
|
||||
}
|
||||
@ -1,63 +0,0 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.attendance.domain.RzSysParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置Mapper接口
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public interface RzSysParamMapper extends BaseMapper<RzSysParam>
|
||||
{
|
||||
/**
|
||||
* 查询参数配置
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 参数配置
|
||||
*/
|
||||
public RzSysParam selectRzSysParamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<RzSysParam> selectRzSysParamList(RzSysParam rzSysParam);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzSysParam(RzSysParam rzSysParam);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzSysParam(RzSysParam rzSysParam);
|
||||
|
||||
/**
|
||||
* 删除参数配置
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzSysParamById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除参数配置
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzSysParamByIds(Long[] ids);
|
||||
}
|
||||
@ -1,169 +0,0 @@
|
||||
package com.evo.attendance.processor;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.mapper.RzAttendanceMapper;
|
||||
import com.evo.attendance.service.IRzSysParamService;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.equipment.domain.EqButton;
|
||||
import com.evo.equipment.mapper.EqButtonMapper;
|
||||
import com.evo.personnelMatters.domain.RzOverTimeDetail;
|
||||
import com.evo.personnelMatters.service.IRzHolidayService;
|
||||
import com.evo.system.service.ISysDictDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:KqUtils
|
||||
* @date: 2025年07月07日 14:09
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class KqUtils {
|
||||
|
||||
static EqButtonMapper eqButtonMapper;
|
||||
|
||||
static RzAttendanceMapper rzAttendanceMapper;
|
||||
|
||||
static RzAttendanceDetailService rzAttendanceDetailService;
|
||||
|
||||
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
static SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
|
||||
@Autowired
|
||||
public KqUtils(EqButtonMapper eqButtonMapper, RzAttendanceMapper rzAttendanceMapper, RzAttendanceDetailService rzAttendanceDetailService) {
|
||||
this.eqButtonMapper = eqButtonMapper;
|
||||
this.rzAttendanceMapper = rzAttendanceMapper;
|
||||
this.rzAttendanceDetailService = rzAttendanceDetailService;
|
||||
}
|
||||
/*** 上班卡的下班卡
|
||||
* @param date
|
||||
* @param rules
|
||||
* @return
|
||||
*/
|
||||
public static Boolean workOffDutyCard(Date date, String rules, RzAttendance attendance){
|
||||
|
||||
//计算工时
|
||||
Long hours = (date.getTime() - attendance.getWorkStartTime().getTime())/1000/60/60;
|
||||
|
||||
EqButton eqButton = eqButtonMapper.selectOne(new LambdaQueryWrapper<EqButton>().eq(EqButton::getName, rules));
|
||||
|
||||
Integer maxWorkHour = ParamUtils.getTsWorkHour(attendance.getName());
|
||||
if(maxWorkHour == null){
|
||||
maxWorkHour = eqButton.getWorkHour();
|
||||
}
|
||||
|
||||
//判断打卡时间, 添加夜班次数 打卡时间在晚上7点以后
|
||||
if(eqButton.getWorkHour() ==12 && hours >= 12 && attendance.getWorkStartTime().getHours() > 12){
|
||||
attendance.setNightNumber(1);
|
||||
}else if(eqButton.getWorkHour() == 8 && hours >= 8 && attendance.getWorkStartTime().getHours() > 18){
|
||||
attendance.setMiddleShiftNumber(1);
|
||||
}
|
||||
//获取工作时长
|
||||
BigDecimal res = new BigDecimal(hours);
|
||||
if(hours.compareTo(Long.valueOf(maxWorkHour)) >= 0){
|
||||
res = new BigDecimal(maxWorkHour);
|
||||
}
|
||||
//检查是否异常
|
||||
if(checkYc("下班", rules, sdf.format(date), sdfd.format(date))){
|
||||
attendance.setYcxFlag("1");
|
||||
}
|
||||
|
||||
attendance.setWorkEndTime(date);
|
||||
attendance.setWorkSum(res);
|
||||
return (rzAttendanceMapper.updateRzAttendance(attendance) > 0);
|
||||
}
|
||||
|
||||
/*** 校验是否上班卡打卡异常
|
||||
* @param rules
|
||||
* @param dateTime
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Boolean checkYc(String type, String rules, String dateTime, String date){
|
||||
String script = ParamUtils.getYcRulesByButtonName(type, rules);
|
||||
if(StringUtils.isEmpty(script)){
|
||||
return false;
|
||||
}
|
||||
ScriptEngineManager manager = new ScriptEngineManager();
|
||||
ScriptEngine engine = manager.getEngineByName("javascript");
|
||||
try {
|
||||
Object result = engine.eval(script.replaceAll("dkDateTime",dateTime).replaceAll("dkDate", date));
|
||||
System.out.println("检查结果"+result);
|
||||
return new Boolean(String.valueOf(result));
|
||||
} catch (Exception e) {
|
||||
log.error("打卡交易是否异常出现错误{}", e.getMessage());
|
||||
}
|
||||
//默认为没有异常
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static void calculateOverTimeHours(RzOverTimeDetail rzOverTimeDetail, Long userId, String sn){
|
||||
//计算加班时长 分钟
|
||||
BigDecimal minutes = new BigDecimal((rzOverTimeDetail.getOverTimeEnd().getTime() - rzOverTimeDetail.getOverTimeStart().getTime())/1000/60);
|
||||
//获取加班的最后一次的上班卡类型, 如果不是12小时制或者三班制, 直接扣减半小时
|
||||
RzAttendanceDetail rzAttendanceDetail = rzAttendanceDetailService.selectLastWorkCardByStaffId(userId);
|
||||
/***
|
||||
* 上班卡不是12小时制, 并且不是三班制 (三班制为兼容旧数据) 直接扣减30分钟
|
||||
*需求来源 3.2.4 短休相关规定
|
||||
* 3.2 工作时间
|
||||
* 3.2.1 长白班:
|
||||
* (1)实行每周一至周六,每天8小时的工作制度;
|
||||
* (2)工作时间:08:30—12:00,13:00—17:30;
|
||||
* (3)午休时间:12:00—13:00;
|
||||
* (4)节假日(含周日)加班时,工作时间按第(2)条执行。
|
||||
* 3.2.2 八小时倒班:
|
||||
* (1)白班工作时间:8:30—12:00, 12:30—17:00; 午餐短休:12:00—12:30。
|
||||
* (2)中班工作时间:17:00—18:30,19:00—01:30; 晚餐短休:18:30—19:00。
|
||||
* 3.2.3 十二小时倒班:
|
||||
* (1)白班工作时间:8:30—12:00,12:30—18:30,19:00—20:30;
|
||||
* 午餐短休:12:00—12:30,晚餐短休:18:30—19:00。
|
||||
* (2)夜班工作时间:20:30—23:30,00:00—03:30,04:00—08:30;
|
||||
* 夜班短休:23:30—00:00,03:30—04:00。
|
||||
* 3.2.4 短休相关规定:
|
||||
* (1)在规定的短休时间段内,需装拆加工零部件时,可暂停设备前往就餐或短休;
|
||||
* (2)原则上十二小时倒班人员短休核算工时,八小时倒班及长白班人员短休不统计该时间段工时;
|
||||
* (3)非就餐的短休,地点应在设备可视且可听范围之内,严禁在短休前提前强行停机,一经发现按以下条款考核激励:
|
||||
* A) 岗位责任人激励-50元/项/次;
|
||||
* B) 公司检查发现的按层级组织秩序,激励责任管理岗两级各-100元/项/次。
|
||||
*/
|
||||
if(!rzAttendanceDetail.getButtonType().contains("12") && !rzAttendanceDetail.getButtonType().contains("三班")){
|
||||
minutes = minutes.subtract(new BigDecimal(ParamUtils.getShortBreakDeductionMinutes("ZC")));
|
||||
}
|
||||
//设置默认加班0小时
|
||||
double hours = 0;
|
||||
//加班分钟>0分钟, 计算小时
|
||||
if(minutes.compareTo(DataUtils.DEFAULT_VALUE) >0){
|
||||
//计算小时, 保留2位小数
|
||||
hours = minutes.divide(new BigDecimal(60),2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
//获取规则
|
||||
JSONObject deviceRules = ParamUtils.getDeviceOverTimeRules(sn);
|
||||
//获取最大加班时长
|
||||
Integer maxOverTimeHour = deviceRules.getInteger("maxHour");
|
||||
//记录加班时长
|
||||
rzOverTimeDetail.setOverTimeHours(BigDecimal.valueOf(((hours > maxOverTimeHour) ? maxOverTimeHour : hours)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,92 +0,0 @@
|
||||
package com.evo.attendance.processor;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceData;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceVo;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.common.utils.spring.SpringUtils;
|
||||
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||
import com.evo.personnelMatters.mapper.EqOverStaffMapper;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 打开处理接口
|
||||
*
|
||||
* @ClassName:PunchTheClockStrategyExchangeProcessor
|
||||
* @date: 2025年05月28日 11:58
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public interface PunchTheClockStrategyExchangeProcessor {
|
||||
|
||||
Logger logger = LoggerFactory.getLogger(PunchTheClockStrategyExchangeProcessor.class);
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
boolean accept(String sn);
|
||||
|
||||
/***
|
||||
* 设备按钮下发
|
||||
* @param userId
|
||||
* @param sn
|
||||
* @return
|
||||
*/
|
||||
String exchangeButton(String userId, String sn);
|
||||
|
||||
/***
|
||||
* 打卡信息回传
|
||||
* @param userId
|
||||
* @param sn
|
||||
* @param date
|
||||
* @param button
|
||||
* @param rules
|
||||
* @return
|
||||
*/
|
||||
String exchangeFace(String userId, String sn, Date date, String button, String rules, String photo);
|
||||
|
||||
default String checkStaff(SysStaff sysStaff, String sn){
|
||||
if(sysStaff == null){
|
||||
return "当前人员不存在";
|
||||
}
|
||||
if(Constants.JOB_STATIS_11.equals(sysStaff.getStatus())){
|
||||
return "当前人员已离职";
|
||||
}
|
||||
if(StringUtils.isEmpty(sysStaff.getTimeClock())){
|
||||
return "当前人员未注册打卡机";
|
||||
}
|
||||
//不是特殊打卡, 并且不是公共打卡, 并且当前打卡设备不是人员绑定设备
|
||||
//&& !sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE)
|
||||
//!sn.equals(sysStaff.getTimeClock())
|
||||
if(!ParamUtils.getTsDevSn().contains(sn) && !sysStaff.getTimeClockList().contains(sn)){
|
||||
return "未设置当前考勤机打卡权限";
|
||||
}
|
||||
//是特殊打卡 并且 特殊打卡人员中, 不包含当前人员
|
||||
if(ParamUtils.getTsDevSn().contains(sn) && StringUtils.isNull(SpringUtils.getBean(EqOverStaffMapper.class).selectEqOverStaffByUserId(sysStaff.getUserId()))){
|
||||
return "未设置当前考勤机打卡权限";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
default String initMessage(Integer result, String meg){
|
||||
//需要返回的对象, 默认失败
|
||||
return JSONObject.toJSONString(new RzAttendanceVo(result, meg, null));
|
||||
}
|
||||
|
||||
default String initMessage(Integer result, String meg, String buttonPermission){
|
||||
//需要返回的对象, 默认失败
|
||||
if(StringUtils.isNotEmpty(buttonPermission)){
|
||||
return JSONObject.toJSONString(new RzAttendanceVo(result, meg, new RzAttendanceData(buttonPermission)));
|
||||
}
|
||||
return JSONObject.toJSONString(new RzAttendanceVo(result, meg));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,448 +0,0 @@
|
||||
package com.evo.attendance.processor.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.mapper.RzAttendanceMapper;
|
||||
import com.evo.attendance.processor.KqUtils;
|
||||
import com.evo.attendance.processor.PunchTheClockStrategyExchangeProcessor;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.*;
|
||||
import com.evo.equipment.mapper.EqButtonMapper;
|
||||
import com.evo.personnelMatters.domain.RzOverTime;
|
||||
import com.evo.personnelMatters.domain.RzOverTimeDetail;
|
||||
import com.evo.personnelMatters.mapper.EqOverStaffMapper;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeDetailMapper;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeMapper;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.domain.SysStaffDetail;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysStaffDetailMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.wechat.service.SendClientService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 考勤设备打卡类
|
||||
*
|
||||
* @ClassName:TSDeviceExchangeProcessor
|
||||
* @date: 2025年05月28日 13:13
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class KQDeviceExchangeProcessor implements PunchTheClockStrategyExchangeProcessor {
|
||||
@Resource
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
@Resource
|
||||
private RzAttendanceDetailService rzAttendanceDetailService;
|
||||
@Resource
|
||||
private RzOverTimeMapper rzOverTimeMapper;
|
||||
@Resource
|
||||
private RzOverTimeDetailMapper rzOverTimeDetailMapper;
|
||||
@Resource
|
||||
private RzAttendanceMapper rzAttendanceMapper;
|
||||
@Resource
|
||||
private EqButtonMapper eqButtonMapper;
|
||||
@Resource
|
||||
private EqOverStaffMapper eqOverStaffMapper;
|
||||
@Resource
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Resource
|
||||
private SysStaffDetailMapper sysStaffDetailMapper;
|
||||
|
||||
@Resource
|
||||
private SendClientService sendClientService;
|
||||
|
||||
@Override
|
||||
public boolean accept(String sn) {
|
||||
//考勤打卡机不下发按钮
|
||||
return !ParamUtils.getTsDevSn().contains(sn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String exchangeButton(String userId, String sn) {
|
||||
//根据ID查询在职员工信息
|
||||
SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));
|
||||
//员工不存在
|
||||
if(StringUtils.isNull(sysStaff)){
|
||||
return initMessage(1,"当前人员不存在", "000000000");
|
||||
}
|
||||
if(Constants.JOB_STATIS_11.equals(sysStaff.getStatus())){
|
||||
return initMessage(1,"当前人员已离职", "000000000");
|
||||
}
|
||||
if(StringUtils.isEmpty(sysStaff.getTimeClock())){
|
||||
return initMessage(1,"当前人员未注册打卡机", "000000000");
|
||||
}
|
||||
//当前设备不是公共打卡机, 并且
|
||||
//!sn.equals(com.evo.equipment.constant.Constants.EQ_DEVICE_PUBLIC_CODE) &&
|
||||
//!sn.equals(sysStaff.getTimeClock())
|
||||
if(!sysStaff.getTimeClockList().contains(sn)){
|
||||
return initMessage(1,"未设置当前考勤机打卡权限", "000000000");
|
||||
}
|
||||
//检查当前打卡人是不是月薪, 如果是月薪 并且当天没有打卡, 则显示上班卡, 否则显示下班卡
|
||||
SysStaffDetail sysStaffDetail = sysStaffDetailMapper.selectSysStaffDetailByStaffId(sysStaff.getUserId());
|
||||
|
||||
//查询员工的最后一次打卡 按钮切换
|
||||
RzAttendanceDetail rzAttendanceDetail = rzAttendanceDetailService.selectLastRzAttendanceDetail(sysStaff.getUserId());
|
||||
//判断最后一次打卡为下班卡或没有打卡记录,则打卡为上班卡
|
||||
if(showButton(sysStaffDetail) || StringUtils.isNull(rzAttendanceDetail) || "下班卡".equals(rzAttendanceDetail.getButtonType()) || "撤销".equals(rzAttendanceDetail.getButtonType())){
|
||||
//如果最后一条数据的卡类型为下班卡,则返回上班卡和加班卡权限 or 检查当前人员是否存在特殊加班中 或者 检查当前人员部门是否开启加班 or 暂时取消这个判定 当天打过加班卡 ( || rzAttendanceDetailMapper.checkOverTimeCard(sysStaff.getUserId(), new Date()) > 0)
|
||||
if(ObjectUtils.isNotEmpty(eqOverStaffMapper.selectEqOverStaffByUserId(sysStaff.getUserId())) || ObjectUtils.isEmpty(sysDeptMapper.selectOne(new LambdaQueryWrapper<SysDept>().eq(SysDept::getDeptId, sysStaff.getDeptId()).eq(SysDept::getIsOverTime,"1")))){
|
||||
//如果存在特殊加班, 或者当前部门没有开启加班 或者当天打过加班, 则无法打加班卡
|
||||
return initMessage(0,"验证通过", "111000000");
|
||||
}
|
||||
return initMessage(0,"验证通过", "111100000");
|
||||
}else{
|
||||
return initMessage(0,"验证通过", "000011000");
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean showButton(SysStaffDetail detail){
|
||||
return (detail.getBasicSalary() != null && detail.getBasicSalary().compareTo(new BigDecimal(0)) > 0) && (detail.getJobsSalary() != null && detail.getJobsSalary().compareTo(new BigDecimal(0)) > 0) && (!checkToDayCard(String.valueOf(detail.getStaffId()), "上班") && !checkToDayCard(String.valueOf(detail.getStaffId()),"加班"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String exchangeFace(String userId, String sn, Date date, String button, String rules, String photo) {
|
||||
//根据ID查询员工信息 ,判断员工是否存在,不存在返回失败
|
||||
SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));//打卡记录信息
|
||||
log.info("日常-打卡信息如下: 员工姓名:{}, 打卡时间:{}. 打卡设备:{}, 打卡情况: {}",sysStaff.getName(), sdfd.format(date), sn, rules);
|
||||
//检查用户数据
|
||||
String error = checkStaff(sysStaff, sn);
|
||||
if(StringUtils.isNotEmpty(error)){
|
||||
return initMessage(1, error);
|
||||
}
|
||||
/***
|
||||
* 应人力要求,
|
||||
* 1.打卡闭环,不能一天可以打多次卡,一天只有一次打上下班及加班卡
|
||||
* 2.考勤出现漏打卡,次日可以正常打卡(8小时制员工)】 其中8小时制员工 为单班制打卡
|
||||
*/
|
||||
//上班卡
|
||||
if(rules.contains("上班") && checkToDayCard(userId, "上班")){
|
||||
return initMessage(1, "当天已经打过上班卡");
|
||||
}
|
||||
//上班卡
|
||||
if(rules.contains("加班") && checkToDayCard(userId, "加班")){
|
||||
return initMessage(1, "当天已经打过加班卡");
|
||||
}
|
||||
|
||||
|
||||
//员工考勤记录
|
||||
RzAttendance attendance = rzAttendanceMapper.queryNowDayAttendanceByStatisticalIdAndDate(Long.valueOf(userId),date);
|
||||
//如果当前打卡是下班卡, 并且当前员工考勤上班时间为空, 则判定为隔天打下班卡
|
||||
if(rules.contains("下班") && attendance.getWorkStartTime() == null){
|
||||
//获取最后一次的上班记录
|
||||
RzAttendance beforeRzAttendance = rzAttendanceMapper.selectLastRzAttendanceByStaffId(Long.valueOf(userId));
|
||||
//这么写, 是因为存在第一天上班就没打卡,导致获取前一天的数据为空, 导致打卡失败
|
||||
if(ObjectUtils.isNotEmpty(beforeRzAttendance)){
|
||||
attendance = beforeRzAttendance;
|
||||
}
|
||||
}
|
||||
//
|
||||
// RzAttendanceDetail attendanceDetail = new RzAttendanceDetail();
|
||||
// //打卡明细表中插入数据
|
||||
// attendanceDetail.setButtonType(rules);
|
||||
// attendanceDetail.setName(sysStaff.getName());
|
||||
// attendanceDetail.setAttendanceId(attendance.getId());
|
||||
// attendanceDetail.setDateTime(date);
|
||||
// attendanceDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
// attendanceDetail.setStaffId(sysStaff.getUserId());
|
||||
// attendanceDetail.setEquipmentCode(sn);
|
||||
// attendanceDetail.setCreateTime(new Date());
|
||||
//获取员工的工作时长
|
||||
RzAttendanceDetail attendanceDetail = rzAttendanceDetailService.addDetail(attendance, rules, sn, date, "", photo);
|
||||
if(attendanceDetail.getId() == null){
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
|
||||
//打的是加班卡,加班列表中填写数据
|
||||
if(rules.contains("加班")){
|
||||
return overTimeCard(sysStaff, date);
|
||||
}
|
||||
|
||||
|
||||
//判断是撤销卡
|
||||
if(rules.contains("撤销")){
|
||||
return revocationCard(sysStaff, date, attendanceDetail);
|
||||
}
|
||||
|
||||
//上班卡
|
||||
if(rules.contains("上班")){
|
||||
return workCard(sysStaff.getUserId(), date, rules);
|
||||
}
|
||||
|
||||
// 查询员工的最后一次上班打卡信息
|
||||
RzAttendanceDetail rzAttendanceDetail = rzAttendanceDetailService.selectRzAttendanceDetailByStaffId(Long.valueOf(userId));
|
||||
//加班的下班卡
|
||||
if(rzAttendanceDetail.getButtonType().contains("加班")){
|
||||
return overTimeOffDutyCard(sysStaff, date, sn);
|
||||
}
|
||||
//上班的下班卡
|
||||
if(rzAttendanceDetail.getButtonType().contains("上班")){
|
||||
|
||||
return KqUtils.workOffDutyCard( date, rzAttendanceDetail.getButtonType(), attendance) ? initMessage(0, "打卡成功") : initMessage(1,"打卡失败");
|
||||
}
|
||||
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
|
||||
public Boolean checkToDayCard(String userId, String rules){
|
||||
return ObjectUtils.isNotEmpty(rzAttendanceDetailService.getOne(new LambdaQueryWrapper<RzAttendanceDetail>()
|
||||
.like(RzAttendanceDetail::getButtonType,"%"+rules+"%")
|
||||
.eq(RzAttendanceDetail::getStaffId, Long.valueOf(userId))
|
||||
.eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
.apply(" date_format(date_time,'%Y%m%d') = date_format({0},'%Y%m%d') ", new Date())));
|
||||
}
|
||||
|
||||
|
||||
/*** 上班卡
|
||||
* @param userId
|
||||
* @param date
|
||||
* @param rules
|
||||
* @return
|
||||
*/
|
||||
public String workCard(Long userId, Date date, String rules){
|
||||
//员工考勤记录
|
||||
RzAttendance attendance = rzAttendanceMapper.queryNowDayAttendanceByStatisticalIdAndDate(Long.valueOf(userId),date);
|
||||
attendance.setRules(rules);
|
||||
attendance.setWorkStartTime(date);
|
||||
try{
|
||||
if(KqUtils.checkYc("上班", rules, sdf.format(date), sdfd.format(date))){
|
||||
attendance.setYcsFlag("1");
|
||||
}
|
||||
}catch (Exception e){
|
||||
return initMessage(1, "打卡失败,"+e.getMessage());
|
||||
}
|
||||
//查询昨天是否未打卡
|
||||
String notBeforeEndTimeMessage = "";
|
||||
try {
|
||||
RzAttendance beforeAttendance = rzAttendanceMapper.queryNowDayAttendanceByStatisticalIdAndDate(Long.valueOf(userId),DateUtils.addDays(date, -1));
|
||||
if(beforeAttendance.getWorkStartTime() != null && beforeAttendance.getWorkEndTime() == null){
|
||||
notBeforeEndTimeMessage = " - 昨天未打下班卡";
|
||||
//上班打卡不在推送消息, 影响消息返回, 可能引发打卡异常
|
||||
// sendAbnormalAttendance(userId, beforeAttendance.getWorkStartTime());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("查询前一天的打卡情况报错了");
|
||||
}
|
||||
return (rzAttendanceMapper.updateRzAttendance(attendance) > 0) ? initMessage(0, "打卡成功"+notBeforeEndTimeMessage) : initMessage(1, "打卡失败"+notBeforeEndTimeMessage);
|
||||
}
|
||||
//
|
||||
// @Async
|
||||
// public void sendAbnormalAttendance(Long userId, Date date){
|
||||
// try {
|
||||
// SysStaff sysStaff = sysStaffMapper.selectById(userId);
|
||||
// if(sysStaff != null && StringUtils.isNotEmpty(sysStaff.getOpenid())){
|
||||
// SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
// sendClientService.sendAbnormalAttendance(sysDept != null ? sysDept.getDeptName() : "未知",sysStaff.getName(), "昨天下班未打卡", date, sysStaff.getOpenid());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.error("推送公众号打卡异常失败, 原因为: {}", e.getMessage(), e);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
/*** 撤销卡
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public String revocationCard(SysStaff sysStaff, Date date, RzAttendanceDetail revocationDetail){
|
||||
//员工考勤记录
|
||||
/***
|
||||
* 倒序获取最后一条打卡详情, 获取最后一次打卡的规则
|
||||
* 1. 如果是上班卡, 直接走清除规则逻辑并删除打卡详情
|
||||
* 2. 如果是加班卡, 并倒序获取最后一条加班打卡详情 并删除加班详情
|
||||
*
|
||||
* PS. 实际测试中发现, 不存在打完下班卡后打撤销卡
|
||||
* 3 如果是下班卡,
|
||||
* 3.1 需要获取倒数第二条的数据,
|
||||
* 3.2 如果是加班卡, 同步清除加班卡的数据, 并删除加班详情
|
||||
* 3.3 如果是上班卡, 同步清除上班数据, 并删除打卡详情
|
||||
*/
|
||||
// 查询员工的最后一次上班打卡信息
|
||||
RzAttendanceDetail rzAttendanceDetail = getLastDetailByUserIdAndDate(sysStaff.getUserId(), revocationDetail.getId());
|
||||
rzAttendanceDetail.setDelFlag(Constants.DELETE_FLAG_1);
|
||||
// 规则1
|
||||
if(rzAttendanceDetail.getButtonType().contains("上班")){
|
||||
RzAttendance attendance = rzAttendanceMapper.queryNowDayAttendanceByStatisticalIdAndDate(sysStaff.getUserId(),date);
|
||||
attendance.setRules("");
|
||||
attendance.setYcsFlag("");
|
||||
//如果是规则1
|
||||
return ((rzAttendanceMapper.updateById(attendance) > 0 && rzAttendanceDetailService.updateById(rzAttendanceDetail)) ? initMessage(0, "打卡成功") : initMessage(1, "打卡失败"));
|
||||
}
|
||||
// 规则2
|
||||
if(rzAttendanceDetail.getButtonType().contains("加班")){
|
||||
RzOverTimeDetail overTimeDetail = getLastRzOverTimeDetailByUserIdAndDate(sysStaff.getUserId(), revocationDetail.getId());
|
||||
return ((rzOverTimeDetailMapper.deleteById(overTimeDetail) > 0 && rzAttendanceDetailService.updateById(rzAttendanceDetail)) ? initMessage(0, "打卡成功") : initMessage(1, "打卡失败"));
|
||||
}
|
||||
//规则3
|
||||
// if(rzAttendanceDetail.getButtonType().contains("下班")){
|
||||
// //3.1 获取倒数第二条数据
|
||||
// RzAttendanceDetail last2AttendanceDetail = getLastDetailByUserIdAndDate(sysStaff.getUserId(), rzAttendanceDetail.getId(), revocationDetail.getId());
|
||||
// //3.2 加班卡
|
||||
// if(last2AttendanceDetail.getButtonType().contains("加班")){
|
||||
// //如果倒数第二条是加班的话, 获取最后一条加班数据
|
||||
// RzOverTimeDetail overTimeDetail = getLastRzOverTimeDetailByUserIdAndDate(sysStaff.getUserId(), null);
|
||||
// overTimeDetail.setOverTimeEnd(null);
|
||||
// //获取加班统计
|
||||
// RzOverTime rzOverTime = rzOverTimeMapper.selectRzOverTimeById(overTimeDetail.getOverTimeId());
|
||||
// rzOverTime.setTaskHours(rzOverTime.getOverHours().subtract(overTimeDetail.getOverTimeHours()));
|
||||
// overTimeDetail.setOverTimeHours(new BigDecimal(0));
|
||||
// return (rzOverTimeDetailMapper.updateById(overTimeDetail) > 1 && rzOverTimeMapper.updateById(rzOverTime) > 0 && rzAttendanceDetailMapper.updateById(rzAttendanceDetail) > 0) ? initMessage(0, "打卡成功") : initMessage(1, "打卡失败");
|
||||
// }
|
||||
// //3.2 上班卡
|
||||
// if(last2AttendanceDetail.getButtonType().contains("上班")){
|
||||
// //获取所属哪一个考勤记录
|
||||
// RzAttendance attendance = rzAttendanceMapper.selectById(rzAttendanceDetail.getAttendanceId());
|
||||
// //如果是规则1
|
||||
// attendance.setNightNumber(0);
|
||||
// attendance.setMiddleShiftNumber(0);
|
||||
// attendance.setYcxFlag("");
|
||||
// attendance.setWorkEndTime(null);
|
||||
// attendance.setWorkSum(new BigDecimal(0));
|
||||
// return (rzAttendanceMapper.updateById(attendance) > 0 && rzAttendanceDetailMapper.updateById(rzAttendanceDetail) > 0) ? initMessage(0, "打卡成功") : initMessage(1, "打卡失败");
|
||||
// }
|
||||
// }
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
|
||||
public RzOverTimeDetail getLastRzOverTimeDetailByUserIdAndDate(Long userId, Long notId){
|
||||
return rzOverTimeDetailMapper.getLastRzOverTimeDetailByUserIdAndNotId(userId, notId);
|
||||
}
|
||||
|
||||
|
||||
public RzAttendanceDetail getLastDetailByUserIdAndDate(Long userId, Long... notId){
|
||||
return rzAttendanceDetailService.getOne(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getStaffId,userId).notIn(Collections.isNotEmpty(notId), RzAttendanceDetail::getId, notId).orderByDesc(RzAttendanceDetail::getDateTime).last(" limit 1"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*** 加班卡
|
||||
* @param sysStaff
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public String overTimeCard(SysStaff sysStaff , Date date){
|
||||
//判断打卡月是否统计过加班
|
||||
RzOverTime rzOverTime = rzOverTimeMapper.selectRzOverTimeByNameAndMonth(sysStaff.getUserId(),date);
|
||||
if(rzOverTime == null){
|
||||
rzOverTime = new RzOverTime();
|
||||
rzOverTime.setUserId(sysStaff.getUserId());
|
||||
rzOverTime.setOverHours(new BigDecimal("0.0"));
|
||||
rzOverTime.setDeptId(sysStaff.getDeptId());
|
||||
rzOverTime.setName(sysStaff.getName());
|
||||
rzOverTime.setOverTimeMonth(date);
|
||||
if(rzOverTimeMapper.insert(rzOverTime) < 1){
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
}
|
||||
RzOverTimeDetail rzOverTimeDetail = new RzOverTimeDetail();
|
||||
rzOverTimeDetail.setOverTimeId(rzOverTime.getId());
|
||||
rzOverTimeDetail.setOverTimeStart(date);
|
||||
rzOverTimeDetail.setName(sysStaff.getName());
|
||||
rzOverTimeDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
rzOverTimeDetail.setCreateBy("admin");
|
||||
rzOverTimeDetail.setCreateTime(DateUtils.getNowDate());
|
||||
return (rzOverTimeDetailMapper.insert(rzOverTimeDetail) < 1) ? initMessage(1, "打卡失败") : initMessage(0, "打卡成功");
|
||||
}
|
||||
|
||||
/*** 加班的下班卡
|
||||
* @param sysStaff
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public String overTimeOffDutyCard(SysStaff sysStaff , Date date, String sn){
|
||||
//修改加班打卡记录 根据员工ID和时间查找 统计数据
|
||||
RzOverTime rzOverTime = rzOverTimeMapper.selectRzOverTimeByNameAndMonth(sysStaff.getUserId(),date);
|
||||
//如果没有加班汇总, 生成一条新的
|
||||
if(ObjectUtils.isEmpty(rzOverTime)){
|
||||
rzOverTime = new RzOverTime();
|
||||
rzOverTime.setUserId(sysStaff.getUserId());
|
||||
rzOverTime.setDeptId(sysStaff.getDeptId());
|
||||
rzOverTime.setName(sysStaff.getName());
|
||||
rzOverTime.setOverTimeMonth(date);
|
||||
rzOverTime.setOverHours(DataUtils.DEFAULT_VALUE);
|
||||
rzOverTime.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
rzOverTime.setCreateBy("admin");
|
||||
rzOverTime.setCreateTime(new Date());
|
||||
rzOverTimeMapper.insert(rzOverTime);
|
||||
}
|
||||
//查找加班详情 加班统计ID和加班开始时间
|
||||
RzOverTimeDetail rzOverTimeDetail = rzOverTimeDetailMapper.queryRzOverTimeDetailByDateAndOverId(rzOverTime.getId(),date);
|
||||
if(ObjectUtils.isEmpty(rzOverTimeDetail)){
|
||||
return initMessage(1, "未找到当天的加班信息, 请补卡");
|
||||
}
|
||||
rzOverTimeDetail.setOverTimeEnd(date);
|
||||
//计算加班时长 分钟
|
||||
KqUtils.calculateOverTimeHours(rzOverTimeDetail, sysStaff.getUserId(), sn);
|
||||
|
||||
// BigDecimal minutes = new BigDecimal((rzOverTimeDetail.getOverTimeEnd().getTime() - rzOverTimeDetail.getOverTimeStart().getTime())/1000/60);
|
||||
// //获取加班的最后一次的上班卡类型, 如果不是12小时制或者三班制, 直接扣减半小时
|
||||
// RzAttendanceDetail rzAttendanceDetail = rzAttendanceDetailService.selectLastWorkCardByStaffId(sysStaff.getUserId());
|
||||
// /***
|
||||
// * 上班卡不是12小时制, 并且不是三班制 (三班制为兼容旧数据) 直接扣减30分钟
|
||||
// *需求来源 3.2.4 短休相关规定
|
||||
// * 3.2 工作时间
|
||||
// * 3.2.1 长白班:
|
||||
// * (1)实行每周一至周六,每天8小时的工作制度;
|
||||
// * (2)工作时间:08:30—12:00,13:00—17:30;
|
||||
// * (3)午休时间:12:00—13:00;
|
||||
// * (4)节假日(含周日)加班时,工作时间按第(2)条执行。
|
||||
// * 3.2.2 八小时倒班:
|
||||
// * (1)白班工作时间:8:30—12:00, 12:30—17:00; 午餐短休:12:00—12:30。
|
||||
// * (2)中班工作时间:17:00—18:30,19:00—01:30; 晚餐短休:18:30—19:00。
|
||||
// * 3.2.3 十二小时倒班:
|
||||
// * (1)白班工作时间:8:30—12:00,12:30—18:30,19:00—20:30;
|
||||
// * 午餐短休:12:00—12:30,晚餐短休:18:30—19:00。
|
||||
// * (2)夜班工作时间:20:30—23:30,00:00—03:30,04:00—08:30;
|
||||
// * 夜班短休:23:30—00:00,03:30—04:00。
|
||||
// * 3.2.4 短休相关规定:
|
||||
// * (1)在规定的短休时间段内,需装拆加工零部件时,可暂停设备前往就餐或短休;
|
||||
// * (2)原则上十二小时倒班人员短休核算工时,八小时倒班及长白班人员短休不统计该时间段工时;
|
||||
// * (3)非就餐的短休,地点应在设备可视且可听范围之内,严禁在短休前提前强行停机,一经发现按以下条款考核激励:
|
||||
// * A) 岗位责任人激励-50元/项/次;
|
||||
// * B) 公司检查发现的按层级组织秩序,激励责任管理岗两级各-100元/项/次。
|
||||
// */
|
||||
// if(!rzAttendanceDetail.getButtonType().contains("12") && !rzAttendanceDetail.getButtonType().contains("三班")){
|
||||
// minutes = minutes.subtract(new BigDecimal(ParamUtils.getShortBreakDeductionMinutes()));
|
||||
// }
|
||||
// //设置默认加班0小时
|
||||
// double hours = 0;
|
||||
// //加班分钟>0分钟, 计算小时
|
||||
// if(minutes.compareTo(DataUtils.DEFAULT_VALUE) >0){
|
||||
// //计算小时, 保留2位小数
|
||||
// hours = minutes.divide(new BigDecimal(60),2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
// }
|
||||
//
|
||||
// //获取规则
|
||||
// JSONObject deviceRules = ParamUtils.getDeviceOverTimeRules(sn);
|
||||
// //获取最大加班时长
|
||||
// Integer maxOverTimeHour = deviceRules.getInteger("maxHour");
|
||||
// //记录加班时长
|
||||
// rzOverTimeDetail.setOverTimeHours(BigDecimal.valueOf(((hours > maxOverTimeHour) ? maxOverTimeHour : hours)));
|
||||
|
||||
if(rzOverTimeDetailMapper.updateRzOverTimeDetail(rzOverTimeDetail) < 1){
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
//加班修改统计
|
||||
rzOverTime.setOverHours(rzOverTime.getOverHours().add(rzOverTimeDetail.getOverTimeHours()));
|
||||
if(rzOverTimeMapper.updateRzOverTime(rzOverTime) < 1){
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
return initMessage(0, "打卡成功");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,180 +0,0 @@
|
||||
package com.evo.attendance.processor.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.attendance.domain.RzSpecialAttendance;
|
||||
import com.evo.attendance.domain.RzSpecialOverTime;
|
||||
import com.evo.attendance.mapper.RzAttendanceStatisticalMapper;
|
||||
import com.evo.attendance.mapper.RzSpecialAttendanceMapper;
|
||||
import com.evo.attendance.mapper.RzSpecialOverTimeMapper;
|
||||
import com.evo.attendance.processor.PunchTheClockStrategyExchangeProcessor;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.utils.DataUtils;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.personnelMatters.domain.EqOverStaff;
|
||||
import com.evo.personnelMatters.domain.SpecialOverTime;
|
||||
import com.evo.personnelMatters.mapper.BsOverTimeMapper;
|
||||
import com.evo.personnelMatters.mapper.EqOverStaffMapper;
|
||||
import com.evo.restaurant.domain.RzRestaurantDetail;
|
||||
import com.evo.restaurant.mapper.RzRestaurantDetailMapper;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 特殊加班类
|
||||
*
|
||||
* @ClassName:TSDeviceExchangeProcessor
|
||||
* @date: 2025年05月28日 13:13
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TSDeviceExchangeProcessor implements PunchTheClockStrategyExchangeProcessor {
|
||||
@Resource
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
@Resource
|
||||
private RzSpecialAttendanceMapper rzSpecialAttendanceMapper;
|
||||
@Resource
|
||||
private RzSpecialOverTimeMapper rzSpecialOverTimeMapper;
|
||||
@Resource
|
||||
private RzRestaurantDetailMapper rzRestaurantDetailMapper;
|
||||
@Resource
|
||||
private BsOverTimeMapper bsOverTimeMapper;
|
||||
@Resource
|
||||
private EqOverStaffMapper eqOverStaffMapper;
|
||||
|
||||
@Override
|
||||
public boolean accept(String sn) {
|
||||
return ParamUtils.getTsDevSn().contains(sn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String exchangeButton(String userId, String sn) {
|
||||
//根据ID查询在职员工信息
|
||||
SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));
|
||||
//检查当前人员是否存在特殊加班中
|
||||
EqOverStaff eqOverStaff = eqOverStaffMapper.selectEqOverStaffByUserId(Long.valueOf(userId));
|
||||
|
||||
if(StringUtils.isNull(eqOverStaff)){
|
||||
return initMessage(1,"未设置当前考勤机打卡权限", "000000000");
|
||||
}
|
||||
if(Constants.JOB_STATIS_11.equals(sysStaff.getStatus())){
|
||||
return initMessage(1,"当前人员已离职", "000000000");
|
||||
}
|
||||
//检查是否有上班的打卡
|
||||
RzSpecialAttendance rzSpecialAttendance = rzSpecialAttendanceMapper.selectRzSpecialAttendanceByUserIdAndDate(Long.valueOf(userId),new Date());
|
||||
if(StringUtils.isNull(rzSpecialAttendance)){
|
||||
return initMessage(0,"验证通过", "000100000");
|
||||
}else{
|
||||
return initMessage(0,"验证通过", "000010000");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String exchangeFace(String userId, String sn, Date date, String button, String rules, String photo) {
|
||||
if(!ParamUtils.checkTsDeviceButton(sn, rules)){
|
||||
return initMessage(1, "无效打卡");
|
||||
}
|
||||
SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));
|
||||
log.info("特殊-打卡信息如下: 员工姓名:{}, 打卡时间:{}. 打卡设备:{}, 打卡情况: {}",sysStaff.getName(), sdfd.format(date), sn, rules);
|
||||
//检查用户数据
|
||||
String error = checkStaff(sysStaff, sn);
|
||||
if(StringUtils.isNotEmpty(error)){
|
||||
return initMessage(1, error);
|
||||
}
|
||||
//获取加班详情数据
|
||||
RzSpecialAttendance rzSpecialAttendance = rzSpecialAttendanceMapper.selectRzSpecialAttendanceByUserIdAndDate(Long.valueOf(userId),new Date());
|
||||
//如果没有, 则新增
|
||||
if(rzSpecialAttendance == null){
|
||||
rzSpecialAttendance = new RzSpecialAttendance();
|
||||
rzSpecialAttendance.setAttendanceDate(new Date());
|
||||
rzSpecialAttendance.setStaffId(Long.valueOf(userId));
|
||||
rzSpecialAttendance.setName(sysStaff.getName());
|
||||
rzSpecialAttendance.setDeptId(sysStaff.getDeptId());
|
||||
rzSpecialAttendance.setDelFlag("0");
|
||||
rzSpecialAttendance.setCreateBy("admin");
|
||||
rzSpecialAttendance.setCreateTime(new Date());
|
||||
rzSpecialAttendanceMapper.insertRzSpecialAttendance(rzSpecialAttendance);
|
||||
}
|
||||
//获取加班统计数据
|
||||
RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeByUserIdAndDate(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
if(ObjectUtils.isEmpty(rzSpecialOverTime)){
|
||||
rzSpecialOverTime = new RzSpecialOverTime();
|
||||
rzSpecialOverTime.setUserId(Long.valueOf(userId));
|
||||
rzSpecialOverTime.setName(sysStaff.getName());
|
||||
rzSpecialOverTime.setDeptId(sysStaff.getDeptId());
|
||||
rzSpecialOverTime.setDelFlag("0");
|
||||
rzSpecialOverTime.setOverDate(date);
|
||||
rzSpecialOverTime.setCreateTime(new Date());
|
||||
rzSpecialOverTime.setCreateBy("admin");
|
||||
rzSpecialOverTimeMapper.insertRzSpecialOverTime(rzSpecialOverTime);
|
||||
}
|
||||
//获取打卡时间范围
|
||||
SpecialOverTime specialOverTime = bsOverTimeMapper.selectSpecialOverTimeById();
|
||||
//特殊打卡机, 只有加班和下班, 所有不做其他类型处理
|
||||
if(rules.contains("加班")){
|
||||
if(date.compareTo(DateUtils.dateTime("yyyy-MM-dd HH:mm", sdfd.format(date)+" "+specialOverTime.getWorkStart())) < 0){
|
||||
return initMessage(1, "当前时间不允许打加班卡");
|
||||
}
|
||||
rzSpecialAttendance.setWorkStartTime(date);
|
||||
rzSpecialAttendanceMapper.updateRzSpecialAttendance(rzSpecialAttendance);
|
||||
return initMessage(0, "打卡成功");
|
||||
}
|
||||
if(rules.contains("下班")){
|
||||
//记录下班时间
|
||||
rzSpecialAttendance.setWorkEndTime(date);
|
||||
JSONObject ruleJson = ParamUtils.getDeviceOverTimeRules(sn);
|
||||
//如果没有规则, 直接设置加班时长为0小时
|
||||
if(ruleJson == null || !ruleJson.containsKey("endMealTime")){
|
||||
rzSpecialAttendance.setWorkHours(new BigDecimal(0));
|
||||
rzSpecialAttendance.setRemarks("没有找到加班规则"+sn);
|
||||
rzSpecialAttendanceMapper.updateRzSpecialAttendance(rzSpecialAttendance);
|
||||
return initMessage(0, "打卡成功");
|
||||
}
|
||||
//获取餐厅关闭时间, 核减打卡开始时间, 核验是否需要扣减加班时长
|
||||
String endMealTime = ruleJson.getString("endMealTime");
|
||||
Integer maxHour = ruleJson.getInteger("maxHour");
|
||||
Integer minHour = ruleJson.getInteger("minHour");
|
||||
//根据公司规定, 如果加班卡打卡时间早于19点,则按照19点计算
|
||||
Date endMealDate = DateUtils.dateTime("yyyy-MM-dd HH:mm", sdfd.format(date)+" "+endMealTime);
|
||||
Long overMinutes = DateUtils.getBetweenMinutes(rzSpecialAttendance.getWorkStartTime(), rzSpecialAttendance.getWorkEndTime());
|
||||
//核查当前人员, 当天是否吃完饭 //如果吃晚饭, 扣减30分钟
|
||||
if((rzSpecialAttendance.getWorkStartTime().compareTo(endMealDate) <= 0) && (rzRestaurantDetailMapper.checkDinnerByStaffIdAndDateAndSign(sysStaff.getUserId(), date, "晚餐").compareTo(0l) > 0)){
|
||||
overMinutes = new BigDecimal(overMinutes).subtract(new BigDecimal(ParamUtils.getShortBreakDeductionMinutes("TS"))).longValue();
|
||||
}
|
||||
BigDecimal workHours = new BigDecimal(0);
|
||||
if(overMinutes >= (maxHour*60)){
|
||||
workHours= new BigDecimal(3);
|
||||
}else if(overMinutes >= (minHour*60)){
|
||||
workHours = new BigDecimal(2);
|
||||
}
|
||||
rzSpecialAttendance.setWorkHours(workHours);
|
||||
rzSpecialAttendanceMapper.updateRzSpecialAttendance(rzSpecialAttendance);
|
||||
//只有当存在打卡时长的时候, 才回去进行数据的计算
|
||||
if(DataUtils.DEFAULT_VALUE.compareTo(rzSpecialAttendance.getWorkHours()) != 0){
|
||||
rzSpecialOverTime.setSickHours(rzSpecialOverTime.getSickHours().add(rzSpecialAttendance.getWorkHours()));
|
||||
rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
|
||||
// RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
// if(StringUtils.isNull(rzAttendanceStatistical.getOverTimeHours())){
|
||||
// rzAttendanceStatistical.setOverTimeHours(new BigDecimal(0.0));
|
||||
// }
|
||||
// rzAttendanceStatistical.setOverTimeHours(rzAttendanceStatistical.getOverTimeHours().add(rzSpecialAttendance.getWorkHours()));
|
||||
// rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
}
|
||||
return initMessage(0, "打卡成功");
|
||||
}
|
||||
return initMessage(1, "打卡失败");
|
||||
}
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
|
||||
/**
|
||||
* 考勤异常详情Service接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public interface IRzAbnormalDetailService
|
||||
{
|
||||
/**
|
||||
* 查询考勤异常详情
|
||||
*
|
||||
* @param id 考勤异常详情主键
|
||||
* @return 考勤异常详情
|
||||
*/
|
||||
public RzAbnormalDetail selectRzAbnormalDetailById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤异常详情列表
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 考勤异常详情集合
|
||||
*/
|
||||
public List<RzAbnormalDetail> selectRzAbnormalDetailList(RzAbnormalDetail rzAbnormalDetail);
|
||||
|
||||
/**
|
||||
* 新增考勤异常详情
|
||||
* @return 结果
|
||||
*/
|
||||
public void insertRzAbnormalDetail();
|
||||
|
||||
/**
|
||||
* 修改考勤异常详情
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAbnormalDetail(RzAbnormalDetail rzAbnormalDetail);
|
||||
|
||||
/**
|
||||
* 删除考勤异常详情信息
|
||||
*
|
||||
* @param id 考勤异常详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzAbnormalDetailById(Long id);
|
||||
}
|
||||
@ -1,52 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzAbnormal;
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
|
||||
/**
|
||||
* 考勤异常Service接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public interface IRzAbnormalService
|
||||
{
|
||||
/**
|
||||
* 查询考勤异常
|
||||
*
|
||||
* @param id 考勤异常主键
|
||||
* @return 考勤异常
|
||||
*/
|
||||
public RzAbnormal selectRzAbnormalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤异常列表
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 考勤异常集合
|
||||
*/
|
||||
public List<RzAbnormal> selectRzAbnormalList(RzAbnormal rzAbnormal);
|
||||
|
||||
/**
|
||||
* 修改考勤异常
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAbnormal(RzAbnormal rzAbnormal);
|
||||
|
||||
/**
|
||||
* 删除考勤异常信息
|
||||
*
|
||||
* @param id 考勤异常主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzAbnormalById(Long id);
|
||||
/**
|
||||
* 异常详情
|
||||
* @param rzAbnormal
|
||||
* @return
|
||||
*/
|
||||
public List<RzAbnormalDetail> listAbnormalDetails(RzAbnormal rzAbnormal);
|
||||
}
|
||||
@ -1,65 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailVO;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤记录Service接口
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
public interface IRzAttendanceService extends IService<RzAttendance>
|
||||
{
|
||||
/**
|
||||
* 查询考勤记录
|
||||
*
|
||||
* @param id 考勤记录主键
|
||||
* @return 考勤记录
|
||||
*/
|
||||
public RzAttendance selectRzAttendanceById(Long id);
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> selectRzAttendanceList(RzAttendance rzAttendance);
|
||||
/**
|
||||
* 修改考勤记录
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAttendance(RzAttendance rzAttendance);
|
||||
/**
|
||||
* 每日上班打卡统计
|
||||
* @return
|
||||
*/
|
||||
public int attendenceCount();
|
||||
/**
|
||||
* 批量修改考勤记录
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult updateBatchAttendance(RzAttendance rzAttendance);
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> listAttendanceByParams(RzAttendance rzAttendance);
|
||||
|
||||
AjaxResult importAttendance(List<RzAttendanceDetailVO> attendanceList);
|
||||
|
||||
RzAttendance selectRzAttendanceBySfIdAndNameAndTime(Long userId, String employeeName, String replacementTime,Boolean isAttendance);
|
||||
|
||||
public void sendAbnormalAttendance();
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤统计Service接口
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
public interface IRzAttendanceStatisticalService extends IService<RzAttendanceStatistical>
|
||||
{
|
||||
/**
|
||||
* 查询考勤统计
|
||||
*
|
||||
* @param id 考勤统计主键
|
||||
* @return 考勤统计
|
||||
*/
|
||||
public RzAttendanceStatistical selectRzAttendanceStatisticalById(Long id);
|
||||
|
||||
/**
|
||||
* 查询考勤统计列表
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 考勤统计集合
|
||||
*/
|
||||
public List<RzAttendanceStatistical> selectRzAttendanceStatisticalList(RzAttendanceStatistical rzAttendanceStatistical);
|
||||
|
||||
/**
|
||||
* 修改考勤统计
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzAttendanceStatistical(RzAttendanceStatistical rzAttendanceStatistical);
|
||||
/**
|
||||
* 校正数据
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult correct(RzAttendanceStatistical rzAttendanceStatisticals);
|
||||
|
||||
/**
|
||||
* 批量导入考勤统计
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
public AjaxResult importRzAttendanceStatistical(List<RzAttendanceStatistical> list);
|
||||
|
||||
/***
|
||||
* 生成考勤信息
|
||||
* @param sysStaff
|
||||
* @param dayList
|
||||
* @param date
|
||||
* @return
|
||||
*/
|
||||
RzAttendanceStatistical createRzAttendance(SysStaff sysStaff, List<String> dayList, Date date);
|
||||
|
||||
/***
|
||||
* 自动计算前一天的考勤情况
|
||||
*/
|
||||
AjaxResult autoCalculateTheDayBeforeAttendance(Date date);
|
||||
|
||||
}
|
||||
@ -1,54 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import com.evo.attendance.domain.RzSpecialAttendance;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 加班考勤记录Service接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
public interface IRzSpecialAttendanceService
|
||||
{
|
||||
/**
|
||||
* 查询加班考勤记录
|
||||
*
|
||||
* @param id 加班考勤记录主键
|
||||
* @return 加班考勤记录
|
||||
*/
|
||||
public RzSpecialAttendance selectRzSpecialAttendanceById(Long id);
|
||||
|
||||
/**
|
||||
* 查询加班考勤记录列表
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 加班考勤记录集合
|
||||
*/
|
||||
public List<RzSpecialAttendance> selectRzSpecialAttendanceList(RzSpecialAttendance rzSpecialAttendance);
|
||||
|
||||
/**
|
||||
* 新增加班考勤记录
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzSpecialAttendance(RzSpecialAttendance rzSpecialAttendance);
|
||||
|
||||
/**
|
||||
* 修改加班考勤记录
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzSpecialAttendance(RzSpecialAttendance rzSpecialAttendance);
|
||||
|
||||
/**
|
||||
* 删除加班考勤记录信息
|
||||
*
|
||||
* @param id 加班考勤记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzSpecialAttendanceById(Long id);
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import com.evo.attendance.domain.RzSpecialOverTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特殊加班管理Service接口
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-16
|
||||
*/
|
||||
public interface IRzSpecialOverTimeService
|
||||
{
|
||||
/**
|
||||
* 查询特殊加班管理
|
||||
*
|
||||
* @param id 特殊加班管理主键
|
||||
* @return 特殊加班管理
|
||||
*/
|
||||
public RzSpecialOverTime selectRzSpecialOverTimeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询特殊加班管理列表
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 特殊加班管理集合
|
||||
*/
|
||||
public List<RzSpecialOverTime> selectRzSpecialOverTimeList(RzSpecialOverTime rzSpecialOverTime);
|
||||
|
||||
/**
|
||||
* 新增特殊加班管理
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzSpecialOverTime(RzSpecialOverTime rzSpecialOverTime);
|
||||
|
||||
/**
|
||||
* 修改特殊加班管理
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzSpecialOverTime(RzSpecialOverTime rzSpecialOverTime);
|
||||
|
||||
/**
|
||||
* 删除特殊加班管理信息
|
||||
*
|
||||
* @param id 特殊加班管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzSpecialOverTimeById(Long id);
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzSysParam;
|
||||
|
||||
/**
|
||||
* 参数配置Service接口
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public interface IRzSysParamService
|
||||
{
|
||||
/**
|
||||
* 查询参数配置
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 参数配置
|
||||
*/
|
||||
public RzSysParam selectRzSysParamById(Long id);
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 参数配置集合
|
||||
*/
|
||||
public List<RzSysParam> selectRzSysParamList(RzSysParam rzSysParam);
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertRzSysParam(RzSysParam rzSysParam);
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateRzSysParam(RzSysParam rzSysParam);
|
||||
|
||||
/**
|
||||
* 批量删除参数配置
|
||||
*
|
||||
* @param ids 需要删除的参数配置主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzSysParamByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除参数配置信息
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteRzSysParamById(Long id);
|
||||
|
||||
/***
|
||||
* 获取数据信息
|
||||
* @param name
|
||||
* @param code
|
||||
* @param defVal
|
||||
* @param des
|
||||
* @return
|
||||
*/
|
||||
public RzSysParam getRzSysParam(String name, String code, String defVal, String des);
|
||||
|
||||
/***
|
||||
* 获取数据信息
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
public RzSysParam getRzSysParam(String code);
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
public interface PunchTheClockService {
|
||||
|
||||
/**
|
||||
* 刷脸获取打卡按钮权限
|
||||
*/
|
||||
public String returnMessage(String json);
|
||||
/**
|
||||
* 用户点击打卡按钮后请求的接口
|
||||
*/
|
||||
public String recordFace(String json) throws UnsupportedEncodingException;
|
||||
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 接口
|
||||
*
|
||||
* @ClassName:RzAttendanceDetailService
|
||||
* @date: 2025年07月07日 13:32
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
public interface RzAttendanceDetailService extends IService<RzAttendanceDetail> {
|
||||
|
||||
public RzAttendanceDetail addDetail(RzAttendance attendance, String rules, String sn, Date date, String remark, String photo);
|
||||
|
||||
public RzAttendanceDetail addOrUpdateDetail(String source, RzAttendance attendance, String rules, String sn, Date date, String remark, String photo);
|
||||
|
||||
public RzAttendanceDetail selectLastRzAttendanceDetail(Long staffId);
|
||||
|
||||
public RzAttendanceDetail selectRzAttendanceDetailByStaffId(Long staffId);
|
||||
|
||||
public RzAttendanceDetail selectLastWorkCardByStaffId(@Param("staffId") Long staffId);
|
||||
|
||||
public List<RzAttendanceDetailTimeLineVO> selectListByAttendanceId(Long attId);
|
||||
|
||||
public void sendAttendanceDetail() throws ParseException;
|
||||
|
||||
}
|
||||
@ -1,602 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceData;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceVo;
|
||||
import com.evo.attendance.processor.PunchTheClockStrategyExchangeProcessor;
|
||||
import com.evo.attendance.service.PunchTheClockService;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.equipment.domain.EqButton;
|
||||
import com.evo.equipment.mapper.EqButtonMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class PunchTheClockServiceImpl implements PunchTheClockService {
|
||||
|
||||
@Resource
|
||||
private EqButtonMapper eqButtonMapper;
|
||||
@Autowired
|
||||
private ApplicationContext applicationContext;
|
||||
/**
|
||||
* 刷脸获取打卡按钮权限
|
||||
* sn 设备号
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* type 设备识别类型
|
||||
* user_id 用户id
|
||||
* card 人员信息中的卡号
|
||||
* confidence 人脸算法识别到的相识度
|
||||
* temperature 测量到的温度,未开启测温的设备为空
|
||||
*
|
||||
* 响应: Result 返回请求类型:0:可以打卡,其它值表示无法打卡
|
||||
* Msg 对应 Result 的状态,可为空
|
||||
* Content 识别后返回的详细信息
|
||||
* button 9位长度的字符串,0 表示不可以点击 1 表示可以点击
|
||||
*
|
||||
* String sn,String type,String userId,String card,String confidence
|
||||
*/
|
||||
@Override
|
||||
public String returnMessage(String json){
|
||||
//解析收到的数据
|
||||
JSONObject jsonObject = JSONObject.parseObject(json);
|
||||
log.info("获取打卡按钮信息{}", jsonObject.toString());
|
||||
String userId = jsonObject.getString("user_id");
|
||||
//需要推送的数据
|
||||
String sn = jsonObject.getString("sn");
|
||||
|
||||
Map<String, PunchTheClockStrategyExchangeProcessor> mqttRequestExchangeProcessorMap = applicationContext.getBeansOfType(PunchTheClockStrategyExchangeProcessor.class);
|
||||
for (PunchTheClockStrategyExchangeProcessor processor : mqttRequestExchangeProcessorMap.values()) {
|
||||
if(processor.accept(sn)){
|
||||
return processor.exchangeButton(userId, sn);
|
||||
}
|
||||
}
|
||||
return initMessage(1,"未找到打卡机信息", "000000000");
|
||||
|
||||
/***
|
||||
* PS: 注解为原代码逻辑
|
||||
* //解析收到的数据
|
||||
* JSONObject jsonObject = JSONObject.parseObject(json);
|
||||
* String userId = jsonObject.getString("user_id");
|
||||
* //需要推送的数据
|
||||
* String message = "";
|
||||
* //需要返回的对象
|
||||
* RzAttendanceVo cardV = new RzAttendanceVo();
|
||||
* RzAttendanceData cardD = new RzAttendanceData();
|
||||
* String sn = jsonObject.getString("sn");
|
||||
* if(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE.equals(sn)){
|
||||
* boolean flag = DateUtil.isSaturday(new Date(),1);
|
||||
* if(flag){
|
||||
* cardV.setResult(1);
|
||||
* cardV.setMsg("{\"Result\":1,\"Msg\":\"周日不能打卡\"}");
|
||||
* cardD.setButton("000000000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* return message;
|
||||
* }
|
||||
* EqOverStaff eqOverStaff = eqOverStaffMapper.selectEqOverStaffByUserId(Long.valueOf(userId));
|
||||
* if(StringUtils.isNull(eqOverStaff)){
|
||||
* cardV.setResult(1);
|
||||
* cardV.setMsg("{\"Result\":1,\"Msg\":\"验证失败,未设置考勤权限\"}");
|
||||
* cardD.setButton("000000000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* return message;
|
||||
* }
|
||||
* RzSpecialAttendance rzSpecialAttendance = rzSpecialAttendanceMapper.selectRzSpecialAttendanceByuserIdAndDate(Long.valueOf(userId),new Date());
|
||||
* if(StringUtils.isNull(rzSpecialAttendance)){
|
||||
* cardV.setResult(0);
|
||||
* cardV.setMsg("验证通过");
|
||||
* cardD.setButton("111100000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* }else{
|
||||
* cardV.setResult(0);
|
||||
* cardV.setMsg("验证通过");
|
||||
* cardD.setButton("000011000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* }
|
||||
* return message;
|
||||
* }
|
||||
* //根据ID查询在职员工信息
|
||||
* SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));
|
||||
* //员工不存在,说明离职没有打卡权限
|
||||
* if(StringUtils.isNull(sysStaff)){
|
||||
* cardV.setResult(1);
|
||||
* cardV.setMsg("{\"Result\":1,\"Msg\":\"验证失败,未设置考勤权限\"}");
|
||||
* cardD.setButton("000000000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* return message;
|
||||
* }
|
||||
* //根据id查询当前员工不是员工列表中的人,返回提示
|
||||
* EqImages userImg = eqImagesMapper.selectEqImagesByStaffId(Long.valueOf(userId));
|
||||
* if(StringUtils.isNull(userImg)){
|
||||
* cardV.setResult(1);
|
||||
* cardV.setMsg("{\"Result\":1,\"Msg\":\"验证失败,未设置考勤权限\"}");
|
||||
* cardD.setButton("000000000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* return message;
|
||||
* }
|
||||
* //查询员工的最后一次打卡 按钮切换
|
||||
* RzAttendanceDetail rzAttendanceDetail = rzAttendanceDetailMapper.selectLastRzAttendanceDetail(Long.valueOf(userId));
|
||||
* //判断最后一次打卡为下班卡或没有打卡记录,则打卡为上班卡
|
||||
* if(StringUtils.isNull(rzAttendanceDetail) || "下班卡".equals(rzAttendanceDetail.getButtonType()) || "撤销".equals(rzAttendanceDetail.getButtonType())){
|
||||
* //如果最后一条数据的卡类型为下班卡,则返回上班卡和加班卡权限
|
||||
* cardV.setResult(0);
|
||||
* cardV.setMsg("验证通过");
|
||||
* cardD.setButton("111100000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* }else{
|
||||
* cardV.setResult(0);
|
||||
* cardV.setMsg("验证通过");
|
||||
* cardD.setButton("000011000");
|
||||
* cardV.setContent(cardD);
|
||||
* //Java对象转换成JSON字符串
|
||||
* message = JSONObject.toJSONString(cardV);
|
||||
* }
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
private String initMessage(Integer result, String meg){
|
||||
//需要返回的对象, 默认失败
|
||||
return JSONObject.toJSONString(new RzAttendanceVo(result, meg, null));
|
||||
}
|
||||
|
||||
private String initMessage(Integer result, String meg, String buttonPermission){
|
||||
//需要返回的对象, 默认失败
|
||||
if(StringUtils.isNotEmpty(buttonPermission)){
|
||||
return JSONObject.toJSONString(new RzAttendanceVo(result, meg, new RzAttendanceData(buttonPermission)));
|
||||
}
|
||||
return JSONObject.toJSONString(new RzAttendanceVo(result, meg));
|
||||
}
|
||||
/**
|
||||
* 用户点击打卡按钮后请求的接口
|
||||
* sn 设备号
|
||||
* user_id 人员id
|
||||
* user_name 用户名
|
||||
* user_type 用户类型,对应下发人员时的 user_type
|
||||
* card_number 卡号
|
||||
* recog_type 识别类型: face - 为人脸识别 、card - 刷卡开门,人脸或卡模式
|
||||
* recog_time 识别时间(时间格式yyyy-MM-dd HH:mm:ss)
|
||||
* photo 识别照片,服务端收到后转换成图片步骤请查看 2、服务规范 - 照片解码流程
|
||||
* body_temperature 体温
|
||||
* confidence 通过的置信度
|
||||
* button 1~9 表示点击的是第几个按钮
|
||||
*
|
||||
* 响应:Result 返回请求类型:0成功,其它失败
|
||||
* Msg 对应 Result 的文本信息
|
||||
*
|
||||
* String sn,String userId,String userName,String userType,String cardNumber,String recog_type,String recog_time,String photo,String body_temperature,String confidence,String button
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public String recordFace(String json) throws UnsupportedEncodingException {
|
||||
//解析收到的数据
|
||||
JSONObject jsonObject = JSONObject.parseObject(json);
|
||||
log.info("获取打卡信息{}", jsonObject.toString());
|
||||
String photo = java.net.URLDecoder.decode(jsonObject.getString("photo"), StandardCharsets.UTF_8.name()).replaceAll("\n","");
|
||||
String userId = jsonObject.getString("user_id");
|
||||
String sn = jsonObject.getString("sn");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = null; //打卡时间
|
||||
try{
|
||||
date = sdf.parse(jsonObject.getString("recog_time"));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return initMessage(1,"打卡失败");
|
||||
}
|
||||
String button = jsonObject.getString("button");
|
||||
List<EqButton> bt_list = eqButtonMapper.selectEqButtonList(null);
|
||||
if(Collections.isEmpty(bt_list)){
|
||||
return initMessage(1,"打卡失败");
|
||||
}
|
||||
//根据顺序获取打卡规则
|
||||
EqButton eqButton = bt_list.get(Integer.parseInt(button)-1);
|
||||
String rules = eqButton.getName(); //打卡规则
|
||||
Map<String, PunchTheClockStrategyExchangeProcessor> mqttRequestExchangeProcessorMap = applicationContext.getBeansOfType(PunchTheClockStrategyExchangeProcessor.class);
|
||||
for (PunchTheClockStrategyExchangeProcessor processor : mqttRequestExchangeProcessorMap.values()) {
|
||||
if(processor.accept(sn)){
|
||||
return processor.exchangeFace(userId, sn, date, button, rules, photo);
|
||||
}
|
||||
}
|
||||
return initMessage(1,"打卡失败");
|
||||
|
||||
/***
|
||||
* PS: 注解为原代码逻辑
|
||||
* //解析收到的数据
|
||||
* JSONObject jsonObject = JSONObject.parseObject(json);
|
||||
* String userId = jsonObject.getString("user_id");
|
||||
* String sn = jsonObject.getString("sn");
|
||||
* SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
* SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
* Date date = null; //打卡时间
|
||||
* try{
|
||||
* date = sdf.parse(jsonObject.getString("recog_time"));
|
||||
* }catch (Exception e){
|
||||
* e.printStackTrace();
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* String rules = ""; //打卡规则
|
||||
* String button = jsonObject.getString("button");
|
||||
* switch (button){
|
||||
* case "1":
|
||||
* rules = "上班卡(单班制)";
|
||||
* break;
|
||||
* case "2":
|
||||
* rules = "上班卡(双班制)";
|
||||
* break;
|
||||
* case "3":
|
||||
* rules = "上班卡(三班制)";
|
||||
* break;
|
||||
* case "4":
|
||||
* rules = "加班卡";
|
||||
* break;
|
||||
* case "5":
|
||||
* rules = "下班卡";
|
||||
* break;
|
||||
* default:
|
||||
* rules = "撤销";
|
||||
* break;
|
||||
* }
|
||||
*
|
||||
* //判断是打特殊加班卡
|
||||
* if(com.evo.equipment.constant.Constants.EQ_DEVICE_OVER_TIME_CODE.equals(sn)){
|
||||
* RzSpecialAttendance rzSpecialAttendance = null;
|
||||
* SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));
|
||||
* if("1".equals(button) || "2".equals(button) || "3".equals(button) || "6".equals(button)){
|
||||
* return "{\"Result\":1,\"Msg\":\"无效打卡\"}";
|
||||
* }
|
||||
* if("4".equals(button)){
|
||||
* rzSpecialAttendance = new RzSpecialAttendance();
|
||||
* rzSpecialAttendance.setAttendanceDate(new Date());
|
||||
* rzSpecialAttendance.setStaffId(Long.valueOf(userId));
|
||||
* rzSpecialAttendance.setName(sysStaff.getName());
|
||||
* rzSpecialAttendance.setWorkStartTime(date);
|
||||
* rzSpecialAttendance.setDeptId(sysStaff.getDeptId());
|
||||
* rzSpecialAttendance.setDelFlag("0");
|
||||
* rzSpecialAttendance.setCreateBy("admin");
|
||||
* rzSpecialAttendance.setCreateTime(new Date());
|
||||
* rzSpecialAttendanceMapper.insertRzSpecialAttendance(rzSpecialAttendance);
|
||||
*
|
||||
* RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeByUserIdAndDate(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
* if(StringUtils.isNull(rzSpecialOverTime)){
|
||||
* rzSpecialOverTime = new RzSpecialOverTime();
|
||||
* rzSpecialOverTime.setUserId(Long.valueOf(userId));
|
||||
* rzSpecialOverTime.setName(sysStaff.getName());
|
||||
* rzSpecialOverTime.setDeptId(sysStaff.getDeptId());
|
||||
* rzSpecialOverTime.setDelFlag("0");
|
||||
* rzSpecialOverTime.setOverDate(date);
|
||||
* rzSpecialOverTime.setCreateTime(new Date());
|
||||
* rzSpecialOverTime.setCreateBy("admin");
|
||||
* rzSpecialOverTimeMapper.insertRzSpecialOverTime(rzSpecialOverTime);
|
||||
* }
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
* }else {
|
||||
* rzSpecialAttendance = rzSpecialAttendanceMapper.selectRzSpecialAttendanceByuserIdAndDate(Long.valueOf(userId),new Date());
|
||||
* rzSpecialAttendance.setWorkEndTime(date);
|
||||
* SpecialOverTime specialOverTime = bsOverTimeMapper.selectSpecialOverTimeById();
|
||||
* try{
|
||||
* Date overDate_s = sdf.parse(sdfd.format(rzSpecialAttendance.getWorkStartTime())+" "+specialOverTime.getWorkStart());
|
||||
* Date overDate_e = sdf.parse(sdfd.format(date)+" "+specialOverTime.getWorkEnd());
|
||||
*
|
||||
* Long minutes = 0l;
|
||||
* if(overDate_s.after(rzSpecialAttendance.getWorkStartTime()) && overDate_e.before(date)){
|
||||
* minutes = (overDate_e.getTime() - overDate_s.getTime())/1000/60;
|
||||
* }else {
|
||||
* if(overDate_s.before(rzSpecialAttendance.getWorkStartTime()) && overDate_e.after(date)){
|
||||
* minutes = (date.getTime() - rzSpecialAttendance.getWorkStartTime().getTime())/1000/60;
|
||||
* }else{
|
||||
* if(overDate_e.after(date)){
|
||||
* minutes = (date.getTime() - overDate_s.getTime())/1000/60;
|
||||
* }else {
|
||||
* minutes = (overDate_e.getTime() - rzSpecialAttendance.getWorkStartTime().getTime())/1000/60;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* if(minutes >= 180){
|
||||
* rzSpecialAttendance.setWorkHours(new BigDecimal(3));
|
||||
* }else if(minutes >= 120){
|
||||
* rzSpecialAttendance.setWorkHours(new BigDecimal(2));
|
||||
* }
|
||||
* rzSpecialAttendanceMapper.updateRzSpecialAttendance(rzSpecialAttendance);
|
||||
*
|
||||
* RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeByUserIdAndDate(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
* rzSpecialOverTime.setSickHours(rzSpecialOverTime.getSickHours().add(rzSpecialAttendance.getWorkHours()));
|
||||
* rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
*
|
||||
* RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
* if(StringUtils.isNull(rzAttendanceStatistical.getOverTimeHours())){
|
||||
* rzAttendanceStatistical.setOverTimeHours(new BigDecimal(0.0));
|
||||
* }
|
||||
* rzAttendanceStatistical.setOverTimeHours(rzAttendanceStatistical.getOverTimeHours().add(rzSpecialAttendance.getWorkHours()));
|
||||
* rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
* }catch (Exception e){
|
||||
* e.printStackTrace();
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* //根据ID查询员工信息 ,判断员工是否存在,不存在返回失败
|
||||
* SysStaff sysStaff = sysStaffMapper.selectSysStaffByUserId(Long.valueOf(userId));//打卡记录信息
|
||||
* if(sysStaff == null){
|
||||
* return "{\"Result\":1,\"Msg\":\"验证失败,未设置考勤权限\"}";
|
||||
* }
|
||||
* //获取员工的工作时长
|
||||
* EqImages eqImages = eqImagesMapper.selectEqImagesByStaffId(Long.valueOf(userId));
|
||||
* //打卡明细
|
||||
* RzAttendanceDetail attendanceDetail = new RzAttendanceDetail();
|
||||
* //打卡明细表中插入数据
|
||||
* attendanceDetail.setButtonType(rules);
|
||||
* attendanceDetail.setName(sysStaff.getName());
|
||||
* attendanceDetail.setDateTime(date);
|
||||
* attendanceDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
* attendanceDetail.setStaffId(Long.valueOf(userId));
|
||||
* attendanceDetail.setEquipmentCode(sn);
|
||||
* attendanceDetail.setCreateTime(new Date());
|
||||
* int i = rzAttendanceDetailMapper.insertRzAttendanceDetail(attendanceDetail);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* //考勤加班统计
|
||||
* RzOverTime rzOverTime = null;
|
||||
* RzOverTimeDetail rzOverTimeDetail = null;
|
||||
*
|
||||
* //打的是加班卡,加班列表中填写数据
|
||||
* if("4".equals(button)){
|
||||
* //判断打卡月是否统计过加班
|
||||
* rzOverTime = rzOverTimeMapper.selectRzOverTimeByNameAndMonth(Long.valueOf(userId),date);
|
||||
* if(rzOverTime == null){
|
||||
* rzOverTime = new RzOverTime();
|
||||
* rzOverTime.setUserId(Long.valueOf(userId));
|
||||
* rzOverTime.setOverHours(new BigDecimal("0.0"));
|
||||
* rzOverTime.setDeptId(sysStaff.getDeptId());
|
||||
* rzOverTime.setName(sysStaff.getName());
|
||||
* rzOverTime.setOverTimeMonth(date);
|
||||
* rzOverTime.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
* rzOverTime.setCreateBy("admin");
|
||||
* rzOverTime.setCreateTime(DateUtils.getNowDate());
|
||||
* i = rzOverTimeMapper.insertRzOverTime(rzOverTime);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* }
|
||||
* rzOverTimeDetail = new RzOverTimeDetail();
|
||||
* rzOverTimeDetail.setOverTimeId(rzOverTime.getId());
|
||||
* rzOverTimeDetail.setOverTimeStart(date);
|
||||
* rzOverTimeDetail.setName(sysStaff.getName());
|
||||
* rzOverTimeDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
* rzOverTimeDetail.setCreateBy("admin");
|
||||
* rzOverTimeDetail.setCreateTime(DateUtils.getNowDate());
|
||||
* i = rzOverTimeDetailMapper.insertRzOverTimeDetail(rzOverTimeDetail);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
* }
|
||||
*
|
||||
* //员工考勤记录
|
||||
* RzAttendance attendance = rzAttendanceMapper.queryNowDayAttendanceByStatisticalIdAndDate(Long.valueOf(userId),date);
|
||||
* //判断是撤销卡
|
||||
* if("6".equals(button)){
|
||||
* attendance.setRules("");
|
||||
* i = rzAttendanceMapper.updateRzAttendance(attendance);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
* }
|
||||
*
|
||||
* //判断是上班卡
|
||||
* if("1".equals(button) || "2".equals(button) || "3".equals(button)){
|
||||
* if(StringUtils.isNotNull(attendance.getWorkStartTime())){
|
||||
* attendance.setRules(rules);
|
||||
* }else{
|
||||
* attendance.setRules(rules);
|
||||
* attendance.setWorkStartTime(date);
|
||||
* }
|
||||
* try{
|
||||
* //判断三种上班卡
|
||||
* Date db_pre = sdf.parse(sdfd.format(date) + " 08:30:00");
|
||||
* Date sb_pre = sdf.parse(sdfd.format(date) + " 17:00:00");
|
||||
* Date sbz_pre = sdf.parse(sdfd.format(date) + " 20:30:00");
|
||||
* if("上班卡(单班制)".equals(rules) && date.after(db_pre)
|
||||
* || ("上班卡(双班制)".equals(rules) && ((date.after(db_pre) && date.getHours() < 12) || (date.after(sb_pre) && date.getHours() <21)))
|
||||
* || ("上班卡(三班制)".equals(rules) && ((date.after(db_pre) && date.getHours() < 12) || (date.after(sbz_pre) && date.getHours() < 24)))){
|
||||
* attendance.setYcsFlag("1");
|
||||
* }
|
||||
* }catch (Exception e){
|
||||
* e.printStackTrace();
|
||||
* }
|
||||
* i = rzAttendanceMapper.updateRzAttendance(attendance);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
* }
|
||||
*
|
||||
* // 查询员工的最后一次上班打卡信息
|
||||
* RzAttendanceDetail rzAttendanceDetail = rzAttendanceDetailMapper.selectRzAttendanceDetailByStaffId(Long.valueOf(userId));
|
||||
*
|
||||
* //下班卡
|
||||
* //最后一次打卡为加班卡 跨月加班按上个月加班计算
|
||||
* if("加班卡".equals(rzAttendanceDetail.getButtonType())){
|
||||
* //修改加班打卡记录 根据员工ID和时间查找 统计数据
|
||||
* rzOverTime = rzOverTimeMapper.selectRzOverTimeByNameAndMonth(Long.valueOf(userId),rzAttendanceDetail.getDateTime());
|
||||
* //查找加班详情 加班统计ID和加班开始时间
|
||||
* rzOverTimeDetail = rzOverTimeDetailMapper.queryRzOverTimeDetailByDateAndOverId(rzOverTime.getId(),rzAttendanceDetail.getDateTime());
|
||||
* rzOverTimeDetail.setOverTimeEnd(date);
|
||||
* //计算加班时长 小时
|
||||
* double hours = (rzOverTimeDetail.getOverTimeEnd().getTime() - rzOverTimeDetail.getOverTimeStart().getTime())/1000/60/60;
|
||||
* if(hours > 4){
|
||||
* rzOverTimeDetail.setOverTimeHours(BigDecimal.valueOf(4));
|
||||
* }else{
|
||||
* rzOverTimeDetail.setOverTimeHours(BigDecimal.valueOf(hours));
|
||||
* }
|
||||
*
|
||||
* i = rzOverTimeDetailMapper.updateRzOverTimeDetail(rzOverTimeDetail);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* //加班修改统计
|
||||
* rzOverTime.setOverHours(rzOverTime.getOverHours().add(rzOverTimeDetail.getOverTimeHours()));
|
||||
* i = rzOverTimeMapper.updateRzOverTime(rzOverTime);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* //反写考勤汇总
|
||||
* RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(Long.valueOf(userId),rzOverTime.getOverTimeMonth());
|
||||
* rzAttendanceStatistical.setWorkOvertimeNumber(rzOverTime.getOverHours());
|
||||
* i = rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
* if(i < 1){
|
||||
* return"{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
* }
|
||||
*
|
||||
* BigDecimal res = new BigDecimal("0.0"); //记录工时
|
||||
* //计算工时
|
||||
* Long hours = (date.getTime() - rzAttendanceDetail.getDateTime().getTime())/1000/60/60;
|
||||
* //判断不是当天的下班卡
|
||||
* if(StringUtils.isNull(attendance.getWorkStartTime())){
|
||||
* //最后一次上班卡打卡时间
|
||||
* attendance = rzAttendanceMapper.selectLastRzAttendanceByStaffId(Long.valueOf(userId));
|
||||
* //判断是单班,双班,还是三班
|
||||
* if("上班卡(三班制)".equals(attendance.getRules())){
|
||||
* if(hours >= eqImages.getHours().longValue() -1){
|
||||
* res = eqImages.getHours();
|
||||
* }else if(hours >= 5){
|
||||
* res = new BigDecimal(6);
|
||||
* }
|
||||
* //判断打卡时间, 添加夜班次数 打卡时间在晚上7点以后
|
||||
* if(hours > 8 && attendance.getWorkStartTime().getHours() > 18){
|
||||
* attendance.setNightNumber(1);
|
||||
* }
|
||||
* }else if("上班卡(双班制)".equals(attendance.getRules())){
|
||||
* if(hours >= 7.5){
|
||||
* res = new BigDecimal("8");
|
||||
* }else if(hours >= 3.5){
|
||||
* res = new BigDecimal(4);
|
||||
* }
|
||||
* //判断打卡时间, 添加中班次数 打卡时间在下午3点以后
|
||||
* if(hours > 6.5 && attendance.getWorkStartTime().getHours() > 15){
|
||||
* attendance.setMiddleShiftNumber(1);
|
||||
* }
|
||||
* }else{
|
||||
* if(hours >= 8){
|
||||
* res = new BigDecimal("8");
|
||||
* }else if(hours >= 3){
|
||||
* res = new BigDecimal(4);
|
||||
* }
|
||||
* }
|
||||
* }else{
|
||||
* try{
|
||||
* if("上班卡(单班制)".equals(rzAttendanceDetail.getButtonType())){
|
||||
* if(attendance.getWorkStartTime().getTime() - sdf.parse(sdfd.format(date) + " 08:30:00").getTime() > 1000*60*+60
|
||||
* || sdf.parse(sdfd.format(date) + " 17:30:00").getTime() - date.getTime() > 1000*60*+60){
|
||||
* if(hours >= 3){
|
||||
* res = new BigDecimal("4");
|
||||
* }
|
||||
* }else{
|
||||
* if(hours >= 8){
|
||||
* res = new BigDecimal("8.0");
|
||||
* }else if(hours >= 4){
|
||||
* res = new BigDecimal(4);
|
||||
* }
|
||||
* }
|
||||
* }else if("上班卡(双班制)".equals(rzAttendanceDetail.getButtonType())){
|
||||
* if(attendance.getWorkStartTime().getTime() - sdf.parse(sdfd.format(date) + " 08:30:00").getTime() > 1000*60*+60
|
||||
* || sdf.parse(sdfd.format(date) + " 17:30:00").getTime() - date.getTime() > 1000*60*+60){
|
||||
* if(hours >= 4){
|
||||
* res = new BigDecimal("4");
|
||||
* }
|
||||
* }else{
|
||||
* if(hours >= 8){
|
||||
* res = new BigDecimal("8.0");
|
||||
* }else if(hours >= 4){
|
||||
* res = new BigDecimal(4);
|
||||
* }
|
||||
* }
|
||||
* }else if("上班卡(三班制)".equals(rzAttendanceDetail.getButtonType())){
|
||||
* if(attendance.getWorkStartTime().getTime() - sdf.parse(sdfd.format(date) + " 08:30:00").getTime() > 1000*60*+60
|
||||
* || sdf.parse(sdfd.format(date) + " 20:30:00").getTime() - date.getTime() > 1000*60*+60){
|
||||
* if(hours >= 5){
|
||||
* res = new BigDecimal("6");
|
||||
* }
|
||||
* }else{
|
||||
* if(hours >= eqImages.getHours().longValue()-1){
|
||||
* res = eqImages.getHours();
|
||||
* }else if(hours >= 5){
|
||||
* res = new BigDecimal(6);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }catch (Exception e){
|
||||
*
|
||||
* }
|
||||
* }
|
||||
* try{
|
||||
* //下班卡异常
|
||||
* Date db_pre = sdf.parse(sdfd.format(date) + " 08:30:00");
|
||||
* Date sb_pre = sdf.parse(sdfd.format(date) + " 17:00:00");
|
||||
* Date db_pre_2 = sdf.parse(sdfd.format(date) + " 17:30:00");
|
||||
* Date sbz_pre = sdf.parse(sdfd.format(date) + " 20:30:00");
|
||||
* Date sbz_pre_2 = sdf.parse(sdfd.format(date) + " 01:30:00");
|
||||
* if(("上班卡(单班制)".equals(rzAttendanceDetail.getButtonType()) && date.before(db_pre_2))
|
||||
* || ("上班卡(双班制)".equals(rzAttendanceDetail.getButtonType())
|
||||
* && ((date.before(sb_pre) && date.after(db_pre)) || ((date.before(sbz_pre_2)) && date.after(sb_pre))))
|
||||
* || ("上班卡(三班制)".equals(rzAttendanceDetail.getButtonType()) && ((date.before(sbz_pre) && date.getHours() > 14) || date.before(db_pre)))){
|
||||
* attendance.setYcxFlag("1");
|
||||
* }
|
||||
* }catch (Exception e){
|
||||
* e.printStackTrace();
|
||||
* }
|
||||
* //修改打卡记录
|
||||
* attendance.setWorkEndTime(date);
|
||||
* attendance.setWorkSum(res);
|
||||
* i = rzAttendanceMapper.updateRzAttendance(attendance);
|
||||
* if(i < 1){
|
||||
* return "{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* //反写考勤汇总
|
||||
* RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(Long.valueOf(userId),attendance.getAttendanceDate());
|
||||
* rzAttendanceStatistical.setRealAttendance(rzAttendanceStatistical.getRealAttendance().add(attendance.getWorkSum()));
|
||||
* i = rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
* if(i < 1){
|
||||
* return"{\"Result\":1,\"Msg\":\"打卡失败\"}";
|
||||
* }
|
||||
* return "{\"Result\":0,\"Msg\":\"打卡成功\"}";
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,193 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import com.evo.attendance.domain.RzAbnormal;
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.attendance.mapper.RzAbnormalDetailMapper;
|
||||
import com.evo.attendance.mapper.RzAbnormalMapper;
|
||||
import com.evo.attendance.mapper.RzAttendanceMapper;
|
||||
import com.evo.attendance.mapper.RzAttendanceStatisticalMapper;
|
||||
import com.evo.attendance.service.IRzAbnormalDetailService;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.personnelMatters.domain.RzLeaveDetail;
|
||||
import com.evo.personnelMatters.mapper.RzLeaveDetailMapper;
|
||||
import com.evo.utils.DateUtil;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Year;
|
||||
import java.time.YearMonth;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
/**
|
||||
* 考勤异常详情Service业务层处理
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
@Service
|
||||
public class RzAbnormalDetailServiceImpl implements IRzAbnormalDetailService
|
||||
{
|
||||
@Resource
|
||||
private RzAbnormalDetailMapper rzAbnormalDetailMapper;
|
||||
@Resource
|
||||
private RzAttendanceMapper rzAttendanceMapper; //考勤信息
|
||||
@Resource
|
||||
private RzAbnormalMapper rzAbnormalMapper; //异常汇总
|
||||
@Resource
|
||||
private RzAttendanceStatisticalMapper rzAttendanceStatisticalMapper; //考勤统计
|
||||
@Resource
|
||||
private RzLeaveDetailMapper rzLeaveDetailMapper;
|
||||
/**
|
||||
* 查询考勤异常详情
|
||||
*
|
||||
* @param id 考勤异常详情主键
|
||||
* @return 考勤异常详情
|
||||
*/
|
||||
@Override
|
||||
public RzAbnormalDetail selectRzAbnormalDetailById(Long id)
|
||||
{
|
||||
return rzAbnormalDetailMapper.selectRzAbnormalDetailById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤异常详情列表
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 考勤异常详情
|
||||
*/
|
||||
@Override
|
||||
public List<RzAbnormalDetail> selectRzAbnormalDetailList(RzAbnormalDetail rzAbnormalDetail)
|
||||
{
|
||||
return rzAbnormalDetailMapper.selectRzAbnormalDetailList(rzAbnormalDetail);
|
||||
}
|
||||
/**
|
||||
* 新增考勤异常详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public void insertRzAbnormalDetail(){
|
||||
//获取所有人的考勤信息
|
||||
List<RzAttendance> res_list = rzAttendanceMapper.currentDateAllAttendance();
|
||||
try{
|
||||
Date checkDate = res_list.get(0).getAttendanceDate();
|
||||
//检查是否为假期
|
||||
Boolean isHoliday = ParamUtils.checkHoliday(checkDate);
|
||||
for (RzAttendance rzAttendance : res_list) {
|
||||
//判断是否为假期
|
||||
if(isHoliday){
|
||||
//如果是假期, 有打卡, 标识为加班, 没有打卡标识为公休
|
||||
//判断未打卡, 做加班还是公休备注
|
||||
rzAttendance.setRemarks((rzAttendance.getWorkStartTime() == null ? "公休": "加班"));
|
||||
rzAttendanceMapper.updateRzAttendance(rzAttendance);
|
||||
continue;
|
||||
}
|
||||
//检查是否请假
|
||||
RzLeaveDetail rzLeaveDetail = rzLeaveDetailMapper.selectRzLeaveDetailByUserIdAndDate(rzAttendance.getStaffId(), checkDate);
|
||||
if(ObjectUtils.isNotEmpty(rzLeaveDetail)){
|
||||
//如果不为空, 则证明存在请假情况 记录请假类型,
|
||||
rzAttendance.setHolidayType(rzLeaveDetail.getType());
|
||||
rzAttendance.setRemarks("请假");
|
||||
rzAttendanceMapper.updateRzAttendance(rzAttendance);
|
||||
continue;
|
||||
}
|
||||
//判断有没有异常打卡
|
||||
if(anomalyCheckIn(rzAttendance)){
|
||||
//判断员工当月是否存在异常情况
|
||||
RzAbnormal rzAbnormal = rzAbnormalMapper.selectRzAbnormalByUserId(rzAttendance.getStaffId(),new Date());
|
||||
//不存在的话, 创建新的
|
||||
if(StringUtils.isNull(rzAbnormal)){
|
||||
rzAbnormal = new RzAbnormal();
|
||||
rzAbnormal.setDeptId(rzAttendance.getDeptId());
|
||||
rzAbnormal.setUserId(rzAttendance.getStaffId());
|
||||
rzAbnormal.setName(rzAttendance.getName());
|
||||
rzAbnormal.setNumber(0l);
|
||||
rzAbnormal.setMoney(BigDecimal.valueOf(0));
|
||||
rzAbnormal.setMonth(new Date());
|
||||
rzAbnormal.setDelFlag("0");
|
||||
rzAbnormalMapper.insertRzAbnormal(rzAbnormal);
|
||||
}
|
||||
rzAbnormalDetailMapper.insertRzAbnormalDetail(getRzAbnormalDetail(rzAttendance, rzAbnormal));
|
||||
//反写汇总
|
||||
rzAbnormal.setNumber(rzAbnormal.getNumber() + 1);
|
||||
rzAbnormalMapper.updateRzAbnormal(rzAbnormal);
|
||||
//反写统计
|
||||
RzAttendanceStatistical attendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(rzAttendance.getStaffId(),rzAttendance.getAttendanceDate());
|
||||
attendanceStatistical.setLateNumber(attendanceStatistical.getLateNumber() + 1);
|
||||
rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(attendanceStatistical);
|
||||
}
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private RzAbnormalDetail getRzAbnormalDetail(RzAttendance rzAttendance, RzAbnormal rzAbnormal) {
|
||||
RzAbnormalDetail rzAbnormalDetail = new RzAbnormalDetail();
|
||||
rzAbnormalDetail.setAbnormalId(rzAbnormal.getId());
|
||||
rzAbnormalDetail.setName(rzAttendance.getName());
|
||||
rzAbnormalDetail.setClockDate(rzAttendance.getAttendanceDate());
|
||||
if("1".equals(rzAttendance.getYcxFlag())){
|
||||
rzAbnormalDetail.setAbnormalTime(rzAttendance.getWorkEndTime());
|
||||
rzAbnormalDetail.setClockType("下班卡");
|
||||
}else if("1".equals(rzAttendance.getYcsFlag())){
|
||||
rzAbnormalDetail.setAbnormalTime(rzAttendance.getWorkStartTime());
|
||||
rzAbnormalDetail.setClockType("上班卡");
|
||||
}else if(rzAttendance.getWorkStartTime() == null){
|
||||
rzAbnormalDetail.setClockType("未打卡");
|
||||
}else{
|
||||
rzAbnormalDetail.setClockType("未打下班卡");
|
||||
}
|
||||
rzAbnormalDetail.setDelFlag("0");
|
||||
return rzAbnormalDetail;
|
||||
}
|
||||
|
||||
public Boolean anomalyCheckIn(RzAttendance rzAttendance){
|
||||
// 上班异常 || 下班异常 || 上班没打卡 || 下班没打卡
|
||||
return ("1".equals(rzAttendance.getYcsFlag()) || "1".equals(rzAttendance.getYcxFlag()) || rzAttendance.getWorkStartTime() == null || rzAttendance.getWorkEndTime() == null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改考勤异常详情
|
||||
*
|
||||
* @param rzAbnormalDetail 考勤异常详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzAbnormalDetail(RzAbnormalDetail rzAbnormalDetail)
|
||||
{
|
||||
rzAbnormalDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
rzAbnormalDetail.setUpdateBy(SecurityUtils.getUsername());
|
||||
return rzAbnormalDetailMapper.updateRzAbnormalDetail(rzAbnormalDetail);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除考勤异常详情信息
|
||||
*
|
||||
* @param id 考勤异常详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzAbnormalDetailById(Long id)
|
||||
{
|
||||
RzAbnormalDetail rzAbnormalDetail = rzAbnormalDetailMapper.selectRzAbnormalDetailById(id);
|
||||
rzAbnormalDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
rzAbnormalDetail.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzAbnormalDetail.setDelFlag("1");
|
||||
return rzAbnormalDetailMapper.updateRzAbnormalDetail(rzAbnormalDetail);
|
||||
}
|
||||
}
|
||||
@ -1,105 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzAbnormalDetail;
|
||||
import com.evo.attendance.mapper.RzAbnormalDetailMapper;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.evo.attendance.mapper.RzAbnormalMapper;
|
||||
import com.evo.attendance.domain.RzAbnormal;
|
||||
import com.evo.attendance.service.IRzAbnormalService;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 考勤异常Service业务层处理
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
@Service
|
||||
public class RzAbnormalServiceImpl implements IRzAbnormalService
|
||||
{
|
||||
@Resource
|
||||
private RzAbnormalMapper rzAbnormalMapper;
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper; //部门
|
||||
@Resource
|
||||
private RzAbnormalDetailMapper rzAbnormalDetailMapper; //异常详情
|
||||
|
||||
/**
|
||||
* 查询考勤异常
|
||||
*
|
||||
* @param id 考勤异常主键
|
||||
* @return 考勤异常
|
||||
*/
|
||||
@Override
|
||||
public RzAbnormal selectRzAbnormalById(Long id)
|
||||
{
|
||||
return rzAbnormalMapper.selectRzAbnormalById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤异常列表
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 考勤异常
|
||||
*/
|
||||
@Override
|
||||
public List<RzAbnormal> selectRzAbnormalList(RzAbnormal rzAbnormal)
|
||||
{
|
||||
List<RzAbnormal> res = rzAbnormalMapper.selectRzAbnormalList(rzAbnormal);
|
||||
for (RzAbnormal re : res) {
|
||||
re.setDeptName(deptMapper.selectDeptById(re.getDeptId()).getDeptName());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤异常
|
||||
*
|
||||
* @param rzAbnormal 考勤异常
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzAbnormal(RzAbnormal rzAbnormal)
|
||||
{
|
||||
rzAbnormal.setUpdateTime(DateUtils.getNowDate());
|
||||
rzAbnormal.setUpdateBy(SecurityUtils.getUsername());
|
||||
return rzAbnormalMapper.updateRzAbnormal(rzAbnormal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除考勤异常信息
|
||||
*
|
||||
* @param id 考勤异常主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzAbnormalById(Long id)
|
||||
{
|
||||
RzAbnormal rzAbnormal = rzAbnormalMapper.selectRzAbnormalById(id);
|
||||
rzAbnormal.setUpdateTime(DateUtils.getNowDate());
|
||||
rzAbnormal.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzAbnormal.setDelFlag("1");
|
||||
return rzAbnormalMapper.updateRzAbnormal(rzAbnormal);
|
||||
}
|
||||
|
||||
/**
|
||||
* 异常详情
|
||||
* @param rzAbnormal
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<RzAbnormalDetail> listAbnormalDetails(RzAbnormal rzAbnormal){
|
||||
List<RzAbnormalDetail> res_list = new ArrayList<RzAbnormalDetail>();
|
||||
RzAbnormal abnormal = rzAbnormalMapper.selectRzAbnormalByUserId(rzAbnormal.getUserId(),rzAbnormal.getMonth());
|
||||
if(abnormal == null){
|
||||
return res_list;
|
||||
}
|
||||
res_list = rzAbnormalDetailMapper.selectRzAbnormalDetailByAbnormalId(abnormal.getId());
|
||||
return res_list;
|
||||
}
|
||||
}
|
||||
@ -1,225 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailTimeLineVO;
|
||||
import com.evo.attendance.mapper.RzAttendanceDetailMapper;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.ParamUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.personnelMatters.domain.RzLeaveDetail;
|
||||
import com.evo.personnelMatters.mapper.RzLeaveDetailMapper;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.mapper.SysStaffMapper;
|
||||
import com.evo.wechat.service.SendClientService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:RzAttendanceDetailServiceimpl
|
||||
* @date: 2025年07月07日 13:33
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class RzAttendanceDetailServiceImpl extends ServiceImpl<RzAttendanceDetailMapper, RzAttendanceDetail> implements RzAttendanceDetailService {
|
||||
@Autowired
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
@Resource
|
||||
private SendClientService sendClientService;
|
||||
@Autowired
|
||||
RzLeaveDetailMapper rzLeaveDetailMapper;
|
||||
@Autowired
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
|
||||
@Override
|
||||
public RzAttendanceDetail addDetail(RzAttendance attendance, String rules, String sn, Date date, String remark, String photo) {
|
||||
return addOrUpdateDetail("clock_in", attendance,rules,sn,date,remark, photo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzAttendanceDetail addOrUpdateDetail(String source, RzAttendance attendance, String rules, String sn, Date date, String remark, String photo) {
|
||||
RzAttendanceDetail attendanceDetail = null;
|
||||
//clock_in为考勤机打卡, 不需要查询
|
||||
if(!"clock_in".equals(source)){
|
||||
//获取员工的工作时长
|
||||
attendanceDetail = getOne(new LambdaQueryWrapper<RzAttendanceDetail>()
|
||||
.eq(RzAttendanceDetail::getButtonType, rules)
|
||||
.eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
.eq(RzAttendanceDetail::getStaffId, attendance.getStaffId())
|
||||
.eq(RzAttendanceDetail::getAttendanceId, attendance.getId())
|
||||
//.apply( " DATE_FORMAT(date_time,'%Y%m%d') = DATE_FORMAT({0},'%Y%m%d')", date)
|
||||
//以下为特殊规则, 只针对下班卡起作用
|
||||
.orderByAsc("下班卡".equals(rules), RzAttendanceDetail::getDateTime)
|
||||
.last("下班卡".equals(rules)," limit 1 ")
|
||||
);
|
||||
}
|
||||
|
||||
if(ObjectUtils.isEmpty(attendanceDetail)){
|
||||
attendanceDetail = new RzAttendanceDetail();
|
||||
attendanceDetail.setStaffId(attendance.getStaffId());
|
||||
attendanceDetail.setName(attendance.getName());
|
||||
attendanceDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
}
|
||||
|
||||
//打卡明细表中插入数据
|
||||
attendanceDetail.setButtonType(rules);
|
||||
attendanceDetail.setAttendanceId(attendance.getId());
|
||||
attendanceDetail.setDateTime(date);
|
||||
attendanceDetail.setEquipmentCode(sn);
|
||||
attendanceDetail.setCreateTime(new Date());
|
||||
attendanceDetail.setRemark(remark);
|
||||
if(StringUtils.isNotEmpty(photo)){
|
||||
attendanceDetail.setPhoto(photo);
|
||||
}
|
||||
if(attendanceDetail.getId() == null){
|
||||
save(attendanceDetail);
|
||||
}else{
|
||||
updateById(attendanceDetail);
|
||||
}
|
||||
return attendanceDetail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzAttendanceDetail selectLastRzAttendanceDetail(Long staffId) {
|
||||
return getBaseMapper().selectLastRzAttendanceDetail(staffId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzAttendanceDetail selectRzAttendanceDetailByStaffId(Long staffId) {
|
||||
return getBaseMapper().selectRzAttendanceDetailByStaffId(staffId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzAttendanceDetail selectLastWorkCardByStaffId(Long staffId) {
|
||||
return getBaseMapper().selectLastWorkCardByStaffId(staffId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RzAttendanceDetailTimeLineVO> selectListByAttendanceId(Long attId) {
|
||||
return list(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getAttendanceId, attId)).stream().map(data ->{
|
||||
return new RzAttendanceDetailTimeLineVO(data.getButtonType(), data.getPhoto(), DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",data.getDateTime()), data.getDelFlag());
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
@Override
|
||||
public void sendAttendanceDetail() throws ParseException {
|
||||
//查询所有上次打开时间距今天超过3天的员工信息
|
||||
List<Map<String, Object>> threeDayNotCheckList = super.getBaseMapper().getThreeDayNotCheck();
|
||||
if(Collections.isNotEmpty(threeDayNotCheckList)){
|
||||
for (Map<String, Object> threeDayNotCheck : threeDayNotCheckList){
|
||||
//用户Id
|
||||
Integer userId = Integer.valueOf(String.valueOf(threeDayNotCheck.get("userId")));
|
||||
//最后打卡时间
|
||||
System.out.println(threeDayNotCheck.get("lastDate"));
|
||||
Date lastDateTme = DateUtils.parseDate(String.valueOf(threeDayNotCheck.get("lastDate")), "yyyy-MM-dd");
|
||||
//首先获取最后打卡时间到今天的所有天数
|
||||
List<String> holidayDates = Collections.emptyList();
|
||||
//记录所有时间的年, 防止有跨年的情况
|
||||
List<String> yearList = Collections.emptyList();
|
||||
Date currentDate = new Date();
|
||||
while (lastDateTme.compareTo(currentDate) <= 0){
|
||||
String date = sdfd.format(lastDateTme);
|
||||
String dateYear = date.substring(0,4);
|
||||
if(!yearList.contains(dateYear)){
|
||||
yearList.add(dateYear);
|
||||
}
|
||||
holidayDates.add(date);
|
||||
lastDateTme = DateUtils.addDays(lastDateTme,1);
|
||||
}
|
||||
//然后排除公休 排除法休
|
||||
for (String year : yearList){
|
||||
List<String> holidays = Collections.findDuplicatesList(ParamUtils.getHoliddayList(Integer.valueOf(year), 0), holidayDates);
|
||||
if(Collections.isNotEmpty(holidays)){
|
||||
holidayDates.removeAll(holidays);
|
||||
}
|
||||
}
|
||||
|
||||
//剩余时长> 3天, 继续检查请假
|
||||
if(holidayDates.size() > 3){
|
||||
//排除假期
|
||||
List<String> leaveDays = Collections.emptyList();
|
||||
for (String holidayDate : holidayDates){
|
||||
if(!leaveDays.contains(holidayDate)){
|
||||
RzLeaveDetail rzLeaveDetail = rzLeaveDetailMapper.selectRzLeaveDetailByUserIdAndDate(Long.valueOf(userId), DateUtils.parseDate(holidayDate));
|
||||
if(rzLeaveDetail != null &&rzLeaveDetail.getLeaveStartTime() != null && rzLeaveDetail.getLeaveEndTime() != null){
|
||||
Date leaveStartDate = rzLeaveDetail.getLeaveStartTime();
|
||||
while (leaveStartDate.compareTo(rzLeaveDetail.getLeaveEndTime()) <= 0){
|
||||
String date = sdfd.format(leaveStartDate);
|
||||
leaveDays.add(date);
|
||||
leaveStartDate = DateUtils.addDays(leaveStartDate,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String> holidays = Collections.findDuplicatesList(leaveDays, holidayDates);
|
||||
if(Collections.isNotEmpty(holidays)){
|
||||
holidayDates.removeAll(holidays);
|
||||
}
|
||||
//如果假期还是> 3天, 则准备推送
|
||||
if(holidayDates.size() > 3){
|
||||
SysStaff sysStaff = sysStaffMapper.selectById(userId);
|
||||
if(sysStaff != null) {
|
||||
SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
String deptName = sysDept != null ? sysDept.getDeptName() : "未知";
|
||||
String userName = sysStaff.getName();
|
||||
// 查询人资办人员信息
|
||||
List<SysStaff> rzb = sysStaffMapper.queryysStaffByDeptId(Collections.asList(28l));
|
||||
if(Collections.isNotEmpty(rzb)){
|
||||
for (SysStaff rz : rzb){
|
||||
sendAttendanceDetail(userName, deptName, rz.getOpenid());
|
||||
}
|
||||
}
|
||||
//查询部门负责人
|
||||
SysStaff leaderSysStaff = sysStaffMapper.selectLeaderSysStaffByDeptId(sysStaff.getDeptId());
|
||||
if(leaderSysStaff != null){
|
||||
sendAttendanceDetail(userName, deptName, leaderSysStaff.getOpenid());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Async
|
||||
protected void sendAttendanceDetail(String userName, String deptName, String openId){
|
||||
try {
|
||||
if(StringUtils.isNotEmpty(openId)){
|
||||
sendClientService.sendAbnormalAttendance(deptName,userName, "长时间未打卡", new Date(), openId);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送公众号打卡异常失败, 原因为: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,502 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailVO;
|
||||
import com.evo.attendance.mapper.RzAttendanceMapper;
|
||||
import com.evo.attendance.processor.KqUtils;
|
||||
import com.evo.attendance.service.IRzAttendanceService;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.annotation.DataScope;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.equipment.service.IEqImagesService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import com.evo.wechat.service.SendClientService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 考勤记录Service业务层处理
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class RzAttendanceServiceImpl extends ServiceImpl<RzAttendanceMapper, RzAttendance> implements IRzAttendanceService {
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper; //部门
|
||||
@Resource
|
||||
private ISysStaffService sysStaffService;
|
||||
@Resource
|
||||
private IEqImagesService eqImagesService;
|
||||
@Resource
|
||||
private RzAttendanceDetailService rzAttendanceDetailService;
|
||||
@Resource
|
||||
private SendClientService sendClientService;
|
||||
|
||||
private static final String MORNING_CARD_SINGLE = "上班卡(单班制)";
|
||||
private static final String MORNING_CARD_DOUBLE = "上班卡(双班制)";
|
||||
private static final String MORNING_CARD_TRIPLE = "上班卡(三班制)";
|
||||
private static final String NIGHT_CARD = "下班卡";
|
||||
@Autowired
|
||||
private SysDeptMapper sysDeptMapper;
|
||||
|
||||
/**
|
||||
* 查询考勤记录
|
||||
*
|
||||
* @param id 考勤记录主键
|
||||
* @return 考勤记录
|
||||
*/
|
||||
@Override
|
||||
public RzAttendance selectRzAttendanceById(Long id) {
|
||||
return getBaseMapper().selectRzAttendanceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录
|
||||
*/
|
||||
@DataScope(deptAlias = "d")
|
||||
@Override
|
||||
public List<RzAttendance> selectRzAttendanceList(RzAttendance rzAttendance) {
|
||||
List<RzAttendance> res_list = getBaseMapper().selectRzAttendanceList(rzAttendance);
|
||||
for (RzAttendance attendance : res_list) {
|
||||
SysDept sysDept = deptMapper.selectDeptById(attendance.getDeptId());
|
||||
attendance.setDeptName(sysDept.getDeptName());
|
||||
if (attendance.getAttendanceDate().before(new Date())) {
|
||||
if (attendance.getWorkStartTime() == null && attendance.getWorkEndTime() == null) {
|
||||
attendance.setYcsFlag("1");
|
||||
}
|
||||
}
|
||||
}
|
||||
return res_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改考勤记录
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzAttendance(RzAttendance rzAttendance) {
|
||||
//如果下班卡为空, 则补上班卡
|
||||
SysStaff sysUser = sysStaffService.selectSysStaffByUserId(rzAttendance.getStaffId());
|
||||
if(rzAttendance.getWorkEndTime() == null){
|
||||
//跟新成功, 插入上班卡信息
|
||||
if(getBaseMapper().updateRzAttendance(rzAttendance) > 0){
|
||||
rzAttendanceDetailService.addOrUpdateDetail("fill_in", rzAttendance, rzAttendance.getRules(), sysUser.getTimeClockList().get(0), rzAttendance.getWorkStartTime(),rzAttendance.getRemark(), null);
|
||||
}
|
||||
return 1;
|
||||
}else if(rzAttendance.getWorkStartTime() != null && rzAttendance.getWorkEndTime() != null){
|
||||
rzAttendanceDetailService.addOrUpdateDetail("fill_in",rzAttendance, rzAttendance.getRules(), sysUser.getTimeClockList().get(0), rzAttendance.getWorkStartTime(),rzAttendance.getRemark(), null);
|
||||
if(KqUtils.workOffDutyCard(rzAttendance.getWorkEndTime(), rzAttendance.getRules(), rzAttendance)){
|
||||
//此处特殊, 使用rules 记录下班卡规则, 但是不持久化
|
||||
rzAttendanceDetailService.addOrUpdateDetail("fill_in",rzAttendance, "下班卡", sysUser.getTimeClockList().get(0), rzAttendance.getWorkEndTime(),rzAttendance.getRemark(), null);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 每日上班打卡统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int attendenceCount() {
|
||||
List<RzAttendance> list = getBaseMapper().attendenceCount();
|
||||
return list.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改考勤记录
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateBatchAttendance(RzAttendance rzAttendance) {
|
||||
if (StringUtils.isNull(rzAttendance.getAttendanceDate())) {
|
||||
return AjaxResult.error("请选择批量修改的时间!!");
|
||||
}
|
||||
//根据时间查询打卡信息
|
||||
List<RzAttendance> list = getBaseMapper().selectRzAttendanceList(rzAttendance);
|
||||
//获取当天12点的时间和8:30的时间
|
||||
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date mid_date = null;
|
||||
Date pre_date = null;
|
||||
try {
|
||||
String str_pre = sdfd.format(rzAttendance.getAttendanceDate()) + " 08:30:00";
|
||||
pre_date = sdft.parse(str_pre);
|
||||
String str_mid = sdfd.format(rzAttendance.getAttendanceDate()) + " 12:00:00";
|
||||
mid_date = sdft.parse(str_mid);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
//循环判断打卡时间,修改打卡时间
|
||||
for (RzAttendance attendance : list) {
|
||||
//判断上班打卡时间存在,且小于12点并且大于早上8:30
|
||||
if (attendance.getWorkStartTime() != null && attendance.getWorkStartTime().before(mid_date) && attendance.getWorkStartTime().after(pre_date)) {
|
||||
//判断没有打卡下班卡
|
||||
if (attendance.getWorkEndTime() == null) {
|
||||
attendance.setWorkStartTime(pre_date);
|
||||
attendance.setYcsFlag("0");
|
||||
getBaseMapper().updateRzAttendance(attendance);
|
||||
continue;
|
||||
}
|
||||
BigDecimal old = attendance.getWorkSum();
|
||||
//计算上班的时间
|
||||
Long fz = (attendance.getWorkEndTime().getTime() - attendance.getWorkStartTime().getTime()) / 1000 / 60;
|
||||
Double xs = fz / 60.0;
|
||||
BigDecimal res = new BigDecimal("0.0");
|
||||
//单班制
|
||||
if ("上班卡(单班制)".equals(attendance.getRules())) {
|
||||
if (xs > 9) {
|
||||
res = new BigDecimal("8.0");
|
||||
} else if (xs > 4.5) {
|
||||
res = BigDecimal.valueOf(xs - 1);
|
||||
} else if (xs > 1) {
|
||||
res = BigDecimal.valueOf(xs);
|
||||
}
|
||||
} else if ("上班卡(双班制)".equals(attendance.getRules())) {
|
||||
if (xs > 8.5) {
|
||||
res = new BigDecimal("8.0");
|
||||
} else if (xs > 1) {
|
||||
res = BigDecimal.valueOf(xs);
|
||||
}
|
||||
} else {
|
||||
if (xs > 12) {
|
||||
res = new BigDecimal("11.0");
|
||||
} else if (xs <= 1) {
|
||||
res = new BigDecimal("0.0");
|
||||
} else {
|
||||
res = BigDecimal.valueOf(xs - 1);
|
||||
}
|
||||
}
|
||||
attendance.setWorkStartTime(pre_date);
|
||||
attendance.setYcsFlag("0");
|
||||
attendance.setWorkSum(res);
|
||||
int i = getBaseMapper().updateRzAttendance(attendance);
|
||||
if (i < 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> listAttendanceByParams(RzAttendance rzAttendance) {
|
||||
|
||||
return getBaseMapper().listAttendanceByParams(rzAttendance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前导入的 RzAttendanceDetailVO 对象中的补卡类型:
|
||||
* 如果是上班卡:则需根据补卡时长减去下班时长来计算上班卡的时间。
|
||||
* 如果是下班卡:则需根据补卡时长加上上班时长来计算下班卡的时间
|
||||
* 在确定补卡类型后,需要查找或创建两条对应的打卡记录:
|
||||
* 上班卡(单班制)
|
||||
* 下班卡
|
||||
* <p>
|
||||
* 情况一:补的是上班卡
|
||||
* 逻辑操作:
|
||||
* 使用补卡总时长减去已有的下班时长,得到新的上班时间。
|
||||
* 更新上班卡记录的时间,并添加备注“补卡”。
|
||||
* 确保对应下班卡记录存在,若不存在则新增一条下班卡记录以保证完整性。
|
||||
* <p>
|
||||
* 情况二:补的是下班卡
|
||||
* 逻辑操作:
|
||||
* 使用补卡总时长减去已有的上班时长,得到新的下班时间。
|
||||
* 更新下班卡记录的时间,并添加备注“补卡”。
|
||||
* 确保对应上班卡记录存在,若不存在则新增一条上班卡记录以保证完整性
|
||||
*/
|
||||
|
||||
@Override
|
||||
public AjaxResult importAttendance(List<RzAttendanceDetailVO> attendanceList) {
|
||||
if (StringUtils.isEmpty(attendanceList)) {
|
||||
return AjaxResult.error("导入的考勤数据为空");
|
||||
}
|
||||
//查询所有员工的考勤记录
|
||||
int successCount = 0;
|
||||
int failCount = 0;
|
||||
for (RzAttendanceDetailVO vo : attendanceList) {
|
||||
try {
|
||||
if (StringUtils.isEmpty(vo.getEmployeeName())) {
|
||||
log.warn("员工姓名为空,跳过该条记录");
|
||||
failCount++;
|
||||
continue;
|
||||
}
|
||||
SysStaff sysUser = sysStaffService.selectSysStaffByName(vo.getEmployeeName());
|
||||
if (sysUser == null) {
|
||||
log.warn(String.format("未找到员工:{}", vo.getEmployeeName()));
|
||||
failCount++;
|
||||
continue;
|
||||
}
|
||||
String replacementDate = vo.getReplacementTime(); // 补卡日期
|
||||
String reissueTime = vo.getReissueTime(); // 补卡时间
|
||||
String timeClock = eqImagesService.selectEqByName(vo.getEmployeeName()).getTimeClock();
|
||||
|
||||
|
||||
Date result = DateUtils.parseDate(vo.getReplacementTime()+" "+reissueTime);
|
||||
if ("正常".equals(vo.getType())) {
|
||||
RzAttendance attendance = selectRzAttendanceBySfIdAndNameAndTime(sysUser.getUserId(), vo.getEmployeeName(), replacementDate, false);
|
||||
// 构建查询条件
|
||||
LambdaQueryWrapper<RzAttendanceDetail> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RzAttendanceDetail::getStaffId, sysUser.getUserId())
|
||||
.apply(" DATE(create_time) = DATE({0})", replacementDate); // 按天匹配
|
||||
|
||||
if ("下班卡".equals(vo.getReissueType())) {
|
||||
queryWrapper.eq(RzAttendanceDetail::getButtonType, NIGHT_CARD)
|
||||
.orderByDesc(RzAttendanceDetail::getDateTime);
|
||||
} else if (vo.getReissueType() != null && vo.getReissueType().contains("上班卡")) {
|
||||
queryWrapper.in(RzAttendanceDetail::getButtonType, MORNING_CARD_SINGLE, MORNING_CARD_DOUBLE, MORNING_CARD_TRIPLE)
|
||||
.orderByAsc(RzAttendanceDetail::getDateTime);
|
||||
}
|
||||
|
||||
List<RzAttendanceDetail> details = rzAttendanceDetailService.list(queryWrapper);
|
||||
RzAttendanceDetail rzAttendanceDetail;
|
||||
if (!details.isEmpty()){
|
||||
rzAttendanceDetail = details.get(0);
|
||||
}else {
|
||||
rzAttendanceDetail = null;
|
||||
}
|
||||
|
||||
//更新考勤记录表
|
||||
if (vo.getReissueType().contains("上班卡")) {
|
||||
//时间变为补卡日期: 2023-05-05 + 补卡时间 例子: 17:30
|
||||
attendance.setWorkStartTime(result);
|
||||
attendance.setWorkSum(BigDecimal.valueOf(vo.getReissueDuration()));
|
||||
attendance.setRemarks("补卡-上班卡");
|
||||
attendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
attendance.setUpdateTime(new Date());
|
||||
attendance.setYcsFlag(null);
|
||||
//更新考勤记录详情
|
||||
if (rzAttendanceDetail != null) {
|
||||
rzAttendanceDetail.setDateTime(attendance.getWorkStartTime());
|
||||
rzAttendanceDetail.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setUpdateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-上班卡");
|
||||
} else {
|
||||
rzAttendanceDetail = new RzAttendanceDetail();
|
||||
rzAttendanceDetail.setStaffId(sysUser.getUserId());
|
||||
rzAttendanceDetail.setName(vo.getEmployeeName());
|
||||
rzAttendanceDetail.setButtonType(vo.getReissueType());
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
//获取打卡机
|
||||
rzAttendanceDetail.setEquipmentCode(timeClock);
|
||||
rzAttendanceDetail.setCreateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setCreateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-上班卡");
|
||||
rzAttendanceDetail.setDelFlag("0");
|
||||
rzAttendanceDetailService.save(rzAttendanceDetail);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
//补的是下班卡
|
||||
|
||||
attendance.setWorkEndTime(result);
|
||||
attendance.setRemarks("补卡-下班卡");
|
||||
attendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
attendance.setUpdateTime(new Date());
|
||||
attendance.setWorkSum(BigDecimal.valueOf(vo.getReissueDuration()));
|
||||
if (rzAttendanceDetail != null) {
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
rzAttendanceDetail.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setUpdateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-下班卡");
|
||||
} else {
|
||||
rzAttendanceDetail = new RzAttendanceDetail();
|
||||
rzAttendanceDetail.setStaffId(sysUser.getUserId());
|
||||
rzAttendanceDetail.setName(vo.getEmployeeName());
|
||||
rzAttendanceDetail.setButtonType(vo.getReissueType());
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
//获取打卡机
|
||||
rzAttendanceDetail.setEquipmentCode(timeClock);
|
||||
rzAttendanceDetail.setCreateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setCreateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-下班卡");
|
||||
rzAttendanceDetail.setDelFlag("0");
|
||||
rzAttendanceDetailService.save(rzAttendanceDetail);
|
||||
}
|
||||
|
||||
}
|
||||
//写表
|
||||
getBaseMapper().update(attendance, new LambdaUpdateWrapper<RzAttendance>()
|
||||
.eq(RzAttendance::getId, attendance.getId()));
|
||||
rzAttendanceDetailService.update(rzAttendanceDetail, new LambdaUpdateWrapper<RzAttendanceDetail>()
|
||||
.eq(RzAttendanceDetail::getId, rzAttendanceDetail.getId()));
|
||||
//更新考勤记录详情
|
||||
} else {
|
||||
//补的是加班卡
|
||||
RzAttendance attendance = selectRzAttendanceBySfIdAndNameAndTime(sysUser.getUserId(), vo.getEmployeeName(), replacementDate, true);
|
||||
LambdaQueryWrapper<RzAttendanceDetail> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(RzAttendanceDetail::getStaffId, sysUser.getUserId())
|
||||
.apply(" date_format(create_time,'%Y%m%d') = date_format({0},'%Y%m%d')", replacementDate)
|
||||
.in(vo.getReissueType().equals("加班卡"), RzAttendanceDetail::getButtonType, "加班卡")
|
||||
.orderBy(vo.getReissueType().contains("加班卡"), true, RzAttendanceDetail::getDateTime);
|
||||
List<RzAttendanceDetail> details = rzAttendanceDetailService.list(queryWrapper);
|
||||
RzAttendanceDetail rzAttendanceDetail = details.get(0);
|
||||
//更新考勤记录表
|
||||
if (vo.getReissueType().equals("加班卡")) {
|
||||
//减去时间
|
||||
attendance.setWorkStartTime(result);
|
||||
attendance.setRemarks("补卡-加班上班卡");
|
||||
attendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
attendance.setUpdateTime(new Date());
|
||||
attendance.setWorkSum(BigDecimal.valueOf(vo.getReissueDuration()));
|
||||
attendance.setYcsFlag(null);
|
||||
//更新考勤记录详情
|
||||
if (rzAttendanceDetail != null) {
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
rzAttendanceDetail.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setUpdateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-加班上班卡");
|
||||
} else {
|
||||
rzAttendanceDetail = new RzAttendanceDetail();
|
||||
rzAttendanceDetail.setStaffId(sysUser.getUserId());
|
||||
rzAttendanceDetail.setName(vo.getEmployeeName());
|
||||
rzAttendanceDetail.setButtonType(vo.getReissueType());
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
//获取打卡机
|
||||
rzAttendanceDetail.setEquipmentCode(timeClock);
|
||||
rzAttendanceDetail.setCreateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setCreateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-加班上班卡");
|
||||
rzAttendanceDetail.setDelFlag("0");
|
||||
rzAttendanceDetailService.save(rzAttendanceDetail);
|
||||
}
|
||||
|
||||
successCount++;
|
||||
} else {
|
||||
//补的是下班卡
|
||||
attendance.setWorkSum(BigDecimal.valueOf(vo.getReissueDuration()));
|
||||
attendance.setWorkEndTime(result);
|
||||
attendance.setRemarks("补卡-加班下班卡");
|
||||
attendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
attendance.setUpdateTime(new Date());
|
||||
if (rzAttendanceDetail != null) {
|
||||
rzAttendanceDetail = new RzAttendanceDetail();
|
||||
rzAttendanceDetail.setStaffId(sysUser.getUserId());
|
||||
rzAttendanceDetail.setName(vo.getEmployeeName());
|
||||
rzAttendanceDetail.setButtonType(vo.getReissueType());
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
|
||||
}else {
|
||||
rzAttendanceDetail = new RzAttendanceDetail();
|
||||
rzAttendanceDetail.setStaffId(sysUser.getUserId());
|
||||
rzAttendanceDetail.setName(vo.getEmployeeName());
|
||||
rzAttendanceDetail.setButtonType(vo.getReissueType());
|
||||
rzAttendanceDetail.setDateTime(result);
|
||||
//获取打卡机
|
||||
rzAttendanceDetail.setEquipmentCode(timeClock);
|
||||
rzAttendanceDetail.setCreateBy(SecurityUtils.getUsername());
|
||||
rzAttendanceDetail.setCreateTime(new Date());
|
||||
rzAttendanceDetail.setRemark("补卡-加班下班卡");
|
||||
rzAttendanceDetail.setDelFlag("0");
|
||||
rzAttendanceDetailService.save(rzAttendanceDetail);
|
||||
}
|
||||
|
||||
}
|
||||
getBaseMapper().update(attendance, new LambdaUpdateWrapper<RzAttendance>()
|
||||
.eq(RzAttendance::getId, attendance.getId()));
|
||||
rzAttendanceDetailService.update(rzAttendanceDetail, new LambdaUpdateWrapper<RzAttendanceDetail>()
|
||||
.eq(RzAttendanceDetail::getId, rzAttendanceDetail.getId()));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("处理考勤导入记录异常", e);
|
||||
failCount++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (failCount == 0) {
|
||||
return AjaxResult.success("导入成功,共处理 " + successCount + " 条记录");
|
||||
} else {
|
||||
return AjaxResult.warn("部分记录导入失败,成功:" + successCount + " 条,失败:" + failCount + " 条");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public RzAttendance selectRzAttendanceBySfIdAndNameAndTime(Long userId, String employeeName, String replacementTime, Boolean isAttendance) {
|
||||
RzAttendance rzAttendance;
|
||||
if (isAttendance == false) {
|
||||
LambdaQueryWrapper<RzAttendance> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(RzAttendance::getStaffId, userId)
|
||||
.eq(RzAttendance::getName, employeeName)
|
||||
.eq(RzAttendance::getAttendanceDate, replacementTime);
|
||||
rzAttendance = getBaseMapper().selectOne(wrapper);
|
||||
} else {
|
||||
LambdaQueryWrapper<RzAttendance> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(RzAttendance::getStaffId, userId)
|
||||
.eq(RzAttendance::getName, employeeName)
|
||||
.eq(RzAttendance::getAttendanceDate, replacementTime)
|
||||
.eq(RzAttendance::getRemarks, "加班");
|
||||
rzAttendance = getBaseMapper().selectOne(wrapper);
|
||||
}
|
||||
|
||||
return rzAttendance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendAbnormalAttendance(){
|
||||
try {
|
||||
for (SysStaff sysStaff : sysStaffService.selectSysStaffListAll()){
|
||||
Date date = DateUtils.addDays(new Date(), -1);
|
||||
RzAttendance beforeAttendance = getBaseMapper().queryNowDayAttendanceByStatisticalIdAndDate(sysStaff.getUserId(), date);
|
||||
if(beforeAttendance.getWorkStartTime() != null && beforeAttendance.getWorkEndTime() == null){
|
||||
sendAbnormalAttendance(sysStaff, beforeAttendance.getWorkStartTime());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("查询前一天的打卡情况报错了");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Async
|
||||
protected void sendAbnormalAttendance(SysStaff sysStaff, Date date){
|
||||
try {
|
||||
if(sysStaff != null && StringUtils.isNotEmpty(sysStaff.getOpenid())){
|
||||
SysDept sysDept = sysDeptMapper.selectById(sysStaff.getDeptId());
|
||||
sendClientService.sendAbnormalAttendance(sysDept != null ? sysDept.getDeptName() : "未知",sysStaff.getName(), "昨天下班未打卡", date, sysStaff.getOpenid());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("推送公众号打卡异常失败, 原因为: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,275 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.attendance.mapper.RzAttendanceMapper;
|
||||
import com.evo.attendance.mapper.RzAttendanceStatisticalMapper;
|
||||
import com.evo.attendance.mapper.RzSpecialAttendanceMapper;
|
||||
import com.evo.attendance.service.IRzAttendanceStatisticalService;
|
||||
import com.evo.attendance.service.IRzSysParamService;
|
||||
import com.evo.common.annotation.DataScope;
|
||||
import com.evo.common.annotation.StatisticalOperationLog;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.utils.*;
|
||||
import com.evo.personnelMatters.domain.RzOverTime;
|
||||
import com.evo.personnelMatters.mapper.RzLeaveDetailMapper;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeDetailMapper;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeMapper;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 考勤统计Service业务层处理
|
||||
*
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@Service
|
||||
public class RzAttendanceStatisticalServiceImpl extends ServiceImpl<RzAttendanceStatisticalMapper, RzAttendanceStatistical> implements IRzAttendanceStatisticalService
|
||||
{
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper; //部门
|
||||
@Resource
|
||||
private RzAttendanceMapper rzAttendanceMapper; //打卡记录
|
||||
@Resource
|
||||
private RzOverTimeMapper rzOverTimeMapper;
|
||||
@Resource
|
||||
private RzOverTimeDetailMapper rzOverTimeDetailMapper;
|
||||
@Resource
|
||||
private RzSpecialAttendanceMapper rzSpecialAttendanceMapper;
|
||||
@Resource
|
||||
private RzLeaveDetailMapper rzLeaveDetailMapper;
|
||||
|
||||
@Resource
|
||||
private IRzSysParamService rzSysParamService; //部门
|
||||
|
||||
/**
|
||||
* 查询考勤统计
|
||||
*
|
||||
* @param id 考勤统计主键
|
||||
* @return 考勤统计
|
||||
*/
|
||||
@Override
|
||||
public RzAttendanceStatistical selectRzAttendanceStatisticalById(Long id)
|
||||
{
|
||||
return getBaseMapper().selectRzAttendanceStatisticalById(id);
|
||||
}
|
||||
/**
|
||||
* 查询考勤统计列表
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 考勤统计
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<RzAttendanceStatistical> selectRzAttendanceStatisticalList(RzAttendanceStatistical rzAttendanceStatistical)
|
||||
{
|
||||
List<RzAttendanceStatistical> res_list = getBaseMapper().selectRzAttendanceStatisticalList(rzAttendanceStatistical);
|
||||
for (RzAttendanceStatistical attendanceStatistical : res_list) {
|
||||
SysDept sysDept = deptMapper.selectDeptById(attendanceStatistical.getDeptId());
|
||||
attendanceStatistical.setDeptName(sysDept.getDeptName());
|
||||
}
|
||||
return res_list;
|
||||
}
|
||||
/**
|
||||
* 修改考勤统计
|
||||
*
|
||||
* @param rzAttendanceStatistical 考勤统计
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@StatisticalOperationLog
|
||||
public int updateRzAttendanceStatistical(RzAttendanceStatistical rzAttendanceStatistical)
|
||||
{
|
||||
rzAttendanceStatistical.setRealAttendance(rzAttendanceStatistical.getEssentialAttendance().add(rzAttendanceStatistical.getWorkOvertimeNumber()).add(rzAttendanceStatistical.getOverTimeHours()));
|
||||
rzAttendanceStatistical.setUpdateTime(DateUtils.getNowDate());
|
||||
rzAttendanceStatistical.setUpdateBy(SecurityUtils.getUsername());
|
||||
return getBaseMapper().updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校正数据
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult correct(RzAttendanceStatistical rzAttendanceStatistical) {
|
||||
if (StringUtils.isNull(rzAttendanceStatistical) || StringUtils.isNull(rzAttendanceStatistical.getMonth())) {
|
||||
return AjaxResult.error("请输入校正日期!!");
|
||||
}
|
||||
//查询条件月统计的数据
|
||||
List<RzAttendanceStatistical> ms_list = getBaseMapper().queryStatisticalByMonth(rzAttendanceStatistical.getMonth());
|
||||
//计算打卡汇总表
|
||||
for (RzAttendanceStatistical attendanceStatistical : ms_list) {
|
||||
//初始化打卡记录
|
||||
attendanceStatistical.setEssentialAttendance(new BigDecimal("0.0"));
|
||||
attendanceStatistical.setWorkOvertimeNumber(new BigDecimal("0.0"));
|
||||
attendanceStatistical.setMiddleShiftNumber(0l);
|
||||
attendanceStatistical.setNightNumber(0l);
|
||||
//查询打卡记录
|
||||
RzAttendance rzAttendance = new RzAttendance();
|
||||
rzAttendance.setAttendanceDate(rzAttendanceStatistical.getMonth());
|
||||
rzAttendance.setStaffId(attendanceStatistical.getStaffId());
|
||||
List<RzAttendance> at_list = rzAttendanceMapper.listAttendanceByParams(rzAttendance);
|
||||
for (RzAttendance attendance : at_list) {
|
||||
attendanceStatistical.setEssentialAttendance(attendanceStatistical.getEssentialAttendance().add(attendance.getWorkSum()));
|
||||
attendanceStatistical.setMiddleShiftNumber(attendanceStatistical.getMiddleShiftNumber() + attendance.getMiddleShiftNumber());
|
||||
attendanceStatistical.setNightNumber(attendanceStatistical.getNightNumber() + attendance.getNightNumber());
|
||||
}
|
||||
//获取加班数据
|
||||
RzOverTime rzOverTime = rzOverTimeMapper.selectRzOverTimeByNameAndMonth(attendanceStatistical.getStaffId(),rzAttendanceStatistical.getMonth());
|
||||
if(StringUtils.isNotNull(rzOverTime)){
|
||||
attendanceStatistical.setWorkOvertimeNumber(rzOverTime.getOverHours());
|
||||
}
|
||||
attendanceStatistical.setRealAttendance(attendanceStatistical.getEssentialAttendance().add(attendanceStatistical.getWorkOvertimeNumber()));
|
||||
getBaseMapper().updateRzAttendanceStatistical(attendanceStatistical) ;
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量导入考勤统计
|
||||
* @param list
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult importRzAttendanceStatistical(List<RzAttendanceStatistical> list){
|
||||
if(list == null || list.size() == 0){
|
||||
return AjaxResult.error("导入数据为空!!");
|
||||
}
|
||||
for (RzAttendanceStatistical rzAttendanceStatistical : list) {
|
||||
getBaseMapper().updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
}
|
||||
return AjaxResult.success("导入数据成功!!");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public RzAttendanceStatistical createRzAttendance(SysStaff sysStaff, List<String> dayList, Date date) {
|
||||
if(date == null){
|
||||
date = DateUtils.getNowDate();
|
||||
}
|
||||
if(Collections.isEmpty(dayList)){
|
||||
dayList = DateUtils.getMonthAndDays(date);
|
||||
}
|
||||
//根据员工ID查询当月的统计信息统计信息
|
||||
RzAttendanceStatistical rzAttendanceStatistical = getBaseMapper().getRzAttendanceStatisticalByDateAndName(sysStaff.getUserId(),date);
|
||||
if(StringUtils.isNotNull(rzAttendanceStatistical)){
|
||||
//判断名称和部门是否一样。不一样操作修改
|
||||
if(!rzAttendanceStatistical.getName().equals(sysStaff.getName()) || rzAttendanceStatistical.getDeptId() != sysStaff.getDeptId()){
|
||||
//修改部门和姓名
|
||||
rzAttendanceStatistical.setName(sysStaff.getName());
|
||||
rzAttendanceStatistical.setDeptId(sysStaff.getDeptId());
|
||||
getBaseMapper().updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
//查询考勤详情修改
|
||||
List<RzAttendance> kq_list = rzAttendanceMapper.queryMonthAttendanceByStaffId(sysStaff.getUserId(),new Date());
|
||||
//循环修改信息
|
||||
for (RzAttendance rzAttendance : kq_list) {
|
||||
rzAttendance.setDeptId(sysStaff.getDeptId());
|
||||
rzAttendance.setName(sysStaff.getName());
|
||||
rzAttendanceMapper.updateRzAttendance(rzAttendance);
|
||||
}
|
||||
}
|
||||
return rzAttendanceStatistical;
|
||||
}
|
||||
//新增考勤统计
|
||||
rzAttendanceStatistical = new RzAttendanceStatistical();
|
||||
rzAttendanceStatistical.setStaffId(sysStaff.getUserId());
|
||||
rzAttendanceStatistical.setName(sysStaff.getName());
|
||||
rzAttendanceStatistical.setMonth(date);
|
||||
rzAttendanceStatistical.setShouldAttendance(new BigDecimal(ParamUtils.getMonthWorkDayNum(DateUtils.getYear(date), DateUtils.getMonth(date))).multiply(Constants.DAY_WORK_HOUR));
|
||||
rzAttendanceStatistical.setDeptId(sysStaff.getDeptId());
|
||||
rzAttendanceStatistical.setAbsenteeism(new BigDecimal(0));
|
||||
getBaseMapper().insert(rzAttendanceStatistical);
|
||||
//新增考勤详情
|
||||
SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd");
|
||||
RzAttendance rzAttendance = null;
|
||||
List<RzAttendance> pa_list = new ArrayList<RzAttendance>();
|
||||
for(String day: dayList){
|
||||
rzAttendance = new RzAttendance();
|
||||
rzAttendance.setDeptId(sysStaff.getDeptId());
|
||||
rzAttendance.setName(sysStaff.getName());
|
||||
rzAttendance.setStaffId(sysStaff.getUserId());
|
||||
try{
|
||||
rzAttendance.setAttendanceDate(sdfd.parse(day));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
rzAttendance.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
rzAttendance.setCreateTime(DateUtils.getNowDate());
|
||||
rzAttendance.setCreateBy("admin");
|
||||
pa_list.add(rzAttendance);
|
||||
}
|
||||
rzAttendanceMapper.insertBatchRzAttendance(pa_list);
|
||||
|
||||
return rzAttendanceStatistical;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AjaxResult autoCalculateTheDayBeforeAttendance(Date date) {
|
||||
/***
|
||||
* 1. 首先当前时间-1天, 获取到前一天的数据
|
||||
* 2. 根据前一天查询统计表数据
|
||||
* 3, 根据统计表的ID 分组查询考勤时长
|
||||
* 4. 根据前一天时间, 分组查询加班时长
|
||||
* 5. 根据前一天时间, 分组查询特殊加班时长
|
||||
* 6. 根据前一天时间, 分组查询请假时长
|
||||
* 7, 组装考勤统计数据
|
||||
*/
|
||||
//因为是前一天的数据, 所以需要-1
|
||||
|
||||
//查询当天的所有加班, 查询当天的所有
|
||||
List<RzAttendanceStatistical> list = getBaseMapper().selectList(new LambdaQueryWrapper<RzAttendanceStatistical>().eq(RzAttendanceStatistical::getDelFlag, Constants.DELETE_FLAG_0).apply(" DATE_FORMAT(create_time,'%Y%m') = DATE_FORMAT({0},'%Y%m')", date));
|
||||
//查询加班
|
||||
Map<String ,Map<String, Object>> specialAttendanceMap = rzSpecialAttendanceMapper.getSpecialAttendanceHour(date).stream().collect(Collectors.toMap(d-> String.valueOf(d.get("staffId")), d->d, (k1,k2)->k1));
|
||||
//查询统计汇总数据
|
||||
Map<String ,Map<String, Object>> attendanceMap = rzAttendanceMapper.getAttendanceHour(date).stream().collect(Collectors.toMap(d-> String.valueOf(d.get("staffId")), d->d, (k1,k2)->k1));
|
||||
//查询加班汇总数据
|
||||
Map<String ,Map<String, Object>> overTimeMap = rzOverTimeDetailMapper.getOverTimeHour(date).stream().collect(Collectors.toMap(d-> String.valueOf(d.get("staffId")), d->d, (k1,k2)->k1));
|
||||
//获取请假信息及详情
|
||||
Map<String ,Map<String, Object>> leaveMap = rzLeaveDetailMapper.getLeaveHour(date).stream().collect(Collectors.toMap(d-> String.valueOf(d.get("staffId")), d->d, (k1,k2)->k1));;
|
||||
//查询特殊加班汇总数据
|
||||
list.stream().forEach(statistical ->{
|
||||
//首选抓取员工考勤记录
|
||||
Map<String, Object> attendance = attendanceMap.get(String.valueOf(statistical.getStaffId()));
|
||||
if(attendance != null){
|
||||
statistical.setEssentialAttendance(getValue(attendance,"workSum"));
|
||||
statistical.setNightNumber(getValue(attendance,"nightNumber").longValue());
|
||||
statistical.setMiddleShiftNumber(getValue(attendance,"middleShiftNumber").longValue());
|
||||
}
|
||||
//继续计算加班数据
|
||||
statistical.setWorkOvertimeNumber(getValue(overTimeMap.get(String.valueOf(statistical.getStaffId())),"overTimeHours"));
|
||||
//继续计算特殊加班数据
|
||||
statistical.setOverTimeHours(getValue(specialAttendanceMap.get(String.valueOf(statistical.getStaffId())),"workHours"));
|
||||
//继续计算请假
|
||||
statistical.setAbsenteeism(getValue(leaveMap.get(String.valueOf(statistical.getStaffId())),"leaveHour"));
|
||||
//实际出勤=打卡+加班+特殊加班
|
||||
statistical.setRealAttendance(statistical.getEssentialAttendance().add(statistical.getWorkOvertimeNumber()).add(statistical.getOverTimeHours()));
|
||||
});
|
||||
|
||||
//更新全部考勤
|
||||
updateBatchById(list);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
public BigDecimal getValue(Map<String, Object> map, String key){
|
||||
return new BigDecimal(Collections.isEmpty(map) || ObjectUtils.isEmpty(map.get(key)) ? "0" : String.valueOf(map.get(key)));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,134 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.evo.attendance.domain.RzAttendanceStatistical;
|
||||
import com.evo.attendance.domain.RzSpecialAttendance;
|
||||
import com.evo.attendance.domain.RzSpecialOverTime;
|
||||
import com.evo.attendance.mapper.RzAttendanceStatisticalMapper;
|
||||
import com.evo.attendance.mapper.RzSpecialAttendanceMapper;
|
||||
import com.evo.attendance.mapper.RzSpecialOverTimeMapper;
|
||||
import com.evo.attendance.service.IRzSpecialAttendanceService;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 加班考勤记录Service业务层处理
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-15
|
||||
*/
|
||||
@Service
|
||||
public class RzSpecialAttendanceServiceImpl implements IRzSpecialAttendanceService
|
||||
{
|
||||
@Resource
|
||||
private RzSpecialAttendanceMapper rzSpecialAttendanceMapper;
|
||||
@Resource
|
||||
private RzSpecialOverTimeMapper rzSpecialOverTimeMapper;
|
||||
@Resource
|
||||
private RzAttendanceStatisticalMapper rzAttendanceStatisticalMapper;
|
||||
/**
|
||||
* 查询加班考勤记录
|
||||
*
|
||||
* @param id 加班考勤记录主键
|
||||
* @return 加班考勤记录
|
||||
*/
|
||||
@Override
|
||||
public RzSpecialAttendance selectRzSpecialAttendanceById(Long id)
|
||||
{
|
||||
return rzSpecialAttendanceMapper.selectRzSpecialAttendanceById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询加班考勤记录列表
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 加班考勤记录
|
||||
*/
|
||||
@Override
|
||||
public List<RzSpecialAttendance> selectRzSpecialAttendanceList(RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
return rzSpecialAttendanceMapper.selectRzSpecialAttendanceList(rzSpecialAttendance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增加班考勤记录
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRzSpecialAttendance(RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
try{
|
||||
rzSpecialAttendance.setAttendanceDate(sdf.parse(sdf.format(rzSpecialAttendance.getWorkStartTime())));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
rzSpecialAttendance.setCreateTime(new Date());
|
||||
rzSpecialAttendance.setCreateBy(SecurityUtils.getUsername());
|
||||
rzSpecialAttendance.setDelFlag("0");
|
||||
rzSpecialAttendance.setCreateTime(DateUtils.getNowDate());
|
||||
rzSpecialAttendanceMapper.insertRzSpecialAttendance(rzSpecialAttendance);
|
||||
|
||||
RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeByUserIdAndDate(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
rzSpecialOverTime.setSickHours(rzSpecialOverTime.getSickHours().add(rzSpecialAttendance.getWorkHours()));
|
||||
rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
|
||||
RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
rzAttendanceStatistical.setOverTimeHours(rzAttendanceStatistical.getOverTimeHours().add(rzSpecialAttendance.getWorkHours()));
|
||||
return rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改加班考勤记录
|
||||
*
|
||||
* @param rzSpecialAttendance 加班考勤记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzSpecialAttendance(RzSpecialAttendance rzSpecialAttendance)
|
||||
{
|
||||
RzSpecialAttendance old = rzSpecialAttendanceMapper.selectRzSpecialAttendanceById(rzSpecialAttendance.getId());
|
||||
rzSpecialAttendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzSpecialAttendance.setUpdateTime(DateUtils.getNowDate());
|
||||
rzSpecialAttendanceMapper.updateRzSpecialAttendance(rzSpecialAttendance);
|
||||
|
||||
RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeByUserIdAndDate(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
rzSpecialOverTime.setSickHours(rzSpecialOverTime.getSickHours().add(rzSpecialAttendance.getWorkHours()).subtract(old.getWorkHours()));
|
||||
rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
|
||||
RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
rzAttendanceStatistical.setOverTimeHours(rzAttendanceStatistical.getOverTimeHours().add(rzSpecialAttendance.getWorkHours()).subtract(old.getWorkHours()));
|
||||
return rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除加班考勤记录信息
|
||||
*
|
||||
* @param id 加班考勤记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzSpecialAttendanceById(Long id)
|
||||
{
|
||||
RzSpecialAttendance rzSpecialAttendance = rzSpecialAttendanceMapper.selectRzSpecialAttendanceById(id);
|
||||
rzSpecialAttendance.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzSpecialAttendance.setUpdateTime(DateUtils.getNowDate());
|
||||
rzSpecialAttendance.setDelFlag("1");
|
||||
rzSpecialAttendanceMapper.updateRzSpecialAttendance(rzSpecialAttendance);
|
||||
|
||||
RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeByUserIdAndDate(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
rzSpecialOverTime.setSickHours(rzSpecialOverTime.getSickHours().subtract(rzSpecialAttendance.getWorkHours()));
|
||||
rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
|
||||
RzAttendanceStatistical rzAttendanceStatistical = rzAttendanceStatisticalMapper.getRzAttendanceStatisticalByDateAndName(rzSpecialAttendance.getStaffId(),rzSpecialAttendance.getAttendanceDate());
|
||||
rzAttendanceStatistical.setOverTimeHours(rzAttendanceStatistical.getOverTimeHours().subtract(rzSpecialAttendance.getWorkHours()));
|
||||
return rzAttendanceStatisticalMapper.updateRzAttendanceStatistical(rzAttendanceStatistical);
|
||||
}
|
||||
}
|
||||
@ -1,106 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzSpecialOverTime;
|
||||
import com.evo.attendance.mapper.RzSpecialOverTimeMapper;
|
||||
import com.evo.attendance.service.IRzSpecialOverTimeService;
|
||||
import com.evo.common.annotation.DataScope;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.system.mapper.SysDeptMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 特殊加班管理Service业务层处理
|
||||
*
|
||||
* @author evo
|
||||
* @date 2025-04-16
|
||||
*/
|
||||
@Service
|
||||
public class RzSpecialOverTimeServiceImpl implements IRzSpecialOverTimeService
|
||||
{
|
||||
@Resource
|
||||
private RzSpecialOverTimeMapper rzSpecialOverTimeMapper;
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
* 查询特殊加班管理
|
||||
*
|
||||
* @param id 特殊加班管理主键
|
||||
* @return 特殊加班管理
|
||||
*/
|
||||
@Override
|
||||
public RzSpecialOverTime selectRzSpecialOverTimeById(Long id)
|
||||
{
|
||||
return rzSpecialOverTimeMapper.selectRzSpecialOverTimeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询特殊加班管理列表
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 特殊加班管理
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "r")
|
||||
public List<RzSpecialOverTime> selectRzSpecialOverTimeList(RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
List<RzSpecialOverTime> reslut = rzSpecialOverTimeMapper.selectRzSpecialOverTimeList(rzSpecialOverTime);
|
||||
for (RzSpecialOverTime specialOverTime : reslut) {
|
||||
specialOverTime.setDeptName(deptMapper.selectDeptById(specialOverTime.getDeptId()).getDeptName());
|
||||
}
|
||||
return reslut;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特殊加班管理
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRzSpecialOverTime(RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
//根据用户ID查询用户名称
|
||||
|
||||
rzSpecialOverTime.setCreateTime(new Date());
|
||||
rzSpecialOverTime.setCreateBy(SecurityUtils.getUsername());
|
||||
rzSpecialOverTime.setDelFlag("0");
|
||||
rzSpecialOverTime.setCreateTime(DateUtils.getNowDate());
|
||||
return rzSpecialOverTimeMapper.insertRzSpecialOverTime(rzSpecialOverTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特殊加班管理
|
||||
*
|
||||
* @param rzSpecialOverTime 特殊加班管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzSpecialOverTime(RzSpecialOverTime rzSpecialOverTime)
|
||||
{
|
||||
rzSpecialOverTime.setUpdateTime(new Date());
|
||||
rzSpecialOverTime.setUpdateBy(SecurityUtils.getUsername());
|
||||
rzSpecialOverTime.setUpdateTime(DateUtils.getNowDate());
|
||||
return rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除特殊加班管理信息
|
||||
*
|
||||
* @param id 特殊加班管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzSpecialOverTimeById(Long id)
|
||||
{
|
||||
RzSpecialOverTime rzSpecialOverTime = rzSpecialOverTimeMapper.selectRzSpecialOverTimeById(id);
|
||||
rzSpecialOverTime.setDelFlag("1");
|
||||
rzSpecialOverTime.setUpdateTime(new Date());
|
||||
rzSpecialOverTime.setUpdateBy(SecurityUtils.getUsername());
|
||||
return rzSpecialOverTimeMapper.updateRzSpecialOverTime(rzSpecialOverTime);
|
||||
}
|
||||
}
|
||||
@ -1,123 +0,0 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.equipment.constant.Constants;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.evo.attendance.mapper.RzSysParamMapper;
|
||||
import com.evo.attendance.domain.RzSysParam;
|
||||
import com.evo.attendance.service.IRzSysParamService;
|
||||
|
||||
/**
|
||||
* 参数配置Service业务层处理
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
@Service
|
||||
public class RzSysParamServiceImpl extends ServiceImpl<RzSysParamMapper, RzSysParam> implements IRzSysParamService
|
||||
{
|
||||
|
||||
/**
|
||||
* 查询参数配置
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 参数配置
|
||||
*/
|
||||
@Override
|
||||
public RzSysParam selectRzSysParamById(Long id)
|
||||
{
|
||||
return getBaseMapper().selectRzSysParamById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 参数配置
|
||||
*/
|
||||
@Override
|
||||
public List<RzSysParam> selectRzSysParamList(RzSysParam rzSysParam)
|
||||
{
|
||||
return getBaseMapper().selectRzSysParamList(rzSysParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRzSysParam(RzSysParam rzSysParam)
|
||||
{
|
||||
rzSysParam.setUpdateTime(DateUtils.getNowDate());
|
||||
rzSysParam.setCreateBy(SecurityUtils.getUsername());
|
||||
rzSysParam.setCreateTime(DateUtils.getNowDate());
|
||||
return getBaseMapper().insertRzSysParam(rzSysParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzSysParam(RzSysParam rzSysParam)
|
||||
{
|
||||
return getBaseMapper().updateRzSysParam(rzSysParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数配置
|
||||
*
|
||||
* @param ids 需要删除的参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzSysParamByIds(Long[] ids)
|
||||
{
|
||||
return getBaseMapper().deleteRzSysParamByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置信息
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzSysParamById(Long id)
|
||||
{
|
||||
return getBaseMapper().deleteRzSysParamById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public RzSysParam getRzSysParam(String name, String code, String defVal, String des){
|
||||
RzSysParam param = getRzSysParam(code);
|
||||
if(ObjectUtils.isEmpty(param)){
|
||||
param = new RzSysParam();
|
||||
param.setParamName(name);
|
||||
param.setParamCode(code);
|
||||
param.setParamValue(defVal);
|
||||
param.setDescription(des);
|
||||
save(param);
|
||||
}
|
||||
return param;
|
||||
}
|
||||
@Override
|
||||
@Cacheable(cacheNames = Constants.SYS_RUNNING_PARAMS, key = "#code")
|
||||
public RzSysParam getRzSysParam(String code){
|
||||
return getOne(new LambdaQueryWrapper<RzSysParam>().eq(RzSysParam::getParamCode, code));
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 匿名访问不鉴权注解
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Target({ ElementType.METHOD, ElementType.TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Anonymous
|
||||
{
|
||||
}
|
||||
@ -1,33 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 数据权限过滤注解
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface DataScope
|
||||
{
|
||||
/**
|
||||
* 部门表的别名
|
||||
*/
|
||||
public String deptAlias() default "";
|
||||
|
||||
/**
|
||||
* 用户表的别名
|
||||
*/
|
||||
public String userAlias() default "";
|
||||
|
||||
/**
|
||||
* 权限字符(用于多个角色匹配符合要求的权限)默认根据权限注解@ss获取,多个权限用逗号分隔开来
|
||||
*/
|
||||
public String permission() default "";
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import com.evo.common.enums.DataSourceType;
|
||||
|
||||
/**
|
||||
* 自定义多数据源切换注解
|
||||
*
|
||||
* 优先级:先方法,后类,如果方法覆盖了类上的数据源类型,以方法的为准,否则以类上的为准
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Target({ ElementType.METHOD, ElementType.TYPE })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Inherited
|
||||
public @interface DataSource
|
||||
{
|
||||
/**
|
||||
* 切换数据源名称
|
||||
*/
|
||||
public DataSourceType value() default DataSourceType.MASTER;
|
||||
}
|
||||
@ -1,213 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.evo.common.utils.poi.handler.ExcelFieldHandlerAdapter;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||
import com.evo.common.utils.poi.handler.ExcelHandlerAdapter;
|
||||
|
||||
/**
|
||||
* 自定义导出Excel数据注解
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface Excel
|
||||
{
|
||||
/**
|
||||
* 导出时在excel中排序
|
||||
*/
|
||||
public int sort() default Integer.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* 导出到Excel中的名字.
|
||||
*/
|
||||
public String name() default "";
|
||||
|
||||
/**
|
||||
* 是否在全部表展示, 默认true
|
||||
*/
|
||||
public boolean showAllSheet() default true;
|
||||
/**
|
||||
* 是否在第一页显示, 默认false
|
||||
*/
|
||||
public boolean showViewHome() default true;
|
||||
|
||||
|
||||
/**
|
||||
* 日期格式, 如: yyyy-MM-dd
|
||||
*/
|
||||
public String dateFormat() default "";
|
||||
|
||||
/**
|
||||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
||||
*/
|
||||
public String dictType() default "";
|
||||
|
||||
/**
|
||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
||||
*/
|
||||
public String readConverterExp() default "";
|
||||
|
||||
/**
|
||||
* 分隔符,读取字符串组内容
|
||||
*/
|
||||
public String separator() default ",";
|
||||
|
||||
/**
|
||||
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
||||
*/
|
||||
public int scale() default -1;
|
||||
|
||||
/**
|
||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||
*/
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的高度
|
||||
*/
|
||||
public double height() default 14;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的宽度
|
||||
*/
|
||||
public double width() default 16;
|
||||
|
||||
/**
|
||||
* 文字后缀,如% 90 变成90%
|
||||
*/
|
||||
public String suffix() default "";
|
||||
|
||||
/**
|
||||
* 当值为空时,字段的默认值
|
||||
*/
|
||||
public String defaultValue() default "";
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*/
|
||||
public String prompt() default "";
|
||||
|
||||
/**
|
||||
* 设置只能选择不能输入的列内容.
|
||||
*/
|
||||
public String[] combo() default {};
|
||||
|
||||
/**
|
||||
* 是否从字典读数据到combo,默认不读取,如读取需要设置dictType注解.
|
||||
*/
|
||||
public boolean comboReadDict() default false;
|
||||
|
||||
/**
|
||||
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
||||
*/
|
||||
public boolean needMerge() default false;
|
||||
|
||||
/**
|
||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||
*/
|
||||
public boolean isExport() default true;
|
||||
|
||||
/**
|
||||
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
||||
*/
|
||||
public String targetAttr() default "";
|
||||
|
||||
/**
|
||||
* 是否自动统计数据,在最后追加一行统计数据总和
|
||||
*/
|
||||
public boolean isStatistics() default false;
|
||||
|
||||
/**
|
||||
* 导出类型(0数字 1字符串 2图片)
|
||||
*/
|
||||
public ColumnType cellType() default ColumnType.STRING;
|
||||
|
||||
/**
|
||||
* 导出列头背景颜色
|
||||
*/
|
||||
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
||||
|
||||
/**
|
||||
* 导出列头字体颜色
|
||||
*/
|
||||
public IndexedColors headerColor() default IndexedColors.WHITE;
|
||||
|
||||
/**
|
||||
* 导出单元格背景颜色
|
||||
*/
|
||||
public IndexedColors backgroundColor() default IndexedColors.WHITE;
|
||||
|
||||
/**
|
||||
* 导出单元格字体颜色
|
||||
*/
|
||||
public IndexedColors color() default IndexedColors.BLACK;
|
||||
|
||||
/**
|
||||
* 导出字段对齐方式
|
||||
*/
|
||||
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
|
||||
|
||||
/**
|
||||
* 自定义数据处理器
|
||||
*/
|
||||
public Class<?> handler() default ExcelHandlerAdapter.class;
|
||||
|
||||
/**
|
||||
* 自定义数据处理器
|
||||
*/
|
||||
public boolean customExcelField() default false;
|
||||
/**
|
||||
* 自定义数据处理器
|
||||
*/
|
||||
public Class<?> excelFieldHandler() default ExcelFieldHandlerAdapter.class;
|
||||
|
||||
/**
|
||||
* 自定义数据处理器参数
|
||||
*/
|
||||
public String[] args() default {};
|
||||
|
||||
/**
|
||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||
*/
|
||||
Type type() default Type.ALL;
|
||||
|
||||
public enum Type
|
||||
{
|
||||
ALL(0), EXPORT(1), IMPORT(2);
|
||||
private final int value;
|
||||
|
||||
Type(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ColumnType
|
||||
{
|
||||
NUMERIC(0), STRING(1), IMAGE(2), TEXT(3);
|
||||
private final int value;
|
||||
|
||||
ColumnType(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,18 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Excel注解集
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Excels
|
||||
{
|
||||
public Excel[] value();
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import com.evo.common.enums.BusinessType;
|
||||
import com.evo.common.enums.OperatorType;
|
||||
|
||||
/**
|
||||
* 自定义操作日志记录注解
|
||||
*
|
||||
* @author evo
|
||||
*
|
||||
*/
|
||||
@Target({ ElementType.PARAMETER, ElementType.METHOD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface Log
|
||||
{
|
||||
/**
|
||||
* 模块
|
||||
*/
|
||||
public String title() default "";
|
||||
|
||||
/**
|
||||
* 功能
|
||||
*/
|
||||
public BusinessType businessType() default BusinessType.OTHER;
|
||||
|
||||
/**
|
||||
* 操作人类别
|
||||
*/
|
||||
public OperatorType operatorType() default OperatorType.MANAGE;
|
||||
|
||||
/**
|
||||
* 是否保存请求的参数
|
||||
*/
|
||||
public boolean isSaveRequestData() default true;
|
||||
|
||||
/**
|
||||
* 是否保存响应的参数
|
||||
*/
|
||||
public boolean isSaveResponseData() default true;
|
||||
|
||||
/**
|
||||
* 排除指定的请求参数
|
||||
*/
|
||||
public String[] excludeParamNames() default {};
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import com.evo.common.constant.CacheConstants;
|
||||
import com.evo.common.enums.LimitType;
|
||||
|
||||
/**
|
||||
* 限流注解
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface RateLimiter
|
||||
{
|
||||
/**
|
||||
* 限流key
|
||||
*/
|
||||
public String key() default CacheConstants.RATE_LIMIT_KEY;
|
||||
|
||||
/**
|
||||
* 限流时间,单位秒
|
||||
*/
|
||||
public int time() default 60;
|
||||
|
||||
/**
|
||||
* 限流次数
|
||||
*/
|
||||
public int count() default 100;
|
||||
|
||||
/**
|
||||
* 限流类型
|
||||
*/
|
||||
public LimitType limitType() default LimitType.DEFAULT;
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 自定义注解防止表单重复提交
|
||||
*
|
||||
* @author evo
|
||||
*
|
||||
*/
|
||||
@Inherited
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
public @interface RepeatSubmit
|
||||
{
|
||||
/**
|
||||
* 间隔时间(ms),小于此时间视为重复提交
|
||||
*/
|
||||
public int interval() default 5000;
|
||||
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
public String message() default "不允许重复提交,请稍候再试";
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.evo.common.config.serializer.SensitiveJsonSerializer;
|
||||
import com.evo.common.enums.DesensitizedType;
|
||||
|
||||
/**
|
||||
* 数据脱敏注解
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
@JacksonAnnotationsInside
|
||||
@JsonSerialize(using = SensitiveJsonSerializer.class)
|
||||
public @interface Sensitive
|
||||
{
|
||||
DesensitizedType desensitizedType();
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package com.evo.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface StatisticalOperationLog {
|
||||
}
|
||||
@ -1,111 +0,0 @@
|
||||
package com.evo.common.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 读取项目相关配置
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "evo")
|
||||
public class EvoConfig
|
||||
{
|
||||
/** 项目名称 */
|
||||
private String name;
|
||||
|
||||
/** 版本 */
|
||||
private String version;
|
||||
|
||||
/** 版权年份 */
|
||||
private String copyrightYear;
|
||||
|
||||
/** 上传路径 */
|
||||
private static String profile;
|
||||
|
||||
/** 获取地址开关 */
|
||||
private static boolean addressEnabled;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getVersion()
|
||||
{
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(String version)
|
||||
{
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getCopyrightYear()
|
||||
{
|
||||
return copyrightYear;
|
||||
}
|
||||
|
||||
public void setCopyrightYear(String copyrightYear)
|
||||
{
|
||||
this.copyrightYear = copyrightYear;
|
||||
}
|
||||
|
||||
public static String getProfile()
|
||||
{
|
||||
return profile;
|
||||
}
|
||||
|
||||
public void setProfile(String profile)
|
||||
{
|
||||
EvoConfig.profile = profile;
|
||||
}
|
||||
|
||||
public static boolean isAddressEnabled()
|
||||
{
|
||||
return addressEnabled;
|
||||
}
|
||||
|
||||
public void setAddressEnabled(boolean addressEnabled)
|
||||
{
|
||||
EvoConfig.addressEnabled = addressEnabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导入上传路径
|
||||
*/
|
||||
public static String getImportPath()
|
||||
{
|
||||
return getProfile() + "/import";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取头像上传路径
|
||||
*/
|
||||
public static String getAvatarPath()
|
||||
{
|
||||
return getProfile() + "/avatar";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下载路径
|
||||
*/
|
||||
public static String getDownloadPath()
|
||||
{
|
||||
return getProfile() + "/download/";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取上传路径
|
||||
*/
|
||||
public static String getUploadPath()
|
||||
{
|
||||
return getProfile() + "/upload";
|
||||
}
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
package com.evo.common.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.models.auth.In;
|
||||
import springfox.documentation.builders.ApiInfoBuilder;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.service.ApiInfo;
|
||||
import springfox.documentation.service.ApiKey;
|
||||
import springfox.documentation.service.AuthorizationScope;
|
||||
import springfox.documentation.service.Contact;
|
||||
import springfox.documentation.service.SecurityReference;
|
||||
import springfox.documentation.service.SecurityScheme;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spi.service.contexts.SecurityContext;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
/**
|
||||
* Swagger2的接口配置
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Configuration
|
||||
public class SwaggerConfig
|
||||
{
|
||||
/** 系统基础配置 */
|
||||
@Autowired
|
||||
private EvoConfig EvoConfig;
|
||||
|
||||
/** 是否开启swagger */
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/** 设置请求的统一前缀 */
|
||||
@Value("${swagger.pathMapping}")
|
||||
private String pathMapping;
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
*/
|
||||
@Bean
|
||||
public Docket createRestApi()
|
||||
{
|
||||
return new Docket(DocumentationType.OAS_30)
|
||||
// 是否启用Swagger
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
.apiInfo(apiInfo())
|
||||
// 设置哪些接口暴露给Swagger展示
|
||||
.select()
|
||||
// 扫描所有有注解的api,用这种方式更灵活
|
||||
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
|
||||
// 扫描指定包中的swagger注解
|
||||
// .apis(RequestHandlerSelectors.basePackage("com.evo.project.tool.swagger"))
|
||||
// 扫描所有 .apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build()
|
||||
/* 设置安全模式,swagger可以设置访问token */
|
||||
.securitySchemes(securitySchemes())
|
||||
.securityContexts(securityContexts())
|
||||
.pathMapping(pathMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全模式,这里指定token通过Authorization头请求头传递
|
||||
*/
|
||||
private List<SecurityScheme> securitySchemes()
|
||||
{
|
||||
List<SecurityScheme> apiKeyList = new ArrayList<SecurityScheme>();
|
||||
apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
|
||||
return apiKeyList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全上下文
|
||||
*/
|
||||
private List<SecurityContext> securityContexts()
|
||||
{
|
||||
List<SecurityContext> securityContexts = new ArrayList<>();
|
||||
securityContexts.add(
|
||||
SecurityContext.builder()
|
||||
.securityReferences(defaultAuth())
|
||||
.operationSelector(o -> o.requestMappingPattern().matches("/.*"))
|
||||
.build());
|
||||
return securityContexts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认的安全上引用
|
||||
*/
|
||||
private List<SecurityReference> defaultAuth()
|
||||
{
|
||||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
|
||||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
|
||||
authorizationScopes[0] = authorizationScope;
|
||||
List<SecurityReference> securityReferences = new ArrayList<>();
|
||||
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
|
||||
return securityReferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加摘要信息
|
||||
*/
|
||||
private ApiInfo apiInfo()
|
||||
{
|
||||
// 用ApiInfoBuilder进行定制
|
||||
return new ApiInfoBuilder()
|
||||
// 设置标题
|
||||
.title("标题:伊特管理系统_接口文档")
|
||||
// 描述
|
||||
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
|
||||
// 作者信息
|
||||
.contact(new Contact(EvoConfig.getName(), null, null))
|
||||
// 版本
|
||||
.version("版本号:" + EvoConfig.getVersion())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
package com.evo.common.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:WebConfig
|
||||
* @date: 2025年05月20日 13:24
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
|
||||
// 在Spring Boot的配置类中添加CORS配置
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**") // 匹配所有接口
|
||||
.allowedOrigins("localhost:8090") // 允许的前端域名
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE") // 允许的HTTP方法
|
||||
.allowedHeaders("*") // 允许的请求头
|
||||
.allowCredentials(true); // 允许携带凭证(如Cookie)
|
||||
}
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package com.evo.common.config.serializer;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.BeanProperty;
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
||||
import com.evo.common.annotation.Sensitive;
|
||||
import com.evo.common.core.domain.model.LoginUser;
|
||||
import com.evo.common.enums.DesensitizedType;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
|
||||
/**
|
||||
* 数据脱敏序列化过滤
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer
|
||||
{
|
||||
private DesensitizedType desensitizedType;
|
||||
|
||||
@Override
|
||||
public void serialize(String value, JsonGenerator gen, SerializerProvider serializers) throws IOException
|
||||
{
|
||||
if (desensitization())
|
||||
{
|
||||
gen.writeString(desensitizedType.desensitizer().apply(value));
|
||||
}
|
||||
else
|
||||
{
|
||||
gen.writeString(value);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonSerializer<?> createContextual(SerializerProvider prov, BeanProperty property)
|
||||
throws JsonMappingException
|
||||
{
|
||||
Sensitive annotation = property.getAnnotation(Sensitive.class);
|
||||
if (Objects.nonNull(annotation) && Objects.equals(String.class, property.getType().getRawClass()))
|
||||
{
|
||||
this.desensitizedType = annotation.desensitizedType();
|
||||
return this;
|
||||
}
|
||||
return prov.findValueSerializer(property.getType(), property);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要脱敏处理
|
||||
*/
|
||||
private boolean desensitization()
|
||||
{
|
||||
try
|
||||
{
|
||||
LoginUser securityUser = SecurityUtils.getLoginUser();
|
||||
// 管理员不脱敏
|
||||
return !securityUser.getUser().isAdmin();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,44 +0,0 @@
|
||||
package com.evo.common.constant;
|
||||
|
||||
/**
|
||||
* 缓存的key 常量
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class CacheConstants
|
||||
{
|
||||
/**
|
||||
* 登录用户 redis key
|
||||
*/
|
||||
public static final String LOGIN_TOKEN_KEY = "login_tokens:";
|
||||
|
||||
/**
|
||||
* 验证码 redis key
|
||||
*/
|
||||
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
|
||||
|
||||
/**
|
||||
* 参数管理 cache key
|
||||
*/
|
||||
public static final String SYS_CONFIG_KEY = "sys_config:";
|
||||
|
||||
/**
|
||||
* 字典管理 cache key
|
||||
*/
|
||||
public static final String SYS_DICT_KEY = "sys_dict:";
|
||||
|
||||
/**
|
||||
* 防重提交 redis key
|
||||
*/
|
||||
public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
|
||||
|
||||
/**
|
||||
* 限流 redis key
|
||||
*/
|
||||
public static final String RATE_LIMIT_KEY = "rate_limit:";
|
||||
|
||||
/**
|
||||
* 登录账户密码错误次数 redis key
|
||||
*/
|
||||
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||
}
|
||||
@ -1,136 +0,0 @@
|
||||
package com.evo.common.constant;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
import io.jsonwebtoken.Claims;
|
||||
import org.apache.commons.math3.optim.nonlinear.scalar.noderiv.BOBYQAOptimizer;
|
||||
|
||||
/**
|
||||
* 通用常量信息
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class Constants
|
||||
{
|
||||
/**
|
||||
* UTF-8 字符集
|
||||
*/
|
||||
public static final String UTF8 = "UTF-8";
|
||||
/**
|
||||
* GBK 字符集
|
||||
*/
|
||||
public static final String GBK = "GBK";
|
||||
/**
|
||||
* 系统语言
|
||||
*/
|
||||
public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
|
||||
/**
|
||||
* www主域
|
||||
*/
|
||||
public static final String WWW = "www.";
|
||||
/**
|
||||
* http请求
|
||||
*/
|
||||
public static final String HTTP = "http://";
|
||||
/**
|
||||
* https请求
|
||||
*/
|
||||
public static final String HTTPS = "https://";
|
||||
/**
|
||||
* 通用成功标识
|
||||
*/
|
||||
public static final String SUCCESS = "0";
|
||||
/**
|
||||
* 通用失败标识
|
||||
*/
|
||||
public static final String FAIL = "1";
|
||||
/**
|
||||
* 登录成功
|
||||
*/
|
||||
public static final String LOGIN_SUCCESS = "Success";
|
||||
/**
|
||||
* 注销
|
||||
*/
|
||||
public static final String LOGOUT = "Logout";
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public static final String REGISTER = "Register";
|
||||
/**
|
||||
* 登录失败
|
||||
*/
|
||||
public static final String LOGIN_FAIL = "Error";
|
||||
/**
|
||||
* 所有权限标识
|
||||
*/
|
||||
public static final String ALL_PERMISSION = "*:*:*";
|
||||
/**
|
||||
* 管理员角色权限标识
|
||||
*/
|
||||
public static final String SUPER_ADMIN = "admin";
|
||||
/**
|
||||
* 角色权限分隔符
|
||||
*/
|
||||
public static final String ROLE_DELIMETER = ",";
|
||||
/**
|
||||
* 权限标识分隔符
|
||||
*/
|
||||
public static final String PERMISSION_DELIMETER = ",";
|
||||
/**
|
||||
* 令牌
|
||||
*/
|
||||
public static final String TOKEN = "token";
|
||||
/**
|
||||
* 令牌前缀
|
||||
*/
|
||||
public static final String TOKEN_PREFIX = "Bearer ";
|
||||
/**
|
||||
* 令牌前缀
|
||||
*/
|
||||
public static final String LOGIN_USER_KEY = "login_user_key";
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
public static final String RESOURCE_PREFIX = "/profile";
|
||||
/**
|
||||
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
||||
*/
|
||||
public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.evo" };
|
||||
|
||||
/**
|
||||
* 业务参数
|
||||
*/
|
||||
public static final String DELETE_FLAG_0 = "0"; //添加信息
|
||||
public static final String DELETE_FLAG_1 = "1"; //删除信息
|
||||
public static final String JOB_STATIS_11 = "-1"; //员工 离职
|
||||
public static final String JOB_STATIS_0 = "0"; //员工 试用
|
||||
public static final String JOB_STATIS_1 = "1"; //员工 正式
|
||||
public static final String SYS_COMPANY = "sys_company"; //公司简称
|
||||
public static final String SYS_CONTRACT = "sys_contract"; //合同年限
|
||||
public static final String SYS_LEVEL = "sys_level"; //学历
|
||||
public static final String SYS_WORK_STATUS = "sys_worker_status"; //在职状态
|
||||
public static final String SYS_RESTAUTANT = "sys_restaurant"; //餐饮字典类型参数
|
||||
public static final String SEIZE_A_SEAT_0 = "0"; //占位符
|
||||
public static final String SEIZE_A_SEAT_1 = "00"; //占位符
|
||||
public static final String SEIZE_A_SEAT_2 = "000"; //占位符
|
||||
public static final String SEIZE_A_SEAT_3 = "0000"; //占位符
|
||||
public static final String SYS_SENIORITY_SUBSIDIES = "50"; //工龄补助
|
||||
public static final Integer SYS_CONTRACT_SUBSIDY = 50; //合同补助的基数
|
||||
public static final String SYS_CONTRACT_0 = "50"; //一年期合同补助
|
||||
public static final String SYS_CONTRACT_1 = "150"; //三年期合同补助
|
||||
public static final String SYS_SOCIAL_SUBSIDIES = "400"; //新农合社保补助
|
||||
public static final String SUBSIDY_PROPORTION = "0.05"; //请假补助扣除比例
|
||||
public static final String SUBSIDY_PERIOD = "0.80"; //试用期工资
|
||||
public static final String SUBSIDY_PERIOD_1 = "0.20"; //试用期工资的余百分比
|
||||
|
||||
|
||||
public static final Long zc_code = 38l; //早餐消费
|
||||
public static final Long wc_code = 39l; //午餐消费
|
||||
public static final Long wcc_code = 40L; //晚餐消费
|
||||
public static final Long gr_zc_code = 66l; //个人早餐消费
|
||||
public static final Long gr_wc_code = 67l; //个人午餐消费
|
||||
public static final Long gr_wcc_code = 68L; //个人晚餐消费
|
||||
|
||||
public static final BigDecimal DAY_WORK_HOUR = new BigDecimal(8);
|
||||
|
||||
}
|
||||
@ -1,117 +0,0 @@
|
||||
package com.evo.common.constant;
|
||||
|
||||
/**
|
||||
* 代码生成通用常量
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class GenConstants
|
||||
{
|
||||
/** 单表(增删改查) */
|
||||
public static final String TPL_CRUD = "crud";
|
||||
|
||||
/** 树表(增删改查) */
|
||||
public static final String TPL_TREE = "tree";
|
||||
|
||||
/** 主子表(增删改查) */
|
||||
public static final String TPL_SUB = "sub";
|
||||
|
||||
/** 树编码字段 */
|
||||
public static final String TREE_CODE = "treeCode";
|
||||
|
||||
/** 树父编码字段 */
|
||||
public static final String TREE_PARENT_CODE = "treeParentCode";
|
||||
|
||||
/** 树名称字段 */
|
||||
public static final String TREE_NAME = "treeName";
|
||||
|
||||
/** 上级菜单ID字段 */
|
||||
public static final String PARENT_MENU_ID = "parentMenuId";
|
||||
|
||||
/** 上级菜单名称字段 */
|
||||
public static final String PARENT_MENU_NAME = "parentMenuName";
|
||||
|
||||
/** 数据库字符串类型 */
|
||||
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
|
||||
|
||||
/** 数据库文本类型 */
|
||||
public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
|
||||
|
||||
/** 数据库时间类型 */
|
||||
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
|
||||
|
||||
/** 数据库数字类型 */
|
||||
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
|
||||
"bit", "bigint", "float", "double", "decimal" };
|
||||
|
||||
/** 页面不需要编辑字段 */
|
||||
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
||||
|
||||
/** 页面不需要显示的列表字段 */
|
||||
public static final String[] COLUMNNAME_NOT_LIST = { "id", "create_by", "create_time", "del_flag", "update_by",
|
||||
"update_time" };
|
||||
|
||||
/** 页面不需要查询字段 */
|
||||
public static final String[] COLUMNNAME_NOT_QUERY = { "id", "create_by", "create_time", "del_flag", "update_by",
|
||||
"update_time", "remark" };
|
||||
|
||||
/** Entity基类字段 */
|
||||
public static final String[] BASE_ENTITY = { "createBy", "createTime", "updateBy", "updateTime", "remark" };
|
||||
|
||||
/** Tree基类字段 */
|
||||
public static final String[] TREE_ENTITY = { "parentName", "parentId", "orderNum", "ancestors", "children" };
|
||||
|
||||
/** 文本框 */
|
||||
public static final String HTML_INPUT = "input";
|
||||
|
||||
/** 文本域 */
|
||||
public static final String HTML_TEXTAREA = "textarea";
|
||||
|
||||
/** 下拉框 */
|
||||
public static final String HTML_SELECT = "select";
|
||||
|
||||
/** 单选框 */
|
||||
public static final String HTML_RADIO = "radio";
|
||||
|
||||
/** 复选框 */
|
||||
public static final String HTML_CHECKBOX = "checkbox";
|
||||
|
||||
/** 日期控件 */
|
||||
public static final String HTML_DATETIME = "datetime";
|
||||
|
||||
/** 图片上传控件 */
|
||||
public static final String HTML_IMAGE_UPLOAD = "imageUpload";
|
||||
|
||||
/** 文件上传控件 */
|
||||
public static final String HTML_FILE_UPLOAD = "fileUpload";
|
||||
|
||||
/** 富文本控件 */
|
||||
public static final String HTML_EDITOR = "editor";
|
||||
|
||||
/** 字符串类型 */
|
||||
public static final String TYPE_STRING = "String";
|
||||
|
||||
/** 整型 */
|
||||
public static final String TYPE_INTEGER = "Integer";
|
||||
|
||||
/** 长整型 */
|
||||
public static final String TYPE_LONG = "Long";
|
||||
|
||||
/** 浮点型 */
|
||||
public static final String TYPE_DOUBLE = "Double";
|
||||
|
||||
/** 高精度计算类型 */
|
||||
public static final String TYPE_BIGDECIMAL = "BigDecimal";
|
||||
|
||||
/** 时间类型 */
|
||||
public static final String TYPE_DATE = "Date";
|
||||
|
||||
/** 模糊查询 */
|
||||
public static final String QUERY_LIKE = "LIKE";
|
||||
|
||||
/** 相等查询 */
|
||||
public static final String QUERY_EQ = "EQ";
|
||||
|
||||
/** 需要 */
|
||||
public static final String REQUIRE = "1";
|
||||
}
|
||||
@ -1,94 +0,0 @@
|
||||
package com.evo.common.constant;
|
||||
|
||||
/**
|
||||
* 返回状态码
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class HttpStatus
|
||||
{
|
||||
/**
|
||||
* 操作成功
|
||||
*/
|
||||
public static final int SUCCESS = 200;
|
||||
|
||||
/**
|
||||
* 对象创建成功
|
||||
*/
|
||||
public static final int CREATED = 201;
|
||||
|
||||
/**
|
||||
* 请求已经被接受
|
||||
*/
|
||||
public static final int ACCEPTED = 202;
|
||||
|
||||
/**
|
||||
* 操作已经执行成功,但是没有返回数据
|
||||
*/
|
||||
public static final int NO_CONTENT = 204;
|
||||
|
||||
/**
|
||||
* 资源已被移除
|
||||
*/
|
||||
public static final int MOVED_PERM = 301;
|
||||
|
||||
/**
|
||||
* 重定向
|
||||
*/
|
||||
public static final int SEE_OTHER = 303;
|
||||
|
||||
/**
|
||||
* 资源没有被修改
|
||||
*/
|
||||
public static final int NOT_MODIFIED = 304;
|
||||
|
||||
/**
|
||||
* 参数列表错误(缺少,格式不匹配)
|
||||
*/
|
||||
public static final int BAD_REQUEST = 400;
|
||||
|
||||
/**
|
||||
* 未授权
|
||||
*/
|
||||
public static final int UNAUTHORIZED = 401;
|
||||
|
||||
/**
|
||||
* 访问受限,授权过期
|
||||
*/
|
||||
public static final int FORBIDDEN = 403;
|
||||
|
||||
/**
|
||||
* 资源,服务未找到
|
||||
*/
|
||||
public static final int NOT_FOUND = 404;
|
||||
|
||||
/**
|
||||
* 不允许的http方法
|
||||
*/
|
||||
public static final int BAD_METHOD = 405;
|
||||
|
||||
/**
|
||||
* 资源冲突,或者资源被锁
|
||||
*/
|
||||
public static final int CONFLICT = 409;
|
||||
|
||||
/**
|
||||
* 不支持的数据,媒体类型
|
||||
*/
|
||||
public static final int UNSUPPORTED_TYPE = 415;
|
||||
|
||||
/**
|
||||
* 系统内部错误
|
||||
*/
|
||||
public static final int ERROR = 500;
|
||||
|
||||
/**
|
||||
* 接口未实现
|
||||
*/
|
||||
public static final int NOT_IMPLEMENTED = 501;
|
||||
|
||||
/**
|
||||
* 系统警告消息
|
||||
*/
|
||||
public static final int WARN = 601;
|
||||
}
|
||||
@ -1,50 +0,0 @@
|
||||
package com.evo.common.constant;
|
||||
|
||||
/**
|
||||
* 任务调度通用常量
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class ScheduleConstants
|
||||
{
|
||||
public static final String TASK_CLASS_NAME = "TASK_CLASS_NAME";
|
||||
|
||||
/** 执行目标key */
|
||||
public static final String TASK_PROPERTIES = "TASK_PROPERTIES";
|
||||
|
||||
/** 默认 */
|
||||
public static final String MISFIRE_DEFAULT = "0";
|
||||
|
||||
/** 立即触发执行 */
|
||||
public static final String MISFIRE_IGNORE_MISFIRES = "1";
|
||||
|
||||
/** 触发一次执行 */
|
||||
public static final String MISFIRE_FIRE_AND_PROCEED = "2";
|
||||
|
||||
/** 不触发立即执行 */
|
||||
public static final String MISFIRE_DO_NOTHING = "3";
|
||||
|
||||
public enum Status
|
||||
{
|
||||
/**
|
||||
* 正常
|
||||
*/
|
||||
NORMAL("0"),
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
PAUSE("1");
|
||||
|
||||
private String value;
|
||||
|
||||
private Status(String value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
package com.evo.common.constant;
|
||||
|
||||
/**
|
||||
* 用户常量信息
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class UserConstants
|
||||
{
|
||||
/**
|
||||
* 平台内系统用户的唯一标志
|
||||
*/
|
||||
public static final String SYS_USER = "SYS_USER";
|
||||
|
||||
/** 正常状态 */
|
||||
public static final String NORMAL = "0";
|
||||
|
||||
/** 异常状态 */
|
||||
public static final String EXCEPTION = "1";
|
||||
|
||||
/** 用户封禁状态 */
|
||||
public static final String USER_DISABLE = "1";
|
||||
|
||||
/** 角色封禁状态 */
|
||||
public static final String ROLE_DISABLE = "1";
|
||||
|
||||
/** 部门正常状态 */
|
||||
public static final String DEPT_NORMAL = "0";
|
||||
|
||||
/** 部门停用状态 */
|
||||
public static final String DEPT_DISABLE = "1";
|
||||
|
||||
/** 字典正常状态 */
|
||||
public static final String DICT_NORMAL = "0";
|
||||
|
||||
/** 是否为系统默认(是) */
|
||||
public static final String YES = "Y";
|
||||
|
||||
/** 是否菜单外链(是) */
|
||||
public static final String YES_FRAME = "0";
|
||||
|
||||
/** 是否菜单外链(否) */
|
||||
public static final String NO_FRAME = "1";
|
||||
|
||||
/** 菜单类型(目录) */
|
||||
public static final String TYPE_DIR = "M";
|
||||
|
||||
/** 菜单类型(菜单) */
|
||||
public static final String TYPE_MENU = "C";
|
||||
|
||||
/** 菜单类型(按钮) */
|
||||
public static final String TYPE_BUTTON = "F";
|
||||
|
||||
/** Layout组件标识 */
|
||||
public final static String LAYOUT = "Layout";
|
||||
|
||||
/** ParentView组件标识 */
|
||||
public final static String PARENT_VIEW = "ParentView";
|
||||
|
||||
/** InnerLink组件标识 */
|
||||
public final static String INNER_LINK = "InnerLink";
|
||||
|
||||
/** 校验是否唯一的返回标识 */
|
||||
public final static boolean UNIQUE = true;
|
||||
public final static boolean NOT_UNIQUE = false;
|
||||
|
||||
/**
|
||||
* 用户名长度限制
|
||||
*/
|
||||
public static final int USERNAME_MIN_LENGTH = 2;
|
||||
public static final int USERNAME_MAX_LENGTH = 20;
|
||||
|
||||
/**
|
||||
* 密码长度限制
|
||||
*/
|
||||
public static final int PASSWORD_MIN_LENGTH = 5;
|
||||
public static final int PASSWORD_MAX_LENGTH = 20;
|
||||
}
|
||||
@ -1,329 +0,0 @@
|
||||
package com.evo.common.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.attendance.service.IRzAttendanceService;
|
||||
import com.evo.attendance.service.IRzAttendanceStatisticalService;
|
||||
import com.evo.attendance.service.RzAttendanceDetailService;
|
||||
import com.evo.common.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeDetailMapper;
|
||||
import com.evo.personnelMatters.mapper.RzOverTimeMapper;
|
||||
import com.evo.restaurant.service.IRzRestaurantStatisticsService;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.service.ISysStaffService;
|
||||
import com.evo.wechat.TemplateMessageUtil;
|
||||
import com.evo.wechat.dto.AbnormalAttendanceTemplate;
|
||||
import com.evo.wechat.dto.MessageTemplate;
|
||||
import com.evo.wechat.service.GZHAccessTokenService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:TestController
|
||||
* @date: 2025年06月04日 11:12
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
public class TestController {
|
||||
@Resource
|
||||
private RzOverTimeMapper rzOverTimeMapper;
|
||||
@Resource
|
||||
private RzOverTimeDetailMapper rzOverTimeDetailMapper;
|
||||
@Resource
|
||||
private ISysStaffService sysStaffService;
|
||||
@Resource
|
||||
IRzAttendanceStatisticalService rzAttendanceStatisticalService;
|
||||
@Resource
|
||||
IRzRestaurantStatisticsService rzRestaurantStatisticsService;
|
||||
|
||||
@Resource
|
||||
private IRzAttendanceService rzAttendanceService;
|
||||
@Resource
|
||||
private RzAttendanceDetailService rzAttendanceDetailService;
|
||||
@Resource
|
||||
private GZHAccessTokenService gzhAccessTokenService;
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@GetMapping("/testSend")
|
||||
public AjaxResult sendAttendanceDetail() throws ParseException {
|
||||
rzAttendanceDetailService.sendAttendanceDetail();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@GetMapping("/overTime")
|
||||
public AjaxResult overTime(Date date) {
|
||||
|
||||
// rzOverTimeMapper.sele
|
||||
// RzOverTimeDetail rzOverTimeDetail = rzOverTimeDetailMapper.queryRzOverTimeDetailByDateAndOverId(rzOverTime.getId(),date);
|
||||
// rzOverTimeDetail.setOverTimeEnd(date);
|
||||
// //计算加班时长 小时
|
||||
// double minutes = (rzOverTimeDetail.getOverTimeEnd().getTime() - rzOverTimeDetail.getOverTimeStart().getTime())/1000/60;
|
||||
// //计算小时, 保留2位小数
|
||||
// double hours = new BigDecimal(minutes).divide(new BigDecimal(60),2,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
// //获取规则
|
||||
// JSONObject deviceRules = ParamUtils.getDeviceOverTimeRules(sn);
|
||||
// //获取最大加班时长
|
||||
// Integer maxOverTimeHour = deviceRules.getInteger("maxHour");
|
||||
// //记录加班时长
|
||||
// rzOverTimeDetail.setOverTimeHours(BigDecimal.valueOf(((hours > maxOverTimeHour) ? maxOverTimeHour : hours)));
|
||||
|
||||
// if(rzOverTimeDetailMapper.updateRzOverTimeDetail(rzOverTimeDetail) < 1){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/message")
|
||||
public String message(String openid) {
|
||||
|
||||
AbnormalAttendanceTemplate templateData = new AbnormalAttendanceTemplate();
|
||||
|
||||
templateData.setThing1((JSONObject) JSON.toJSON(Collections.asMap("value", "研发部")));
|
||||
templateData.setThing2((JSONObject)JSON.toJSON(Collections.asMap("value", "张三")));//动态跟换车牌号
|
||||
templateData.setConst4((JSONObject)JSON.toJSON(Collections.asMap("value", "昨天下班未打卡")));//动态跟换车牌号
|
||||
templateData.setTime6((JSONObject)JSON.toJSON(Collections.asMap("value", DateUtil.format(new Date(), "yyyy年MM月dd日"))));//动态跟换车牌号
|
||||
|
||||
MessageTemplate sendData = new MessageTemplate();
|
||||
sendData.setTouser(openid);
|
||||
sendData.setTemplate_id("z9sy-38K-iC5MAWHbxcxwg1c-9oNTFWeCOoy6B6zdKY");
|
||||
sendData.setData((JSONObject)JSON.toJSON(templateData));
|
||||
return TemplateMessageUtil.templateMessageSend(gzhAccessTokenService.gzhAccessToken(), sendData);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/error")
|
||||
public String error(Model model) {
|
||||
SysStaff user = new SysStaff();
|
||||
user.setName("张三");
|
||||
user.setIdCard("130132197019183237");
|
||||
user.setOpenid("123456");
|
||||
model.addAttribute("user", user);
|
||||
model.addAttribute("message", "信息提交失败, 请检查你的个人信息录入是否正确");
|
||||
|
||||
return "error.html";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/success")
|
||||
public String success(Model model) {
|
||||
model.addAttribute("message", "信息提交成功");
|
||||
|
||||
return "success.html";
|
||||
}
|
||||
|
||||
/**
|
||||
* 清洗加班
|
||||
*/
|
||||
@PostMapping("/attendanceStatistical")
|
||||
public AjaxResult attendanceStatistical(String userIds, String date) throws ParseException {
|
||||
Date d = new SimpleDateFormat("yyyy-MM-dd").parse(date);
|
||||
for (SysStaff sysStaff : sysStaffService.list(new LambdaQueryWrapper<SysStaff>().in(SysStaff::getUserId, Collections.asList(userIds.split(","))))){
|
||||
rzAttendanceStatisticalService.createRzAttendance(sysStaff, null, d);
|
||||
rzRestaurantStatisticsService.createRestaurantStatistics(sysStaff, d);
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/qxdk")
|
||||
public AjaxResult qxdk() throws ParseException {
|
||||
// Map<Long, String> snMap = sysStaffService.list(new LambdaQueryWrapper<SysStaff>().eq(SysStaff::getDelFlag, Constants.DELETE_FLAG_0)).stream().filter(data->{ return (data.getUserId() != null && StringUtils.isNotEmpty(data.getTimeClock()));
|
||||
// }).collect(Collectors.toMap(SysStaff::getUserId, SysStaff::getTimeClock));
|
||||
//
|
||||
//
|
||||
// Date d = new SimpleDateFormat("yyyy-MM-dd").parse("2025-07-08");
|
||||
// Map<String, Integer> timeMap = Collections.asMap("上班卡(倒班12时制)",12,"上班卡(单班制)",9,"上班卡(倒班8时制)",9);
|
||||
// List<RzAttendance> list = rzAttendanceService.list(new LambdaQueryWrapper<RzAttendance>()
|
||||
// .eq(RzAttendance::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
// .apply(" date_format(`attendance_date`,'%Y%m%d')=date_format({0},'%Y%m%d') ",d)
|
||||
// .apply(" work_start_time is not null ")
|
||||
// ).stream().map(data ->{
|
||||
// data.setWorkEndTime(DateUtils.addHours(data.getWorkStartTime(), timeMap.get(data.getRules())));
|
||||
// return data;
|
||||
// }).collect(Collectors.toList());
|
||||
//
|
||||
// if(Collections.isNotEmpty(list)){
|
||||
// //更新所有的卡时间
|
||||
// rzAttendanceService.updateBatchById(list);
|
||||
// for (RzAttendance rzAttendance : list){
|
||||
// List<RzAttendanceDetail> sbList = rzAttendanceDetailService.list(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0).eq(RzAttendanceDetail::getAttendanceId, rzAttendance.getId()).like(RzAttendanceDetail::getButtonType,"%上班%"));
|
||||
// if(Collections.isEmpty(sbList)){
|
||||
// rzAttendanceDetailService.addOrUpdateDetail(rzAttendance, rzAttendance.getRules(), snMap.get(rzAttendance.getStaffId()), rzAttendance.getWorkStartTime(), "系统清洗");
|
||||
// }else if(sbList.size() > 1){
|
||||
// sbList.remove(0);
|
||||
// rzAttendanceDetailService.removeByIds(sbList);
|
||||
// }
|
||||
// List<RzAttendanceDetail> xbList = rzAttendanceDetailService.list(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0).eq(RzAttendanceDetail::getAttendanceId, rzAttendance.getId()).like(RzAttendanceDetail::getButtonType,"%下班%"));
|
||||
// if(ObjectUtils.isEmpty(xbList)){
|
||||
// rzAttendanceDetailService.addOrUpdateDetail(rzAttendance, "下班卡", snMap.get(rzAttendance.getStaffId()), rzAttendance.getWorkEndTime(), "系统清洗");
|
||||
// }else if(xbList.size() > 1){
|
||||
// xbList.remove(0);
|
||||
// rzAttendanceDetailService.removeByIds(xbList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// list = rzAttendanceService.list(new LambdaQueryWrapper<RzAttendance>()
|
||||
// .eq(RzAttendance::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
// .apply(" date_format(`attendance_date`,'%Y%m%d')=date_format({0},'%Y%m%d') ",new SimpleDateFormat("yyyy-MM-dd").parse("2025-07-09"))
|
||||
// .apply(" work_start_time is not null ")
|
||||
// );
|
||||
//
|
||||
// if(Collections.isNotEmpty(list)){
|
||||
// //更新所有的卡时间
|
||||
// for (RzAttendance rzAttendance : list){
|
||||
// List<RzAttendanceDetail> sbList = rzAttendanceDetailService.list(new LambdaQueryWrapper<RzAttendanceDetail>().eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0).eq(RzAttendanceDetail::getAttendanceId, rzAttendance.getId()).like(RzAttendanceDetail::getButtonType,"%上班%"));
|
||||
// if(Collections.isEmpty(sbList)){
|
||||
// rzAttendanceDetailService.addOrUpdateDetail(rzAttendance, rzAttendance.getRules(), snMap.get(rzAttendance.getStaffId()), rzAttendance.getWorkStartTime(), "系统清洗");
|
||||
// }else if(sbList.size() > 1){
|
||||
// sbList.remove(0);
|
||||
// rzAttendanceDetailService.removeByIds(sbList);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
private String buildCode(Integer code){
|
||||
if(code < 10){
|
||||
return Constants.SEIZE_A_SEAT_3 + code;
|
||||
}else if(code < 100){
|
||||
return Constants.SEIZE_A_SEAT_2 + code;
|
||||
}else if(code < 1000){
|
||||
return Constants.SEIZE_A_SEAT_1 + code;
|
||||
}else if(code < 10000){
|
||||
return Constants.SEIZE_A_SEAT_0 + code;
|
||||
}else{
|
||||
return String.valueOf(code);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/qxCode")
|
||||
public AjaxResult qxCode() throws ParseException {
|
||||
AtomicReference<Integer> code = new AtomicReference<>(6);
|
||||
List<SysStaff> list = sysStaffService.list(new LambdaQueryWrapper<SysStaff>().notIn(SysStaff::getName, Collections.asList("胡景昌","张敏","胡毅鹏","李雾","尹国峰")).orderByAsc(SysStaff::getEmploymentDate)).stream().map(data ->{
|
||||
data.setCode(buildCode(code.get()));
|
||||
code.set(code.get() +1);
|
||||
return data;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
sysStaffService.updateBatchById(list,list.size());
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/jb")
|
||||
public AjaxResult jb() throws Exception{
|
||||
|
||||
// BufferedReader reader = new BufferedReader(new FileReader(new File("D:\\andy\\文档\\考勤\\7月8号加班数据清洗.txt")));
|
||||
// String line = reader.readLine();
|
||||
// while (line != null) {
|
||||
// String[] info = line.split("-");
|
||||
// RzAttendanceDetail detail = rzAttendanceDetailService.getOne(new LambdaQueryWrapper<RzAttendanceDetail>()
|
||||
// .eq(RzAttendanceDetail::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
// .eq(RzAttendanceDetail::getName, info[0])
|
||||
// .eq(RzAttendanceDetail::getButtonType,"下班卡")
|
||||
// .apply(" DATE_FORMAT(date_time,'%Y%m%d') = DATE_FORMAT({0},'%Y%m%d') ", "2025-07-08"));
|
||||
//
|
||||
// RzAttendance attendance= rzAttendanceService.getOne(new LambdaQueryWrapper<RzAttendance>()
|
||||
// .eq(RzAttendance::getDelFlag, Constants.DELETE_FLAG_0)
|
||||
// .eq(RzAttendance::getName, info[0])
|
||||
// .eq(RzAttendance::getAttendanceDate, "2025-07-08")
|
||||
// );
|
||||
// System.out.println(info[0]);
|
||||
// SysStaff sysStaff = sysStaffService.getById(detail.getStaffId());
|
||||
// RzOverTime rzOverTime = rzOverTimeMapper.selectRzOverTimeByNameAndMonth(sysStaff.getUserId(),detail.getDateTime());
|
||||
// if(rzOverTime == null){
|
||||
// rzOverTime = new RzOverTime();
|
||||
// rzOverTime.setUserId(sysStaff.getUserId());
|
||||
// rzOverTime.setOverHours(new BigDecimal("0.0"));
|
||||
// rzOverTime.setDeptId(sysStaff.getDeptId());
|
||||
// rzOverTime.setName(sysStaff.getName());
|
||||
// rzOverTime.setOverTimeMonth(detail.getDateTime());
|
||||
// rzOverTimeMapper.insert(rzOverTime);
|
||||
// }
|
||||
//
|
||||
// detail = rzAttendanceDetailService.addOrUpdateDetail(attendance, "加班卡", detail.getEquipmentCode(), com.evo.common.utils.DateUtils.addSeconds(detail.getDateTime(), 10), "数据清洗");
|
||||
// RzOverTimeDetail rzOverTimeDetail = new RzOverTimeDetail();
|
||||
// rzOverTimeDetail.setOverTimeId(rzOverTime.getId());
|
||||
// rzOverTimeDetail.setOverTimeStart(detail.getDateTime());
|
||||
// rzOverTimeDetail.setName(sysStaff.getName());
|
||||
// rzOverTimeDetail.setDelFlag(Constants.DELETE_FLAG_0);
|
||||
// rzOverTimeDetail.setCreateBy("admin");
|
||||
// rzOverTimeDetail.setCreateTime(com.evo.common.utils.DateUtils.getNowDate());
|
||||
//
|
||||
// detail = rzAttendanceDetailService.addOrUpdateDetail(attendance, "下班卡", detail.getEquipmentCode(), com.evo.common.utils.DateUtils.addMinutes(detail.getDateTime(), new BigDecimal(info[1]).multiply(new BigDecimal(60)).add(new BigDecimal(30)).intValue()), "数据清洗");
|
||||
// rzOverTimeDetail.setOverTimeEnd(detail.getDateTime());
|
||||
// rzOverTimeDetailMapper.insert(rzOverTimeDetail);
|
||||
// KqUtils.calculateOverTimeHours(rzOverTimeDetail, sysStaff.getUserId(), sysStaff.getTimeClock());
|
||||
// rzOverTimeDetailMapper.updateRzOverTimeDetail(rzOverTimeDetail);
|
||||
// //加班修改统计
|
||||
// rzOverTime.setOverHours(rzOverTime.getOverHours().add(rzOverTimeDetail.getOverTimeHours()));
|
||||
// rzOverTimeMapper.updateRzOverTime(rzOverTime);
|
||||
// line = reader.readLine();
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
BufferedReader reader = new BufferedReader(new FileReader(new File("D:\\andy\\文档\\考勤\\岗位任职部门信息.txt")));
|
||||
String line = reader.readLine();
|
||||
while (line != null) {
|
||||
String[] configData = line.split("_");
|
||||
System.out.println("update sys_dict_data set dict_value='"+line+"' where dict_value='"+configData[0]+"';\n");
|
||||
line = reader.readLine();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,51 +0,0 @@
|
||||
package com.evo.common.controller;
|
||||
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:TestWebController
|
||||
* @date: 2025年08月30日 11:10
|
||||
* @author: andy.shi
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/test/web")
|
||||
public class TestWebController {
|
||||
|
||||
|
||||
@GetMapping("/message")
|
||||
public String message(Model model, String code) {
|
||||
System.out.println(code);
|
||||
SysStaff user = new SysStaff();
|
||||
user.setOpenid(code);
|
||||
model.addAttribute("user", user);
|
||||
return "user_info.html";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/error")
|
||||
public String error(Model model) {
|
||||
SysStaff user = new SysStaff();
|
||||
user.setName("张三");
|
||||
user.setIdCard("130132197019183237");
|
||||
user.setOpenid("123456");
|
||||
model.addAttribute("user", user);
|
||||
model.addAttribute("message", "信息提交失败, 请检查你的个人信息录入是否正确");
|
||||
|
||||
return "error.html";
|
||||
}
|
||||
|
||||
@GetMapping("/success")
|
||||
public String success(Model model) {
|
||||
model.addAttribute("message", "信息提交成功");
|
||||
|
||||
return "success.html";
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,202 +0,0 @@
|
||||
package com.evo.common.core.controller;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.annotation.InitBinder;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.evo.common.constant.HttpStatus;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.model.LoginUser;
|
||||
import com.evo.common.core.page.PageDomain;
|
||||
import com.evo.common.core.page.TableDataInfo;
|
||||
import com.evo.common.core.page.TableSupport;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.PageUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.common.utils.sql.SqlUtil;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class BaseController
|
||||
{
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
* 将前台传递过来的日期格式的字符串,自动转化为Date类型
|
||||
*/
|
||||
@InitBinder
|
||||
public void initBinder(WebDataBinder binder)
|
||||
{
|
||||
// Date 类型转换
|
||||
binder.registerCustomEditor(Date.class, new PropertyEditorSupport()
|
||||
{
|
||||
@Override
|
||||
public void setAsText(String text)
|
||||
{
|
||||
setValue(DateUtils.parseDate(text));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求分页数据
|
||||
*/
|
||||
protected void startPage()
|
||||
{
|
||||
PageUtils.startPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求排序数据
|
||||
*/
|
||||
protected void startOrderBy()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
if (StringUtils.isNotEmpty(pageDomain.getOrderBy()))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
PageHelper.orderBy(orderBy);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理分页的线程变量
|
||||
*/
|
||||
protected void clearPage()
|
||||
{
|
||||
PageUtils.clearPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应请求分页数据
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected TableDataInfo getDataTable(List<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
public AjaxResult success()
|
||||
{
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败消息
|
||||
*/
|
||||
public AjaxResult error()
|
||||
{
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*/
|
||||
public AjaxResult success(String message)
|
||||
{
|
||||
return AjaxResult.success(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*/
|
||||
public AjaxResult success(Object data)
|
||||
{
|
||||
return AjaxResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败消息
|
||||
*/
|
||||
public AjaxResult error(String message)
|
||||
{
|
||||
return AjaxResult.error(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回警告消息
|
||||
*/
|
||||
public AjaxResult warn(String message)
|
||||
{
|
||||
return AjaxResult.warn(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
* @param rows 影响行数
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(int rows)
|
||||
{
|
||||
return rows > 0 ? AjaxResult.success() : AjaxResult.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应返回结果
|
||||
*
|
||||
* @param result 结果
|
||||
* @return 操作结果
|
||||
*/
|
||||
protected AjaxResult toAjax(boolean result)
|
||||
{
|
||||
return result ? success() : error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面跳转
|
||||
*/
|
||||
public String redirect(String url)
|
||||
{
|
||||
return StringUtils.format("redirect:{}", url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户缓存信息
|
||||
*/
|
||||
public LoginUser getLoginUser()
|
||||
{
|
||||
return SecurityUtils.getLoginUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户id
|
||||
*/
|
||||
public Long getUserId()
|
||||
{
|
||||
return getLoginUser().getUserId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录部门id
|
||||
*/
|
||||
public Long getDeptId()
|
||||
{
|
||||
return getLoginUser().getDeptId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录用户名
|
||||
*/
|
||||
public String getUsername()
|
||||
{
|
||||
return getLoginUser().getUsername();
|
||||
}
|
||||
}
|
||||
@ -1,216 +0,0 @@
|
||||
package com.evo.common.core.domain;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import com.evo.common.constant.HttpStatus;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 操作消息提醒
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class AjaxResult extends HashMap<String, Object>
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 状态码 */
|
||||
public static final String CODE_TAG = "code";
|
||||
|
||||
/** 返回内容 */
|
||||
public static final String MSG_TAG = "msg";
|
||||
|
||||
/** 数据对象 */
|
||||
public static final String DATA_TAG = "data";
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||
*/
|
||||
public AjaxResult()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回内容
|
||||
*/
|
||||
public AjaxResult(int code, String msg)
|
||||
{
|
||||
super.put(CODE_TAG, code);
|
||||
super.put(MSG_TAG, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
*/
|
||||
public AjaxResult(int code, String msg, Object data)
|
||||
{
|
||||
super.put(CODE_TAG, code);
|
||||
super.put(MSG_TAG, msg);
|
||||
if (StringUtils.isNotNull(data))
|
||||
{
|
||||
super.put(DATA_TAG, data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success()
|
||||
{
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功数据
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(Object data)
|
||||
{
|
||||
return AjaxResult.success("操作成功", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(String msg)
|
||||
{
|
||||
return AjaxResult.success(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回警告消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult warn(String msg)
|
||||
{
|
||||
return AjaxResult.warn(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回警告消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult warn(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.WARN, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error()
|
||||
{
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error(String msg)
|
||||
{
|
||||
return AjaxResult.error(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.ERROR, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回内容
|
||||
* @return 错误消息
|
||||
*/
|
||||
public static AjaxResult error(int code, String msg)
|
||||
{
|
||||
return new AjaxResult(code, msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为成功消息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isSuccess()
|
||||
{
|
||||
return Objects.equals(HttpStatus.SUCCESS, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为警告消息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isWarn()
|
||||
{
|
||||
return Objects.equals(HttpStatus.WARN, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为错误消息
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean isError()
|
||||
{
|
||||
return Objects.equals(HttpStatus.ERROR, this.get(CODE_TAG));
|
||||
}
|
||||
|
||||
/**
|
||||
* 方便链式调用
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值
|
||||
* @return 数据对象
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult put(String key, Object value)
|
||||
{
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@ -1,140 +0,0 @@
|
||||
package com.evo.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.evo.common.utils.Collections;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class BaseEntity implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 搜索值 */
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@TableField(exist = false)
|
||||
private String remark;
|
||||
|
||||
/** 请求参数 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> extendeds;
|
||||
|
||||
public String getSearchValue()
|
||||
{
|
||||
return searchValue;
|
||||
}
|
||||
|
||||
public void setSearchValue(String searchValue)
|
||||
{
|
||||
this.searchValue = searchValue;
|
||||
}
|
||||
|
||||
public String getCreateBy()
|
||||
{
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy)
|
||||
{
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy()
|
||||
{
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy)
|
||||
{
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public Map<String, Object> getParams()
|
||||
{
|
||||
if (params == null)
|
||||
{
|
||||
params = new HashMap<>();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public Map<String, Object> getExtendeds() {
|
||||
if (extendeds == null)
|
||||
{
|
||||
extendeds = Collections.emptyMap();
|
||||
}
|
||||
return extendeds;
|
||||
}
|
||||
|
||||
public void setParams(Map<String, Object> params)
|
||||
{
|
||||
this.params = params;
|
||||
}
|
||||
}
|
||||
@ -1,115 +0,0 @@
|
||||
package com.evo.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.evo.common.constant.HttpStatus;
|
||||
|
||||
/**
|
||||
* 响应信息主体
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class R<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 成功 */
|
||||
public static final int SUCCESS = HttpStatus.SUCCESS;
|
||||
|
||||
/** 失败 */
|
||||
public static final int FAIL = HttpStatus.ERROR;
|
||||
|
||||
private int code;
|
||||
|
||||
private String msg;
|
||||
|
||||
private T data;
|
||||
|
||||
public static <T> R<T> ok()
|
||||
{
|
||||
return restResult(null, SUCCESS, "操作成功");
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(T data)
|
||||
{
|
||||
return restResult(data, SUCCESS, "操作成功");
|
||||
}
|
||||
|
||||
public static <T> R<T> ok(T data, String msg)
|
||||
{
|
||||
return restResult(data, SUCCESS, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail()
|
||||
{
|
||||
return restResult(null, FAIL, "操作失败");
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(String msg)
|
||||
{
|
||||
return restResult(null, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data)
|
||||
{
|
||||
return restResult(data, FAIL, "操作失败");
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(T data, String msg)
|
||||
{
|
||||
return restResult(data, FAIL, msg);
|
||||
}
|
||||
|
||||
public static <T> R<T> fail(int code, String msg)
|
||||
{
|
||||
return restResult(null, code, msg);
|
||||
}
|
||||
|
||||
private static <T> R<T> restResult(T data, int code, String msg)
|
||||
{
|
||||
R<T> apiResult = new R<>();
|
||||
apiResult.setCode(code);
|
||||
apiResult.setData(data);
|
||||
apiResult.setMsg(msg);
|
||||
return apiResult;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg()
|
||||
{
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg)
|
||||
{
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static <T> Boolean isError(R<T> ret)
|
||||
{
|
||||
return !isSuccess(ret);
|
||||
}
|
||||
|
||||
public static <T> Boolean isSuccess(R<T> ret)
|
||||
{
|
||||
return R.SUCCESS == ret.getCode();
|
||||
}
|
||||
}
|
||||
@ -1,79 +0,0 @@
|
||||
package com.evo.common.core.domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Tree基类
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class TreeEntity extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 父菜单名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 父菜单ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 子部门 */
|
||||
private List<?> children = new ArrayList<>();
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
public String getAncestors()
|
||||
{
|
||||
return ancestors;
|
||||
}
|
||||
|
||||
public void setAncestors(String ancestors)
|
||||
{
|
||||
this.ancestors = ancestors;
|
||||
}
|
||||
|
||||
public List<?> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<?> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
@ -1,77 +0,0 @@
|
||||
package com.evo.common.core.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
import com.evo.common.core.domain.entity.SysMenu;
|
||||
|
||||
/**
|
||||
* Treeselect树结构实体类
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class TreeSelect implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 节点ID */
|
||||
private Long id;
|
||||
|
||||
/** 节点名称 */
|
||||
private String label;
|
||||
|
||||
/** 子节点 */
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
private List<TreeSelect> children;
|
||||
|
||||
public TreeSelect()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TreeSelect(SysDept dept)
|
||||
{
|
||||
this.id = dept.getDeptId();
|
||||
this.label = dept.getDeptName();
|
||||
this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public TreeSelect(SysMenu menu)
|
||||
{
|
||||
this.id = menu.getMenuId();
|
||||
this.label = menu.getMenuName();
|
||||
this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public List<TreeSelect> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<TreeSelect> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 类
|
||||
*
|
||||
* @ClassName:RzUpload
|
||||
* @date: 2025年05月20日 15:35
|
||||
* @author: andy.shi
|
||||
* @contact: 17330188597
|
||||
* @remark: 开发人员联系方式 1042025947@qq.com/微信同步
|
||||
*/
|
||||
@Data
|
||||
public class RzUpload implements Serializable {
|
||||
|
||||
/***
|
||||
* id
|
||||
*/
|
||||
Long id;
|
||||
|
||||
/***
|
||||
* 类型
|
||||
*/
|
||||
String type;
|
||||
/***
|
||||
* 业务Id
|
||||
*/
|
||||
Long businessId;
|
||||
/***
|
||||
* 文件绝对路径
|
||||
*/
|
||||
String url;
|
||||
|
||||
/***
|
||||
* 文件相对路径
|
||||
*/
|
||||
String fileName;
|
||||
/***
|
||||
* 上传文件名称
|
||||
*/
|
||||
String newFileName;
|
||||
|
||||
/***
|
||||
* 文件原始名称
|
||||
*/
|
||||
String originalFileName;
|
||||
|
||||
/** 上传时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date uploadTime;
|
||||
|
||||
/***
|
||||
* 上传ip
|
||||
*/
|
||||
String uploadIp;
|
||||
/***
|
||||
* 标识
|
||||
* 有效: valid
|
||||
* 无效: Invalid
|
||||
*/
|
||||
String valid="valid";
|
||||
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
@Data
|
||||
public class SysDept extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 部门ID */
|
||||
@TableId(value = "dept_id", type = IdType.AUTO)
|
||||
private Long deptId;
|
||||
|
||||
/** 父部门ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 祖级列表 */
|
||||
private String ancestors;
|
||||
|
||||
/** 部门名称 */
|
||||
private String deptName;
|
||||
|
||||
/** 负责人 */
|
||||
private String leader;
|
||||
|
||||
/** 联系电话 */
|
||||
private String phone;
|
||||
|
||||
/** 部门状态:0正常,1停用 */
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 父部门名称 */
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
|
||||
/** 是否加班 */
|
||||
private String isOverTime;
|
||||
|
||||
/** 子部门 */
|
||||
@TableField(exist = false)
|
||||
private List<SysDept> children = new ArrayList<SysDept>();
|
||||
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "部门名称长度不能超过30个字符")
|
||||
public String getDeptName()
|
||||
{
|
||||
return deptName;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
|
||||
public String getPhone()
|
||||
{
|
||||
return phone;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -1,176 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.annotation.Excel.ColumnType;
|
||||
import com.evo.common.constant.UserConstants;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class SysDictData extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典编码 */
|
||||
@Excel(name = "字典编码", cellType = ColumnType.NUMERIC)
|
||||
private Long dictCode;
|
||||
|
||||
/** 字典排序 */
|
||||
@Excel(name = "字典排序", cellType = ColumnType.NUMERIC)
|
||||
private Long dictSort;
|
||||
|
||||
/** 字典标签 */
|
||||
@Excel(name = "字典标签")
|
||||
private String dictLabel;
|
||||
|
||||
/** 字典键值 */
|
||||
@Excel(name = "字典键值")
|
||||
private String dictValue;
|
||||
|
||||
/** 字典类型 */
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 样式属性(其他样式扩展) */
|
||||
private String cssClass;
|
||||
|
||||
/** 表格字典样式 */
|
||||
private String listClass;
|
||||
|
||||
/** 是否默认(Y是 N否) */
|
||||
@Excel(name = "是否默认", readConverterExp = "Y=是,N=否")
|
||||
private String isDefault;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public Long getDictCode()
|
||||
{
|
||||
return dictCode;
|
||||
}
|
||||
|
||||
public void setDictCode(Long dictCode)
|
||||
{
|
||||
this.dictCode = dictCode;
|
||||
}
|
||||
|
||||
public Long getDictSort()
|
||||
{
|
||||
return dictSort;
|
||||
}
|
||||
|
||||
public void setDictSort(Long dictSort)
|
||||
{
|
||||
this.dictSort = dictSort;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典标签不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典标签长度不能超过100个字符")
|
||||
public String getDictLabel()
|
||||
{
|
||||
return dictLabel;
|
||||
}
|
||||
|
||||
public void setDictLabel(String dictLabel)
|
||||
{
|
||||
this.dictLabel = dictLabel;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||
public String getDictValue()
|
||||
{
|
||||
return dictValue;
|
||||
}
|
||||
|
||||
public void setDictValue(String dictValue)
|
||||
{
|
||||
this.dictValue = dictValue;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型长度不能超过100个字符")
|
||||
public String getDictType()
|
||||
{
|
||||
return dictType;
|
||||
}
|
||||
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 100, message = "样式属性长度不能超过100个字符")
|
||||
public String getCssClass()
|
||||
{
|
||||
return cssClass;
|
||||
}
|
||||
|
||||
public void setCssClass(String cssClass)
|
||||
{
|
||||
this.cssClass = cssClass;
|
||||
}
|
||||
|
||||
public String getListClass()
|
||||
{
|
||||
return listClass;
|
||||
}
|
||||
|
||||
public void setListClass(String listClass)
|
||||
{
|
||||
this.listClass = listClass;
|
||||
}
|
||||
|
||||
public boolean getDefault()
|
||||
{
|
||||
return UserConstants.YES.equals(this.isDefault);
|
||||
}
|
||||
|
||||
public String getIsDefault()
|
||||
{
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public void setIsDefault(String isDefault)
|
||||
{
|
||||
this.isDefault = isDefault;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictCode", getDictCode())
|
||||
.append("dictSort", getDictSort())
|
||||
.append("dictLabel", getDictLabel())
|
||||
.append("dictValue", getDictValue())
|
||||
.append("dictType", getDictType())
|
||||
.append("cssClass", getCssClass())
|
||||
.append("listClass", getListClass())
|
||||
.append("isDefault", getIsDefault())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.annotation.Excel.ColumnType;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 字典类型表 sys_dict_type
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class SysDictType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 字典主键 */
|
||||
@Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
|
||||
private Long dictId;
|
||||
|
||||
/** 字典名称 */
|
||||
@Excel(name = "字典名称")
|
||||
private String dictName;
|
||||
|
||||
/** 字典类型 */
|
||||
@Excel(name = "字典类型")
|
||||
private String dictType;
|
||||
|
||||
/** 状态(0正常 1停用) */
|
||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
public Long getDictId()
|
||||
{
|
||||
return dictId;
|
||||
}
|
||||
|
||||
public void setDictId(Long dictId)
|
||||
{
|
||||
this.dictId = dictId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
|
||||
public String getDictName()
|
||||
{
|
||||
return dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName)
|
||||
{
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典类型不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
|
||||
public String getDictType()
|
||||
{
|
||||
return dictType;
|
||||
}
|
||||
|
||||
public void setDictType(String dictType)
|
||||
{
|
||||
this.dictType = dictType;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictId", getDictId())
|
||||
.append("dictName", getDictName())
|
||||
.append("dictType", getDictType())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,274 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 菜单权限表 sys_menu
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class SysMenu extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 菜单ID */
|
||||
private Long menuId;
|
||||
|
||||
/** 菜单名称 */
|
||||
private String menuName;
|
||||
|
||||
/** 父菜单名称 */
|
||||
private String parentName;
|
||||
|
||||
/** 父菜单ID */
|
||||
private Long parentId;
|
||||
|
||||
/** 显示顺序 */
|
||||
private Integer orderNum;
|
||||
|
||||
/** 路由地址 */
|
||||
private String path;
|
||||
|
||||
/** 组件路径 */
|
||||
private String component;
|
||||
|
||||
/** 路由参数 */
|
||||
private String query;
|
||||
|
||||
/** 路由名称,默认和路由地址相同的驼峰格式(注意:因为vue3版本的router会删除名称相同路由,为避免名字的冲突,特殊情况可以自定义) */
|
||||
private String routeName;
|
||||
|
||||
/** 是否为外链(0是 1否) */
|
||||
private String isFrame;
|
||||
|
||||
/** 是否缓存(0缓存 1不缓存) */
|
||||
private String isCache;
|
||||
|
||||
/** 类型(M目录 C菜单 F按钮) */
|
||||
private String menuType;
|
||||
|
||||
/** 显示状态(0显示 1隐藏) */
|
||||
private String visible;
|
||||
|
||||
/** 菜单状态(0正常 1停用) */
|
||||
private String status;
|
||||
|
||||
/** 权限字符串 */
|
||||
private String perms;
|
||||
|
||||
/** 菜单图标 */
|
||||
private String icon;
|
||||
|
||||
/** 子菜单 */
|
||||
private List<SysMenu> children = new ArrayList<SysMenu>();
|
||||
|
||||
public Long getMenuId()
|
||||
{
|
||||
return menuId;
|
||||
}
|
||||
|
||||
public void setMenuId(Long menuId)
|
||||
{
|
||||
this.menuId = menuId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
@Size(min = 0, max = 50, message = "菜单名称长度不能超过50个字符")
|
||||
public String getMenuName()
|
||||
{
|
||||
return menuName;
|
||||
}
|
||||
|
||||
public void setMenuName(String menuName)
|
||||
{
|
||||
this.menuName = menuName;
|
||||
}
|
||||
|
||||
public String getParentName()
|
||||
{
|
||||
return parentName;
|
||||
}
|
||||
|
||||
public void setParentName(String parentName)
|
||||
{
|
||||
this.parentName = parentName;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getOrderNum()
|
||||
{
|
||||
return orderNum;
|
||||
}
|
||||
|
||||
public void setOrderNum(Integer orderNum)
|
||||
{
|
||||
this.orderNum = orderNum;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 200, message = "路由地址不能超过200个字符")
|
||||
public String getPath()
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path)
|
||||
{
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 200, message = "组件路径不能超过255个字符")
|
||||
public String getComponent()
|
||||
{
|
||||
return component;
|
||||
}
|
||||
|
||||
public void setComponent(String component)
|
||||
{
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public String getQuery()
|
||||
{
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query)
|
||||
{
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public String getRouteName()
|
||||
{
|
||||
return routeName;
|
||||
}
|
||||
|
||||
public void setRouteName(String routeName)
|
||||
{
|
||||
this.routeName = routeName;
|
||||
}
|
||||
|
||||
public String getIsFrame()
|
||||
{
|
||||
return isFrame;
|
||||
}
|
||||
|
||||
public void setIsFrame(String isFrame)
|
||||
{
|
||||
this.isFrame = isFrame;
|
||||
}
|
||||
|
||||
public String getIsCache()
|
||||
{
|
||||
return isCache;
|
||||
}
|
||||
|
||||
public void setIsCache(String isCache)
|
||||
{
|
||||
this.isCache = isCache;
|
||||
}
|
||||
|
||||
@NotBlank(message = "菜单类型不能为空")
|
||||
public String getMenuType()
|
||||
{
|
||||
return menuType;
|
||||
}
|
||||
|
||||
public void setMenuType(String menuType)
|
||||
{
|
||||
this.menuType = menuType;
|
||||
}
|
||||
|
||||
public String getVisible()
|
||||
{
|
||||
return visible;
|
||||
}
|
||||
|
||||
public void setVisible(String visible)
|
||||
{
|
||||
this.visible = visible;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 100, message = "权限标识长度不能超过100个字符")
|
||||
public String getPerms()
|
||||
{
|
||||
return perms;
|
||||
}
|
||||
|
||||
public void setPerms(String perms)
|
||||
{
|
||||
this.perms = perms;
|
||||
}
|
||||
|
||||
public String getIcon()
|
||||
{
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(String icon)
|
||||
{
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public List<SysMenu> getChildren()
|
||||
{
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<SysMenu> children)
|
||||
{
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("menuId", getMenuId())
|
||||
.append("menuName", getMenuName())
|
||||
.append("parentId", getParentId())
|
||||
.append("orderNum", getOrderNum())
|
||||
.append("path", getPath())
|
||||
.append("component", getComponent())
|
||||
.append("query", getQuery())
|
||||
.append("routeName", getRouteName())
|
||||
.append("isFrame", getIsFrame())
|
||||
.append("IsCache", getIsCache())
|
||||
.append("menuType", getMenuType())
|
||||
.append("visible", getVisible())
|
||||
.append("status ", getStatus())
|
||||
.append("perms", getPerms())
|
||||
.append("icon", getIcon())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,241 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.annotation.Excel.ColumnType;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 角色表 sys_role
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class SysRole extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 角色ID */
|
||||
@Excel(name = "角色序号", cellType = ColumnType.NUMERIC)
|
||||
private Long roleId;
|
||||
|
||||
/** 角色名称 */
|
||||
@Excel(name = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
/** 角色权限 */
|
||||
@Excel(name = "角色权限")
|
||||
private String roleKey;
|
||||
|
||||
/** 角色排序 */
|
||||
@Excel(name = "角色排序")
|
||||
private Integer roleSort;
|
||||
|
||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
|
||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||
private String dataScope;
|
||||
|
||||
/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
|
||||
private boolean menuCheckStrictly;
|
||||
|
||||
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||
private boolean deptCheckStrictly;
|
||||
|
||||
/** 角色状态(0正常 1停用) */
|
||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 用户是否存在此角色标识 默认不存在 */
|
||||
private boolean flag = false;
|
||||
|
||||
/** 菜单组 */
|
||||
private Long[] menuIds;
|
||||
|
||||
/** 部门组(数据权限) */
|
||||
private Long[] deptIds;
|
||||
|
||||
/** 角色菜单权限 */
|
||||
private Set<String> permissions;
|
||||
|
||||
public SysRole()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SysRole(Long roleId)
|
||||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
return isAdmin(this.roleId);
|
||||
}
|
||||
|
||||
public static boolean isAdmin(Long roleId)
|
||||
{
|
||||
return roleId != null && 1L == roleId;
|
||||
}
|
||||
|
||||
@NotBlank(message = "角色名称不能为空")
|
||||
@Size(min = 0, max = 30, message = "角色名称长度不能超过30个字符")
|
||||
public String getRoleName()
|
||||
{
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName)
|
||||
{
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
@NotBlank(message = "权限字符不能为空")
|
||||
@Size(min = 0, max = 100, message = "权限字符长度不能超过100个字符")
|
||||
public String getRoleKey()
|
||||
{
|
||||
return roleKey;
|
||||
}
|
||||
|
||||
public void setRoleKey(String roleKey)
|
||||
{
|
||||
this.roleKey = roleKey;
|
||||
}
|
||||
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
public Integer getRoleSort()
|
||||
{
|
||||
return roleSort;
|
||||
}
|
||||
|
||||
public void setRoleSort(Integer roleSort)
|
||||
{
|
||||
this.roleSort = roleSort;
|
||||
}
|
||||
|
||||
public String getDataScope()
|
||||
{
|
||||
return dataScope;
|
||||
}
|
||||
|
||||
public void setDataScope(String dataScope)
|
||||
{
|
||||
this.dataScope = dataScope;
|
||||
}
|
||||
|
||||
public boolean isMenuCheckStrictly()
|
||||
{
|
||||
return menuCheckStrictly;
|
||||
}
|
||||
|
||||
public void setMenuCheckStrictly(boolean menuCheckStrictly)
|
||||
{
|
||||
this.menuCheckStrictly = menuCheckStrictly;
|
||||
}
|
||||
|
||||
public boolean isDeptCheckStrictly()
|
||||
{
|
||||
return deptCheckStrictly;
|
||||
}
|
||||
|
||||
public void setDeptCheckStrictly(boolean deptCheckStrictly)
|
||||
{
|
||||
this.deptCheckStrictly = deptCheckStrictly;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public boolean isFlag()
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void setFlag(boolean flag)
|
||||
{
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public Long[] getMenuIds()
|
||||
{
|
||||
return menuIds;
|
||||
}
|
||||
|
||||
public void setMenuIds(Long[] menuIds)
|
||||
{
|
||||
this.menuIds = menuIds;
|
||||
}
|
||||
|
||||
public Long[] getDeptIds()
|
||||
{
|
||||
return deptIds;
|
||||
}
|
||||
|
||||
public void setDeptIds(Long[] deptIds)
|
||||
{
|
||||
this.deptIds = deptIds;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions)
|
||||
{
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("roleId", getRoleId())
|
||||
.append("roleName", getRoleName())
|
||||
.append("roleKey", getRoleKey())
|
||||
.append("roleSort", getRoleSort())
|
||||
.append("dataScope", getDataScope())
|
||||
.append("menuCheckStrictly", isMenuCheckStrictly())
|
||||
.append("deptCheckStrictly", isDeptCheckStrictly())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,311 +0,0 @@
|
||||
package com.evo.common.core.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.validation.constraints.*;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.evo.common.annotation.Excel;
|
||||
import com.evo.common.annotation.Excel.ColumnType;
|
||||
import com.evo.common.annotation.Excel.Type;
|
||||
import com.evo.common.annotation.Excels;
|
||||
import com.evo.common.core.domain.BaseEntity;
|
||||
import com.evo.common.xss.Xss;
|
||||
|
||||
/**
|
||||
* 用户对象 sys_user
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class SysUser extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
/** 部门ID */
|
||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||
private Long deptId;
|
||||
|
||||
/** 用户账号 */
|
||||
@Excel(name = "登录名称")
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
@Excel(name = "用户名称")
|
||||
private String nickName;
|
||||
|
||||
/** 用户邮箱 */
|
||||
@Excel(name = "用户邮箱")
|
||||
private String email;
|
||||
|
||||
/** 手机号码 */
|
||||
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
||||
private String phonenumber;
|
||||
|
||||
/** 用户性别 */
|
||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||
private String sex;
|
||||
|
||||
/** 用户头像 */
|
||||
private String avatar;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 帐号状态(0正常 1停用) */
|
||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/** 最后登录IP */
|
||||
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||
private String loginIp;
|
||||
|
||||
/** 最后登录时间 */
|
||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||
private Date loginDate;
|
||||
|
||||
/** 部门对象 */
|
||||
@Excels({
|
||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||
})
|
||||
private SysDept dept;
|
||||
|
||||
/** 角色对象 */
|
||||
private List<SysRole> roles;
|
||||
|
||||
/** 角色组 */
|
||||
private Long[] roleIds;
|
||||
|
||||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SysUser(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public boolean isAdmin()
|
||||
{
|
||||
return isAdmin(this.userId);
|
||||
}
|
||||
|
||||
public static boolean isAdmin(Long userId)
|
||||
{
|
||||
return userId != null && 1L == userId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Xss(message = "用户昵称不能包含脚本字符")
|
||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
public String getNickName()
|
||||
{
|
||||
return nickName;
|
||||
}
|
||||
|
||||
public void setNickName(String nickName)
|
||||
{
|
||||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
public String getUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName)
|
||||
{
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
@Email(message = "邮箱格式不正确")
|
||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||
public String getEmail()
|
||||
{
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email)
|
||||
{
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
public String getPhonenumber()
|
||||
{
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getAvatar()
|
||||
{
|
||||
return avatar;
|
||||
}
|
||||
|
||||
public void setAvatar(String avatar)
|
||||
{
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
public void setDelFlag(String delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getLoginIp()
|
||||
{
|
||||
return loginIp;
|
||||
}
|
||||
|
||||
public void setLoginIp(String loginIp)
|
||||
{
|
||||
this.loginIp = loginIp;
|
||||
}
|
||||
|
||||
public Date getLoginDate()
|
||||
{
|
||||
return loginDate;
|
||||
}
|
||||
|
||||
public void setLoginDate(Date loginDate)
|
||||
{
|
||||
this.loginDate = loginDate;
|
||||
}
|
||||
|
||||
public SysDept getDept()
|
||||
{
|
||||
return dept;
|
||||
}
|
||||
|
||||
public void setDept(SysDept dept)
|
||||
{
|
||||
this.dept = dept;
|
||||
}
|
||||
|
||||
public List<SysRole> getRoles()
|
||||
{
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<SysRole> roles)
|
||||
{
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public Long[] getRoleIds()
|
||||
{
|
||||
return roleIds;
|
||||
}
|
||||
|
||||
public void setRoleIds(Long[] roleIds)
|
||||
{
|
||||
this.roleIds = roleIds;
|
||||
}
|
||||
|
||||
public Long getRoleId()
|
||||
{
|
||||
return roleId;
|
||||
}
|
||||
|
||||
public void setRoleId(Long roleId)
|
||||
{
|
||||
this.roleId = roleId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("userId", getUserId())
|
||||
.append("deptId", getDeptId())
|
||||
.append("userName", getUserName())
|
||||
.append("nickName", getNickName())
|
||||
.append("email", getEmail())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("avatar", getAvatar())
|
||||
.append("password", getPassword())
|
||||
.append("status", getStatus())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("loginIp", getLoginIp())
|
||||
.append("loginDate", getLoginDate())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("dept", getDept())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.evo.common.core.domain.model;
|
||||
|
||||
/**
|
||||
* 用户登录对象
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class LoginBody
|
||||
{
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 验证码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 唯一标识
|
||||
*/
|
||||
private String uuid;
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username)
|
||||
{
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password)
|
||||
{
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getUuid()
|
||||
{
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
}
|
||||
}
|
||||
@ -1,266 +0,0 @@
|
||||
package com.evo.common.core.domain.model;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.evo.common.core.domain.entity.SysUser;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 登录用户身份权限
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class LoginUser implements UserDetails
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户唯一标识
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 登录时间
|
||||
*/
|
||||
private Long loginTime;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private Long expireTime;
|
||||
|
||||
/**
|
||||
* 登录IP地址
|
||||
*/
|
||||
private String ipaddr;
|
||||
|
||||
/**
|
||||
* 登录地点
|
||||
*/
|
||||
private String loginLocation;
|
||||
|
||||
/**
|
||||
* 浏览器类型
|
||||
*/
|
||||
private String browser;
|
||||
|
||||
/**
|
||||
* 操作系统
|
||||
*/
|
||||
private String os;
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
*/
|
||||
private Set<String> permissions;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
private SysUser user;
|
||||
|
||||
public LoginUser()
|
||||
{
|
||||
}
|
||||
|
||||
public LoginUser(SysUser user, Set<String> permissions)
|
||||
{
|
||||
this.user = user;
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public LoginUser(Long userId, Long deptId, SysUser user, Set<String> permissions)
|
||||
{
|
||||
this.userId = userId;
|
||||
this.deptId = deptId;
|
||||
this.user = user;
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getDeptId()
|
||||
{
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId)
|
||||
{
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public String getToken()
|
||||
{
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token)
|
||||
{
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public String getPassword()
|
||||
{
|
||||
return user.getPassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername()
|
||||
{
|
||||
return user.getUserName();
|
||||
}
|
||||
|
||||
/**
|
||||
* 账户是否未过期,过期无法验证
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public boolean isAccountNonExpired()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定用户是否解锁,锁定的用户无法进行身份验证
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public boolean isAccountNonLocked()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指示是否已过期的用户的凭据(密码),过期的凭据防止认证
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可用 ,禁用的用户不能身份验证
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public boolean isEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public Long getLoginTime()
|
||||
{
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
public void setLoginTime(Long loginTime)
|
||||
{
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
public String getIpaddr()
|
||||
{
|
||||
return ipaddr;
|
||||
}
|
||||
|
||||
public void setIpaddr(String ipaddr)
|
||||
{
|
||||
this.ipaddr = ipaddr;
|
||||
}
|
||||
|
||||
public String getLoginLocation()
|
||||
{
|
||||
return loginLocation;
|
||||
}
|
||||
|
||||
public void setLoginLocation(String loginLocation)
|
||||
{
|
||||
this.loginLocation = loginLocation;
|
||||
}
|
||||
|
||||
public String getBrowser()
|
||||
{
|
||||
return browser;
|
||||
}
|
||||
|
||||
public void setBrowser(String browser)
|
||||
{
|
||||
this.browser = browser;
|
||||
}
|
||||
|
||||
public String getOs()
|
||||
{
|
||||
return os;
|
||||
}
|
||||
|
||||
public void setOs(String os)
|
||||
{
|
||||
this.os = os;
|
||||
}
|
||||
|
||||
public Long getExpireTime()
|
||||
{
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(Long expireTime)
|
||||
{
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public Set<String> getPermissions()
|
||||
{
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(Set<String> permissions)
|
||||
{
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public SysUser getUser()
|
||||
{
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(SysUser user)
|
||||
{
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
package com.evo.common.core.domain.model;
|
||||
|
||||
/**
|
||||
* 用户注册对象
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class RegisterBody extends LoginBody
|
||||
{
|
||||
|
||||
}
|
||||
@ -1,101 +0,0 @@
|
||||
package com.evo.common.core.page;
|
||||
|
||||
import com.evo.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class PageDomain
|
||||
{
|
||||
/** 当前记录起始索引 */
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页显示记录数 */
|
||||
private Integer pageSize;
|
||||
|
||||
/** 排序列 */
|
||||
private String orderByColumn;
|
||||
|
||||
/** 排序的方向desc或者asc */
|
||||
private String isAsc = "asc";
|
||||
|
||||
/** 分页参数合理化 */
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy()
|
||||
{
|
||||
if (StringUtils.isEmpty(orderByColumn))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||
}
|
||||
|
||||
public Integer getPageNum()
|
||||
{
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum)
|
||||
{
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize()
|
||||
{
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize)
|
||||
{
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getOrderByColumn()
|
||||
{
|
||||
return orderByColumn;
|
||||
}
|
||||
|
||||
public void setOrderByColumn(String orderByColumn)
|
||||
{
|
||||
this.orderByColumn = orderByColumn;
|
||||
}
|
||||
|
||||
public String getIsAsc()
|
||||
{
|
||||
return isAsc;
|
||||
}
|
||||
|
||||
public void setIsAsc(String isAsc)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(isAsc))
|
||||
{
|
||||
// 兼容前端排序类型
|
||||
if ("ascending".equals(isAsc))
|
||||
{
|
||||
isAsc = "asc";
|
||||
}
|
||||
else if ("descending".equals(isAsc))
|
||||
{
|
||||
isAsc = "desc";
|
||||
}
|
||||
this.isAsc = isAsc;
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean getReasonable()
|
||||
{
|
||||
if (StringUtils.isNull(reasonable))
|
||||
{
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return reasonable;
|
||||
}
|
||||
|
||||
public void setReasonable(Boolean reasonable)
|
||||
{
|
||||
this.reasonable = reasonable;
|
||||
}
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
package com.evo.common.core.page;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 表格分页数据对象
|
||||
*
|
||||
* @author evo
|
||||
*/
|
||||
public class TableDataInfo implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 总记录数 */
|
||||
private long total;
|
||||
|
||||
/** 列表数据 */
|
||||
private List<?> rows;
|
||||
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
|
||||
/** 消息内容 */
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
* 表格数据对象
|
||||
*/
|
||||
public TableDataInfo()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页
|
||||
*
|
||||
* @param list 列表数据
|
||||
* @param total 总记录数
|
||||
*/
|
||||
public TableDataInfo(List<?> list, int total)
|
||||
{
|
||||
this.rows = list;
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public long getTotal()
|
||||
{
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total)
|
||||
{
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<?> getRows()
|
||||
{
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(List<?> rows)
|
||||
{
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg()
|
||||
{
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg)
|
||||
{
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user