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 ee5e8749
authored
Nov 13, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(创建预约工单): 创建预约工单技能相关信息换成code
1 parent
d3cf3310
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 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 @
ee5e874
...
...
@@ -64,6 +64,7 @@ public class PeaApiController {
private
static
final
String
stage
=
"{\"orderId\": \"X10001\", \"engineerCode\": \"E12005\", \"engineerName\": \"祝枝山\", \"engineerCodeAssist\": \"E12446\", \"engineerNameAssist\": \"李晓阳\", \"planVisitTime\": \"2023-07-27 12:00:00\", \"realtimeInfo\": {\"engineerLocation\": {\"latitude\": 31.349701, \"longitude\": 120.675945, \"address\": \"江苏省苏州市苏州工业园区和顺路\", \"name\": \"和顺大酒店\"}, \"estimate\": {\"distance\": 2300, \"arriveTime\": \"2023-07-27 12:12:00\"}}}"
;
/**
* 3.1GET 查询技术员日历
*
...
...
@@ -185,6 +186,21 @@ public class PeaApiController {
*/
@PostMapping
(
"/order/create"
)
public
Result
<?>
orderCreate
(
@Validated
@RequestBody
OrderDTO
.
OrderCreateRequest
request
)
{
TypeCodeCheckTableEntity
brand
=
tableCodeCheckDao
.
findByTypeAndCode
(
"BRAND"
,
request
.
getBrand
());
if
(
Objects
.
isNull
(
brand
))
{
throw
new
BusinessException
(
"查询不到:"
+
request
.
getBrand
()
+
"对应的品牌"
);
}
TypeCodeCheckTableEntity
type
=
tableCodeCheckDao
.
findByTypeAndCode
(
"TYPE"
,
request
.
getProductType
());
if
(
Objects
.
isNull
(
type
))
{
throw
new
BusinessException
(
"查询不到:"
+
request
.
getProductType
()
+
"对应的产品类型"
);
}
TypeCodeCheckTableEntity
skill
=
tableCodeCheckDao
.
findByTypeAndCode
(
"SKILL"
,
request
.
getServiceType
());
if
(
Objects
.
isNull
(
skill
))
{
throw
new
BusinessException
(
"查询不到:"
+
request
.
getServiceType
()
+
"对应的技能"
);
}
request
.
setBrand
(
brand
.
getName
());
request
.
setProductType
(
type
.
getName
());
request
.
setServiceType
(
skill
.
getName
());
return
orderCreateService
.
createOrder
(
request
);
}
...
...
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