Commit a006226a by 孙昱

Merge branch 'qa' of gitlab.freemud.com:order-group-application/order-group into qa

parents 26e58eb6 68e2ee75
...@@ -56,17 +56,21 @@ public class CalculationCommonService { ...@@ -56,17 +56,21 @@ public class CalculationCommonService {
/** /**
* 使用促销算价赋值行记录 * 使用促销算价赋值行记录
*/ */
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods = discountResult.getGoods(); List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goods = null;
long totalOriginalAmount = 0L,totalAmount = 0L,totalPackageAmount = 0L; if (discountResult != null && CollectionUtils.isNotEmpty(discountResult.getGoods())) {
long originalAmount = 0L,amount = 0L,packageAmount =0L; goods = discountResult.getGoods();
}
long totalOriginalAmount = 0L, totalAmount = 0L, totalPackageAmount = 0L;
long originalAmount = 0L, amount = 0L, packageAmount = 0L;
for (CartGoods cartGoods : cartGoodsList) { for (CartGoods cartGoods : cartGoodsList) {
originalAmount = 0L; originalAmount = 0L;
amount = 0L; amount = 0L;
packageAmount =0L; packageAmount = 0L;
CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(cartGoods.getCartGoodsUid())).findFirst().get(); CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods find = goods.stream().filter((k) -> k.getCartGoodsUid().equals(cartGoods.getCartGoodsUid())).findFirst().get();
if (find==null) continue; if (find == null) continue;
//成交价行记录 //成交价行记录
amount += find.getRealAmount()*cartGoods.getQty(); //amount += find.getRealAmount() * cartGoods.getQty();
amount += find.getRealAmount();
cartGoods.setAmount(amount); cartGoods.setAmount(amount);
totalAmount += amount; totalAmount += amount;
//原价行记录 //原价行记录
...@@ -454,7 +458,7 @@ public class CalculationCommonService { ...@@ -454,7 +458,7 @@ public class CalculationCommonService {
List<Integer> types = new ArrayList<>(); List<Integer> types = new ArrayList<>();
types.add(ActivityTypeEnum.TYPE_2.getCode()); types.add(ActivityTypeEnum.TYPE_2.getCode());
types.add(ActivityTypeEnum.TYPE_1.getCode()); types.add(ActivityTypeEnum.TYPE_1.getCode());
if (CollectionUtils.isEmpty(discountResult.getGoods())) return; if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods())) return;
List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goodsList = discountResult.getGoods() List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods> goodsList = discountResult.getGoods()
.stream() .stream()
......
...@@ -45,6 +45,9 @@ public class FullSharingService { ...@@ -45,6 +45,9 @@ public class FullSharingService {
, ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo , ShoppingCartGoodsResponseVo shoppingCartGoodsResponseVo
, ActivityQueryDto activityQueryDto) { , ActivityQueryDto activityQueryDto) {
if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods())) {
return;
}
shoppingCartGoodsResponseVo.setActivityTip(new ActivityTip()); shoppingCartGoodsResponseVo.setActivityTip(new ActivityTip());
List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>(); List<ActivityTypeEnum> activityTypeEnums = new LinkedList<>();
/** /**
...@@ -323,6 +326,7 @@ public class FullSharingService { ...@@ -323,6 +326,7 @@ public class FullSharingService {
public HashMap<String, Long> drawnFullDiscount(List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial> materialDiscount,List<Integer> typeEnums,int type) { public HashMap<String, Long> drawnFullDiscount(List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial> materialDiscount,List<Integer> typeEnums,int type) {
HashMap<String, Long> hashMap = new HashMap<>(); HashMap<String, Long> hashMap = new HashMap<>();
for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial smallMaterial : materialDiscount) { for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.SmallMaterial smallMaterial : materialDiscount) {
if (CollectionUtils.isEmpty(smallMaterial.getDiscounts())) continue;
for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount discount : smallMaterial.getDiscounts()) { for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount discount : smallMaterial.getDiscounts()) {
if (typeEnums.contains(discount.getType())) { if (typeEnums.contains(discount.getType())) {
hashMap.put(discount.getGoodsId(),discount.getDiscount()); hashMap.put(discount.getGoodsId(),discount.getDiscount());
...@@ -338,6 +342,7 @@ public class FullSharingService { ...@@ -338,6 +342,7 @@ public class FullSharingService {
public HashMap<String, Long> drawnFullDiscount(List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GroupCombox> groupCombDiscount,List<Integer> typeEnums) { public HashMap<String, Long> drawnFullDiscount(List<CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GroupCombox> groupCombDiscount,List<Integer> typeEnums) {
HashMap<String, Long> hashMap = new HashMap<>(); HashMap<String, Long> hashMap = new HashMap<>();
for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GroupCombox com : groupCombDiscount) { for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GroupCombox com : groupCombDiscount) {
if (CollectionUtils.isEmpty(com.getDiscounts())) continue;
for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount discount : com.getDiscounts()) { for (CalculationSharingDiscountResponseDto.CalculationDiscountResult.Goods.GoodsDiscount discount : com.getDiscounts()) {
if (typeEnums.contains(discount.getType())) { if (typeEnums.contains(discount.getType())) {
hashMap.put(discount.getGoodsId(),discount.getDiscount()); hashMap.put(discount.getGoodsId(),discount.getDiscount());
......
...@@ -46,7 +46,7 @@ public class GiftSharingService { ...@@ -46,7 +46,7 @@ public class GiftSharingService {
, ShoppingCartInfoRequestVo shoppingCartInfoRequestVo , ShoppingCartInfoRequestVo shoppingCartInfoRequestVo
, ActivityQueryDto activityQueryDto) { , ActivityQueryDto activityQueryDto) {
if (CollectionUtils.isEmpty(discountResult.getSendGoods())) { if (discountResult == null || CollectionUtils.isEmpty(discountResult.getGoods())) {
return; return;
} }
String menuType = shoppingCartInfoRequestVo == null ? null : shoppingCartInfoRequestVo.getMenuType(); String menuType = shoppingCartInfoRequestVo == null ? null : shoppingCartInfoRequestVo.getMenuType();
......
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