Merge remote-tracking branch 'origin/master'

This commit is contained in:
zt
2025-03-06 16:51:00 +08:00
36 changed files with 70 additions and 13 deletions

View File

@ -39,6 +39,7 @@ import com.ruoyi.wgz.domain.WgzUser;
import com.ruoyi.wgz.service.IWgzMessageService;
import com.ruoyi.wgz.service.IWgzScoreRecordService;
import com.ruoyi.wgz.service.IWgzUserService;
import com.ruoyi.wgz.service.impl.WgzMessageServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
@ -255,13 +256,16 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
eq(BgtProjectRecruitApply::getUserId, appUserId).
in(BgtProjectRecruitApply::getStatus, "3", "5")
);
if (i > 0) {
throw new RuntimeException("已有工地!不可再次申请!");
}
WgzUser byId = wgzUserService.findByUserId(appUserId);
if (byId == null) {
throw new RuntimeException("查询不到用户信息!");
}
if (byId.getIdentityCard() == null || byId.getIdentityCard()=="") {
throw new RuntimeException("当前用户还未实名认证!");
}
if (i > 0) {
throw new RuntimeException("已有工地!不可再次申请!");
}
List<String> list = Arrays.asList(byId.getTypeOfWork().split(","));
if (!list.contains(appById.getTypeOfWork())){
throw new RuntimeException("工种不匹配!");
@ -469,6 +473,14 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
//2、当前申请报名的工地信息
BgtProjectRecruitApply recruitApply = queryById(req.getRecruitApplyId());
BgtProjectRecruit recruit = iBgtProjectRecruitService.getAppById(recruitApply.getRecruitId());
//数据库行级锁
String s = new WgzMessageServiceImpl().JudgingRecruitment(recruit.getId(), recruit.getRecruitStaffNum(), recruit.getRecruitEndTime());
switch (s) {
case "1":
throw new RuntimeException("已招满!");
case "2":
throw new RuntimeException("已失效!");
}
//3、更新报名状态、及更新消息的操作状态
BgtProjectRecruitApply apply = new BgtProjectRecruitApply();
apply.setId(req.getRecruitApplyId());

View File

@ -44,7 +44,7 @@ public class WgzAppRegistrationInformationRes implements Serializable {
private String recruitAmount;
@ApiModelProperty("招工数量")
private String recruitStaffNum;
private int recruitStaffNum;
@ApiModelProperty("任务名称")
private String taskName;
@ -55,6 +55,12 @@ public class WgzAppRegistrationInformationRes implements Serializable {
@ApiModelProperty("招工描述")
private String subDescribe;
@ApiModelProperty("招工开始日期")
private LocalDate recruitBeginTime;
@ApiModelProperty("招工结束日期")
private LocalDate recruitEndTime;
@ApiModelProperty("开工日期")
private LocalDate recruitWorkBeginTime;
@ -73,6 +79,9 @@ public class WgzAppRegistrationInformationRes implements Serializable {
@ApiModelProperty("是否需要操作0不需要 1需要 2已操作")
private String isOperation;
@ApiModelProperty("招工是否正常0正常 1已招满 2已失效")
private String full;
// @ApiModelProperty("附件实体数据")
// private List<Annex> annex;

View File

@ -1,6 +1,7 @@
package com.ruoyi.wgz.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.bgt.domain.BgtProjectRecruit;
import com.ruoyi.bgt.domain.dto.BgtDailyClockListDTO;
import com.ruoyi.bgt.domain.vo.BgtDailyClockListVO;
import com.ruoyi.wgz.bo.req.WgzAppGetMessageListReq;
@ -11,6 +12,7 @@ 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.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
@ -32,4 +34,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);
}

View File

@ -225,7 +225,7 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
//1、获取当前人、当前工的上下班时间范围
Long appUserId = SecurityUtils.getAppUserId();
BgtProjectRecruitApply by = iBgtProjectRecruitApplyService.selectByUserIdProjectRecruitApplyId(appUserId);
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getId());
BgtProjectRecruit appById = iBgtProjectRecruitService.getAppById(by.getRecruitId());
//1、组装数据
WgzDailyClock dc = new WgzDailyClock();
BeanUtils.copyProperties(req,dc);

View File

@ -3,7 +3,9 @@ package com.ruoyi.wgz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.bgt.mapper.BgtProjectRecruitMapper;
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.domain.Annex;
@ -21,9 +23,7 @@ import com.ruoyi.wgz.bo.res.WgzAppGetMessageListRes;
import com.ruoyi.wgz.bo.res.WgzAppMessageTypeStatisticsRes;
import com.ruoyi.wgz.bo.res.WgzAppRegistrationInformationRes;
import com.ruoyi.wgz.bo.rests.WgzAppMessageTypeStatisticsTwo;
import com.ruoyi.wgz.domain.WgzLeave;
import com.ruoyi.wgz.domain.WgzReissueacard;
import com.ruoyi.wgz.domain.WgzUser;
import com.ruoyi.wgz.domain.*;
import com.ruoyi.wgz.service.IWgzLeaveService;
import com.ruoyi.wgz.service.IWgzReissueacardService;
import com.ruoyi.wgz.service.IWgzUserService;
@ -34,10 +34,10 @@ import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.wgz.bo.WgzMessageQueryBo;
import com.ruoyi.wgz.domain.WgzMessage;
import com.ruoyi.wgz.mapper.WgzMessageMapper;
import com.ruoyi.wgz.service.IWgzMessageService;
import java.time.LocalDate;
import java.util.*;
/**
@ -64,6 +64,9 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
@Autowired
private IWgzUserService wgzUserService;
@Autowired
private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
@Override
public WgzMessage queryById(Long id){
return getById(id);
@ -202,14 +205,13 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
@Override
public WgzAppRegistrationInformationRes userRegistrationInformation(Long messageId) {
Long appUserId = SecurityUtils.getAppUserId();
//1、获取当前消息的招工ID
WgzMessage byId = this.getById(messageId);
//2、根据招工ID得到招工信息及附件
WgzAppRegistrationInformationRes byRecruitIdData = baseMapper.findByRecruitIdData(byId.getTableId());
// List<Annex> byUserIdAndRecruitId = annexService.findByUserIdAndRecruitId(appUserId, byId.getId(), new String[]{"1"});
// byRecruitIdData.setAnnex(null);
return byRecruitIdData.setMessageId(byId.getId()).setIsOperation(byId.getIsOperation());
byRecruitIdData.setMessageId(byId.getId()).setIsOperation(byId.getIsOperation());
byRecruitIdData.setFull(JudgingRecruitment(byId.getTableId(), byRecruitIdData.getRecruitStaffNum(), byRecruitIdData.getRecruitEndTime()));
return byRecruitIdData;
}
@Override
@ -217,4 +219,29 @@ public class WgzMessageServiceImpl extends ServicePlusImpl<WgzMessageMapper, Wgz
WgzMessage wgzMessage = new WgzMessage().setId(req.getMessageId()).setReadStatus("1");
return baseMapper.updateById(wgzMessage) > 0;
}
/**
* 判断招工是否已招满或已过期
* @param recruitId 招工ID
* @param num 招工数量
* @param recruitEndTime 招工结束时间
* @return
*/
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";
}
if (recruitEndTime.isAfter(LocalDate.now())){
return "2";
}
return "0";
}
}

View File

@ -100,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND a.message_small_type = #{req.smallType}
</if>
</where>
order by a.create_time desc
</select>
@ -123,6 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
a.message_small_type is null AND
a.del_flag = "0"
</where>
order by a.create_time desc
</select>
@ -136,6 +138,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.recruit_amount as recruitAmount,
b.recruit_staff_num as recruitStaffNum,
b.sub_describe as subDescribe,
b.recruit_begin_time as recruitBeginTime,
b.recruit_end_time as recruitEndTime,
b.recruit_work_begin_time as recruitWorkBeginTime,
b.recruit_contact_person as recruitContactPerson,
b.recruit_contact_phone as recruitContactPhone,

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 385 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 KiB