Commit 542ef18e by 刘鹏飞

Merge remote-tracking branch 'origin/qa' into qa

# Conflicts:
#	order-application-service/src/main/java/cn/freemud/adapter/OrderAdapter.java
parents 1e58130a 3f248424
...@@ -1390,6 +1390,7 @@ public class OrderAdapter { ...@@ -1390,6 +1390,7 @@ public class OrderAdapter {
if (enableRefundCodes.contains(ordersBean.getStatus()) && PayStatus.HAVE_PAID.getCode().equals(ordersBean.getPayStatus())) { if (enableRefundCodes.contains(ordersBean.getStatus()) && PayStatus.HAVE_PAID.getCode().equals(ordersBean.getPayStatus())) {
responseVo.setEnableRefund(true); responseVo.setEnableRefund(true);
} }
responseVo.setMarketingType(ordersBean.getMarketingType());
list.add(responseVo); list.add(responseVo);
}); });
return list; return list;
...@@ -2027,6 +2028,7 @@ public class OrderAdapter { ...@@ -2027,6 +2028,7 @@ public class OrderAdapter {
productVos.sort(Comparator.comparing(ProductVo::getSequence)); productVos.sort(Comparator.comparing(ProductVo::getSequence));
responseVo.setProducts(productVos); responseVo.setProducts(productVos);
responseVo.setProductNum(productVos.stream().mapToInt(ProductVo::getQty).sum()); responseVo.setProductNum(productVos.stream().mapToInt(ProductVo::getQty).sum());
responseVo.setOrderUserNum(productVos.stream().filter(product -> StringUtils.isNotEmpty(product.getUserId())).map(ProductVo::getUserId).distinct().count());
} }
} }
...@@ -2061,6 +2063,11 @@ public class OrderAdapter { ...@@ -2061,6 +2063,11 @@ public class OrderAdapter {
productVo.setSequence(productBean.getSequence()); productVo.setSequence(productBean.getSequence());
productVo.setQty(productBean.getNumber()); productVo.setQty(productBean.getNumber());
productVo.setSpecification(""); productVo.setSpecification("");
productVo.setUserId(productBean.getUserId());
productVo.setOpenId(productBean.getOpenId());
productVo.setNickName(productBean.getNickName());
productVo.setPhotoUrl(productBean.getPhotoUrl());
productVo.setPackPrice(productBean.getPackPrice());
List<InventedParentActivityVo> inventedParentActivityVos = new ArrayList<>(); List<InventedParentActivityVo> inventedParentActivityVos = new ArrayList<>();
String attributeNames = ""; String attributeNames = "";
if (StringUtils.isNotBlank(productBean.getAddInfo()) && productBean.getAddInfo().contains("attributeNames")) { if (StringUtils.isNotBlank(productBean.getAddInfo()) && productBean.getAddInfo().contains("attributeNames")) {
...@@ -2453,8 +2460,14 @@ public class OrderAdapter { ...@@ -2453,8 +2460,14 @@ public class OrderAdapter {
createOrderProductDemoDto.setTaxId(cartGoodsDetailDto.getTaxId()); createOrderProductDemoDto.setTaxId(cartGoodsDetailDto.getTaxId());
createOrderProductDemoDto.setClassificationId(cartGoodsDetailDto.getClassificationId()); createOrderProductDemoDto.setClassificationId(cartGoodsDetailDto.getClassificationId());
createOrderProductDemoDto.setClassificationName(cartGoodsDetailDto.getClassificationName()); createOrderProductDemoDto.setClassificationName(cartGoodsDetailDto.getClassificationName());
createOrderProductDemoDto.setUserId(cartGoodsDetailDto.getUserId());
createOrderProductDemoDto.setOpenId(cartGoodsDetailDto.getOpenId());
createOrderProductDemoDto.setNickName(cartGoodsDetailDto.getUserName());
createOrderProductDemoDto.setPhotoUrl(cartGoodsDetailDto.getPhotoUrl());
createOrderProductDemoDto.setPackPrice(cartGoodsDetailDto.getPackPrice());
createOrderProductDemoDto.setCartGoodsUid(cartGoodsDetailDto.getCartGoodsUid()); createOrderProductDemoDto.setCartGoodsUid(cartGoodsDetailDto.getCartGoodsUid());
createOrderProductDemoDto.setOriginalGoodsUid(cartGoodsDetailDto.getOriginalGoodsUid()); createOrderProductDemoDto.setOriginalGoodsUid(cartGoodsDetailDto.getOriginalGoodsUid()
return createOrderProductDemoDto; return createOrderProductDemoDto;
} }
......
...@@ -413,7 +413,7 @@ public class OrderServiceImpl implements Orderservice { ...@@ -413,7 +413,7 @@ public class OrderServiceImpl implements Orderservice {
dto.setPartnerId(partnerId); dto.setPartnerId(partnerId);
dto.setStoreId(storeId); dto.setStoreId(storeId);
dto.setTrackingNo(LogThreadLocal.getTrackingNo()); dto.setTrackingNo(LogThreadLocal.getTrackingNo());
paymentQueueService.paymentCallback(dto); //paymentQueueService.paymentCallback(dto);
} catch (Exception e) { } catch (Exception e) {
log.info("paymentQueueService.paymentCallback" + dto + " error" + e); log.info("paymentQueueService.paymentCallback" + dto + " error" + e);
} }
...@@ -435,7 +435,7 @@ public class OrderServiceImpl implements Orderservice { ...@@ -435,7 +435,7 @@ public class OrderServiceImpl implements Orderservice {
dto.setStoreId(storeId); dto.setStoreId(storeId);
dto.setPayChannelType(payChanelType); dto.setPayChannelType(payChanelType);
dto.setTrackingNo(LogThreadLocal.getTrackingNo()); dto.setTrackingNo(LogThreadLocal.getTrackingNo());
paymentQueueService.paymentCallback(dto); //paymentQueueService.paymentCallback(dto);
} catch (Exception e) { } catch (Exception e) {
log.info("paymentQueueService.paymentCallback" + dto + " error" + e); log.info("paymentQueueService.paymentCallback" + dto + " error" + e);
} }
...@@ -1846,6 +1846,9 @@ public class OrderServiceImpl implements Orderservice { ...@@ -1846,6 +1846,9 @@ public class OrderServiceImpl implements Orderservice {
if (baseResponse != null) { if (baseResponse != null) {
return baseResponse; return baseResponse;
} }
// 删除订单 通知活动添加商品库存
backOrdersStatusChange(orderBean.getOid(), orderBean.getStatus(), orderBean.getPayStatus());
return ResponseUtil.success();
} }
} }
......
...@@ -621,10 +621,10 @@ public class ShoppingCartConvertAdapter { ...@@ -621,10 +621,10 @@ public class ShoppingCartConvertAdapter {
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productCombo : cartGoods.getProductComboList()){ for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productCombo : cartGoods.getProductComboList()){
//套餐子商品多规格商品 //套餐子商品多规格商品
if(productCombo.getSpuId() == null && !productCombo.getSkuId().equals(productCombo.getSpuId()) ){ if(productCombo.getSpuId() == null && !productCombo.getSkuId().equals(productCombo.getSpuId()) ){
updateComboxGoodsInfoForMCoffee(productCombo, spuProduct, true); updateComboxGoodsInfoForMCoffee(productCombo, spuProduct, true,null);
}else { }else {
//套餐子商品为单品 //套餐子商品为单品
updateComboxGoodsInfoForMCoffee(productCombo, spuProduct, true); updateComboxGoodsInfoForMCoffee(productCombo, spuProduct, true,null);
} }
} }
} }
...@@ -634,11 +634,11 @@ public class ShoppingCartConvertAdapter { ...@@ -634,11 +634,11 @@ public class ShoppingCartConvertAdapter {
//套餐子商品多规格商品 //套餐子商品多规格商品
if(comboxGoods.getSpuId() == null && !comboxGoods.getSkuId().equals(comboxGoods.getSpuId()) ){ if(comboxGoods.getSpuId() == null && !comboxGoods.getSkuId().equals(comboxGoods.getSpuId()) ){
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) { for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) {
updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false); updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false,null);
} }
}else { }else {
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) { for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) {
updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false); updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false,null);
} }
} }
} }
...@@ -684,7 +684,8 @@ public class ShoppingCartConvertAdapter { ...@@ -684,7 +684,8 @@ public class ShoppingCartConvertAdapter {
* @param isComboxGoods 是否是固定商品 * @param isComboxGoods 是否是固定商品
* @return * @return
*/ */
private void updateComboxGoodsInfoForMCoffee(com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods comboxGoods, ProductTypeBeanDTO parentProductBean, boolean isComboxGoods) { private void updateComboxGoodsInfoForMCoffee(com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods comboxGoods,
ProductTypeBeanDTO parentProductBean, boolean isComboxGoods,Map<String,ProductTypeBeanDTO> subProductTypeMap) {
if("0".equals(comboxGoods.getGoodsId())){ if("0".equals(comboxGoods.getGoodsId())){
return; return;
} }
...@@ -730,24 +731,7 @@ public class ShoppingCartConvertAdapter { ...@@ -730,24 +731,7 @@ public class ShoppingCartConvertAdapter {
//2020/12/10 套餐内可选商品加料 //2020/12/10 套餐内可选商品加料
if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){ if(CollectionUtils.isNotEmpty(comboxGoods.getProductMaterialList())){
if (CollectionUtils.isNotEmpty(parentProductBean.getAdditionalGroupList())) { resolveMaterialForProductGroup(comboxGoods,subProductTypeMap);
List<ProductTypeBeanDTO.ProductGroupType.GroupDetailType> groupDetail = new ArrayList<>();
for (ProductTypeBeanDTO.ProductGroupType productGroupType : parentProductBean.getAdditionalGroupList()){
groupDetail.addAll(productGroupType.getGroupDetail());
}
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods productMaterial :comboxGoods.getProductMaterialList()){
for (ProductTypeBeanDTO.ProductGroupType.GroupDetailType detailType : groupDetail){
if(detailType.getProductId().equals(productMaterial.getSpuId())){
productMaterial.setSpuId(detailType.getProductId());
productMaterial.setAmount(detailType.getProductFinalPrice().longValue());
productMaterial.setFinalPrice(detailType.getProductFinalPrice().longValue());
productMaterial.setOriginalAmount(detailType.getProductFinalPrice().longValue());
productMaterial.setOriginalPrice(detailType.getProductFinalPrice().longValue());
productMaterial.setSpuName(detailType.getProductName());
}
}
}
}
} }
} }
...@@ -819,6 +803,77 @@ public class ShoppingCartConvertAdapter { ...@@ -819,6 +803,77 @@ public class ShoppingCartConvertAdapter {
cartGoods.setOriginalMaterialAmount(originalMaterAmount); cartGoods.setOriginalMaterialAmount(originalMaterAmount);
} }
/**
* 可选商品组加料处理逻辑
* @param comboxGoods
* @param subProductTypeMap
*/
private void resolveMaterialForProductGroup(com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods comboxGoods, Map<String,ProductTypeBeanDTO> subProductTypeMap){
//可选商品加料信息提取
List<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods> groupProductMaterial = new ArrayList<>();
groupProductMaterial.addAll(comboxGoods.getProductMaterialList());
if (null != subProductTypeMap && !subProductTypeMap.isEmpty()) {
ProductTypeBeanDTO productTypeBeanDTO = subProductTypeMap.get(comboxGoods.getSkuId());
if (CollectionUtils.isNotEmpty(productTypeBeanDTO.getAdditionalGroupList())){
List<String> materialSpu = new ArrayList<>();
HashMap<String, ProductTypeBeanDTO.ProductGroupType.GroupDetailType> materialHash = new HashMap<>();
for (ProductTypeBeanDTO.ProductGroupType productGroupType : productTypeBeanDTO.getAdditionalGroupList()) {
//提取加料信息
List<ProductTypeBeanDTO.ProductGroupType.GroupDetailType> groupDetail = new ArrayList<>();
groupDetail.addAll(productGroupType.getGroupDetail());
for (ProductTypeBeanDTO.ProductGroupType.GroupDetailType groupDetailType : groupDetail) {
materialHash.put(groupDetailType.getProductId(), groupDetailType);
materialSpu.add(groupDetailType.getProductId());
}
}
//加车小料和商品小料没有交集则提示商品信息有异常
if (CollectionUtils.isEmpty(groupProductMaterial.stream().filter(e -> materialSpu.contains(e.getSpuId())).collect(Collectors.toList()))) {
// comboxGoods.setGoodsType(com.freemud.sdk.api.assortment.shoppingcart.constant.GoodsTypeEnum.EXCEPTION_GOODS.getGoodsType());
comboxGoods.setProductMaterialList(new ArrayList<>());
return;
}
ArrayList<com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods> materialGoodsList = new ArrayList<>();
Long materialAmount = 0L;
Long originalMaterAmount = 0L;
String materialSubName = comboxGoods.getSubName();
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods materialGoods : comboxGoods.getProductMaterialList()) {
ProductTypeBeanDTO.ProductGroupType.GroupDetailType detail = materialHash.get(materialGoods.getSpuId());
if (detail == null) continue;
com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods material = new com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.MaterialGoods();
material.setSpuName(detail.getProductName());
material.setSpuId(detail.getProductId());
//行单价 \ 行总价
material.setFinalPrice(detail.getProductFinalPrice().longValue());
material.setAmount(detail.getProductFinalPrice().longValue() * comboxGoods.getQty());
//原行单价*数量
material.setOriginalAmount(detail.getProductFinalPrice().longValue() * comboxGoods.getQty());
material.setOriginalPrice(detail.getProductFinalPrice().longValue());
material.setCustomerCode(materialGoods.getCustomerCode());
materialGoodsList.add(material);
materialAmount += detail.getProductFinalPrice().longValue() * comboxGoods.getQty();
originalMaterAmount += detail.getProductFinalPrice().longValue() * comboxGoods.getQty();
;
materialSubName = materialSubName + "/" + detail.getProductName();
}
//设置购物车行记录
comboxGoods.setProductMaterialList(materialGoodsList);
//加料行记录现价总价
comboxGoods.setMaterialAmount(materialAmount);
//加料行记录原价总价
// comboxGoods.setOriginalMaterialAmount(originalMaterAmount);
}else{
// comboxGoods.setGoodsType(com.freemud.sdk.api.assortment.shoppingcart.constant.GoodsTypeEnum.EXCEPTION_GOODS.getGoodsType());
comboxGoods.setProductMaterialList(new ArrayList<>());
return;
}
}
}
public void updateCartGoodsInfo(com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods cartGoods, ProductTypeBeanDTO spuProduct,Map<String,ProductTypeBeanDTO> subProductTypeMap) { public void updateCartGoodsInfo(com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods cartGoods, ProductTypeBeanDTO spuProduct,Map<String,ProductTypeBeanDTO> subProductTypeMap) {
try { try {
...@@ -866,22 +921,21 @@ public class ShoppingCartConvertAdapter { ...@@ -866,22 +921,21 @@ public class ShoppingCartConvertAdapter {
updateComboxGoodsInfoFor(productCombo, productBeanDTO, true); updateComboxGoodsInfoFor(productCombo, productBeanDTO, true);
}else { }else {
//套餐子商品为单品 //套餐子商品为单品
updateComboxGoodsInfoForMCoffee(productCombo, spuProduct, true); updateComboxGoodsInfoForMCoffee(productCombo, spuProduct, true,null);
} }
} }
} }
//套餐可选商品 //套餐可选商品
if (CollectionUtils.isNotEmpty(cartGoods.getProductGroupList())) { if (CollectionUtils.isNotEmpty(cartGoods.getProductGroupList())) {
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods comboxGoods : cartGoods.getProductGroupList()){ for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods comboxGoods : cartGoods.getProductGroupList()){
ProductTypeBeanDTO productBeanDTO = subProductTypeMap.get(comboxGoods.getSpuId());
//套餐子商品多规格商品 //套餐子商品多规格商品
if(comboxGoods.getSpuId() != null && !comboxGoods.getSkuId().equals(comboxGoods.getSpuId()) ){ if(comboxGoods.getSpuId() != null && !comboxGoods.getSkuId().equals(comboxGoods.getSpuId()) ){
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) { for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) {
updateComboxGoodsInfoForMCoffee(productGroup, productBeanDTO, false); updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false,subProductTypeMap);
} }
}else { }else {
for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) { for (com.freemud.sdk.api.assortment.shoppingcart.domain.CartGoods.ComboxGoods productGroup : cartGoods.getProductGroupList()) {
updateComboxGoodsInfoForMCoffee(productGroup, productBeanDTO, false); updateComboxGoodsInfoForMCoffee(productGroup, spuProduct, false,subProductTypeMap);
} }
} }
} }
......
...@@ -237,13 +237,12 @@ public class BuySendPromotionService implements IPromotionService { ...@@ -237,13 +237,12 @@ public class BuySendPromotionService implements IPromotionService {
} }
if (manyOrSingle) { if (manyOrSingle) {
// 多规格 // 多规格
if (!Objects.equals(sendGoodsMap.get(cartGood.getSkuId()).getGoodsId(), cartGood.getSkuId())) { if (!Objects.equals(sendGoodsMap.get(cartGood.getSkuId()).getOriginalGoodsUid(), cartGood.getCartGoodsUid())) {
return; return;
} }
} else { } else {
// 单品 // 单品
List<String> spuIds = newCartGoodsList.stream().map(CartGoods::getSpuId).collect(Collectors.toList()); if (!Objects.equals(sendGoodsMap.get(cartGood.getSpuId()).getOriginalGoodsUid(), cartGood.getCartGoodsUid())) {
if (spuIds.contains(cartGood.getSpuId())) {
return; return;
} }
} }
......
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