优化
This commit is contained in:
@ -97,7 +97,7 @@ public class AppBgtProjectRecruitApplyController extends BaseController {
|
||||
@GetMapping("/check/{id}")
|
||||
public AjaxResult<Boolean> check(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(false);
|
||||
return AjaxResult.success(iBgtProjectRecruitApplyService.check(id));
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,12 +9,16 @@ import com.ruoyi.bgt.domain.vo.BgtProjectRecruitDetailWgzListVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitVO;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
|
||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
|
||||
import com.ruoyi.bgt.service.IBgtUserService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.BgtUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.exception.BaseException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -41,6 +45,8 @@ public class AppBgtProjectRecruitController extends BaseController {
|
||||
|
||||
private final IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
|
||||
|
||||
private final IBgtUserService bgtUserService;
|
||||
|
||||
/**
|
||||
* 查询包工头招工列表 状态为通过和报名
|
||||
*/
|
||||
@ -90,6 +96,10 @@ public class AppBgtProjectRecruitController extends BaseController {
|
||||
@RepeatSubmit
|
||||
@PostMapping()
|
||||
public AjaxResult<Boolean> add(@Validated @RequestBody BgtProjectRecruit bo) {
|
||||
BgtUser byId = bgtUserService.getById(SecurityUtils.getAppUserId());
|
||||
if(byId == null || byId.getIdentityCard() == null){
|
||||
throw new BaseException("当前用户还未实名认证!");
|
||||
}
|
||||
return AjaxResult.success(iBgtProjectRecruitService.insert(bo));
|
||||
}
|
||||
|
||||
|
@ -3,12 +3,15 @@ package com.ruoyi.web.controller.bgt;
|
||||
import com.ruoyi.bgt.domain.dto.BgtProjectTaskUserDTO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectRecruitApplyVO;
|
||||
import com.ruoyi.bgt.domain.vo.BgtProjectTaskUseCountVO;
|
||||
import com.ruoyi.bgt.service.IBgtUserService;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.BgtUser;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.exception.BaseException;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.fbs.domain.FbsProjectTask;
|
||||
import com.ruoyi.fbs.domain.dto.AppTaskDTO;
|
||||
@ -38,6 +41,8 @@ public class AppBgtProjectTaskController extends BaseController {
|
||||
|
||||
private final IFbsProjectTaskService iFbsProjectTaskService;
|
||||
|
||||
private final IBgtUserService bgtUserService;
|
||||
|
||||
/**
|
||||
* 首页任务列表 任务状态 申请(0) 是否我的任务 false
|
||||
* 我的任务列表 任务状态 申请(0) 进行(1) 完成(2) 是否我的任务 true
|
||||
@ -118,6 +123,10 @@ public class AppBgtProjectTaskController extends BaseController {
|
||||
bo.setSubId(num);
|
||||
bo.setUserId(SecurityUtils.getAppUserId());
|
||||
bo.setStatus("1");
|
||||
BgtUser byId = bgtUserService.getById(SecurityUtils.getAppUserId());
|
||||
if(byId == null || byId.getIdentityCard() == null){
|
||||
throw new BaseException("当前用户还未实名认证!");
|
||||
}
|
||||
return AjaxResult.success(iFbsProjectTaskService.insert(bo));
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.common.mapper.AnnexRecordMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.common.domain.AnnexRecord" id="CommonAnnexRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userType" column="user_type"/>
|
||||
<result property="recruitId" column="recruit_id"/>
|
||||
<result property="annexType" column="annex_type"/>
|
||||
<result property="annexName" column="annex_name"/>
|
||||
<result property="annexUrl" column="annex_url"/>
|
||||
<result property="createUserId" column="create_user_Id"/>
|
||||
<result property="createUserType" column="create_user_type"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user