Commit eca63bfc by 徐康

对接餐道grilling

parent a2bf9b4e
......@@ -187,25 +187,25 @@ public class DeliveryAdapter {
ProductInfo deliveryProductInfo = new ProductInfo();
deliveryProductInfo.setProductCode(productList.getProductId().substring(4));
String productName = StringUtils.isBlank(productList.getSpecificationName()) ? productList.getProductName() : productList.getSpecificationName();
String grilling = "";
OrderProductAddInfoDto extInfo = JSON.parseObject(productList.getExtInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfo.getSpecialAttrs())) {
String attr = "";
for (OrderSpecialExtraAttrRequest special : extInfo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) {
attr = special.getAttributeName();
break;
}
}
if(attr.length() > 0) {
productName += "("+attr+")";
grilling += special.getAttributeName() + "/";
}
}
if(CollectionUtils.isNotEmpty(productList.getMaterialProduct())) {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean material : productList.getMaterialProduct()) {
productName += "/"+material.getSpecificationName();
grilling += material.getSpecificationName() + "/";
}
}
if(grilling.length() > 0) {
grilling = grilling.substring(0, grilling.length()-1);
}
deliveryProductInfo.setGrilling(grilling);
deliveryProductInfo.setProductName(productName);
deliveryProductInfo.setProductNumber(productList.getNumber());
deliveryProductInfo.setProductPrice(productList.getSalePrice().intValue());
......@@ -223,25 +223,26 @@ public class DeliveryAdapter {
ProductInfo deliveryComboProductInfo = new ProductInfo();
deliveryComboProductInfo.setProductCode(comboProduct.getProductId().substring(4));
String productNameCombo = StringUtils.isBlank(comboProduct.getSpecificationName()) ? comboProduct.getProductName() : comboProduct.getSpecificationName();
String grillingCombo = "";
OrderProductAddInfoDto extInfoCombo = JSON.parseObject(comboProduct.getExtInfo(), OrderProductAddInfoDto.class);
if(CollectionUtils.isNotEmpty(extInfoCombo.getSpecialAttrs())) {
String attr = "";
for (OrderSpecialExtraAttrRequest special : extInfoCombo.getSpecialAttrs()) {
if(special.getAttributeName().indexOf("冰") >= 0) {
attr = special.getAttributeName();
break;
}
}
if(attr.length() > 0) {
productNameCombo += "("+attr+")";
grillingCombo += special.getAttributeName() + "/";
}
}
if(CollectionUtils.isNotEmpty(comboProduct.getMaterialProduct())) {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean material : comboProduct.getMaterialProduct()) {
productNameCombo += "/"+material.getSpecificationName();
grillingCombo += material.getSpecificationName() + "/";
}
}
if(grillingCombo.length() > 0) {
grillingCombo = grillingCombo.substring(0, grillingCombo.length()-1);
}
deliveryComboProductInfo.setGrilling(grillingCombo);
deliveryComboProductInfo.setProductName(productNameCombo);
deliveryComboProductInfo.setProductNumber(comboProduct.getNumber()/productList.getNumber());
deliveryComboProductInfo.setProductPrice(comboProduct.getSalePrice().intValue());
......
......@@ -40,6 +40,11 @@ public class ProductInfo {
private String productName;
/**
* 特挑和加料信息
*/
private String grilling;
/**
* 商品数量
* productNumber不能为空
* productNumber不能小于1
......
......@@ -981,7 +981,11 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
if (deliveryResponse == null || RESPONSE_SUCCESS_CODE != deliveryResponse.getCode() || deliveryResponse.getData() == null) {
String deliveryId = deliveryResponse != null && deliveryResponse.getData() != null ? deliveryResponse.getData().getDeliveryId() : "";
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)));
return sendPaySuccessNoticeMessage();
} else {
......@@ -1001,9 +1005,9 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
* @param orderCode
* @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()
.abnormalDesc("配送异常")
.abnormalDesc(abnormalDesc)
.deliveryId(deliveryId)
.orderCode(orderCode)
.partnerId(partnerId)
......
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