Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
b71ae01a
Commit
b71ae01a
authored
Oct 29, 2018
by
zhh
Browse files
订单修改接口添加
parent
e90c511f
Changes
5
Hide whitespace changes
Inline
Side-by-side
mall-admin/src/main/java/com/macro/mall/controller/OmsOrderController.java
View file @
b71ae01a
package
com.macro.mall.controller
;
import
com.macro.mall.dto.CommonResult
;
import
com.macro.mall.dto.OmsOrderDeliveryParam
;
import
com.macro.mall.dto.OmsOrderDetail
;
import
com.macro.mall.dto.OmsOrderQueryParam
;
import
com.macro.mall.dto.*
;
import
com.macro.mall.model.OmsOrder
;
import
com.macro.mall.service.OmsOrderService
;
import
io.swagger.annotations.Api
;
...
...
@@ -75,4 +72,26 @@ public class OmsOrderController {
OmsOrderDetail
orderDetailResult
=
orderService
.
detail
(
id
);
return
new
CommonResult
().
success
(
orderDetailResult
);
}
@ApiOperation
(
"修改收货人信息"
)
@RequestMapping
(
value
=
"/update/receiverInfo"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateReceiverInfo
(
@RequestBody
OmsReceiverInfoParam
receiverInfoParam
)
{
int
count
=
orderService
.
updateReceiverInfo
(
receiverInfoParam
);
if
(
count
>
0
)
{
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
@ApiOperation
(
"修改订单费用信息"
)
@RequestMapping
(
value
=
"/update/moneyInfo"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Object
updateReceiverInfo
(
@RequestBody
OmsMoneyInfoParam
moneyInfoParam
)
{
int
count
=
orderService
.
updateMoneyInfo
(
moneyInfoParam
);
if
(
count
>
0
)
{
return
new
CommonResult
().
success
(
count
);
}
return
new
CommonResult
().
failed
();
}
}
mall-admin/src/main/java/com/macro/mall/dto/OmsMoneyInfoParam.java
0 → 100644
View file @
b71ae01a
package
com.macro.mall.dto
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.math.BigDecimal
;
/**
* 修改订单费用信息参数
* Created by macro on 2018/10/29.
*/
@Getter
@Setter
public
class
OmsMoneyInfoParam
{
private
Long
orderId
;
private
BigDecimal
freightAmount
;
private
BigDecimal
discountAmount
;
}
mall-admin/src/main/java/com/macro/mall/dto/OmsReceiverInfoParam.java
0 → 100644
View file @
b71ae01a
package
com.macro.mall.dto
;
import
lombok.Getter
;
import
lombok.Setter
;
/**
* 订单修改收货人信息参数
* Created by macro on 2018/10/29.
*/
@Getter
@Setter
public
class
OmsReceiverInfoParam
{
private
Long
orderId
;
private
String
receiverName
;
private
String
receiverPhone
;
private
String
receiverPostCode
;
private
String
receiverDetailAddress
;
private
String
receiverProvince
;
private
String
receiverCity
;
private
String
receiverRegion
;
}
mall-admin/src/main/java/com/macro/mall/service/OmsOrderService.java
View file @
b71ae01a
package
com.macro.mall.service
;
import
com.macro.mall.dto.OmsOrderDeliveryParam
;
import
com.macro.mall.dto.OmsOrderDetail
;
import
com.macro.mall.dto.OmsOrderQueryParam
;
import
com.macro.mall.dto.*
;
import
com.macro.mall.model.OmsOrder
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -39,4 +37,14 @@ public interface OmsOrderService {
* 获取指定订单详情
*/
OmsOrderDetail
detail
(
Long
id
);
/**
* 修改订单收货人信息
*/
int
updateReceiverInfo
(
OmsReceiverInfoParam
receiverInfoParam
);
/**
* 修改订单费用信息
*/
int
updateMoneyInfo
(
OmsMoneyInfoParam
moneyInfoParam
);
}
mall-admin/src/main/java/com/macro/mall/service/impl/OmsOrderServiceImpl.java
View file @
b71ae01a
...
...
@@ -3,9 +3,7 @@ package com.macro.mall.service.impl;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.dao.OmsOrderDao
;
import
com.macro.mall.dao.OmsOrderOperateHistoryDao
;
import
com.macro.mall.dto.OmsOrderDeliveryParam
;
import
com.macro.mall.dto.OmsOrderDetail
;
import
com.macro.mall.dto.OmsOrderQueryParam
;
import
com.macro.mall.dto.*
;
import
com.macro.mall.mapper.OmsOrderMapper
;
import
com.macro.mall.model.OmsOrder
;
import
com.macro.mall.model.OmsOrderExample
;
...
...
@@ -89,4 +87,29 @@ public class OmsOrderServiceImpl implements OmsOrderService {
public
OmsOrderDetail
detail
(
Long
id
)
{
return
orderDao
.
getDetail
(
id
);
}
@Override
public
int
updateReceiverInfo
(
OmsReceiverInfoParam
receiverInfoParam
)
{
OmsOrder
order
=
new
OmsOrder
();
order
.
setId
(
receiverInfoParam
.
getOrderId
());
order
.
setReceiverName
(
receiverInfoParam
.
getReceiverName
());
order
.
setReceiverPhone
(
receiverInfoParam
.
getReceiverPhone
());
order
.
setReceiverPostCode
(
receiverInfoParam
.
getReceiverPostCode
());
order
.
setReceiverDetailAddress
(
receiverInfoParam
.
getReceiverDetailAddress
());
order
.
setReceiverProvince
(
receiverInfoParam
.
getReceiverProvince
());
order
.
setReceiverCity
(
receiverInfoParam
.
getReceiverCity
());
order
.
setReceiverRegion
(
receiverInfoParam
.
getReceiverRegion
());
order
.
setModifyTime
(
new
Date
());
return
orderMapper
.
updateByPrimaryKeySelective
(
order
);
}
@Override
public
int
updateMoneyInfo
(
OmsMoneyInfoParam
moneyInfoParam
)
{
OmsOrder
order
=
new
OmsOrder
();
order
.
setId
(
moneyInfoParam
.
getOrderId
());
order
.
setFreightAmount
(
moneyInfoParam
.
getFreightAmount
());
order
.
setDiscountAmount
(
moneyInfoParam
.
getDiscountAmount
());
order
.
setModifyTime
(
new
Date
());
return
orderMapper
.
updateByPrimaryKeySelective
(
order
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
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 comment