|
|
@@ -3,8 +3,10 @@ package com.fs.store.service.impl;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.fs.store.domain.FsStoreDelivers;
|
|
|
import com.fs.store.domain.FsStoreOrder;
|
|
|
import com.fs.store.domain.FsStorePayment;
|
|
|
+import com.fs.store.mapper.FsStoreDeliversMapper;
|
|
|
import com.fs.store.mapper.FsStoreOrderMapper;
|
|
|
import com.fs.store.mapper.FsStorePaymentMapper;
|
|
|
import com.fs.store.service.ExpressToWxService;
|
|
|
@@ -26,7 +28,8 @@ public class ShopExpressToWxService extends ExpressToWxService {
|
|
|
private FsStoreOrderMapper fsStoreOrderMapper;
|
|
|
@Autowired
|
|
|
private FsStorePaymentMapper fsStorePaymentMapper;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private FsStoreDeliversMapper fsStoreDeliversMapper;
|
|
|
|
|
|
private FsStoreOrder fsStoreOrder;
|
|
|
private FsStorePayment fsStorePayment;
|
|
|
@@ -61,6 +64,24 @@ public class ShopExpressToWxService extends ExpressToWxService {
|
|
|
return getOrderGoodsInfo(fsStoreOrder);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String getExpressCompany() {
|
|
|
+ List<FsStoreDelivers> byOrderId = fsStoreDeliversMapper.findByOrderId(fsStoreOrder.getId());
|
|
|
+ if(CollectionUtils.isEmpty(byOrderId)){
|
|
|
+ throw new IllegalArgumentException(String.format("当前订单 %s 无物流记录",getOrderCode()));
|
|
|
+ }
|
|
|
+ return byOrderId.get(0).getDeliverSn();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getExpressNo() {
|
|
|
+ List<FsStoreDelivers> byOrderId = fsStoreDeliversMapper.findByOrderId(fsStoreOrder.getId());
|
|
|
+ if(CollectionUtils.isEmpty(byOrderId)){
|
|
|
+ throw new IllegalArgumentException(String.format("当前订单 %s 无物流记录",getOrderCode()));
|
|
|
+ }
|
|
|
+ return byOrderId.get(0).getDeliverId();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public boolean support(Integer type) {
|
|
|
return 0 == type;
|