Merge branch 'refs/heads/master' into 分包商
This commit is contained in:
@ -3,14 +3,17 @@ package com.ruoyi.task;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.lang.Console;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
|
||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||
import com.ruoyi.bgt.domain.dto.BgtScoreDTO;
|
||||
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
|
||||
import com.ruoyi.common.enums.RecruitApplyStatus;
|
||||
import com.ruoyi.common.enums.RecruitStatus;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
@ -24,6 +27,8 @@ import com.ruoyi.wgz.service.IWgzScoreRecordService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.reactive.TransactionalOperator;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@ -67,6 +72,12 @@ public class BusinessTask
|
||||
@Autowired
|
||||
private IWgzScoreRecordService wgzScoreRecordService;
|
||||
|
||||
@Autowired
|
||||
private IBgtMessageService iBgtMessageService;
|
||||
|
||||
@Autowired
|
||||
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||
|
||||
public void ryNoParams()
|
||||
{
|
||||
Console.log("-------------------------------------------------------------------------");
|
||||
@ -272,7 +283,7 @@ public class BusinessTask
|
||||
WgzAttendance attendance = new WgzAttendance()
|
||||
.setId(one.getId())
|
||||
.setMissedOut(1)
|
||||
.setExceptionType("4,").setUpdateBy("系统").setCreateBy("系统");
|
||||
.setExceptionType(one.getExceptionType()+"4,").setUpdateBy("系统").setCreateBy("系统");
|
||||
lists.add(attendance);
|
||||
//添加消息提醒
|
||||
WgzMessage wgzMessage = new WgzMessage().
|
||||
@ -306,7 +317,12 @@ public class BusinessTask
|
||||
/**
|
||||
* 请假
|
||||
*/
|
||||
@Transactional
|
||||
public void leave(){
|
||||
System.out.println("????????????????");
|
||||
System.out.println("????????????????");
|
||||
System.out.println("????????????????");
|
||||
System.out.println("????????????????");
|
||||
List<WgzLeave> updataList = new ArrayList<>();
|
||||
List<WgzAttendance> attendanceList = new ArrayList<>();
|
||||
List<WgzMessage> messagesList = new ArrayList<>();
|
||||
@ -335,51 +351,61 @@ public class BusinessTask
|
||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"118")).
|
||||
setMessageLargeType(LARGE_OTHER).
|
||||
setMessageSmallType(SMALL_SYSTEM);
|
||||
messagesList.add(wgzMessage); }
|
||||
messagesList.add(wgzMessage);
|
||||
//状态超时需要把对应消息的状态变更为【不需要操作】
|
||||
BgtProjectRecruit recruit = iBgtProjectRecruitService.getById(wgzLeave.getApplyKey());
|
||||
iBgtMessageService.operation(
|
||||
USERTYPE_WGZ,
|
||||
SecurityUtils.getAppUserId(),
|
||||
USERTYPE_BGT,
|
||||
recruit.getUserId(),
|
||||
wgzLeave.getId(),
|
||||
SqlHelper.table(WgzLeave.class).getTableName()
|
||||
);
|
||||
}
|
||||
}
|
||||
if (iWgzLeaveService.updateBatchById(updataList)){
|
||||
//3、发送请假超时的消息
|
||||
if (!iWgzMessageService.saveBatch(messagesList)){
|
||||
log.error("批量添加请假超时消息失败!");
|
||||
}
|
||||
//4、获取所有审批成功的请假消息,然后批量新增请假打卡数据到考勤表(如若需要日薪就需要连表查询)
|
||||
List<WgzLeave> wgzLeaveListTwo = iWgzLeaveService.list(
|
||||
Wrappers.<WgzLeave>lambdaQuery()
|
||||
.eq(WgzLeave::getAuditorType, "2")
|
||||
);
|
||||
for (WgzLeave wgzLeave : wgzLeaveListTwo) {
|
||||
//获取请假的具体天数(目前的请假是全天,没有分时间段)
|
||||
List<LocalDate> formattedDates = getFormattedDates(wgzLeave.getStartTime(), wgzLeave.getEndTime());
|
||||
//业务逻辑
|
||||
for (LocalDate formattedDate : formattedDates) {
|
||||
//如果formattedDate小于当前日期,就跳过
|
||||
if (formattedDate.isBefore(now)){
|
||||
continue;
|
||||
}
|
||||
//查询当前人、当前项目、当前打卡时间是否存在,如若存在就跳过
|
||||
int count = iWgzAttendanceService.count(
|
||||
Wrappers.<WgzAttendance>lambdaQuery()
|
||||
.eq(WgzAttendance::getUserId, wgzLeave.getUserId())
|
||||
.eq(WgzAttendance::getRecruitId, wgzLeave.getRecruitId())
|
||||
.eq(WgzAttendance::getDate, formattedDate)
|
||||
);
|
||||
if (count > 0){
|
||||
continue;
|
||||
}
|
||||
//获取到请假天数
|
||||
WgzAttendance wgzAttendance = new WgzAttendance().
|
||||
setRecruitId(wgzLeave.getRecruitId()).
|
||||
setApplyKey(wgzLeave.getApplyKey()).
|
||||
setUserId(wgzLeave.getUserId()).
|
||||
setLeaveMarkId(wgzLeave.getId()).
|
||||
setDate(formattedDate).
|
||||
setExceptionType("6,");
|
||||
attendanceList.add(wgzAttendance);
|
||||
//3、发送请假超时的消息,然后批量修改请假消息的状态为超时且发送超时消息
|
||||
if (!updataList.isEmpty()){
|
||||
iWgzLeaveService.updateBatchById(updataList);
|
||||
iWgzMessageService.saveBatch(messagesList);
|
||||
}
|
||||
//4、获取所有审批成功的请假消息,然后批量新增请假打卡数据到考勤表(如若需要日薪就需要连表查询)
|
||||
List<WgzLeave> wgzLeaveListTwo = iWgzLeaveService.list(
|
||||
Wrappers.<WgzLeave>lambdaQuery()
|
||||
.eq(WgzLeave::getAuditorType, "2")
|
||||
);
|
||||
for (WgzLeave wgzLeave : wgzLeaveListTwo) {
|
||||
//获取请假的具体天数(目前的请假是全天,没有分时间段)
|
||||
List<LocalDate> formattedDates = getFormattedDates(wgzLeave.getStartTime(), wgzLeave.getEndTime());
|
||||
//业务逻辑
|
||||
for (LocalDate formattedDate : formattedDates) {
|
||||
//如果formattedDate小于当前日期,就跳过
|
||||
if (formattedDate.isBefore(now)){
|
||||
continue;
|
||||
}
|
||||
//查询当前人、当前项目、当前打卡时间是否存在,如若存在就跳过
|
||||
int count = iWgzAttendanceService.count(
|
||||
Wrappers.<WgzAttendance>lambdaQuery()
|
||||
.eq(WgzAttendance::getUserId, wgzLeave.getUserId())
|
||||
.eq(WgzAttendance::getRecruitId, wgzLeave.getRecruitId())
|
||||
.eq(WgzAttendance::getDate, formattedDate)
|
||||
);
|
||||
if (count > 0){
|
||||
continue;
|
||||
}
|
||||
//获取到请假天数
|
||||
WgzAttendance wgzAttendance = new WgzAttendance().
|
||||
setRecruitId(wgzLeave.getRecruitId()).
|
||||
setApplyKey(wgzLeave.getApplyKey()).
|
||||
setUserId(wgzLeave.getUserId()).
|
||||
setLeaveMarkId(wgzLeave.getId()).
|
||||
setDate(formattedDate).
|
||||
setExceptionType("7,").setUpdateBy("系统").setCreateBy("系统");
|
||||
attendanceList.add(wgzAttendance);
|
||||
}
|
||||
if (!iWgzAttendanceService.addAMissingCardRecord(attendanceList)){
|
||||
log.error("批量添加上班缺卡信息失败!");
|
||||
}
|
||||
}
|
||||
if (!attendanceList.isEmpty()){
|
||||
iWgzAttendanceService.addAMissingCardRecord(attendanceList);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class WgzAppUserApplyForPayrollSettlementDetails {
|
||||
@ApiModelProperty("结算人")
|
||||
private String auditorUserName;
|
||||
|
||||
@ApiModelProperty("结算时间")
|
||||
@ApiModelProperty("申请时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("工资金额")
|
||||
|
@ -364,7 +364,8 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
//4、查询所有缺卡、迟到、早退的打卡记录
|
||||
LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
|
||||
eq(WgzAttendance::getUserId, appUserId).
|
||||
eq(WgzAttendance::getRecruitId, appById.getId())
|
||||
eq(WgzAttendance::getRecruitId, appById.getId()).
|
||||
isNull(WgzAttendance::getLeaveMarkId)
|
||||
.and(wrapper -> wrapper
|
||||
.eq(WgzAttendance::getLate, 1)
|
||||
.or()
|
||||
@ -386,11 +387,11 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
||||
addRecord(wgzAttendance, 2, wgzAttendance.getClockOutTime(), list);
|
||||
}
|
||||
if (exceptionType.contains("3")) { // 上班缺卡
|
||||
LocalDateTime dateTime = LocalDateTime.of(LocalDate.now(), appById.getBeginWorkTime());
|
||||
LocalDateTime dateTime = LocalDateTime.of(wgzAttendance.getDate(), appById.getBeginWorkTime());
|
||||
addRecord(wgzAttendance, 3,dateTime, list);
|
||||
}
|
||||
if (exceptionType.contains("4")) { // 下班缺卡
|
||||
LocalDateTime dateTime = LocalDateTime.of(LocalDate.now(), appById.getEndWorkTime());
|
||||
LocalDateTime dateTime = LocalDateTime.of(wgzAttendance.getDate(), appById.getEndWorkTime());
|
||||
addRecord(wgzAttendance, 4, dateTime, list);
|
||||
}
|
||||
}
|
||||
|
@ -33,14 +33,12 @@ import com.ruoyi.wgz.bo.res.WgzAppCheckDailyNewspaperRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzAppUserDailyRecordRes;
|
||||
import com.ruoyi.wgz.bo.res.WgzUserDailyCalendarRes;
|
||||
import com.ruoyi.wgz.bo.rests.WgzAppAttachmentAcquisitionTwo;
|
||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||
import com.ruoyi.wgz.domain.WgzDailyClock;
|
||||
import com.ruoyi.wgz.domain.WgzMessage;
|
||||
import com.ruoyi.wgz.domain.WgzUser;
|
||||
import com.ruoyi.wgz.mapper.WgzDailyClockMapper;
|
||||
import com.ruoyi.wgz.service.IWgzDailyClockService;
|
||||
import com.ruoyi.wgz.service.IWgzLeaveService;
|
||||
import com.ruoyi.wgz.service.IWgzMessageService;
|
||||
import com.ruoyi.wgz.service.IWgzUserService;
|
||||
import com.ruoyi.wgz.service.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -91,6 +89,9 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
|
||||
@Autowired
|
||||
private IBgtMessageService iBgtMessageService;
|
||||
|
||||
@Autowired
|
||||
private IWgzAttendanceService iWgzAttendanceService;
|
||||
|
||||
@Override
|
||||
public WgzDailyClock queryById(Long id){
|
||||
return getById(id);
|
||||
@ -209,6 +210,17 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
|
||||
}
|
||||
}
|
||||
});
|
||||
//5、数据补充:根据第一次打卡数据来存储到fh里面提供后面逻辑的数据支持
|
||||
LambdaQueryWrapper<WgzAttendance> apply1 = new LambdaQueryWrapper<WgzAttendance>()
|
||||
.eq(WgzAttendance::getApplyKey, by.getId())
|
||||
.eq(WgzAttendance::getUserId, appUserId)
|
||||
.orderByAsc(WgzAttendance::getId)
|
||||
.last("limit 1");
|
||||
WgzAttendance one1 = iWgzAttendanceService.getOne(apply1);
|
||||
if (one1 != null) {
|
||||
LocalDate date = one1.getDate();
|
||||
fh.put(date.toString(),new WgzAppAttachmentAcquisitionTwo().setStatus("1"));
|
||||
}
|
||||
//5、查看fh的key最大和最小的日期之间差哪些日期,然后补齐数据
|
||||
LocalDate minDate = fh.keySet().stream().map(LocalDate::parse).min(LocalDate::compareTo).orElse(null);
|
||||
LocalDate now = LocalDate.now();
|
||||
|
@ -253,11 +253,11 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
|
||||
//状态取消成功需要把对应消息的状态变更为【不需要操作】
|
||||
iBgtMessageService.operation(
|
||||
USERTYPE_WGZ,
|
||||
recruit.getUserId(),
|
||||
USERTYPE_BGT,
|
||||
SecurityUtils.getAppUserId(),
|
||||
USERTYPE_BGT,
|
||||
recruit.getUserId(),
|
||||
we.getId(),
|
||||
SqlHelper.table(BgtProjectRecruitApply.class).getTableName()
|
||||
SqlHelper.table(WgzLeave.class).getTableName()
|
||||
);
|
||||
return true;
|
||||
}else{
|
||||
|
@ -151,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and (wa.late = 0 and wa.early_leave = 0 and wa.missed_in = 0 and wa.missed_out = 0) and leave_mark_id is null
|
||||
</if>
|
||||
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
||||
AND ((wa.late = 1 OR wa.missed_in = 1 OR wa.early_leave = 1 OR wa.missed_out = 1)
|
||||
AND ((wa.id is null OR wa.late = 1 OR wa.missed_in = 1 OR wa.early_leave = 1 OR wa.missed_out = 1)
|
||||
AND leave_mark_id IS NULL)
|
||||
</if>
|
||||
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
||||
|
Reference in New Issue
Block a user