优化
This commit is contained in:
		@ -113,6 +113,12 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
 | 
			
		||||
	 * 确认进场
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean confirm(Long id);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 检查材料
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean check(Long id);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 指定日期所有人员出勤情况
 | 
			
		||||
	 */
 | 
			
		||||
@ -135,7 +141,7 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
 | 
			
		||||
	/**
 | 
			
		||||
	 * 评分
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean score(@Validated @RequestBody BgtScoreDTO dto);
 | 
			
		||||
	Boolean score( @RequestBody BgtScoreDTO dto);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 务工者取消报名
 | 
			
		||||
 | 
			
		||||
@ -99,6 +99,14 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IWgzLeaveService wgzLeaveService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IWgzDailyClockService dailyClockService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IWgzPayCalculationService payCalculationService;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public BgtProjectRecruitApply queryById(Long id) {
 | 
			
		||||
		return getById(id);
 | 
			
		||||
@ -297,6 +305,15 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		return updateById(recruitApply);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean check(Long id) {
 | 
			
		||||
		BgtProjectRecruitApply recruitApply = getById(id);
 | 
			
		||||
		if(recruitApply == null){
 | 
			
		||||
			throw new BaseException("该申请人员不存在");
 | 
			
		||||
		}
 | 
			
		||||
		return annexService.checkEntry(recruitApply.getUserId(), recruitApply.getRecruitId());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * LC-APP相关
 | 
			
		||||
	 * =================================================================================================================
 | 
			
		||||
@ -433,9 +450,15 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
			recruit.setStatus(RecruitStatus.PROGRESS.getCode());
 | 
			
		||||
			iBgtProjectRecruitService.updateById(recruit);
 | 
			
		||||
		}
 | 
			
		||||
		//批量拒绝请假和补卡
 | 
			
		||||
		wgzReissueacardService.refuseBatch(recruitApply.getRecruitId(),recruitApply.getUserId());
 | 
			
		||||
		wgzLeaveService.refuseBatch(recruitApply.getRecruitId(),recruitApply.getUserId());
 | 
			
		||||
		//检查是否还有申请未审批
 | 
			
		||||
		Boolean reissueacard = wgzReissueacardService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
 | 
			
		||||
		Boolean leave = wgzLeaveService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
 | 
			
		||||
		Boolean dailyClock = dailyClockService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
 | 
			
		||||
		Boolean payCalculation = payCalculationService.isThereAnyApplicationsInReview(recruitApply.getRecruitId(), recruitApply.getUserId());
 | 
			
		||||
 | 
			
		||||
		if(reissueacard || leave || dailyClock || payCalculation){
 | 
			
		||||
			throw new BaseException("当前用户还有未审批的申请,无法退场!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//发消息
 | 
			
		||||
		HashMap<String, String> mp = new HashMap<>();
 | 
			
		||||
 | 
			
		||||
@ -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;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -100,11 +100,11 @@ public class BusinessTask
 | 
			
		||||
	public void entry()
 | 
			
		||||
	{
 | 
			
		||||
		Console.log("开始招工进场任务");
 | 
			
		||||
		recruitApplyService.lambdaUpdate()
 | 
			
		||||
			.le(BgtProjectRecruitApply::getEntryTime, LocalDate.now())
 | 
			
		||||
			.eq(BgtProjectRecruitApply::getStatus,RecruitApplyStatus.WGZ_PASS.getCode())
 | 
			
		||||
			.set(BgtProjectRecruitApply::getStatus,RecruitApplyStatus.BGT_REFUSE.getCode())
 | 
			
		||||
			.update();
 | 
			
		||||
//		recruitApplyService.lambdaUpdate()
 | 
			
		||||
//			.le(BgtProjectRecruitApply::getEntryTime, LocalDate.now())
 | 
			
		||||
//			.eq(BgtProjectRecruitApply::getStatus,RecruitApplyStatus.WGZ_PASS.getCode())
 | 
			
		||||
//			.set(BgtProjectRecruitApply::getStatus,RecruitApplyStatus.BGT_REFUSE.getCode())
 | 
			
		||||
//			.update();
 | 
			
		||||
		Console.log("招工进场任务结束!");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -108,4 +108,9 @@ public interface IWgzDailyClockService extends IServicePlus<WgzDailyClock> {
 | 
			
		||||
	 * 查看和审核
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean appUpdate(BgtDailyClockUpdateDTO dto);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 是否还有在审核的申请
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean isThereAnyApplicationsInReview(Long recruitId,Long userId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -115,6 +115,11 @@ public interface IWgzLeaveService extends IServicePlus<WgzLeave> {
 | 
			
		||||
	 */
 | 
			
		||||
	void refuseBatch(Long recruitId,Long userId);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 是否还有在审核的申请
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean isThereAnyApplicationsInReview(Long recruitId,Long userId);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 包工头审核列表
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
@ -16,9 +16,7 @@ import com.ruoyi.wgz.bo.res.WgzAppApplyForPayrollSettlementListRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserApplyForPayrollSettlementDetails;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzPayCalculation;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.PathVariable;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
@ -126,7 +124,18 @@ public interface IWgzPayCalculationService extends IServicePlus<WgzPayCalculatio
 | 
			
		||||
	 */
 | 
			
		||||
	TableDataInfo<BgtPayCalculationDetailListVO> record(BgtPayCalculationRecordDTO dto);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 包工头结算
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean bgtAdd(BgtApplyForWgzPayAddDTO dto);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 结算基础信息
 | 
			
		||||
	 */
 | 
			
		||||
	BgtApplyForWgzPayAddInfoVO payInfo(Long userId, Long recruitId);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 是否还有在审核的申请
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean isThereAnyApplicationsInReview(Long recruitId,Long userId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -96,4 +96,9 @@ public interface IWgzReissueacardService extends IServicePlus<WgzReissueacard> {
 | 
			
		||||
	 */
 | 
			
		||||
	void  refuseBatch(Long recruitId,Long userId);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 是否还有在审核的申请
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean isThereAnyApplicationsInReview(Long recruitId,Long userId);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
package com.ruoyi.wgz.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
@ -398,4 +399,14 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
 | 
			
		||||
		}
 | 
			
		||||
		return updateById(dailyClock);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean isThereAnyApplicationsInReview(Long recruitId, Long userId) {
 | 
			
		||||
		List<WgzDailyClock> list = list(Wrappers.<WgzDailyClock>lambdaQuery()
 | 
			
		||||
			.eq(WgzDailyClock::getRecruitId, recruitId)
 | 
			
		||||
			.eq(WgzDailyClock::getUserId, userId)
 | 
			
		||||
			.eq(WgzDailyClock::getStatus, "1")
 | 
			
		||||
			.in(WgzDailyClock::getAuditorType, AuditStatus.getToAudit()));
 | 
			
		||||
		return CollectionUtil.isNotEmpty(list);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -353,6 +353,15 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean isThereAnyApplicationsInReview(Long recruitId, Long userId) {
 | 
			
		||||
		List<WgzLeave> list = list(Wrappers.<WgzLeave>lambdaQuery()
 | 
			
		||||
			.eq(WgzLeave::getRecruitId, recruitId)
 | 
			
		||||
			.eq(WgzLeave::getUserId, userId)
 | 
			
		||||
			.in(WgzLeave::getAuditorType, AuditStatus.getToAudit()));
 | 
			
		||||
		return CollectionUtil.isNotEmpty(list);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public TableDataInfo<BgtAuditResultVO>  bgtLeaveAudit(BgtAuditListDTO dto) {
 | 
			
		||||
		dto.setAuditorUserId(SecurityUtils.getAppUserId());
 | 
			
		||||
 | 
			
		||||
@ -616,4 +616,13 @@ public class WgzPayCalculationServiceImpl extends ServicePlusImpl<WgzPayCalculat
 | 
			
		||||
		vo.setCardNo(wgzUser.getCardNo());
 | 
			
		||||
		return vo;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean isThereAnyApplicationsInReview(Long recruitId, Long userId) {
 | 
			
		||||
		List<WgzPayCalculation> list = list(Wrappers.<WgzPayCalculation>lambdaQuery()
 | 
			
		||||
			.eq(WgzPayCalculation::getRecruitId, recruitId)
 | 
			
		||||
			.eq(WgzPayCalculation::getUserId, userId)
 | 
			
		||||
			.in(WgzPayCalculation::getAuditorType, AuditStatus.getToAudit()));
 | 
			
		||||
		return CollectionUtil.isNotEmpty(list);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,7 @@
 | 
			
		||||
package com.ruoyi.wgz.service.impl;
 | 
			
		||||
 | 
			
		||||
import cn.hutool.core.bean.BeanUtil;
 | 
			
		||||
import cn.hutool.core.collection.CollectionUtil;
 | 
			
		||||
import cn.hutool.core.util.StrUtil;
 | 
			
		||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 | 
			
		||||
@ -317,4 +318,13 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
 | 
			
		||||
			appUpdate(bgtReissueacardUpdateDTO);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean isThereAnyApplicationsInReview(Long recruitId, Long userId) {
 | 
			
		||||
		List<WgzReissueacard> list = list(new LambdaQueryWrapper<WgzReissueacard>()
 | 
			
		||||
			.eq(WgzReissueacard::getRecruitId, recruitId)
 | 
			
		||||
			.eq(WgzReissueacard::getUserId, userId)
 | 
			
		||||
			.in(WgzReissueacard::getAuditorType,AuditStatus.getToAudit()));
 | 
			
		||||
		return CollectionUtil.isNotEmpty(list);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user