优化
This commit is contained in:
@ -86,4 +86,8 @@ public interface IAnnexService extends IServicePlus<Annex> {
|
||||
*/
|
||||
void deleteByUserIdAndRecruitIdAndType(Long userId,Long recruitId,String type);
|
||||
|
||||
/**
|
||||
* 检查入场材料
|
||||
*/
|
||||
boolean checkEntry(Long userId,Long recruitId);
|
||||
}
|
||||
|
||||
@ -19,9 +19,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.ruoyi.common.constant.Constants.WGZ;
|
||||
@ -164,4 +162,24 @@ public class AnnexServiceImpl extends ServicePlusImpl<AnnexMapper, Annex> implem
|
||||
baseMapper.delete(Wrappers.<Annex>lambdaQuery().eq(Annex::getUserId,userId)
|
||||
.eq(Annex::getRecruitId,recruitId).eq(Annex::getAnnexType,type).eq(Annex::getUserType,WGZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEntry(Long userId, Long recruitId) {
|
||||
|
||||
boolean result = false;
|
||||
|
||||
LambdaQueryWrapper<Annex> wra = new LambdaQueryWrapper<Annex>().
|
||||
eq(Annex::getUserType,WGZ).
|
||||
eq(Annex::getUserId,userId).
|
||||
eq(Annex::getRecruitId,recruitId).
|
||||
in(Annex::getAnnexType, Arrays.asList("1","2"));
|
||||
List<Annex> annexes = baseMapper.selectList(wra);
|
||||
if(CollectionUtil.isNotEmpty(annexes)){
|
||||
Set<String> collect = annexes.stream().map(Annex::getAnnexType).collect(Collectors.toSet());
|
||||
if(collect.contains("1") && collect.contains("2")){
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user