Commit d562d448 by zhiheng.zhang

Merge branch 'feature/20210401-pos打印小票-张志恒'

# Conflicts:
#	assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/OrderProductAddInfoDto.java
parents fafee741 0c9e9ac1
package com.freemud.sdk.api.assortment.order.adapter;
import cn.freemud.base.constant.Version;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.couponcenter.offline.domain.ProductRedeemVO;
......@@ -905,8 +906,31 @@ public class OrderSdkAdapter {
List<OrderItemResp> materialProducts = orderItemList.stream().filter(item -> ObjectUtils.equals(partnerProductId, item.getParentProductId())).collect(Collectors.toList());
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(StringUtils.isEmpty(extInfo.getCartGoodsUid()) ? "" : extInfo.getCartGoodsUid());
productBean.setOriginalGoodsUid(StringUtils.isEmpty(extInfo.getOriginalGoodsUid()) ? "" : extInfo.getOriginalGoodsUid());
}
productList.add(productBean);
}
if(null != productList && productList.size() >0) {
for (QueryOrdersResponse.DataBean.OrderBean.ProductBean sendProductBean : productList) {
sendProductBean.setIsPrint(true);
if(null !=sendProductBean.getIsSendGoods() && sendProductBean.getIsSendGoods() && StringUtils.isNotEmpty(sendProductBean.getOriginalGoodsUid())){
sendProductBean.setIsPrint(false);
}
if (null !=sendProductBean.getIsSendGoods() && null !=sendProductBean.getIsSendGoods() && !sendProductBean.getIsSendGoods()) {
sendProductBean.setSendProduct(productList.stream()
.filter(productBean -> productBean.getOriginalGoodsUid().equalsIgnoreCase(sendProductBean.getCartGoodsUid()) && productBean.getIsSendGoods() == true)
.map(o -> JSON.parseObject(JSON.toJSONString(o), QueryOrdersResponse.DataBean.OrderBean.ProductBean.class))
.collect(Collectors.toList()));
}
}
}
return productList;
}
......
......@@ -14,6 +14,7 @@ package com.freemud.sdk.api.assortment.order.response.order;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.*;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderCostResp;
import com.rabbitmq.tools.json.JSONUtil;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang.builder.ToStringBuilder;
......@@ -665,6 +666,11 @@ public class QueryOrdersResponse {
public List<ProductBean> materialProduct;
/**
* 赠品
*/
public List<ProductBean> sendProduct;
/**
* 商品拓展字段extInfo转换对象接收
*/
public List<ProductExtInfo> productExtInfo;
......@@ -679,6 +685,11 @@ public class QueryOrdersResponse {
*/
private String originalGoodsUid;
/**
* 是否打印
*/
private Boolean isPrint;
@NoArgsConstructor
@Data
public static class ProductDiscount {
......@@ -735,6 +746,11 @@ public class QueryOrdersResponse {
}
/**
* 是否是赠品
*/
private Boolean isSendGoods;
}
@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