完成务工者考勤模块
This commit is contained in:
@ -0,0 +1,79 @@
|
||||
package com.ruoyi.wgz.bo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 补卡申请分页查询对象 wgz_reissueacard
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("补卡申请分页查询对象")
|
||||
public class WgzReissueacardQueryBo extends BaseEntity {
|
||||
|
||||
/** 分页大小 */
|
||||
@ApiModelProperty("分页大小")
|
||||
private Integer pageSize;
|
||||
/** 当前页数 */
|
||||
@ApiModelProperty("当前页数")
|
||||
private Integer pageNum;
|
||||
/** 排序列 */
|
||||
@ApiModelProperty("排序列")
|
||||
private String orderByColumn;
|
||||
/** 排序的方向desc或者asc */
|
||||
@ApiModelProperty(value = "排序的方向", example = "asc,desc")
|
||||
private String isAsc;
|
||||
|
||||
|
||||
/** 项目ID */
|
||||
@ApiModelProperty("项目ID")
|
||||
private Long recruitId;
|
||||
/** 人员ID */
|
||||
@ApiModelProperty("人员ID")
|
||||
private Long userId;
|
||||
/** 打卡ID */
|
||||
@ApiModelProperty("打卡ID")
|
||||
private Long attendanceId;
|
||||
/** 状态(0上班补卡 1下班补卡) */
|
||||
@ApiModelProperty("状态(0上班补卡 1下班补卡)")
|
||||
private String type;
|
||||
/** 项目名称 */
|
||||
@ApiModelProperty("项目名称")
|
||||
private String recruitName;
|
||||
/** 原打卡时间 */
|
||||
@ApiModelProperty("原打卡时间")
|
||||
private String rawTime;
|
||||
/** 现补卡时间 */
|
||||
@ApiModelProperty("现补卡时间")
|
||||
private LocalDateTime nowTime;
|
||||
/** 补卡理由 */
|
||||
@ApiModelProperty("补卡理由")
|
||||
private String reason;
|
||||
/** 审核人ID */
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long auditorUserId;
|
||||
/** 审核状态(0待审核 1审核中 2已同意 3已拒绝) */
|
||||
@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝)")
|
||||
private String auditorType;
|
||||
/** 审核意见 */
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditorOpinion;
|
||||
/** 同意|拒绝时间 */
|
||||
@ApiModelProperty("同意|拒绝时间")
|
||||
private LocalDateTime auditorTime;
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.ruoyi.wgz.bo.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("补卡申请请求对象")
|
||||
public class WgzAppCardReplacementApplicationReq implements Serializable {
|
||||
|
||||
/** 打卡ID */
|
||||
@Excel(name = "打卡ID")
|
||||
@ApiModelProperty("打卡ID")
|
||||
private Long attendanceId;
|
||||
|
||||
/** 状态(0上班补卡 1下班补卡) */
|
||||
@Excel(name = "状态" , readConverterExp = "0=上班补卡,1=下班补卡")
|
||||
@ApiModelProperty("状态(0上班补卡 1下班补卡)")
|
||||
private String type;
|
||||
|
||||
/** 现补卡时间 */
|
||||
@Excel(name = "现补卡时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("现补卡时间")
|
||||
private LocalDateTime nowTime;
|
||||
|
||||
/** 补卡理由 */
|
||||
@Excel(name = "补卡理由")
|
||||
@ApiModelProperty("补卡理由")
|
||||
private String reason;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.wgz.bo.req;
|
||||
|
||||
import com.ruoyi.common.bo.PageReq;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("补卡申请历史记录请求对象")
|
||||
public class WgzAppReplacementCardRecordReq extends PageReq {
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppCardReplacementApplicationTwo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("补卡申请列表返回对象")
|
||||
public class WgzAppCardReplacementApplicationRes implements Serializable {
|
||||
List<WgzAppCardReplacementApplicationTwo> list;
|
||||
}
|
@ -44,10 +44,10 @@ public class WgzAppLeaveHistoryListPageRes implements Serializable {
|
||||
private Long auditorUserId;
|
||||
|
||||
@ApiModelProperty("审核人头像")
|
||||
private Long auditorHead;
|
||||
private String auditorHead;
|
||||
|
||||
@ApiModelProperty("审核人名称")
|
||||
private Long auditorName;
|
||||
private String auditorname;
|
||||
|
||||
@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝 4已取消)")
|
||||
private String auditorType;
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordTwo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("打卡-打卡日历返回对象")
|
||||
public class WgzAppPunchTheCalendarRecordRes implements Serializable {
|
||||
@ApiModelProperty("日历")
|
||||
private Map<LocalDate, WgzAppPunchTheCalendarRecordTwo> mp;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("考勤打卡·APP用户今日打卡状态")
|
||||
public class WgzAppUserClockingConditionRes implements Serializable {
|
||||
@ApiModelProperty("务工者今日打卡状态:0上班 1下班 2请假")
|
||||
private Integer clockingCondition;
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.ruoyi.wgz.bo.res;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("补卡申请历史记录返回对象")
|
||||
public class WgzReplacementCardRecordRes implements Serializable {
|
||||
|
||||
|
||||
@ApiModelProperty("项目ID")
|
||||
private Long recruitId;
|
||||
|
||||
@ApiModelProperty("申请人ID")
|
||||
private Long userId;
|
||||
|
||||
@ApiModelProperty("申请人姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("打卡ID")
|
||||
private Long attendanceId;
|
||||
|
||||
@ApiModelProperty("状态(0上班补卡 1下班补卡)")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String recruitName;
|
||||
|
||||
@ApiModelProperty("原打卡时间")
|
||||
private String rawTime;
|
||||
|
||||
@ApiModelProperty("现补卡时间")
|
||||
private LocalDateTime nowTime;
|
||||
|
||||
@ApiModelProperty("补卡理由")
|
||||
private String reason;
|
||||
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long auditorUserId;
|
||||
|
||||
@ApiModelProperty("审核人头像")
|
||||
private String auditorHead;
|
||||
|
||||
@ApiModelProperty("审核人名称")
|
||||
private String auditorname;
|
||||
|
||||
@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝)")
|
||||
private String auditorType;
|
||||
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditorOpinion;
|
||||
|
||||
/** 同意|拒绝时间 */
|
||||
@Excel(name = "同意|拒绝时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("同意|拒绝时间")
|
||||
private LocalDateTime auditorTime;
|
||||
|
||||
|
||||
@ApiModelProperty("创建时间|申请时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.wgz.bo.rests;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WgzAppCardReplacementApplicationTwo implements Serializable {
|
||||
@ApiModelProperty("补卡自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("补卡状态(1迟到 2早退 3上班缺卡 4下班缺卡)")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("补卡时间")
|
||||
private LocalDate fillingData;
|
||||
|
||||
@ApiModelProperty("星期")
|
||||
private String week;
|
||||
|
||||
@ApiModelProperty("原本打卡时间(如果是缺卡会直接返回项目的上班或下班的时间)")
|
||||
private LocalDateTime fillingDataTime;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.wgz.bo.rests;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WgzAppPunchTheCalendarRecordThree implements Serializable {
|
||||
@ApiModelProperty("打卡时间")
|
||||
private LocalDateTime clockingTime;
|
||||
|
||||
@ApiModelProperty("打卡位置")
|
||||
private String pnchOsition;
|
||||
|
||||
@ApiModelProperty("打卡状态(0正常 1迟到 2早退 3上班缺卡 4下班缺卡 5上班补卡 6下班补卡 7请假)")
|
||||
private Integer clockingCondition;
|
||||
|
||||
// @ApiModelProperty("补卡自增ID")
|
||||
// private Integer clockingCondition;
|
||||
//
|
||||
// @ApiModelProperty("补卡状态")
|
||||
// private Integer clockingCondition;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.ruoyi.wgz.bo.rests;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class WgzAppPunchTheCalendarRecordTwo implements Serializable {
|
||||
@ApiModelProperty("主键自增ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("今日打卡次数")
|
||||
private Integer num;
|
||||
|
||||
@ApiModelProperty("今日工时")
|
||||
private Double manHour;
|
||||
|
||||
@ApiModelProperty("上班情况")
|
||||
private WgzAppPunchTheCalendarRecordThree sb;
|
||||
|
||||
@ApiModelProperty("下班情况")
|
||||
private WgzAppPunchTheCalendarRecordThree xb;
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package com.ruoyi.wgz.domain;
|
||||
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 补卡申请对象 wgz_reissueacard
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("wgz_reissueacard")
|
||||
@ApiModel("补卡申请视图对象")
|
||||
public class WgzReissueacard implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/** 主键自增ID */
|
||||
@ApiModelProperty("主键自增ID")
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
@ApiModelProperty("项目ID")
|
||||
private Long recruitId;
|
||||
|
||||
/** 人员ID */
|
||||
@Excel(name = "人员ID")
|
||||
@ApiModelProperty("人员ID")
|
||||
private Long userId;
|
||||
|
||||
/** 打卡ID */
|
||||
@Excel(name = "打卡ID")
|
||||
@ApiModelProperty("打卡ID")
|
||||
private Long attendanceId;
|
||||
|
||||
/** 状态(0上班补卡 1下班补卡) */
|
||||
@Excel(name = "状态" , readConverterExp = "0=上班补卡,1=下班补卡")
|
||||
@ApiModelProperty("状态(0上班补卡 1下班补卡)")
|
||||
private String type;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
@ApiModelProperty("项目名称")
|
||||
private String recruitName;
|
||||
|
||||
/** 原打卡时间 */
|
||||
@Excel(name = "原打卡时间")
|
||||
@ApiModelProperty("原打卡时间")
|
||||
private String rawTime;
|
||||
|
||||
/** 现补卡时间 */
|
||||
@Excel(name = "现补卡时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("现补卡时间")
|
||||
private LocalDateTime nowTime;
|
||||
|
||||
/** 补卡理由 */
|
||||
@Excel(name = "补卡理由")
|
||||
@ApiModelProperty("补卡理由")
|
||||
private String reason;
|
||||
|
||||
/** 审核人ID */
|
||||
@Excel(name = "审核人ID")
|
||||
@ApiModelProperty("审核人ID")
|
||||
private Long auditorUserId;
|
||||
|
||||
/** 审核状态(0待审核 1审核中 2已同意 3已拒绝) */
|
||||
@Excel(name = "审核状态" , readConverterExp = "0=待审核,1=审核中,2=已同意,3=已拒绝")
|
||||
@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝)")
|
||||
private String auditorType;
|
||||
|
||||
/** 审核意见 */
|
||||
@Excel(name = "审核意见")
|
||||
@ApiModelProperty("审核意见")
|
||||
private String auditorOpinion;
|
||||
|
||||
/** 同意|拒绝时间 */
|
||||
@Excel(name = "同意|拒绝时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("同意|拒绝时间")
|
||||
private LocalDateTime auditorTime;
|
||||
|
||||
/** 删除标志(0代表存在 2代表删除) */
|
||||
@Excel(name = "删除标志" , readConverterExp = "0=代表存在,2=代表删除")
|
||||
@ApiModelProperty("删除标志(0代表存在 2代表删除)")
|
||||
private String delFlag;
|
||||
|
||||
/** 创建者 */
|
||||
@Excel(name = "创建者")
|
||||
@ApiModelProperty("创建者")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("创建时间")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@Excel(name = "更新者")
|
||||
@ApiModelProperty("更新者")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间" , width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("更新时间")
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.wgz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
|
||||
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
|
||||
import org.apache.ibatis.annotations.CacheNamespace;
|
||||
|
||||
/**
|
||||
* 补卡申请Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
|
||||
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
|
||||
public interface WgzReissueacardMapper extends BaseMapperPlus<WgzReissueacard> {
|
||||
/**
|
||||
* 查询关联数据并支持分页
|
||||
* @param page 分页对象
|
||||
* @return 分页查询结果
|
||||
*/
|
||||
Page<WgzReplacementCardRecordRes> userReplacementCardRecordListPage(Page<WgzReplacementCardRecordRes> page);
|
||||
}
|
@ -2,6 +2,9 @@ package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppSubmitTheClockReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppCardReplacementApplicationRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppPunchTheCalendarRecordRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserClockingConditionRes;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.bo.WgzAttendanceQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
@ -69,8 +72,23 @@ public interface IWgzAttendanceService extends IServicePlus<WgzAttendance> {
|
||||
*/
|
||||
Boolean userSubmitTheClock(@Validated @RequestBody WgzAppSubmitTheClockReq req);
|
||||
|
||||
// /**
|
||||
// * 查看当前人、当前工地、当前日期的打卡记录
|
||||
// */
|
||||
// WgzAttendance findByUserIdWait(Long appUserId, Long recruitId, String date);
|
||||
/**
|
||||
* 用户今日打卡状态(0上班 1下班 2请假)
|
||||
*/
|
||||
WgzAppUserClockingConditionRes userClockingCondition();
|
||||
|
||||
/**
|
||||
* 打卡日历记录
|
||||
*/
|
||||
WgzAppPunchTheCalendarRecordRes userPunchTheCalendarRecord();
|
||||
|
||||
/**
|
||||
* 根据id查询具体的打卡详情
|
||||
*/
|
||||
WgzAttendance findById(Long id);
|
||||
|
||||
/**
|
||||
* 补卡申请列表
|
||||
*/
|
||||
WgzAppCardReplacementApplicationRes userCardReplacementApplication();
|
||||
}
|
||||
|
@ -0,0 +1,79 @@
|
||||
package com.ruoyi.wgz.service;
|
||||
|
||||
import com.ruoyi.wgz.bo.req.WgzAppReplacementCardRecordReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppCardReplacementApplicationReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppCardReplacementApplicationRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
||||
import com.ruoyi.wgz.bo.WgzReissueacardQueryBo;
|
||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 补卡申请Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
public interface IWgzReissueacardService extends IServicePlus<WgzReissueacard> {
|
||||
/**
|
||||
* 查询单个
|
||||
* @return
|
||||
*/
|
||||
WgzReissueacard queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
TableDataInfo<WgzReissueacard> queryPageList(WgzReissueacardQueryBo bo);
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<WgzReissueacard> queryList(WgzReissueacardQueryBo bo);
|
||||
|
||||
/**
|
||||
* 根据新增业务对象插入补卡申请
|
||||
* @param bo 补卡申请新增业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean insert(WgzReissueacard bo);
|
||||
|
||||
/**
|
||||
* 根据编辑业务对象修改补卡申请
|
||||
* @param bo 补卡申请编辑业务对象
|
||||
* @return
|
||||
*/
|
||||
Boolean update(WgzReissueacard bo);
|
||||
|
||||
/**
|
||||
* 校验并删除数据
|
||||
* @param ids 主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
/**
|
||||
* APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* APP补卡申请
|
||||
*/
|
||||
Boolean userCardReplacementApplication(@Validated @RequestBody WgzAppCardReplacementApplicationReq req);
|
||||
|
||||
/**
|
||||
* 补卡记录(分页)
|
||||
*/
|
||||
TableDataInfo<WgzReplacementCardRecordRes> userReplacementCardRecord(@Validated WgzAppReplacementCardRecordReq req);
|
||||
|
||||
}
|
@ -13,8 +13,15 @@ import com.ruoyi.common.core.page.PagePlus;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppSubmitTheClockReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppCardReplacementApplicationRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppPunchTheCalendarRecordRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserClockingConditionRes;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppCardReplacementApplicationTwo;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordThree;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppPunchTheCalendarRecordTwo;
|
||||
import com.ruoyi.wgz.domain.WgzLeave;
|
||||
import com.ruoyi.wgz.service.IWgzLeaveService;
|
||||
import org.aspectj.weaver.ast.Var;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
@ -27,13 +34,11 @@ import com.ruoyi.wgz.service.IWgzAttendanceService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.reactive.TransactionalOperator;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.text.DecimalFormat;
|
||||
import java.time.*;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.time.temporal.TemporalAdjusters;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 考勤打卡Service业务层处理
|
||||
@ -143,54 +148,260 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
//3、根据工地id得到完整的工地信息
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
||||
//4、查看当前用户是否有请假申请,有请假申请并且通过,那就无法进行打卡
|
||||
// //4、查看当前用户是否有请假申请,有请假申请并且通过,那就无法进行打卡------------------>此处代码将改写逻辑为:每天凌晨1分的时候直接找出已请假的人然后定时插入数据到打卡记录中标记为请假
|
||||
// String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
// WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate);
|
||||
// if (wgzLeave != null) { //表示有请假申请
|
||||
// LocalDateTime startTime = wgzLeave.getStartTime();
|
||||
// LocalDate localDate = startTime.toLocalDate();
|
||||
// throw new RuntimeException("您有已通过的请假申请,请假时间为:"+localDate);
|
||||
// }
|
||||
//5、查看当前人、当前工地、当天的打卡记录
|
||||
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate);
|
||||
if (wgzLeave != null) { //表示有请假申请
|
||||
LocalDateTime startTime = wgzLeave.getStartTime();
|
||||
LocalDate localDate = startTime.toLocalDate();
|
||||
throw new RuntimeException("您有已通过的请假申请,请假时间为:"+localDate);
|
||||
WgzAttendance we = publicFindByUserIdWait(appUserId, by.getId(), formattedDate);
|
||||
String exceptionType = we.getExceptionType();
|
||||
if (we.getLeaveMarkId() != null && we.getLeaveMarkId()!= 0) {
|
||||
throw new RuntimeException("您有已通过的请假申请,请假时间为:"+formattedDate);
|
||||
}
|
||||
//5、查看当前人、当前工地、当天是否有打卡记录
|
||||
//4、组装完整的打卡信息
|
||||
//6、组装完整的打卡信息
|
||||
WgzAttendance wgzAttendance = new WgzAttendance().
|
||||
setRecruitId(appById.getId()).
|
||||
setUserId(appUserId).
|
||||
setDailyWage(appById.getRecruitAmount()).
|
||||
setDate(LocalDate.now()).
|
||||
setPnchOsition(req.getPnchOsition()).
|
||||
setDate(LocalDate.now());
|
||||
//设置打卡时间
|
||||
setPnchOsition(req.getPnchOsition());
|
||||
LocalDateTime now = LocalDateTime.now(); //当前完整年月日时分秒
|
||||
LocalTime localTime = now.toLocalTime(); //获取时分秒
|
||||
if (req.getType().equals(Clocking)) {
|
||||
if (Objects.isNull(we)) { //表示当天第一次打卡---上班
|
||||
wgzAttendance.setClockInTime(now);
|
||||
//判断当前打卡时间是否在上班时间之前
|
||||
LocalTime beginWorkTime = appById.getBeginWorkTime(); //上班
|
||||
if (!localTime.isBefore(beginWorkTime)) {
|
||||
wgzAttendance.setLate(1); //迟到
|
||||
wgzAttendance.setLateTime(now);
|
||||
wgzAttendance.setExceptionType("1,");
|
||||
}
|
||||
}
|
||||
if (req.getType().equals(OffDuty)) {
|
||||
}else{ //表示当天不是第一次打卡---下班
|
||||
wgzAttendance.setClockOutTime(now);
|
||||
//判断当前打卡时间是否在下班时间之后
|
||||
LocalTime endWorkTime = appById.getEndWorkTime(); //下班
|
||||
if (!localTime.isAfter(endWorkTime)) {
|
||||
wgzAttendance.setEarlyLeave(1); //早退
|
||||
wgzAttendance.setEarlyLeaveTime(now);
|
||||
wgzAttendance.setExceptionType("2,");
|
||||
wgzAttendance.setExceptionType(exceptionType+"2,");
|
||||
}
|
||||
}
|
||||
return baseMapper.insert(wgzAttendance) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgzAppUserClockingConditionRes userClockingCondition() {
|
||||
WgzAppUserClockingConditionRes res = new WgzAppUserClockingConditionRes();
|
||||
//1、获取打卡信息
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
WgzAttendance wgzAttendance = publicFindByUserIdWait(appUserId, by.getId(), formattedDate);
|
||||
//2、获取今日用户打卡状态
|
||||
if (Objects.isNull(wgzAttendance)) {
|
||||
res.setClockingCondition(0); //上班
|
||||
}else{
|
||||
res.setClockingCondition(1); //下班
|
||||
if (wgzAttendance.getLeaveMarkId()!= null && wgzAttendance.getLeaveMarkId()!= 0) {
|
||||
res.setClockingCondition(2); //请假
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgzAppPunchTheCalendarRecordRes userPunchTheCalendarRecord() {
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
//1、获取当月的所有日期
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
LocalDate firstDayOfMonth = currentDate.with(TemporalAdjusters.firstDayOfMonth());
|
||||
LocalDate lastDayOfMonth = currentDate.with(TemporalAdjusters.lastDayOfMonth());
|
||||
List<LocalDate> dates = new ArrayList<>();
|
||||
LocalDate tempDate = firstDayOfMonth;
|
||||
while (!tempDate.isAfter(lastDayOfMonth)) {
|
||||
dates.add(tempDate);
|
||||
tempDate = tempDate.plusDays(1);
|
||||
}
|
||||
String format = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||
//2、获取当前人、当前工地、当前月的所有考勤记录
|
||||
LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
|
||||
eq(WgzAttendance::getUserId, appUserId).
|
||||
eq(WgzAttendance::getRecruitId, by.getId()).
|
||||
apply("DATE_FORMAT(date, '%Y-%m') = {0}", format);
|
||||
List<WgzAttendance> wgzAttendances = baseMapper.selectList(apply);
|
||||
//3、组装返回数据
|
||||
Map<LocalDate, WgzAppPunchTheCalendarRecordTwo> mp = new HashMap<>();
|
||||
for (LocalDate date : dates) {
|
||||
for (WgzAttendance wa : wgzAttendances) {
|
||||
WgzAppPunchTheCalendarRecordTwo two = new WgzAppPunchTheCalendarRecordTwo().setId(wa.getId());
|
||||
LocalDate clockDate = wa.getDate();
|
||||
if (clockDate.equals(date)) {
|
||||
//上班
|
||||
if (wa.getClockInTime() != null) {
|
||||
two.setNum(1);
|
||||
two.setSb(sbOrXb(wa, 1));
|
||||
}
|
||||
//下班
|
||||
if (wa.getClockOutTime() != null) {
|
||||
two.setNum(2);
|
||||
two.setManHour(calculateWorkingHours(wa.getClockInTime(), wa.getClockOutTime()));
|
||||
two.setSb(sbOrXb(wa, 2));
|
||||
}
|
||||
}
|
||||
mp.put(date, two);
|
||||
}
|
||||
}
|
||||
return new WgzAppPunchTheCalendarRecordRes().setMp(mp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgzAttendance findById(Long id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgzAppCardReplacementApplicationRes userCardReplacementApplication() {
|
||||
//1、获取当前用户信息
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
//2、获取当前用户所在的工地id
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
//3、根据工地id得到完整的工地信息
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
||||
//4、查询所有缺卡、迟到、早退的打卡记录
|
||||
LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
|
||||
eq(WgzAttendance::getUserId, appUserId).
|
||||
eq(WgzAttendance::getRecruitId, by.getId()).
|
||||
eq(WgzAttendance::getRecruitId, by.getId())
|
||||
.and(wrapper -> wrapper
|
||||
.eq(WgzAttendance::getLate, 1)
|
||||
.or()
|
||||
.eq(WgzAttendance::getEarlyLeave, 1)
|
||||
.or()
|
||||
.eq(WgzAttendance::getMissedIn, 1)
|
||||
.or()
|
||||
.eq(WgzAttendance::getMissedOut, 1)
|
||||
);
|
||||
List<WgzAttendance> wgzAttendances = baseMapper.selectList(apply);
|
||||
//4、将这些数据进行拆分
|
||||
ArrayList<WgzAppCardReplacementApplicationTwo> list = new ArrayList<>();
|
||||
for (WgzAttendance wgzAttendance : wgzAttendances) {
|
||||
String exceptionType = wgzAttendance.getExceptionType();
|
||||
if (exceptionType.contains("1")) { // 迟到
|
||||
addRecord(wgzAttendance, 1, wgzAttendance.getClockInTime(), list);
|
||||
}
|
||||
if (exceptionType.contains("2")) { // 早退
|
||||
addRecord(wgzAttendance, 2, wgzAttendance.getClockOutTime(), list);
|
||||
}
|
||||
if (exceptionType.contains("3")) { // 上班缺卡
|
||||
addRecord(wgzAttendance, 3, LocalDateTime.from(appById.getBeginWorkTime()), list);
|
||||
}
|
||||
if (exceptionType.contains("4")) { // 下班缺卡
|
||||
addRecord(wgzAttendance, 4, LocalDateTime.from(appById.getEndWorkTime()), list);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public WgzAttendance findByUserIdWait(Long appUserId, Long recruitId, String date) {
|
||||
// LambdaQueryWrapper<WgzAttendance> qw = new LambdaQueryWrapper<>();
|
||||
// qw.eq(WgzAttendance::getRecruitId,recruitId);
|
||||
// qw.eq(WgzAttendance::getUserId,appUserId);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取指定人、指定工地、指定日期的打卡记录
|
||||
* @param appUserId 务工者用户id
|
||||
* @param recruitId 工地id
|
||||
* @param date 具体日期
|
||||
* @return WgzAttendance
|
||||
*/
|
||||
public WgzAttendance publicFindByUserIdWait(Long appUserId, Long recruitId, String date) {
|
||||
LambdaQueryWrapper<WgzAttendance> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(WgzAttendance::getRecruitId,recruitId);
|
||||
qw.eq(WgzAttendance::getUserId,appUserId);
|
||||
qw.eq(WgzAttendance::getDate,date);
|
||||
return baseMapper.selectOne(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两个时间之间的工作小时数
|
||||
*
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 工作小时数
|
||||
*/
|
||||
public double calculateWorkingHours(LocalDateTime startTime, LocalDateTime endTime) {
|
||||
// 计算两个时间之间的持续时间
|
||||
Duration duration = Duration.between(startTime, endTime);
|
||||
|
||||
// 将持续时间转换为分钟
|
||||
long minutes = duration.toMinutes();
|
||||
|
||||
// 将分钟转换为小时
|
||||
double hours = (double) minutes / 60;
|
||||
|
||||
// 使用 DecimalFormat 保留两位小数
|
||||
DecimalFormat df = new DecimalFormat("#.00");
|
||||
String formattedHours = df.format(hours);
|
||||
|
||||
// 将格式化后的字符串转换回 double 类型
|
||||
return Double.parseDouble(formattedHours);
|
||||
}
|
||||
|
||||
/**
|
||||
* 组装上班、下班打卡记录
|
||||
* @param wa 打卡记录
|
||||
* @param num 1上班 2下班
|
||||
* @return WgzAppPunchTheCalendarRecordThree
|
||||
*/
|
||||
public WgzAppPunchTheCalendarRecordThree sbOrXb( WgzAttendance wa,int num) {
|
||||
WgzAppPunchTheCalendarRecordThree sbb = new WgzAppPunchTheCalendarRecordThree().
|
||||
setClockingTime(wa.getClockInTime()).
|
||||
setPnchOsition(wa.getPnchOsition()).
|
||||
setClockingCondition(0); //正常
|
||||
//判断是否请假
|
||||
if (wa.getLeaveMarkId()!=null && wa.getLeaveMarkId()!=0) {
|
||||
sbb.setClockingCondition(7);
|
||||
}
|
||||
if (num == 1){
|
||||
//判断上班迟到
|
||||
if (wa.getLate() == 1) {
|
||||
sbb.setClockingCondition(1);
|
||||
}
|
||||
//判断是否上班补卡
|
||||
if (wa.getExceptionType().contains("5")) {
|
||||
sbb.setClockingCondition(5);
|
||||
}
|
||||
}
|
||||
if (num == 2){
|
||||
//判断下班早退
|
||||
if (wa.getEarlyLeave() == 1) {
|
||||
sbb.setClockingCondition(2);
|
||||
}
|
||||
//判断是否下班补卡
|
||||
if (wa.getExceptionType().contains("6")) {
|
||||
sbb.setClockingCondition(6);
|
||||
}
|
||||
}
|
||||
return sbb;
|
||||
}
|
||||
|
||||
/**
|
||||
* 补卡
|
||||
* @param wgzAttendance 打卡记录
|
||||
* @param type 1上班 2下班
|
||||
* @param fillingDataTime 补卡时间
|
||||
* @param list 补卡记录
|
||||
*/
|
||||
private void addRecord(WgzAttendance wgzAttendance, int type, LocalDateTime fillingDataTime, List<WgzAppCardReplacementApplicationTwo> list) {
|
||||
LocalDate date = wgzAttendance.getDate();
|
||||
DayOfWeek dayOfWeek = date.getDayOfWeek();
|
||||
String week = dayOfWeek.toString();
|
||||
WgzAppCardReplacementApplicationTwo two = new WgzAppCardReplacementApplicationTwo()
|
||||
.setId(wgzAttendance.getId())
|
||||
.setType(type)
|
||||
.setFillingData(date)
|
||||
.setWeek(week)
|
||||
.setFillingDataTime(fillingDataTime);
|
||||
list.add(two);
|
||||
}
|
||||
}
|
||||
|
@ -155,6 +155,7 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean userCancelLeave(WgzAppCancelLeaveReq req) {
|
||||
WgzLeave wgzLeave = new WgzLeave().
|
||||
setId(req.getId()).
|
||||
|
@ -0,0 +1,172 @@
|
||||
package com.ruoyi.wgz.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
import com.ruoyi.common.utils.PageUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppReplacementCardRecordReq;
|
||||
import com.ruoyi.wgz.bo.req.WgzAppCardReplacementApplicationReq;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppCardReplacementApplicationRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.service.IWgzAttendanceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.wgz.bo.WgzReissueacardQueryBo;
|
||||
import com.ruoyi.wgz.domain.WgzReissueacard;
|
||||
import com.ruoyi.wgz.mapper.WgzReissueacardMapper;
|
||||
import com.ruoyi.wgz.service.IWgzReissueacardService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 补卡申请Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-02-20
|
||||
*/
|
||||
@Service
|
||||
public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardMapper, WgzReissueacard> implements IWgzReissueacardService {
|
||||
|
||||
@Autowired
|
||||
private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
|
||||
|
||||
@Autowired
|
||||
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
|
||||
@Autowired
|
||||
private IWgzAttendanceService iWgzAttendanceService;
|
||||
|
||||
@Override
|
||||
public WgzReissueacard queryById(Long id){
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzReissueacard> queryPageList(WgzReissueacardQueryBo bo) {
|
||||
Page<WgzReissueacard> result = page(PageUtils.buildPage(), buildQueryWrapper(bo));
|
||||
return PageUtils.buildDataInfo(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgzReissueacard> queryList(WgzReissueacardQueryBo bo) {
|
||||
return list(buildQueryWrapper(bo));
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WgzReissueacard> buildQueryWrapper(WgzReissueacardQueryBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WgzReissueacard> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRecruitId() != null, WgzReissueacard::getRecruitId, bo.getRecruitId());
|
||||
lqw.eq(bo.getUserId() != null, WgzReissueacard::getUserId, bo.getUserId());
|
||||
lqw.eq(bo.getAttendanceId() != null, WgzReissueacard::getAttendanceId, bo.getAttendanceId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getType()), WgzReissueacard::getType, bo.getType());
|
||||
lqw.like(StrUtil.isNotBlank(bo.getRecruitName()), WgzReissueacard::getRecruitName, bo.getRecruitName());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getRawTime()), WgzReissueacard::getRawTime, bo.getRawTime());
|
||||
lqw.eq(bo.getNowTime() != null, WgzReissueacard::getNowTime, bo.getNowTime());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getReason()), WgzReissueacard::getReason, bo.getReason());
|
||||
lqw.eq(bo.getAuditorUserId() != null, WgzReissueacard::getAuditorUserId, bo.getAuditorUserId());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getAuditorType()), WgzReissueacard::getAuditorType, bo.getAuditorType());
|
||||
lqw.eq(StrUtil.isNotBlank(bo.getAuditorOpinion()), WgzReissueacard::getAuditorOpinion, bo.getAuditorOpinion());
|
||||
lqw.eq(bo.getAuditorTime() != null, WgzReissueacard::getAuditorTime, bo.getAuditorTime());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean insert(WgzReissueacard bo) {
|
||||
WgzReissueacard add = BeanUtil.toBean(bo, WgzReissueacard.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(WgzReissueacard bo) {
|
||||
WgzReissueacard update = BeanUtil.toBean(bo, WgzReissueacard.class);
|
||||
validEntityBeforeSave(update);
|
||||
return updateById(update);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*
|
||||
* @param entity 实体类数据
|
||||
*/
|
||||
private void validEntityBeforeSave(WgzReissueacard entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* APP相关
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
* =================================================================================================================
|
||||
*/
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean userCardReplacementApplication(WgzAppCardReplacementApplicationReq req) {
|
||||
//1、获取当前用户信息
|
||||
Long appUserId = SecurityUtils.getAppUserId();
|
||||
//2、获取当前用户所在的工地id
|
||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||
//3、根据招工id获取到具体招工信息
|
||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
||||
//4、获取到原打卡的信息
|
||||
WgzAttendance attendanceInfo = iWgzAttendanceService.findById(req.getAttendanceId());
|
||||
if (Objects.isNull(attendanceInfo)) {
|
||||
throw new RuntimeException("打卡信息不存在");
|
||||
}
|
||||
String rawTime = "";
|
||||
if (attendanceInfo.getClockInTime() == null) {
|
||||
rawTime = "缺卡";
|
||||
}else{
|
||||
rawTime = attendanceInfo.getClockInTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||
}
|
||||
//5、组装补卡申请数据
|
||||
WgzReissueacard wgzReissueacard = new WgzReissueacard().
|
||||
setRecruitId(by.getRecruitId()).
|
||||
setUserId(appUserId).
|
||||
setAttendanceId(req.getAttendanceId()).
|
||||
setType(req.getType()).
|
||||
setRecruitName(appById.getRecruitName()).
|
||||
setRawTime(rawTime).
|
||||
setNowTime(req.getNowTime()).
|
||||
setReason(req.getReason()).
|
||||
setAttendanceId(appById.getUserId());
|
||||
return baseMapper.insert(wgzReissueacard) > 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<WgzReplacementCardRecordRes> userReplacementCardRecord(WgzAppReplacementCardRecordReq req) {
|
||||
Page<WgzReplacementCardRecordRes> queryDTOPage = new Page<>();
|
||||
queryDTOPage.setCurrent(req.getPageNum());
|
||||
queryDTOPage.setSize(req.getPageSize());
|
||||
return PageUtils.buildDataInfo(baseMapper.userReplacementCardRecordListPage(queryDTOPage));
|
||||
}
|
||||
|
||||
}
|
@ -116,6 +116,7 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
|
||||
//注册
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean userRegister(WgzAppRegisterReq bo) {
|
||||
WgzUser wgzUser = new WgzUser();
|
||||
//1、查询手机号是否存在
|
||||
@ -135,6 +136,7 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Boolean userModifyingUserProfilePicture(WgzAppModifyingUserProfilePictureReq req) {
|
||||
WgzUser user = new WgzUser();
|
||||
BeanUtils.copyProperties(req, user);
|
||||
|
@ -0,0 +1,45 @@
|
||||
<?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.ruoyi.wgz.mapper.WgzReissueacardMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wgz.domain.WgzReissueacard" id="WgzReissueacardResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="recruitId" column="recruit_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="attendanceId" column="attendance_id"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="recruitName" column="recruit_name"/>
|
||||
<result property="rawTime" column="raw_time"/>
|
||||
<result property="nowTime" column="now_time"/>
|
||||
<result property="reason" column="reason"/>
|
||||
<result property="auditorUserId" column="auditor_user_id"/>
|
||||
<result property="auditorType" column="auditor_type"/>
|
||||
<result property="auditorOpinion" column="auditor_opinion"/>
|
||||
<result property="auditorTime" column="auditor_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="userReplacementCardRecordListPage" resultType="com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes">
|
||||
SELECT
|
||||
a.*,
|
||||
b.username,
|
||||
b.avatar_name,
|
||||
c.username as userName
|
||||
FROM
|
||||
wgz_reissueacard a
|
||||
LEFT JOIN bgt_user b ON (a.auditor_user_id = b.user_id and b.del_flag = 0)
|
||||
LEFT JOIN wgz_user c ON (a.user_id = c.user_id and c.del_flag = 0)
|
||||
WHERE
|
||||
a.del_flag = 0
|
||||
ORDER BY
|
||||
a.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user