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.collection.CollectionUtil;
|
||||||
import cn.hutool.core.lang.Console;
|
import cn.hutool.core.lang.Console;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
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.BgtProjectRecruit;
|
||||||
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
|
||||||
import com.ruoyi.bgt.domain.dto.BgtScoreDTO;
|
import com.ruoyi.bgt.domain.dto.BgtScoreDTO;
|
||||||
|
import com.ruoyi.bgt.service.IBgtMessageService;
|
||||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||||
import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
|
import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
|
||||||
import com.ruoyi.common.enums.RecruitApplyStatus;
|
import com.ruoyi.common.enums.RecruitApplyStatus;
|
||||||
import com.ruoyi.common.enums.RecruitStatus;
|
import com.ruoyi.common.enums.RecruitStatus;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
import com.ruoyi.fbs.domain.FbsProjectTask;
|
import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
import com.ruoyi.fbs.service.IFbsProjectTaskService;
|
||||||
import com.ruoyi.wgz.domain.WgzAttendance;
|
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||||
@ -24,6 +27,8 @@ import com.ruoyi.wgz.service.IWgzScoreRecordService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.transaction.reactive.TransactionalOperator;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
@ -67,6 +72,12 @@ public class BusinessTask
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IWgzScoreRecordService wgzScoreRecordService;
|
private IWgzScoreRecordService wgzScoreRecordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBgtMessageService iBgtMessageService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBgtProjectRecruitService iBgtProjectRecruitService;
|
||||||
|
|
||||||
public void ryNoParams()
|
public void ryNoParams()
|
||||||
{
|
{
|
||||||
Console.log("-------------------------------------------------------------------------");
|
Console.log("-------------------------------------------------------------------------");
|
||||||
@ -272,7 +283,7 @@ public class BusinessTask
|
|||||||
WgzAttendance attendance = new WgzAttendance()
|
WgzAttendance attendance = new WgzAttendance()
|
||||||
.setId(one.getId())
|
.setId(one.getId())
|
||||||
.setMissedOut(1)
|
.setMissedOut(1)
|
||||||
.setExceptionType("4,").setUpdateBy("系统").setCreateBy("系统");
|
.setExceptionType(one.getExceptionType()+"4,").setUpdateBy("系统").setCreateBy("系统");
|
||||||
lists.add(attendance);
|
lists.add(attendance);
|
||||||
//添加消息提醒
|
//添加消息提醒
|
||||||
WgzMessage wgzMessage = new WgzMessage().
|
WgzMessage wgzMessage = new WgzMessage().
|
||||||
@ -306,7 +317,12 @@ public class BusinessTask
|
|||||||
/**
|
/**
|
||||||
* 请假
|
* 请假
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
public void leave(){
|
public void leave(){
|
||||||
|
System.out.println("????????????????");
|
||||||
|
System.out.println("????????????????");
|
||||||
|
System.out.println("????????????????");
|
||||||
|
System.out.println("????????????????");
|
||||||
List<WgzLeave> updataList = new ArrayList<>();
|
List<WgzLeave> updataList = new ArrayList<>();
|
||||||
List<WgzAttendance> attendanceList = new ArrayList<>();
|
List<WgzAttendance> attendanceList = new ArrayList<>();
|
||||||
List<WgzMessage> messagesList = new ArrayList<>();
|
List<WgzMessage> messagesList = new ArrayList<>();
|
||||||
@ -335,12 +351,23 @@ public class BusinessTask
|
|||||||
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"118")).
|
setSubheading(WgzAndBgtMessageConstant.wgzMessage(mp,"118")).
|
||||||
setMessageLargeType(LARGE_OTHER).
|
setMessageLargeType(LARGE_OTHER).
|
||||||
setMessageSmallType(SMALL_SYSTEM);
|
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、发送请假超时的消息
|
//3、发送请假超时的消息,然后批量修改请假消息的状态为超时且发送超时消息
|
||||||
if (!iWgzMessageService.saveBatch(messagesList)){
|
if (!updataList.isEmpty()){
|
||||||
log.error("批量添加请假超时消息失败!");
|
iWgzLeaveService.updateBatchById(updataList);
|
||||||
|
iWgzMessageService.saveBatch(messagesList);
|
||||||
}
|
}
|
||||||
//4、获取所有审批成功的请假消息,然后批量新增请假打卡数据到考勤表(如若需要日薪就需要连表查询)
|
//4、获取所有审批成功的请假消息,然后批量新增请假打卡数据到考勤表(如若需要日薪就需要连表查询)
|
||||||
List<WgzLeave> wgzLeaveListTwo = iWgzLeaveService.list(
|
List<WgzLeave> wgzLeaveListTwo = iWgzLeaveService.list(
|
||||||
@ -373,13 +400,12 @@ public class BusinessTask
|
|||||||
setUserId(wgzLeave.getUserId()).
|
setUserId(wgzLeave.getUserId()).
|
||||||
setLeaveMarkId(wgzLeave.getId()).
|
setLeaveMarkId(wgzLeave.getId()).
|
||||||
setDate(formattedDate).
|
setDate(formattedDate).
|
||||||
setExceptionType("6,");
|
setExceptionType("7,").setUpdateBy("系统").setCreateBy("系统");
|
||||||
attendanceList.add(wgzAttendance);
|
attendanceList.add(wgzAttendance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!iWgzAttendanceService.addAMissingCardRecord(attendanceList)){
|
if (!attendanceList.isEmpty()){
|
||||||
log.error("批量添加上班缺卡信息失败!");
|
iWgzAttendanceService.addAMissingCardRecord(attendanceList);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class WgzAppUserApplyForPayrollSettlementDetails {
|
|||||||
@ApiModelProperty("结算人")
|
@ApiModelProperty("结算人")
|
||||||
private String auditorUserName;
|
private String auditorUserName;
|
||||||
|
|
||||||
@ApiModelProperty("结算时间")
|
@ApiModelProperty("申请时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
@ApiModelProperty("工资金额")
|
@ApiModelProperty("工资金额")
|
||||||
|
@ -364,7 +364,8 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
//4、查询所有缺卡、迟到、早退的打卡记录
|
//4、查询所有缺卡、迟到、早退的打卡记录
|
||||||
LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
|
LambdaQueryWrapper<WgzAttendance> apply = new LambdaQueryWrapper<WgzAttendance>().
|
||||||
eq(WgzAttendance::getUserId, appUserId).
|
eq(WgzAttendance::getUserId, appUserId).
|
||||||
eq(WgzAttendance::getRecruitId, appById.getId())
|
eq(WgzAttendance::getRecruitId, appById.getId()).
|
||||||
|
isNull(WgzAttendance::getLeaveMarkId)
|
||||||
.and(wrapper -> wrapper
|
.and(wrapper -> wrapper
|
||||||
.eq(WgzAttendance::getLate, 1)
|
.eq(WgzAttendance::getLate, 1)
|
||||||
.or()
|
.or()
|
||||||
@ -386,11 +387,11 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
addRecord(wgzAttendance, 2, wgzAttendance.getClockOutTime(), list);
|
addRecord(wgzAttendance, 2, wgzAttendance.getClockOutTime(), list);
|
||||||
}
|
}
|
||||||
if (exceptionType.contains("3")) { // 上班缺卡
|
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);
|
addRecord(wgzAttendance, 3,dateTime, list);
|
||||||
}
|
}
|
||||||
if (exceptionType.contains("4")) { // 下班缺卡
|
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);
|
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.WgzAppUserDailyRecordRes;
|
||||||
import com.ruoyi.wgz.bo.res.WgzUserDailyCalendarRes;
|
import com.ruoyi.wgz.bo.res.WgzUserDailyCalendarRes;
|
||||||
import com.ruoyi.wgz.bo.rests.WgzAppAttachmentAcquisitionTwo;
|
import com.ruoyi.wgz.bo.rests.WgzAppAttachmentAcquisitionTwo;
|
||||||
|
import com.ruoyi.wgz.domain.WgzAttendance;
|
||||||
import com.ruoyi.wgz.domain.WgzDailyClock;
|
import com.ruoyi.wgz.domain.WgzDailyClock;
|
||||||
import com.ruoyi.wgz.domain.WgzMessage;
|
import com.ruoyi.wgz.domain.WgzMessage;
|
||||||
import com.ruoyi.wgz.domain.WgzUser;
|
import com.ruoyi.wgz.domain.WgzUser;
|
||||||
import com.ruoyi.wgz.mapper.WgzDailyClockMapper;
|
import com.ruoyi.wgz.mapper.WgzDailyClockMapper;
|
||||||
import com.ruoyi.wgz.service.IWgzDailyClockService;
|
import com.ruoyi.wgz.service.*;
|
||||||
import com.ruoyi.wgz.service.IWgzLeaveService;
|
|
||||||
import com.ruoyi.wgz.service.IWgzMessageService;
|
|
||||||
import com.ruoyi.wgz.service.IWgzUserService;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -91,6 +89,9 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IBgtMessageService iBgtMessageService;
|
private IBgtMessageService iBgtMessageService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IWgzAttendanceService iWgzAttendanceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WgzDailyClock queryById(Long id){
|
public WgzDailyClock queryById(Long id){
|
||||||
return getById(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最大和最小的日期之间差哪些日期,然后补齐数据
|
//5、查看fh的key最大和最小的日期之间差哪些日期,然后补齐数据
|
||||||
LocalDate minDate = fh.keySet().stream().map(LocalDate::parse).min(LocalDate::compareTo).orElse(null);
|
LocalDate minDate = fh.keySet().stream().map(LocalDate::parse).min(LocalDate::compareTo).orElse(null);
|
||||||
LocalDate now = LocalDate.now();
|
LocalDate now = LocalDate.now();
|
||||||
|
@ -253,11 +253,11 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
|
|||||||
//状态取消成功需要把对应消息的状态变更为【不需要操作】
|
//状态取消成功需要把对应消息的状态变更为【不需要操作】
|
||||||
iBgtMessageService.operation(
|
iBgtMessageService.operation(
|
||||||
USERTYPE_WGZ,
|
USERTYPE_WGZ,
|
||||||
recruit.getUserId(),
|
|
||||||
USERTYPE_BGT,
|
|
||||||
SecurityUtils.getAppUserId(),
|
SecurityUtils.getAppUserId(),
|
||||||
|
USERTYPE_BGT,
|
||||||
|
recruit.getUserId(),
|
||||||
we.getId(),
|
we.getId(),
|
||||||
SqlHelper.table(BgtProjectRecruitApply.class).getTableName()
|
SqlHelper.table(WgzLeave.class).getTableName()
|
||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}else{
|
}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
|
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>
|
||||||
<if test="dto.attendanceType !=null and dto.attendanceType ==2 ">
|
<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)
|
AND leave_mark_id IS NULL)
|
||||||
</if>
|
</if>
|
||||||
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
<if test="dto.attendanceType !=null and dto.attendanceType ==3 ">
|
||||||
|
Reference in New Issue
Block a user