Commit bc617bab by 孙昱

Merge branch 'qa' of gitlab.freemud.com:order-group-application/order-group into qa

parents 25e2c1e4 ee98f193
......@@ -151,3 +151,6 @@
| 2.1.7-RELEASE | 农工商撤单 | 张志恒 | 2020-12-07 |
| 2.2.20-SNAPSHOT| 抖音支付 | 张志恒 | 2020-12-11ß |
| 2.1.8-RELEASE | 拼单 | 缪晖 | 2020-12-10 |
| 2.1.9-RELEASE | 去掉0元核销优惠券 | 李小二 | 2020-12-14 |
\ No newline at end of file
......@@ -2088,6 +2088,11 @@ public class OrderAdapter {
}
productVo.setInventedParentActivitiesVo(inventedParentActivityVos);
}
// 购物车行id
productVo.setCid(orderProductAddInfoDto.getCartGoodsUid());
// 购物车行父id
productVo.setOcid(orderProductAddInfoDto.getOriginalGoodsUid());
}
productVo.setOriginalPrice(productBean.getPrice());
productVo.setFinalPrice(productBean.getSalePrice());
......@@ -2465,6 +2470,9 @@ public class OrderAdapter {
createOrderProductDemoDto.setNickName(cartGoodsDetailDto.getUserName());
createOrderProductDemoDto.setPhotoUrl(cartGoodsDetailDto.getPhotoUrl());
createOrderProductDemoDto.setPackPrice(cartGoodsDetailDto.getPackPrice());
createOrderProductDemoDto.setCartGoodsUid(cartGoodsDetailDto.getCartGoodsUid());
createOrderProductDemoDto.setOriginalGoodsUid(cartGoodsDetailDto.getOriginalGoodsUid());
return createOrderProductDemoDto;
}
......
......@@ -192,6 +192,8 @@ public class OrderServiceImpl implements Orderservice {
private String fnStoreId;
@Value("${collage.pre_order_pay.goods_tag}")
private String collageGoodsTag;
@Value("${collage.pre_order_pay.goods_tag_list}")
private String collageGoodsTagList;
/**
* coco商户
......@@ -2744,7 +2746,11 @@ public class OrderServiceImpl implements Orderservice {
if (null != orderBean.getMarketingType() && OrderMarketType.COLLAGE.getIndex() == orderBean.getMarketingType()) {
// 拼单人数大于1人时参加拼单补贴
if (null != orderBean.getProductList() && orderBean.getProductList().stream().map(QueryOrdersResponse.DataBean.OrderBean.ProductBean::getUserId).distinct().collect(Collectors.toList()).size() > 1) {
request.setGoodsTag(collageGoodsTag);
Map<String, String> goodsTagMap = this.goodsTagMap();
if (null != goodsTagMap && !goodsTagMap.isEmpty()) {
// 根据商户号获取
request.setGoodsTag(goodsTagMap.get(orderBean.getCompanyId()) == null ? collageGoodsTag : goodsTagMap.get(orderBean.getCompanyId()));
}
}
}
// add by miaohui for 拼单群收款判断拼单人数大于1时参与微信平台补贴活动,创建预支付时上送goodsTag,后续抽成促销服务活动时删除此逻辑 end
......@@ -3671,4 +3677,16 @@ public class OrderServiceImpl implements Orderservice {
return false;
}
}
private Map<String, String> goodsTagMap() {
Map<String, String> map = new HashMap<>();
try {
for (String pg : collageGoodsTagList.split(",")) {
map.put(pg.split(":")[0], pg.split(":")[1]);
}
} catch (Exception e) {
log.error("goodsTag解析失败:" + collageGoodsTagList);
}
return map;
}
}
......@@ -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.service.StoreCenterService;
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.QueryOrdersResponse;
import io.swagger.models.auth.In;
......@@ -109,7 +110,14 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
Map<String,QueryOrdersResponse.DataBean.OrderBean.ProductBean> productMap = new HashMap<>();
List<QueryOrdersResponse.DataBean.OrderBean.ProductBean> productList = response.getData().getProductList();
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 {
});
}
List<ProductVo> productVos = new ArrayList<>();
if(null != masterProducts && !masterProducts.isEmpty()){
for(ProductVo product : masterProducts){
Integer giftQty = giftMap.get(product.getCid()) == null ? 0 : giftMap.get(product.getCid());
......@@ -141,7 +151,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
boolean halfFlag = false;
List<QueryOrdersResponse.DataBean.OrderBean.ProductBean.ProductDiscount> discountList = productBean.getDiscountList();
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;
break;
}
......@@ -151,6 +161,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
for(int i = 0 ; i < num-1 ; i++){
ProductVo newProduct = JSONObject.parseObject(JSONObject.toJSONString(product),ProductVo.class);
newProduct.setQty(1);
productVos.add(newProduct);
}
product.setQty(1);
......@@ -159,6 +170,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
}
masterProducts.addAll(productVos);
queryOrderResponseVo.setProducts(masterProducts);
}
}
......@@ -693,7 +693,7 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
//设置更新响应信息
setAddAndUpdateResponse(shoppingCartGoodsResponseVo, calculationDiscountResult, cartGoodsList, shoppingCartGoodsResponseVo.getToastMsg(), partnerId, storeId, userId, ShoppingCartConstant.QUERY_INFO, shoppingCartInfoRequestVo);
//设置均摊信息,商品行信息
//设置均摊信息
updateShoppingCartGoodsApportion(shoppingCartGoodsResponseVo, calculationDiscountResult, shoppingCartGoodsDto, premiumExchangeActivity, shoppingCartInfoRequestVo);
// 计算第一次使用会员卡需多支付的金额 单位:分
getNeedCardAmount(shoppingCartInfoRequestVo, shoppingCartGoodsDto);
......@@ -703,13 +703,13 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
shoppingCartGoodsDto.setThresholdAmount(shoppingCartGoodsResponseVo.getThresholdAmount());
shoppingCartGoodsDto.setIsDiscountDelivery(shoppingCartGoodsResponseVo.getIsDiscountDelivery());
shoppingCartGoodsDto.setDiscountDeliveryActivityCode(shoppingCartGoodsResponseVo.getDiscountDeliveryActivityCode());
if (calculationDiscountResult != null){
shoppingCartGoodsDto.setSendPoint(calculationDiscountResult.getSendPointVo());
}
// 购物车购买人包装费计算
updatePackPrice(shoppingCartGoodsResponseVo, shoppingCartGoodsDto);
// 重新计算购物车行折扣总金额
updateTotalDiscountAmount(calculationDiscountResult, shoppingCartGoodsDto);
return ResponseUtil.success(shoppingCartGoodsDto);
}
......@@ -734,22 +734,6 @@ public class ShoppingCartCollageServiceImpl extends AbstractShoppingCartImpl imp
}
}
/**
* 重新计算拼单购物车行总折扣金额
*/
private void updateTotalDiscountAmount(ActivityCalculationDiscountResponseDto.CalculationDiscountResult calculationDiscountResult, ShoppingCartGoodsDto shoppingCartGoodsDto) {
if (null != shoppingCartGoodsDto && null != shoppingCartGoodsDto.getProducts() && null != calculationDiscountResult && null != calculationDiscountResult.getGoods()) {
shoppingCartGoodsDto.getProducts().stream().forEach(product -> {
calculationDiscountResult.getGoods().stream().forEach(goods -> {
if (goods.getCartGoodsUid().equals(product.getCartGoodsUid())) {
long totalDiscountAmount = product.getOriginalPrice() * product.getQty() - goods.getRealAmount();
product.setTotalDiscountAmount(Integer.valueOf(String.valueOf(totalDiscountAmount)));
}
});
});
}
}
@Override
public ActivityCalculationDiscountResponseDto.CalculationDiscountResult getActivityCalculationDiscountResponse(String partnerId, String storeId, String userId, String appId, Integer orderType, boolean isMember, List<CartGoods> cartGoodsList, List<ActivityCalculationDiscountRequestDto.CalculationDiscountCoupon> coupons, List<ShoppingCartInfoRequestVo.SendGoods> sendGoodsList, String menuType, Long distributionFee) {
ActivityCalculationDiscountRequestDto activityCalculationDiscountRequestDto = getActivityCalculationDiscountRequestDto(partnerId, storeId, userId, appId, orderType);
......
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