招商阶段短信通知与回调逻辑更改

This commit is contained in:
guohb
2024-05-20 17:50:45 +08:00
parent e6ee518da2
commit 9be6d0747e
7 changed files with 56 additions and 35 deletions

View File

@@ -184,6 +184,8 @@ public enum ErrorCodeEnum {
NEW_STORE_FALSE(109011, "新店开业流程API调用失败", null), NEW_STORE_FALSE(109011, "新店开业流程API调用失败", null),
AUDIT_RESULT_FALSE(109012, "意向加盟合同API本次调用结果与上一次不一致", null),
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null), INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null), INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),

View File

@@ -29,6 +29,7 @@ public class LineInfoDO {
/** /**
* 申请人姓名 * 申请人姓名
*/ */
@Column(name = "username")
private String username; private String username;
/** /**
@@ -166,6 +167,7 @@ public class LineInfoDO {
/** /**
* 加盟商编码 * 加盟商编码
*/ */
@Column(name = "partner_num")
private String partnerNum; private String partnerNum;
} }

View File

@@ -119,6 +119,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
requestMap.put("storeName", shopInfoDO.getShopName()); requestMap.put("storeName", shopInfoDO.getShopName());
requestMap.put("partnerName,", lineInfoDO.getUsername()); requestMap.put("partnerName,", lineInfoDO.getUsername());
requestMap.put("partnerMobile", lineInfoDO.getMobile()); requestMap.put("partnerMobile", lineInfoDO.getMobile());
log.info("submitLicense SMS requestMap:{}",JSONObject.toJSONString(requestMap));
commonService.sendMessage(Collections.singletonList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_17, requestMap); commonService.sendMessage(Collections.singletonList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_17, requestMap);
} }
return true; return true;

View File

@@ -8,10 +8,7 @@ import com.cool.store.entity.BankdocDO;
import com.cool.store.entity.BanktypeDO; import com.cool.store.entity.BanktypeDO;
import com.cool.store.entity.LineAuditInfoDO; import com.cool.store.entity.LineAuditInfoDO;
import com.cool.store.entity.LineInfoDO; import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.AuditResultTypeEnum; import com.cool.store.enums.*;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.mapper.LinePayMapper; import com.cool.store.mapper.LinePayMapper;
import com.cool.store.request.AuditRejectRequest; import com.cool.store.request.AuditRejectRequest;
import com.cool.store.request.BranchBankPageRequest; import com.cool.store.request.BranchBankPageRequest;
@@ -48,6 +45,9 @@ public class BankServiceImpl extends LineFlowService implements BankService {
@Resource @Resource
private LineAuditInfoDAO lineAuditInfoDAO; private LineAuditInfoDAO lineAuditInfoDAO;
@Resource
CommonService commonService;
@Override @Override
public List<BanktypeDO> listBank() { public List<BanktypeDO> listBank() {
List<BanktypeDO> bankList = bankDAO.listBank(); List<BanktypeDO> bankList = bankDAO.listBank();
@@ -71,6 +71,7 @@ public class BankServiceImpl extends LineFlowService implements BankService {
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage(); WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
//更新线索阶段 //更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId); lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PAYMENT_SUCCESS);
return Boolean.TRUE; return Boolean.TRUE;
} }

View File

@@ -160,6 +160,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode()); lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode());
lineInfo.setUpdateUserId(userId); lineInfo.setUpdateUserId(userId);
lineInfoDAO.updateLineInfo(lineInfo); lineInfoDAO.updateLineInfo(lineInfo);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PROTOCOL_FAIL);
} }
//待OA审核code 75 处理逻辑 //待OA审核code 75 处理逻辑
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) { if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
@@ -272,9 +273,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override @Override
public Boolean auditResult(AuditResultRequest request) { public Boolean auditResult(AuditResultRequest request) {
try {
String kdzBusinessId = request.getKdzBusinessId(); String kdzBusinessId = request.getKdzBusinessId();
String lineId = getLineId(kdzBusinessId); String lineId = getLineId(kdzBusinessId);
String redisKey = "kdzBusinessId:" + kdzBusinessId;
if (StringUtil.isBlank(lineId)) { if (StringUtil.isBlank(lineId)) {
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
} }
@@ -282,6 +283,14 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
if (Objects.isNull(lineInfoDO)) { if (Objects.isNull(lineInfoDO)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST); throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
} }
String auditResult = redisUtilPool.getString(redisKey);
if (WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_70.getCode().equals(lineInfoDO.getWorkflowSubStageStatus())){
//鲜丰系统不稳定会出现调用成功但内部状态未更改的情况这时直接返回true即可
return true;
}
if (StringUtil.isNotBlank(auditResult) && !auditResult.equals(String.valueOf(request.getAuditResult()))) {
throw new ServiceException(ErrorCodeEnum.AUDIT_RESULT_FALSE);
}
if (request.getAuditResult() == 1) { if (request.getAuditResult() == 1) {
AuditPassRequest auditPassRequest = new AuditPassRequest(); AuditPassRequest auditPassRequest = new AuditPassRequest();
auditPassRequest.setLineId(lineInfoDO.getId()); auditPassRequest.setLineId(lineInfoDO.getId());
@@ -296,9 +305,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
auditRejectRequest.setRejectRealReason(request.getFailureCause()); auditRejectRequest.setRejectRealReason(request.getFailureCause());
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest, null); commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest, null);
} }
} catch (Exception e) { redisUtilPool.setString(redisKey, JSONObject.toJSONString(request.getAuditResult()));
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
}
return true; return true;
} }

View File

@@ -102,6 +102,7 @@ public class TrainingExperienceServiceImpl extends LineFlowService implements Tr
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode()); lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.SECOND_INTERVIEWS.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_100.getCode()); lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SECOND_INTERVIEWS_100.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO); lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
commonService.sendSms(lineInfoDO.getMobile(),SMSMsgEnum.SECOND_INTERVIEW_APPOINTMENT);
} else { } else {
lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.STORE_EXPERIENCE.getCode()); lineInfoDO.setWorkflowSubStage(WorkflowSubStageEnum.STORE_EXPERIENCE.getCode());
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_95.getCode()); lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.STORE_EXPERIENCE_95.getCode());

View File

@@ -107,6 +107,13 @@ public class XxlJobHandler {
List<Long> lineIds = leaseBaseInfoDOS.stream().map(LeaseBaseInfoDO::getLineId).collect(Collectors.toList()); List<Long> lineIds = leaseBaseInfoDOS.stream().map(LeaseBaseInfoDO::getLineId).collect(Collectors.toList());
WorkflowSubStageStatusEnum storeExperience90 = WorkflowSubStageStatusEnum.STORE_EXPERIENCE_90; WorkflowSubStageStatusEnum storeExperience90 = WorkflowSubStageStatusEnum.STORE_EXPERIENCE_90;
lineInfoMapper.toExperiencing(lineIds, storeExperience90.getCode()); lineInfoMapper.toExperiencing(lineIds, storeExperience90.getCode());
List<LineInfoDO> lineInfos = lineInfoMapper.getByLineIds(lineIds);
Map<Long, String> lineInfoMap = lineInfos.stream().collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getMobile));
leaseBaseInfoDOS.forEach(e -> {
commonService.sendSms(lineInfoMap.get(e.getLineId()), SMSMsgEnum.SHOP_EXPERIENCE);
});
log.info("------实训体验状态变更结束------"); log.info("------实训体验状态变更结束------");
XxlJobHelper.handleSuccess(); XxlJobHelper.handleSuccess();
} }