|
|
@@ -899,7 +899,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
auditReasonName.append(":").append(reason2.getReasonName());
|
|
|
}
|
|
|
storeAfterSales.setAuditReasonName(auditReasonName.toString());
|
|
|
-
|
|
|
+
|
|
|
fsStoreAfterSalesMapper.updateFsStoreAfterSales(storeAfterSales);
|
|
|
|
|
|
FsStoreOrderScrm order = orderService.selectFsStoreOrderByOrderCode(storeAfterSales.getOrderCode());
|
|
|
@@ -950,18 +950,28 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
// 活动订单:先回滚Redis规格库存(确保Redis和DB库存一致)
|
|
|
rollbackActivityStockIfNeeded(order, orderItemVOS);
|
|
|
|
|
|
- // 获取售后商品
|
|
|
- FsStoreAfterSalesItemScrm params = new FsStoreAfterSalesItemScrm();
|
|
|
- params.setStoreAfterSalesId(storeAfterSales.getId());
|
|
|
- List<FsStoreAfterSalesItemScrm> fsStoreAfterSalesItems = afterSalesItemService.selectFsStoreAfterSalesItemList(params);
|
|
|
|
|
|
- // 退DB库存
|
|
|
- for (FsStoreAfterSalesItemScrm item : fsStoreAfterSalesItems) {
|
|
|
- FsStoreOrderItemVO itemVO = orderItemVOS.stream().filter(i -> i.getProductId().equals(item.getProductId())).findFirst().orElse(null);
|
|
|
- if(Objects.nonNull(itemVO) && itemVO.getIsAfterSales() == 1 && Objects.nonNull(item.getNum())){
|
|
|
- productService.incProductStock(item.getNum().longValue(), item.getProductId(), null);
|
|
|
+
|
|
|
+ // 获取售后商品
|
|
|
+ FsStoreAfterSalesItemScrm params = new FsStoreAfterSalesItemScrm();
|
|
|
+ params.setStoreAfterSalesId(storeAfterSales.getId());
|
|
|
+ List<FsStoreAfterSalesItemScrm> fsStoreAfterSalesItems = afterSalesItemService.selectFsStoreAfterSalesItemList(params);
|
|
|
+
|
|
|
+ // 退DB库存
|
|
|
+ for (FsStoreAfterSalesItemScrm item : fsStoreAfterSalesItems) {
|
|
|
+ FsStoreOrderItemVO itemVO = orderItemVOS.stream().filter(i -> i.getProductId().equals(item.getProductId())).findFirst().orElse(null);
|
|
|
+ if(Objects.nonNull(itemVO) && itemVO.getIsAfterSales() == 1 && Objects.nonNull(item.getNum())){
|
|
|
+ // 1商城订单 2 直播订单
|
|
|
+ if (order.getOrderType()==1) {
|
|
|
+ productService.incProductStock(item.getNum().longValue(), item.getProductId(), null);
|
|
|
+ }else if(order.getOrderType()==2){
|
|
|
+ // 是个bug,直播订单合并到商城订单,购买的时候 +直播商品库存-直播商品销量,取消的时候又+商品管理库存-商品管理销量(反正销量和库存可以随便改,这里直播库存暂定不做修改了)
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
//将钱退还给用户
|
|
|
if(order.getPayMoney().compareTo(BigDecimal.ZERO)==1){
|