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

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

@@ -119,6 +119,7 @@ public class ApplyLicenseServiceImpl implements ApplyLicenseService {
requestMap.put("storeName", shopInfoDO.getShopName());
requestMap.put("partnerName,", lineInfoDO.getUsername());
requestMap.put("partnerMobile", lineInfoDO.getMobile());
log.info("submitLicense SMS requestMap:{}",JSONObject.toJSONString(requestMap));
commonService.sendMessage(Collections.singletonList(shopInfoDO.getSupervisorUserId()), MessageEnum.MESSAGE_17, requestMap);
}
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.LineAuditInfoDO;
import com.cool.store.entity.LineInfoDO;
import com.cool.store.enums.AuditResultTypeEnum;
import com.cool.store.enums.LineStatusEnum;
import com.cool.store.enums.WorkflowSubStageEnum;
import com.cool.store.enums.WorkflowSubStageStatusEnum;
import com.cool.store.enums.*;
import com.cool.store.mapper.LinePayMapper;
import com.cool.store.request.AuditRejectRequest;
import com.cool.store.request.BranchBankPageRequest;
@@ -48,6 +45,9 @@ public class BankServiceImpl extends LineFlowService implements BankService {
@Resource
private LineAuditInfoDAO lineAuditInfoDAO;
@Resource
CommonService commonService;
@Override
public List<BanktypeDO> listBank() {
List<BanktypeDO> bankList = bankDAO.listBank();
@@ -71,6 +71,7 @@ public class BankServiceImpl extends LineFlowService implements BankService {
WorkflowSubStageEnum nextStage = workflowSubStageEnum.getNextStage();
//更新线索阶段
lineInfoDAO.updateWorkflowStage(lineInfo.getId(), nextStage, nextStage.getInitStatus(), userId);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PAYMENT_SUCCESS);
return Boolean.TRUE;
}

View File

@@ -84,9 +84,9 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
lineInfoDO.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_63.getCode());
lineInfoMapper.updateByPrimaryKeySelective(lineInfoDO);
Map<String, String> requestMap = new HashMap<>();
requestMap.put("partnerUsername",lineInfoDO.getUsername());
requestMap.put("partnerMobile",lineInfoDO.getMobile());
requestMap.put("lineId",String.valueOf(lineInfoDO.getId()));
requestMap.put("partnerUsername", lineInfoDO.getUsername());
requestMap.put("partnerMobile", lineInfoDO.getMobile());
requestMap.put("lineId", String.valueOf(lineInfoDO.getId()));
requestMap.put("submitTime", DateUtils.dateTimeNow(DateUtils.SPECIAL_DATE_START));
commonService.sendMessage(Collections.singletonList(lineInfoDO.getInvestmentManager()),
MessageEnum.MESSAGE_30,
@@ -160,6 +160,7 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
lineInfo.setWorkflowSubStageStatus(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_65.getCode());
lineInfo.setUpdateUserId(userId);
lineInfoDAO.updateLineInfo(lineInfo);
commonService.sendSms(lineInfo.getMobile(), SMSMsgEnum.INTENTION_PROTOCOL_FAIL);
}
//待OA审核code 75 处理逻辑
if (lineInfo.getWorkflowSubStageStatus().equals(WorkflowSubStageStatusEnum.SIGN_INTENT_AGREEMENT_75.getCode())) {
@@ -168,8 +169,8 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
lineInfoDAO.updateLineInfo(lineInfo);
//message
Map<String, String> requestMap = new HashMap<>();
requestMap.put("partnerUsername",lineInfo.getUsername());
requestMap.put("lineId",String.valueOf(lineInfo.getId()));
requestMap.put("partnerUsername", lineInfo.getUsername());
requestMap.put("lineId", String.valueOf(lineInfo.getId()));
requestMap.put("submitTime", DateUtils.dateTimeNow(DateUtils.SPECIAL_DATE_START));
commonService.sendMessage(Collections.singletonList(lineInfo.getInvestmentManager()),
MessageEnum.MESSAGE_31,
@@ -272,33 +273,39 @@ public class IntentAgreementServiceImpl extends LineFlowService implements Inten
@Override
public Boolean auditResult(AuditResultRequest request) {
try {
String kdzBusinessId = request.getKdzBusinessId();
String lineId = getLineId(kdzBusinessId);
if (StringUtil.isBlank(lineId)) {
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
}
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
if (Objects.isNull(lineInfoDO)) {
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
}
if (request.getAuditResult() == 1) {
AuditPassRequest auditPassRequest = new AuditPassRequest();
auditPassRequest.setLineId(lineInfoDO.getId());
auditPassRequest.setPassReason(request.getCause());
auditPassRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
commonService.getLineFlowService(auditPassRequest.getWorkflowSubStage()).auditPass(auditPassRequest, null);
} else if (request.getAuditResult() == 0) {
AuditRejectRequest auditRejectRequest = new AuditRejectRequest();
auditRejectRequest.setLineId(lineInfoDO.getId());
auditRejectRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
auditRejectRequest.setRejectPublicReason(request.getCause());
auditRejectRequest.setRejectRealReason(request.getFailureCause());
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest, null);
}
} catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.UNKNOWN);
String kdzBusinessId = request.getKdzBusinessId();
String lineId = getLineId(kdzBusinessId);
String redisKey = "kdzBusinessId:" + kdzBusinessId;
if (StringUtil.isBlank(lineId)) {
throw new ServiceException(ErrorCodeEnum.BUSINESS_ID_NOT_EXIST);
}
LineInfoDO lineInfoDO = lineInfoMapper.getByLineId(Long.valueOf(lineId));
if (Objects.isNull(lineInfoDO)) {
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) {
AuditPassRequest auditPassRequest = new AuditPassRequest();
auditPassRequest.setLineId(lineInfoDO.getId());
auditPassRequest.setPassReason(request.getCause());
auditPassRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
commonService.getLineFlowService(auditPassRequest.getWorkflowSubStage()).auditPass(auditPassRequest, null);
} else if (request.getAuditResult() == 0) {
AuditRejectRequest auditRejectRequest = new AuditRejectRequest();
auditRejectRequest.setLineId(lineInfoDO.getId());
auditRejectRequest.setWorkflowSubStage(lineInfoDO.getWorkflowSubStage());
auditRejectRequest.setRejectPublicReason(request.getCause());
auditRejectRequest.setRejectRealReason(request.getFailureCause());
commonService.getLineFlowService(auditRejectRequest.getWorkflowSubStage()).auditReject(auditRejectRequest, null);
}
redisUtilPool.setString(redisKey, JSONObject.toJSONString(request.getAuditResult()));
return true;
}

View File

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