完善细节,修复日报补卡消息

This commit is contained in:
2025-03-13 11:13:20 +08:00
parent 29b14e4c1f
commit 4a1f10e488
10 changed files with 95 additions and 11 deletions

View File

@ -0,0 +1,25 @@
package com.ruoyi.common.mapper;
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
import com.ruoyi.common.domain.Annex;
import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
* 务工者Mapper接口
*
* @author ruoyi
* @date 2025-02-14
*/
// 如使需切换数据源 请勿使用缓存 会造成数据不一致现象
@CacheNamespace(implementation = MybatisPlusRedisCache.class, eviction = MybatisPlusRedisCache.class)
public interface WgzMapper extends BaseMapperPlus<BgtProjectRecruitApply> {
@Select("SELECT count(1) FROM bgt_project_recruit_apply WHERE user_id = #{userId} and status in ('3','5') FOR UPDATE")
@Options(useCache = false) // 禁用 MyBatis 缓存
Integer QueryWhetherTheCurrentUserHasAnOngoingProject(@Param("userId") Long userId);
}

View File

@ -0,0 +1,9 @@
package com.ruoyi.common.service;
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
public interface IWgzService extends IServicePlus<BgtProjectRecruitApply> {
//行级锁-查询当前用户是否已有进行中项目
Integer QueryWhetherTheCurrentUserHasAnOngoingProject(Long userId);
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.common.service.impl;
import com.ruoyi.bgt.domain.BgtProjectRecruitApply;
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
import com.ruoyi.common.mapper.WgzMapper;
import com.ruoyi.common.service.IWgzService;
import org.springframework.stereotype.Service;
@Service
public class WgzServiceImpl extends ServicePlusImpl<WgzMapper, BgtProjectRecruitApply> implements IWgzService {
@Override
public Integer QueryWhetherTheCurrentUserHasAnOngoingProject(Long userId) {
return baseMapper.QueryWhetherTheCurrentUserHasAnOngoingProject(userId);
}
}