Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 17d84931
authored
Nov 02, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(容量): 查询不到对应技能组时对外接口直接抛异常, 内部返回不可约状态
1 parent
8b6c9fbb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
project-order/src/main/java/com/dituhui/pea/order/controller/PeaApiController.java
View file @
17d8493
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
()));
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment