98 lines
3.4 KiB
Markdown
98 lines
3.4 KiB
Markdown
# 问题起因
|
||
|
||
BPM 工单号: 046-202303080005
|
||
|
||

|
||
|
||
poc-s.test.hihonor.com
|
||
|
||
poc.test.hihonor.com
|
||
|
||
poc-a.test.hihonor.com
|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||
# 问题描述
|
||
|
||
BPM 在验收反馈的时候报错:域名校验未通过
|
||
|
||
关注代码位置:
|
||
|
||
```java
|
||
if (!"true".equalsIgnoreCase(skipFlag) &&
|
||
!DomainValidationEnum.VALIDATIONSUCCESS.getCode().equals(testOrderInfo.getCheckDomain())) {
|
||
throw new PlatformException("域名校验未通过");
|
||
}
|
||
```
|
||
|
||
根据异常抛出位置应关注 skipFlag 的值,下方位置决定了他的值:
|
||
|
||
```java
|
||
boolean isLiveProduct = ProductsBBossEnum.LIVESTREAM.getCode().toString().equals(testOrderInfo.getTestType().get(0));
|
||
|
||
//直播域名在验收反馈前就已经配置好了,但是校验的标志位未置为配置成功。先调验证方法,如果配置成功则重置标志位
|
||
if(isLiveProduct){
|
||
verificationStatus(testOrderInfo.getOrderNum(), TestOrderResultEnum.OK.getCode().toString());
|
||
}
|
||
//验收反馈时,直播域名配置已经入库,预先校验时要校验域名配置
|
||
String skipFlag = isLiveProduct ? "false" : "true";
|
||
```
|
||
|
||
问题方法:com.cmcc.cdn.platform.selfservice.service.impl.TestOrderServiceImpl#verificationStatus
|
||
|
||
下方代码导致未将配置设置未配置已完成:
|
||
|
||
```java
|
||
//试用工单中的试用域名在企业账号下是否完全包含
|
||
if (!((testDomain2.size() == domainList.size()
|
||
&& testDomain2.containsAll(domainList)) || domainList.containsAll(testDomain2))) {
|
||
testDomain2.removeAll(domainList);
|
||
for (String domain : testDomain2) {
|
||
sb.append(domain).append("、");
|
||
}
|
||
resultResponse.put("success", false);
|
||
resultResponse.put("message", "域名配置未完成:" + sb.substring(0, sb.length() - 1));
|
||
log.info("----域名配置未完成:{}----", sb.substring(0, sb.length() - 1));
|
||
flag = false;
|
||
}
|
||
```
|
||
|
||
```java
|
||
if (flag) {
|
||
resultResponse.put("success", true);
|
||
resultResponse.put("message", "域名配置成功");
|
||
testOrderInfo.setCheckDomain(DomainValidationEnum.VALIDATIONSUCCESS.getCode());
|
||
} else {
|
||
testOrderInfo.setCheckDomain(DomainValidationEnum.VALIDATIONFAIL.getCode());
|
||
}
|
||
```
|
||
|
||
下方代码块儿为 domainList 的来源
|
||
|
||
```java
|
||
DataProcess<List<ProductDomainInfoVO>> dataProcess = productTrialService.getProductAndConfigedDomains(preOrderInfo.getEcId());
|
||
|
||
if (ls != null) {
|
||
ls = ls.stream().filter(d -> DomainTicketStateEnum.EFFICIENT.equals(d.getState())).collect(Collectors.toList());
|
||
for (EpProductChargeMode ep : op.get()) {
|
||
ProductDomainInfoVO vo = new ProductDomainInfoVO();
|
||
vo.setState(ep.getProductState());
|
||
vo.setProductId(ep.getProductId());
|
||
vo.setDomains(ls.stream().filter(d -> ep.getProductId().equals(d.getProduct().getId())).map(d->
|
||
new DomainVO(d.getDomain(), d.getProvinces().stream().map(p -> p.getCode()).collect(Collectors.toList()))
|
||
).collect(Collectors.toList()));
|
||
result.add(vo);
|
||
}
|
||
}
|
||
```
|
||
|
||
这时候定位到这 3 个域名已经进行了停用,域名状态时停用中。所以域名均被过滤。造成无法通过校验。(DomainTicketStateEnum)
|
||
|
||
# 备注
|
||
|
||
BPM 在进行验收反馈的时候会有一个域名状态校验步骤。
|