Commit 4d04afc8 by xiaoer.li@freemud.com

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

parents 9c7329f3 d99e7b8b
......@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>assortment-ordercenter-sdk</artifactId>
<version>2.1.5-RELEASE</version>
<version>2.2.8-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -20,7 +20,7 @@
<dependency>
<artifactId>assortment-data-manager</artifactId>
<groupId>com.freemud.sdk.api.assortment</groupId>
<version>3.5.RELEASE</version>
<version>5.2.7.RELEASE</version>
<scope>provided</scope>
</dependency>
<dependency>
......
......@@ -410,12 +410,17 @@ public class QueryOrdersResponse {
private String downstreamThirdOrderCode;
/**
* 混合支付list
*/
//订单支付详情
private String pickUpGoodsNo;
/**
* 混合支付list
*/
private List<OrderPayItem> orderPayItem;
private String pickUpGoodsNo;
@NoArgsConstructor
@Data
......
......@@ -7,18 +7,14 @@ import cn.freemud.entities.vo.CreateDeliveryVo;
import cn.freemud.entities.vo.ProductInfo;
import cn.freemud.enums.DeliveryChannelEnum;
import cn.freemud.enums.OrderSourceType;
import cn.freemud.enums.OrderType;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.deliverycenter.dto.CreateDeliveryOrderRequestDto;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.application.sdk.api.storecenter.response.StoreResponse;
import com.freemud.sdk.api.assortment.order.enums.OldOrderAccountType;
import com.freemud.sdk.api.assortment.order.enums.QueryOrderAccountType;
import com.freemud.sdk.api.assortment.order.request.order.CreateOrderProductRequest;
import com.freemud.sdk.api.assortment.order.request.order.OrderProductAddInfoDto;
import com.freemud.sdk.api.assortment.order.request.order.OrderSpecialExtraAttrRequest;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Component;
......@@ -28,10 +24,9 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.stream.Collectors;
import static java.util.stream.Collectors.toList;
@Component
public class DeliveryAdapter {
......@@ -183,6 +178,7 @@ public class DeliveryAdapter {
List<ProductInfo> productInfos = new ArrayList<>();
if (CollectionUtils.isNotEmpty(order.getProductList())) {
AtomicBoolean flag = new AtomicBoolean(false);
order.getProductList().forEach(productList -> {
ProductInfo deliveryProductInfo = new ProductInfo();
deliveryProductInfo.setProductCode(productList.getProductId().substring(4));
......@@ -211,6 +207,9 @@ public class DeliveryAdapter {
if(grilling.length() > 0) {
grilling = grilling.substring(0, grilling.length()-1);
}
if(grilling.length() > 50) {
flag.set(true);
}
deliveryProductInfo.setGrilling(grilling);
deliveryProductInfo.setProductName(productName);
deliveryProductInfo.setProductNumber(productList.getNumber());
......@@ -253,6 +252,9 @@ public class DeliveryAdapter {
if(grillingCombo.length() > 0) {
grillingCombo = grillingCombo.substring(0, grillingCombo.length()-1);
}
if(grillingCombo.length() > 50) {
flag.set(true);
}
deliveryComboProductInfo.setGrilling(grillingCombo);
deliveryComboProductInfo.setProductName(productNameCombo);
deliveryComboProductInfo.setProductNumber(comboProduct.getNumber()/productList.getNumber());
......@@ -291,6 +293,9 @@ public class DeliveryAdapter {
}
});
deliveryOrderRequestDto.setProductTotal(productInfos.stream().mapToInt(t -> t.getCumulatedTotal()).sum());
if(flag.get()) {
return null;
}
}
......
......@@ -977,14 +977,20 @@ public class MCCafeOrderServiceImpl implements MCCafeOrderService {
return sendPaySuccessNoticeMessage();
}
CreateDeliveryVo createDeliveryVo = deliveryAdapter.buildDeliveryOrderRequestDto(orderBean, storeInfo, deliveryCallBackUrl, downstreamThirdOrderCode);
CreateDeliveryOrderResponseDto deliveryResponse = null;
if(null != createDeliveryVo) {
//创建配送单
CreateDeliveryOrderResponseDto deliveryResponse = deliveryFeiginClient.deliveryOrderAdd(createDeliveryVo);
deliveryResponse = deliveryFeiginClient.deliveryOrderAdd(createDeliveryVo);
}
//创建配送单失败,更新订单为异常单
if (deliveryResponse == null || RESPONSE_SUCCESS_CODE != deliveryResponse.getCode() || deliveryResponse.getData() == null) {
String deliveryId = deliveryResponse != null && deliveryResponse.getData() != null ? deliveryResponse.getData().getDeliveryId() : "";
String operator = "系统" ;
String abnormalDesc = "配送异常";
if(StringUtils.isNotBlank(deliveryResponse.getMsg())) {
if(null == createDeliveryVo) {
abnormalDesc = "grilling过长";
}
if(null != deliveryResponse && StringUtils.isNotBlank(deliveryResponse.getMsg())) {
abnormalDesc = deliveryResponse.getMsg();
}
updateDeliveryAbnormal(orderBean.getCompanyId(), orderBean.getOid(), deliveryId, operator, abnormalDesc);
......
......@@ -83,7 +83,6 @@ import com.freemud.application.sdk.api.ordercenter.request.OrderConditionsReq;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtendedReq;
import com.freemud.application.sdk.api.ordercenter.request.carpark.ParkingOrderCreateReq;
import com.freemud.application.sdk.api.ordercenter.request.create.OrderPayItemCreateReq;
import com.freemud.application.sdk.api.ordercenter.response.carpark.OrderResp;
import com.freemud.application.sdk.api.ordercenter.response.BaseDownLoadResponse;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoReqs;
......@@ -128,6 +127,7 @@ import com.freemud.sdk.api.assortment.payment.service.StandardPaymentService;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
......@@ -178,10 +178,6 @@ public class OrderServiceImpl implements Orderservice {
private String cloud_print_exchange;
@Value("${mcCafe.fengniao.storeId}")
private String fnStoreId;
@Value("${svcSwith}")
private Boolean svcSwitch;
@Value("${partnerId}")
private String partnerId;
/**
* coco商户
......@@ -552,9 +548,6 @@ public class OrderServiceImpl implements Orderservice {
}
//支付回掉成功标记
redisCache.save(RedisKeyConstant.KGD_PAYMENT_CALLBACK_FMID + message.getOut_trade_no(), message.getOut_trade_no(), 10L, TimeUnit.MINUTES);
log.info("调用券码核销==" + message.getTrans_id());
verificationCoupon(message.getTrans_id());
log.info("调用券码结束=="+ message.getTrans_id());
return sendPaySuccessNoticeMessage();
}
......@@ -631,6 +624,9 @@ public class OrderServiceImpl implements Orderservice {
if (jsonObject.containsKey("code")) {
Integer code = (Integer) jsonObject.get("code");
if (Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS_0, code) || Objects.equals(ResponseCodeConstant.RESPONSE_SUCCESS, code)) {
log.info("调用券码核销==" + message.getTrans_id());
verificationCoupon(message.getTrans_id());
log.info("调用券码结束=="+ message.getTrans_id());
return newSendPaySuccessNoticeMessage();
} else {
return newSendPayFaileMessage();
......@@ -1765,7 +1761,8 @@ public class OrderServiceImpl implements Orderservice {
* @param orderRefundVo
* @param orderBean
*/
private BaseResponse partnerNoTakeOrder(OrderRefundVo orderRefundVo, OrderBean orderBean, String fatherOrderId,AfterSalesType afterSalesType,Boolean isRefundDeliveryFee) {
@SneakyThrows
private BaseResponse partnerNoTakeOrder(OrderRefundVo orderRefundVo, OrderBean orderBean, String fatherOrderId, AfterSalesType afterSalesType, Boolean isRefundDeliveryFee) {
com.freemud.application.sdk.api.base.BaseResponse<OrderRefundResponse> response = null;
Long refundId = System.currentTimeMillis();
String partnerId = orderBean.getCompanyId();
......
......@@ -71,9 +71,9 @@ public class MallOrderServiceImplTest {
@Test
public void f1() {
mcCafeOrderService.createOrder(JSON.parseObject("{\"channelType\":\"saas\",\"partnerId\":\"1206\",\"appId\":\"wx6816a0b007741702\",\"sessionId\":\"ef7f2839e35e7a4f7d21dd1fc26157a4862698a5\",\"orderType\":1,\"menuType\":\"saas\",\"shopId\":\"1450026\",\"couponCode\":\"\",\"payChannelType\":1,\"reachStoreType\":5,\"takeMealFlag\":\"0\",\"needInvoice\":0,\"orderRemark\":\"\",\"receiveId\":\"\"}", CreateOrderVo.class),
mcCafeOrderService.createOrder(JSON.parseObject("{\"channelType\":\"saas\",\"partnerId\":\"1206\",\"appId\":\"wx6816a0b007741702\",\"sessionId\":\"db47c0d7f8238e7495cef5525d91b12befa6ce35\",\"orderType\":1,\"menuType\":\"saas\",\"shopId\":\"1450167\",\"couponCode\":\"\",\"buyMonthlyCard\":1,\"receiveId\":\"\"}", CreateOrderVo.class),
new StoreResponse.BizVO(),
JSON.parseObject("{\"activityDiscountsDtos\":[{\"activityCode\":\"CZJG2020091815220412683\",\"activityName\":\"terry0918eee\",\"activityType\":23,\"discountAmount\":-2200}],\"deliveryAmount\":0,\"discountDeliveryAmount\":0,\"isDiscountDelivery\":false,\"originalTotalAmount\":7100,\"packageAmount\":0,\"products\":[{\"activityDiscountsDtos\":[{\"activityCode\":\"CZJG2020091815220412683\",\"activityName\":\"terry0918eee\",\"activityType\":23,\"actualActivityGoodsNumber\":1,\"discountAmount\":2200}],\"activityType\":2,\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"categoryName\":\"\",\"classificationId\":\"\",\"classificationName\":\"\",\"customerCode\":\"508120\",\"extraList\":[],\"hasProductCoupon\":false,\"materialList\":[],\"originalPrice\":2300,\"picture\":\"https://picture.sandload.cn/1598681143874.png\",\"productCode\":\"901126\",\"qty\":1,\"skuId\":\"184440231236332839\",\"skuName\":\"红茶拿铁-中杯\",\"spuId\":\"184440231236332839\",\"spuName\":\"红茶拿铁-中杯\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":2200},{\"activityDiscountsDtos\":[],\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"classificationId\":\"\",\"classificationName\":\"\",\"comboProducts\":[{\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"customerCode\":\"2217\",\"extraList\":[],\"hasProductCoupon\":false,\"isFixedProduct\":false,\"materialList\":[],\"originalPrice\":1900,\"parentProductId\":\"184437712179293469\",\"picture\":\"https://picture.sandload.cn/1598675643524.png\",\"productType\":6,\"qty\":2,\"skuId\":\"181574788508098858\",\"skuName\":\"中杯拿铁\",\"spuId\":\"181574788508098858\",\"spuName\":\"中杯拿铁\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":0,\"unit\":\"\",\"weight\":0.0},{\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"customerCode\":\"508134\",\"extraList\":[],\"hasProductCoupon\":false,\"isFixedProduct\":false,\"materialList\":[],\"originalPrice\":2100,\"parentProductId\":\"184437712179293469\",\"picture\":\"https://picture.sandload.cn/1598675940164.png\",\"productType\":6,\"qty\":2,\"skuId\":\"184434761663638803\",\"skuName\":\"经典芝士蛋糕\",\"spuId\":\"184434761663638803\",\"spuName\":\"经典芝士蛋糕\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":3200,\"unit\":\"\",\"weight\":0.0}],\"customerCode\":\"508131\",\"extraList\":[],\"hasProductCoupon\":false,\"materialList\":[],\"originalPrice\":4800,\"picture\":\"https://picture.sandload.cn/1598678713405.png\",\"productCode\":\"508131\",\"productType\":6,\"qty\":2,\"skuId\":\"184437712179293469\",\"skuName\":\"早餐啡常搭\",\"spuId\":\"184437712179293469\",\"spuName\":\"早餐啡常搭\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":0,\"unit\":\"\",\"weight\":0.0}],\"totalAmount\":4900,\"totalDiscountAmount\":2200}", ShoppingCartGoodsDto.class),
JSON.parseObject("{\"activityDiscountsDtos\":[],\"deliveryAmount\":0,\"discountDeliveryAmount\":0,\"isDiscountDelivery\":false,\"originalTotalAmount\":500,\"packageAmount\":0,\"payCardFee\":0,\"products\":[{\"activityDiscountsDtos\":[],\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"categoryName\":\"\",\"classificationId\":\"\",\"classificationName\":\"\",\"customerCode\":\"110604\",\"extraList\":[],\"hasProductCoupon\":false,\"materialList\":[{\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"customerCode\":\"100072_2\",\"extraList\":[],\"hasProductCoupon\":false,\"originalPrice\":0,\"productCode\":\"100072_2\",\"qty\":1,\"specialExtra\":[],\"spuId\":\"189906104835159083\",\"spuName\":\"多糖浆\",\"stockLimit\":false,\"tax\":0.0,\"totalDiscountAmount\":0}],\"originalPrice\":0,\"picture\":\"https://picture.sandload.cn/1605493364971.png\",\"productCode\":\"110604\",\"qty\":1,\"skuId\":\"191616363987631633\",\"skuName\":\"4test\",\"specialExtra\":[{\"attributeId\":\"187910205014545213\",\"attributeName\":\"多冰\",\"specialCode\":\"110604_200002_2\"}],\"spuId\":\"191612801712731697\",\"spuName\":\"5test\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":0,\"unit\":\"\",\"weight\":0.0},{\"activityDiscountsDtos\":[],\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"categoryName\":\"套餐\",\"classificationId\":\"\",\"classificationName\":\"\",\"comboProducts\":[{\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"customerCode\":\"110604\",\"extraList\":[],\"hasProductCoupon\":false,\"isFixedProduct\":true,\"materialList\":[{\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"customerCode\":\"100072_2\",\"extraList\":[],\"hasProductCoupon\":false,\"originalPrice\":0,\"productCode\":\"100072_2\",\"qty\":1,\"specialExtra\":[],\"spuId\":\"189906104835159083\",\"stockLimit\":false,\"tax\":0.0,\"totalDiscountAmount\":0}],\"originalPrice\":0,\"parentProductId\":\"191724441979486472\",\"picture\":\"https://picture.sandload.cn/1605493364971.png\",\"productType\":6,\"qty\":1,\"skuId\":\"191616363987631633\",\"skuName\":\"4test\",\"specialExtra\":[{\"attributeId\":\"187994174169235473\",\"attributeName\":\"少冰\",\"specialCode\":\"110604_200002_1_1\"}],\"spuId\":\"191612801712731697\",\"spuName\":\"5test\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":0,\"unit\":\"\",\"weight\":0.0},{\"attributeNames\":\"{\\\"attributeNames\\\":\\\"\\\"}\",\"customerCode\":\"508664\",\"extraList\":[],\"hasProductCoupon\":false,\"isFixedProduct\":false,\"materialList\":[],\"originalPrice\":500,\"parentProductId\":\"191724441979486472\",\"picture\":\"https://picture.sandload.cn/1604910380410.png\",\"productType\":6,\"qty\":1,\"skuId\":\"191003415228296969\",\"skuName\":\"巴斯克芝士蛋糕\",\"spuName\":\"巴斯克芝士蛋糕\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":0,\"unit\":\"\",\"weight\":0.0}],\"customerCode\":\"121431\",\"extraList\":[],\"hasProductCoupon\":false,\"materialList\":[],\"originalPrice\":0,\"picture\":\"https://picture.sandload.cn/1605605774124.png\",\"productCode\":\"121431\",\"productType\":6,\"qty\":1,\"skuId\":\"191724441979486472\",\"skuName\":\"啡常搭\",\"specialExtra\":[],\"spuId\":\"191724441979486472\",\"spuName\":\"啡常搭\",\"stockLimit\":false,\"tax\":0.01,\"taxId\":\"\",\"totalDiscountAmount\":0,\"unit\":\"\",\"weight\":0.0}],\"totalAmount\":500,\"totalDiscountAmount\":0}", ShoppingCartGoodsDto.class),
new OrderExtendedReq(),
OrderClientType.SAAS,"www");
}
......
package cn.freemud.management.adapter;
import com.alibaba.fastjson.JSONObject;
import com.freemud.application.sdk.api.base.SDKCommonBaseContextWare;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.sdk.api.assortment.order.request.order.MultiOrderRefundRequest;
import com.freemud.sdk.api.assortment.order.response.order.QueryOrdersResponse;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -43,6 +43,7 @@ public class PaymentSdkAdapter {
return refundRequestDTO;
}
@SneakyThrows
public MultiOrderRefundRequest getMultiOrderPayRefundRequest(QueryOrdersResponse.DataBean.OrderBean orderBean, BigDecimal refundAmount) {
MultiOrderRefundRequest multiQueryRequest = new MultiOrderRefundRequest();
multiQueryRequest.setStationId("1");
......@@ -50,7 +51,7 @@ public class PaymentSdkAdapter {
multiQueryRequest.setStoreId(orderBean.getShopId());
multiQueryRequest.setFmId("");
multiQueryRequest.setRefundAmount(Long.valueOf(String.valueOf(refundAmount)));
multiQueryRequest.setRefundTradeNo(getRefundSerialNo().toString());
multiQueryRequest.setRefundTradeNo(String.valueOf(getRefundSerialNo()));
multiQueryRequest.setStoreId(orderBean.getShopId());
multiQueryRequest.setNotifyUrl(refundNotifyCallback);
multiQueryRequest.setVer("V1");
......
......@@ -8,7 +8,7 @@
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>1.5.0-SNAPSHOT</version>
<version>1.6.7-SNAPSHOT</version>
<artifactId>ordercenter-sdk</artifactId>
<dependencies>
......
......@@ -287,11 +287,11 @@ public class ShoppingCartConvertAdapter {
List<ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods> materialList = new ArrayList<>(0);
for (CartGoods.MaterialGoods materialGoods : comboxGoods.getProductMaterialList()) {
ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods goods = new ShoppingCartGoodsDto.CartGoodsDetailDto.MaterialGoods();
goods.setSpuId(materialGoods.getSpuId());
goods.setSpuName(materialGoods.getSpuName());
goods.setSpuId(StringUtils.isEmpty(materialGoods.getSpuId())?"":materialGoods.getSpuId());
goods.setSpuName(StringUtils.isEmpty(materialGoods.getSpuName()) ? "":materialGoods.getSpuName());
goods.setOriginalPrice(null != materialGoods.getOriginalPrice() ? materialGoods.getOriginalPrice() : 0);
goods.setSalePrice(materialGoods.getFinalPrice());
goods.setQty(cartGoods.getQty());
goods.setSalePrice(null == materialGoods.getFinalPrice() ? materialGoods.getFinalPrice() : 0);
goods.setQty(null == cartGoods.getQty() ? 0 : cartGoods.getQty());
goods.setTotalDiscountAmount(0);
goods.setProductCode(materialGoods.getCustomerCode());
goods.setCustomerCode(materialGoods.getCustomerCode());
......
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