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 fd6a4e09
authored
Jun 16, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登记OrderChange
1 parent
d2ae3820
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/entity/OrderChangeEntity.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/CommonService.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrderCreateServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/entity/OrderChangeEntity.java
View file @
fd6a4e0
package
com
.
alibaba
.
cloud
.
integration
.
order
.
entity
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.persistence.*
;
import
java.util.Date
;
...
...
@@ -8,6 +9,7 @@ import java.util.Date;
@Entity
@Data
@Accessors
(
chain
=
true
)
@Table
(
name
=
"order_change"
)
public
class
OrderChangeEntity
{
/**
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/CommonService.java
View file @
fd6a4e0
...
...
@@ -2,6 +2,8 @@ package com.alibaba.cloud.integration.order.service;
import
com.alibaba.cloud.integration.order.dao.CapacityTeamStatDao
;
import
com.alibaba.cloud.integration.order.dao.MapBlockInfoDao
;
import
com.alibaba.cloud.integration.order.dao.OrderChangeDao
;
import
com.alibaba.cloud.integration.order.entity.OrderChangeEntity
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
lombok.experimental.Accessors
;
...
...
@@ -15,6 +17,7 @@ import org.springframework.util.MultiValueMap;
import
org.springframework.web.client.RestTemplate
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Random
;
...
...
@@ -28,6 +31,9 @@ public class CommonService {
@Autowired
private
CapacityTeamStatDao
capacityTeamStatDao
;
@Autowired
private
OrderChangeDao
orderChangeDao
;
public
String
getTeamIdByInput
(
String
location
,
String
address
,
String
layer
)
{
// todo 目前会随机兜底,后面将合理化
String
teamId
=
null
;
...
...
@@ -118,4 +124,11 @@ public class CommonService {
private
String
areaId
;
private
String
areaName
;
}
public
void
addOrderChange
(
String
orderId
,
String
subOrderId
,
String
source
,
String
operator
,
String
content
,
String
memo
){
OrderChangeEntity
entity
=
new
OrderChangeEntity
();
entity
.
setOrderId
(
orderId
).
setSuborderId
(
subOrderId
).
setSource
(
source
).
setOperator
(
operator
).
setContent
(
content
).
setMemo
(
memo
);
entity
.
setCreateTime
(
new
Date
()).
setUpdateTime
(
new
Date
());
orderChangeDao
.
save
(
entity
);
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrderCreateServiceImpl.java
View file @
fd6a4e0
...
...
@@ -135,6 +135,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
String
catalogId
=
categoryEntity
.
getProductCategoryId
();
entity
.
setCategoryId
(
catalogId
);
orderRequestDao
.
save
(
entity
);
// 登记
commonService
.
addOrderChange
(
orderId
,
""
,
req
.
getSource
(),
"API"
,
"创建订单"
,
""
);
return
Result
.
success
(
null
);
}
}
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