Commit 0b735eeb by chongfu.liang

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

parents c97f7215 470493ee
...@@ -2619,6 +2619,7 @@ public class OrderSdkAdapter { ...@@ -2619,6 +2619,7 @@ public class OrderSdkAdapter {
return originalAmount; return originalAmount;
} }
Integer index = 1; Integer index = 1;
Integer comboIndex = 1;
for (CreateOrderProductRequest productRequest : products) { for (CreateOrderProductRequest productRequest : products) {
// 普通商品 订单转换 // 普通商品 订单转换
productRequest.setOpid(index); productRequest.setOpid(index);
...@@ -2628,7 +2629,6 @@ public class OrderSdkAdapter { ...@@ -2628,7 +2629,6 @@ public class OrderSdkAdapter {
// 父类商品productId=productId+seq // 父类商品productId=productId+seq
String parentProductId = productRequest.getProductId() + "_" + index; String parentProductId = productRequest.getProductId() + "_" + index;
if (CollectionUtils.isNotEmpty(productRequest.getComboProduct())) { if (CollectionUtils.isNotEmpty(productRequest.getComboProduct())) {
Integer comboIndex = 1;
for(CreateOrderProductRequest combo : productRequest.getComboProduct()) { for(CreateOrderProductRequest combo : productRequest.getComboProduct()) {
combo.setOpid(comboIndex); combo.setOpid(comboIndex);
updateOrderItemAndSettlement(orderItemList, orderSettlementCreateReqList, combo, partnerId, parentProductId, false); updateOrderItemAndSettlement(orderItemList, orderSettlementCreateReqList, combo, partnerId, parentProductId, false);
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<dependency> <dependency>
<groupId>cn.freemud</groupId> <groupId>cn.freemud</groupId>
<artifactId>assortment-ordercenter-sdk</artifactId> <artifactId>assortment-ordercenter-sdk</artifactId>
<version>2.0.18-SNAPSHOT</version> <version>2.0.20-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.freemud.application.service.sdk</groupId> <groupId>com.freemud.application.service.sdk</groupId>
......
...@@ -1933,11 +1933,13 @@ public class OrderAdapter { ...@@ -1933,11 +1933,13 @@ public class OrderAdapter {
List<ProductVo> setMaterialProducts = new ArrayList<>(); List<ProductVo> setMaterialProducts = new ArrayList<>();
product.getMaterialProduct().forEach(materialProduct -> { product.getMaterialProduct().forEach(materialProduct -> {
ProductVo material = convent2ProductVo(materialProduct); ProductVo material = convent2ProductVo(materialProduct);
material.setOriginalTotalAmount(new BigDecimal(material.getOriginalPrice()).multiply(new BigDecimal(productVo.getQty())).longValue());
material.setSaleTotalAmount(new BigDecimal(material.getFinalPrice()).multiply(new BigDecimal(productVo.getQty())).longValue());
setMaterialProducts.add(material); setMaterialProducts.add(material);
productVo.setOriginalPrice(new BigDecimal(productVo.getOriginalPrice()).subtract(new BigDecimal(material.getOriginalPrice())).longValue()); productVo.setOriginalPrice(new BigDecimal(productVo.getOriginalPrice()).add(new BigDecimal(material.getOriginalPrice())).longValue());
productVo.setFinalPrice(new BigDecimal(productVo.getFinalPrice()).subtract(new BigDecimal(material.getFinalPrice())).longValue()); productVo.setFinalPrice(new BigDecimal(productVo.getFinalPrice()).add(new BigDecimal(material.getFinalPrice())).longValue());
productVo.setOriginalTotalAmount(new BigDecimal(productVo.getOriginalTotalAmount()).subtract(new BigDecimal(material.getOriginalTotalAmount())).longValue()); productVo.setOriginalTotalAmount(new BigDecimal(productVo.getOriginalTotalAmount()).add(new BigDecimal(material.getOriginalTotalAmount())).longValue());
productVo.setSaleTotalAmount(new BigDecimal(productVo.getSaleTotalAmount()).subtract(new BigDecimal(product.getSettlementPrice())).longValue()); productVo.setSaleTotalAmount(new BigDecimal(productVo.getSaleTotalAmount()).add(new BigDecimal(material.getSaleTotalAmount())).longValue());
}); });
comboProduct.setSetMaterialProducts(setMaterialProducts); comboProduct.setSetMaterialProducts(setMaterialProducts);
} }
...@@ -1949,11 +1951,13 @@ public class OrderAdapter { ...@@ -1949,11 +1951,13 @@ public class OrderAdapter {
List<ProductVo> setMaterialProducts = new ArrayList<>(); List<ProductVo> setMaterialProducts = new ArrayList<>();
productBean.getMaterialProduct().forEach(product -> { productBean.getMaterialProduct().forEach(product -> {
ProductVo material = convent2ProductVo(product); ProductVo material = convent2ProductVo(product);
material.setOriginalTotalAmount(new BigDecimal(material.getOriginalPrice()).multiply(new BigDecimal(productVo.getQty())).longValue());
material.setSaleTotalAmount(new BigDecimal(material.getFinalPrice()).multiply(new BigDecimal(productVo.getQty())).longValue());
setMaterialProducts.add(material); setMaterialProducts.add(material);
productVo.setOriginalPrice(new BigDecimal(productVo.getOriginalPrice()).subtract(new BigDecimal(material.getOriginalPrice())).longValue()); productVo.setOriginalPrice(new BigDecimal(productVo.getOriginalPrice()).add(new BigDecimal(material.getOriginalPrice())).longValue());
productVo.setFinalPrice(new BigDecimal(productVo.getFinalPrice()).subtract(new BigDecimal(material.getFinalPrice())).longValue()); productVo.setFinalPrice(new BigDecimal(productVo.getFinalPrice()).add(new BigDecimal(material.getFinalPrice())).longValue());
productVo.setOriginalTotalAmount(new BigDecimal(productVo.getOriginalTotalAmount()).subtract(new BigDecimal(material.getOriginalTotalAmount())).longValue()); productVo.setOriginalTotalAmount(new BigDecimal(productVo.getOriginalTotalAmount()).add(new BigDecimal(material.getOriginalTotalAmount())).longValue());
productVo.setSaleTotalAmount(new BigDecimal(productVo.getSaleTotalAmount()).subtract(new BigDecimal(product.getSettlementPrice())).longValue()); productVo.setSaleTotalAmount(new BigDecimal(productVo.getSaleTotalAmount()).add(new BigDecimal(material.getSaleTotalAmount())).longValue());
}); });
productVo.setSetMaterialProducts(setMaterialProducts); productVo.setSetMaterialProducts(setMaterialProducts);
} }
......
package cn.freemud.service.impl; package cn.freemud.service.impl;
import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto; import cn.freemud.entities.dto.shoppingCart.ShoppingCartGoodsDto;
import cn.freemud.entities.vo.CreateOrderVo; import cn.freemud.entities.vo.*;
import cn.freemud.entities.vo.NewPaysuccessNoticeMessage;
import cn.freemud.entities.vo.OrderAffirmRequestVO;
import cn.freemud.entities.vo.PaysuccessNoticeMessage;
import cn.freemud.utils.ValidationCode; import cn.freemud.utils.ValidationCode;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType; import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
...@@ -34,6 +31,9 @@ public class MallOrderServiceImplTest { ...@@ -34,6 +31,9 @@ public class MallOrderServiceImplTest {
@Autowired @Autowired
private MCCafeOrderServiceImpl mcCafeOrderService; private MCCafeOrderServiceImpl mcCafeOrderService;
@Autowired
private OrderServiceImpl orderService;
@Before @Before
public void before() throws Exception { public void before() throws Exception {
...@@ -59,6 +59,11 @@ public class MallOrderServiceImplTest { ...@@ -59,6 +59,11 @@ public class MallOrderServiceImplTest {
} }
@Test @Test
public void f3() {
orderService.mcCafeQueryOrderById(JSON.parseObject("{\"channelType\":\"saas\",\"partnerId\":\"1206\",\"appId\":\"wx6816a0b007741702\",\"sessionId\":\"07e359b4147ef0182951b2c064f5ec8d716a702a\",\"orderType\":1,\"menuType\":\"saas\",\"shopId\":\"1450026\",\"oid\":\"19284932547021936900006\"}", MaCafeQueryOrderVo.class));
}
@Test
public void testPaySuccess() { public void testPaySuccess() {
//0元支付 //0元支付
String fmId = "SPAY" + ValidationCode.getRandomUuid(); String fmId = "SPAY" + ValidationCode.getRandomUuid();
......
...@@ -267,7 +267,7 @@ public class ShoppingCartConvertAdapter { ...@@ -267,7 +267,7 @@ public class ShoppingCartConvertAdapter {
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = new ShoppingCartGoodsDto.CartGoodsDetailDto(); ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = new ShoppingCartGoodsDto.CartGoodsDetailDto();
cartGoodsDetailDto.setTaxId(cartGoods.getTaxId()); cartGoodsDetailDto.setTaxId(cartGoods.getTaxId());
cartGoodsDetailDto.setTax(cartGoods.getTax()); cartGoodsDetailDto.setTax(cartGoods.getTax());
cartGoodsDetailDto.setSpuId(comboxGoods.getGoodsId()); cartGoodsDetailDto.setSpuId(comboxGoods.getSpuId());
cartGoodsDetailDto.setSpuName(comboxGoods.getSpuName()); cartGoodsDetailDto.setSpuName(comboxGoods.getSpuName());
cartGoodsDetailDto.setSkuId(comboxGoods.getGoodsId()); cartGoodsDetailDto.setSkuId(comboxGoods.getGoodsId());
cartGoodsDetailDto.setSkuName(StringUtils.isEmpty(comboxGoods.getSkuName()) ? comboxGoods.getSpuName() : comboxGoods.getSkuName()); cartGoodsDetailDto.setSkuName(StringUtils.isEmpty(comboxGoods.getSkuName()) ? comboxGoods.getSpuName() : comboxGoods.getSkuName());
......
...@@ -426,7 +426,7 @@ public class CalculationServiceImpl { ...@@ -426,7 +426,7 @@ public class CalculationServiceImpl {
ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material(); ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material();
material.setType(1); material.setType(1);
material.setGoodsId(materialGoods2.getSpuId()); material.setGoodsId(materialGoods2.getSpuId());
material.setGoodsQuantity(cartGoods.getQty()); material.setGoodsQuantity(1);
material.setOriginalPrice(materialGoods2.getFinalPrice()); material.setOriginalPrice(materialGoods2.getFinalPrice());
materials.add(material); materials.add(material);
} }
...@@ -440,7 +440,7 @@ public class CalculationServiceImpl { ...@@ -440,7 +440,7 @@ public class CalculationServiceImpl {
ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material(); ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material material = new ActivityCalculationDiscountRequestDto.CalculationDiscountGoods.Material();
material.setType(1); material.setType(1);
material.setGoodsId(materialGoods.getSpuId()); material.setGoodsId(materialGoods.getSpuId());
material.setGoodsQuantity(cartGoods.getQty()); material.setGoodsQuantity(1);
material.setOriginalPrice(materialGoods.getOriginalPrice()); material.setOriginalPrice(materialGoods.getOriginalPrice());
material.setNowPrice(materialGoods.getFinalPrice().intValue()); material.setNowPrice(materialGoods.getFinalPrice().intValue());
materials.add(material); materials.add(material);
......
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