|
@@ -56,6 +56,8 @@ import com.fs.huifuPay.domain.HuiFuCreateOrder;
|
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
import com.fs.huifuPay.domain.HuifuCreateOrderResult;
|
|
|
import com.fs.huifuPay.dto.*;
|
|
import com.fs.huifuPay.dto.*;
|
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
import com.fs.huifuPay.service.HuiFuService;
|
|
|
|
|
+import com.fs.live.mapper.LiveOrderMapper;
|
|
|
|
|
+import com.fs.live.mapper.LiveOrderPaymentMapper;
|
|
|
import com.fs.pay.pay.domain.CreateWxOrderResult;
|
|
import com.fs.pay.pay.domain.CreateWxOrderResult;
|
|
|
import com.fs.pay.pay.domain.RefundResult;
|
|
import com.fs.pay.pay.domain.RefundResult;
|
|
|
import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
import com.fs.pay.pay.dto.OrderQueryDTO;
|
|
@@ -261,9 +263,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ShippingService shippingService;
|
|
private ShippingService shippingService;
|
|
|
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private OrderQueryService orderQueryService;
|
|
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsWarehousesMapper fsWarehousesMapper;
|
|
private FsWarehousesMapper fsWarehousesMapper;
|
|
|
|
|
|
|
@@ -273,12 +272,6 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsUserMapper fsUserMapper;
|
|
private FsUserMapper fsUserMapper;
|
|
|
|
|
|
|
|
- @Value("${snowflake.worker-id:1}")
|
|
|
|
|
- private long workerId;
|
|
|
|
|
-
|
|
|
|
|
- @Value("${snowflake.datacenter-id:1}")
|
|
|
|
|
- private long datacenterId;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void syncExpressToWx() {
|
|
public void syncExpressToWx() {
|
|
@@ -297,26 +290,21 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
orderKey.setOrderNumberType(2);
|
|
orderKey.setOrderNumberType(2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
FsUser fsUser = fsUserMapper.selectFsUserById(fsWxExpressTask.getUserId());
|
|
FsUser fsUser = fsUserMapper.selectFsUserById(fsWxExpressTask.getUserId());
|
|
|
- FsStoreOrder fsStoreOrder = fsStoreOrderMapper.selectFsStoreOrderByOrderCode(fsWxExpressTask.getOrderCode());
|
|
|
|
|
|
|
|
|
|
|
|
+ ExpressToWxService service = ExpressToWxHolder.findBest(fsWxExpressTask.getType());
|
|
|
|
|
+ Asserts.notNull(service,"订单类型不被支持!");
|
|
|
|
|
+ service.setOrderCode(fsWxExpressTask.getOrderCode());
|
|
|
|
|
|
|
|
- if(ObjectUtil.isNotNull(fsStoreOrder)){
|
|
|
|
|
- List<FsStorePayment> fsStorePayments = paymentService.selectFsStorePaymentByOrder(fsStoreOrder.getId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- if(CollectionUtils.isNotEmpty(fsStorePayments)){
|
|
|
|
|
- FsStorePayment fsStorePayment = fsStorePayments.get(0);
|
|
|
|
|
- orderKey.setTransactionId(fsStorePayment.getBankTransactionId());
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ orderKey.setTransactionId(service.getTransactionId());
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ String userPhone = service.getUserPhone();
|
|
|
|
|
+ String orderGoodsInfo = service.getOrderGoodsInfo();
|
|
|
|
|
|
|
|
- String userPhone = "";
|
|
|
|
|
- String orderGoodsInfo = "商品";
|
|
|
|
|
- if(fsStoreOrder != null){
|
|
|
|
|
- userPhone = fsStoreOrder.getUserPhone();
|
|
|
|
|
- orderGoodsInfo = getOrderGoodsInfo(fsStoreOrder);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
Payer payer = new Payer();
|
|
Payer payer = new Payer();
|
|
|
if(StringUtils.isNotBlank(fsUser.getMaOpenId())){
|
|
if(StringUtils.isNotBlank(fsUser.getMaOpenId())){
|
|
@@ -363,30 +351,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * 获取订单商品信息
|
|
|
|
|
- * @return
|
|
|
|
|
- */
|
|
|
|
|
- private String getOrderGoodsInfo(FsStoreOrder order){
|
|
|
|
|
- StringBuilder title = new StringBuilder();
|
|
|
|
|
- // 如果是套餐
|
|
|
|
|
- if(ObjectUtil.equal(order.getIsPackage(),1)){
|
|
|
|
|
- String packageJson = order.getPackageJson();
|
|
|
|
|
- JSONObject jsonObject = JSON.parseObject(packageJson);
|
|
|
|
|
- title = new StringBuilder(jsonObject.getString("title"));
|
|
|
|
|
- } else {
|
|
|
|
|
- String itemJson = order.getItemJson();
|
|
|
|
|
- com.alibaba.fastjson.JSONArray arrays = JSON.parseArray(itemJson);
|
|
|
|
|
- for(int i=0;i<arrays.size();i++){
|
|
|
|
|
- JSONObject jsonObject = arrays.getJSONObject(i);
|
|
|
|
|
- String jsonInfo = jsonObject.getString("jsonInfo");
|
|
|
|
|
- JSONObject jsonObject1 = JSON.parseObject(jsonInfo);
|
|
|
|
|
- String productName = jsonObject1.getString("productName");
|
|
|
|
|
- title.append(productName).append("\n");
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return title.toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询订单
|
|
* 查询订单
|