20240115-ljl-multiPay
ljl 1 year ago
parent b6412bbec1
commit e41c2a8ef2

@ -1,5 +1,6 @@
package com.ms.biz.dto.openspi.response;
import com.alibaba.fastjson.annotation.JSONField;
import com.doudian.open.gson.annotations.SerializedName;
import lombok.Data;
@ -7,6 +8,7 @@ import java.util.List;
@Data
public class BatchCreateData {
@JSONField(name = "order_results")
@SerializedName("order_results")
private List<OrderResult> orderResults;
}

@ -1,5 +1,6 @@
package com.ms.biz.dto.openspi.response;
import com.alibaba.fastjson.annotation.JSONField;
import com.doudian.open.gson.annotations.SerializedName;
import lombok.Data;
@ -7,6 +8,7 @@ import java.util.List;
@Data
public class BatchPayData {
@JSONField(name = "payment_results")
@SerializedName("payment_results")
private List<PaymentResult> paymentResults;
}

@ -1,5 +1,6 @@
package com.ms.biz.dto.openspi.response;
import com.alibaba.fastjson.annotation.JSONField;
import com.doudian.open.gson.annotations.SerializedName;
import lombok.Data;
@ -8,36 +9,45 @@ import java.util.List;
@Data
public class OrderResult {
@JSONField(name = "pur_order_id")
@SerializedName("pur_order_id")
private String purOrderId;
@JSONField(name = "out_pre_orderId")
@SerializedName("out_pre_orderId")
private String outPreOrderId;
@JSONField(name = "supplier_order_id")
@SerializedName("supplier_order_id")
private String supplierOrderId;
@JSONField(name = "supplier_order_url")
@SerializedName("supplier_order_url")
private SupplierOrderUrl supplierOrderUrl;
@JSONField(name = "sku_order_results")
@SerializedName("sku_order_results")
private List<SkuOrderResult> skuOrderResults;
@Data
public static class SupplierOrderUrl implements Serializable {
@JSONField(name = "h5_url")
@SerializedName("h5_url")
private String h5Url;
@JSONField(name = "pc_url")
@SerializedName("pc_url")
private String pcUrl;
}
@Data
public static class SkuOrderResult implements Serializable {
@JSONField(name = "pur_sku_order_id")
@SerializedName("pur_sku_order_id")
private String purSkuOrderId;
@JSONField(name = "supplier_sku_order_id")
@SerializedName("supplier_sku_order_id")
private String supplierSkuOrderId;
}

@ -1,5 +1,6 @@
package com.ms.biz.dto.openspi.response;
import com.alibaba.fastjson.annotation.JSONField;
import com.doudian.open.gson.annotations.SerializedName;
import lombok.Data;
@ -7,17 +8,21 @@ import java.io.Serializable;
@Data
public class PaymentResult {
@JSONField(name = "pur_order_id")
@SerializedName("pur_order_id")
private String purOrderId;
@JSONField(name = "pay_url")
@SerializedName("pay_url")
private PayUrl payUrl;
@Data
public static class PayUrl implements Serializable {
@JSONField(name = "h5_url")
@SerializedName("h5_url")
private String h5Url;
@JSONField(name = "pc_url")
@SerializedName("pc_url")
private String pcUrl;
}

@ -317,24 +317,48 @@ public class DsMessageServiceImpl implements DsMessageService {
if (purchaseOrderDTO.getRefundInfo() == null || purchaseOrderDTO.getRefundInfo().isEmpty()) {
return;
}
Map<String, Long> subItemIdAndSkuIdMap = new HashMap<>();
for (PurchaseOrderItemDTO itemDTO: purchaseOrderDTO.getItems()) {
subItemIdAndSkuIdMap.put(itemDTO.getSubItemId(), itemDTO.getSkuId());
}
Map<String, String> skuIdAndPurSkuOrderIdMap = new HashMap<>();
List<PlatformPurchaseOrderSku> skus = platformPurchaseOrderSkuMapper.getListByPurOrderIds(Collections.singletonList(purchaseOrder.getPurOrderId()));
for (PlatformPurchaseOrderSku sku: skus) {
skuIdAndPurSkuOrderIdMap.put(sku.getOuterSkuId(), sku.getPurSkuOrderId());
}
SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam();
param.setPurOrderId(purchaseOrderDTO.getPlatformOrderId());
List<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>();
for (Map.Entry<String, RefundInfoDTO> entry: purchaseOrderDTO.getRefundInfo().entrySet()) {
SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(entry.getValue());
skuRefundInfosItems.add(skuRefundInfosItem);
Set<String> subItemIds = entry.getValue().getOrderEntryCountMap().keySet();
for (String subItemId: subItemIds) {
if (!subItemIdAndSkuIdMap.containsKey(subItemId)) {
log.info("sku unFound, subItemId: " + subItemId + "subItemIdAndSkuIdMap: " + subItemIdAndSkuIdMap);
continue;
}
Long skuId = subItemIdAndSkuIdMap.get(subItemId);
if (!skuIdAndPurSkuOrderIdMap.containsKey(String.valueOf(skuId))) {
log.info("purSkuOrderId unFound skuId: " + skuId + "skuIdAndPurSkuOrderIdMap: " + skuIdAndPurSkuOrderIdMap);
continue;
}
String purSkuOrderId = skuIdAndPurSkuOrderIdMap.get(String.valueOf(skuId));
SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(purSkuOrderId, entry.getValue());
skuRefundInfosItems.add(skuRefundInfosItem);
}
}
param.setSkuRefundInfos(skuRefundInfosItems);
DDApi.supplyCenterRefundOperate(param);
}
private SkuRefundInfosItem buildSkuRefundInfosItem(RefundInfoDTO refundInfo) {
private SkuRefundInfosItem buildSkuRefundInfosItem(String purSkuOrderId, RefundInfoDTO refundInfo) {
Address address = new Address();
address.setUserName(refundInfo.getSellerRealName());
address.setDetail(refundInfo.getSellerReceiveAddress());
address.setMobile(refundInfo.getSellerMobile());
SkuRefundInfosItem skuRefundInfosItem = new SkuRefundInfosItem();
skuRefundInfosItem.setPurSkuOrderId("");
skuRefundInfosItem.setPurSkuOrderId(purSkuOrderId);
skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason());
skuRefundInfosItem.setAddress(address);
skuRefundInfosItem.setCloseReason("");

@ -114,6 +114,11 @@ public class ShopServiceImpl implements ShopService {
}
public void querySupplyPlatformAuth(QuerySupplyPlatformAuthParam param, QuerySupplyPlatformAuthData data) {
if (param.getScene() == 1) {
data.setAuthorized(true);
data.setAuthUrl("");
return;
}
Long shopId = param.getShopId();
ShopBO shop = getShopInfo(shopId);
ShopTo1688DsMember shopTo1688DsMember = shopTo1688DsMemberMapper.getDetailByShopId(shopId);

Loading…
Cancel
Save