Add shop ERP code to ShoumanOrderContent

pull/8040/head
Qiuyi LI 2024-03-15 17:31:28 +01:00
parent 6429a6ab2a
commit f4a4068e97
3 changed files with 19 additions and 7 deletions

View File

@ -24,6 +24,7 @@ public class OrderCreationRequestBody implements RequestBody {
private final static String QUOTE = ":";
private final static String WIA = "维亚智通";
private final static String TRANSACTION_NUMBER = "交易号";
private final static String SHOP_CODE = "店铺名称";
public OrderCreationRequestBody(List<ShoumanOrderContent> orderContents, Map<String, Country> countryMap) {
this.orderContents = orderContents;
@ -60,7 +61,8 @@ public class OrderCreationRequestBody implements RequestBody {
totalPrice = totalPrice.add(price);
putNonNull(contentJson, "theImagePath", content.getImageUrl());
putNonNull(contentJson, "comment", generateRemark(content.getRemark(), content.getCustomizationData(),
content.getContentRecRegex(), content.getContentExtRegex(), content.getPlatformOrderNumber()));
content.getContentRecRegex(), content.getContentExtRegex(), content.getShopErpCode(),
content.getPlatformOrderNumber()));
putNonNull(contentJson, "sku", content.getSku());
putNonNull(contentJson, "outboundNumder", content.getQuantity()); // Typo intended
outboundInfos.add(contentJson);
@ -71,7 +73,7 @@ public class OrderCreationRequestBody implements RequestBody {
}
private String generateRemark(String baseRemark, String customizationData, String contentRecRegex, String contentExtRegex,
String platformOrderNumber) {
String shopErpCode, String platformOrderNumber) {
StringBuilder sb = new StringBuilder();
String[] baseRemarks = baseRemark.split(DEFAULT_SPLIT);
for (String remark : baseRemarks) {
@ -92,6 +94,9 @@ public class OrderCreationRequestBody implements RequestBody {
.append(LINE_BREAK);
}
}
sb.append(SHOP_CODE)
.append(shopErpCode)
.append(LINE_BREAK);
sb.append(TRANSACTION_NUMBER)
.append(platformOrderNumber)
.append(LINE_BREAK);

View File

@ -7,6 +7,7 @@ import java.math.BigDecimal;
@Data
public class ShoumanOrderContent {
private String shopErpCode;
private String platformOrderId;
private String platformOrderNumber;
private String postcode;
@ -24,10 +25,12 @@ public class ShoumanOrderContent {
private String imageUrl;
private String sku;
public ShoumanOrderContent(String platformOrderId, String platformOrderNumber, String postcode, String recipient,
String city, String country, String platformOrderContentId, String customizationData,
Integer quantity, String productName, String remark, String contentRecRegex,
String contentExtRegex, BigDecimal price, String imageUrl, String sku) {
public ShoumanOrderContent(String shopErpCode, String platformOrderId, String platformOrderNumber, String postcode,
String recipient, String city, String country, String platformOrderContentId,
String customizationData, Integer quantity, String productName, String remark,
String contentRecRegex, String contentExtRegex, BigDecimal price, String imageUrl,
String sku) {
this.shopErpCode = shopErpCode;
this.platformOrderId = platformOrderId;
this.platformOrderNumber = platformOrderNumber;
this.postcode = postcode;
@ -49,6 +52,7 @@ public class ShoumanOrderContent {
@Override
public String toString() {
return "ShoumanOrderContent{" +
"shopErpCode='" + shopErpCode + '\'' +
"platformOrderId='" + platformOrderId + '\'' +
"platformOrderNumber='" + platformOrderNumber + '\'' +
", postcode='" + postcode + '\'' +

View File

@ -362,7 +362,8 @@
<select id="searchShoumanOrderContent"
resultType="org.jeecg.modules.business.entity.ShoumanOrderContent">
select po.platform_order_id,
select sh.erp_code,
po.platform_order_id,
po.platform_order_number,
po.postcode,
po.recipient,
@ -380,6 +381,7 @@
sc.sku
from platform_order_content poc
join platform_order po on poc.platform_order_id = po.id
join shop sh on po.shop_id = sh.id
join sku s on poc.sku_id = s.id
join shouman_sku_relation ssr on s.id = ssr.sku_id
join shouman_category sc on ssr.shouman_category_id = sc.id
@ -388,6 +390,7 @@
<resultMap id="shoumanOrderContentResultMap" type="org.jeecg.modules.business.entity.ShoumanOrderContent">
<id property="platformOrderContentId" column="platform_order_content_id" javaType="string"/>
<result property="shopErpCode" column="erp_code" javaType="string"/>
<result property="platformOrderId" column="platform_order_id" javaType="string"/>
<result property="platformOrderNumber" column="platform_order_number" javaType="string"/>
<result property="postcode" column="postcode" javaType="string"/>