Commit a1b77361 by ping.wu

围餐订单预览返回商品英文名

parent 62a1780a
...@@ -2061,28 +2061,37 @@ public class OrderAdapter { ...@@ -2061,28 +2061,37 @@ public class OrderAdapter {
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());
String productName = StringUtils.isBlank(productBean.getSpecificationName()) ? productBean.getProductName() : productBean.getSpecificationName(); String productName = StringUtils.isBlank(productBean.getSpecificationName()) ? productBean.getProductName() : productBean.getSpecificationName();
String foreignProductName = StringUtils.isBlank(productBean.getSpecificationForeignName()) ? productBean.getProductForeignName() : productBean.getSpecificationForeignName();
OrderProductAddInfoDto extInfo = JSON.parseObject(productBean.getExtInfo(), OrderProductAddInfoDto.class); OrderProductAddInfoDto extInfo = JSON.parseObject(productBean.getExtInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) { if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) {
String attr = ""; String attr = "";
String attrEng = "";
for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) { for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) { if(special.getAttributeName().indexOf("冰") >= 0) {
attr = special.getAttributeName(); attr = special.getAttributeName();
attrEng = special.getAttributeForeignName();
break; break;
} }
} }
if(attr.length() > 0) { if(attr.length() > 0) {
productName += "("+attr+")"; productName += "("+attr+")";
} }
//英文名处理
if(attrEng.length() > 0) {
foreignProductName += "("+attrEng+")";
}
} }
if(CollectionUtils.isNotEmpty(productBean.getMaterialProduct())) { if(CollectionUtils.isNotEmpty(productBean.getMaterialProduct())) {
for (QueryOrdersResponse.DataBean.OrderBean.ProductBean material : productBean.getMaterialProduct()) { for (QueryOrdersResponse.DataBean.OrderBean.ProductBean material : productBean.getMaterialProduct()) {
productName += "/"+material.getSpecificationName(); productName += "/"+material.getSpecificationName();
foreignProductName += "/"+material.getSpecificationForeignName();
} }
} }
productVo.setName(productName); productVo.setName(productName);
productVo.setSpuName(productBean.getProductName()); productVo.setSpuName(productBean.getProductName());
productVo.setForeignName(foreignProductName);
productVo.setSpuForeignName(productBean.getProductForeignName());
productVo.setPicture(productBean.getPicture()); productVo.setPicture(productBean.getPicture());
productVo.setSequence(productBean.getSequence()); productVo.setSequence(productBean.getSequence());
productVo.setQty(productBean.getNumber()); productVo.setQty(productBean.getNumber());
......
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