Commit 3e2b4633 by ping.wu

Merge branches 'feature/20211213_保存spu商品货号_wuping' and 'qa' of…

Merge branches 'feature/20211213_保存spu商品货号_wuping' and 'qa' of http://gitlab.freemud.com/order-group-application/order-group into qa

# Conflicts:
#	assortment-ordercenter-sdk/src/main/java/com/freemud/sdk/api/assortment/order/request/order/OrderProductAddInfoDto.java
parents e0eec9e1 05b23181
......@@ -3138,6 +3138,9 @@ public class OrderSdkAdapter {
if (StringUtils.isNotBlank(product.getThirdProductSpecId())) {
extInfo.setThirdProductSpecId(product.getThirdProductSpecId());
}
if (StringUtils.isNotBlank(product.getSpuProductCode())) {
extInfo.setSpuProductCode(product.getSpuProductCode());
}
//第三方商品属性id
if (StringUtils.isNotBlank(product.getThirdProductPropertyId())) {
extInfo.setThirdProductPropertyId(product.getThirdProductPropertyId());
......
......@@ -65,6 +65,9 @@ public class CreateOrderProductRequest extends BaseConfig {
* 商品货号,商品服务可重复
*/
private String productCode;
//多规格商品的spu商品 商品货号,单规格即为单规格商品货号
private String spuProductCode;
/**
* 商品价格 单价分
*/
......
......@@ -129,4 +129,7 @@ public class OrderProductAddInfoDto extends BaseConfig {
* 【订C,“POS编码”让凌顶那边去匹配商品】 https://www.tapd.cn/43862731/prong/stories/view/1143862731001039549
*/
private String linkedId;
//多规格商品的spu商品 商品货号,单规格即为单规格商品货号
private String spuProductCode;
}
......@@ -304,7 +304,11 @@ public class OrderCallBackMQService {
wechatReportOrderDto.setStatus(NewOrderStatus.PENDING_PAYMENT.getIndex().equals(orderInfoReqs.getOrderState()) ? 2 : 1);
// 菜品列表
List<WechatReportOrderDto.DishInfo> dishList = new ArrayList<>();
//【ID1040698】【数据上报】如果是套餐商品,只上报套餐,不上报明细, 解决数据上报商品数量(20)超限制报错
for (OrderItemResp item : orderInfoReqs.getOrderItemList()) {
if(StringUtils.isNotEmpty(item.getParentProductId()) && !"0".equals(item.getParentProductId())){
continue;
}
WechatReportOrderDto.DishInfo dishInfo = new WechatReportOrderDto.DishInfo();
dishInfo.setOutDishNo(item.getProductId());
dishInfo.setCount(item.getProductQuantity());
......@@ -313,6 +317,9 @@ public class OrderCallBackMQService {
dishInfo.setUrl(item.getProductPicUrl());
dishList.add(dishInfo);
}
if(dishList.size() >20){
dishList.subList(0,20);
}
wechatReportOrderDto.setDishList(dishList);
return wechatReportOrderDto;
}
......
......@@ -40,6 +40,9 @@ public class GetProductsVo {
*/
private String productCode;
//多规格商品的spu商品 商品货号,单规格即为单规格商品货号
private String spuProductCode;
/**
* 第三方商品规格编号
*/
......
......@@ -63,6 +63,8 @@ public class ItemServiceImpl implements ItemService{
boolean toPosCustomerCode = productInfosDto.getData().getToPosProductIdType() != null && productInfosDto.getData().getToPosProductIdType() == 1;
productInfosDto.getData().getProducts().forEach(productBean -> {
GetProductsVo spuProductsVo = new GetProductsVo();
spuProductsVo.setSpuProductCode(productBean.getProductCode());
//保存货号到三方商品编号字段
if(toPosCustomerCode){
spuProductsVo.setCustomerCode(productBean.getProductCode());
......@@ -108,6 +110,8 @@ public class ItemServiceImpl implements ItemService{
if (CollectionUtils.isNotEmpty(productBean.getSkuList())) {
for (SkuProduct skuProductBean : productBean.getSkuList()) {
GetProductsVo skuProductsVo = new GetProductsVo();
skuProductsVo.setSpuProductCode(productBean.getProductCode());
//保存货号到三方商品编号字段
if(toPosCustomerCode){
skuProductsVo.setCustomerCode(skuProductBean.getProductCode());
......@@ -146,6 +150,8 @@ public class ItemServiceImpl implements ItemService{
if (CollectionUtils.isNotEmpty(productBean.getProductComboList())) {
for (ProductComboListDto productComboListDto : productBean.getProductComboList()) {
GetProductsVo comboProductsVo = new GetProductsVo();
comboProductsVo.setSpuProductCode(productComboListDto.getProductCode());
//保存货号到三方商品编号字段
if(toPosCustomerCode){
comboProductsVo.setCustomerCode(productComboListDto.getProductCode());
......@@ -192,6 +198,7 @@ public class ItemServiceImpl implements ItemService{
//多规格获取sku信息
GetProductsVo groupProductsVo = new GetProductsVo();
groupProductsVo.setSpuProductCode(groupDetailBean.getProductCode());
//保存货号到三方商品编号字段
if(toPosCustomerCode){
groupProductsVo.setCustomerCode(groupDetailBean.getProductCode());
......
......@@ -2412,6 +2412,7 @@ public class OrderServiceImpl implements Orderservice {
for (CreateOrderProductRequest productDto : createOrderDto.getProducts()) {
String skuId = productDto.getSpecification();
if (products.get(skuId) != null) {
productDto.setSpuProductCode(products.get(skuId).getSpuProductCode());
productDto.setCustomerCode(products.get(skuId).getCustomerCode());
productDto.setProductCode(products.get(skuId).getProductCode());
productDto.setThirdProductSpecId(products.get(productDto.getSpecification()).getThirdProductSpecId());
......@@ -2429,6 +2430,7 @@ public class OrderServiceImpl implements Orderservice {
for (CreateOrderProductRequest comboProduct : productDto.getComboProduct()) {
String comboSkuId = comboProduct.getSpecification();
if (products.get(comboSkuId) != null) {
comboProduct.setSpuProductCode(products.get(comboSkuId).getSpuProductCode());
comboProduct.setCustomerCode(products.get(comboSkuId).getCustomerCode());
comboProduct.setProductCode(products.get(comboSkuId).getProductCode());
comboProduct.setThirdProductSpecId(products.get(comboSkuId).getThirdProductSpecId());
......
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