Commit c01da911 by 徐康

special name in query

parent 8dd4c7a0
...@@ -17,6 +17,7 @@ import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType; ...@@ -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.enums.QueryOrderAccountType;
import com.freemud.sdk.api.assortment.order.request.order.CreateOrderProductRequest; 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.OrderProductAddInfoDto;
import com.freemud.sdk.api.assortment.order.request.order.OrderSpecialExtraAttrRequest;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -178,7 +179,21 @@ public class DeliveryAdapter { ...@@ -178,7 +179,21 @@ public class DeliveryAdapter {
order.getProductList().forEach(productList -> { order.getProductList().forEach(productList -> {
ProductInfo deliveryProductInfo = new ProductInfo(); ProductInfo deliveryProductInfo = new ProductInfo();
deliveryProductInfo.setProductCode(productList.getProductId()); 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.setProductNumber(productList.getNumber());
deliveryProductInfo.setProductPrice(productList.getPrice().intValue()); deliveryProductInfo.setProductPrice(productList.getPrice().intValue());
//餐道使用 //餐道使用
......
...@@ -39,6 +39,8 @@ import cn.freemud.interceptor.ServiceException; ...@@ -39,6 +39,8 @@ import cn.freemud.interceptor.ServiceException;
import cn.freemud.request.wechat.dto.SignMessageBuilder; import cn.freemud.request.wechat.dto.SignMessageBuilder;
import cn.freemud.service.impl.OrderCommonService; import cn.freemud.service.impl.OrderCommonService;
import cn.freemud.utils.*; import cn.freemud.utils.*;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerWxappConfig; import com.freemud.api.assortment.datamanager.entity.db.AssortmentOpenPlatformPartnerWxappConfig;
import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo; import com.freemud.api.assortment.datamanager.entity.vo.AssortmentCustomerInfoVo;
...@@ -1850,7 +1852,22 @@ public class OrderAdapter { ...@@ -1850,7 +1852,22 @@ public class OrderAdapter {
ProductVo productVo = new ProductVo(); ProductVo productVo = new ProductVo();
productVo.setId(productBean.getId()); productVo.setId(productBean.getId());
productVo.setPid(StringUtils.isBlank(productBean.getSpecification()) ? productBean.getProductId() : productBean.getSpecification()); 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.setSpuName(productBean.getProductName());
productVo.setPicture(productBean.getPicture()); productVo.setPicture(productBean.getPicture());
productVo.setSequence(productBean.getSequence()); 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