Commit b72543ff by 黄炜

feat(recruitment): 试岗计划字段调整

1 parent 4a124f58
package cn.com.glsx.dj.staff.miniprogram.controller.recruitment; package cn.com.glsx.dj.staff.miniprogram.controller.recruitment;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentSubSceneDTO;
import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentTrialOnboardingDTO; import cn.com.glsx.dj.staff.dto.recruitment.RecruitmentTrialOnboardingDTO;
import cn.com.glsx.dj.staff.miniprogram.request.recruitment.RecruitmentTrialOnboardingAddRequest; import cn.com.glsx.dj.staff.miniprogram.request.recruitment.*;
import cn.com.glsx.dj.staff.miniprogram.request.recruitment.RecruitmentTrialOnboardingDeleteRequest; import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentTrialStoreListResponse;
import cn.com.glsx.dj.staff.miniprogram.request.recruitment.RecruitmentTrialOnboardingProcessRequest;
import cn.com.glsx.dj.staff.miniprogram.service.recruitment.RecruitmentDemandService; import cn.com.glsx.dj.staff.miniprogram.service.recruitment.RecruitmentDemandService;
import cn.com.glsx.dj.staff.miniprogram.util.CommonUtil; import cn.com.glsx.dj.staff.miniprogram.util.CommonUtil;
import cn.com.glsx.dj.staff.remote.RecruitmentDemandRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.rop.response.RopResponse; import cn.com.glsx.framework.rop.response.RopResponse;
import com.rop.annotation.NeedInSessionType; import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod; import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean; import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date; import java.util.Date;
import java.util.List;
@Slf4j @Slf4j
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.NO)
@Api("招聘试岗(试岗计划)") @Api("招聘试岗(试岗计划)")
@RestController
@RequiredArgsConstructor
public class RecruitmentTrialOnboardingController { public class RecruitmentTrialOnboardingController {
@Autowired private final RecruitmentDemandService recruitmentDemandService;
private RecruitmentDemandService recruitmentDemandService;
private final RecruitmentDemandRemote recruitmentDemandRemote;
/** /**
* 新增试岗人员 * 新增试岗人员
*/ */
@ApiOperation("新增试岗人员") @ApiOperation("新增试岗人员")
@ServiceMethod(method = "dj.api.staff.miniprogram.recruitment.trial.onboarding.add", needInSession = NeedInSessionType.YES) @ServiceMethod(method = "dj.api.staff.miniprogram.recruitment.trial.onboarding.add", needInSession = NeedInSessionType.YES)
@PostMapping("/dj.api.staff.miniprogram.recruitment.trial.onboarding.add/1.0.0")
public RopResponse<Boolean> trialOnboardingAdd(RecruitmentTrialOnboardingAddRequest request) { public RopResponse<Boolean> trialOnboardingAdd(RecruitmentTrialOnboardingAddRequest request) {
RecruitmentTrialOnboardingDTO dto = CommonUtil.convertRequest(RecruitmentTrialOnboardingDTO.class); RecruitmentTrialOnboardingDTO dto = CommonUtil.convertRequest(RecruitmentTrialOnboardingDTO.class);
...@@ -74,4 +86,26 @@ public class RecruitmentTrialOnboardingController { ...@@ -74,4 +86,26 @@ public class RecruitmentTrialOnboardingController {
dto.setProcessTime(new Date()); dto.setProcessTime(new Date());
return recruitmentDemandService.trialOnboardingProcess(dto); return recruitmentDemandService.trialOnboardingProcess(dto);
} }
/**
* 试岗门店(4S店)下拉列表:区域运营名下关联的全部4S店
*/
@ApiOperation("试岗门店(4S店)下拉列表")
@ServiceMethod(method = "dj.api.staff.miniprogram.recruitment.trial.onboarding.store.list", needInSession = NeedInSessionType.YES)
@PostMapping("/dj.api.staff.miniprogram.recruitment.trial.onboarding.store.list/1.0.0")
public RopResponse<List<RecruitmentTrialStoreListResponse>> trialStoreList(RecruitmentDemandStoreListRequest request) {
return recruitmentDemandService.listTrialStore(request.getMerchantName());
}
@ApiOperation("新增试岗-小场景列表查询")
@ServiceMethod(method = "dj.staff.api.recruitment.demand.sub.scene.list", needInSession = NeedInSessionType.YES)
@PostMapping("/dj.staff.api.recruitment.demand.sub.scene.list/1.0.0")
public RopResponse<List<RecruitmentSubSceneDTO>> listSubScene(RecruitmentSubSceneListRequest request) {
RecruitmentSubSceneDTO dto = RecruitmentSubSceneDTO.builder()
.merchantId(request.getMerchantId())
.businessType(request.getBusinessType())
.build();
RpcResponse<List<RecruitmentSubSceneDTO>> response = recruitmentDemandRemote.listSubScenes(dto);
return CommonUtil.convertRopResponse(response);
}
} }
package cn.com.glsx.dj.staff.miniprogram.request.recruitment;
import com.rop.AbstractRopRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @Author huangwei
* @Description
* @Date 2026/6/22 17:16
*/
@Data
@Builder
@EqualsAndHashCode(callSuper = true)
public class RecruitmentSubSceneListRequest extends AbstractRopRequest {
@ApiModelProperty(notes = "门店商户号", required = true)
private Integer merchantId;
@ApiModelProperty(notes = "招聘需求业务类型值", required = true)
private Integer businessType;
}
...@@ -45,4 +45,39 @@ public class RecruitmentTrialOnboardingAddRequest extends AbstractRopRequest { ...@@ -45,4 +45,39 @@ public class RecruitmentTrialOnboardingAddRequest extends AbstractRopRequest {
@NotBlank(message = "招聘渠道类型名不能为空") @NotBlank(message = "招聘渠道类型名不能为空")
@ApiModelProperty(notes = "招聘渠道类型名", required = true) @ApiModelProperty(notes = "招聘渠道类型名", required = true)
private String channelName; private String channelName;
/**
* 试岗门店商户号(4s店或园区店)
*/
@NotBlank(message = "试岗门店商户号不能为空")
@ApiModelProperty(notes = "试岗门店商户号(4s店或园区店)", required = true)
private String storeNo;
/**
* 试岗门店名称
*/
@NotBlank(message = "试岗门店名称不能为空")
@ApiModelProperty(notes = "试岗门店名称", required = true)
private String storeName;
/**
* 业务场景信息,JSON数组格式
*/
@NotBlank(message = "业务场景信息不能为空")
@ApiModelProperty(notes = "业务场景信息,JSON数组格式", required = true)
private String bizSceneInfo;
/**
* 驻店类型字典值
*/
@NotBlank(message = "驻店类型字典值不能为空")
@ApiModelProperty(notes = "驻店类型字典值", required = true)
private String residentType;
/**
* 驻店类型字典名
*/
@NotBlank(message = "驻店类型字典名不能为空")
@ApiModelProperty(notes = "驻店类型字典名", required = true)
private String residentTypeName;
} }
package cn.com.glsx.dj.staff.miniprogram.response.recruitment;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.io.Serializable;
/**
* 试岗门店(4S店)下拉项
*/
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@Data
public class RecruitmentTrialStoreListResponse implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 试岗门店商户号
*/
@ApiModelProperty(notes = "试岗门店商户号")
private String storeNo;
/**
* 试岗门店名称
*/
@ApiModelProperty(notes = "试岗门店名称")
private String storeName;
}
...@@ -19,6 +19,7 @@ import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandDe ...@@ -19,6 +19,7 @@ import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandDe
import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandStatResponse; import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandStatResponse;
import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandStoreListResponse; import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandStoreListResponse;
import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandTSStatResponse; import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentDemandTSStatResponse;
import cn.com.glsx.dj.staff.miniprogram.response.recruitment.RecruitmentTrialStoreListResponse;
import cn.com.glsx.dj.staff.miniprogram.util.CommonUtil; import cn.com.glsx.dj.staff.miniprogram.util.CommonUtil;
import cn.com.glsx.dj.staff.remote.RecruitmentDemandRemote; import cn.com.glsx.dj.staff.remote.RecruitmentDemandRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
...@@ -57,25 +58,17 @@ public class RecruitmentDemandService { ...@@ -57,25 +58,17 @@ public class RecruitmentDemandService {
* @date 2025年10月20日 15:19:14 * @date 2025年10月20日 15:19:14
*/ */
public RopResponse<List<RecruitmentDemandStoreListResponse>> listStore(RecruitmentDemandStoreListRequest request) { public RopResponse<List<RecruitmentDemandStoreListResponse>> listStore(RecruitmentDemandStoreListRequest request) {
log.info("list store, 1.查找当前登录人作为区域运营的门店列表"); // 1.查找当前登录人作为区域运营的4S店列表
ShopMerchantDirectorConfigDTO dto = ShopMerchantDirectorConfigDTO.builder() List<RecruitmentDemandStoreListResponse> shopStoreList = queryShopStoreList(request.getMerchantName());
.directorTypes(Arrays.asList(DirectorTypeEnum.AREA_SUPERVISION_1_1.getValue(), DirectorTypeEnum.AREA_SUPERVISION_2_1.getValue())) if (shopStoreList == null) {
.directorUserId(CommonUtil.getLoginUserInfo().getUuid())
.merchantName(request.getMerchantName()).build();
RpcResponse<List<ShopMerchantDirectorConfigDTO>> shopDirectorConfigResp = shopMerchantDirectorConfigRemote.list(dto);
if (!shopDirectorConfigResp.hasResult()) {
log.error("list store, 1.查找当前登录人作为区域运营的门店列表失败, msg:{}", shopDirectorConfigResp.getMessage());
return RopResponse.error(RopErrorEnum.RECRUITMENT_DEMAND_GET_STORE_LIST_ERROR); return RopResponse.error(RopErrorEnum.RECRUITMENT_DEMAND_GET_STORE_LIST_ERROR);
} }
List<RecruitmentDemandStoreListResponse> shopStoreList = new ArrayList<>(shopDirectorConfigResp.getResult().stream()
.filter(o -> o != null && o.getMerchantId() != null).map(o -> RecruitmentDemandStoreListResponse.builder()
.merchantId(o.getMerchantId()).merchantName(o.getMerchantName()).build()).collect(Collectors.toMap(RecruitmentDemandStoreListResponse::getMerchantId, o -> o, (o1, o2) -> o1)).values());
log.info("list store, 1.查找当前登录人作为区域运营的门店列表成功, size:{}", shopStoreList.size());
List<RecruitmentDemandStoreListResponse> storeList = new ArrayList<>(); List<RecruitmentDemandStoreListResponse> storeList = new ArrayList<>();
if (CollectionUtils.isEmpty(shopStoreList)) { if (CollectionUtils.isEmpty(shopStoreList)) {
return RopResponse.success(storeList); return RopResponse.success(storeList);
} }
storeList.addAll(shopStoreList); storeList.addAll(shopStoreList);
// 2.查找门店关联园区店列表
log.info("list store, 2.查找门店关联园区店列表"); log.info("list store, 2.查找门店关联园区店列表");
List<Integer> shopMerchantIds = shopStoreList.stream().map(RecruitmentDemandStoreListResponse::getMerchantId).distinct().collect(Collectors.toList()); List<Integer> shopMerchantIds = shopStoreList.stream().map(RecruitmentDemandStoreListResponse::getMerchantId).distinct().collect(Collectors.toList());
SceneMerchantRefDTO sceneMerchantRefDTO = SceneMerchantRefDTO.builder().mainMerchantIdList(shopMerchantIds).subMerchantName(request.getMerchantName()).build(); SceneMerchantRefDTO sceneMerchantRefDTO = SceneMerchantRefDTO.builder().mainMerchantIdList(shopMerchantIds).subMerchantName(request.getMerchantName()).build();
...@@ -94,6 +87,51 @@ public class RecruitmentDemandService { ...@@ -94,6 +87,51 @@ public class RecruitmentDemandService {
return RopResponse.success(storeList); return RopResponse.success(storeList);
} }
/**
* 查询当前登录人(区域运营)名下关联的全部4S店列表(公共方法,供门店列表与试岗门店下拉复用)。
*
* @param merchantName 门店名称模糊搜索关键字,可为空
* @return 4S店列表(按merchantId去重);查询失败返回null
*/
private List<RecruitmentDemandStoreListResponse> queryShopStoreList(String merchantName) {
log.info("list shop store, 查找当前登录人作为区域运营的4S店列表");
ShopMerchantDirectorConfigDTO dto = ShopMerchantDirectorConfigDTO.builder()
.directorTypes(Arrays.asList(DirectorTypeEnum.AREA_SUPERVISION_1_1.getValue(), DirectorTypeEnum.AREA_SUPERVISION_2_1.getValue()))
.directorUserId(CommonUtil.getLoginUserInfo().getUuid())
.merchantName(merchantName).build();
RpcResponse<List<ShopMerchantDirectorConfigDTO>> shopDirectorConfigResp = shopMerchantDirectorConfigRemote.list(dto);
if (!shopDirectorConfigResp.hasResult()) {
log.error("list shop store, 查找当前登录人作为区域运营的4S店列表失败, msg:{}", shopDirectorConfigResp.getMessage());
return null;
}
List<RecruitmentDemandStoreListResponse> shopStoreList = new ArrayList<>(shopDirectorConfigResp.getResult().stream()
.filter(o -> o != null && o.getMerchantId() != null).map(o -> RecruitmentDemandStoreListResponse.builder()
.merchantId(o.getMerchantId()).merchantName(o.getMerchantName()).build()).collect(Collectors.toMap(RecruitmentDemandStoreListResponse::getMerchantId, o -> o, (o1, o2) -> o1)).values());
log.info("list shop store, 查找当前登录人作为区域运营的4S店列表成功, size:{}", shopStoreList.size());
return shopStoreList;
}
/**
* 试岗门店(4S店)下拉列表:区域运营名下关联的全部4S店,转换为试岗门店storeNo/storeName。
* 用于新增/编辑试岗人员时选择试岗门店。
*
* @param storeName 门店名称模糊搜索关键字,可为空
* @return 试岗门店列表
*/
public RopResponse<List<RecruitmentTrialStoreListResponse>> listTrialStore(String storeName) {
List<RecruitmentDemandStoreListResponse> shopStoreList = queryShopStoreList(storeName);
if (shopStoreList == null) {
return RopResponse.error(RopErrorEnum.RECRUITMENT_DEMAND_GET_STORE_LIST_ERROR);
}
List<RecruitmentTrialStoreListResponse> storeList = shopStoreList.stream()
.filter(o -> o != null && o.getMerchantId() != null)
.map(o -> RecruitmentTrialStoreListResponse.builder()
.storeNo(String.valueOf(o.getMerchantId()))
.storeName(o.getMerchantName()).build())
.collect(Collectors.toList());
return RopResponse.success(storeList);
}
/** /**
* 统计区域运营的招聘需求数量 * 统计区域运营的招聘需求数量
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!