订单接口完善
This commit is contained in:
parent
b71ae01aed
commit
306da6f4d9
@ -94,4 +94,17 @@ public class OmsOrderController {
|
|||||||
}
|
}
|
||||||
return new CommonResult().failed();
|
return new CommonResult().failed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("备注订单")
|
||||||
|
@RequestMapping(value = "/update/note", method = RequestMethod.POST)
|
||||||
|
@ResponseBody
|
||||||
|
public Object updateNote(@RequestParam("id") Long id,
|
||||||
|
@RequestParam("note") String note,
|
||||||
|
@RequestParam("status") Integer status) {
|
||||||
|
int count = orderService.updateNote(id,note,status);
|
||||||
|
if (count > 0) {
|
||||||
|
return new CommonResult().success(count);
|
||||||
|
}
|
||||||
|
return new CommonResult().failed();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,5 @@ public class OmsMoneyInfoParam {
|
|||||||
private Long orderId;
|
private Long orderId;
|
||||||
private BigDecimal freightAmount;
|
private BigDecimal freightAmount;
|
||||||
private BigDecimal discountAmount;
|
private BigDecimal discountAmount;
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,5 @@ public class OmsReceiverInfoParam {
|
|||||||
private String receiverProvince;
|
private String receiverProvince;
|
||||||
private String receiverCity;
|
private String receiverCity;
|
||||||
private String receiverRegion;
|
private String receiverRegion;
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
@ -41,10 +41,18 @@ public interface OmsOrderService {
|
|||||||
/**
|
/**
|
||||||
* 修改订单收货人信息
|
* 修改订单收货人信息
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
int updateReceiverInfo(OmsReceiverInfoParam receiverInfoParam);
|
int updateReceiverInfo(OmsReceiverInfoParam receiverInfoParam);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改订单费用信息
|
* 修改订单费用信息
|
||||||
*/
|
*/
|
||||||
|
@Transactional
|
||||||
int updateMoneyInfo(OmsMoneyInfoParam moneyInfoParam);
|
int updateMoneyInfo(OmsMoneyInfoParam moneyInfoParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改订单备注
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
int updateNote(Long id, String note, Integer status);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import com.macro.mall.dao.OmsOrderDao;
|
|||||||
import com.macro.mall.dao.OmsOrderOperateHistoryDao;
|
import com.macro.mall.dao.OmsOrderOperateHistoryDao;
|
||||||
import com.macro.mall.dto.*;
|
import com.macro.mall.dto.*;
|
||||||
import com.macro.mall.mapper.OmsOrderMapper;
|
import com.macro.mall.mapper.OmsOrderMapper;
|
||||||
|
import com.macro.mall.mapper.OmsOrderOperateHistoryMapper;
|
||||||
import com.macro.mall.model.OmsOrder;
|
import com.macro.mall.model.OmsOrder;
|
||||||
import com.macro.mall.model.OmsOrderExample;
|
import com.macro.mall.model.OmsOrderExample;
|
||||||
import com.macro.mall.model.OmsOrderOperateHistory;
|
import com.macro.mall.model.OmsOrderOperateHistory;
|
||||||
@ -28,6 +29,8 @@ public class OmsOrderServiceImpl implements OmsOrderService {
|
|||||||
private OmsOrderDao orderDao;
|
private OmsOrderDao orderDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OmsOrderOperateHistoryDao orderOperateHistoryDao;
|
private OmsOrderOperateHistoryDao orderOperateHistoryDao;
|
||||||
|
@Autowired
|
||||||
|
private OmsOrderOperateHistoryMapper orderOperateHistoryMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum) {
|
public List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum) {
|
||||||
@ -100,7 +103,16 @@ public class OmsOrderServiceImpl implements OmsOrderService {
|
|||||||
order.setReceiverCity(receiverInfoParam.getReceiverCity());
|
order.setReceiverCity(receiverInfoParam.getReceiverCity());
|
||||||
order.setReceiverRegion(receiverInfoParam.getReceiverRegion());
|
order.setReceiverRegion(receiverInfoParam.getReceiverRegion());
|
||||||
order.setModifyTime(new Date());
|
order.setModifyTime(new Date());
|
||||||
return orderMapper.updateByPrimaryKeySelective(order);
|
int count = orderMapper.updateByPrimaryKeySelective(order);
|
||||||
|
//插入操作记录
|
||||||
|
OmsOrderOperateHistory history = new OmsOrderOperateHistory();
|
||||||
|
history.setOrderId(receiverInfoParam.getOrderId());
|
||||||
|
history.setCreateTime(new Date());
|
||||||
|
history.setOperateMan("后台管理员");
|
||||||
|
history.setOrderStatus(receiverInfoParam.getStatus());
|
||||||
|
history.setNote("修改收货人信息");
|
||||||
|
orderOperateHistoryMapper.insert(history);
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -110,6 +122,32 @@ public class OmsOrderServiceImpl implements OmsOrderService {
|
|||||||
order.setFreightAmount(moneyInfoParam.getFreightAmount());
|
order.setFreightAmount(moneyInfoParam.getFreightAmount());
|
||||||
order.setDiscountAmount(moneyInfoParam.getDiscountAmount());
|
order.setDiscountAmount(moneyInfoParam.getDiscountAmount());
|
||||||
order.setModifyTime(new Date());
|
order.setModifyTime(new Date());
|
||||||
return orderMapper.updateByPrimaryKeySelective(order);
|
int count = orderMapper.updateByPrimaryKeySelective(order);
|
||||||
|
//插入操作记录
|
||||||
|
OmsOrderOperateHistory history = new OmsOrderOperateHistory();
|
||||||
|
history.setOrderId(moneyInfoParam.getOrderId());
|
||||||
|
history.setCreateTime(new Date());
|
||||||
|
history.setOperateMan("后台管理员");
|
||||||
|
history.setOrderStatus(moneyInfoParam.getStatus());
|
||||||
|
history.setNote("修改费用信息");
|
||||||
|
orderOperateHistoryMapper.insert(history);
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updateNote(Long id, String note, Integer status) {
|
||||||
|
OmsOrder order = new OmsOrder();
|
||||||
|
order.setId(id);
|
||||||
|
order.setNote(note);
|
||||||
|
order.setModifyTime(new Date());
|
||||||
|
int count = orderMapper.updateByPrimaryKeySelective(order);
|
||||||
|
OmsOrderOperateHistory history = new OmsOrderOperateHistory();
|
||||||
|
history.setOrderId(id);
|
||||||
|
history.setCreateTime(new Date());
|
||||||
|
history.setOperateMan("后台管理员");
|
||||||
|
history.setOrderStatus(status);
|
||||||
|
history.setNote("修改备注信息:"+note);
|
||||||
|
orderOperateHistoryMapper.insert(history);
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user