|
@@ -268,6 +268,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
public R applyForAfterSales(long userId, FsStoreAfterSalesParam storeAfterSalesParam) {
|
|
|
logger.info("申请退款请求信息:"+JSONUtil.toJsonStr(storeAfterSalesParam));
|
|
|
FsStoreOrderScrm order=orderService.selectFsStoreOrderByOrderCode(storeAfterSalesParam.getOrderCode());
|
|
|
+ Integer orderStatus = order.getStatus();
|
|
|
if(!order.getUserId().equals(userId)){
|
|
|
throw new CustomException("非法操作");
|
|
|
}
|
|
@@ -311,18 +312,11 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
//拿到所有的商品
|
|
|
List<FsStoreOrderItemVO> orderItems=orderItemService.selectFsStoreOrderItemListByOrderId(order.getId());
|
|
|
for (FsStoreOrderItemVO item : orderItems) {
|
|
|
- StoreOrderProductDTO cartInfo = JSONObject.parseObject(item.getJsonInfo(), StoreOrderProductDTO.class);
|
|
|
FsStoreAfterSalesProductParam prosuctParam = storeAfterSalesParam.getProductList().stream().filter(p -> p.getProductId().equals(item.getProductId())).findFirst().orElse(new FsStoreAfterSalesProductParam());
|
|
|
if (prosuctParam.getProductId() != null) {
|
|
|
-// //商品优惠前总金额
|
|
|
-// BigDecimal totalAmountOfGoods = NumberUtil.mul(cartInfo.getPrice(), item.getNum());
|
|
|
-// //商品优惠总金额
|
|
|
-// BigDecimal commodityDiscountAmount = NumberUtil.mul(NumberUtil.div(totalAmountOfGoods, NumberUtil.sub(order.getTotalPrice(), order.getPayPostage())), order.getCouponPrice());
|
|
|
-// //商品优惠后总金额
|
|
|
-// totalPrice = NumberUtil.add(totalPrice, NumberUtil.sub(totalAmountOfGoods, commodityDiscountAmount));
|
|
|
+
|
|
|
item.setIsAfterSales(1);
|
|
|
FsStoreOrderItemScrm orderItem=new FsStoreOrderItemScrm();
|
|
|
-// BeanUtil.copyProperties(item, orderItem);
|
|
|
try {
|
|
|
BeanUtils.copyProperties(orderItem,item);
|
|
|
} catch (IllegalAccessException e) {
|
|
@@ -335,7 +329,6 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
}
|
|
|
}
|
|
|
//更新订单状态
|
|
|
- Integer orderStatus=order.getStatus();
|
|
|
order.setStatus(OrderInfoEnum.STATUS_NE1.getValue());
|
|
|
order.setRefundStatus(OrderInfoEnum.REFUND_STATUS_1.getValue());
|
|
|
order.setRefundReasonWap(storeAfterSalesParam.getReasons());
|
|
@@ -389,6 +382,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
|
|
|
request.setOid(order.getOrderCode());
|
|
|
request.setRefund_state(1);
|
|
|
request.setStoreAfterSalesId(storeAfterSales.getId());
|
|
|
+ request.setOrderStatus(orderStatus);
|
|
|
BaseResponse response=erpOrderService.refundUpdateScrm(request);
|
|
|
if(response.getSuccess()){
|
|
|
return R.ok();
|