Browse Source

erp售后流程

xdd 4 tuần trước cách đây
mục cha
commit
d84341e905

+ 1 - 0
fs-service/src/main/java/com/fs/erp/dto/ErpRefundUpdateRequest.java

@@ -10,5 +10,6 @@ public class ErpRefundUpdateRequest implements Serializable {
     String oid;//子订单号
     Integer refund_state;//0:未退款 1:退款完成 2:退款中
     Long storeAfterSalesId;//售后id
+    Integer orderStatus;//售后id
 
 }

+ 1 - 1
fs-service/src/main/java/com/fs/erp/service/impl/JSTErpOrderServiceImpl.java

@@ -475,7 +475,7 @@ public class JSTErpOrderServiceImpl implements IErpOrderService {
         log.info("订单号: {},发货状态: {},是否发货后: {}",fsStoreOrder.getOrderCode(),fsStoreOrder.getStatus(),ObjectUtils.equals(fsStoreOrder.getStatus(),2));
 
         // 发货后退款
-        if(ObjectUtils.equals(fsStoreOrder.getStatus(),2)){
+        if(ObjectUtils.equals(param.getOrderStatus(),2)){
 
             FsJstAftersalePush fsJstAftersalePush = new FsJstAftersalePush();
             fsJstAftersalePush.setOrderId(fsStoreOrder.getOrderCode());

+ 3 - 9
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java

@@ -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();