优化
This commit is contained in:
		@ -25,6 +25,7 @@ import com.ruoyi.common.enums.RecruitApplyStatus;
 | 
			
		||||
import com.ruoyi.common.enums.RecruitStatus;
 | 
			
		||||
import com.ruoyi.common.exception.BaseException;
 | 
			
		||||
import com.ruoyi.common.service.IAnnexService;
 | 
			
		||||
import com.ruoyi.common.service.IAsyncService;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.system.service.ISysDictTypeService;
 | 
			
		||||
@ -62,22 +63,31 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IAnnexService annexService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IWgzScoreRecordService scoreRecordService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IWgzUserService wgzUserService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IBgtProjectRecruitService iBgtProjectRecruitService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IWgzMessageService iWgzMessageService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IBgtMessageService iBgtMessageService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private ISysDictTypeService dictTypeService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IAsyncService iAsyncService;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public BgtProjectRecruitApply queryById(Long id) {
 | 
			
		||||
		return getById(id);
 | 
			
		||||
@ -542,6 +552,8 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		String s = iWgzMessageService.JudgingRecruitment(req.getRecruitApplyId(), recruit.getRecruitStaffNum(), recruit.getRecruitEndTime());
 | 
			
		||||
		switch (s) {
 | 
			
		||||
			case "1":
 | 
			
		||||
				//异步修改状态为已招满
 | 
			
		||||
				iAsyncService.updateRecruitStatus(recruit);
 | 
			
		||||
				throw new RuntimeException("已招满!");
 | 
			
		||||
			case "2":
 | 
			
		||||
				throw new RuntimeException("已失效!");
 | 
			
		||||
@ -555,9 +567,13 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		}
 | 
			
		||||
		int up = baseMapper.updateById(apply);
 | 
			
		||||
		if (up == 0) {
 | 
			
		||||
			throw new RuntimeException("插入数据失败!");
 | 
			
		||||
			throw new RuntimeException("修改招工申请信息失败!");
 | 
			
		||||
		}
 | 
			
		||||
		//3-2、修改消息
 | 
			
		||||
		boolean b = iWgzMessageService.updateById(new WgzMessage().setId(req.getMessageId()).setIsOperation("2"));
 | 
			
		||||
		if (!b) {
 | 
			
		||||
			throw new RuntimeException("修改消息失败!");
 | 
			
		||||
		}
 | 
			
		||||
		iWgzMessageService.updateById(new WgzMessage().setId(req.getMessageId()).setIsOperation("2"));
 | 
			
		||||
		//4系统拒绝消息
 | 
			
		||||
		SysDictData typeOfWork = dictTypeService.selectDictDataByTypeAndData("type_of_work", recruit.getTypeOfWork());
 | 
			
		||||
		Map<String, String> mp = new HashMap<>();
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,8 @@
 | 
			
		||||
package com.ruoyi.common.service;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
 | 
			
		||||
 | 
			
		||||
public interface IAsyncService {
 | 
			
		||||
	//异步修改招工状态为招满
 | 
			
		||||
	void updateRecruitStatus(BgtProjectRecruit recruit);
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,22 @@
 | 
			
		||||
package com.ruoyi.common.service.impl;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.bgt.domain.BgtProjectRecruit;
 | 
			
		||||
import com.ruoyi.bgt.service.IBgtProjectRecruitService;
 | 
			
		||||
import com.ruoyi.common.service.IAsyncService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.scheduling.annotation.Async;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
 | 
			
		||||
@Service
 | 
			
		||||
public class AsyncServiceImpl implements IAsyncService {
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IBgtProjectRecruitService iBgtProjectRecruitService;
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	@Async
 | 
			
		||||
	public void updateRecruitStatus(BgtProjectRecruit recruit) {
 | 
			
		||||
		recruit.setStatus("2");
 | 
			
		||||
		iBgtProjectRecruitService.updateById(recruit);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -2,6 +2,7 @@ package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.FieldFill;
 | 
			
		||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import com.ruoyi.common.annotation.Excel;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
@ -56,6 +57,10 @@ public class WgzAppRegisteredProjectRes implements Serializable {
 | 
			
		||||
	@ApiModelProperty("已报名数量")
 | 
			
		||||
	private Integer numberOfRegistered;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("发布时间")
 | 
			
		||||
	@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
 | 
			
		||||
	private LocalDateTime taskCreateTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("工种")
 | 
			
		||||
	private String typeOfWork;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,12 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
import org.springframework.format.annotation.DateTimeFormat;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
@ -27,6 +29,7 @@ public class WgzAppUnderwayRes implements Serializable {
 | 
			
		||||
	private String recruitName;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("创建时间")
 | 
			
		||||
	@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
 | 
			
		||||
	private LocalDateTime createTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("封面图(多个逗号分隔)")
 | 
			
		||||
@ -51,6 +54,7 @@ public class WgzAppUnderwayRes implements Serializable {
 | 
			
		||||
	private String recruitRequirement;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("发布时间")
 | 
			
		||||
	@JsonFormat(pattern = "yyyy-MM-dd", shape = JsonFormat.Shape.STRING)
 | 
			
		||||
	private LocalDateTime taskCreateTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("进场时间")
 | 
			
		||||
@ -59,6 +63,12 @@ public class WgzAppUnderwayRes implements Serializable {
 | 
			
		||||
	@ApiModelProperty("离场时间")
 | 
			
		||||
	private LocalDate leaveTime;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("工种")
 | 
			
		||||
	private String typeOfWork;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("工种名称")
 | 
			
		||||
	private String typeOfWorkLabel;
 | 
			
		||||
 | 
			
		||||
//	@ApiModelProperty("已报名数量")
 | 
			
		||||
//	private Integer numberOfRegistered;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -37,6 +37,7 @@ import com.ruoyi.wgz.service.IWgzAttendanceService;
 | 
			
		||||
import com.ruoyi.wgz.service.IWgzLeaveService;
 | 
			
		||||
import com.ruoyi.wgz.service.IWgzUserService;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.context.annotation.Lazy;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.transaction.annotation.Transactional;
 | 
			
		||||
 | 
			
		||||
@ -61,19 +62,14 @@ public class WgzAttendanceServiceImpl extends ServicePlusImpl<WgzAttendanceMappe
 | 
			
		||||
	public static final String OffDuty = "1";
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	@Lazy
 | 
			
		||||
	private IBgtProjectRecruitApplyService iBgtProjectRecruitApplyService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IBgtProjectRecruitService iBgtProjectRecruitService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IWgzLeaveService iWgzLeaveService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IFbsProjectTaskService taskService;
 | 
			
		||||
 | 
			
		||||
	@Autowired
 | 
			
		||||
	private IWgzUserService wgzUserService;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
 | 
			
		||||
@ -230,12 +230,15 @@ public class WgzDailyClockServiceImpl extends ServicePlusImpl<WgzDailyClockMappe
 | 
			
		||||
		if (req.getStatus().equals("1")){
 | 
			
		||||
			now = req.getRqData();
 | 
			
		||||
		}
 | 
			
		||||
//		//3、判断当前时间的补卡是否存在,存在就不允许插入
 | 
			
		||||
//		LambdaQueryWrapper<WgzDailyClock> apply = new LambdaQueryWrapper<WgzDailyClock>()
 | 
			
		||||
//			.eq(WgzDailyClock::getUserId, appUserId)
 | 
			
		||||
//			.eq(WgzDailyClock::getRecruitId, appById.getId())
 | 
			
		||||
//			.eq(WgzDailyClock::getDilyTime, now);
 | 
			
		||||
//		List<WgzDailyClock> wgzDailyClocks = baseMapper.selectList(apply);
 | 
			
		||||
		//3、判断当前时间的补卡是否存在,存在就不允许插入
 | 
			
		||||
		LambdaQueryWrapper<WgzDailyClock> apply = new LambdaQueryWrapper<WgzDailyClock>()
 | 
			
		||||
			.eq(WgzDailyClock::getUserId, appUserId)
 | 
			
		||||
			.eq(WgzDailyClock::getRecruitId, appById.getId())
 | 
			
		||||
			.eq(WgzDailyClock::getDilyTime, now);
 | 
			
		||||
		List<WgzDailyClock> wgzDailyClocks = baseMapper.selectList(apply);
 | 
			
		||||
		if (!wgzDailyClocks.isEmpty()){
 | 
			
		||||
			throw new RuntimeException("当前时间已存在补卡记录!");
 | 
			
		||||
		}
 | 
			
		||||
		//1、组装数据
 | 
			
		||||
		WgzDailyClock dc = new WgzDailyClock();
 | 
			
		||||
		BeanUtils.copyProperties(req,dc);
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user