Commit 24e6e673 by 刘鹏飞

Merge remote-tracking branch 'remotes/origin/feature/coco-payGift-刘鹏飞' into qa

parents cc57b13e 89151fa7
...@@ -28,6 +28,7 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSendC ...@@ -28,6 +28,7 @@ import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderSendC
import com.freemud.application.sdk.api.storecenter.response.StoreResponse; import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
import com.freemud.application.sdk.api.storecenter.service.StoreCenterService; import com.freemud.application.sdk.api.storecenter.service.StoreCenterService;
import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType; import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType;
import com.freemud.sdk.api.assortment.order.request.order.OrderProductAddInfoDto;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrderByIdResponse; import com.freemud.sdk.api.assortment.order.response.order.QueryOrderByIdResponse;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse; import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
...@@ -109,7 +110,14 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -109,7 +110,14 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
Map<String,QueryOrdersResponse.DataBean.OrderBean.ProductBean> productMap = new HashMap<>(); Map<String,QueryOrdersResponse.DataBean.OrderBean.ProductBean> productMap = new HashMap<>();
List<QueryOrdersResponse.DataBean.OrderBean.ProductBean> productList = response.getData().getProductList(); List<QueryOrdersResponse.DataBean.OrderBean.ProductBean> productList = response.getData().getProductList();
if(productList != null && !productList.isEmpty()){ if(productList != null && !productList.isEmpty()){
productMap = productList.stream().collect(Collectors.toMap(QueryOrdersResponse.DataBean.OrderBean.ProductBean::getCartGoodsUid, g -> g,(k1,k2)->k1)); for(QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean : productList){
if(StringUtils.isEmpty(productBean.getExtInfo())){
continue;
}
OrderProductAddInfoDto orderProductAddInfoDto = JSONObject.parseObject(productBean.getExtInfo(),OrderProductAddInfoDto.class);
productMap.put(orderProductAddInfoDto.getCartGoodsUid(),productBean);
}
} }
...@@ -129,6 +137,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -129,6 +137,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
}); });
} }
List<ProductVo> productVos = new ArrayList<>();
if(null != masterProducts && !masterProducts.isEmpty()){ if(null != masterProducts && !masterProducts.isEmpty()){
for(ProductVo product : masterProducts){ for(ProductVo product : masterProducts){
Integer giftQty = giftMap.get(product.getCid()) == null ? 0 : giftMap.get(product.getCid()); Integer giftQty = giftMap.get(product.getCid()) == null ? 0 : giftMap.get(product.getCid());
...@@ -141,7 +151,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -141,7 +151,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
boolean halfFlag = false; boolean halfFlag = false;
List<QueryOrdersResponse.DataBean.OrderBean.ProductBean.ProductDiscount> discountList = productBean.getDiscountList(); List<QueryOrdersResponse.DataBean.OrderBean.ProductBean.ProductDiscount> discountList = productBean.getDiscountList();
for(QueryOrdersResponse.DataBean.OrderBean.ProductBean.ProductDiscount productDiscount : discountList){ for(QueryOrdersResponse.DataBean.OrderBean.ProductBean.ProductDiscount productDiscount : discountList){
if(ObjectUtils.equals(productDiscount.getDiscountType(), 20)){ if(ObjectUtils.equals(productDiscount.getDiscountType(), OldOrderAccountType.SECOND_DISCOUNT.getCode())){
halfFlag = true; halfFlag = true;
break; break;
} }
...@@ -151,6 +161,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -151,6 +161,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
for(int i = 0 ; i < num-1 ; i++){ for(int i = 0 ; i < num-1 ; i++){
ProductVo newProduct = JSONObject.parseObject(JSONObject.toJSONString(product),ProductVo.class); ProductVo newProduct = JSONObject.parseObject(JSONObject.toJSONString(product),ProductVo.class);
newProduct.setQty(1); newProduct.setQty(1);
productVos.add(newProduct);
} }
product.setQty(1); product.setQty(1);
...@@ -159,6 +170,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService { ...@@ -159,6 +170,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
} }
masterProducts.addAll(productVos);
queryOrderResponseVo.setProducts(masterProducts); queryOrderResponseVo.setProducts(masterProducts);
} }
} }
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