|
@@ -1823,8 +1823,15 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
if (order.getStatus() < 0) {
|
|
if (order.getStatus() < 0) {
|
|
|
throw new CustomException("订单不可提交售后");
|
|
throw new CustomException("订单不可提交售后");
|
|
|
}
|
|
}
|
|
|
|
|
+ Long orderId = order.getOrderId();
|
|
|
|
|
+ //查询是否已经存在未处理的售后
|
|
|
|
|
+ List<FsStoreAfterSales> unFinishList = fsStoreAfterSalesService.selectFsStoreAfterSalesByOrderIdUnFinish(orderId);
|
|
|
|
|
+ if (unFinishList != null && !unFinishList.isEmpty()) {
|
|
|
|
|
+ throw new CustomException("已有未处理售后订单,订单不可提交售后");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
FsStoreAfterSales fsStoreAfterSales = new FsStoreAfterSales();
|
|
FsStoreAfterSales fsStoreAfterSales = new FsStoreAfterSales();
|
|
|
- fsStoreAfterSales.setOrderId(order.getOrderId());
|
|
|
|
|
|
|
+ fsStoreAfterSales.setOrderId(orderId);
|
|
|
fsStoreAfterSales.setStoreId(order.getStoreId());
|
|
fsStoreAfterSales.setStoreId(order.getStoreId());
|
|
|
fsStoreAfterSales.setRefundAmount(order.getPayMoney());
|
|
fsStoreAfterSales.setRefundAmount(order.getPayMoney());
|
|
|
fsStoreAfterSales.setCreateTime(DateUtils.getNowDate());
|
|
fsStoreAfterSales.setCreateTime(DateUtils.getNowDate());
|
|
@@ -1847,7 +1854,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
fsStoreAfterSales.setCompanyUserId(order.getCompanyUserId());
|
|
fsStoreAfterSales.setCompanyUserId(order.getCompanyUserId());
|
|
|
fsStoreAfterSales.setIsDel(0);
|
|
fsStoreAfterSales.setIsDel(0);
|
|
|
fsStoreAfterSalesService.insertFsStoreAfterSales(fsStoreAfterSales);
|
|
fsStoreAfterSalesService.insertFsStoreAfterSales(fsStoreAfterSales);
|
|
|
- List<FsStoreOrderItem> fsStoreOrderItems = fsStoreOrderItemMapper.selectFsStoreOrderItemListByOrderId(order.getOrderId());
|
|
|
|
|
|
|
+ List<FsStoreOrderItem> fsStoreOrderItems = fsStoreOrderItemMapper.selectFsStoreOrderItemListByOrderId(orderId);
|
|
|
for (FsStoreOrderItem fsStoreOrderItem : fsStoreOrderItems) {
|
|
for (FsStoreOrderItem fsStoreOrderItem : fsStoreOrderItems) {
|
|
|
FsStoreAfterSalesItem item = new FsStoreAfterSalesItem();
|
|
FsStoreAfterSalesItem item = new FsStoreAfterSalesItem();
|
|
|
item.setAfterSalesId(fsStoreAfterSales.getId());
|
|
item.setAfterSalesId(fsStoreAfterSales.getId());
|
|
@@ -1865,7 +1872,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
logs.setChangeMessage("平台提交售后");
|
|
logs.setChangeMessage("平台提交售后");
|
|
|
fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
|
|
fsStoreAfterSalesLogsMapper.insertFsStoreAfterSalesLogs(logs);
|
|
|
//添加订单日志
|
|
//添加订单日志
|
|
|
- fsStoreOrderLogsService.create(order.getOrderId(), FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getValue(),
|
|
|
|
|
|
|
+ fsStoreOrderLogsService.create(orderId, FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getValue(),
|
|
|
fsStoreOrderSalesParam.getOperator() + " " +FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getDesc());
|
|
fsStoreOrderSalesParam.getOperator() + " " +FsStoreOrderLogEnum.REFUND_ORDER_PLATFORM.getDesc());
|
|
|
//判断是否开启erp
|
|
//判断是否开启erp
|
|
|
FsSysConfig sysConfig = configUtil.getSysConfig();
|
|
FsSysConfig sysConfig = configUtil.getSysConfig();
|
|
@@ -4090,6 +4097,11 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
|
|
|
if (order.getStatus() < 0) {
|
|
if (order.getStatus() < 0) {
|
|
|
throw new CustomException("订单不可提交售后");
|
|
throw new CustomException("订单不可提交售后");
|
|
|
}
|
|
}
|
|
|
|
|
+ //查询是否已经存在未处理的售后
|
|
|
|
|
+ List<FsStoreAfterSales> unFinishList = fsStoreAfterSalesService.selectFsStoreAfterSalesByOrderIdUnFinish(order.getOrderId());
|
|
|
|
|
+ if (unFinishList != null && !unFinishList.isEmpty()) {
|
|
|
|
|
+ throw new CustomException("已有未处理售后订单,订单不可提交售后");
|
|
|
|
|
+ }
|
|
|
//判断总退款金额是否小于等于实付金额
|
|
//判断总退款金额是否小于等于实付金额
|
|
|
BigDecimal refundAmount = param.getRefundAmount();
|
|
BigDecimal refundAmount = param.getRefundAmount();
|
|
|
if (refundAmount.compareTo(order.getPayMoney())>0){
|
|
if (refundAmount.compareTo(order.getPayMoney())>0){
|