feat(attendance): 优化考勤数据导入功能
- 新增 DateConvertor 工具类,用于日期转换 - 更新 EqImagesMapper 接口,继承 BaseMapper- 在 EqImagesServiceImpl 中实现根据姓名查询照片功能 - 更新 IRzAttendanceService 接口,添加导入考勤数据方法 - 新增 IRzSysParamService 接口,用于参数配置 - 更新 ISysStaffService 接口,继承 IService - 重构 RzAbnormalDetail 类,优化字段注释和方法 - 更新 RzAbnormalDetailController 和 mapper XML 文件 - 重构 RzAttendance 类,使用 Lombok 注解 - 更新 RzAttendanceController,添加导入数据功能 - 更新 RzAttendanceMapper 和 RzAttendanceDetailMapper接口 - 更新 RzAttendanceMapper.xml,添加按日期范围查询功能
This commit is contained in:
parent
e1a99ad2e5
commit
ca416b24a2
@ -1,17 +1,12 @@
|
||||
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.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 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;
|
||||
@ -39,8 +34,8 @@ public class RzAbnormalDetailController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('attendance:abnormalDetail:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(RzAbnormalDetail rzAbnormalDetail)
|
||||
{
|
||||
public TableDataInfo list(RzAbnormalDetail rzAbnormalDetail) {
|
||||
|
||||
startPage();
|
||||
List<RzAbnormalDetail> list = rzAbnormalDetailService.selectRzAbnormalDetailList(rzAbnormalDetail);
|
||||
return getDataTable(list);
|
||||
@ -90,4 +85,5 @@ public class RzAbnormalDetailController extends BaseController
|
||||
{
|
||||
return toAjax(rzAbnormalDetailService.deleteRzAbnormalDetailById(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailVO;
|
||||
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;
|
||||
@ -10,6 +12,8 @@ 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;
|
||||
@ -101,5 +105,14 @@ public class RzAttendanceController extends BaseController
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,104 @@
|
||||
package com.evo.attendance.controller;
|
||||
|
||||
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.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.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));
|
||||
}
|
||||
}
|
||||
@ -2,6 +2,7 @@ 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;
|
||||
@ -14,18 +15,23 @@ import com.evo.common.core.domain.BaseEntity;
|
||||
* @author evo
|
||||
* @date 2025-03-10
|
||||
*/
|
||||
public class RzAbnormalDetail extends BaseEntity
|
||||
{
|
||||
public class RzAbnormalDetail extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键ID */
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/** 异常ID */
|
||||
/**
|
||||
* 异常ID
|
||||
*/
|
||||
@Excel(name = "异常ID")
|
||||
private Long abnormalId;
|
||||
|
||||
/** 员工姓名 */
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
@Excel(name = "员工姓名")
|
||||
private String name;
|
||||
|
||||
@ -35,6 +41,28 @@ public class RzAbnormalDetail extends BaseEntity
|
||||
|
||||
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;
|
||||
}
|
||||
@ -43,19 +71,6 @@ public class RzAbnormalDetail extends BaseEntity
|
||||
this.clockDate = clockDate;
|
||||
}
|
||||
|
||||
/** 打卡时间 */
|
||||
@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 String getClockType() {
|
||||
return clockType;
|
||||
}
|
||||
@ -64,13 +79,11 @@ public class RzAbnormalDetail extends BaseEntity
|
||||
this.clockType = clockType;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@ -82,26 +95,23 @@ public class RzAbnormalDetail extends BaseEntity
|
||||
this.abnormalId = abnormalId;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setAbnormalTime(Date abnormalTime)
|
||||
{
|
||||
|
||||
public void setAbnormalTime(Date abnormalTime) {
|
||||
this.abnormalTime = abnormalTime;
|
||||
}
|
||||
|
||||
public Date getAbnormalTime()
|
||||
{
|
||||
public Date getAbnormalTime() {
|
||||
return abnormalTime;
|
||||
}
|
||||
public void setMoney(BigDecimal money)
|
||||
{
|
||||
|
||||
public void setMoney(BigDecimal money) {
|
||||
this.money = money;
|
||||
}
|
||||
|
||||
@ -113,34 +123,31 @@ public class RzAbnormalDetail extends BaseEntity
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public BigDecimal getMoney()
|
||||
{
|
||||
@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)
|
||||
{
|
||||
|
||||
public void setDelFlag(String delFlag) {
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public String getDelFlag()
|
||||
{
|
||||
public String getDelFlag() {
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("abnormalId", getAbnormalId())
|
||||
.append("name", getName())
|
||||
.append("abnormalTime", getAbnormalTime())
|
||||
.append("money", getMoney())
|
||||
.append("remarks", getRemarks())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,17 @@
|
||||
package com.evo.attendance.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
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;
|
||||
|
||||
@ -14,229 +21,100 @@ import java.util.Date;
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
public class RzAttendance extends BaseEntity
|
||||
{
|
||||
@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 */
|
||||
/**
|
||||
* 统计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;
|
||||
|
||||
/** 删除标识 */
|
||||
/**
|
||||
* 删除标识
|
||||
*/
|
||||
private String delFlag;
|
||||
@TableField(exist = false)
|
||||
private Date startTime;
|
||||
@TableField(exist = false)
|
||||
private Date endTime;
|
||||
|
||||
public String getYcsFlag() {
|
||||
return ycsFlag;
|
||||
}
|
||||
|
||||
public void setYcsFlag(String ycsFlag) {
|
||||
this.ycsFlag = ycsFlag;
|
||||
}
|
||||
|
||||
public String getYcxFlag() {
|
||||
return ycxFlag;
|
||||
}
|
||||
|
||||
public void setYcxFlag(String ycxFlag) {
|
||||
this.ycxFlag = ycxFlag;
|
||||
}
|
||||
|
||||
public Long getStaffId() {
|
||||
return staffId;
|
||||
}
|
||||
|
||||
public void setStaffId(Long staffId) {
|
||||
this.staffId = staffId;
|
||||
}
|
||||
|
||||
public BigDecimal getWorkHours() {
|
||||
return workHours;
|
||||
}
|
||||
|
||||
public void setWorkHours(BigDecimal workHours) {
|
||||
this.workHours = workHours;
|
||||
}
|
||||
|
||||
public int getNightNumber() {
|
||||
return nightNumber;
|
||||
}
|
||||
|
||||
public void setNightNumber(int nightNumber) {
|
||||
this.nightNumber = nightNumber;
|
||||
}
|
||||
|
||||
public int getMiddleShiftNumber() {
|
||||
return middleShiftNumber;
|
||||
}
|
||||
|
||||
public void setMiddleShiftNumber(int middleShiftNumber) {
|
||||
this.middleShiftNumber = middleShiftNumber;
|
||||
}
|
||||
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 setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public Long getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Long deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public void setAttendanceDate(Date attendanceDate)
|
||||
{
|
||||
this.attendanceDate = attendanceDate;
|
||||
}
|
||||
|
||||
public Date getAttendanceDate()
|
||||
{
|
||||
return attendanceDate;
|
||||
}
|
||||
public void setRules(String rules)
|
||||
{
|
||||
this.rules = rules;
|
||||
}
|
||||
|
||||
public String getRules()
|
||||
{
|
||||
return rules;
|
||||
}
|
||||
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 setWorkSum(BigDecimal workSum)
|
||||
{
|
||||
this.workSum = workSum;
|
||||
}
|
||||
|
||||
public BigDecimal getWorkSum()
|
||||
{
|
||||
return workSum;
|
||||
}
|
||||
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("name", getName())
|
||||
.append("deptName", getDeptId())
|
||||
.append("attendanceDate", getAttendanceDate())
|
||||
.append("rules", getRules())
|
||||
.append("workStartTime", getWorkStartTime())
|
||||
.append("workEndTime", getWorkEndTime())
|
||||
.append("workSum", getWorkSum())
|
||||
.append("remarks", getRemarks())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,97 @@
|
||||
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,5 +1,7 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -12,7 +14,7 @@ import java.util.List;
|
||||
* @author chenyj
|
||||
* @date 2024-09-14
|
||||
*/
|
||||
public interface RzAttendanceDetailMapper
|
||||
public interface RzAttendanceDetailMapper extends BaseMapper<RzAttendanceDetail>
|
||||
{
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.attendance.domain.RzAttendance;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.Date;
|
||||
@ -11,8 +12,7 @@ import java.util.List;
|
||||
* @author chenyj
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
public interface RzAttendanceMapper
|
||||
{
|
||||
public interface RzAttendanceMapper extends BaseMapper<RzAttendance> {
|
||||
/**
|
||||
* 查询考勤记录
|
||||
*
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.evo.attendance.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.evo.attendance.domain.RzSysParam;
|
||||
|
||||
/**
|
||||
* 参数配置Mapper接口
|
||||
*
|
||||
* @author 田志阳
|
||||
* @date 2025-05-23
|
||||
*/
|
||||
public interface RzSysParamMapper
|
||||
{
|
||||
/**
|
||||
* 查询参数配置
|
||||
*
|
||||
* @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,7 +1,10 @@
|
||||
package com.evo.attendance.service;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
@ -52,4 +55,9 @@ public interface IRzAttendanceService
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> listAttendanceByParams(RzAttendance rzAttendance);
|
||||
|
||||
AjaxResult importAttendance(List<RzAttendanceDetailVO> attendanceList);
|
||||
|
||||
RzAttendance selectRzAttendanceBySfIdAndNameAndTime(Long userId, String employeeName, String replacementTime,Boolean isAttendance);
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
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);
|
||||
}
|
||||
@ -61,6 +61,10 @@ public class PunchTheClockServiceImpl implements PunchTheClockService {
|
||||
/**
|
||||
* 刷脸获取打卡按钮权限
|
||||
* sn 设备号
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* type 设备识别类型
|
||||
* user_id 用户id
|
||||
* card 人员信息中的卡号
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.evo.attendance.domain.RzAttendanceDetail;
|
||||
import com.evo.attendance.domain.vo.RzAttendanceDetailVO;
|
||||
import com.evo.attendance.mapper.RzAttendanceDetailMapper;
|
||||
import com.evo.common.annotation.DataScope;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.SysDept;
|
||||
@ -10,14 +16,26 @@ import com.evo.attendance.mapper.RzAttendanceMapper;
|
||||
import com.evo.attendance.mapper.RzAttendanceStatisticalMapper;
|
||||
import com.evo.attendance.service.IRzAttendanceService;
|
||||
import com.evo.common.utils.StringUtils;
|
||||
import com.evo.equipment.domain.EqImages;
|
||||
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.utils.DateConvertor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.evo.framework.datasource.DynamicDataSourceContextHolder.log;
|
||||
|
||||
/**
|
||||
* 考勤记录Service业务层处理
|
||||
*
|
||||
@ -25,14 +43,24 @@ import java.util.List;
|
||||
* @date 2024-09-05
|
||||
*/
|
||||
@Service
|
||||
public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
{
|
||||
public class RzAttendanceServiceImpl implements IRzAttendanceService {
|
||||
@Resource
|
||||
private RzAttendanceMapper rzAttendanceMapper;
|
||||
@Resource
|
||||
private SysDeptMapper deptMapper; //部门
|
||||
@Resource
|
||||
private RzAttendanceStatisticalMapper rzAttendanceStatisticalMapper; //考勤汇总
|
||||
@Resource
|
||||
private RzAttendanceDetailMapper rzAttendanceDetailMapper;
|
||||
@Resource
|
||||
private ISysStaffService sysStaffService;
|
||||
@Resource
|
||||
private IEqImagesService eqImagesService;
|
||||
|
||||
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 = "下班卡";
|
||||
|
||||
/**
|
||||
* 查询考勤记录
|
||||
@ -41,8 +69,7 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
* @return 考勤记录
|
||||
*/
|
||||
@Override
|
||||
public RzAttendance selectRzAttendanceById(Long id)
|
||||
{
|
||||
public RzAttendance selectRzAttendanceById(Long id) {
|
||||
return rzAttendanceMapper.selectRzAttendanceById(id);
|
||||
}
|
||||
|
||||
@ -54,14 +81,13 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
*/
|
||||
@DataScope(deptAlias = "d")
|
||||
@Override
|
||||
public List<RzAttendance> selectRzAttendanceList(RzAttendance rzAttendance)
|
||||
{
|
||||
public List<RzAttendance> selectRzAttendanceList(RzAttendance rzAttendance) {
|
||||
List<RzAttendance> res_list = rzAttendanceMapper.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){
|
||||
if (attendance.getAttendanceDate().before(new Date())) {
|
||||
if (attendance.getWorkStartTime() == null && attendance.getWorkEndTime() == null) {
|
||||
attendance.setYcsFlag("1");
|
||||
}
|
||||
}
|
||||
@ -76,13 +102,12 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzAttendance(RzAttendance rzAttendance)
|
||||
{
|
||||
public int updateRzAttendance(RzAttendance rzAttendance) {
|
||||
//判断考勤时间
|
||||
Long sj = (rzAttendance.getWorkEndTime().getTime() - rzAttendance.getWorkStartTime().getTime())/1000/60/60;
|
||||
if(sj >= 8){
|
||||
Long sj = (rzAttendance.getWorkEndTime().getTime() - rzAttendance.getWorkStartTime().getTime()) / 1000 / 60 / 60;
|
||||
if (sj >= 8) {
|
||||
rzAttendance.setWorkSum(new BigDecimal(8));
|
||||
}else if(sj >= 4){
|
||||
} else if (sj >= 4) {
|
||||
rzAttendance.setWorkSum(new BigDecimal(4));
|
||||
}
|
||||
rzAttendance.setYcsFlag("0");
|
||||
@ -93,11 +118,12 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
}
|
||||
|
||||
/**
|
||||
* 每日上班打卡统计
|
||||
* 每日上班打卡统计
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int attendenceCount(){
|
||||
public int attendenceCount() {
|
||||
List<RzAttendance> list = rzAttendanceMapper.attendenceCount();
|
||||
return list.size();
|
||||
}
|
||||
@ -109,8 +135,8 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateBatchAttendance(RzAttendance rzAttendance){
|
||||
if(StringUtils.isNull(rzAttendance.getAttendanceDate())){
|
||||
public AjaxResult updateBatchAttendance(RzAttendance rzAttendance) {
|
||||
if (StringUtils.isNull(rzAttendance.getAttendanceDate())) {
|
||||
return AjaxResult.error("请选择批量修改的时间!!");
|
||||
}
|
||||
//根据时间查询打卡信息
|
||||
@ -120,20 +146,20 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
SimpleDateFormat sdft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date mid_date = null;
|
||||
Date pre_date = null;
|
||||
try{
|
||||
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){
|
||||
} 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.getWorkStartTime() != null && attendance.getWorkStartTime().before(mid_date) && attendance.getWorkStartTime().after(pre_date)) {
|
||||
//判断没有打卡下班卡
|
||||
if(attendance.getWorkEndTime() == null){
|
||||
if (attendance.getWorkEndTime() == null) {
|
||||
attendance.setWorkStartTime(pre_date);
|
||||
attendance.setYcsFlag("0");
|
||||
rzAttendanceMapper.updateRzAttendance(attendance);
|
||||
@ -141,30 +167,30 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
}
|
||||
BigDecimal old = attendance.getWorkSum();
|
||||
//计算上班的时间
|
||||
Long fz = (attendance.getWorkEndTime().getTime() - attendance.getWorkStartTime().getTime())/1000/60;
|
||||
Double xs = fz/60.0;
|
||||
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){
|
||||
if ("上班卡(单班制)".equals(attendance.getRules())) {
|
||||
if (xs > 9) {
|
||||
res = new BigDecimal("8.0");
|
||||
}else if(xs > 4.5){
|
||||
} else if (xs > 4.5) {
|
||||
res = BigDecimal.valueOf(xs - 1);
|
||||
}else if(xs > 1){
|
||||
} else if (xs > 1) {
|
||||
res = BigDecimal.valueOf(xs);
|
||||
}
|
||||
}else if("上班卡(双班制)".equals(attendance.getRules())){
|
||||
if(xs > 8.5){
|
||||
} else if ("上班卡(双班制)".equals(attendance.getRules())) {
|
||||
if (xs > 8.5) {
|
||||
res = new BigDecimal("8.0");
|
||||
}else if(xs > 1){
|
||||
} else if (xs > 1) {
|
||||
res = BigDecimal.valueOf(xs);
|
||||
}
|
||||
}else{
|
||||
if(xs > 12){
|
||||
} else {
|
||||
if (xs > 12) {
|
||||
res = new BigDecimal("11.0");
|
||||
}else if(xs <= 1){
|
||||
} else if (xs <= 1) {
|
||||
res = new BigDecimal("0.0");
|
||||
}else{
|
||||
} else {
|
||||
res = BigDecimal.valueOf(xs - 1);
|
||||
}
|
||||
}
|
||||
@ -172,21 +198,271 @@ public class RzAttendanceServiceImpl implements IRzAttendanceService
|
||||
attendance.setYcsFlag("0");
|
||||
attendance.setWorkSum(res);
|
||||
int i = rzAttendanceMapper.updateRzAttendance(attendance);
|
||||
if(i < 1){
|
||||
if (i < 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询考勤记录列表
|
||||
*
|
||||
* @param rzAttendance 考勤记录
|
||||
* @return 考勤记录集合
|
||||
*/
|
||||
public List<RzAttendance> listAttendanceByParams(RzAttendance rzAttendance){
|
||||
public List<RzAttendance> listAttendanceByParams(RzAttendance rzAttendance) {
|
||||
|
||||
return rzAttendanceMapper.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("未找到员工:{}", 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 = rzAttendanceDetailMapper.selectList(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");
|
||||
rzAttendanceDetailMapper.insert(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");
|
||||
rzAttendanceDetailMapper.insert(rzAttendanceDetail);
|
||||
}
|
||||
|
||||
}
|
||||
//写表
|
||||
rzAttendanceMapper.update(attendance, new LambdaUpdateWrapper<RzAttendance>()
|
||||
.eq(RzAttendance::getId, attendance.getId()));
|
||||
rzAttendanceDetailMapper.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(" and 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 = rzAttendanceDetailMapper.selectList(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");
|
||||
rzAttendanceDetailMapper.insert(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");
|
||||
rzAttendanceDetailMapper.insert(rzAttendanceDetail);
|
||||
}
|
||||
|
||||
}
|
||||
rzAttendanceMapper.update(attendance, new LambdaUpdateWrapper<RzAttendance>()
|
||||
.eq(RzAttendance::getId, attendance.getId()));
|
||||
rzAttendanceDetailMapper.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 = rzAttendanceMapper.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 = rzAttendanceMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
return rzAttendance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,98 @@
|
||||
package com.evo.attendance.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
import com.evo.common.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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 implements IRzSysParamService
|
||||
{
|
||||
@Autowired
|
||||
private RzSysParamMapper rzSysParamMapper;
|
||||
|
||||
/**
|
||||
* 查询参数配置
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 参数配置
|
||||
*/
|
||||
@Override
|
||||
public RzSysParam selectRzSysParamById(Long id)
|
||||
{
|
||||
return rzSysParamMapper.selectRzSysParamById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询参数配置列表
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 参数配置
|
||||
*/
|
||||
@Override
|
||||
public List<RzSysParam> selectRzSysParamList(RzSysParam rzSysParam)
|
||||
{
|
||||
return rzSysParamMapper.selectRzSysParamList(rzSysParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertRzSysParam(RzSysParam rzSysParam)
|
||||
{
|
||||
rzSysParam.setUpdateTime(DateUtils.getNowDate());
|
||||
rzSysParam.setCreateBy(SecurityUtils.getUsername());
|
||||
rzSysParam.setCreateTime(DateUtils.getNowDate());
|
||||
return rzSysParamMapper.insertRzSysParam(rzSysParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改参数配置
|
||||
*
|
||||
* @param rzSysParam 参数配置
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateRzSysParam(RzSysParam rzSysParam)
|
||||
{
|
||||
return rzSysParamMapper.updateRzSysParam(rzSysParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除参数配置
|
||||
*
|
||||
* @param ids 需要删除的参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzSysParamByIds(Long[] ids)
|
||||
{
|
||||
return rzSysParamMapper.deleteRzSysParamByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除参数配置信息
|
||||
*
|
||||
* @param id 参数配置主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteRzSysParamById(Long id)
|
||||
{
|
||||
return rzSysParamMapper.deleteRzSysParamById(id);
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
package com.evo.equipment.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.evo.equipment.domain.EqImages;
|
||||
|
||||
import java.util.List;
|
||||
@ -10,7 +11,7 @@ import java.util.List;
|
||||
* @author chenyj
|
||||
* @date 2024-08-28
|
||||
*/
|
||||
public interface EqImagesMapper
|
||||
public interface EqImagesMapper extends BaseMapper<EqImages>
|
||||
{
|
||||
/**
|
||||
* 查询照片管理
|
||||
|
||||
@ -46,4 +46,5 @@ public interface IEqImagesService
|
||||
*/
|
||||
public AjaxResult uploadBatchFile(MultipartFile filePath);
|
||||
|
||||
public EqImages selectEqByName(String employeeName);
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.evo.equipment.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.evo.equipment.constant.Constants;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.utils.DateUtils;
|
||||
@ -326,4 +327,11 @@ public class EqImagesServiceImpl implements IEqImagesService
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public EqImages selectEqByName(String employeeName) {
|
||||
LambdaQueryWrapper<EqImages> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(EqImages::getStaffName,employeeName);
|
||||
return eqImagesMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.evo.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.evo.common.core.domain.AjaxResult;
|
||||
import com.evo.common.core.domain.entity.SysUser;
|
||||
import com.evo.system.domain.SysStaff;
|
||||
import com.evo.system.domain.vo.SysStaffVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -13,7 +15,7 @@ import java.util.List;
|
||||
* @author evo
|
||||
* @date 2024-11-21
|
||||
*/
|
||||
public interface ISysStaffService
|
||||
public interface ISysStaffService extends IService<SysStaff>
|
||||
{
|
||||
/**
|
||||
* 查询员工管理
|
||||
@ -92,4 +94,6 @@ public interface ISysStaffService
|
||||
* 自动计算工龄
|
||||
*/
|
||||
public void calculationOfSeniority();
|
||||
|
||||
public SysStaff selectSysStaffByName(String employeeName);
|
||||
}
|
||||
|
||||
@ -90,7 +90,9 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
@Resource
|
||||
private RzRestaurantStatisticsMapper rzRestaurantStatisticsMapper; //餐饮统计
|
||||
@Resource
|
||||
private RzUploadService rzUploadService; //餐饮统计
|
||||
private RzUploadService rzUploadService;//餐饮统计
|
||||
@Resource
|
||||
private SysStaffMapper sysStaffMapper;
|
||||
/**
|
||||
* 查询员工管理
|
||||
*
|
||||
@ -1013,4 +1015,12 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysStaff selectSysStaffByName(String employeeName) {
|
||||
LambdaQueryWrapper<SysStaff> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(SysStaff::getName,employeeName);
|
||||
|
||||
return sysStaffMapper.selectOne(wrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@ -453,6 +453,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
user.setUserId(u.getUserId());
|
||||
user.setUpdateBy(operName);
|
||||
userMapper.updateUser(user);
|
||||
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
|
||||
}
|
||||
|
||||
21
evo-admin/src/main/java/com/evo/utils/DateConvertor.java
Normal file
21
evo-admin/src/main/java/com/evo/utils/DateConvertor.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.evo.utils;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
|
||||
public class DateConvertor {
|
||||
private static final ZoneId DEFAULT_ZONE = ZoneId.of("Asia/Shanghai");
|
||||
|
||||
public static LocalTime toLocalTime(java.util.Date date) {
|
||||
return date.toInstant()
|
||||
.atZone(DEFAULT_ZONE)
|
||||
.toLocalTime();
|
||||
}
|
||||
|
||||
public static LocalDate toLocalDate(java.util.Date date) {
|
||||
return date.toInstant()
|
||||
.atZone(DEFAULT_ZONE)
|
||||
.toLocalDate();
|
||||
}
|
||||
}
|
||||
@ -1,36 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.evo.attendance.mapper.RzAbnormalDetailMapper">
|
||||
|
||||
<resultMap type="RzAbnormalDetail" id="RzAbnormalDetailResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="abnormalId" column="abnormal_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="clockDate" column="clock_date" />
|
||||
<result property="clockType" column="clock_type" />
|
||||
<result property="abnormalTime" column="abnormal_time" />
|
||||
<result property="money" column="money" />
|
||||
<result property="remarks" column="remarks" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="abnormalId" column="abnormal_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="clockDate" column="clock_date"/>
|
||||
<result property="clockType" column="clock_type"/>
|
||||
<result property="abnormalTime" column="abnormal_time"/>
|
||||
<result property="money" column="money"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRzAbnormalDetailVo">
|
||||
select id, abnormal_id, name,clock_date,clock_type, abnormal_time, money, remarks, del_flag, create_by, create_time, update_time, update_by from rz_abnormal_detail
|
||||
select id,
|
||||
abnormal_id,
|
||||
name,
|
||||
clock_date,
|
||||
clock_type,
|
||||
abnormal_time,
|
||||
money,
|
||||
remarks,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_time,
|
||||
update_by
|
||||
from rz_abnormal_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectRzAbnormalDetailList" parameterType="RzAbnormalDetail" resultMap="RzAbnormalDetailResult">
|
||||
<include refid="selectRzAbnormalDetailVo"/>
|
||||
<where>
|
||||
del_flag = '0'
|
||||
<if test="abnormalId != null "> and abnormal_id = #{abnormalId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="clockDate != null "> and date_format(clock_date,'%y%m%d') = date_format(#{clockDate},'%y%m%d') </if>
|
||||
<if test="abnormalId != null ">and abnormal_id = #{abnormalId}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="clockDate != null ">and date_format(clock_date,'%y%m%d') = date_format(#{clockDate},'%y%m%d')</if>
|
||||
|
||||
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -54,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="abnormalId != null">#{abnormalId},</if>
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
@ -68,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRzAbnormalDetail" parameterType="RzAbnormalDetail">
|
||||
|
||||
@ -41,6 +41,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="workSum == '1'.toString()"> and d.work_sum > 0</if>
|
||||
<if test="name != null and name != ''"> and d.name like concat('%', #{name}, '%')</if>
|
||||
<if test="attendanceDate != null "> and DATE_FORMAT( d.attendance_date, '%Y%m%d' ) = DATE_FORMAT(#{attendanceDate} , '%Y%m%d' )</if>
|
||||
<if test="startTime != null">
|
||||
<![CDATA[and attendance_date >= #{startTime} ]]>
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
<![CDATA[and attendance_date <= #{endTime} ]]>
|
||||
</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.evo.attendance.mapper.RzSysParamMapper">
|
||||
|
||||
<resultMap type="RzSysParam" id="RzSysParamResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="paramName" column="param_name" />
|
||||
<result property="paramCode" column="param_code" />
|
||||
<result property="paramValue" column="param_value" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectRzSysParamVo">
|
||||
select id, param_name, param_code, param_value, description, create_by, create_time, update_by, remark from rz_sys_param
|
||||
</sql>
|
||||
|
||||
<select id="selectRzSysParamList" parameterType="RzSysParam" resultMap="RzSysParamResult">
|
||||
<include refid="selectRzSysParamVo"/>
|
||||
<where>
|
||||
<if test="paramName != null and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if>
|
||||
<if test="paramCode != null and paramCode != ''"> and param_code = #{paramCode}</if>
|
||||
<if test="paramValue != null and paramValue != ''"> and param_value = #{paramValue}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectRzSysParamById" parameterType="Long" resultMap="RzSysParamResult">
|
||||
<include refid="selectRzSysParamVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertRzSysParam" parameterType="RzSysParam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into rz_sys_param
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="paramName != null and paramName != ''">param_name,</if>
|
||||
<if test="paramCode != null and paramCode != ''">param_code,</if>
|
||||
<if test="paramValue != null">param_value,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="paramName != null and paramName != ''">#{paramName},</if>
|
||||
<if test="paramCode != null and paramCode != ''">#{paramCode},</if>
|
||||
<if test="paramValue != null">#{paramValue},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateRzSysParam" parameterType="RzSysParam">
|
||||
update rz_sys_param
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="paramName != null and paramName != ''">param_name = #{paramName},</if>
|
||||
<if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
|
||||
<if test="paramValue != null">param_value = #{paramValue},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteRzSysParamById" parameterType="Long">
|
||||
delete from rz_sys_param where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRzSysParamByIds" parameterType="String">
|
||||
delete from rz_sys_param where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user