Commit ef459b6a by ice

修改销售订单退货成功时状态为退货退款

parent 1e448084
...@@ -61,8 +61,12 @@ public class WshShipmentController { ...@@ -61,8 +61,12 @@ public class WshShipmentController {
public Result createShip(@RequestBody WshShipmentHeaderPage wshShipmentHeaderPage, public Result createShip(@RequestBody WshShipmentHeaderPage wshShipmentHeaderPage,
@RequestParam(value = "status",required = true)String status, @RequestParam(value = "status",required = true)String status,
@RequestParam(value = "token",required = true)String token){ @RequestParam(value = "token",required = true)String token){
SalOrderHeader salOrderHeader = salOrderHeaderService.findSalOrderById(wshShipmentHeaderPage.getSourceHeaderId());
if(salOrderHeader == null){
return new Result(false,StatusCode.ERROR,"该销售订单不存在,请刷新!");
}
//判断销售订单是否是已审批状态 //判断销售订单是否是已审批状态
if (!"approval".equals(status)) { if (!"approval".equals(status) || !"approval".equals(salOrderHeader.getHeaderStatus())) {
throw ErrorEnum.NotAllowStatusERROR.createException(wshShipmentHeaderPage.getSourceHeaderNumber());//返回状态不对 throw ErrorEnum.NotAllowStatusERROR.createException(wshShipmentHeaderPage.getSourceHeaderNumber());//返回状态不对
} }
//检查accesstoken的有效性 //检查accesstoken的有效性
...@@ -120,8 +124,12 @@ public class WshShipmentController { ...@@ -120,8 +124,12 @@ public class WshShipmentController {
public Result createReceive(@RequestBody RcvReceiptHeaderPage rcvReceiptHeaderPage, public Result createReceive(@RequestBody RcvReceiptHeaderPage rcvReceiptHeaderPage,
@RequestParam(value = "status",required = true)String status, @RequestParam(value = "status",required = true)String status,
@RequestParam(value = "token",required = true)String token){ @RequestParam(value = "token",required = true)String token){
//判断销售订单是否是已审批状态 SalOrderHeader salOrderHeader = salOrderHeaderService.findSalOrderById(rcvReceiptHeaderPage.getSourceHeaderId());
if (!"approval".equals(status)) { if(salOrderHeader == null){
return new Result(false,StatusCode.ERROR,"该销售订单不存在,请刷新!");
}
//判断销售订单是否是已完成状态
if (!"completed".equals(status) || !"completed".equals(salOrderHeader.getHeaderStatus())) {
throw ErrorEnum.NotAllowStatusERROR.createException(rcvReceiptHeaderPage.getSourceHeaderNumber());//返回状态不对 throw ErrorEnum.NotAllowStatusERROR.createException(rcvReceiptHeaderPage.getSourceHeaderNumber());//返回状态不对
} }
//检查accesstoken的有效性 //检查accesstoken的有效性
...@@ -155,9 +163,9 @@ public class WshShipmentController { ...@@ -155,9 +163,9 @@ public class WshShipmentController {
BeanUtils.copyProperties(rcvReceiptHeaderPage,rcvReceiptHeader); BeanUtils.copyProperties(rcvReceiptHeaderPage,rcvReceiptHeader);
//增加 //增加
rcvReceiptHeaderService.saveMain(rcvReceiptHeader,rcvReceiptHeaderPage.getRcvReceiptLineList()); rcvReceiptHeaderService.saveMain(rcvReceiptHeader,rcvReceiptHeaderPage.getRcvReceiptLineList());
//修改销售订单的状态为已完成completed //修改销售订单的状态为已退货退款
salOrderLineService.updateSalOrderLineStatus(updateBy,updateTime,"completed",rcvReceiptHeader.getSourceHeaderId()); salOrderLineService.updateSalOrderLineStatus(updateBy,updateTime,"refund",rcvReceiptHeader.getSourceHeaderId());
boolean headerTrue = salOrderHeaderService.updateOrderHeaderStatus(updateBy,updateTime,"completed",rcvReceiptHeader.getSourceHeaderId()); boolean headerTrue = salOrderHeaderService.updateOrderHeaderStatus(updateBy,updateTime,"refund",rcvReceiptHeader.getSourceHeaderId());
if(!headerTrue){ if(!headerTrue){
throw ErrorEnum.Error.createException("销售订单的状态修改失败"); throw ErrorEnum.Error.createException("销售订单的状态修改失败");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment