Commit 79b8e9d8 by xiaoer.li@freemud.com

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

parents d0c306f7 d09915f9
...@@ -17,6 +17,7 @@ import cn.freemud.entities.vo.OrderCallBackRequestVo; ...@@ -17,6 +17,7 @@ import cn.freemud.entities.vo.OrderCallBackRequestVo;
import cn.freemud.service.OrderCallBackService; import cn.freemud.service.OrderCallBackService;
import com.freemud.application.sdk.api.log.ApiAnnotation; import com.freemud.application.sdk.api.log.ApiAnnotation;
import com.freemud.application.sdk.api.log.LogParams; import com.freemud.application.sdk.api.log.LogParams;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -28,6 +29,7 @@ import javax.validation.Valid; ...@@ -28,6 +29,7 @@ import javax.validation.Valid;
@RestController @RestController
@RequestMapping(value = "/callback", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/callback", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Log4j
public class CallBackController { public class CallBackController {
@Autowired @Autowired
...@@ -36,6 +38,8 @@ public class CallBackController { ...@@ -36,6 +38,8 @@ public class CallBackController {
@PostMapping("/order") @PostMapping("/order")
@ApiAnnotation(logMessage = "/order") @ApiAnnotation(logMessage = "/order")
public BaseResponse orderCallBackHandle(@Valid @RequestBody @LogParams OrderCallBackRequestVo requestVo) { public BaseResponse orderCallBackHandle(@Valid @RequestBody @LogParams OrderCallBackRequestVo requestVo) {
log.info("in callback order ordercode:"+ requestVo.getOrderCode());
log.info("callback order requestVo:"+ requestVo);
return orderCallBackService.orderCallBackHandle(requestVo); return orderCallBackService.orderCallBackHandle(requestVo);
} }
......
...@@ -2382,11 +2382,14 @@ public class OrderAdapter { ...@@ -2382,11 +2382,14 @@ public class OrderAdapter {
if(cartGoodsDetailDto.getProductType() != null) { if(cartGoodsDetailDto.getProductType() != null) {
if(cartGoodsDetailDto.getProductType() == ProductType.SETMEALPRODUCT.getCode() if(cartGoodsDetailDto.getProductType() == ProductType.SETMEALPRODUCT.getCode()
|| cartGoodsDetailDto.getProductType() == ProductType.SETMEALPRODUCT_UPPRICE.getCode()) { || cartGoodsDetailDto.getProductType() == ProductType.SETMEALPRODUCT_UPPRICE.getCode()) {
createOrderProductDemoDto.setPrice(0l); // createOrderProductDemoDto.setPrice(0l);
//套餐 //套餐
List<CreateOrderProductRequest> comboProducts = new ArrayList<>(); List<CreateOrderProductRequest> comboProducts = new ArrayList<>();
cartGoodsDetailDto.getComboProducts().forEach(product -> { cartGoodsDetailDto.getComboProducts().forEach(product -> {
CreateOrderProductRequest createOrderComboProduct = convent2MCCafeOrderProductDemo(product, product.getProductType()); CreateOrderProductRequest createOrderComboProduct = convent2MCCafeOrderProductDemo(product, product.getProductType());
if(!product.getIsFixedProduct()) {
createOrderProductDemoDto.setPrice(createOrderProductDemoDto.getPrice()+product.getOriginalPrice());
}
comboProducts.add(createOrderComboProduct); comboProducts.add(createOrderComboProduct);
if(CollectionUtils.isNotEmpty(product.getMaterialList())) { if(CollectionUtils.isNotEmpty(product.getMaterialList())) {
//加料商品 //加料商品
......
...@@ -842,6 +842,22 @@ public class ShoppingCartMCoffeeServiceImpl { ...@@ -842,6 +842,22 @@ public class ShoppingCartMCoffeeServiceImpl {
//设置均摊信息 //设置均摊信息
calculationService.updateShoppingCartGoodsApportion(shoppingCartGoodsResponseVo, calculationDiscount, shoppingCartGoodsDto, premiumExchangeActivity, shoppingCartInfoRequestVo); calculationService.updateShoppingCartGoodsApportion(shoppingCartGoodsResponseVo, calculationDiscount, shoppingCartGoodsDto, premiumExchangeActivity, shoppingCartInfoRequestVo);
//如果是餐具商品,则放到最后
if (CollectionUtils.isNotEmpty(shoppingCartGoodsDto.getProducts())) {
int size = shoppingCartGoodsDto.getProducts().size();
for(int i=0;i<size;i++) {
if(shoppingCartGoodsDto.getProducts().get(i).getSkuId().equals(mcCafeTablewareSkuId)) {
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = shoppingCartGoodsDto.getProducts().get(i);
cartGoodsDetailDto.setIsTableware(1);
if(i != size-1) {
shoppingCartGoodsDto.getProducts().remove(i);
shoppingCartGoodsDto.getProducts().add(cartGoodsDetailDto);
break;
}
}
}
}
return ResponseUtil.success(shoppingCartGoodsDto); return ResponseUtil.success(shoppingCartGoodsDto);
} }
......
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