订单接口完善

This commit is contained in:
zhh 2018-10-30 16:40:11 +08:00
parent b71ae01aed
commit 306da6f4d9
5 changed files with 63 additions and 2 deletions

View File

@ -94,4 +94,17 @@ public class OmsOrderController {
}
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();
}
}

View File

@ -15,4 +15,5 @@ public class OmsMoneyInfoParam {
private Long orderId;
private BigDecimal freightAmount;
private BigDecimal discountAmount;
private Integer status;
}

View File

@ -18,4 +18,5 @@ public class OmsReceiverInfoParam {
private String receiverProvince;
private String receiverCity;
private String receiverRegion;
private Integer status;
}

View File

@ -41,10 +41,18 @@ public interface OmsOrderService {
/**
* 修改订单收货人信息
*/
@Transactional
int updateReceiverInfo(OmsReceiverInfoParam receiverInfoParam);
/**
* 修改订单费用信息
*/
@Transactional
int updateMoneyInfo(OmsMoneyInfoParam moneyInfoParam);
/**
* 修改订单备注
*/
@Transactional
int updateNote(Long id, String note, Integer status);
}

View File

@ -5,6 +5,7 @@ import com.macro.mall.dao.OmsOrderDao;
import com.macro.mall.dao.OmsOrderOperateHistoryDao;
import com.macro.mall.dto.*;
import com.macro.mall.mapper.OmsOrderMapper;
import com.macro.mall.mapper.OmsOrderOperateHistoryMapper;
import com.macro.mall.model.OmsOrder;
import com.macro.mall.model.OmsOrderExample;
import com.macro.mall.model.OmsOrderOperateHistory;
@ -28,6 +29,8 @@ public class OmsOrderServiceImpl implements OmsOrderService {
private OmsOrderDao orderDao;
@Autowired
private OmsOrderOperateHistoryDao orderOperateHistoryDao;
@Autowired
private OmsOrderOperateHistoryMapper orderOperateHistoryMapper;
@Override
public List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum) {
@ -100,7 +103,16 @@ public class OmsOrderServiceImpl implements OmsOrderService {
order.setReceiverCity(receiverInfoParam.getReceiverCity());
order.setReceiverRegion(receiverInfoParam.getReceiverRegion());
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
@ -110,6 +122,32 @@ public class OmsOrderServiceImpl implements OmsOrderService {
order.setFreightAmount(moneyInfoParam.getFreightAmount());
order.setDiscountAmount(moneyInfoParam.getDiscountAmount());
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;
}
}