Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
chenchao
6 years ago
Commit
1cad6bdb053a825b629ab481a261d7517c255c8d
1 parent
8359504e
definition api req and resp
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
10 deletions
order/src/main/java/com/yohoufo/order/controller/SellerOrderController.java
order/src/main/java/com/yohoufo/order/service/impl/SellerOrderService.java
order/src/main/java/com/yohoufo/order/controller/SellerOrderController.java
View file @
1cad6bd
package
com
.
yohoufo
.
order
.
controller
;
import
com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo
;
import
com.yohobuy.ufo.model.order.req.SellerOrderCancelReq
;
import
com.yohobuy.ufo.model.order.req.SellerOrderComputeReq
;
import
com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq
;
import
com.yohobuy.ufo.model.order.req.*
;
import
com.yohobuy.ufo.model.order.resp.BatchChangePriceResp
;
import
com.yohoufo.common.ApiResponse
;
import
com.yohoufo.common.annotation.IgnoreSession
;
import
com.yohoufo.common.annotation.IgnoreSignature
;
...
...
@@ -34,6 +33,9 @@ public class SellerOrderController {
@Autowired
private
SellerOrderService
sellerOrderService
;
@Autowired
private
SellerOrderComputeHandler
sellerOrderComputeHandler
;
/**
* 根据卖家提交价格来计算各项费用
* @param uid
...
...
@@ -46,7 +48,8 @@ public class SellerOrderController {
@ResponseBody
public
ApiResponse
computePublishPrd
(
@RequestParam
(
name
=
"uid"
,
required
=
true
)
int
uid
,
@RequestParam
(
name
=
"storage_id"
,
required
=
true
)
int
storage_id
,
@RequestParam
(
name
=
"price"
,
required
=
true
)
String
price
)
throws
GatewayException
{
@RequestParam
(
name
=
"price"
,
required
=
true
)
String
price
,
@RequestParam
(
name
=
"num"
,
defaultValue
=
"1"
,
required
=
false
)
int
num
)
throws
GatewayException
{
SellerOrderComputeReq
req
=
SellerOrderComputeReq
.
builder
().
uid
(
uid
).
storageId
(
storage_id
).
price
(
price
).
build
();
logger
.
info
(
"in ufo.sellerOrder.computePublishPrd, req {}"
,
req
);
SoldPrdComputeBo
computeBo
=
sellerOrderService
.
computePublishPrd
(
req
);
...
...
@@ -68,7 +71,8 @@ public class SellerOrderController {
public
ApiResponse
publishPrd
(
@RequestParam
(
name
=
"uid"
,
required
=
true
)
int
uid
,
@RequestParam
(
name
=
"storage_id"
,
required
=
true
)
int
storage_id
,
@RequestParam
(
name
=
"price"
,
required
=
true
)
String
price
,
@RequestParam
(
name
=
"address_id"
)
String
address_id
)
throws
GatewayException
{
@RequestParam
(
name
=
"address_id"
)
String
address_id
,
@RequestParam
(
name
=
"num"
,
defaultValue
=
"1"
,
required
=
false
)
int
num
)
throws
GatewayException
{
SellerOrderSubmitReq
req
=
SellerOrderSubmitReq
.
builder
()
.
uid
(
uid
)
.
storageId
(
storage_id
)
...
...
@@ -80,7 +84,32 @@ public class SellerOrderController {
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
resp
).
code
(
200
).
message
(
"发布成功"
).
build
();
}
/**
* 入驻商家的批量下架
* @param uid
* @param batchNo
* @param num
* @return
* @throws GatewayException
*/
@RequestMapping
(
params
=
"method=ufo.sellerOrder.batchCancel"
)
@ResponseBody
public
ApiResponse
batchCancel
(
@RequestParam
(
name
=
"uid"
,
required
=
true
)
int
uid
,
@RequestParam
(
name
=
"batchNo"
,
required
=
true
)
String
batchNo
,
@RequestParam
(
name
=
"num"
,
defaultValue
=
"1"
,
required
=
false
)
int
num
)
throws
GatewayException
{
SellerOrderBatchCancelReq
req
=
SellerOrderBatchCancelReq
.
builder
()
.
uid
(
uid
).
batchNo
(
batchNo
).
storageNum
(
num
)
.
build
();
logger
.
info
(
"in ufo.sellerOrder.batchCancel, req {}"
,
req
);
boolean
result
=
sellerOrderService
.
batchCancel
(
req
);
String
msg
=
"批量取消成功"
;
if
(!
result
){
msg
=
"批量取消失败"
;
}
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
result
).
code
(
200
).
message
(
msg
).
build
();
}
...
...
@@ -144,8 +173,7 @@ public class SellerOrderController {
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
result
).
code
(
200
).
message
(
msg
).
build
();
}
@Autowired
private
SellerOrderComputeHandler
sellerOrderComputeHandler
;
@RequestMapping
(
params
=
"method=ufo.skup.earnestMoneyRange"
)
@ResponseBody
...
...
@@ -154,4 +182,30 @@ public class SellerOrderController {
.
data
(
sellerOrderComputeHandler
.
getEarnestMoneyrange
())
.
message
(
"get EarnestMoneyrange success"
).
build
();
}
/**
* 批量调价
* @param uid
* @param batchNo
* @param price
* @return
* @throws GatewayException
*/
@RequestMapping
(
params
=
"method=ufo.sellerOrder.batchChangePrice"
)
@ResponseBody
public
ApiResponse
batchChangePrice
(
@RequestParam
(
name
=
"uid"
,
required
=
true
)
int
uid
,
@RequestParam
(
name
=
"price"
,
required
=
true
)
String
price
,
@RequestParam
(
name
=
"batchNo"
,
required
=
true
)
String
batchNo
,
@RequestParam
(
name
=
"num"
,
defaultValue
=
"1"
,
required
=
false
)
int
num
)
throws
GatewayException
{
BatchChangePriceReq
req
=
BatchChangePriceReq
.
builder
()
.
uid
(
uid
).
price
(
price
).
storageNum
(
num
)
.
batchNo
(
batchNo
)
.
build
();
logger
.
info
(
"in ufo.sellerOrder.batchChangePrice, req {}"
,
req
);
BatchChangePriceResp
result
=
sellerOrderService
.
batchChangePrice
(
req
);
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
result
).
code
(
200
).
message
(
result
.
getTips
()).
build
();
}
}
...
...
order/src/main/java/com/yohoufo/order/service/impl/SellerOrderService.java
View file @
1cad6bd
...
...
@@ -4,9 +4,8 @@ import com.yoho.error.ServiceError;
import
com.yoho.error.exception.ServiceException
;
import
com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo
;
import
com.yohobuy.ufo.model.order.common.*
;
import
com.yohobuy.ufo.model.order.req.SellerOrderCancelReq
;
import
com.yohobuy.ufo.model.order.req.SellerOrderComputeReq
;
import
com.yohobuy.ufo.model.order.req.SellerOrderSubmitReq
;
import
com.yohobuy.ufo.model.order.req.*
;
import
com.yohobuy.ufo.model.order.resp.BatchChangePriceResp
;
import
com.yohobuy.ufo.model.order.resp.OrderCntResp
;
import
com.yohobuy.ufo.model.order.resp.PageResp
;
import
com.yohoufo.common.alarm.EventBusPublisher
;
...
...
@@ -366,6 +365,11 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
return
true
;
}
public
boolean
batchCancel
(
SellerOrderBatchCancelReq
req
){
return
true
;
}
public
boolean
cancel
(
SellerOrderCancelReq
req
){
log
.
info
(
"seller self cancel order,req {}"
,
req
);
...
...
@@ -547,4 +551,12 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
.
actor
(
orderRequest
.
getTabType
()).
build
();
}
public
BatchChangePriceResp
batchChangePrice
(
BatchChangePriceReq
req
){
BatchChangePriceResp
resp
=
BatchChangePriceResp
.
builder
().
successCnt
(
1
).
failCnt
(
1
)
.
tips
(
"变价成功1个,失败1个"
).
build
();
return
resp
;
}
}
...
...
Please
register
or
login
to post a comment