3.19优化
This commit is contained in:
		@ -11,6 +11,7 @@ import com.ruoyi.common.core.mybatisplus.cache.MybatisPlusRedisCache;
 | 
			
		||||
import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo;
 | 
			
		||||
import org.apache.ibatis.annotations.CacheNamespace;
 | 
			
		||||
import org.apache.ibatis.annotations.Param;
 | 
			
		||||
 | 
			
		||||
@ -43,4 +44,7 @@ public interface BgtProjectRecruitApplyMapper extends BaseMapperPlus<BgtProjectR
 | 
			
		||||
 | 
			
		||||
	// 我的任务详情-务工者人员列表分页
 | 
			
		||||
	Page<BgtProjectRecruitApplyVO> taskUserList(@Param("page")Page<BgtProjectTaskUserDTO> queryDTOPage, @Param("dto") BgtProjectTaskUserDTO dto);
 | 
			
		||||
 | 
			
		||||
	//获取指定用户的所有招工
 | 
			
		||||
	List<WgzAppUserAllRecruitmentTwo> userAllRecruitment(@Param("userId") Long userId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -9,6 +9,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestBody;
 | 
			
		||||
 | 
			
		||||
@ -88,6 +89,11 @@ public interface IBgtProjectRecruitApplyService extends IServicePlus<BgtProjectR
 | 
			
		||||
	 * =================================================================================================================
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 获取当前用户的所有招工
 | 
			
		||||
	 */
 | 
			
		||||
	List<WgzAppUserAllRecruitmentTwo> userAllRecruitment();
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * 根据用户唯一标识去查询当前进场的工地信息
 | 
			
		||||
	 */
 | 
			
		||||
 | 
			
		||||
@ -34,6 +34,7 @@ import com.ruoyi.system.service.ISysDictTypeService;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppConfirmRegistrationReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.req.WgzAppUnderwayReq;
 | 
			
		||||
import com.ruoyi.wgz.bo.res.WgzAppUnderwayRes;
 | 
			
		||||
import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzMessage;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzScoreRecord;
 | 
			
		||||
import com.ruoyi.wgz.domain.WgzUser;
 | 
			
		||||
@ -204,6 +205,30 @@ public class BgtProjectRecruitApplyServiceImpl extends ServicePlusImpl<BgtProjec
 | 
			
		||||
		return baseMapper.appQueryList(dto);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public List<WgzAppUserAllRecruitmentTwo> userAllRecruitment() {
 | 
			
		||||
		//1、获取到所有项目
 | 
			
		||||
		Long appUserId = SecurityUtils.getAppUserId();
 | 
			
		||||
		List<WgzAppUserAllRecruitmentTwo> res = baseMapper.userAllRecruitment(appUserId);
 | 
			
		||||
		//2、获取到当前人员所在的工地
 | 
			
		||||
		for (WgzAppUserAllRecruitmentTwo re : res) {
 | 
			
		||||
			LambdaQueryWrapper<BgtProjectRecruitApply> last = new LambdaQueryWrapper<BgtProjectRecruitApply>()
 | 
			
		||||
				.eq(BgtProjectRecruitApply::getRecruitId, re.getRecruitId())
 | 
			
		||||
				.eq(BgtProjectRecruitApply::getUserId, appUserId)
 | 
			
		||||
				.orderByDesc(BgtProjectRecruitApply::getId)
 | 
			
		||||
				.last("limit 1");
 | 
			
		||||
			BgtProjectRecruitApply bgtProjectRecruitApply = baseMapper.selectOne(last);
 | 
			
		||||
			if (bgtProjectRecruitApply != null && bgtProjectRecruitApply.getStatus().equals("5")) {
 | 
			
		||||
				re.setType("1");
 | 
			
		||||
			}else{
 | 
			
		||||
				re.setType("2");
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		//3、res按照type升序,然后按照id降低
 | 
			
		||||
		res.sort(Comparator.comparing(WgzAppUserAllRecruitmentTwo::getType).thenComparing(WgzAppUserAllRecruitmentTwo::getRecruitId));
 | 
			
		||||
		return res;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	@Transactional(rollbackFor = Exception.class)
 | 
			
		||||
	public Boolean consent(BgtProjectRecruitApplyConsentDTO dto) {
 | 
			
		||||
 | 
			
		||||
@ -68,6 +68,7 @@ public interface IAnnexService extends IServicePlus<Annex> {
 | 
			
		||||
	 * @return
 | 
			
		||||
	 */
 | 
			
		||||
	void insertBatch(List<AnnexDTO> annexList);
 | 
			
		||||
	Boolean insertBatchLc(List<AnnexDTO> annexList);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
 | 
			
		||||
@ -116,6 +116,21 @@ public class AnnexServiceImpl extends ServicePlusImpl<AnnexMapper, Annex> implem
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	public Boolean insertBatchLc(List<AnnexDTO> annexList) {
 | 
			
		||||
		List<Annex> annexes = annexList.stream()
 | 
			
		||||
			.map(dto -> {
 | 
			
		||||
				Annex annex = new Annex();
 | 
			
		||||
				BeanUtil.copyProperties(dto, annex);
 | 
			
		||||
				return annex;
 | 
			
		||||
			})
 | 
			
		||||
			.collect(Collectors.toList());
 | 
			
		||||
		if(CollectionUtil.isNotEmpty(annexes)){
 | 
			
		||||
			return super.saveAll(annexes);
 | 
			
		||||
		}
 | 
			
		||||
		return false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	@Override
 | 
			
		||||
	@Transactional
 | 
			
		||||
	public Boolean deleteByIds(Long id) {
 | 
			
		||||
 | 
			
		||||
@ -12,4 +12,5 @@ import lombok.experimental.Accessors;
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("请假·历史请假记录请求对象")
 | 
			
		||||
public class WgzAppLeaveHistoryListPageReq extends PageReq {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -70,8 +70,8 @@ public class WgzAppRealNameAuthenticationReq implements Serializable {
 | 
			
		||||
	@NotBlank(message = "银行卡号不能为空")
 | 
			
		||||
	private String cardNo;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("附件实体数据")
 | 
			
		||||
	private List<Annex> annex;
 | 
			
		||||
//	@ApiModelProperty("附件实体数据")
 | 
			
		||||
//	private List<Annex> annex;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("工种,多个逗号分隔")
 | 
			
		||||
	private String typeOfWork;
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,20 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.req;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.common.domain.Annex;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("附件新增请求对象")
 | 
			
		||||
public class WgzAppUserDeleteAttachmentAdd implements Serializable {
 | 
			
		||||
	@ApiModelProperty("附件实体数据")
 | 
			
		||||
	private List<Annex> annex;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,20 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.res;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.wgz.bo.rests.WgzAppUserAllRecruitmentTwo;
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("项目进行中返回对象")
 | 
			
		||||
public class WgzAppUserAllRecruitmentRes implements Serializable {
 | 
			
		||||
	@ApiModelProperty("列表")
 | 
			
		||||
	private List<WgzAppUserAllRecruitmentTwo> list;
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,24 @@
 | 
			
		||||
package com.ruoyi.wgz.bo.rests;
 | 
			
		||||
 | 
			
		||||
import io.swagger.annotations.ApiModel;
 | 
			
		||||
import io.swagger.annotations.ApiModelProperty;
 | 
			
		||||
import lombok.Data;
 | 
			
		||||
import lombok.NoArgsConstructor;
 | 
			
		||||
import lombok.experimental.Accessors;
 | 
			
		||||
 | 
			
		||||
import java.io.Serializable;
 | 
			
		||||
 | 
			
		||||
@Data
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@Accessors(chain = true)
 | 
			
		||||
@ApiModel("获取当前用户的所有招工信息返回")
 | 
			
		||||
public class WgzAppUserAllRecruitmentTwo implements Serializable {
 | 
			
		||||
	@ApiModelProperty("主键ID")
 | 
			
		||||
	private Long recruitId;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("招工名称")
 | 
			
		||||
	private String recruitName;
 | 
			
		||||
 | 
			
		||||
	@ApiModelProperty("1当前招工 2历史招工")
 | 
			
		||||
	private String type;
 | 
			
		||||
}
 | 
			
		||||
@ -12,6 +12,7 @@ import com.ruoyi.common.domain.Annex;
 | 
			
		||||
import com.ruoyi.common.domain.dto.AnnexDTO;
 | 
			
		||||
import com.ruoyi.common.service.IAnnexService;
 | 
			
		||||
import com.ruoyi.common.util.DataUtil;
 | 
			
		||||
import com.ruoyi.common.util.ValidUtil;
 | 
			
		||||
import com.ruoyi.common.utils.PageUtils;
 | 
			
		||||
import com.ruoyi.common.utils.SecurityUtils;
 | 
			
		||||
import com.ruoyi.system.service.ISysDictTypeService;
 | 
			
		||||
@ -199,6 +200,13 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
	@Override
 | 
			
		||||
	@Transactional()
 | 
			
		||||
	public Boolean userRealNameAuthentication(WgzAppRealNameAuthenticationReq req) {
 | 
			
		||||
		if (!ValidUtil.isValidIdentityCard(req.getIdentityCard())){
 | 
			
		||||
			throw new RuntimeException("请检查身份证!");
 | 
			
		||||
		}
 | 
			
		||||
		if(!ValidUtil.isValidBankCard(req.getCardNo())){
 | 
			
		||||
			throw new RuntimeException("请检查银行卡!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//1、对指定用户进行实名认证
 | 
			
		||||
		WgzUser user = new WgzUser();
 | 
			
		||||
		BeanUtils.copyProperties(req, user);
 | 
			
		||||
@ -206,20 +214,16 @@ public class WgzUserServiceImpl extends ServicePlusImpl<WgzUserMapper, WgzUser>
 | 
			
		||||
		if (update == 0){
 | 
			
		||||
			throw new RuntimeException("当前用户不存在!");
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		//2、新增附件
 | 
			
		||||
		List<Annex> annex = req.getAnnex();
 | 
			
		||||
		List<AnnexDTO> annexDTOS = new ArrayList<>();
 | 
			
		||||
		for (Annex data : annex) {
 | 
			
		||||
			AnnexDTO dto = new AnnexDTO();
 | 
			
		||||
			BeanUtils.copyProperties(data, dto);
 | 
			
		||||
			dto.setUserId(req.getUserId()).setUserType(WGZ);
 | 
			
		||||
//				setAnnexType(data.getAnnexType()).
 | 
			
		||||
//				setAnnexName(data.getAnnexName()).
 | 
			
		||||
//				setAnnexUrl(data.getAnnexUrl());
 | 
			
		||||
			annexDTOS.add(dto);
 | 
			
		||||
		}
 | 
			
		||||
		iAnnexService.insertBatch(annexDTOS);
 | 
			
		||||
//		//2、新增附件
 | 
			
		||||
//		List<Annex> annex = req.getAnnex();
 | 
			
		||||
//		List<AnnexDTO> annexDTOS = new ArrayList<>();
 | 
			
		||||
//		for (Annex data : annex) {
 | 
			
		||||
//			AnnexDTO dto = new AnnexDTO();
 | 
			
		||||
//			BeanUtils.copyProperties(data, dto);
 | 
			
		||||
//			dto.setUserId(req.getUserId()).setUserType(WGZ);
 | 
			
		||||
//			annexDTOS.add(dto);
 | 
			
		||||
//		}
 | 
			
		||||
//		iAnnexService.insertBatch(annexDTOS);
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user