|
|
@@ -18,7 +18,6 @@ import cn.hutool.core.util.IdUtil;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
-import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
@@ -31,7 +30,6 @@ import com.fs.common.event.TemplateEvent;
|
|
|
import com.fs.common.event.TemplateListenEnum;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.*;
|
|
|
-import com.fs.common.utils.ip.IpUtils;
|
|
|
import com.fs.company.domain.Company;
|
|
|
import com.fs.company.domain.CompanyDept;
|
|
|
import com.fs.company.domain.CompanyMoneyLogs;
|
|
|
@@ -46,9 +44,6 @@ import com.fs.erp.dto.*;
|
|
|
import com.fs.erp.service.IErpOrderService;
|
|
|
import com.fs.erp.utils.ErpContextHolder;
|
|
|
import com.fs.express.FsStoreDeliversService;
|
|
|
-import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
-import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
-import com.fs.huifuPay.service.HuiFuService;
|
|
|
import com.fs.live.domain.*;
|
|
|
import com.fs.live.dto.LiveOrderItemDTO;
|
|
|
import com.fs.live.mapper.*;
|
|
|
@@ -60,9 +55,7 @@ import com.fs.live.vo.LiveGoodsVo;
|
|
|
import com.fs.live.vo.LiveOrderItemVo;
|
|
|
import com.fs.live.vo.LiveOrderListVo;
|
|
|
import com.fs.live.vo.LiveOrderVo;
|
|
|
-import com.fs.pay.service.IPayService;
|
|
|
import com.fs.store.cache.IFsExpressCacheService;
|
|
|
-import com.fs.store.config.StoreConfig;
|
|
|
import com.fs.store.domain.*;
|
|
|
import com.fs.store.dto.*;
|
|
|
import com.fs.store.enums.OrderInfoEnum;
|
|
|
@@ -79,28 +72,15 @@ import com.fs.store.service.*;
|
|
|
import com.fs.store.service.channel.PaymentHandler;
|
|
|
import com.fs.store.service.channel.PaymentHandlerHolder;
|
|
|
import com.fs.store.service.channel.param.PayProcessContext;
|
|
|
-import com.fs.store.vo.FsStoreOrderItemVO;
|
|
|
-import com.fs.store.vo.FsStoreProductActivityListVO;
|
|
|
import com.fs.system.config.SnowflakeUtils;
|
|
|
-import com.fs.system.domain.SysConfig;
|
|
|
-import com.fs.system.mapper.SysConfigMapper;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
-import com.fs.tzBank.TzBankService;
|
|
|
import com.fs.wx.domain.FsWxExpressTask;
|
|
|
import com.fs.wx.mapper.FsWxExpressTaskMapper;
|
|
|
-import com.fs.wx.pay.config.WxPayProperties;
|
|
|
-import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
|
|
|
-import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
|
|
-import com.github.binarywang.wxpay.config.WxPayConfig;
|
|
|
-import com.github.binarywang.wxpay.exception.WxPayException;
|
|
|
-import com.github.binarywang.wxpay.service.WxPayService;
|
|
|
-import com.google.gson.Gson;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang.ObjectUtils;
|
|
|
import org.apache.http.util.Asserts;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -952,24 +932,6 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
return R.error("已退款");
|
|
|
}
|
|
|
log.info("准备退款 订单: {}",JSON.toJSONString(order));
|
|
|
- if(StringUtils.isNotEmpty(order.getExtendOrderId())){
|
|
|
- ErpRefundUpdateRequest request=new ErpRefundUpdateRequest();
|
|
|
- request.setTid(order.getOrderCode());
|
|
|
- request.setOid(order.getOrderCode());
|
|
|
- request.setRefund_state(1);
|
|
|
- request.setOrderStatus(liveAfterSales.getOrderStatus());
|
|
|
- request.setStoreAfterSalesId(liveAfterSales.getId());
|
|
|
- // 根据仓库code找erp
|
|
|
- if(StringUtils.isNotBlank(order.getStoreHouseCode())){
|
|
|
- String erp = fsWarehousesMapper.selectErpByCode(order.getStoreHouseCode());
|
|
|
- ErpContextHolder.setErpType(erp);
|
|
|
- }
|
|
|
- BaseResponse response=erpOrderService.refundUpdateLive(request);
|
|
|
- if(ObjectUtil.isNull(response) || !response.getSuccess()){
|
|
|
- log.error("调用erp退款接口失败! {}",JSON.toJSONString(response));
|
|
|
- throw new CustomException("调用erp退款接口失败:"+response.getErrorDesc());
|
|
|
- }
|
|
|
- }
|
|
|
order.setStatus(-2);
|
|
|
order.setRefundMoney(order.getPayMoney());
|
|
|
order.setRefundStatus(String.valueOf(OrderInfoEnum.REFUND_STATUS_2.getValue()));
|
|
|
@@ -1643,6 +1605,41 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
|
|
|
return liveOrderMapper.selectLiveOrderByOrderCode(orderCode);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R getExpressMulti(LiveOrder order) {
|
|
|
+ //顺丰轨迹查询处理
|
|
|
+ String lastFourNumber = PhoneUtils.getLastFourNum(order.getUserPhone());
|
|
|
+ // 获取该订单关联的物流信息
|
|
|
+ List<FsStoreDelivers> fsStoreDelivers = fsStoreDeliversMapper.findByOrderIdWithType(order.getOrderId(),1);
|
|
|
+ if(CollectionUtils.isEmpty(fsStoreDelivers)){
|
|
|
+ return R.ok("当前订单号暂无物流信息");
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ExpressInfoDTO> result = new ArrayList<>();
|
|
|
+ for (FsStoreDelivers fsStoreDeliver : fsStoreDelivers) {
|
|
|
+ ExpressInfoDTO dto=expressService.getExpressInfo(order.getOrderCode(),
|
|
|
+ fsStoreDeliver.getDeliverSn(),
|
|
|
+ fsStoreDeliver.getDeliverId(),
|
|
|
+ lastFourNumber);
|
|
|
+ result.add(dto);
|
|
|
+ }
|
|
|
+
|
|
|
+ return R.ok().put("data",result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public R getExpress(LiveOrder order) {
|
|
|
+ //顺丰轨迹查询处理
|
|
|
+ String lastFourNumber = "";
|
|
|
+ if (order.getDeliverySn().equals(ShipperCodeEnum.SF.getValue())) {
|
|
|
+ lastFourNumber = PhoneUtils.getLastFourNum(order.getUserPhone());
|
|
|
+ }
|
|
|
+ ExpressInfoDTO dto=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
|
|
|
+ dto.setShipperName(order.getDeliveryName());
|
|
|
+ FsExpress express=expressService.selectFsExpressByName(order.getDeliveryName());
|
|
|
+ return R.ok().put("data", dto).put("express",express).put("deliveryId",order.getDeliverySn());
|
|
|
+ }
|
|
|
+
|
|
|
private BigDecimal handleDeliveryMoney(Long cityId, FsStoreProduct fsStoreProduct, String totalNumSize) {
|
|
|
BigDecimal storePostage = BigDecimal.ZERO;
|
|
|
List<Long> citys = new ArrayList<>();
|