流程策略
This commit is contained in:
@@ -5,8 +5,9 @@ import com.google.common.collect.Lists;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
@@ -26,13 +27,19 @@ public class EnterpriseUserSingleInfoVO {
|
||||
if(CollectionUtils.isEmpty(userList)){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
Map<String, String> userIdMap = new HashMap<>();
|
||||
List<EnterpriseUserSingleInfoVO> resultList = new ArrayList<>();
|
||||
for (EnterpriseUserDO enterpriseUser : userList) {
|
||||
EnterpriseUserSingleInfoVO result = new EnterpriseUserSingleInfoVO();
|
||||
result.setUserId(enterpriseUser.getUserId());
|
||||
result.setUserName(enterpriseUser.getName());
|
||||
result.setMobile(enterpriseUser.getMobile());
|
||||
resultList.add(result);
|
||||
String userId = enterpriseUser.getUserId();
|
||||
boolean isContains = userIdMap.containsKey(userId);
|
||||
if(isContains){
|
||||
EnterpriseUserSingleInfoVO result = new EnterpriseUserSingleInfoVO();
|
||||
result.setUserId(userId);
|
||||
result.setUserName(enterpriseUser.getName());
|
||||
result.setMobile(enterpriseUser.getMobile());
|
||||
resultList.add(result);
|
||||
userIdMap.put(userId, userId);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.cool.store.service;
|
||||
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: WorkFlowService
|
||||
* @Description: 流程服务
|
||||
* @date 2023-06-26 21:14
|
||||
*/
|
||||
public interface WorkFlowService {
|
||||
|
||||
/**
|
||||
* 结束流程
|
||||
* @param workflowStage
|
||||
* @param request
|
||||
*/
|
||||
void endProcess(WorkflowStageEnum workflowStage, CloseFollowRequest request);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.service.WorkFlowService;
|
||||
import com.cool.store.service.impl.workflow.IntentWorkFlowService;
|
||||
import com.cool.store.service.impl.workflow.InterviewWorkFlowService;
|
||||
import com.cool.store.service.impl.workflow.ReservationWorkFlowService;
|
||||
import com.cool.store.service.impl.workflow.WorkFlowBaseService;
|
||||
import com.cool.store.utils.CommonContextUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: WorkFlowBaseService
|
||||
* @Description:
|
||||
* @date 2023-06-26 21:14
|
||||
*/
|
||||
@Service
|
||||
public class WorkFlowServiceImpl implements WorkFlowService{
|
||||
|
||||
private WorkFlowBaseService getWorkflowService(WorkflowStageEnum workflowStage){
|
||||
switch (workflowStage){
|
||||
case INTENT:
|
||||
return CommonContextUtil.getBean(IntentWorkFlowService.class);
|
||||
case RESERVATION:
|
||||
return CommonContextUtil.getBean(ReservationWorkFlowService.class);
|
||||
case INTERVIEW:
|
||||
return CommonContextUtil.getBean(InterviewWorkFlowService.class);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endProcess(WorkflowStageEnum workflowStage, CloseFollowRequest request) {
|
||||
getWorkflowService(workflowStage).endProcess(request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cool.store.service.impl.workflow;
|
||||
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.service.impl.WorkFlowServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: IntentWorkFlowService
|
||||
* @Description: 意向申请
|
||||
* @date 2023-06-26 21:21
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class IntentWorkFlowService extends WorkFlowBaseService {
|
||||
|
||||
@Override
|
||||
public WorkflowStageEnum getWorkFlowStage() {
|
||||
return WorkflowStageEnum.INTENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endProcess(CloseFollowRequest request) {
|
||||
log.info("意向申请结束~");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cool.store.service.impl.workflow;
|
||||
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.service.impl.WorkFlowServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: InterviewWorkFlowService
|
||||
* @Description:面试流程
|
||||
* @date 2023-06-26 21:24
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class InterviewWorkFlowService extends WorkFlowBaseService {
|
||||
|
||||
@Override
|
||||
public WorkflowStageEnum getWorkFlowStage() {
|
||||
return WorkflowStageEnum.RESERVATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endProcess(CloseFollowRequest request) {
|
||||
log.info("面试结束~");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cool.store.service.impl.workflow;
|
||||
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
import com.cool.store.service.impl.WorkFlowServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: ReservationWorkFlowService
|
||||
* @Description:预约面试
|
||||
* @date 2023-06-26 21:23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ReservationWorkFlowService extends WorkFlowBaseService {
|
||||
|
||||
@Override
|
||||
public WorkflowStageEnum getWorkFlowStage() {
|
||||
return WorkflowStageEnum.RESERVATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void endProcess(CloseFollowRequest request) {
|
||||
log.info("预约面试结束~");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.cool.store.service.impl.workflow;
|
||||
|
||||
import com.cool.store.enums.WorkflowStageEnum;
|
||||
import com.cool.store.request.CloseFollowRequest;
|
||||
|
||||
/**
|
||||
* @author zhangchenbiao
|
||||
* @FileName: WorkFlowBaseService
|
||||
* @Description:
|
||||
* @date 2023-06-26 22:15
|
||||
*/
|
||||
public abstract class WorkFlowBaseService {
|
||||
|
||||
/**
|
||||
* 获取流程阶段
|
||||
* @return
|
||||
*/
|
||||
public abstract WorkflowStageEnum getWorkFlowStage();
|
||||
|
||||
/**
|
||||
* 结束流程
|
||||
* @param request
|
||||
*/
|
||||
public abstract void endProcess(CloseFollowRequest request);
|
||||
}
|
||||
Reference in New Issue
Block a user