Commit 8fb323ff by zhiheng.zhang

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

parents 88a433b8 4af9aa0a
...@@ -187,25 +187,25 @@ public class DeliveryAdapter { ...@@ -187,25 +187,25 @@ public class DeliveryAdapter {
ProductInfo deliveryProductInfo = new ProductInfo(); ProductInfo deliveryProductInfo = new ProductInfo();
deliveryProductInfo.setProductCode(productList.getProductId().substring(4)); deliveryProductInfo.setProductCode(productList.getProductId().substring(4));
String productName = StringUtils.isBlank(productList.getSpecificationName()) ? productList.getProductName() : productList.getSpecificationName(); String productName = StringUtils.isBlank(productList.getSpecificationName()) ? productList.getProductName() : productList.getSpecificationName();
String grilling = "";
OrderProductAddInfoDto extInfo = JSON.parseObject(productList.getExtInfo(), OrderProductAddInfoDto.class); OrderProductAddInfoDto extInfo = JSON.parseObject(productList.getExtInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) { if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) {
String attr = "";
for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) { for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) { grilling += special.getAttributeName() + "/";
attr = special.getAttributeName();
break;
}
}
if(attr.length() > 0) {
productName += "("+attr+")";
} }
} }
if(CollectionUtils.isNotEmpty(productList.getMaterialProduct())) { if(CollectionUtils.isNotEmpty(productList.getMaterialProduct())) {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean material : productList.getMaterialProduct()) { for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean material : productList.getMaterialProduct()) {
productName += "/"+material.getSpecificationName(); productName += "/"+material.getSpecificationName();
grilling += material.getSpecificationName() + "/";
} }
} }
if(grilling.length() > 0) {
grilling = grilling.substring(0, grilling.length()-1);
}
deliveryProductInfo.setGrilling(grilling);
deliveryProductInfo.setProductName(productName); deliveryProductInfo.setProductName(productName);
deliveryProductInfo.setProductNumber(productList.getNumber()); deliveryProductInfo.setProductNumber(productList.getNumber());
deliveryProductInfo.setProductPrice(productList.getSalePrice().intValue()); deliveryProductInfo.setProductPrice(productList.getSalePrice().intValue());
...@@ -223,25 +223,26 @@ public class DeliveryAdapter { ...@@ -223,25 +223,26 @@ public class DeliveryAdapter {
ProductInfo deliveryComboProductInfo = new ProductInfo(); ProductInfo deliveryComboProductInfo = new ProductInfo();
deliveryComboProductInfo.setProductCode(comboProduct.getProductId().length()>4?comboProduct.getProductId().substring(4):comboProduct.getProductId()); deliveryComboProductInfo.setProductCode(comboProduct.getProductId().length()>4?comboProduct.getProductId().substring(4):comboProduct.getProductId());
String productNameCombo = StringUtils.isBlank(comboProduct.getSpecificationName()) ? comboProduct.getProductName() : comboProduct.getSpecificationName(); String productNameCombo = StringUtils.isBlank(comboProduct.getSpecificationName()) ? comboProduct.getProductName() : comboProduct.getSpecificationName();
String grillingCombo = "";
OrderProductAddInfoDto extInfoCombo = JSON.parseObject(comboProduct.getExtInfo(), OrderProductAddInfoDto.class); OrderProductAddInfoDto extInfoCombo = JSON.parseObject(comboProduct.getExtInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfoCombo.getSpecialAttrs())) { if(CollectionUtils.isNotEmpty(extInfoCombo.getSpecialAttrs())) {
String attr = ""; String attr = "";
for (OrderSpecialExtraAttrRequest special : extInfoCombo.getSpecialAttrs()) { for (OrderSpecialExtraAttrRequest special : extInfoCombo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) { grillingCombo += special.getAttributeName() + "/";
attr = special.getAttributeName();
break;
}
}
if(attr.length() > 0) {
productNameCombo += "("+attr+")";
} }
} }
if(CollectionUtils.isNotEmpty(comboProduct.getMaterialProduct())) { if(CollectionUtils.isNotEmpty(comboProduct.getMaterialProduct())) {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean material : comboProduct.getMaterialProduct()) { for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean material : comboProduct.getMaterialProduct()) {
productNameCombo += "/"+material.getSpecificationName(); productNameCombo += "/"+material.getSpecificationName();
grillingCombo += material.getSpecificationName() + "/";
} }
} }
if(grillingCombo.length() > 0) {
grillingCombo = grillingCombo.substring(0, grillingCombo.length()-1);
}
deliveryComboProductInfo.setGrilling(grillingCombo);
deliveryComboProductInfo.setProductName(productNameCombo); deliveryComboProductInfo.setProductName(productNameCombo);
deliveryComboProductInfo.setProductNumber(comboProduct.getNumber()/productList.getNumber()); deliveryComboProductInfo.setProductNumber(comboProduct.getNumber()/productList.getNumber());
deliveryComboProductInfo.setProductPrice(comboProduct.getSalePrice().intValue()); deliveryComboProductInfo.setProductPrice(comboProduct.getSalePrice().intValue());
......
...@@ -40,6 +40,11 @@ public class ProductInfo { ...@@ -40,6 +40,11 @@ public class ProductInfo {
private String productName; private String productName;
/** /**
* 特挑和加料信息
*/
private String grilling;
/**
* 商品数量 * 商品数量
* productNumber不能为空 * productNumber不能为空
* productNumber不能小于1 * productNumber不能小于1
......
...@@ -988,7 +988,11 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService { ...@@ -988,7 +988,11 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
if (deliveryResponse == null || RESPONSE_SUCCESS_CODE != deliveryResponse.getCode() || deliveryResponse.getData() == null) { if (deliveryResponse == null || RESPONSE_SUCCESS_CODE != deliveryResponse.getCode() || deliveryResponse.getData() == null) {
String deliveryId = deliveryResponse != null && deliveryResponse.getData() != null ? deliveryResponse.getData().getDeliveryId() : ""; String deliveryId = deliveryResponse != null && deliveryResponse.getData() != null ? deliveryResponse.getData().getDeliveryId() : "";
String operator = "系统" ; String operator = "系统" ;
updateDeliveryAbnormal(orderBean.getCompanyId(), orderBean.getOid(), deliveryId, operator); String abnormalDesc = "配送异常";
if(StringUtils.isNotBlank(deliveryResponse.getMsg())) {
abnormalDesc = deliveryResponse.getMsg();
}
updateDeliveryAbnormal(orderBean.getCompanyId(), orderBean.getOid(), deliveryId, operator, abnormalDesc);
emailAlertService.sendEmailAlert("创建配送单失败", String.format("request:%s \r\nresponse:%s", JSONObject.toJSONString(createDeliveryVo), JSONObject.toJSONString(deliveryResponse))); emailAlertService.sendEmailAlert("创建配送单失败", String.format("request:%s \r\nresponse:%s", JSONObject.toJSONString(createDeliveryVo), JSONObject.toJSONString(deliveryResponse)));
return sendPaySuccessNoticeMessage(); return sendPaySuccessNoticeMessage();
} else { } else {
...@@ -1008,9 +1012,9 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService { ...@@ -1008,9 +1012,9 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
* @param orderCode * @param orderCode
* @param deliveryId * @param deliveryId
*/ */
public void updateDeliveryAbnormal(String partnerId, String orderCode, String deliveryId, String operator) { public void updateDeliveryAbnormal(String partnerId, String orderCode, String deliveryId, String operator, String abnormalDesc) {
AssortmentUpdateDeliveryAbnormalRequest request = AssortmentUpdateDeliveryAbnormalRequest.builder() AssortmentUpdateDeliveryAbnormalRequest request = AssortmentUpdateDeliveryAbnormalRequest.builder()
.abnormalDesc("配送异常") .abnormalDesc(abnormalDesc)
.deliveryId(deliveryId) .deliveryId(deliveryId)
.orderCode(orderCode) .orderCode(orderCode)
.partnerId(partnerId) .partnerId(partnerId)
......
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
package cn.freemud.entities.vo; package cn.freemud.entities.vo;
import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto; import cn.freemud.entities.dto.ActivityCalculationDiscountResponseDto;
import cn.freemud.entities.dto.calculate.CalculationSharingDiscountResponseDto;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
@Data @Data
...@@ -154,5 +156,12 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV ...@@ -154,5 +156,12 @@ public class ShoppingCartGoodsResponseVo extends ShoppingCartGoodsBaseResponseV
/** /**
* 总的优惠信息集合 * 总的优惠信息集合
*/ */
private List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount> discounts; private List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Discount> discounts;
/**
* 商品优惠信息
*/
private List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods;
} }
...@@ -52,7 +52,7 @@ public class FixDeliveryServiceImpl extends AbstractDeliveryServiceImpl implemen ...@@ -52,7 +52,7 @@ public class FixDeliveryServiceImpl extends AbstractDeliveryServiceImpl implemen
shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0); shoppingCartGoodsResponseVo.setDeliveryFeeZeroReason(0);
return new Double(storeResponse.getBizVO().getDeliveryPrice()).longValue() * 100; return new Double(storeResponse.getBizVO().getDeliveryPrice() * 100).longValue();
} }
} }
...@@ -332,6 +332,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -332,6 +332,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, menuType , menuType
, deliveryAmount , deliveryAmount
, ShoppingCartConstant.ADD_AND_UPDATE); , ShoppingCartConstant.ADD_AND_UPDATE);
buildDiscounts(shoppingCartGoodsResponseVo,discountResult);
} }
else { else {
// 获取优惠信息 // 获取优惠信息
...@@ -350,8 +352,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -350,8 +352,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//设置更新响应信息 //设置更新响应信息
setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, allCartGoodsList, null, partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null); setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, allCartGoodsList, null, partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null);
// 将促销返回的总的活动信息返回给前端
shoppingCartGoodsResponseVo.setDiscounts(calculationDiscountResult == null ? null : calculationDiscountResult.getDiscounts());
} }
//埋点添加购物车行为 //埋点添加购物车行为
this.buriedPointShoppingCart(addShoppingCartGoodsRequestVo, spuId, productName); this.buriedPointShoppingCart(addShoppingCartGoodsRequestVo, spuId, productName);
...@@ -455,6 +455,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -455,6 +455,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, menuType , menuType
, deliveryAmount , deliveryAmount
, ShoppingCartConstant.ADD_AND_UPDATE); , ShoppingCartConstant.ADD_AND_UPDATE);
buildDiscounts(shoppingCartGoodsResponseVo,discountResult);
} }
else { else {
// 获取优惠信息 // 获取优惠信息
...@@ -472,8 +474,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -472,8 +474,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
//设置更新响应信息 //设置更新响应信息
setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo.getToastMsg(), partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null); setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo.getToastMsg(), partnerId, storeId, userId, ShoppingCartConstant.ADD_AND_UPDATE, null);
// 将促销返回的总的活动信息返回给前端
shoppingCartGoodsResponseVo.setDiscounts(calculationDiscountResult == null ? null : calculationDiscountResult.getDiscounts());
} }
return ResponseUtil.success(shoppingCartGoodsResponseVo); return ResponseUtil.success(shoppingCartGoodsResponseVo);
...@@ -609,6 +609,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -609,6 +609,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
, menuType , menuType
, deliveryAmount , deliveryAmount
, ShoppingCartConstant.QUERY_INFO); , ShoppingCartConstant.QUERY_INFO);
buildDiscounts(shoppingCartGoodsResponseVo,calculationSharingDiscountResult);
} }
else { else {
List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = new ArrayList<>(); List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons = new ArrayList<>();
...@@ -631,9 +633,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -631,9 +633,6 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
// 在原价、现价、折扣价上增加第一次使用会员卡的费用 // 在原价、现价、折扣价上增加第一次使用会员卡的费用
this.addNeedCardAmount(shoppingCartInfoRequestVo, shoppingCartGoodsResponseVo); this.addNeedCardAmount(shoppingCartInfoRequestVo, shoppingCartGoodsResponseVo);
// 将促销返回的总的活动信息返回给前端
shoppingCartGoodsResponseVo.setDiscounts(calculationDiscountResult == null ? null : calculationDiscountResult.getDiscounts());
} }
return ResponseUtil.success(shoppingCartGoodsResponseVo); return ResponseUtil.success(shoppingCartGoodsResponseVo);
} }
...@@ -2068,4 +2067,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService { ...@@ -2068,4 +2067,17 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
} }
/**
* 设置总的优惠信息和商品优惠信息
* @param shoppingCartGoodsResponseVo
* @param discountResult
*/
private void buildDiscounts(ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo,CalculationSharingDiscountResponseDto.CalculationDiscountResult discountResult) {
if(discountResult != null){
shoppingCartGoodsResponseVo.setDiscounts(discountResult.getDiscounts());
shoppingCartGoodsResponseVo.setGoods(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