Commit 6ba4da3c by xiaoer.li@freemud.com

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

parents 2b13053f 660700a6
......@@ -88,12 +88,9 @@
| 2.2.18-SNAPSHOT| 抖音支付新增抖音单号和openId | 张志恒 | 2020-12-4 |
| 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 |
| 2.1.10-RELEASE | coco | 刘鹏飞 | 2020-12-17 |
| 2.1.11-RELEASE | 农工商添加设备号 | 梁崇福 | 2020-12-17 |
| 2.1.12-RELEASE | coco定制优惠券核销 | 刘鹏飞 | 2020-12-24 |
| 2.1.19-SNAPSHOT | 增加配送类型字段 | 王航航 | 2020-12-22 |
package cn.freemud.entities.vo;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
@Data
public class PlatformPaySuccessRequest {
@NotEmpty(message = "orderCode 不能为空")
private String orderCode;
@NotEmpty(message = "商户号 不能为空")
private String partnerId;
}
......@@ -59,4 +59,10 @@ public class SellCouponCreateOrderVo {
// @NotEmpty(message = "version 版本号不能为空")
private String version;
/**
* 渠道 1 saas 2 img 爱马哥 默认saas 3. iwc i围餐
*/
private String channel;
}
......@@ -147,8 +147,4 @@ public interface Orderservice {
BaseResponse timeOutOrderRefund(TimeOutOrderVo timeOutOrderVo);
BaseResponse platformPaysuccess(PlatformPaySuccessRequest requestVo);
}
......@@ -132,7 +132,7 @@ public class AppOrderServiceImpl implements AppOrderService {
CreatePrepayRequestDto createPrepayRequestDto = orderAdapter.convertToCreatePrepayRequestDto(createPrepayVo.getPartnerId(), createPrepayVo.getPayAppId(), createPrepayVo.getOpenId(), faceCode,
cardCode, createPrepayVo.getPayCode(), createOrderOperateDto.getFatherOrderBean(), createOrderOperateDto.getProductOrderBean(), createOrderOperateDto.getTotalAmount(),
createOrderOperateDto.getCardAmount(), extInfo, transId, OrderClientType.APP);
redisService.savePaymentTransIdOrder(RedisUtil.getPaymentTransIdOrderKey(transId), productOrderBean.getOid(), 30L, TimeUnit.MINUTES);
redisService.savePaymentTransIdOrder(RedisUtil.getPaymentTransIdOrderKey(transId), productOrderBean.getOid(), 60L, TimeUnit.MINUTES);
return orderservice.createPrepayOrder(createPrepayRequestDto);
}
......
......@@ -1280,24 +1280,6 @@ public class OrderServiceImpl implements Orderservice {
return ResponseUtil.success();
}
@Override
public BaseResponse platformPaysuccess(PlatformPaySuccessRequest requestVo) {
BaseQueryOrderRequest baseQueryOrderRequest = new BaseQueryOrderRequest();
baseQueryOrderRequest.setOrderId(requestVo.getOrderCode());
baseQueryOrderRequest.setTrackingNo(LogThreadLocal.getTrackingNo());
QueryOrderByIdResponse queryOrderByIdResponse = orderCenterSdkService.queryOrderById(baseQueryOrderRequest);
if (!RESPONSE_SUCCESS_CODE.equals(queryOrderByIdResponse.getErrcode()) || queryOrderByIdResponse.getData() == null) {
return ResponseUtil.error(ResponseResult.ORDER_QUERYORDER_ERROR);
}
// 扣减储值卡
// 扣减券
// 扣减积分
return ResponseUtil.success();
}
private String getRedpacketsPicture(String activityId) {
if (StringUtils.isNotBlank(activityId)) {
......@@ -2517,7 +2499,8 @@ public class OrderServiceImpl implements Orderservice {
orderClient = OrderClientType.APP;
}
//抖音小程序
if(PayChannelType.TIKTOKPAY.getIndex().equals(createOrderVo.getPayChannelType()) && "5".equalsIgnoreCase(createOrderVo.getChannel())) {
if("5".equalsIgnoreCase(createOrderVo.getChannel())) {
createOrderVo.setPayChannelType(PayChannelType.TIKTOKPAY.getIndex());
orderClient = OrderClientType.TIKTOKPAY;
}
long totalAmount = 0;
......@@ -2816,7 +2799,7 @@ public class OrderServiceImpl implements Orderservice {
orderPayResponse.setPayMode(PayChannelType.ALIPAY.getEbcode());
}
//抖音支付
if(orderBean.getPayChannelType().equalsIgnoreCase(PayChannelType.TIKTOKPAY.getIndex().toString())){
if(PayChannelType.TIKTOKPAY.getIndex().toString().equalsIgnoreCase(orderBean.getPayChannelType())){
orderPayResponse.setPayMode(PayChannelType.TIKTOKPAY.getEbcode());
}
......
......@@ -37,6 +37,7 @@ import com.freemud.application.sdk.api.log.LogThreadLocal;
import com.freemud.application.sdk.api.ordercenter.enums.NewOrderStatus;
import com.freemud.application.sdk.api.ordercenter.enums.OrderClientType;
import com.freemud.application.sdk.api.ordercenter.enums.OrderType;
import com.freemud.application.sdk.api.ordercenter.enums.PayChannelType;
import com.freemud.application.sdk.api.ordercenter.request.OrderChangeStateReq;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.application.sdk.api.ordercenter.request.create.*;
......@@ -409,6 +410,11 @@ public class SellCouponOrderServiceImpl {
if(UserLoginChannelEnum.APP.getCode().equals(userLoginInfoDto.getChannel())){
orderClient = OrderClientType.APP.getIndex();
}
//抖音小程序
if("5".equalsIgnoreCase(requestVo.getChannel())) {
request.setPayChannel(PayChannelType.TIKTOKPAY.getIndex().toString());
orderClient = OrderClientType.TIKTOKPAY.getIndex();
}
String partnerId = userLoginInfoDto.getPartnerId();
request.setOrderClient(orderClient);
request.setPartnerId(partnerId);
......@@ -493,6 +499,10 @@ public class SellCouponOrderServiceImpl {
request.setOrderExtended(orderAdapter.saveStoreInfo(storeInfo));
request.setOperator(userLoginInfoDto.getNickName());
request.setAppId(userLoginInfoDto.getWxAppId());
if("5".equalsIgnoreCase(requestVo.getChannel().toString())){
request.setPayChannelType(PayChannelType.TIKTOKPAY.getIndex());
}
request.setPayChannel(requestVo.getChannel());
return request;
}
......
......@@ -136,9 +136,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
giftMap.put(giftProduct.getOcid(),giftProduct.getQty());
});
}
// 赠品原总价
Long giftOriTotalAmount = 0L;
Long itemAmount = 0L;
List<ProductVo> productVos = new ArrayList<>();
if(null != masterProducts && !masterProducts.isEmpty()){
for(ProductVo product : masterProducts){
......@@ -156,8 +154,7 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
// 商品现单价 = 商品现单价+小料现单价
smallMaterialOriTotal = smallMaterialOriTotal == null ? 0 : smallMaterialOriTotal;
product.setOriginalPrice(smallMaterialOriTotal + (product.getOriginalPrice() == null ? 0L : product.getOriginalPrice()));
giftOriTotalAmount = giftOriTotalAmount + product.getOriginalPrice() * giftQty;
itemAmount = itemAmount + product.getOriginalPrice() * product.getQty();
// 如果商品参加了第二件半价活动,要把该行拆成数量为1的多行
QueryOrdersResponse.DataBean.OrderBean.ProductBean productBean = productMap.get(product.getCid());
......@@ -191,8 +188,8 @@ public class CocoOrderRelationServiceImpl implements OrderRelationService {
masterProducts.addAll(productVos);
queryOrderResponseVo.setProducts(masterProducts);
// 商品总价需要包含赠品的价格
queryOrderResponseVo.setItemAmount(queryOrderResponseVo.getItemAmount() + giftOriTotalAmount);
// 商品总价
queryOrderResponseVo.setItemAmount(itemAmount);
}
......
......@@ -119,5 +119,6 @@ public class OrderConditionsReq {
private String appId;
//是否删除
private Integer isDeleted;
//营销活动类型
private Integer marketingType;
}
......@@ -156,7 +156,7 @@ public class ItemServiceImpl implements ItemService {
if (ResponseCodeConstant.RESPONSE_SUCCESS.equals(productInfosDto.getErrcode())
&& productInfosDto.getData() != null
&& CollectionUtils.isNotEmpty(productInfosDto.getData().getProducts())) {
productInfosDto.getData().getProducts().parallelStream().forEach(productBean -> {
productInfosDto.getData().getProducts().stream().forEach(productBean -> {
//多规格获取sku信息
GetProductsVo getProductsVo = new GetProductsVo();
getProductsVo.setSkuId(productBean.getPid());
......@@ -194,8 +194,8 @@ public class ItemServiceImpl implements ItemService {
ProductListDto productListDto = storeItemClient.getSpuIdsBySkuIds(bySkuIdsDto);
if (ResponseCodeConstant.RESPONSE_SUCCESS.equals(productListDto.getErrcode())
&& CollectionUtils.isNotEmpty(productListDto.getData())) {
productListDto.getData().parallelStream().forEach(product -> {
product.getSkuList().parallelStream().forEach(skuProductBean -> {
productListDto.getData().stream().forEach(product -> {
product.getSkuList().stream().forEach(skuProductBean -> {
if (resultMap.get(skuProductBean.getSkuId()) != null) {
GetProductsVo getProductsVo = resultMap.get(skuProductBean.getSkuId());
getProductsVo.setSpuId(product.getPid());
......@@ -232,5 +232,4 @@ public class ItemServiceImpl implements ItemService {
}
}
......@@ -1075,7 +1075,8 @@ public class ShoppingCartNewServiceImpl implements ShoppingCartNewService {
private CartGoods convert2ShopCartGoods(GetMemberInfoRequestDto.OrderItemRequest each){
CartGoods card = new CartGoods();
int saleValue = (each.getProductPrice() * each.getProductQuantity() - each.getProductSharePrice()) / each.getProductQuantity();
int sharePrice = each.getProductSharePrice() == null ? 0 : each.getProductSharePrice();
int saleValue = (each.getProductPrice() * each.getProductQuantity() - sharePrice) / each.getProductQuantity();
card.setAmount(Long.valueOf(saleValue));
card.setOriginalPrice(each.getProductPrice() == null ? 0L : Long.valueOf(each.getProductPrice()));
card.setQty(each.getProductQuantity());
......
......@@ -475,6 +475,7 @@ public class CouponDiscountCalculation {
private Long createProductRequest(List<CartGoods> cartGoods, List<CouponProductVo> productList) {
Long totalAmount = 0L;
try {
for (CartGoods cartGood : cartGoods) {
// 剔除商品券得商品
if (StringUtils.isEmpty(cartGood.getSkuId()) && StringUtils.isEmpty(cartGood.getSpuId())) {
......@@ -502,6 +503,9 @@ public class CouponDiscountCalculation {
productList.add(product);
totalAmount = totalAmount +product.getAmount() * cartGood.getQty();
}
} catch (NumberFormatException e) {
throw new ServiceException(ResponseResult.SYSTEM_ERROR);
}
return totalAmount;
}
......
......@@ -280,11 +280,14 @@ public class CouponTest {
*/
List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtoList = new ArrayList<>();
shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
/*
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product);
cartGoodsDetailDtoList.add(cartGoodsDetailDto);
}
*/
}
......@@ -315,11 +318,14 @@ public class CouponTest {
*/
List<ShoppingCartGoodsDto.CartGoodsDetailDto> cartGoodsDetailDtoList = new ArrayList<>();
shoppingCartGoodsResponseVo.setProducts(cartGoodsList);
/*
for (CartGoods product : shoppingCartGoodsResponseVo.getProducts()) {
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(product.getCartGoodsUid())).findFirst().get();
ShoppingCartGoodsDto.CartGoodsDetailDto cartGoodsDetailDto = calculationCommonService.convertCartGoods2DetailGoodsList(find, product);
cartGoodsDetailDtoList.add(cartGoodsDetailDto);
}
*/
//ShoppingCartInfoRequestVo
String shoppingCartInfoRequestVoStr = "{\"premiumExchangeActivity\":{\"activityCode\":\"MEHG2020092914160146595\",\"activityName\":\"丹妮加价购活动\",\"products\":[{\"attributes\":[],\"originalPrice\":1300,\"qty\":1,\"skuId\":\"186550397673068596\",\"skuName\":\"桔子单品12\",\"spuId\":\"186550397673068596\"}]},\"shoppingCartInfoRequestVo\":{\"flag\":0,\"menuType\":\"saas\",\"orderType\":1,\"partnerId\":\"2399\",\"reachStoreType\":4,\"receiveId\":\"3584084950985469155\",\"sessionId\":\"146e3ced5884092de0ba3d0369cf7dc338b515c8\",\"shopId\":\"716001\",\"useCustomerScore\":2,\"version\":\"2.0.1\"}}";
GetShoppingCartGoodsApportionRequestVo getShoppingCartGoodsApportionRequestVo = JSONObject.parseObject(shoppingCartInfoRequestVoStr, new TypeReference<GetShoppingCartGoodsApportionRequestVo>() {
......
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