订单修改接口添加
This commit is contained in:
parent
e90c511f66
commit
b71ae01aed
@ -1,9 +1,6 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
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;
|
||||
}
|
@ -1,8 +1,6 @@
|
||||
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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user