This commit is contained in:
2025-03-11 11:24:59 +08:00
parent d48aa9aa67
commit e20c8da97c
76 changed files with 81 additions and 17 deletions

View File

@ -25,6 +25,7 @@ import com.ruoyi.common.enums.RecruitApplyStatus;
import com.ruoyi.common.enums.RecruitStatus;
import com.ruoyi.common.exception.BaseException;
import com.ruoyi.common.service.IAnnexService;
import com.ruoyi.common.service.IAsyncService;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysDictTypeService;
@ -62,22 +63,31 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
@Autowired
private IAnnexService annexService;
@Autowired
private IWgzScoreRecordService scoreRecordService;
@Autowired
private IWgzUserService wgzUserService;
@Autowired
@Lazy
private IBgtProjectRecruitService iBgtProjectRecruitService;
@Autowired
@Lazy
private IWgzMessageService iWgzMessageService;
@Autowired
@Lazy
private IBgtMessageService iBgtMessageService;
@Autowired
private ISysDictTypeService dictTypeService;
@Autowired
private IAsyncService iAsyncService;
@Override
public BgtProjectRecruitApply queryById(Long id) {
return getById(id);
@ -542,6 +552,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
String s = iWgzMessageService.JudgingRecruitment(req.getRecruitApplyId(), recruit.getRecruitStaffNum(), recruit.getRecruitEndTime());
switch (s) {
case "1":
//异步修改状态为已招满
iAsyncService.updateRecruitStatus(recruit);
throw new RuntimeException("已招满!");
case "2":
throw new RuntimeException("已失效!");
@ -555,9 +567,13 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
}
int up = baseMapper.updateById(apply);
if (up == 0) {
throw new RuntimeException("插入数据失败!");
throw new RuntimeException("修改招工申请信息失败!");
}
//3-2、修改消息
boolean b = iWgzMessageService.updateById(new WgzMessage().setId(req.getMessageId()).setIsOperation("2"));
if (!b) {
throw new RuntimeException("修改消息失败!");
}
iWgzMessageService.updateById(new WgzMessage().setId(req.getMessageId()).setIsOperation("2"));
//4系统拒绝消息
SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", recruit.getTypeOfWork());
Map<String, String> mp = new HashMap<>();

View File

@ -0,0 +1,8 @@
package com.ruoyi.common.service;
import com.ruoyi.bgt.domain.BgtProjectRecruit;
public interface IAsyncService {
//异步修改招工状态为招满
void updateRecruitStatus(BgtProjectRecruit recruit);
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.common.service.impl;
import com.ruoyi.bgt.domain.BgtProjectRecruit;
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
import com.ruoyi.common.service.IAsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@Service
public class AsyncServiceImpl implements IAsyncService {
@Autowired
private IBgtProjectRecruitService iBgtProjectRecruitService;
@Override
@Async
public void updateRecruitStatus(BgtProjectRecruit recruit) {
recruit.setStatus("2");
iBgtProjectRecruitService.updateById(recruit);
}
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.wgz.bo.res;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -56,6 +57,10 @@ public class WgzAppRegisteredProjectRes implements Serializable {
@ApiModelProperty("已报名数量")
private Integer numberOfRegistered;
@ApiModelProperty("发布时间")
@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
private LocalDateTime taskCreateTime;
@ApiModelProperty("工种")
private String typeOfWork;

View File

@ -1,10 +1,12 @@
package com.ruoyi.wgz.bo.res;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
@ -27,6 +29,7 @@ public class WgzAppUnderwayRes implements Serializable {
private String recruitName;
@ApiModelProperty("创建时间")
@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
private LocalDateTime createTime;
@ApiModelProperty("封面图(多个逗号分隔)")
@ -51,6 +54,7 @@ public class WgzAppUnderwayRes implements Serializable {
private String recruitRequirement;
@ApiModelProperty("发布时间")
@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
private LocalDateTime taskCreateTime;
@ApiModelProperty("进场时间")
@ -59,6 +63,12 @@ public class WgzAppUnderwayRes implements Serializable {
@ApiModelProperty("离场时间")
private LocalDate leaveTime;
@ApiModelProperty("工种")
private String typeOfWork;
@ApiModelProperty("工种名称")
private String typeOfWorkLabel;
// @ApiModelProperty("已报名数量")
// private Integer numberOfRegistered;

View File

@ -37,6 +37,7 @@ import com.ruoyi.wgz.service.IWgzAttendanceService;
import com.ruoyi.wgz.service.IWgzLeaveService;
import com.ruoyi.wgz.service.IWgzUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -61,19 +62,14 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
public static final String OffDuty = "1";
@Autowired
@Lazy
private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
@Autowired
private IBgtProjectRecruitService iBgtProjectRecruitService;
@Autowired
private IWgzLeaveService iWgzLeaveService;
@Autowired
private IFbsProjectTaskService taskService;
@Autowired
private IWgzUserService wgzUserService;
@Override

View File

@ -230,12 +230,15 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
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);
//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);
if (!wgzDailyClocks.isEmpty()){
throw new RuntimeException("当前时间已存在补卡记录!");
}
//1、组装数据
WgzDailyClock dc = new WgzDailyClock();
BeanUtils.copyProperties(req,dc);

View File

@ -139,11 +139,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.task_name,
c.task_address,
c.task_img,
c.create_time as taskCreateTime
c.create_time as taskCreateTime,
d.dict_label AS typeOfWorkLabel
FROM
bgt_project_recruit_apply as a
LEFT JOIN bgt_project_recruit as b on(a.recruit_id = b.id and b.del_flag = 0 )
LEFT JOIN fbs_project_task as c ON (b.task_id = c.id AND c.del_flag = 0)
LEFT JOIN sys_dict_data AS d ON ( d.dict_type = 'type_of_work' AND d.dict_value = b.type_of_work )
<where>
<if test="req.userId!=null and req.userId!=0 ">
a.user_id = #{req.userId} AND

View File

@ -106,6 +106,7 @@ 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.status = '1' and
b.del_flag = 0
order by b.create_time desc
</select>