Commit e555226c by hanghang.wang

Merge branch 'feature/20210226_【C端服务端】购物车商品新增英文相关字段_wanghanghang'

# Conflicts:
#	assortment-ordercenter-sdk/pom.xml
#	assortment-shoppingcart-sdk/pom.xml
#	order-application-service/pom.xml
#	order-application-service/src/main/resources/application.properties
#	ordercenter-sdk/pom.xml
#	shopping-cart-application-service/pom.xml
#	shopping-cart-application-service/src/main/java/cn/freemud/entities/vo/CartGoods.java
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/AssortmentSdkService.java
#	shopping-cart-application-service/src/main/java/cn/freemud/service/impl/ShoppingCartNewServiceImpl.java
parents c1dc6c02 f03ad5f4
......@@ -11,6 +11,7 @@
<artifactId>assortment-ordercenter-sdk</artifactId>
<version>2.1.39-RELEASE</version>
<version>2.2.69-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -20,7 +21,7 @@
<dependency>
<artifactId>assortment-data-manager</artifactId>
<groupId>com.freemud.sdk.api.assortment</groupId>
<version>3.5.RELEASE</version>
<version>5.4.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
......@@ -39,6 +40,7 @@
<groupId>cn.freemud</groupId>
<artifactId>ordercenter-sdk</artifactId>
<version>1.3.41.RELEASE</version>
<version>1.9.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......@@ -55,7 +57,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>storecenter-sdk</artifactId>
<version>3.2.6.RELEASE</version>
<version>3.3.12-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
......
......@@ -34,11 +34,13 @@ public class OrderAssortmentDtoConvertToDMVoAdapter {
public static DMOrderItemVo convertCreateOrderProductRequest(CreateOrderProductRequest createOrderProductRequest){
DMOrderItemVo dmOrderItemVo=new DMOrderItemVo();
dmOrderItemVo.setAddInfo(createOrderProductRequest.getAddInfo());
dmOrderItemVo.setForeignAddInfo(createOrderProductRequest.getForeignAddInfo());
dmOrderItemVo.setCategoryId(createOrderProductRequest.getCategoryId());
dmOrderItemVo.setCategoryName(createOrderProductRequest.getCategoryName());
dmOrderItemVo.setCustomerCode(createOrderProductRequest.getCustomerCode());
dmOrderItemVo.setDiscountId(createOrderProductRequest.getDiscountId());
dmOrderItemVo.setExtras(createOrderProductRequest.getExtras());
dmOrderItemVo.setForeignExtras(createOrderProductRequest.getForeignExtras());
dmOrderItemVo.setHasStockProduct(createOrderProductRequest.getHasStockProudct());
dmOrderItemVo.setWeight(createOrderProductRequest.getWeight());
dmOrderItemVo.setUnit(createOrderProductRequest.getUnit());
......
......@@ -925,15 +925,19 @@ public class OrderSdkAdapter {
productBean.setPrice(orderItemResp.getProductPrice().longValue());
productBean.setSalePrice(orderItemResp.getSalePrice().longValue());
productBean.setProductName(orderItemResp.getProductName());
productBean.setProductForeignName(orderItemResp.getProductForeignName());
productBean.setSpecification(orderItemResp.getProductSpec());
productBean.setSpecificationName(orderItemResp.getProductSpecName());
productBean.setSpecificationForeignName(orderItemResp.getProductForeignSpecName());
productBean.setProductSharePrice(orderItemResp.getProductSharePrice());
productBean.setSettlementPrice(orderItemResp.getSettlementPrice().longValue());
productBean.setUnit(orderItemResp.getProductUnit());
Map<String, String> map = new HashMap<String, String>();
map.put("attributeNames", orderItemResp.getProductProperty());
map.put("attributeForeignNames", orderItemResp.getProductForeignProperty());
productBean.setAddInfo(JSONObject.toJSONString(map));
productBean.setProductProperty(orderItemResp.getProductProperty());
productBean.setProductForeignProperty(orderItemResp.getProductForeignProperty());
productBean.setExtInfo(orderItemResp.getExtInfo());
productBean.setNote(orderItemResp.getNote());
......@@ -1073,6 +1077,11 @@ public class OrderSdkAdapter {
//【订单开放平台】订单详情查询接口增加配送类型字段
data.setExpressType(orderInfoReqs.getExpressType());
//围餐门店英文名称
if (orderInfoReqs.getOrderExtended() != null) {
data.setShopNameEn(orderInfoReqs.getOrderExtended().getStoreNameEn());
}
if (orderInfoReqs.getAfterSalesOrderList() != null && orderInfoReqs.getAfterSalesOrderList().size() >= 1) {
data.setAfterSalesOrderResp(orderInfoReqs.getAfterSalesOrderList().get(0));
}
......@@ -2499,6 +2508,7 @@ public class OrderSdkAdapter {
request.setOrderClient(requestVO.getOrderClient());
request.setCompanySelfCode(requestVO.getThirdOrderCode());
request.setStoreName(requestVO.getShopName());
request.setStoreNameEn(requestVO.getShopNameEn());
request.setPartnerName(requestVO.getCompanyName());
request.setStoreUnifyId(requestVO.getShopCode());
request.setUserId(requestVO.getUserId());
......@@ -2770,9 +2780,11 @@ public class OrderSdkAdapter {
orderItemCreateReq.setId(product.getId());
orderItemCreateReq.setPartnerId(partnerId);
orderItemCreateReq.setProductName(product.getProductName());
orderItemCreateReq.setProductForeignName(product.getProductForeignName());
orderItemCreateReq.setProductId(product.getProductId());
orderItemCreateReq.setProductSpec(product.getSpecification());
orderItemCreateReq.setProductSpecName(product.getSpecificationName());
orderItemCreateReq.setProductForeignSpecName(product.getSpecificationForeignName());
orderItemCreateReq.setProductSeq(product.getOpid());
orderItemCreateReq.setProductQuantity(product.getNumber());
orderItemCreateReq.setProductPrice(product.getPrice());
......@@ -2810,7 +2822,7 @@ public class OrderSdkAdapter {
Long setmealTotalSettlementPrice = 0L;
for (CreateOrderProductRequest createOrderProductRequest : product.getComboProduct()) {
// 删除的不计算在内
if(createOrderProductRequest.getIsDeleted() != null && createOrderProductRequest.getIsDeleted()) {
if(createOrderProductRequest.getIsDeleted() != null && createOrderProductRequest.getIsDeleted()) {
continue;
}
Long comboProductTotalDiscountAmount = createOrderProductRequest.getTotalDiscountAmount() == null ? 0L : createOrderProductRequest.getTotalDiscountAmount();
......@@ -2843,6 +2855,7 @@ public class OrderSdkAdapter {
OrderProductAddInfoDto addInfo = JSONObject.parseObject(product.getAddInfo(), OrderProductAddInfoDto.class);
if (addInfo !=null ) {
orderItemCreateReq.setProductProperty(addInfo.getAttributeNames());
orderItemCreateReq.setProductForeignProperty(addInfo.getAttributeForeignNames());
}
orderItemCreateReq.setProductPicUrl(product.getPicture());
orderItemCreateReq.setThirdProductId(product.getCustomerCode());
......@@ -3012,13 +3025,17 @@ public class OrderSdkAdapter {
CreateOrderProductRequest createOrderProductRequest = new CreateOrderProductRequest();
createOrderProductRequest.setProductCode(productBean.getProductCode());
createOrderProductRequest.setProductName(productBean.getProductName());
createOrderProductRequest.setProductForeignName(productBean.getProductForeignName());
createOrderProductRequest.setNumber(productBean.getNumber());
createOrderProductRequest.setParentProductId(productBean.getParentProductId());
createOrderProductRequest.setTrackingNo(trackingNo);
createOrderProductRequest.setAddInfo(productBean.getAddInfo());
createOrderProductRequest.setForeignAddInfo(productBean.getForeignAddInfo());
createOrderProductRequest.setProductId(productBean.getProductId());
createOrderProductRequest.setSpecification(productBean.getSpecification());
createOrderProductRequest.setSpecificationName(productBean.getSpecificationName());
createOrderProductRequest.setSpecificationForeignName(productBean.getSpecificationName());
createOrderProductRequest.setCustomerCode(productBean.getCustomerCode());
createOrderProductRequest.setSequence(productBean.getSequence());
createOrderProductRequest.setPrice(productBean.getPrice());
......
......@@ -42,6 +42,11 @@ public class AssortmentGroupCreateOrderRequest extends BaseConfig {
* 门店名称
*/
private String shopName;
/**
* 门店名称英文
*/
private String shopNameEn;
/**
* 用户ID
*/
......
......@@ -31,6 +31,10 @@ public class BaseCreateOrderRequest extends BaseConfig {
*/
private String shopName;
/**
* 门店英文名称
*/
private String shopNameEn;
/**
* 用户ID
*/
private String userId;
......@@ -213,6 +217,9 @@ public class BaseCreateOrderRequest extends BaseConfig {
private SendPoint point;
//门店英文名称
private String storeNameEn;
}
@Data
......
package com.freemud.sdk.api.assortment.order.request.order;
import lombok.Data;
/**
* @author wanghanghang
* @title: CreateOrderProductExpandRequest
* @projectName order-group
* @description: 订单商品信息字段拓展表
* @date 2021/3/3上午10:43
*/
@Data
public class CreateOrderProductExpandRequest {
/**订单主键id**/
private Long orderId;
/**订单item主键id**/
private Long orderItemId;
/**商品英文名**/
private String productForeignName;
/**
* 商品规格英文名称
*/
private String specificationForeignName;
}
......@@ -28,6 +28,11 @@ public class CreateOrderProductRequest extends BaseConfig {
* 商品名称
*/
private String productName;
/**商品英文名**/
private String productForeignName;
/**
* 商品数量
*/
......@@ -40,6 +45,11 @@ public class CreateOrderProductRequest extends BaseConfig {
* 商品规格名称
*/
private String specificationName;
/**
* 商品规格英文名称
*/
private String specificationForeignName;
/**
* 第三方商品编号,商品服务唯一
*/
......@@ -76,10 +86,14 @@ public class CreateOrderProductRequest extends BaseConfig {
* 属性 温|半糖|甜
*/
private String addInfo;
private String foreignAddInfo;
/**
* 属性
*/
private String extras;
private String foreignExtras;
/**
* 第三方菜品分类Id
*/
......
......@@ -27,6 +27,11 @@ public class OrderProductAddInfoDto extends BaseConfig {
private String attributeNames;
/**
* 属性英文名称 多糖/冷/常温
*/
private String attributeForeignNames;
/**
* 是否是套餐内固定商品
*/
private Boolean isFixedProduct;
......
......@@ -19,6 +19,10 @@ public class OrderSpecialExtraAttrRequest {
*/
private String attributeName;
/**
* 属性英文名
*/
private String attributeForeignName;
/**
* 入机code
*/
private String specialCode;
......
......@@ -210,6 +210,7 @@ public class QueryOrdersResponse {
*/
private String thirdShopId;
private String shopName;
private String shopNameEn;
private String source;
private String sourceName;
/**
......@@ -577,6 +578,10 @@ public class QueryOrdersResponse {
*/
private String productName;
/**
* 商品英文名称
*/
private String productForeignName;
/**
* 商品排序
*/
private int sequence;
......@@ -585,16 +590,20 @@ public class QueryOrdersResponse {
*/
private String specification;
private String specificationName;
private String specificationForeignName;
private String unit;
/**
* 商品扩展字段 保存为
*/
private String addInfo;
private String foreignAddInfo;
/**
* 商品属性
*/
private String productProperty;
private String productForeignProperty;
/**
* 数据库字段(保存套餐商品是否为固定商品)
......
......@@ -1314,7 +1314,7 @@ public class OrderCenterSdkServiceImpl implements OrderCenterSdkService {
public OrderDetailResponse updateOrderItem(AssortmentSdkUpdateOrderProductInfoRequest updateOrderProductInfoRequest) {
QueryOrderByIdResponse queryOrderByIdResponse = null;
/**
* 若先清除再更新先清除现有订单商品信息
* 若先清除再更新 先清除现有订单商品信息
*/
if (AssortmentSdkUpdateOrderProductInfoRequest.OpUpdateOrderItemEnum.deleteAndUpdate == updateOrderProductInfoRequest.getOpUpdateOrderItemEnum()) {
this.orderSdkService.clearGroupOrder(this.orderSdkAdapter.convertAssortmentSdkUpdateOrderProductInfoRequestTo(updateOrderProductInfoRequest), updateOrderProductInfoRequest.getTrackingNo());
......
......@@ -11,6 +11,7 @@
<artifactId>assortment-shoppingcart-sdk</artifactId>
<version>1.2.5.RELEASE</version>
<version>2.0.30-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -40,7 +41,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>productcenter-sdk</artifactId>
<version>3.7.6-SNAPSHOT</version>
<version>4.0.4.SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
......@@ -57,7 +58,7 @@
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<version>2.6.1-SNAPSHOT</version>
<version>3.3.12-SNAPSHOT</version>
<artifactId>storecenter-sdk</artifactId>
<scope>provided</scope>
</dependency>
......
......@@ -40,6 +40,7 @@ import java.util.stream.Collectors;
public class ShoppingCartAdapter {
private static final String ATTRIBUTEID = "attributeId";
private static final String ATTRIBUTENAME = "attributeName";
private static final String ATTRIBUTEFOREIGNNAME = "attributeForeignName";
public GetProductInfoRequest convertGetProductInfoRequest(String partnerId, String storeId, List<String> goodsIds, String trackingNo) {
GetProductInfoRequest request = new GetProductInfoRequest();
......@@ -89,6 +90,7 @@ public class ShoppingCartAdapter {
ProductAttributeValueType productAttributeValueType = new ProductAttributeValueType();
productAttributeValueType.setAttributeId(cartGoodsExtra.getAttributeId());
productAttributeValueType.setAttributeValue(cartGoodsExtra.getAttributeName());
productAttributeValueType.setForeignAttributeValue(cartGoodsExtra.getAttributeForeignName());
attributeValueTypes.add(productAttributeValueType);
}
}
......@@ -280,8 +282,12 @@ public class ShoppingCartAdapter {
if(!"早餐啡常搭".equals(cartGoods.getName()) && !"早餐啡常搭".equals(cartGoods.getSkuName()) && !"早餐啡常搭".equals(cartGoods.getSpuName())
&& !"啡常搭".equals(cartGoods.getName()) && !"啡常搭".equals(cartGoods.getSkuName()) && !"啡常搭".equals(cartGoods.getSpuName())) {
cartGoods.setName(spuProduct.getName());
cartGoods.setForeignName(spuProduct.getForeignName());
cartGoods.setSpuName(spuProduct.getName());
cartGoods.setSpuForeignName(spuProduct.getForeignName());
cartGoods.setSkuName(isSkuProduct ? skuProduct.getProductName() : spuProduct.getName());
cartGoods.setSkuForeignName(isSkuProduct ? skuProduct.getForeignProductName() : spuProduct.getForeignName());
}
cartGoods.setSpecProductId(attributes.get(ATTRIBUTEID));
cartGoods.setPic(spuProduct.getPicture());
......@@ -292,17 +298,29 @@ public class ShoppingCartAdapter {
cartGoods.setMemberDiscount(spuProduct.getMemberDiscountResult());
cartGoods.setClassificationId(spuProduct.getCategory());
cartGoods.setClassificationName(spuProduct.getCategoryName());
cartGoods.setClassificationForeignName(spuProduct.getCategoryName());
cartGoods.setTax(spuProduct.getTax());
cartGoods.setTaxId(spuProduct.getTaxId());
String skuSpecName = "";
String skuForeignSpecName = "";
if (isSkuProduct && CollectionUtils.isNotEmpty(skuProduct.getSkuSpecValues())) {
List<String> skuSpecValus = skuProduct.getSkuSpecValues().stream().map(p -> p.getSpecValue()).collect(Collectors.toList());
skuSpecName = StringUtils.join(skuSpecValus, "/");
}
if (isSkuProduct && CollectionUtils.isNotEmpty(skuProduct.getSkuSpecValues())) {
List<String> skuSpecValus = skuProduct.getSkuSpecValues().stream().map(p -> p.getForeignSpecValue()).collect(Collectors.toList());
skuForeignSpecName = StringUtils.join(skuSpecValus, "/");
}
String attributeName = attributes.get(ATTRIBUTENAME) == null ? "" : attributes.get(ATTRIBUTENAME);
String attributeForeignName = attributes.get(ATTRIBUTEFOREIGNNAME) == null ? "" : attributes.get(ATTRIBUTEFOREIGNNAME);
//购物车小标题
cartGoods.setSubName(StringUtils.isNotEmpty(skuSpecName) && StringUtils.isNotEmpty(attributeName) ?
skuSpecName + "/" + attributeName : skuSpecName + attributeName);
//购物车英文小标题
cartGoods.setSubForeignName(StringUtils.isNotEmpty(skuForeignSpecName) && StringUtils.isNotEmpty(attributeForeignName) ?
skuForeignSpecName + "/" + attributeForeignName : skuForeignSpecName + attributeForeignName);
if (isSetMealProduct) {
if (CollectionUtils.isNotEmpty(cartGoods.getProductComboList())) {
......@@ -383,6 +401,7 @@ public class ShoppingCartAdapter {
CartGoods.MaterialGoods material = new CartGoods.MaterialGoods();
material.setQty(materialGoods.getQty());
material.setSpuName(detail.getProductName());
material.setSpuForeignName(detail.getForeignProductName());
material.setSpuId(detail.getProductId());
//行单价 \ 行总价
material.setFinalPrice(detail.getProductFinalPrice().longValue());
......@@ -479,9 +498,13 @@ public class ShoppingCartAdapter {
// 设置商品详情
Map<String, String> attributes = getAttributesNew(comboxGoods.getExtra());
comboxGoods.setName(isComboxGoods ? productComboType.getProductName() : groupDetailType.getProductName());
comboxGoods.setForeignName(isComboxGoods ? productComboType.getForeignProductName() : groupDetailType.getForeignProductName());
comboxGoods.setSpuName(comboxGoods.getName());
comboxGoods.setSpuForeignName(comboxGoods.getForeignName());
comboxGoods.setSpecProductId(attributes.get(ATTRIBUTEID));
comboxGoods.setSubName(attributes.get(ATTRIBUTENAME));
comboxGoods.setSubForeignName(attributes.get(ATTRIBUTEFOREIGNNAME));
comboxGoods.setPic(isComboxGoods ? productComboType.getPicture() : groupDetailType.getPicture());
comboxGoods.setOriginalPrice(isComboxGoods ? productComboType.getFinalPrice().longValue() : groupDetailType.getProductFinalPrice().longValue());
comboxGoods.setOriginalAmount(comboxGoods.getOriginalPrice() * comboxGoods.getQty());
......@@ -537,9 +560,11 @@ public class ShoppingCartAdapter {
}
List<String> attributeIds = extra.stream().map(CartGoods.CartGoodsExtra::getAttributeId).collect(Collectors.toList());
List<String> attributeNames = extra.stream().map(CartGoods.CartGoodsExtra::getAttributeName).collect(Collectors.toList());
List<String> attributeForeignNames = extra.stream().map(CartGoods.CartGoodsExtra::getAttributeForeignName).collect(Collectors.toList());
Map<String, String> result = new HashMap<>();
result.put(ATTRIBUTEID, StringUtils.join(attributeIds, "/"));
result.put(ATTRIBUTENAME, StringUtils.join(attributeNames, "/"));
result.put(ATTRIBUTEFOREIGNNAME, StringUtils.join(attributeForeignNames, "/"));
return result;
}
......
......@@ -73,11 +73,6 @@ public class CartGoods {
* 单位
*/
private String unit;
/**
* 商品券code
*/
private String couponCode;
/**
* 是否是月享卡商品
*/
......@@ -91,6 +86,10 @@ public class CartGoods {
*/
private int isSunnyCoupon;
/**
* 商品券code
*/
private String couponCode;
/**
* 商品券门槛金额
*/
private Long couponThresholdAmount;
......@@ -102,6 +101,12 @@ public class CartGoods {
* 商品券名称
*/
private String couponName;
/**
* 购物车商品券商品价格
*/
private Long couponProductPrice;
private String spuId;
private String skuId;
/**
......@@ -146,9 +151,18 @@ public class CartGoods {
private String name;
/**
* 购物车一行商品英文名称
*/
private String foreignName;
/**
* 商品的spuName
*/
private String spuName;
/**
* 商品的spuForeignName
*/
private String spuForeignName;
/**
* 商品的skuName
......@@ -156,10 +170,19 @@ public class CartGoods {
private String skuName;
/**
* skuForeignName
*/
private String skuForeignName;
/**
* 购物车一行商品的副名称
*/
private String subName;
/**
* 购物车一行商品的英文副名称
*/
private String subForeignName;
/**
* 商品图片URL
*/
private String pic;
......@@ -198,6 +221,7 @@ public class CartGoods {
* 统计分类名称
*/
private String classificationName;
private String classificationForeignName;
/**
* 是否限制库存
* 用于创建订单时,是否扣减库存
......@@ -252,6 +276,8 @@ public class CartGoods {
* 属性名
*/
private String attributeName;
private String attributeForeignName;
}
@Data
......@@ -265,6 +291,8 @@ public class CartGoods {
*/
private String attributeName;
private String attributeForeignName;
/**
* 麦咖啡特定属性入机code
*/
......@@ -297,6 +325,7 @@ public class CartGoods {
private String spuId;
private String skuId;
private String skuName;
private String skuForeignName;
/**
* 所有属性attributeId的拼接
*/
......@@ -337,15 +366,17 @@ public class CartGoods {
* 购物车一行商品的名称
*/
private String name;
private String foreignName;
/**
* 商品的spuName
*/
private String spuName;
private String spuForeignName;
/**
* 购物车一行商品的副名称
*/
private String subName;
private String subForeignName;
/**
* 商品图片URL
*/
......@@ -432,6 +463,7 @@ public class CartGoods {
* 加料名称
*/
private String spuName;
private String spuForeignName;
/**
* 购物车一行商品的现单价
*/
......
......@@ -47,11 +47,12 @@
<groupId>cn.freemud</groupId>
<artifactId>assortment-ordercenter-sdk</artifactId>
<version>2.1.39-RELEASE</version>
<version>2.2.69-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>productcenter-sdk</artifactId>
<version>2.8.4-SNAPSHOT</version>
<version>4.0.2.SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>membercenter-sdk</artifactId>
......@@ -93,7 +94,7 @@
<!-- 商户门店sdk -->
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<version>3.2.6.RELEASE</version>
<version>3.3.12-SNAPSHOT</version>
<artifactId>storecenter-sdk</artifactId>
</dependency>
<dependency>
......@@ -125,7 +126,7 @@
<dependency>
<artifactId>assortment-data-manager</artifactId>
<groupId>com.freemud.sdk.api.assortment</groupId>
<version>5.2.7.RELEASE</version>
<version>5.4.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.freemud.commons</groupId>
......
......@@ -654,6 +654,7 @@ public class OrderAdapter {
createOrderDto.setShopId(createOrderVo.getShopId());
createOrderDto.setThirdShopId(createOrderVo.getThirdShopId());
createOrderDto.setShopName(createOrderVo.getStoreName());
createOrderDto.setShopNameEn(createOrderVo.getStoreNameEn());
createOrderDto.setUserId(createOrderVo.getUserId());
createOrderDto.setUserName(createOrderVo.getUserName());
createOrderDto.setPhone(createOrderVo.getMobile());
......@@ -1103,6 +1104,7 @@ public class OrderAdapter {
responseVo.setOid(ordersBean.getOid());
responseVo.setShopId(ordersBean.getShopId());
responseVo.setShopName(ordersBean.getShopName());
responseVo.setShopNameEn(ordersBean.getShopNameEn());
responseVo.setShopAddress(ordersBean.getShopAddress());
responseVo.setShopPhone(ordersBean.getShopPhone());
responseVo.setReceiveAddress(ordersBean.getAddress());
......@@ -2066,28 +2068,37 @@ public class OrderAdapter {
productVo.setId(productBean.getId());
productVo.setPid(StringUtils.isBlank(productBean.getSpecification()) ? productBean.getProductId() : productBean.getSpecification());
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);
if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) {
String attr = "";
String attrEng = "";
for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) {
attr = special.getAttributeName();
attrEng = special.getAttributeForeignName();
break;
}
}
if(attr.length() > 0) {
productName += "("+attr+")";
}
//英文名处理
if(attrEng.length() > 0) {
foreignProductName += "("+attrEng+")";
}
}
if(CollectionUtils.isNotEmpty(productBean.getMaterialProduct())) {
for (QueryOrdersResponse.DataBean.OrderBean.ProductBean material : productBean.getMaterialProduct()) {
productName += "/"+material.getSpecificationName();
foreignProductName += "/"+material.getSpecificationForeignName();
}
}
productVo.setName(productName);
productVo.setSpuName(productBean.getProductName());
productVo.setForeignName(foreignProductName);
productVo.setSpuForeignName(productBean.getProductForeignName());
productVo.setPicture(productBean.getPicture());
productVo.setSequence(productBean.getSequence());
productVo.setQty(productBean.getNumber());
......@@ -2129,6 +2140,8 @@ public class OrderAdapter {
productVo.setOriginalPrice(productBean.getPrice());
productVo.setFinalPrice(productBean.getSalePrice());
productVo.setExtras(shoppingCartAdapter.getExtraName(productBean.getSpecificationName(), attributeNames));
productVo.setForeignExtras(shoppingCartAdapter.getForeignExtras(productBean.getSpecificationForeignName(), productBean.getProductForeignProperty()));
productVo.setAttributeNamesEn(productBean.getProductForeignProperty());
//计算商品原总金额=商品原价格 * 商品数量
Long originalTotalAmount = productBean.getPrice() * productBean.getNumber();
if(ProductTypeEnum.WEIGHT_PRODUCT.getCode().equals(productBean.getProductType())){
......@@ -2408,8 +2421,6 @@ public class OrderAdapter {
});
createOrderProductDemoDto.setMaterialProduct(materialProducts);
}
createOrderProductDemoDto.setProductType(cartGoodsDetailDto.getProductType());
return createOrderProductDemoDto;
}
......@@ -2490,8 +2501,10 @@ public class OrderAdapter {
CreateOrderProductRequest createOrderProductDemoDto = new CreateOrderProductRequest();
createOrderProductDemoDto.setProductId(StringUtils.isNotBlank(cartGoodsDetailDto.getSpuId()) ? cartGoodsDetailDto.getSpuId() : cartGoodsDetailDto.getSkuId());
createOrderProductDemoDto.setProductName(cartGoodsDetailDto.getSpuName());
createOrderProductDemoDto.setProductForeignName(cartGoodsDetailDto.getSpuForeignName());
createOrderProductDemoDto.setSpecification(cartGoodsDetailDto.getSkuId());
createOrderProductDemoDto.setSpecificationName(cartGoodsDetailDto.getSkuName());
createOrderProductDemoDto.setSpecificationForeignName(cartGoodsDetailDto.getSkuForeignName());
createOrderProductDemoDto.setPrice(cartGoodsDetailDto.getOriginalPrice());
createOrderProductDemoDto.setSalePrice(cartGoodsDetailDto.getOriginalPrice());
createOrderProductDemoDto.setTotalDiscountAmount(cartGoodsDetailDto.getTotalDiscountAmount() == null ? 0 : cartGoodsDetailDto.getTotalDiscountAmount().longValue());
......@@ -2559,7 +2572,7 @@ public class OrderAdapter {
if(CollectionUtils.isNotEmpty(cartGoodsDetailDto.getSpecialExtra())) {
createOrderProductDemoDto.setSpecialAttrs(new ArrayList<>());
cartGoodsDetailDto.getSpecialExtra().stream().forEach(o -> {
createOrderProductDemoDto.getSpecialAttrs().add(new OrderSpecialExtraAttrRequest(o.getAttributeId(), o.getAttributeName(), o.getSpecialCode()));
createOrderProductDemoDto.getSpecialAttrs().add(new OrderSpecialExtraAttrRequest(o.getAttributeId(), o.getAttributeName(),o.getAttributeForeignName(), o.getSpecialCode()));
});
}
return createOrderProductDemoDto;
......@@ -3152,6 +3165,8 @@ public class OrderAdapter {
previewOrderInfoVo.setPayStatus(queryOrderResponseVo.getPayStatus());
previewOrderInfoVo.setPayStatusDesc(queryOrderResponseVo.getPayStatusDesc());
previewOrderInfoVo.setShopName(queryOrderResponseVo.getShopName());
previewOrderInfoVo.setShopNameEn(queryOrderResponseVo.getShopNameEn());
previewOrderInfoVo.setFullDiscount(queryOrderResponseVo.getFullDiscountAmount());
previewOrderInfoVo.setCustomerScoreAmount(queryOrderResponseVo.getCustomerScoreAmount());
if (queryOrderResponseVo.getCouponInfo() != null) {
......
......@@ -53,4 +53,26 @@ public class ShoppingCartAdapter {
}
return extraName.toString();
}
public String getForeignExtras(String skuNameEn, String attributeNamesEn) {
if (StringUtils.isBlank(skuNameEn)) {
skuNameEn = "";
}
if (StringUtils.isBlank(attributeNamesEn)) {
attributeNamesEn = "";
}
skuNameEn = skuNameEn.replace("|", "/") + "/" + attributeNamesEn;
String[] names = skuNameEn.split("/");
StringBuilder extraName = new StringBuilder("");
if (names.length >= 2) {
for (int i = 1; i < names.length; i++) {
if (i == names.length - 1) {
extraName.append(names[i]);
} else {
extraName.append(names[i]).append("/");
}
}
}
return extraName.toString();
}
}
......@@ -14,6 +14,8 @@ public class OrderProductAddInfo {
* 属性名称 多糖/冷/常温
*/
private String attributeNames;
private String attributeForeignNames;
/**
* 活动商品集合
*/
......
......@@ -32,6 +32,7 @@ public class ProductGroupDto {
private Long productFinalPrice;
private String productId;
private String productName;
private String productForeignName;
private Long productPrice;
private Integer sequence;
private Integer status;
......
......@@ -40,6 +40,8 @@ public class ProductListDto {
*/
private Long finalPrice;
private String name;
private String foreignName;
/**
* 原始价格 单位分
*/
......@@ -94,6 +96,7 @@ public class ProductListDto {
private Long finalPrice;
private Long originalPrice;
private String productName;
private String productForeignName;
private Integer productType;
private Integer sequence;
private String skuCode;
......@@ -109,6 +112,7 @@ public class ProductListDto {
private Integer sequence;
private String specId;
private String specName;
private String specForeignName;
private String specValue;
private String specValueId;
}
......@@ -121,6 +125,8 @@ public class ProductListDto {
private Integer sequence;
private String specId;
private String specName;
private String specForeignName;
private List<SpecificationGroupBean.SpecValueVo> specValueVos;
@NoArgsConstructor
......@@ -138,6 +144,8 @@ public class ProductListDto {
public static class ProductLabelNameListBean {
private String id;
private String name;
private String foreignName;
private String partnerId;
List<?> productList;
private String storeId;
......@@ -157,6 +165,8 @@ public class ProductListDto {
* 属性名称
*/
private String attributeName;
private String attributeForeignName;
/**
* 属性类型
*/
......
......@@ -14,6 +14,7 @@ public class StoreDeliveryInfoDto {
private String storeId;
private String storeName;
private String storeNameEn;
/**
* 门店是否可配送
*/
......
......@@ -30,6 +30,8 @@ public class AttributeValue {
private String attributeId;
private String attributeValue;
private String attributeForeignValue;
/**
* 属性ID
*/
......
......@@ -23,6 +23,7 @@ public class GroupDetail {
private Long productFinalPrice;
private String productId;
private String productName;
private String productForeignName;
private Long productPrice;
private Integer sequence;
private Integer status;
......
......@@ -29,6 +29,8 @@ public class ProductAttributeGroup {
* 属性名称
*/
private String attributeName;
private String attributeForeignName;
/**
* 属性类型
*/
......
......@@ -19,6 +19,7 @@ public class ActivityDiscountsDto {
private String activityCode;
private String activityName;
private String activityForeignName;
private Integer discountAmount;
private Integer activityType;
private Integer actualActivityGoodsNumber;
......
......@@ -121,10 +121,12 @@ public class ShoppingCartGoodsDto {
* 商品的名称
*/
private String spuName;
private String spuForeignName;
/**
* 如果是单品 skuName=spuName
*/
private String skuName;
private String skuForeignName;
/**
* 商品行原始价格
*/
......@@ -163,6 +165,7 @@ public class ShoppingCartGoodsDto {
* 1.6.0 版本增加 分类名
*/
private String categoryName;
private String categoryForeignName;
/**
* 套餐--父级商品Id
......@@ -191,6 +194,7 @@ public class ShoppingCartGoodsDto {
private String classificationId;
private String classificationName;
private String classificationForeignName;
/**
* 是否限制库存
* 用于创建订单时,是否扣减库存
......@@ -296,6 +300,7 @@ public class ShoppingCartGoodsDto {
* 属性名
*/
private String attributeName;
private String attributeForeignName;
/**
* 入机code
*/
......@@ -308,10 +313,12 @@ public class ShoppingCartGoodsDto {
*/
public String getAttributeNames() {
String extras = "";
String foreignExtras = "";
if (CollectionUtils.isNotEmpty(this.extraList)) {
extras = extraList.stream().map(CartGoodsDetailDto.CartGoodsExtra::getAttributeName).collect(Collectors.joining("/"));
foreignExtras = extraList.stream().map(CartGoodsDetailDto.CartGoodsExtra::getAttributeForeignName).collect(Collectors.joining("/"));
}
return JSON.toJSONString(OrderProductAddInfo.builder().attributeNames(extras).build());
return JSON.toJSONString(OrderProductAddInfo.builder().attributeNames(extras).attributeForeignNames(foreignExtras).build());
}
}
......
......@@ -66,6 +66,8 @@ public class CreateOrderVo {
private String storeName;
private String storeNameEn;
//入参不需要传
private String storeAddress;
......@@ -319,6 +321,8 @@ public class CreateOrderVo {
@NotNull(message = "商品名称不能为空")
private String skuName;
private String skuForeignName;
@NotNull(message = "商品数量不能为空")
private Integer qty;
......@@ -350,6 +354,9 @@ public class CreateOrderVo {
* 属性名称
*/
private String attributeValue;
private String attributeForeignValue;
}
}
......@@ -390,6 +397,9 @@ public class CreateOrderVo {
*/
private String goodsName;
private String goodsForeignName;
/**
* 赠送商品数量
*/
......
......@@ -39,12 +39,22 @@ public class ProductVo {
* 商品名称
*/
private String name;
/**
* 商品名称
*/
private String foreignName;
/**
* 商品spu名称
*/
private String spuName;
/**
* 商品spu名称
*/
private String spuForeignName;
/**
* 加购人ID
*/
private String userId;
......@@ -73,6 +83,9 @@ public class ProductVo {
* 商品的规格信息加属性信息
*/
private String extras;
private String foreignExtras;
/**
* 标准价格 精确到分
*/
......@@ -139,6 +152,11 @@ public class ProductVo {
* 属性名称 订单详情展示 V1.5.2版本增加
*/
private String attributeNames;
/**
* 属性名称英文
*/
private String attributeNamesEn;
/**
* 是否包含商品券 V1.5.2版本增加
*/
......
......@@ -37,6 +37,8 @@ public class QueryOrderResponseVo {
private String shopName;
private String shopNameEn;
private String shopAddress;
private String shopPhone;
......
......@@ -86,6 +86,8 @@ public class PreviewOrderInfoVo {
*/
private String shopName;
private String shopNameEn;
private List<PromotionMessageDto> promotionMessages;
/**
......
......@@ -43,6 +43,7 @@ import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformIapp
import com.freemud.api.assortment.datamanager.manager.AssortmentOpenPlatformPartnerStoreDeliveryConfigManager;
import com.freemud.api.assortment.datamanager.manager.customer.AssortmentCustomerInfoManager;
import com.freemud.application.sdk.api.base.BaseResponse;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.membercenter.request.QueryReceiveAddressRequest;
import com.freemud.application.sdk.api.membercenter.request.StatisticalPropertyRequest;
......@@ -204,6 +205,7 @@ public class CheckOrder {
createOrderVo.setStoreName(storeResponseDto.getStoreName());
createOrderVo.setStoreAddress(storeResponseDto.getAddress());
createOrderVo.setThirdShopId(storeResponseDto.getThirdPartCode());
createOrderVo.setStoreNameEn(storeResponseDto.getStoreNameEn());
return storeResponseDto;
}
......@@ -623,6 +625,8 @@ public class CheckOrder {
if (this.isCollageOrder(createOrderVo)) {
apportionResponse = shoppingCartClient.getCollageShoppingCartGoodsApportion(requestDto);
} else {
log.info(JSONObject.toJSON(requestDto));
apportionResponse = shoppingCartClient.getShoppingCartGoodsApportionNew(requestDto);
}
......@@ -723,6 +727,7 @@ public class CheckOrder {
storeDeliveryInfoDto.setPartnerId(storeResponseDto.getPartnerId());
storeDeliveryInfoDto.setStoreId(storeResponseDto.getStoreCode());
storeDeliveryInfoDto.setStoreName(storeResponseDto.getStoreName());
storeDeliveryInfoDto.setStoreNameEn(storeResponseDto.getStoreNameEn());
// 查询外卖配送信息
AssortmentOpenPlatformPartnerStoreDeliveryConfig deliveryConfig = deliveryConfigManager.findByPartnerIdAndStoreCode(storeResponseDto.getPartnerId(),
storeResponseDto.getStoreCode());
......
......@@ -59,6 +59,7 @@ import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import com.freemud.sdk.api.assortment.order.service.OrderCenterSdkService;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils;
......@@ -82,6 +83,7 @@ import java.util.stream.Collectors;
* @Copyright: ${DATE.YARE} www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Slf4j
@Service
public class EncircleOrderServiceImpl implements EncircleOrderService {
......@@ -142,10 +144,14 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
storeTableListRequest.setStoreCode(createOrderVo.getShopId());
storeTableListRequest.setTableCode(assortmentCustomerInfoVo.getTableNumber());
com.freemud.application.sdk.api.base.BaseResponse<GetStoreTableResponse> storeTable = storeCenterService.getStoreTable(storeTableListRequest,LogThreadLocal.getTrackingNo());
//activeFlag 是否有效 0无效 1有效
//orderState 点餐状态 1开台 2清台
if(ObjectUtils.notEqual(ResponseResult.SUCCESS.getCode(),storeTable.getCode()) || storeTable.getData() == null) return ResponseUtil.error(ResponseResult.STORE_NOT_TABLE_INFO);
if(storeTable.getData().getActiveFlag() == 0) return ResponseUtil.error(ResponseResult.QUERY_TABLESTATUS_ACTIVEFLAG_ERROR);
if(storeTable.getData().getOrderState() == 1) return ResponseUtil.success();
if(storeTable.getData().getOrderState() == 1) {
log.info("门店返回1,已开台");
return ResponseUtil.success();
}
/**
* 尝试获取Redis锁 ==>获取锁失败直接提示用户有人正在开台或桌号已被占用
* 锁过期时间 24小时
......@@ -203,7 +209,7 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
throw e;
}finally {
//释放锁
RedisLock.getInstance(redisTemplate).unlock(orderCommonService.redisLockInfo(assortmentCustomerInfoVo,RedisCacheEnum.CREATERESERVEORDER_LOCKKEY_PREFIX));
redisTemplate.delete(orderCommonService.redisLockInfo(assortmentCustomerInfoVo,RedisCacheEnum.CREATERESERVEORDER_LOCKKEY_PREFIX));
}
/**
* 开台成功
......@@ -222,6 +228,7 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
groupCreateOrderRequest.setCompanyId(assortmentCustomerInfoVo.getPartnerId());
groupCreateOrderRequest.setShopId(assortmentCustomerInfoVo.getStoreId());
groupCreateOrderRequest.setShopName(storeResponseDto.getStoreName());
groupCreateOrderRequest.setShopNameEn(storeResponseDto.getStoreNameEn());
groupCreateOrderRequest.setBarCounter(assortmentCustomerInfoVo.getTableNumber());
groupCreateOrderRequest.setOrderClient(OrderClientType.WAI_MEAL.getIndex()); //默认围餐
//开台不存用户信息
......@@ -332,7 +339,7 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
throw new ServiceException(ResponseResult.UPDATE_ORDER_INFO_ERROR);
}finally {
//释放锁
RedisLock.getInstance(redisTemplate).unlock(orderCommonService.redisLockInfo(assortmentCustomerInfoVo,RedisCacheEnum.ORDER_PLUS_DISH_LOCKKEY_PREFIX));
redisTemplate.delete(orderCommonService.redisLockInfo(assortmentCustomerInfoVo,RedisCacheEnum.ORDER_PLUS_DISH_LOCKKEY_PREFIX));
try {
ShoppingCartBaseResponse cartBaseResponse = shoppingCartClient.clearShoppingCart(shoppingCartClearDto);
if(cartBaseResponse == null || ObjectUtils.notEqual(cartBaseResponse.getCode(),RESPONSE_SUCCESS_CODE)){
......@@ -579,7 +586,7 @@ public class EncircleOrderServiceImpl implements EncircleOrderService {
throw new ServiceException(ResponseResult.PAY_BACKEND_CONFIG_ERROR);
}finally {
//释放锁
RedisLock.getInstance(redisTemplate).unlock(orderCommonService.redisLockInfo(assortmentCustomerInfoVo,RedisCacheEnum.CREATE_PRE_PAYMENTORDER_LOCKKEY_PREFIX));
redisTemplate.delete(orderCommonService.redisLockInfo(assortmentCustomerInfoVo,RedisCacheEnum.CREATE_PRE_PAYMENTORDER_LOCKKEY_PREFIX));
if(orderResponseVo != null && Objects.equals(orderResponseVo.getPaySuccess(), false) && updateDiscountApportion) {
//记录订单支付状态,防止用户在唤起支付后继续下单,同时也防止重复进行促销计算
mealCacheManager.setOrderCreatePreParmentLock(assortmentCustomerInfoVo.getPartnerId(),assortmentCustomerInfoVo.getStoreId(),assortmentCustomerInfoVo.getTableNumber());
......
......@@ -9,6 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.3.41.RELEASE</version>
<version>1.9.6-SNAPSHOT</version>
<artifactId>ordercenter-sdk</artifactId>
<dependencies>
......
......@@ -40,6 +40,9 @@ public class GroupCreateOrderRequest {
//门店名
private String storeName;
//英文门店名
private String storeNameEn;
//商户名
private String partnerName;
......
......@@ -22,4 +22,7 @@ public class OrderExtendedReq {
//渠道分组编号
private String orderClientGroupCode;
//订单门店英文名称
private String storeNameEn;
}
......@@ -39,6 +39,8 @@ public class CreateOrderRequest extends BaseRequest {
//门店名
private String storeName;
//门店名
private String storeNameEn;
//门店全局唯一编号
private String storeUnifyId;
......@@ -193,6 +195,7 @@ public class CreateOrderRequest extends BaseRequest {
//订单商品信息
List<OrderItemCreateReq> orderItemList;
//订单费用信息
List<OrderCostCreateReq> orderCostDetailList;
......
......@@ -45,6 +45,9 @@ public class OrderItemCreateReq {
//商品名称
private String productName;
/**商品英文名**/
private String productForeignName;
//商品序号
private Integer productSeq;
......@@ -54,6 +57,8 @@ public class OrderItemCreateReq {
//商品规格名称
private String productSpecName;
private String productForeignSpecName;
//商品UPC码
private String productUpc;
......@@ -81,6 +86,9 @@ public class OrderItemCreateReq {
//商品属性
private String productProperty;
//商品英文属性
private String productForeignProperty;
//重量
private Double weight;
......
......@@ -88,6 +88,9 @@ public class OrderInfoReqs {
//门店名
private String storeName;
//门店英文名
private String storeNameEn;
//门店全局唯一编号
private String storeUnifyId;
......
......@@ -46,6 +46,9 @@ public class OrderItemResp {
//商品名称
private String productName;
//商品英文名称
private String productForeignName;
//商品序号
private Integer productSeq;
......@@ -54,6 +57,9 @@ public class OrderItemResp {
//商品规格名称
private String productSpecName;
//商品规格英文名称
private String productForeignSpecName;
//商品UPC码
private String productUpc;
......@@ -82,6 +88,9 @@ public class OrderItemResp {
//商品属性
private String productProperty;
//商品属性
private String productForeignProperty;
//重量
private BigDecimal weight;
......
......@@ -705,6 +705,7 @@ public class OrderSdkService {
* @return
*/
public QueryByCodeResponse updateGroupOrder(GroupOrderUpdateReq groupOrderAffirmReq, String trackingNo){
log.info(JSONArray.toJSONString(groupOrderAffirmReq));
QueryByCodeResponse queryByCodeResponse = RequestThirdPartyUtils.httpJsonReqComplexNew(this.restTemplate, InterfaceAddressConstant.GROUP_UPDATEORDER, createBaseRequest(groupOrderAffirmReq, trackingNo), new ParameterizedTypeReference<QueryByCodeResponse>() {});
return queryByCodeResponse;
}
......@@ -716,7 +717,7 @@ public class OrderSdkService {
* @return
*/
public BaseResponse<PaySuccessResp> clearGroupOrder(GroupOrderClearReq groupOrderAffirmReq,String trackingNo){
StringBuilder urlString = new StringBuilder(InterfaceAddressConstant.GROUP_CLEARITEMS);
StringBuilder urlString = new StringBuilder(InterfaceAddressConstant.GROUP_CLEARITEMS);
urlString.append("?");
if(StringUtils.isNotEmpty(groupOrderAffirmReq.getOrderCode())){
urlString.append("&orderCode=")
......
......@@ -35,7 +35,7 @@
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<artifactId>productcenter-sdk</artifactId>
<version>3.7.6-SNAPSHOT</version>
<version>4.0.4.SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......@@ -45,13 +45,14 @@
<dependency>
<groupId>cn.freemud</groupId>
<artifactId>assortment-shoppingcart-sdk</artifactId>
<version>2.0.30-SNAPSHOT</version>
<version>1.2.5.RELEASE</version>
</dependency>
<!-- 再来一单查询订单信息 -->
<dependency>
<groupId>cn.freemud</groupId>
<artifactId>ordercenter-sdk</artifactId>
<version>1.3.28.RELEASE</version>
<version>1.9.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
......@@ -61,11 +62,11 @@
<dependency>
<artifactId>assortment-data-manager</artifactId>
<groupId>com.freemud.sdk.api.assortment</groupId>
<version>4.6.8.RELEASE</version>
<version>5.4.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.freemud.application.service.sdk</groupId>
<version>2.10.RELEASE</version>
<version>3.3.12-SNAPSHOT</version>
<artifactId>storecenter-sdk</artifactId>
</dependency>
......
......@@ -99,8 +99,10 @@ public class ShoppingCartConvertAdapter {
cartGoodsDetailDto.setTax(cartGoods.getTax());
cartGoodsDetailDto.setSpuId(cartGoods.getSpuId());
cartGoodsDetailDto.setSpuName(cartGoods.getSpuName());
cartGoodsDetailDto.setSpuForeignName(cartGoods.getSpuForeignName());
cartGoodsDetailDto.setSkuId(StringUtils.isEmpty(cartGoods.getSkuId()) ? cartGoods.getSpuId() : cartGoods.getSkuId());
cartGoodsDetailDto.setSkuName(StringUtils.isEmpty(cartGoods.getSkuName()) ? cartGoods.getSpuName() : cartGoods.getSkuName());
cartGoodsDetailDto.setSkuForeignName(StringUtils.isEmpty(cartGoods.getSkuForeignName()) ? cartGoods.getSpuForeignName() : cartGoods.getSkuForeignName());
cartGoodsDetailDto.setOriginalPrice(cartGoods.getOriginalPrice());
// cartGoodsDetailDto.setTotalDiscountAmount(0);
cartGoodsDetailDto.setUserId(cartGoods.getUserId());
......@@ -140,6 +142,7 @@ public class ShoppingCartConvertAdapter {
ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods goods = new ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods();
goods.setSpuId(materialGoods.getSpuId());
goods.setSpuName(materialGoods.getSpuName());
goods.setSpuForeignName(materialGoods.getSpuForeignName());
goods.setOriginalPrice(materialGoods.getOriginalPrice());
goods.setSalePrice(materialGoods.getFinalPrice());
goods.setCustomerCode(materialGoods.getCustomerCode());
......
......@@ -10,7 +10,9 @@ public class CheckSpqInfoResponseDto {
private String spuId;
private String skuId;
private String spuName;
private String spuForeignName;
private String skuName;
private String skuForeignName;
/**
* 活动名称
*/
......@@ -32,6 +34,7 @@ public class CheckSpqInfoResponseDto {
private String picture;
private String defaultSpecId;
private String defaultSpecName;
private String defaultForeignSpecName;
/**
* 券商品类型 : 0 -> 商品券,4,换购券
*/
......
......@@ -143,6 +143,7 @@ public class GetMenuResponseDto {
*/
private Integer isSkuProduct;
private String name;
private String foreignName;
/**
* 原始价格 单位分
*/
......@@ -153,6 +154,7 @@ public class GetMenuResponseDto {
private Long packPrice;
private String picture;
private Double weight;
private String pid;
private Integer pknumber;
private String productionLocation;
......@@ -200,6 +202,7 @@ public class GetMenuResponseDto {
private Long finalPrice;
private Long originalPrice;
private String productName;
private String foreignProductName;
private Integer productType;
private Integer sequence;
private String skuCode;
......@@ -220,7 +223,9 @@ public class GetMenuResponseDto {
private Integer sequence;
private String specId;
private String specName;
private String foreignSpecName;
private String specValue;
private String foreignSpecValue;
private String specValueId;
}
}
......@@ -232,6 +237,7 @@ public class GetMenuResponseDto {
private Integer sequence;
private String specId;
private String specName;
private String foreignSpecName;
private List<SpecValueVo> specValueVos;
@NoArgsConstructor
......@@ -240,6 +246,7 @@ public class GetMenuResponseDto {
private Integer sequence;
private String specId;
private String specValue;
private String foreignSpecValue;
private String specValueId;
}
}
......@@ -249,6 +256,7 @@ public class GetMenuResponseDto {
public static class ProductLabelNameListBean {
private String id;
private String name;
private String foreignName;
private String partnerId;
List<?> productList;
private String storeId;
......@@ -268,6 +276,10 @@ public class GetMenuResponseDto {
* 属性名称
*/
private String attributeName;
private String foreignAttributeName;
/**
* 属性类型
*/
......@@ -293,6 +305,8 @@ public class GetMenuResponseDto {
private String attributeId;
private String attributeValue;
private String foreignAttributeValue;
/**
* 属性ID
*/
......
......@@ -11,6 +11,8 @@ public class OrderProductAddInfo {
* 属性名称 多糖/冷/常温
*/
private String attributeNames;
private String attributeForeignNames;
/**
* 活动商品集合
*/
......
......@@ -158,10 +158,13 @@ public class ShoppingCartGoodsDto {
* 商品的名称
*/
private String spuName;
private String spuForeignName;
/**
* 如果是单品 skuName=spuName
*/
private String skuName;
private String skuForeignName;
/**
* 商品行原始价格(单价)
*/
......@@ -291,6 +294,7 @@ public class ShoppingCartGoodsDto {
*/
private String classificationName;
/**
* 税率代码
*/
......@@ -331,6 +335,7 @@ public class ShoppingCartGoodsDto {
* 属性名
*/
private String attributeName;
private String attributeForeignName;
}
@Data
......@@ -340,6 +345,7 @@ public class ShoppingCartGoodsDto {
*/
private String spuId;
private String spuName;
private String spuForeignName;
/**
* 商品行记录:当前元售价
*/
......@@ -371,10 +377,13 @@ public class ShoppingCartGoodsDto {
*/
public String getAttributeNames() {
String extras = "";
String foreignExtras = "";
if (CollectionUtils.isNotEmpty(this.extraList)) {
extras = extraList.stream().map(CartGoodsDetailDto.CartGoodsExtra::getAttributeName).collect(Collectors.joining("/"));
foreignExtras = extraList.stream().map(CartGoodsDetailDto.CartGoodsExtra::getAttributeForeignName).collect(Collectors.joining("/"));
}
return JSON.toJSONString(OrderProductAddInfo.builder().attributeNames(extras).build());
return JSON.toJSONString(OrderProductAddInfo.builder().attributeNames(extras).attributeForeignNames(foreignExtras).build());
}
}
......
......@@ -141,19 +141,37 @@ public class CartGoods {
private String name;
/**
* 购物车一行商品英文名称
*/
private String foreignName;
/**
* 商品的spuName
*/
private String spuName;
/**
* 商品的spuForeignName
*/
private String spuForeignName;
/**
* 商品的skuName
*/
private String skuName;
/**
* skuForeignName
*/
private String skuForeignName;
/**
* 购物车一行商品的副名称
*/
private String subName;
/**
* 购物车一行商品的英文副名称
*/
private String subForeignName;
/**
* 商品图片URL
*/
......@@ -276,6 +294,7 @@ public class CartGoods {
*/
private String attributeName;
private String attributeForeignName;
}
@Data
......@@ -288,6 +307,8 @@ public class CartGoods {
* 属性名
*/
private String attributeName;
private String attributeForeignName;
/**
* 麦咖啡特定属性入机code
......@@ -304,6 +325,7 @@ public class CartGoods {
private String spuId;
private String skuId;
private String skuName;
private String skuForeignName;
/**
* 所有属性attributeId的拼接
*/
......@@ -346,14 +368,18 @@ public class CartGoods {
*/
private String name;
private String foreignName;
/**
* 商品的spuName
*/
private String spuName;
private String spuForeignName;
/**
* 购物车一行商品的副名称
*/
private String subName;
private String subForeignName;
/**
* 商品图片URL
*/
......@@ -576,6 +602,8 @@ public class CartGoods {
* 加料名称
*/
private String spuName;
private String spuForeignName;
/**
* 购物车一行商品的原单价
*/
......
......@@ -10,11 +10,15 @@ import cn.freemud.entities.vo.ShoppingCartGoodsBaseResponseVo;
import cn.freemud.enums.ResponseResult;
import cn.freemud.interceptor.ServiceException;
import cn.freemud.service.thirdparty.StoreItemClient;
import cn.freemud.service.thirdparty.StoreItemClient;
import cn.freemud.utils.LogUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.constant.ResponseResultEnum;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ApiLog;
import com.freemud.application.sdk.api.log.ErrorLog;
import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.productcenter.domain.ProductBeanDTO;
......@@ -27,6 +31,8 @@ import com.freemud.sdk.api.assortment.shoppingcart.service.impl.ShoppingCartBase
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import cn.freemud.entities.dto.GetMenuResponseDto.DataBean.RootNodeBean.ChildrenBeanFirst.ChildrenBeanSecond.ProductBean;
......
......@@ -92,6 +92,7 @@ import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import cn.freemud.entities.dto.GetMenuResponseDto.DataBean.RootNodeBean.ChildrenBeanFirst.ChildrenBeanSecond.ProductBean;
import static cn.freemud.constant.ApplicationConstant.*;
import static cn.freemud.constant.ShoppingCartConstant.SHOPPING_CART_EMPTY_GOODS_LIST;
import static cn.freemud.constant.ShoppingCartConstant.SHOPPING_CART_INVALIAD_GOODS;
......@@ -310,6 +311,11 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
isMultiCoupon = pair.getValue();
}
}
// // 获取商品详细信息
// List<ProductBeanDTO> productBeanListSpuClass = assortmentSdkService.getProductsInfoSdk(partnerId, storeId
// , Collections.singletonList(spuId2),addShoppingCartGoodsRequestVo.getMenuType(), this.shoppingCartBaseService);
// LogUtil.info("productBeanListSpuClass", spuId2,JSON.toJSONString(productBeanListSpuClass));
// 获取商品详细信息
List<ProductBean> productBeanListSpuClass = assortmentSdkService.getProductsInfo(partnerId, storeId
, Collections.singletonList(spuId2),addShoppingCartGoodsRequestVo.getMenuType(), this.shoppingCartBaseService);
......
......@@ -349,8 +349,11 @@ public class CalculationCommonService {
cartGoodsDetailDto.setTax(cartGoods.getTax());
cartGoodsDetailDto.setSpuId(cartGoods.getSpuId());
cartGoodsDetailDto.setSpuName(cartGoods.getSpuName());
cartGoodsDetailDto.setSpuForeignName(cartGoods.getSpuForeignName());
cartGoodsDetailDto.setSkuId(StringUtils.isEmpty(cartGoods.getSkuId()) ? cartGoods.getSpuId() : cartGoods.getSkuId());
cartGoodsDetailDto.setSkuName(StringUtils.isEmpty(cartGoods.getSkuName()) ? cartGoods.getSpuName() : cartGoods.getSkuName());
cartGoodsDetailDto.setSkuForeignName(StringUtils.isEmpty(cartGoods.getSkuForeignName()) ? cartGoods.getSpuForeignName() : cartGoods.getSkuForeignName());
cartGoodsDetailDto.setOriginalPrice(cartGoods.getOriginalPrice());
cartGoodsDetailDto.setSalePrice(cartGoods.getOriginalPrice());
cartGoodsDetailDto.setPicture(cartGoods.getPic());
......@@ -410,6 +413,7 @@ public class CalculationCommonService {
ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods goods = new ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods();
goods.setSpuId(mg.getSpuId());
goods.setSpuName(mg.getSpuName());
goods.setSpuForeignName(mg.getSpuForeignName());
goods.setSalePrice(mg.getFinalPrice());
goods.setQty(mg.getQty());
goods.setCustomerCode(cartGoods.getCustomerCode());
......@@ -488,8 +492,11 @@ public class CalculationCommonService {
ShoppingCartGoodsDto.CartGoodsDetailDto com = new ShoppingCartGoodsDto.CartGoodsDetailDto();
com.setSpuId(comb.getGoodsId());
com.setSpuName(comb.getSpuName());
com.setSpuForeignName(comb.getSpuForeignName());
com.setSkuId(comb.getGoodsId());
com.setSkuName(StringUtils.isEmpty(comb.getSkuName()) ? com.getSpuName() : com.getSkuName());
com.setSkuForeignName(StringUtils.isEmpty(comb.getSkuForeignName()) ? com.getSpuForeignName() : com.getSkuForeignName());
com.setPicture(comb.getPic());
com.setProductType(comb.isWeightType() ? ProductType.WEIGHT_PRODUCT.getCode() : ProductType.SETMEAL.getCode());
com.setParentProductId(cartGoods.getGoodsId());
......
......@@ -190,8 +190,10 @@ public class CouponSharingService {
cartGoods.setQty(cartGoods.getQty());
cartGoods.setCouponCode(checkSpqInfoResponseDto.getCouponCode());
cartGoods.setSpuName(checkSpqInfoResponseDto.getSpuName());
cartGoods.setSpuForeignName(checkSpqInfoResponseDto.getSpuForeignName());
cartGoods.setSpecProductId(checkSpqInfoResponseDto.getDefaultSpecId());
cartGoods.setSubName(checkSpqInfoResponseDto.getDefaultSpecName());
cartGoods.setSubForeignName(checkSpqInfoResponseDto.getDefaultForeignSpecName());
cartGoods.setExtra(checkSpqInfoResponseDto.getExtras());
if (GoodsTypeEnum.HG_COUPON_GOODS.getGoodsType().equals(cartGoods.getGoodsType())) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods discountGoods = discountResult.getGoods()
......
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