This commit is contained in:
2025-03-11 09:27:43 +08:00
parent 8a6a812617
commit 1261d872aa
11 changed files with 84 additions and 46 deletions

View File

@ -6,6 +6,7 @@
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
import com.ruoyi.bgt.service.IBgtUserService;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.bo.AnnexQueryBo;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.BgtUser;
@ -105,6 +106,7 @@
*/
@ApiOperation("【务工者账号注册】")
@PostMapping("/wgzRegister")
@RepeatSubmit
public AjaxResult<Boolean> userRegister(@Validated @RequestBody WgzAppRegisterReq bo) {
return AjaxResult.success(iWgzUserService.userRegister(bo));
}
@ -124,6 +126,7 @@
*/
@ApiOperation("【我的】修改用户头像")
// //@PreAuthorize("@ss.hasPermi('wgzApp:user:userModifyingUserProfilePicture')")
@RepeatSubmit
@PutMapping("/wgzUserModifyingUserProfilePicture")
public AjaxResult<Boolean> userModifyingUserProfilePicture(@Validated @RequestBody WgzAppModifyingUserProfilePictureReq req) {
return AjaxResult.success(iWgzUserService.userModifyingUserProfilePicture(req));
@ -144,6 +147,7 @@
*/
@ApiOperation("【我的】实名认证")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userRealNameAuthentication')")
@RepeatSubmit
@PutMapping("/wgzUserRealNameAuthentication")
public AjaxResult<Boolean> userRealNameAuthentication(@Validated @RequestBody WgzAppRealNameAuthenticationReq req) {
return AjaxResult.success(iWgzUserService.userRealNameAuthentication(req));
@ -183,6 +187,7 @@
*/
@ApiOperation("【我的】【岗前培训】岗前培训·提交试卷")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userSubmitATestPaper')")
@RepeatSubmit
@PostMapping("/WgzUserSubmitATestPaper")
public AjaxResult<WgzAppSubmitATestPaperRes> userSubmitATestPaper(@Validated @RequestBody WgzAppSubmitATestPaperReq req) {
return AjaxResult.success(iWgzQuestionSaveService.userSubmitATestPaper(req));
@ -203,6 +208,7 @@
*/
@ApiOperation("【我的】【请假】请假·提交请假上下班的时间需要等待zt创建好mysql字段")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userSubmitLeave')")
@RepeatSubmit
@PostMapping("/WgzAppSubmitLeave")
public AjaxResult<Boolean> userSubmitLeave(@Validated @RequestBody WgzAppSubmitLeaveReq req) {
return AjaxResult.success(iWgzLeaveService.userSubmitLeave(req));
@ -213,6 +219,7 @@
*/
@ApiOperation("【我的】【请假】请假·取消请假")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userCancelLeave')")
@RepeatSubmit
@PutMapping("/WgzAppUserCancelLeave")
public AjaxResult<Boolean> userCancelLeave(@Validated @RequestBody WgzAppCancelLeaveReq req) {
return AjaxResult.success(iWgzLeaveService.userCancelLeave(req));
@ -274,6 +281,7 @@
*/
@ApiOperation("【考勤打卡】【打卡】 提交上下班打卡)")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userSubmitTheClock')")
@RepeatSubmit
@PostMapping("/WgzAppUserSubmitTheClock")
public AjaxResult<Boolean> userSubmitTheClock(@Validated @RequestBody WgzAppSubmitTheClockReq req) {
return AjaxResult.success(iWgzAttendanceService.userSubmitTheClock(req));
@ -304,6 +312,7 @@
*/
@ApiOperation("【考勤打卡】【打卡日历】 补卡申请)")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userCardReplacementApplication')")
@RepeatSubmit
@PostMapping("/WgzAppUserCardReplacementApplication")
public AjaxResult<Boolean> userCardReplacementApplication(@Validated @RequestBody WgzAppCardReplacementApplicationReq req) {
return AjaxResult.success(iWgzReissueacardService.userCardReplacementApplication(req));
@ -364,6 +373,7 @@
*/
@ApiOperation("【首页】【已报名项目】 已报名项目·取消报名)")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userCancelRegistration')")
@RepeatSubmit
@DeleteMapping("/WgzAppUserCancelRegistration/{recruitApplyId}")
public AjaxResult<Boolean> userCancelRegistration(@NotEmpty(message = "招工主键不能为空") @PathVariable Long recruitApplyId) {
return AjaxResult.success(iBgtProjectRecruitApplyService.userCancelRegistration(recruitApplyId));
@ -447,6 +457,7 @@
*/
@ApiOperation("【首页】【项目进行中|已完成项目】 申请工资结算(新增)")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userApplyForPayrollSettlementAdd')")
@RepeatSubmit
@PostMapping("/WgzAppUserApplyForPayrollSettlementAdd")
public AjaxResult<Boolean> userApplyForPayrollSettlementAdd(@Validated @RequestBody WgzApplyForPayrollSettlementAddReq req) {
return AjaxResult.success(iWgzPayCalculationService.userApplyForPayrollSettlementAdd(req));
@ -498,6 +509,7 @@
*/
@ApiOperation("【消息】【报名消息】 报名消息·确认|拒绝报名")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userConfirmRegistration')")
@RepeatSubmit
@PutMapping("/WgzAppUserConfirmRegistration")
public AjaxResult<Boolean> userConfirmRegistration(@Validated @RequestBody WgzAppConfirmRegistrationReq req) {
return AjaxResult.success(iBgtProjectRecruitApplyService.userConfirmRegistration(req));
@ -597,6 +609,7 @@
*/
@ApiOperation("【通用】修改已读未读状态")
//@PreAuthorize("@ss.hasPermi('wgzApp:user:userReadUnread')")
@RepeatSubmit
@PutMapping("/WgzAppUserReadUnread")
public AjaxResult<Boolean> userReadUnread(@Validated @RequestBody WgzAppReadUnreadReq req) {
return AjaxResult.success(iWgzMessageService.userReadUnread(req));

View File

@ -12,9 +12,9 @@ spring:
# 主库数据源
master:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/work_platform?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: work_platform
password: work_platform
url: jdbc:mysql://localhost:3386/lhyg?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
username: root2
password: CQyj20200808!
# 从库数据源
# slave:
# driverClassName: com.mysql.cj.jdbc.Driver
@ -72,7 +72,7 @@ spring:
# 数据库索引
database: 15
# 密码
password: 123456
# password: 123456
# 连接超时时间
timeout: 10s
# 是否开启ssl

View File

@ -68,7 +68,7 @@ spring:
messages:
# 国际化资源文件路径
basename: i18n/messages
# dev 开发环境 pord 正式环境
# dev 开发环境 prod 正式环境
profiles:
active: dev
# 文件上传

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.google.errorprone.annotations.Var;
import com.ruoyi.bgt.bo.BgtProjectRecruitApplyQueryBo;
import com.ruoyi.bgt.domain.BgtMessage;
import com.ruoyi.bgt.domain.BgtProjectRecruit;
@ -41,6 +42,7 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import springfox.documentation.builders.ValidationResult;
import java.text.DecimalFormat;
import java.time.LocalDate;
@ -193,7 +195,6 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean consent(BgtProjectRecruitApplyConsentDTO dto) {
BgtProjectRecruitApply recruitApply = getById(dto.getId());
List<BgtProjectRecruitApply> list = baseMapper.selectList(Wrappers.<BgtProjectRecruitApply>lambdaQuery()
.eq(BgtProjectRecruitApply::getUserId, recruitApply.getUserId())
@ -270,7 +271,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
Long appUserId = SecurityUtils.getAppUserId();
//2、当前申请报名的工地信息
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(id);
//3、检查当前用户是否已经有工地了、检查当前用户是否满足对应工种
//3、检查当前用户是否实名认证
Integer i = baseMapper.selectCount(
new LambdaQueryWrapper<BgtProjectRecruitApply>().
eq(BgtProjectRecruitApply::getUserId, appUserId).
@ -283,22 +284,26 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
if (byId.getIdentityCard() == null || byId.getIdentityCard()=="") {
throw new RuntimeException("当前用户还未实名认证!");
}
//3-2、是否已有工地
if (i > 0) {
throw new RuntimeException("已有工地!不可再次申请!");
}
//3-3、是否重复申请同一工地先检查最后一次是否离场或取消如果是就还能再次申请这个项目否则无法申请
BgtProjectRecruitApply oneApply = baseMapper.selectOne(
new LambdaQueryWrapper<BgtProjectRecruitApply>().
eq(BgtProjectRecruitApply::getUserId, appUserId).
eq(BgtProjectRecruitApply::getRecruitId, id).
last("limit 1")
);
if (oneApply!=null && !(oneApply.getStatus().equals("6") || oneApply.getStatus().equals("7"))) {
throw new RuntimeException("已申请过当前项目,如若再次申请请发起退场或者取消操作!");
}
//3-4、检查当前用户是否满足对应工种
List<String> list = Arrays.asList(byId.getTypeOfWork().split(","));
if (!list.contains(appById.getTypeOfWork())){
throw new RuntimeException("工种不匹配!");
}
//4、判断当前用户是否已经申请过了如果已经申请过了就不能再次申请了
Integer integer = baseMapper.selectCount(
new LambdaQueryWrapper<BgtProjectRecruitApply>().
eq(BgtProjectRecruitApply::getUserId, appUserId).
eq(BgtProjectRecruitApply::getRecruitId, id)
);
if (integer > 0) {
throw new RuntimeException("已申请过了!不可再次申请!");
}
//3、插入数据
BgtProjectRecruitApply bgtProjectRecruitApply = new BgtProjectRecruitApply();
bgtProjectRecruitApply.setTaskId(appById.getTaskId());
@ -478,15 +483,16 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
return insert;
}
@Override
@Transactional
public Boolean userCancelRegistration(Long recruitApplyId) {
BgtProjectRecruitApply by = baseMapper.selectById(recruitApplyId);
BgtProjectRecruitApply bgtProjectRecruitApply = new BgtProjectRecruitApply();
bgtProjectRecruitApply.setId(recruitApplyId);
// bgtProjectRecruitApply.setStatus("7");
if (baseMapper.deleteById(bgtProjectRecruitApply) > 0) {
bgtProjectRecruitApply.setStatus("7");
if (baseMapper.updateById(bgtProjectRecruitApply) > 0) {
Long appUserId = SecurityUtils.getAppUserId();
BgtProjectRecruitApply by = baseMapper.selectById(recruitApplyId);
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
Map<String, String> mp = new HashMap<>();
mp.put("projectName", appById.getRecruitName());
@ -497,8 +503,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
setRecipientId(appUserId).
setHeadline(wgzMessage(mp, "103")).
setSubheading(wgzMessage(mp, "104")).
// setTableId(bgtProjectRecruitApply.getId()).
// setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
setTableId(bgtProjectRecruitApply.getId()).
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
setMessageLargeType(LARGE_OTHER).
setMessageSmallType(SMALL_SYSTEM);
if (!iWgzMessageService.sendAMessage(wgzMessage)) {
@ -534,10 +540,13 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
case "2":
throw new RuntimeException("已失效!");
}
//3、更新报名状态、及更新消息的操作状态
//3、更新报名状态、及更新消息的操作状态(用户同意更新进场时间、状态;用户拒绝更新状态)
BgtProjectRecruitApply apply = new BgtProjectRecruitApply();
apply.setId(req.getRecruitApplyId());
apply.setStatus(req.getStatus());
if (req.getStatus().equals("3")){
apply.setStatus("5");
}
int up = baseMapper.updateById(apply);
if (up == 0) {
throw new RuntimeException("插入数据失败!");
@ -588,7 +597,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
setSubheading(wgzMessage(mp, "108")).
setTableId(apply.getId()).
setTableName(SqlHelper.table(BgtProjectRecruitApply.class).getTableName()).
setMessageLargeType(SMALL_SYSTEM);
setMessageLargeType(LARGE_APPLY).
setMessageSmallType(SMALL_SYSTEM);
if (!iWgzMessageService.sendAMessage(wgzMessage)) {
throw new RuntimeException("系统消息报名同意发送失败!");
}

View File

@ -231,11 +231,11 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
pe.setCurrent(req.getPageNum());
pe.setSize(req.getPageSize());
TableDataInfo<WgzAppRegisteredProjectRes> wgzAppRegisteredProjectResTableDataInfo = PageUtils.buildDataInfo(baseMapper.userRegisteredProject(pe, userId));
wgzAppRegisteredProjectResTableDataInfo.getRows().forEach(registeredProjectRes -> {
//1、获取当前用户的取消、满员、失效、同意、拒绝状态
//1、获取当前项目下的成员
List<WgzAppCancelRegistrationProjectDetailsTwo> wgzUser = baseMapper.GetsTheMembersUnderTheCurrentProject(registeredProjectRes.getId());
});
// wgzAppRegisteredProjectResTableDataInfo.getRows().forEach(registeredProjectRes -> {
// //1、获取当前用户的取消、满员、失效、同意、拒绝状态
// //1、获取当前项目下的成员
// List<WgzAppCancelRegistrationProjectDetailsTwo> wgzUser = baseMapper.GetsTheMembersUnderTheCurrentProject(registeredProjectRes.getId());
// });
return wgzAppRegisteredProjectResTableDataInfo;
}
@ -264,7 +264,9 @@ public class BgtProjectRecruitServiceImpl extends ServicePlusImpl<BgtProjectRecr
.in(WgzMessage::getTableId, req.getRecruitApplyId())
.in(WgzMessage::getTableName, SqlHelper.table(BgtProjectRecruitApply.class).getTableName())
);
res.setIsOperation(one.getIsOperation());
if (one !=null){
res.setIsOperation(one.getIsOperation());
}
res.setFull(wgzAppProjectDetailsRes.getStatus());
//5、获取当前申请人是否操作的对应状态
BgtProjectRecruitApply byId = bgtProjectRecruitApplyService.getById(req.getRecruitApplyId());

View File

@ -212,7 +212,7 @@ public class FbsProjectTaskServiceImpl extends ServicePlusImpl<FbsProjectTaskMap
Integer totalNum = attendanceService.dayTotalNum(id, date);
appTaskDetailVO.setTotalNum(totalNum);
//计算到岗率
if(totalNum!=0){
if(totalNum!=0 && bgtDayAttendanceCountVOS.size()>0){
BgtDayAttendanceCountVO bgtDayAttendanceCountVO = bgtDayAttendanceCountVOS.get(bgtDayAttendanceCountVOS.size() - 1);
int rate = new BigDecimal(bgtDayAttendanceCountVO.getReportToDutyNum()).divide(new BigDecimal(totalNum), 2, RoundingMode.HALF_UP)
.multiply(new BigDecimal(100)).intValue();

View File

@ -12,6 +12,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
@Data
@ -22,6 +23,9 @@ public class WgzAppDailyClockReq implements Serializable {
@ApiModelProperty("日报状态0正常 1补卡")
private String status;
@ApiModelProperty("status为1时补卡日期")
private LocalDateTime rqData;
@ApiModelProperty("今日完成工作")
private String finishToday;

View File

@ -188,6 +188,7 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
if (!flag) {
throw new RuntimeException("打卡时间间隔不能少于3分钟");
}
wgzAttendance.setId(we.getId());
wgzAttendance.setClockOutTime(now);
LocalTime endWorkTime = appById.getEndWorkTime(); //下班
String exceptionType = we.getExceptionType();
@ -213,19 +214,17 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
}
/**
* 判断两个 LocalDateTime 之间的差值分钟数是否超过 3
* 判断两个 LocalDateTime 之间的差值是否超过 3 分钟
*
* @param startTime 开始时间
* @param endTime 结束时间
* @return 如果差值分钟数超过 3 返回 true否则返回 false
* @return 如果差值超过 3 分钟返回 true否则返回 false
*/
public static boolean isMinutesDifferenceGreaterThanThree(LocalDateTime startTime, LocalDateTime endTime) {
// 计算两个时间之间的持续时间
Duration duration = Duration.between(startTime, endTime);
// 获取持续时间的分钟数
long minutes = duration.toMinutes();
// 判断分钟数是否超过 3
return Math.abs(minutes) > 3;
public boolean isMinutesDifferenceGreaterThanThree(LocalDateTime startTime, LocalDateTime endTime) {
// 计算两个时间之间的持续时间(秒级精度)
long seconds = Duration.between(startTime, endTime).getSeconds();
// 超过 180 秒3 分钟)则返回 true
return Math.abs(seconds) > 180;
}
@Override

View File

@ -178,9 +178,9 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
tempDate = tempDate.plusDays(1);
}
//2、查询当前人员指定日期的所有日报情况
QueryWrapper<WgzDailyClock> queryWrapper = new QueryWrapper<>();
queryWrapper.apply("DATE_FORMAT(dily_time, '%Y-%m') = {0}", req.getYearMonth()); // 使用 apply 方法添加自定义 SQL 条件
List<WgzDailyClock> wgzDailyClocks = baseMapper.selectList(queryWrapper);
Long appUserId = SecurityUtils.getAppUserId();
LambdaQueryWrapper<WgzDailyClock> apply = new LambdaQueryWrapper<WgzDailyClock>().eq(WgzDailyClock::getUserId, appUserId).apply("DATE_FORMAT(dily_time, '%Y-%m') = {0}", req.getYearMonth());
List<WgzDailyClock> wgzDailyClocks = baseMapper.selectList(apply);
//3、查看当前人、当前项目、当前月是否有请假
Map<LocalDate, LocalDate> ll = iWgzLeaveService.selectByUserCancelLeave(req.getYearMonth());
//4、将获取的年月与数据库中的日期进行比对然后填充数据
@ -195,7 +195,6 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
setId(wgzDailyClock.getId()).
setDilyTime(wgzDailyClock.getDilyTime()).
setPnchOsition(wgzDailyClock.getPnchOsition());
if (ll.get(date) !=null && ll.get(date).equals(clockDate)) {
wgzAppAttachmentAcquisitionTwo.setStatus("2"); //全天请假
}
@ -226,13 +225,24 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
Long appUserId = SecurityUtils.getAppUserId();
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
//2、为补卡时now的时间就为前端传递的日期
LocalDateTime now = LocalDateTime.now();
if (req.getStatus().equals("1")){
now = req.getRqData();
}
// //3、判断当前时间的补卡是否存在存在就不允许插入
// LambdaQueryWrapper<WgzDailyClock> apply = new LambdaQueryWrapper<WgzDailyClock>()
// .eq(WgzDailyClock::getUserId, appUserId)
// .eq(WgzDailyClock::getRecruitId, appById.getId())
// .eq(WgzDailyClock::getDilyTime, now);
// List<WgzDailyClock> wgzDailyClocks = baseMapper.selectList(apply);
//1、组装数据
WgzDailyClock dc = new WgzDailyClock();
BeanUtils.copyProperties(req,dc);
dc.setStatus(req.getStatus());
dc.setRecruitId(appUserId);
dc.setUserId(appUserId);
dc.setDilyTime(LocalDateTime.now());
dc.setDilyTime(now);
dc.setAuditorUserId(appById.getUserId());
int insert = baseMapper.insert(dc);
//2、插入成功且状态为1那么就需要发送消息给【补日报】的人和上级【招工】

View File

@ -237,7 +237,7 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
if(count == num){
return "1"; //已招满
}
if (recruitEndTime.isAfter(LocalDate.now())){
if (!LocalDate.now().isBefore(recruitEndTime)){
return "2"; //已失效
}
return "0";

View File

@ -91,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.recruit_id = #{recruitId} AND a.del_flag = 0
</select>
<!--b.id not in (SELECT recruit_id FROM bgt_project_recruit_apply WHERE user_id = #{req.userId})and-->
<select id="userJobListing" resultType="com.ruoyi.wgz.bo.res.WgzAppJobListingRes">
SELECT
b.*,
@ -105,7 +106,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_dict_data as d ON (d.dict_type = 'type_of_work' and d.dict_value = b.type_of_work)
WHERE
DATE_FORMAT(NOW(), '%Y-%m-%d') BETWEEN b.recruit_begin_time AND b.recruit_end_time and
b.id not in (SELECT recruit_id FROM bgt_project_recruit_apply WHERE user_id = #{req.userId})and
b.del_flag = 0
order by b.create_time desc
</select>