Commit c7a73feb by zhiheng.zhang

小票打印

parent eab8e22b
...@@ -905,8 +905,18 @@ public class OrderSdkAdapter { ...@@ -905,8 +905,18 @@ public class OrderSdkAdapter {
List<OrderItemResp> materialProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList()); List<OrderItemResp> materialProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList());
materialProducts.forEach(material -> productBean.getMaterialProduct().add(getOldOrderProduct(orderSettlementResps, material))); materialProducts.forEach(material -> productBean.getMaterialProduct().add(getOldOrderProduct(orderSettlementResps, material)));
} }
if(StringUtils.isNotEmpty(productBean.getExtInfo())) {
OrderProductAddInfoDto extInfo = JSONObject.parseObject(productBean.getExtInfo(), OrderProductAddInfoDto.class);
productBean.setIsSendGoods(null == extInfo.getIsSendGoods() ? false : extInfo.getIsSendGoods());
productBean.setCartGoodsUid(null == extInfo.getCartGoodsUid() ? "" : extInfo.getCartGoodsUid());
productBean.setOriginalGoodsUid(null == extInfo.getOriginalGoodsUid() ? "" : extInfo.getOriginalGoodsUid());
}
productList.add(productBean); productList.add(productBean);
} }
productList.stream().forEach(productBean -> productBean.setSendProduct(getSendProduct(productList)));
return productList; return productList;
} }
...@@ -3362,4 +3372,13 @@ public class OrderSdkAdapter { ...@@ -3362,4 +3372,13 @@ public class OrderSdkAdapter {
orderConfirmRequest.setTimeout(timeOut); orderConfirmRequest.setTimeout(timeOut);
return orderConfirmRequest; return orderConfirmRequest;
} }
private List<QueryOrdersResponse.DataBean.OrderBean.ProductBean> getSendProduct(List<QueryOrdersResponse.DataBean.OrderBean.ProductBean> productList){
for(QueryOrdersResponse.DataBean.OrderBean.ProductBean sendProductBean : productList){
if(!sendProductBean.getIsSendGoods()) {
sendProductBean.setSendProduct(productList.stream().filter(productBean -> productBean.getOriginalGoodsUid().equalsIgnoreCase(sendProductBean.getCartGoodsUid()) && productBean.getIsSendGoods() == false).collect(Collectors.toList()));
}
}
return productList;
}
} }
...@@ -106,4 +106,9 @@ public class OrderProductAddInfoDto extends BaseConfig { ...@@ -106,4 +106,9 @@ public class OrderProductAddInfoDto extends BaseConfig {
* 虚拟商品种子券号 * 虚拟商品种子券号
*/ */
private String cardCode; private String cardCode;
/**
* 是否是赠品
*/
private Boolean isSendGoods;
} }
...@@ -665,6 +665,11 @@ public class QueryOrdersResponse { ...@@ -665,6 +665,11 @@ public class QueryOrdersResponse {
public List<ProductBean> materialProduct; public List<ProductBean> materialProduct;
/** /**
* 赠品
*/
public List<ProductBean> sendProduct;
/**
* 商品拓展字段extInfo转换对象接收 * 商品拓展字段extInfo转换对象接收
*/ */
public List<ProductExtInfo> productExtInfo; public List<ProductExtInfo> productExtInfo;
...@@ -733,6 +738,11 @@ public class QueryOrdersResponse { ...@@ -733,6 +738,11 @@ public class QueryOrdersResponse {
} }
/**
* 是否是赠品
*/
private Boolean isSendGoods;
} }
@NoArgsConstructor @NoArgsConstructor
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment