Commit 17d84931 by 刘鑫

fix(容量): 查询不到对应技能组时对外接口直接抛异常, 内部返回不可约状态

1 parent 8b6c9fbb
package com.dituhui.pea.order.controller;
import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.enums.StatusCodeEnum;
import com.dituhui.pea.order.common.jackson.DateUtil;
......@@ -47,6 +48,7 @@ import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.stream.Collectors;
......@@ -124,8 +126,17 @@ public class PeaApiController {
List<CapacityQueryDTO.Service> convertService = services.stream()
.map(source -> {
TypeCodeCheckTableEntity brand = tableCodeCheckDao.findByTypeAndCode("BRAND", source.getBrand());
if (Objects.isNull(brand)) {
throw new BusinessException("查询不到:"+ source.getBrand() + "对应的品牌");
}
TypeCodeCheckTableEntity type = tableCodeCheckDao.findByTypeAndCode("TYPE", source.getProductType());
if (Objects.isNull(type)) {
throw new BusinessException("查询不到:"+ source.getProductType() + "对应的产品类型");
}
TypeCodeCheckTableEntity skill = tableCodeCheckDao.findByTypeAndCode("SKILL", source.getServiceType());
if (Objects.isNull(skill)) {
throw new BusinessException("查询不到:"+ source.getServiceType() + "对应的技能");
}
CapacityQueryDTO.Service service = new CapacityQueryDTO.Service();
service.setBrand(fixBrand(brand.getName()));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!