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

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

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

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

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

@ -317,24 +317,48 @@ public class DsMessageServiceImpl implements DsMessageService {
if (purchaseOrderDTO.getRefundInfo() == null || purchaseOrderDTO.getRefundInfo().isEmpty()) { if (purchaseOrderDTO.getRefundInfo() == null || purchaseOrderDTO.getRefundInfo().isEmpty()) {
return; 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(); SupplyCenterRefundOperateParam param = new SupplyCenterRefundOperateParam();
param.setPurOrderId(purchaseOrderDTO.getPlatformOrderId()); param.setPurOrderId(purchaseOrderDTO.getPlatformOrderId());
List<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>(); List<SkuRefundInfosItem> skuRefundInfosItems = new ArrayList<>();
for (Map.Entry<String, RefundInfoDTO> entry: purchaseOrderDTO.getRefundInfo().entrySet()) { for (Map.Entry<String, RefundInfoDTO> entry: purchaseOrderDTO.getRefundInfo().entrySet()) {
SkuRefundInfosItem skuRefundInfosItem = buildSkuRefundInfosItem(entry.getValue()); 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); skuRefundInfosItems.add(skuRefundInfosItem);
} }
}
param.setSkuRefundInfos(skuRefundInfosItems); param.setSkuRefundInfos(skuRefundInfosItems);
DDApi.supplyCenterRefundOperate(param); DDApi.supplyCenterRefundOperate(param);
} }
private SkuRefundInfosItem buildSkuRefundInfosItem(RefundInfoDTO refundInfo) { private SkuRefundInfosItem buildSkuRefundInfosItem(String purSkuOrderId, RefundInfoDTO refundInfo) {
Address address = new Address(); Address address = new Address();
address.setUserName(refundInfo.getSellerRealName()); address.setUserName(refundInfo.getSellerRealName());
address.setDetail(refundInfo.getSellerReceiveAddress()); address.setDetail(refundInfo.getSellerReceiveAddress());
address.setMobile(refundInfo.getSellerMobile()); address.setMobile(refundInfo.getSellerMobile());
SkuRefundInfosItem skuRefundInfosItem = new SkuRefundInfosItem(); SkuRefundInfosItem skuRefundInfosItem = new SkuRefundInfosItem();
skuRefundInfosItem.setPurSkuOrderId(""); skuRefundInfosItem.setPurSkuOrderId(purSkuOrderId);
skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason()); skuRefundInfosItem.setRejectReason(refundInfo.getRejectReason());
skuRefundInfosItem.setAddress(address); skuRefundInfosItem.setAddress(address);
skuRefundInfosItem.setCloseReason(""); skuRefundInfosItem.setCloseReason("");

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

Loading…
Cancel
Save