Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
pserimal
2023-06-29 15:46:34 +08:00
10 changed files with 53 additions and 17 deletions

View File

@@ -36,7 +36,7 @@ public enum WorkflowStageEnum {
public static final HashMap<String,String> getWorkflowStageMap(){
HashMap<String, String> result = new HashMap<>();
result.put(INTENT.getCode(),WorkflowStatusEnum.INTENT_3.getCode());
result.put(RESERVATION.getCode(),WorkflowStatusEnum.RESERVATION_8.getCode());
result.put(RESERVATION.getCode(),WorkflowStatusEnum.RESERVATION_7.getCode());
result.put(INTERVIEW.getCode(),WorkflowStatusEnum.INTERVIEW_7.getCode());
return result;
}

View File

@@ -386,6 +386,7 @@
hpll.id as partnerLineId,
hpci.qualify_verify_id as qualifyVerifyId,
hpci.intention_contract_no as intentionContractNo,
hpll.workflow_stage as workflowStage,
hpi.pass_time as passTime,
hpi.pass_reason as passReason,
hpi.recorder as recorderId,

View File

@@ -54,7 +54,7 @@ public class OpenAreaTreeVO {
public static List<OpenAreaTreeVO> convertTree(List<HyOpenAreaInfoDO> allOpenArea, String keyword, Boolean applyFlag){
long startTime = System.currentTimeMillis();
List<HyOpenAreaInfoDO> firstArea = allOpenArea.stream().filter(o -> Objects.isNull(o.getParentId())).collect(Collectors.toList());
Map<Long, List<HyOpenAreaInfoDO>> openAreaParentMap = allOpenArea.stream().filter(o->Objects.nonNull(o.getParentId())).collect(Collectors.groupingBy(k -> k.getParentId()));
Map<Long, List<HyOpenAreaInfoDO>> openAreaParentMap = allOpenArea.stream().distinct().filter(o->Objects.nonNull(o.getParentId())).collect(Collectors.groupingBy(k -> k.getParentId()));
List<OpenAreaTreeVO> allTree = new ArrayList<>();
for (HyOpenAreaInfoDO openAreaInfo : firstArea) {
OpenAreaTreeVO node = copyProperties(openAreaInfo);
@@ -62,29 +62,33 @@ public class OpenAreaTreeVO {
node.setChildNode(childList);
allTree.add(node);
}
//不需要过滤 直接返回
if(StringUtils.isBlank(keyword) && (Objects.isNull(applyFlag) || !applyFlag)){
return allTree;
}
log.info("1#耗时:{}", System.currentTimeMillis() - startTime);
Map<Long, List<OpenAreaTreeVO>> childMap = allTree.stream().collect(Collectors.toMap(k -> k.getId(), v -> v.getChildNode()));
List<HyOpenAreaInfoDO> filterList = allOpenArea.stream().filter(o -> (StringUtils.isBlank(keyword) || o.getAreaPath().contains(keyword))
&& (Objects.isNull(applyFlag) || AreaStatusEnum.OPEN.getCode().equals(o.getAreaStatus()) || AreaStatusEnum.OPEN.getCode().equals(o.getAreaStatus())))
.collect(Collectors.toList());
Map<Long, HyOpenAreaInfoDO> openAreaMap = allOpenArea.stream().collect(Collectors.toMap(k -> k.getId(), Function.identity()));
List<HyOpenAreaInfoDO> list = new ArrayList<>();
List<HyOpenAreaInfoDO> filterAndParentList = new ArrayList<>();
//向上处理节点
for (HyOpenAreaInfoDO openAreaInfo : filterList) {
list.add(openAreaInfo);
filterAndParentList.add(openAreaInfo);
while (Objects.nonNull(openAreaInfo) && Objects.nonNull(openAreaInfo.getParentId())){
openAreaInfo = openAreaMap.get(openAreaInfo.getParentId());
if(Objects.isNull(openAreaInfo)){
continue;
if(Objects.nonNull(openAreaInfo) && !filterAndParentList.contains(openAreaInfo)){
filterAndParentList.add(openAreaInfo);
}
list.add(openAreaInfo);
}
}
log.info("2#耗时:{}", System.currentTimeMillis() - startTime);
List<OpenAreaTreeVO> resultList = new ArrayList<>();
List<HyOpenAreaInfoDO> filterFirstArea = list.stream().filter(o -> Objects.isNull(o.getParentId())).distinct().collect(Collectors.toList());
Map<Long, List<HyOpenAreaInfoDO>> filterOpenAreaParentMap = list.stream().filter(Objects::nonNull).filter(o->Objects.nonNull(o.getParentId())).collect(Collectors.groupingBy(k -> k.getParentId()));
List<HyOpenAreaInfoDO> filterFirstArea = filterAndParentList.stream().filter(o -> Objects.isNull(o.getParentId())).collect(Collectors.toList());
Map<Long, List<HyOpenAreaInfoDO>> filterOpenAreaParentMap = filterAndParentList.stream().filter(Objects::nonNull).filter(o->Objects.nonNull(o.getParentId())).collect(Collectors.groupingBy(k -> k.getParentId()));
for (HyOpenAreaInfoDO openAreaInfo : filterFirstArea) {
Long id = openAreaInfo.getId();
OpenAreaTreeVO node = copyProperties(openAreaInfo);
List<OpenAreaTreeVO> childList = dealChild(openAreaInfo, filterOpenAreaParentMap);
if(CollectionUtils.isEmpty(childList)){

View File

@@ -25,6 +25,9 @@ public class InterviewVO {
@ApiModelProperty(value = "线索id", required = true)
private Long partnerLineId;
@ApiModelProperty(value = "线索状态")
private Long workflowStage;
@ApiModelProperty("资质审核流程id")
private String qualifyVerifyId;

View File

@@ -76,5 +76,17 @@ public class JobHandler {
}
}
@XxlJob("approvalReminder")
public void approvalReminder(){
try {
log.info("审批即将超时提醒开始");
hyPartnerInterviewPlanService.approvalReminder();
log.info("审批即将超时提醒结束");
XxlJobHelper.handleSuccess();
}catch (Exception e){
log.error("审批即将超时提醒定时任务异常",e);
XxlJobHelper.log("审批即将超时提醒定时任务异常"+e.getMessage());
}
}
}

View File

@@ -62,4 +62,5 @@ public interface HyPartnerInterviewPlanService {
* @return
*/
void updateAbsentInterview() throws ApiException;
void approvalReminder() throws ApiException;
}

View File

@@ -72,14 +72,14 @@ public class CommonServiceImpl implements CommonService {
if(partnerCertificationInfoDO != null){
intentionContractNo = partnerCertificationInfoDO.getIntentionContractNo();
}
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "发起加盟商资质审核|"+intentionContractNo);
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "发起加盟商资质审核 | "+intentionContractNo);
}else if (workflowStage.equals(WorkflowStageEnum.INTERVIEW.getCode()) && workflowStatus.equals(WorkflowStatusEnum.INTERVIEW_6.getCode())) {
HyPartnerCertificationInfoDO partnerCertificationInfoDO = hyPartnerCertificationInfoMapper.selectByPartnerLineId(partnerLineId);
String intentionContractNo = null;
if(partnerCertificationInfoDO != null){
intentionContractNo = partnerCertificationInfoDO.getIntentionContractNo();
}
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "审核通过|"+intentionContractNo);
return getInterviewTips(partnerLineId, OperateTypeEnum.FINISH_INTERVIEW, "审核通过 | "+intentionContractNo);
}
return null;

View File

@@ -184,13 +184,16 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
hyPartnerUserInfoDAO.updateByPrimaryKeySelective(hyPartnerUserInfoDO);
// 更新线索状态和招商经理
HyPartnerLineInfoDO hyPartnerLineInfoDO = hyPartnerLineInfoDAO.selectByPrimaryKeySelective(request.getPartnerLineId());
Boolean flag = hyPartnerLineInfoService.assignFollowUser(request.getPartnerId(), request.getWantShopArea(), request.getAcceptAdjustType());
hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode());
if (flag){
String investmentManager = hyPartnerLineInfoService.getAssignFollowUser(request.getPartnerId(), "intent");
hyPartnerLineInfoDO.setInvestmentManager(investmentManager);
//是公海线索 才会修改线索状态与招商经理
if (LineStatusEnum.PUBLIC_SEAS.getCode().equals(hyPartnerLineInfoDO.getLineStatus())){
Boolean flag = hyPartnerLineInfoService.assignFollowUser(request.getPartnerId(), request.getWantShopArea(), request.getAcceptAdjustType());
hyPartnerLineInfoDO.setLineStatus(flag ? LineStatusEnum.PRIVATE_SEAS.getCode() : LineStatusEnum.PUBLIC_SEAS.getCode());
if (flag){
String investmentManager = hyPartnerLineInfoService.getAssignFollowUser(request.getPartnerId(), "intent");
hyPartnerLineInfoDO.setInvestmentManager(investmentManager);
}
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
}
hyPartnerLineInfoDAO.updateByPrimaryKeySelective(hyPartnerLineInfoDO);
}
if (StringUtil.isNotBlank(request.getWantShopArea())){
HyOpenAreaInfoDO hyOpenAreaInfoDO = hyOpenAreaInfoDAO.selectById(Long.valueOf(request.getWantShopArea()));

View File

@@ -221,6 +221,16 @@ public class HyPartnerInterviewPlanServiceImpl implements HyPartnerInterviewPlan
handleOverTimeInterview(interviewBaseInfoList,"超时未面试");
}
@Override
public void approvalReminder() throws ApiException {
//查询即将超时但未审批的面试
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setDeleted(Boolean.FALSE);
hyPartnerInterviewPlanDO.setApplicationApproved(0);
// hyPartnerInterviewPlanDO.setStartTime();
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
}
/**
* 统一处理面试超时情况,包括超时未预约和超时未面试
* @param interviewBaseInfoList

View File

@@ -587,6 +587,8 @@ public class InterviewServiceImpl implements InterviewService {
//根据加盟商用户ID查询面试官ID
HyPartnerInterviewPlanDO hyPartnerInterviewPlanDO = new HyPartnerInterviewPlanDO();
hyPartnerInterviewPlanDO.setPartnerId(partnerId);
hyPartnerInterviewPlanDO.setPartnerLineId(Long.valueOf(lineId));
hyPartnerInterviewPlanDO.setDeleted(false);
List<HyPartnerInterviewPlanDO> hyPartnerInterviewPlanDOS = hyPartnerInterviewPlanMapper.selectBySelective(hyPartnerInterviewPlanDO);
//如果查询结果为空,则去线索中获取招商经理,面试官只有两个阶段,一个是在第一次申请时不存在面试安排直接取招商经理,第二个时面试信息中可修改面试官信息,这个时候以面试信息中为准
if (CollectionUtils.isEmpty(hyPartnerInterviewPlanDOS)) {