Commit 7376176a by 徐康

Merge branch 'feature/20200915_麦咖啡p2v3活动入机增加TENDERID字段' into develop

# Conflicts:
#	order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
parents 2baf4895 c01da911
......@@ -17,6 +17,7 @@ import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType;
import com.freemud.sdk.api.assortment.order.enums.QueryOrderAccountType;
import com.freemud.sdk.api.assortment.order.request.order.CreateOrderProductRequest;
import com.freemud.sdk.api.assortment.order.request.order.OrderProductAddInfoDto;
import com.freemud.sdk.api.assortment.order.request.order.OrderSpecialExtraAttrRequest;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
......@@ -184,7 +185,21 @@ public class DeliveryAdapter {
order.getProductList().forEach(productList -> {
ProductInfo deliveryProductInfo = new ProductInfo();
deliveryProductInfo.setProductCode(productList.getProductId());
deliveryProductInfo.setProductName(productList.getProductName());
String productName = productList.getProductName();
OrderProductAddInfoDto extInfo = JSON.parseObject(productList.getAddInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) {
String attr = "";
for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) {
attr += special.getAttributeName()+",";
}
}
if(attr.length() > 0) {
attr = attr.substring(0, attr.length()-1);
productName += "("+attr+")";
}
}
deliveryProductInfo.setProductName(productName);
deliveryProductInfo.setProductNumber(productList.getNumber());
deliveryProductInfo.setProductPrice(productList.getSalePrice().intValue());
//餐道使用
......
......@@ -41,6 +41,7 @@ import cn.freemud.request.wechat.dto.SignMessageBuilder;
import cn.freemud.service.impl.OrderCommonService;
import cn.freemud.utils.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerWxappConfig;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
......@@ -1889,7 +1890,22 @@ public class OrderAdapter {
ProductVo productVo = new ProductVo();
productVo.setId(productBean.getId());
productVo.setPid(StringUtils.isBlank(productBean.getSpecification()) ? productBean.getProductId() : productBean.getSpecification());
productVo.setName(StringUtils.isBlank(productBean.getSpecificationName()) ? productBean.getProductName() : productBean.getSpecificationName());
String productName = StringUtils.isBlank(productBean.getSpecificationName()) ? productBean.getProductName() : productBean.getSpecificationName();
OrderProductAddInfoDto extInfo = JSON.parseObject(productBean.getExtInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) {
String attr = "";
for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) {
attr += special.getAttributeName()+",";
}
}
if(attr.length() > 0) {
attr = attr.substring(0, attr.length()-1);
productName += "("+attr+")";
}
}
productVo.setName(productName);
productVo.setSpuName(productBean.getProductName());
productVo.setPicture(productBean.getPicture());
productVo.setSequence(productBean.getSequence());
......
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