This commit is contained in:
2025-03-10 11:45:45 +08:00
parent 11255deebc
commit 708458df71
16 changed files with 669 additions and 640 deletions

View File

@ -524,7 +524,7 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
BgtProjectRecruitApply recruitApply = queryById(req.getRecruitApplyId());
BgtProjectRecruit recruit = iBgtProjectRecruitService.getAppById(recruitApply.getRecruitId());
//数据库行级锁
String s = new WgzMessageServiceImpl().JudgingRecruitment(req.getRecruitApplyId(), recruit.getRecruitStaffNum(), recruit.getRecruitEndTime());
String s = iWgzMessageService.JudgingRecruitment(req.getRecruitApplyId(), recruit.getRecruitStaffNum(), recruit.getRecruitEndTime());
switch (s) {
case "1":
throw new RuntimeException("已招满!");

View File

@ -47,6 +47,10 @@ public class WgzAppJobListingRes implements Serializable {
@ApiModelProperty("工种")
private String typeOfWork;
@ApiModelProperty("工种名称")
private String typeOfWorkLabel;
@ApiModelProperty("申请者数量")
private Integer numberOfRegistered;

View File

@ -74,6 +74,12 @@ public class WgzAppProjectDetailsRes implements Serializable {
@ApiModelProperty("招工要求")
private String recruitRequirement;
@ApiModelProperty("工种")
private String typeOfWork;
@ApiModelProperty("工种名称")
private String typeOfWorkLabel;
//---------
//---------
//---------

View File

@ -32,7 +32,7 @@ public class WgzAppRegisteredProjectRes implements Serializable {
@ApiModelProperty("招工名称")
private String recruitName;
@ApiModelProperty("创建时间")
@ApiModelProperty("创建时间/报名时间")
private LocalDateTime createTime;
@ApiModelProperty("封面图(多个逗号分隔)")
@ -59,5 +59,11 @@ public class WgzAppRegisteredProjectRes implements Serializable {
@ApiModelProperty("已报名数量")
private Integer numberOfRegistered;
@ApiModelProperty("工种")
private String typeOfWork;
@ApiModelProperty("工种名称")
private String typeOfWorkLabel;
}

View File

@ -82,6 +82,9 @@ public class WgzAppRegistrationInformationRes implements Serializable {
@ApiModelProperty("招工是否正常0正常 1已招满 2已失效")
private String full;
@ApiModelProperty("务工者同意拒绝状态3务工者同意 4务工者拒绝")
private String status;
// @ApiModelProperty("附件实体数据")
// private List<Annex> annex;

View File

@ -11,6 +11,7 @@ import com.ruoyi.wgz.domain.WgzMessage;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@ -35,6 +36,7 @@ public interface WgzMessageMapper extends BaseMapperPlus<WgzMessage> {
//分页查询消息列表
Page<WgzAppGetMessageListRes> pagingQueryTheMessageList(@Param("page") Page<WgzAppGetMessageListReq> page,@Param("req") WgzAppGetMessageListReq req);
@Select("SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = #{recruitId} and status in ('3','4')")
int countRecruitApply(Long recruitId);
@Select("SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = #{recruitId} and status in ('3','4') FOR UPDATE")
@Options(useCache = false) // 禁用 MyBatis 缓存
int countRecruitApply(@Param("recruitId") Long recruitId);
}

View File

@ -12,6 +12,7 @@ import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.validation.annotation.Validated;
import java.time.LocalDate;
import java.util.Collection;
import java.util.List;
@ -87,6 +88,11 @@ public interface IWgzMessageService extends IServicePlus<WgzMessage> {
*/
WgzAppRegistrationInformationRes userRegistrationInformation(Long messageId);
/**
* 判断招工是否已招满或已过期
*/
String JudgingRecruitment(Long recruitId, int num, LocalDate recruitEndTime);
/**
* 修改已读未读状态
*/

View File

@ -160,16 +160,13 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
//3、根据工地id得到完整的工地信息
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
// //4、查看当前用户是否有请假申请有请假申请并且通过那就无法进行打卡------------------>此处代码将改写逻辑为每天凌晨1分的时候直接找出已请假的人然后定时插入数据到打卡记录中标记为请假
// String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// WgzLeave wgzLeave = iWgzLeaveService.FindAskForLeaveOrNotInfo(appUserId, by.getId(), formattedDate);
// if (wgzLeave != null) { //表示有请假申请
// LocalDateTime startTime = wgzLeave.getStartTime();
// LocalDate localDate = startTime.toLocalDate();
// throw new RuntimeException("您有已通过的请假申请,请假时间为:"+localDate);
// }
//4、在进场时间时才能打卡如果有退场记录就不允许打卡
if (by.getEntryTime() == null) {
throw new RuntimeException("需要进场才能实现打卡操作!");
}
if (by.getLeaveTime() != null) {
throw new RuntimeException("您已离场,无法进行打卡操作!");
}
//5、查看当前人、当前工地、当天的打卡记录
String formattedDate = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
WgzAttendance we = publicFindByUserIdWait(appUserId, by.getRecruitId(), formattedDate);

View File

@ -36,6 +36,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.wgz.bo.WgzMessageQueryBo;
import com.ruoyi.wgz.mapper.WgzMessageMapper;
import com.ruoyi.wgz.service.IWgzMessageService;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.util.*;
@ -228,14 +230,10 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
* @param recruitEndTime 招工结束时间
* @return
*/
@Override
public String JudgingRecruitment(Long recruitId,int num,LocalDate recruitEndTime) {
//使用数据库行级锁
int count = baseMapper.countRecruitApply(recruitId);
// int count = iBgtProjectRecruitApplyService.count(
// Wrappers.<BgtProjectRecruitApply>lambdaQuery()
// .eq(BgtProjectRecruitApply::getRecruitId, recruitId)
// .in(BgtProjectRecruitApply::getStatus, Arrays.asList("3", "4"))
// );
if(count == num){
return "1";
}

View File

@ -47,10 +47,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.*,
b.task_name,
b.task_address,
b.task_img
b.task_img,
d.dict_label AS typeOfWorkLabel
FROM
bgt_project_recruit as a
LEFT JOIN fbs_project_task as b ON (a.task_id = b.id AND b.del_flag = 0)
LEFT JOIN sys_dict_data AS d ON ( d.dict_type = 'type_of_work' AND d.dict_value = a.type_of_work )
WHERE
a.id = #{id} AND a.del_flag = 0
</select>
@ -62,11 +64,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.task_name,
c.task_address,
c.task_img,
d.dict_label AS typeOfWorkLabel,
(SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = b.id) as numberOfRegistered
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
a.user_id = #{userId} AND
(a.status = '0' or a.status = '1') AND
@ -93,10 +97,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
c.task_name,
c.task_address,
c.task_img,
d.dict_label as typeOfWorkLabel,
(SELECT count(1) FROM bgt_project_recruit_apply WHERE recruit_id = b.id) as numberOfRegistered
FROM
bgt_project_recruit as b
LEFT JOIN fbs_project_task as c ON (c.id = b.task_id)
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

View File

@ -132,6 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT
a.id as recruitApplyId,
a.entry_time as entryTime,
a.status as status,
b.id as recruitId,
b.create_time as createTime,
b.recruit_name as recruitName,

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB