Commit 5dd8b30a by 徐康

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

parents c6abaa2b 07ade50b
......@@ -1324,7 +1324,7 @@ public class OrderAdapter {
}
private OrderViewStatusDto getOrderViewStatusDesc(QueryOrdersResponse.DataBean.OrderBean orderBean, String wxAppId) {
public OrderViewStatusDto getOrderViewStatusDesc(QueryOrdersResponse.DataBean.OrderBean orderBean, String wxAppId) {
OrderViewStatusDto orderViewStatusDto = new OrderViewStatusDto();
LogUtil.info("getOrderStatusDesc start ", new Gson().toJson(orderBean), new Gson().toJson(orderBean));
QueryOrdersResponse.DataBean.OrderBean.RefundBean refundBean = null;
......@@ -1946,13 +1946,21 @@ public class OrderAdapter {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean productBean : productBeans) {
OrderPrintDto.ProductsBean productVO = getProductBean(productBean);
List<OrderPrintDto.ProductsBean> comboProductVOs = new ArrayList<>();
List<OrderPrintDto.ProductsBean> materialProductVOs = new ArrayList<>();
if (CollectionUtils.isNotEmpty(productBean.getComboProduct())) {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean comboProduct : productBean.getComboProduct()) {
OrderPrintDto.ProductsBean sonProductVO = getProductBean(comboProduct);
comboProductVOs.add(sonProductVO);
}
}
if (CollectionUtils.isNotEmpty(productBean.getMaterialProduct())) {
for (QueryOrdersResponseDto.DataBean.OrderBean.ProductBean materialProduct : productBean.getMaterialProduct()) {
OrderPrintDto.ProductsBean materialProductVO = getProductBean(materialProduct);
materialProductVOs.add(materialProductVO);
}
}
productVO.setSonProducts(comboProductVOs);
productVO.setMaterialProducts(materialProductVOs);
products.add(productVO);
}
return products;
......
......@@ -29,10 +29,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
......@@ -351,5 +348,14 @@ public class OrderController {
return orderservice.listFreeRider(vo);
}
/**
* 根据订单号查询订单状态和取餐码
*/
@ApiAnnotation(logMessage = "mcCafePollingPickUpCode")
@PostMapping("/mcCafePollingPickUpCode")
public BaseResponse mcCafePollingPickUpCode(@Validated @LogParams @RequestBody MaCafeQueryOrderVo vo) {
return orderservice.mcCafePollingPickUpCode(vo);
}
}
......@@ -128,6 +128,8 @@ public class OrderPrintDto {
private Integer parentType;
//套餐商品的子商品
private List<ProductsBean> sonProducts;
//加料商品的加料
private List<ProductsBean> materialProducts;
}
}
......@@ -369,6 +369,8 @@ public class QueryOrdersResponseDto {
List<ProductBean> comboProduct;
List<ProductBean> materialProduct;
@NoArgsConstructor
@Data
public static class ProductDiscount {
......
......@@ -123,4 +123,6 @@ public interface Orderservice {
BaseResponse mcCafeQueryOrderById(MaCafeQueryOrderVo queryOrderVo);
BaseResponse mcCafeQueryOrders(McCafeQueryOrderVo queryOrderVo);
BaseResponse mcCafePollingPickUpCode(MaCafeQueryOrderVo vo );
}
......@@ -882,27 +882,12 @@ public class OrderServiceImpl implements Orderservice {
BeanUtils.copyProperties(queryOrderVo,vo);
String channelType = this.getQueryOrderChannelType(vo, userLoginInfoDto);
QueryOrdersDto queryOrdersDto = orderAdapter.convent2QueryOrdersDtoMcCafe(queryOrderVo, userId, channelType);
//封装查询正在进行中的订单数
McCafeQueryOrderVo queryOrderVoNow =new McCafeQueryOrderVo();
BeanUtils.copyProperties(queryOrderVo,queryOrderVoNow);
List<Integer> queryOrderStatus = Arrays.asList(QueryOrderStatus.TAKE_MEAL.getCode());
List<Integer> queryOrderType = Arrays.asList(OrderType.COLLECT_GOODS.getCode(),OrderType.TAKE_OUT.getCode());
queryOrderVoNow.setQueryOrderStatus(queryOrderStatus);
queryOrderVoNow.setQueryOrderType(queryOrderType);
QueryOrdersDto queryOrdersDtoNow = orderAdapter.convent2QueryOrdersDtoMcCafe(queryOrderVoNow, userId, channelType);
QueryOrdersResponse queryOrderResponse;
QueryOrdersResponse queryOrderResponseNow;
try {
QueryOrdersRequest queryOrdersRequest2 = new QueryOrdersRequest();
BeanUtil.convertBean(queryOrdersDto, queryOrdersRequest2);
queryOrdersRequest2.setTrackingNo(LogTreadLocal.getTrackingNo());
queryOrderResponse = orderCenterSdkService.queryOrders(queryOrdersRequest2);
QueryOrdersRequest queryOrdersRequestNow = new QueryOrdersRequest();
BeanUtil.convertBean(queryOrdersDtoNow, queryOrdersRequestNow);
queryOrdersRequestNow.setTrackingNo(LogTreadLocal.getTrackingNo());
queryOrderResponseNow = orderCenterSdkService.queryOrders(queryOrdersRequestNow);
} catch (Exception e) {
LogUtil.error("queryOrders_error", gson.toJson(queryOrdersDto), e);
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR);
......@@ -914,7 +899,6 @@ public class OrderServiceImpl implements Orderservice {
//用户无订单数据
if (queryOrderResponse.getData() == null || queryOrderResponse.getData().getCount() == 0) {
responseMap.put("count", 0);
responseMap.put("progressOrderCount", queryOrderResponseNow.getData() == null ? 0 : queryOrderResponseNow.getData().getCount());
responseMap.put("list", new ArrayList<QueryOrderResponseVo>());
return ResponseUtil.success(responseMap);
}
......@@ -994,7 +978,6 @@ public class OrderServiceImpl implements Orderservice {
List<QueryOrderResponseVo> queryOrderResponseVos = orderAdapter.convent2QueryOrderResponseVos(orders, userLoginInfoDto.getWxAppId(), userLoginInfoDto.getIappId());
responseMap.put("count", queryOrderResponse.getData() == null ? 0 : queryOrderResponse.getData().getCount());
responseMap.put("progressOrderCount", queryOrderResponseNow.getData() == null ? 0 : queryOrderResponseNow.getData().getCount());
responseMap.put("list", queryOrderResponseVos);
//只有有订单时才显示用户自定义取餐信息
if (CollectionUtils.isNotEmpty(queryOrderResponseVos)) {
......@@ -1003,6 +986,31 @@ public class OrderServiceImpl implements Orderservice {
return ResponseUtil.success(responseMap);
}
@Override
public BaseResponse mcCafePollingPickUpCode(MaCafeQueryOrderVo queryOrderVo) {
AssortmentCustomerInfoVo userLoginInfoDto = customerInfoManager.getCustomerInfoByObject(queryOrderVo.getSessionId());
if (userLoginInfoDto == null || StringUtils.isBlank(userLoginInfoDto.getMemberId())) {
return ResponseUtil.error(ResponseResult.NOT_LOGIN);
}
String oid =queryOrderVo.getOid();
if (StringUtils.isBlank(oid)) {
return ResponseUtil.error(ResponseResult.PARAMETER_MISSING.getCode(), "oid不能为空");
}
BaseQueryOrderRequest baseQueryOrderRequest = new BaseQueryOrderRequest();
baseQueryOrderRequest.setOrderId(oid);
baseQueryOrderRequest.setTrackingNo(LogTreadLocal.getTrackingNo());
QueryOrderByIdResponse response = orderCenterSdkService.queryOrderById(baseQueryOrderRequest);
if (!RESPONSE_SUCCESS_CODE.equals(response.getErrcode()) || response.getData() == null) {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR);
}
QueryOrdersResponse.DataBean.OrderBean orderBean = response.getData();
OrderViewStatusDto orderViewStatusDesc = orderAdapter.getOrderViewStatusDesc(orderBean, userLoginInfoDto.getWxAppId());
Map<String, Object> responseMap = Maps.newTreeMap();
responseMap.put("orderStatus", orderViewStatusDesc.getOrderStatus());
responseMap.put("takeCode",orderBean.getOtherCode() );
return ResponseUtil.success(responseMap);
}
private String getRedpacketsPicture(String activityId) {
if (StringUtils.isNotBlank(activityId)) {
try {
......
......@@ -296,6 +296,8 @@ public class ActivityCalculationDiscountResponseDto {
* 优惠金额(单位分)
*/
private Integer discountAmount;
private Integer activityType;
}
@Data
......
......@@ -229,6 +229,7 @@ public class ShoppingCartMCoffeeServiceImpl {
// check购物车中所有商品
cartGoodsList = checkCartGoods(partnerId, storeId, orderType, menuType, shoppingCartGoodsResponseVo, cartGoodsList);
// 重新存储最新购物车
assortmentSdkService.setShoppingCart(partnerId, storeId, userId, cartGoodsList, sessionId, "", shoppingCartBaseService);
......@@ -480,7 +481,6 @@ public class ShoppingCartMCoffeeServiceImpl {
Integer orderType = 1;
String userId = assortmentCustomerInfoVo.getMemberId();
String partnerId = requestVo.getPartnerId();
String storeId = requestVo.getShopId();
String appId = requestVo.getAppId();
String orderId = requestVo.getOrderId();
String trackingNo = LogThreadLocal.getTrackingNo();
......@@ -491,7 +491,7 @@ public class ShoppingCartMCoffeeServiceImpl {
}
List<CartGoods> cartGoodsList = getOrderGoods(orderInfo.getResult());
String storeId = orderInfo.getResult().getStoreId();
if(orderInfo.getResult().getOrderType() == 3 || orderInfo.getResult().getOrderType() == 4){
menuType = "saasdelivery";
orderType = 2;
......@@ -899,6 +899,9 @@ public class ShoppingCartMCoffeeServiceImpl {
private List<CartGoods> checkCartGoods(String partnerId, String storeId, Integer orderType, String menuType,
ShoppingCartGoodsBaseResponseVo shoppingCartGoodsResponseVo, List<CartGoods> cartGoodsList) {
//筛选数量不为0商品
cartGoodsList = cartGoodsList.stream().filter(cartGoods -> cartGoods.getQty() != 0).collect(Collectors.toList());
//筛选非加购商品--加价购商品不校验是否在菜单,不调用validateShopProduct
List<CartGoods> checkGoods = cartGoodsList.stream().filter(cartGoods -> cartGoods.getGoodsType() != GoodsTypeEnum.REDUCE_PRICE_GOODS.getGoodsType()).collect(Collectors.toList());
//加价购商品
......
......@@ -195,6 +195,19 @@ public class CalculationServiceImpl {
activityDiscountsDtos.add(activityDiscountsDto);
}
}
for (ActivityCalculationDiscountResponseDto.CalculationDiscountResult.CouponResults discount : calculationDiscountResult.getCouponDiscounts()) {
int discountAmount = (discount.getDiscountAmount() == null) ? 0 : discount.getDiscountAmount();
Integer discountType = discount.getActivityType();
if (discountType != null && discountAmount > 0) {
ActivityDiscountsDto activityDiscountsDto = new ActivityDiscountsDto();
activityDiscountsDto.setActivityCode(discount.getCouponCode());
activityDiscountsDto.setActivityName(discount.getCouponCode());
activityDiscountsDto.setActivityType(discountType);
activityDiscountsDto.setDiscountAmount(0 - discountAmount);
activityDiscountsDtos.add(activityDiscountsDto);
}
}
//过滤出加价购
List<ActivityCalculationDiscountResponseDto.CalculationDiscountResult.Discount> addMoneyDiscounts = discounts.stream().filter(discount -> ActivityTypeEnum.TYPE_81.getCode().equals(discount.getType())).collect(Collectors.toList());
......@@ -303,7 +316,7 @@ public class CalculationServiceImpl {
if (storeInfo.getBizVO().getDeliveryPrice() == 0) {
throw new ServiceException(ResponseResult.STORE_DELIVERY_AMOUNT_ERROR);
}
Double deliveryPrice = storeInfo.getBizVO().getDeliveryPrice();
Double deliveryPrice = storeInfo.getBizVO().getDeliveryPrice()*100;
deliveryAmount = deliveryPrice.longValue();
return deliveryAmount;
}
......
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