优化
This commit is contained in:
		@ -20,5 +20,7 @@ public class BgtReissueacardUpdateDTO {
 | 
			
		||||
	@ApiModelProperty("审核状态(0待审核 1审核中 2已同意 3已拒绝)")
 | 
			
		||||
	private String auditorType;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("审核意见")
 | 
			
		||||
	private String auditorOpinion;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -16,6 +16,8 @@ public class BgtScoreDTO {
 | 
			
		||||
	/** 招工ID */
 | 
			
		||||
	@ApiModelProperty("招工ID")
 | 
			
		||||
	private Long recruitId;
 | 
			
		||||
	@ApiModelProperty("招工申请ID")
 | 
			
		||||
	private Long  recruitApplyId;
 | 
			
		||||
	/** 被评人ID(务工者) */
 | 
			
		||||
	@ApiModelProperty("被评人ID(务工者)")
 | 
			
		||||
	private Long userId;
 | 
			
		||||
 | 
			
		||||
@ -37,9 +37,7 @@ import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzMessage;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzScoreRecord;
 | 
			
		||||
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.*;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.scheduling.annotation.Async;
 | 
			
		||||
@ -93,6 +91,14 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IWgzService iWgzService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IWgzReissueacardService wgzReissueacardService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IWgzLeaveService wgzLeaveService;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public BgtProjectRecruitApply queryById(Long id) {
 | 
			
		||||
		return getById(id);
 | 
			
		||||
@ -383,6 +389,9 @@ 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());
 | 
			
		||||
 | 
			
		||||
		//发消息
 | 
			
		||||
		HashMap<String, String> mp = new HashMap<>();
 | 
			
		||||
 | 
			
		||||
@ -12,15 +12,13 @@ import com.ruoyi.bgt.domain.dto.BgtProjectTaskProgressQueryDTO;
 | 
			
		||||
import com.ruoyi.bgt.domain.vo.BgtProjectTaskProgressDetailVO;
 | 
			
		||||
import com.ruoyi.bgt.domain.vo.BgtProjectTaskProgressVO;
 | 
			
		||||
import com.ruoyi.bgt.mapper.BgtProjectTaskProgressMapper;
 | 
			
		||||
import com.ruoyi.bgt.service.IBgtProjectRecruitApplyService;
 | 
			
		||||
import com.ruoyi.bgt.service.IBgtProjectTaskProgressService;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.common.enums.AuditStatus;
 | 
			
		||||
import com.ruoyi.common.exception.BaseException;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.fbs.service.IFbsProjectTaskService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
@ -36,14 +34,6 @@ import java.util.Map;
 | 
			
		||||
@Service
 | 
			
		||||
public class BgtProjectTaskProgressServiceImpl extends ServicePlusImpl<BgtProjectTaskProgressMapper, BgtProjectTaskProgress> implements IBgtProjectTaskProgressService {
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IFbsProjectTaskService fbsProjectTaskService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IBgtProjectRecruitApplyService recruitApplyService;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public BgtProjectTaskProgress queryById(Long id){
 | 
			
		||||
        return getById(id);
 | 
			
		||||
@ -140,6 +130,7 @@ public class BgtProjectTaskProgressServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
	public Integer getLastProgress(Long taskId) {
 | 
			
		||||
		LambdaQueryWrapper<BgtProjectTaskProgress> wrapper = new LambdaQueryWrapper<>();
 | 
			
		||||
		wrapper.eq(BgtProjectTaskProgress::getTaskId, taskId);
 | 
			
		||||
		wrapper.eq(BgtProjectTaskProgress::getAuditStatus, AuditStatus.PASS.getCode());
 | 
			
		||||
		wrapper.orderByDesc(BgtProjectTaskProgress::getProgress);
 | 
			
		||||
		List<BgtProjectTaskProgress> list = baseMapper.selectList(wrapper);
 | 
			
		||||
		return CollectionUtil.isEmpty(list)?0:list.get(0).getProgress();
 | 
			
		||||
 | 
			
		||||
@ -27,6 +27,9 @@ import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
import java.util.Map;
 | 
			
		||||
 | 
			
		||||
import static com.ruoyi.common.util.ValidUtil.isValidBankCard;
 | 
			
		||||
import static com.ruoyi.common.util.ValidUtil.isValidIdentityCard;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * APP包工头Service业务层处理
 | 
			
		||||
 *
 | 
			
		||||
@ -128,6 +131,15 @@ public class BgtUserServiceImpl extends ServicePlusImpl<BgtUserMapper, BgtUser>
 | 
			
		||||
		if(bgtUser == null){
 | 
			
		||||
			throw new BaseException("用户不存在");
 | 
			
		||||
		}
 | 
			
		||||
		// 校验身份证号
 | 
			
		||||
		if (!isValidIdentityCard(dto.getIdentityCard())) {
 | 
			
		||||
			throw new BaseException("身份证号格式不正确");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 校验银行卡号
 | 
			
		||||
		if (!isValidBankCard(dto.getCardNo())) {
 | 
			
		||||
			throw new BaseException("银行卡号格式不正确");
 | 
			
		||||
		}
 | 
			
		||||
		BeanUtil.copyProperties(dto, bgtUser);
 | 
			
		||||
		for (AnnexDTO annexDTO:dto.getAnnexList()){
 | 
			
		||||
			annexDTO.setUserId(dto.getUserId());
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,19 @@
 | 
			
		||||
package com.ruoyi.common.util;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 校验工具类
 | 
			
		||||
 * @author zhangqiao
 | 
			
		||||
 * @since 2020/4/16 16:05
 | 
			
		||||
 */
 | 
			
		||||
public class ValidUtil {
 | 
			
		||||
 | 
			
		||||
	public static boolean isValidIdentityCard(String identityCard) {
 | 
			
		||||
		// 简单的身份证号校验逻辑,可以根据需要进行更复杂的校验
 | 
			
		||||
		return identityCard != null && identityCard.matches("\\d{15}|\\d{18}");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public static boolean isValidBankCard(String bankCard) {
 | 
			
		||||
		// 简单的银行卡号校验逻辑,可以根据需要进行更复杂的校验
 | 
			
		||||
		return bankCard != null && bankCard.matches("\\d{16,19}");
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -103,6 +103,46 @@ public class BusinessTask
 | 
			
		||||
		Console.log("招工进场任务结束!");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 自动给两个月前的任务下的人员默认5分的评价
 | 
			
		||||
	 */
 | 
			
		||||
	public void  score()
 | 
			
		||||
	{
 | 
			
		||||
		Console.log("开始进行务工评价任务");
 | 
			
		||||
		//搜索时间在两个月前的已完结的任务
 | 
			
		||||
		List<FbsProjectTask> taskList = iFbsProjectTaskService.list(Wrappers.<FbsProjectTask>lambdaQuery()
 | 
			
		||||
			.eq(FbsProjectTask::getStatus, "2")
 | 
			
		||||
			.lt(FbsProjectTask::getTaskBeginTime, LocalDate.now().plusMonths(-2)));
 | 
			
		||||
		List<Long> taskIds = taskList.stream().map(FbsProjectTask::getId).collect(Collectors.toList());
 | 
			
		||||
		if(CollectionUtil.isNotEmpty(taskIds)){
 | 
			
		||||
			//任务下的招工
 | 
			
		||||
			List<BgtProjectRecruit> recruitList = recruitService.list(Wrappers.<BgtProjectRecruit>lambdaQuery()
 | 
			
		||||
				.in(BgtProjectRecruit::getTaskId, taskIds));
 | 
			
		||||
			List<Long> recruitIds = recruitList.stream().map(BgtProjectRecruit::getId).collect(Collectors.toList());
 | 
			
		||||
			if(CollectionUtil.isNotEmpty(recruitIds)){
 | 
			
		||||
				//招工下的人员
 | 
			
		||||
				List<BgtProjectRecruitApply> applyList = recruitApplyService.list(Wrappers.<BgtProjectRecruitApply>lambdaQuery()
 | 
			
		||||
					.in(BgtProjectRecruitApply::getRecruitId, recruitIds));
 | 
			
		||||
				//筛选已离场的
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
//
 | 
			
		||||
//			iFbsProjectTaskService.lambdaUpdate().in(FbsProjectTask::getId,collect)
 | 
			
		||||
//				.set(FbsProjectTask::getStatus, "3")
 | 
			
		||||
//				.update();
 | 
			
		||||
//			iWgzMessageService.saveBatch(WgzAndBgtMessageConstant.getScoreMessage(collect));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		recruitApplyService.lambdaUpdate()
 | 
			
		||||
			.le(BgtProjectRecruitApply::getEntryTime, LocalDate.now())
 | 
			
		||||
			.eq(BgtProjectRecruitApply::getStatus,RecruitApplyStatus.WGZ_PASS.getCode())
 | 
			
		||||
			.set(BgtProjectRecruitApply::getStatus,RecruitApplyStatus.BGT_REFUSE.getCode())
 | 
			
		||||
			.update();
 | 
			
		||||
		Console.log("招工进场任务结束!");
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 上班缺卡
 | 
			
		||||
 | 
			
		||||
@ -36,6 +36,9 @@ public class WgzScoreRecord implements Serializable {
 | 
			
		||||
    @ApiModelProperty("招工ID")
 | 
			
		||||
    private Long recruitId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工申请ID")
 | 
			
		||||
	private Long  recruitApplyId;
 | 
			
		||||
 | 
			
		||||
    /** 被评人ID(务工者) */
 | 
			
		||||
    @Excel(name = "被评人ID(务工者)")
 | 
			
		||||
    @ApiModelProperty("被评人ID(务工者)")
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,6 @@
 | 
			
		||||
package com.ruoyi.wgz.service;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.bgt.domain.dto.BgtLeaveUpdateDTO;
 | 
			
		||||
import com.ruoyi.common.core.domain.AjaxResult;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.IServicePlus;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.wgz.bo.WgzLeaveQueryBo;
 | 
			
		||||
@ -10,7 +9,6 @@ import com.ruoyi.wgz.bo.req.WgzAppLeaveHistoryListPageReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppSubmitLeaveReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppLeaveHistoryListPageRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserLeaveDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzLeave;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.PathVariable;
 | 
			
		||||
@ -110,4 +108,9 @@ public interface IWgzLeaveService extends IServicePlus<WgzLeave> {
 | 
			
		||||
	 */
 | 
			
		||||
	Boolean bgtAudit(BgtLeaveUpdateDTO dto);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 批量拒绝请假
 | 
			
		||||
	 */
 | 
			
		||||
	void refuseBatch(Long recruitId,Long userId);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -11,10 +11,8 @@ import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzReplacementCardRecordRes;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzReissueacard;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.PathVariable;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
 | 
			
		||||
import javax.validation.constraints.NotNull;
 | 
			
		||||
import java.util.Collection;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@ -92,4 +90,9 @@ public interface IWgzReissueacardService extends IServicePlus<WgzReissueacard> {
 | 
			
		||||
 | 
			
		||||
	WgzAppUserReplacementCardRecordDetailsRes userReplacementCardRecordDetails(Long id);
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 拒绝批量操作
 | 
			
		||||
	 */
 | 
			
		||||
	void  refuseBatch(Long recruitId,Long userId);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -27,7 +27,6 @@ import com.ruoyi.wgz.bo.req.WgzAppLeaveHistoryListPageReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppSubmitLeaveReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppLeaveHistoryListPageRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserLeaveDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUserReplacementCardRecordDetailsRes;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzAttendance;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzLeave;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzMessage;
 | 
			
		||||
@ -306,26 +305,44 @@ public class WgzLeaveServiceImpl extends ServicePlusImpl<WgzLeaveMapper, WgzLeav
 | 
			
		||||
			.setMessageSmallType(SMALL_LEAVE);
 | 
			
		||||
		iWgzMessageService.sendAMessage(wgzMessage);
 | 
			
		||||
 | 
			
		||||
		//考勤信息
 | 
			
		||||
		List<WgzAttendance> list = attendanceService.list(Wrappers.<WgzAttendance>lambdaQuery()
 | 
			
		||||
			.eq(WgzAttendance::getRecruitId, recruit.getId())
 | 
			
		||||
			.eq(WgzAttendance::getUserId, wgzLeave.getUserId())
 | 
			
		||||
			.eq(WgzAttendance::getDate, wgzLeave.getStartTime().toLocalDate()));
 | 
			
		||||
		if(CollectionUtil.isNotEmpty(list)){
 | 
			
		||||
			WgzAttendance wgzAttendance = list.get(0);
 | 
			
		||||
			wgzAttendance.setLeaveMarkId(wgzLeave.getId());
 | 
			
		||||
			wgzAttendance.setExceptionType("7");
 | 
			
		||||
			attendanceService.updateById(wgzAttendance);
 | 
			
		||||
		}else {
 | 
			
		||||
			WgzAttendance wgzAttendance = new WgzAttendance();
 | 
			
		||||
			wgzAttendance.setRecruitId(recruit.getId());
 | 
			
		||||
			wgzAttendance.setUserId(wgzLeave.getUserId());
 | 
			
		||||
			wgzAttendance.setLeaveMarkId(wgzLeave.getId());
 | 
			
		||||
			wgzAttendance.setDailyWage(recruit.getRecruitAmount());
 | 
			
		||||
			wgzAttendance.setDate(wgzLeave.getStartTime().toLocalDate());
 | 
			
		||||
			wgzAttendance.setExceptionType("7");
 | 
			
		||||
			attendanceService.save(wgzAttendance);
 | 
			
		||||
		if(AuditStatus.PASS.getCode().equals(dto.getAuditorType())){
 | 
			
		||||
			//考勤信息
 | 
			
		||||
			List<WgzAttendance> list = attendanceService.list(Wrappers.<WgzAttendance>lambdaQuery()
 | 
			
		||||
				.eq(WgzAttendance::getRecruitId, recruit.getId())
 | 
			
		||||
				.eq(WgzAttendance::getUserId, wgzLeave.getUserId())
 | 
			
		||||
				.eq(WgzAttendance::getDate, wgzLeave.getStartTime().toLocalDate()));
 | 
			
		||||
			if(CollectionUtil.isNotEmpty(list)){
 | 
			
		||||
				WgzAttendance wgzAttendance = list.get(0);
 | 
			
		||||
				wgzAttendance.setLeaveMarkId(wgzLeave.getId());
 | 
			
		||||
				wgzAttendance.setExceptionType("7");
 | 
			
		||||
				attendanceService.updateById(wgzAttendance);
 | 
			
		||||
			}else {
 | 
			
		||||
				WgzAttendance wgzAttendance = new WgzAttendance();
 | 
			
		||||
				wgzAttendance.setRecruitId(recruit.getId());
 | 
			
		||||
				wgzAttendance.setUserId(wgzLeave.getUserId());
 | 
			
		||||
				wgzAttendance.setLeaveMarkId(wgzLeave.getId());
 | 
			
		||||
				wgzAttendance.setDailyWage(recruit.getRecruitAmount());
 | 
			
		||||
				wgzAttendance.setDate(wgzLeave.getStartTime().toLocalDate());
 | 
			
		||||
				wgzAttendance.setExceptionType("7");
 | 
			
		||||
				attendanceService.save(wgzAttendance);
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		return updateById(wgzLeave);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	@Transactional(rollbackFor = Exception.class)
 | 
			
		||||
	public void refuseBatch(Long recruitId, Long userId) {
 | 
			
		||||
		List<WgzLeave> list = list(Wrappers.<WgzLeave>lambdaQuery()
 | 
			
		||||
			.eq(WgzLeave::getRecruitId, recruitId)
 | 
			
		||||
			.eq(WgzLeave::getUserId, userId)
 | 
			
		||||
			.in(WgzLeave::getAuditorType, AuditStatus.getToAudit()));
 | 
			
		||||
		for(WgzLeave wgzLeave : list){
 | 
			
		||||
			BgtLeaveUpdateDTO dto = new BgtLeaveUpdateDTO();
 | 
			
		||||
			dto.setId(wgzLeave.getId());
 | 
			
		||||
			dto.setAuditorType(AuditStatus.REFUSE.getCode());
 | 
			
		||||
			dto.setAuditorOpinion("您已退场");
 | 
			
		||||
			bgtAudit(dto);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,7 @@ import com.ruoyi.bgt.service.IBgtProjectRecruitService;
 | 
			
		||||
import com.ruoyi.common.constants.WgzAndBgtMessageConstant;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
 | 
			
		||||
import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.common.enums.AuditStatus;
 | 
			
		||||
import com.ruoyi.common.util.LocalDateToChineseWeekday;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
@ -40,7 +41,6 @@ import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
import java.time.LocalDate;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.time.format.DateTimeFormatter;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
import static com.ruoyi.common.constants.BgtMessageConstant.*;
 | 
			
		||||
@ -243,39 +243,42 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
 | 
			
		||||
	public Boolean appUpdate(BgtReissueacardUpdateDTO dto) {
 | 
			
		||||
		WgzReissueacard byId = getById(dto.getId());
 | 
			
		||||
		BeanUtil.copyProperties(dto, byId);
 | 
			
		||||
		byId.setAuditorTime(LocalDateTime.now());
 | 
			
		||||
		boolean b = updateById(byId);
 | 
			
		||||
		boolean isPass = AuditStatus.PASS.getCode().equals(dto.getAuditorType());
 | 
			
		||||
		if(isPass){
 | 
			
		||||
			//修改考勤标记
 | 
			
		||||
			WgzAttendance attendance = iWgzAttendanceService.getById(byId.getAttendanceId());
 | 
			
		||||
 | 
			
		||||
		//修改考勤标记
 | 
			
		||||
		WgzAttendance attendance = iWgzAttendanceService.getById(byId.getAttendanceId());
 | 
			
		||||
			String exceptionType = attendance.getExceptionType();
 | 
			
		||||
			if ("0".equals(byId.getType())) { //上班补卡
 | 
			
		||||
				exceptionType = exceptionType.replace("\\b1\\b", "5");
 | 
			
		||||
				exceptionType = exceptionType.replace("\\b3\\b", "5");
 | 
			
		||||
				attendance.setExceptionType(exceptionType);
 | 
			
		||||
				attendance.setLate(1);
 | 
			
		||||
				attendance.setMissedIn(1);
 | 
			
		||||
				if(attendance.getClockInTime() == null){
 | 
			
		||||
					attendance.setClockInTime(byId.getNowTime());
 | 
			
		||||
				}
 | 
			
		||||
			} else { //下班补卡
 | 
			
		||||
				exceptionType = exceptionType.replace("\\b2\\b", "6");
 | 
			
		||||
				exceptionType = exceptionType.replace("\\b4\\b", "6");
 | 
			
		||||
				attendance.setExceptionType(exceptionType);
 | 
			
		||||
				attendance.setEarlyLeave(1);
 | 
			
		||||
				attendance.setMissedOut(1);
 | 
			
		||||
				if(attendance.getClockOutTime() == null){
 | 
			
		||||
					attendance.setClockOutTime(byId.getNowTime());
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			iWgzAttendanceService.updateById(attendance);
 | 
			
		||||
 | 
			
		||||
		String exceptionType = attendance.getExceptionType();
 | 
			
		||||
		if ("0".equals(byId.getType())) { //上班补卡
 | 
			
		||||
			exceptionType = exceptionType.replace("\\b1\\b", "5");
 | 
			
		||||
			exceptionType = exceptionType.replace("\\b3\\b", "5");
 | 
			
		||||
			attendance.setExceptionType(exceptionType);
 | 
			
		||||
			attendance.setLate(1);
 | 
			
		||||
			attendance.setMissedIn(1);
 | 
			
		||||
			if(attendance.getClockInTime() == null){
 | 
			
		||||
				attendance.setClockInTime(byId.getNowTime());
 | 
			
		||||
			}
 | 
			
		||||
		} else { //下班补卡
 | 
			
		||||
			exceptionType = exceptionType.replace("\\b2\\b", "6");
 | 
			
		||||
			exceptionType = exceptionType.replace("\\b4\\b", "6");
 | 
			
		||||
			attendance.setExceptionType(exceptionType);
 | 
			
		||||
			attendance.setEarlyLeave(1);
 | 
			
		||||
			attendance.setMissedOut(1);
 | 
			
		||||
			if(attendance.getClockOutTime() == null){
 | 
			
		||||
				attendance.setClockOutTime(byId.getNowTime());
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		iWgzAttendanceService.updateById(attendance);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		//发消息
 | 
			
		||||
		HashMap<String, String> mp = new HashMap<>();
 | 
			
		||||
		mp.put("projectName", iBgtProjectRecruitService.getById(byId.getRecruitId()).getRecruitName());
 | 
			
		||||
		mp.put("auditor", SecurityUtils.getUsername());
 | 
			
		||||
		Map<String, String> map = bgtMessage(mp, BGT_TYPE_MAKE_UP, true);
 | 
			
		||||
		Map<String, String> map = bgtMessage(mp, BGT_TYPE_MAKE_UP, isPass);
 | 
			
		||||
		WgzMessage wgzMessage = new WgzMessage()
 | 
			
		||||
			.setSenderType(USERTYPE_BGT)
 | 
			
		||||
			.setSenderId(SecurityUtils.getAppUserId())
 | 
			
		||||
@ -297,4 +300,20 @@ public class WgzReissueacardServiceImpl extends ServicePlusImpl<WgzReissueacardM
 | 
			
		||||
		info.setWeek( LocalDateToChineseWeekday.getChineseWeekday(info.getRawTime().toLocalDate()));
 | 
			
		||||
		return info;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	@Transactional(rollbackFor = Exception.class)
 | 
			
		||||
	public void refuseBatch(Long recruitId, Long userId) {
 | 
			
		||||
		List<WgzReissueacard> list = list(new LambdaQueryWrapper<WgzReissueacard>()
 | 
			
		||||
			.eq(WgzReissueacard::getRecruitId, recruitId)
 | 
			
		||||
			.eq(WgzReissueacard::getUserId, userId)
 | 
			
		||||
			.in(WgzReissueacard::getAuditorType,AuditStatus.getToAudit()));
 | 
			
		||||
		for (WgzReissueacard wgzReissueacard : list) {
 | 
			
		||||
			BgtReissueacardUpdateDTO bgtReissueacardUpdateDTO = new BgtReissueacardUpdateDTO();
 | 
			
		||||
			bgtReissueacardUpdateDTO.setId(wgzReissueacard.getId());
 | 
			
		||||
			bgtReissueacardUpdateDTO.setAuditorType(AuditStatus.REFUSE.getCode());
 | 
			
		||||
			bgtReissueacardUpdateDTO.setAuditorOpinion("您已退场");
 | 
			
		||||
			appUpdate(bgtReissueacardUpdateDTO);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user