优化
This commit is contained in:
@ -577,7 +577,7 @@ public class WgzAppController {
|
|||||||
//2、根据唯一标识获取到当前用户的招工
|
//2、根据唯一标识获取到当前用户的招工
|
||||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||||
//3、根据招工id获取到具体招工信息
|
//3、根据招工id获取到具体招工信息
|
||||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
|
||||||
Map<String, LocalTime> mp = new HashMap<>();
|
Map<String, LocalTime> mp = new HashMap<>();
|
||||||
mp.put("beginWorkTime", appById.getBeginWorkTime());
|
mp.put("beginWorkTime", appById.getBeginWorkTime());
|
||||||
mp.put("endWorkTime", appById.getEndWorkTime());
|
mp.put("endWorkTime", appById.getEndWorkTime());
|
||||||
|
@ -28,7 +28,7 @@ captcha:
|
|||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
# 服务器的HTTP端口,默认为8080
|
# 服务器的HTTP端口,默认为8080
|
||||||
port: 9099
|
port: 9098
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /ruoyi
|
context-path: /ruoyi
|
||||||
|
@ -249,7 +249,11 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
|||||||
throw new RuntimeException("已有工地!不可再次申请!");
|
throw new RuntimeException("已有工地!不可再次申请!");
|
||||||
}
|
}
|
||||||
WgzUser byId = wgzUserService.findByUserId(appUserId);
|
WgzUser byId = wgzUserService.findByUserId(appUserId);
|
||||||
if (!Objects.equals(appById.getTypeOfWork(), byId.getTypeOfWork())) {
|
if (byId == null) {
|
||||||
|
throw new RuntimeException("查询不到用户信息!");
|
||||||
|
}
|
||||||
|
List<String> list = Arrays.asList(byId.getTypeOfWork().split(","));
|
||||||
|
if (!list.contains(appById.getTypeOfWork())){
|
||||||
throw new RuntimeException("工种不匹配!");
|
throw new RuntimeException("工种不匹配!");
|
||||||
}
|
}
|
||||||
//4、判断当前用户是否已经申请过了,如果已经申请过了,就不能再次申请了
|
//4、判断当前用户是否已经申请过了,如果已经申请过了,就不能再次申请了
|
||||||
@ -263,6 +267,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
|
|||||||
}
|
}
|
||||||
//3、插入数据
|
//3、插入数据
|
||||||
BgtProjectRecruitApply bgtProjectRecruitApply = new BgtProjectRecruitApply();
|
BgtProjectRecruitApply bgtProjectRecruitApply = new BgtProjectRecruitApply();
|
||||||
|
bgtProjectRecruitApply.setTaskId(appById.getTaskId());
|
||||||
bgtProjectRecruitApply.setRecruitId(id);
|
bgtProjectRecruitApply.setRecruitId(id);
|
||||||
bgtProjectRecruitApply.setUserId(appUserId);
|
bgtProjectRecruitApply.setUserId(appUserId);
|
||||||
int insert = baseMapper.insert(bgtProjectRecruitApply);
|
int insert = baseMapper.insert(bgtProjectRecruitApply);
|
||||||
|
@ -32,7 +32,7 @@ import static com.ruoyi.common.constants.WgzAndBgtMessageConstant.*;
|
|||||||
/**
|
/**
|
||||||
* 业务定时任务
|
* 业务定时任务
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi businessTask.leave
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component("businessTask")
|
@Component("businessTask")
|
||||||
@ -138,7 +138,7 @@ public class BusinessTask
|
|||||||
.setDailyWage(recruit.getRecruitAmount())
|
.setDailyWage(recruit.getRecruitAmount())
|
||||||
.setDate(now)
|
.setDate(now)
|
||||||
.setMissedIn(1)
|
.setMissedIn(1)
|
||||||
.setExceptionType("3,");
|
.setExceptionType("3,").setUpdateBy("系统").setCreateBy("系统");
|
||||||
lists.add(attendance);
|
lists.add(attendance);
|
||||||
//添加消息提醒
|
//添加消息提醒
|
||||||
WgzMessage wgzMessage = new WgzMessage().
|
WgzMessage wgzMessage = new WgzMessage().
|
||||||
@ -150,7 +150,7 @@ public class BusinessTask
|
|||||||
// setTableId(apply.getId()).
|
// setTableId(apply.getId()).
|
||||||
// setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
// setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||||
setMessageLargeType(LARGE_OTHER).
|
setMessageLargeType(LARGE_OTHER).
|
||||||
setMessageSmallType(SMALL_SYSTEM);
|
setMessageSmallType(SMALL_SYSTEM).setUpdateBy("系统").setCreateBy("系统");
|
||||||
messages.add(wgzMessage);
|
messages.add(wgzMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ public class BusinessTask
|
|||||||
WgzAttendance attendance = new WgzAttendance()
|
WgzAttendance attendance = new WgzAttendance()
|
||||||
.setId(one.getId())
|
.setId(one.getId())
|
||||||
.setMissedOut(1)
|
.setMissedOut(1)
|
||||||
.setExceptionType("4,");
|
.setExceptionType("4,").setUpdateBy("系统").setCreateBy("系统");
|
||||||
lists.add(attendance);
|
lists.add(attendance);
|
||||||
//添加消息提醒
|
//添加消息提醒
|
||||||
WgzMessage wgzMessage = new WgzMessage().
|
WgzMessage wgzMessage = new WgzMessage().
|
||||||
@ -222,7 +222,7 @@ public class BusinessTask
|
|||||||
// setTableId(apply.getId()).
|
// setTableId(apply.getId()).
|
||||||
// setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
// setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
|
||||||
setMessageLargeType(LARGE_OTHER).
|
setMessageLargeType(LARGE_OTHER).
|
||||||
setMessageSmallType(SMALL_SYSTEM);
|
setMessageSmallType(SMALL_SYSTEM).setUpdateBy("系统").setCreateBy("系统");
|
||||||
messages.add(wgzMessage);
|
messages.add(wgzMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,9 +58,9 @@ public class WgzAppRealNameAuthenticationReq implements Serializable {
|
|||||||
@NotBlank(message = "地址不能为空")
|
@NotBlank(message = "地址不能为空")
|
||||||
private String site;
|
private String site;
|
||||||
|
|
||||||
@ApiModelProperty("联系电话")
|
// @ApiModelProperty("联系电话")
|
||||||
@NotBlank(message = "联系电话不能为空")
|
// @NotBlank(message = "联系电话不能为空")
|
||||||
private String phone;
|
// private String phone;
|
||||||
|
|
||||||
@ApiModelProperty("银行")
|
@ApiModelProperty("银行")
|
||||||
@NotBlank(message = "银行不能为空")
|
@NotBlank(message = "银行不能为空")
|
||||||
|
@ -163,7 +163,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
//2、获取当前用户所在的工地id
|
//2、获取当前用户所在的工地id
|
||||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||||
//3、根据工地id得到完整的工地信息
|
//3、根据工地id得到完整的工地信息
|
||||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
|
||||||
// //4、查看当前用户是否有请假申请,有请假申请并且通过,那就无法进行打卡------------------>此处代码将改写逻辑为:每天凌晨1分的时候直接找出已请假的人然后定时插入数据到打卡记录中标记为请假
|
// //4、查看当前用户是否有请假申请,有请假申请并且通过,那就无法进行打卡------------------>此处代码将改写逻辑为:每天凌晨1分的时候直接找出已请假的人然后定时插入数据到打卡记录中标记为请假
|
||||||
// String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
// String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
// WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate);
|
// WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate);
|
||||||
@ -174,7 +174,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
// }
|
// }
|
||||||
//5、查看当前人、当前工地、当天的打卡记录
|
//5、查看当前人、当前工地、当天的打卡记录
|
||||||
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
WgzAttendance we = publicFindByUserIdWait(appUserId, by.getId(), formattedDate);
|
WgzAttendance we = publicFindByUserIdWait(appUserId, by.getRecruitId(), formattedDate);
|
||||||
if (we !=null && we.getLeaveMarkId() != null && we.getLeaveMarkId()!= 0) {
|
if (we !=null && we.getLeaveMarkId() != null && we.getLeaveMarkId()!= 0) {
|
||||||
throw new RuntimeException("您有已通过的请假申请,请假时间为:"+formattedDate);
|
throw new RuntimeException("您有已通过的请假申请,请假时间为:"+formattedDate);
|
||||||
}
|
}
|
||||||
@ -187,17 +187,8 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
setPnchOsition(req.getPnchOsition());
|
setPnchOsition(req.getPnchOsition());
|
||||||
LocalDateTime now = LocalDateTime.now(); //当前完整年月日时分秒
|
LocalDateTime now = LocalDateTime.now(); //当前完整年月日时分秒
|
||||||
LocalTime localTime = now.toLocalTime(); //获取时分秒
|
LocalTime localTime = now.toLocalTime(); //获取时分秒
|
||||||
if (Objects.isNull(we)) { //表示当天第一次打卡---上班 否则 表示当天不是第一次打卡---下班
|
if (we !=null) {
|
||||||
wgzAttendance.setClockInTime(now);
|
//获取上次打卡时间与这次打卡时间的间隔是否超过3分钟
|
||||||
LocalTime beginWorkTime = appById.getBeginWorkTime(); //上班
|
|
||||||
if (!localTime.isBefore(beginWorkTime)) {
|
|
||||||
wgzAttendance.setLate(1); //迟到
|
|
||||||
wgzAttendance.setLateTime(now);
|
|
||||||
wgzAttendance.setExceptionType("1,");
|
|
||||||
}
|
|
||||||
return baseMapper.insert(wgzAttendance) > 0;
|
|
||||||
}else{
|
|
||||||
//7、获取上次打卡时间与这次打卡时间的间隔是否超过3分钟
|
|
||||||
boolean flag = isMinutesDifferenceGreaterThanThree(we.getClockInTime(), now);
|
boolean flag = isMinutesDifferenceGreaterThanThree(we.getClockInTime(), now);
|
||||||
if (!flag){
|
if (!flag){
|
||||||
throw new RuntimeException("打卡时间间隔不能少于3分钟");
|
throw new RuntimeException("打卡时间间隔不能少于3分钟");
|
||||||
@ -212,6 +203,15 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
wgzAttendance.setExceptionType(exceptionType+"2,");
|
wgzAttendance.setExceptionType(exceptionType+"2,");
|
||||||
}
|
}
|
||||||
return baseMapper.updateById(wgzAttendance) > 0;
|
return baseMapper.updateById(wgzAttendance) > 0;
|
||||||
|
}else{
|
||||||
|
wgzAttendance.setClockInTime(now);
|
||||||
|
LocalTime beginWorkTime = appById.getBeginWorkTime(); //上班
|
||||||
|
if (!localTime.isBefore(beginWorkTime)) {
|
||||||
|
wgzAttendance.setLate(1); //迟到
|
||||||
|
wgzAttendance.setLateTime(now);
|
||||||
|
wgzAttendance.setExceptionType("1,");
|
||||||
|
}
|
||||||
|
return baseMapper.insert(wgzAttendance) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
|
|||||||
Long appUserId = SecurityUtils.getAppUserId();
|
Long appUserId = SecurityUtils.getAppUserId();
|
||||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
|
||||||
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||||
WgzAttendance wgzAttendance = publicFindByUserIdWait(appUserId, by.getId(), formattedDate);
|
WgzAttendance wgzAttendance = publicFindByUserIdWait(appUserId, by.getRecruitId(), formattedDate);
|
||||||
//2、获取今日用户打卡状态
|
//2、获取今日用户打卡状态
|
||||||
if (wgzAttendance == null) {
|
if (wgzAttendance == null) {
|
||||||
res.setClockingCondition(0); //上班
|
res.setClockingCondition(0); //上班
|
||||||
|
@ -182,7 +182,7 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
|
|||||||
});
|
});
|
||||||
//4、获取当前务工者的招工信息的主题及招工创建人的基本信息
|
//4、获取当前务工者的招工信息的主题及招工创建人的基本信息
|
||||||
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(SecurityUtils.getAppUserId());
|
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(SecurityUtils.getAppUserId());
|
||||||
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
|
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
|
||||||
BgtUser one = iBgtUserService.getOne(
|
BgtUser one = iBgtUserService.getOne(
|
||||||
new LambdaQueryWrapper<BgtUser>().
|
new LambdaQueryWrapper<BgtUser>().
|
||||||
eq(BgtUser::getUserId, appById.getUserId())
|
eq(BgtUser::getUserId, appById.getUserId())
|
||||||
|
Reference in New Issue
Block a user