From aecf1e6808cd9eca68f5ec87340bd6c92f8c464c Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Thu, 29 Jul 2021 20:40:26 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/api_score_meger' into api_score_meger --- zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java | 80 ++++++++++++++++++--------------------- 1 files changed, 37 insertions(+), 43 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java index 2b11597..83b57f5 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java @@ -524,34 +524,34 @@ * 检查产品销售次数 */ private void checkSealLimit(SysOrder pageOrder) { - pageOrder.getItems().forEach(item->{ - ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId()); + pageOrder.getItems().forEach(item->{ + ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId()); - //最大销售次数检测 - Integer maxNum = shopGoods.getCarMaxSaleCount(); - if (maxNum != null && maxNum != 0) { - Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(),null); - if ((buyNum + item.getCount()) > maxNum) { - throw new GlobleException(shopGoods.getName() + "已超过最大销售数量"); - } - if ((buyNum + item.getCount()) == maxNum) { - if (!shopGoods.getStaus().equals(Dictionary.BUSINESS_STATE_DOWN)) { - shopGoods.setStaus(Dictionary.BUSINESS_STATE_DOWN); - shoppingGoodsDao.update(shopGoods); - } - } - } - //每人限购次数检测 - Integer onceCount = shopGoods.getIsOnce(); - if(onceCount!=null && onceCount!=0){ - Integer buyOnceCount = orderItemDao.selectByGoodsId(shopGoods.getId(),pageOrder.getVipId()); + //最大销售次数检测 + Integer maxNum = shopGoods.getCarMaxSaleCount(); + if (maxNum != null && maxNum != 0) { + Integer buyNum = orderItemDao.selectByGoodsId(shopGoods.getId(),null); + if ((buyNum + item.getCount()) > maxNum) { + throw new GlobleException(shopGoods.getName() + "已超过最大销售数量"); + } + if ((buyNum + item.getCount()) == maxNum) { + if (!shopGoods.getStaus().equals(Dictionary.BUSINESS_STATE_DOWN)) { + shopGoods.setStaus(Dictionary.BUSINESS_STATE_DOWN); + shoppingGoodsDao.update(shopGoods); + } + } + } + //每人限购次数检测 + Integer onceCount = shopGoods.getIsOnce(); + if(onceCount!=null && onceCount!=0){ + Integer buyOnceCount = orderItemDao.selectByGoodsId(shopGoods.getId(),pageOrder.getVipId()); - if ((buyOnceCount + item.getCount()) > onceCount) { - throw new GlobleException(shopGoods.getName() + "每人限购"+onceCount+"次"); - } - } + if ((buyOnceCount + item.getCount()) > onceCount) { + throw new GlobleException(shopGoods.getName() + "每人限购"+onceCount+"次"); + } + } - }); + }); } @@ -666,15 +666,15 @@ //添加自己的积分 if(selfScore>0){ - scoreVipDetailService.addScore( - vipInfo.getId(), - pageOrder.getStaffId(), - pageOrder.getShopId(), - selfScore, - pageOrder.getId(), - ScoreVipDetail.SCORE_VIP_TYPE_CASH, - "消费奖励" - ); + scoreVipDetailService.addScore( + vipInfo.getId(), + pageOrder.getStaffId(), + pageOrder.getShopId(), + selfScore, + pageOrder.getId(), + ScoreVipDetail.SCORE_VIP_TYPE_CASH, + "消费奖励" + ); } if(vipInfo.getRecommendId()!=null){ @@ -1241,8 +1241,7 @@ if(zsConsumeAchieve){ if(sysOrderItem.getPrice()>0){ - - + //大于0 不修改金额 }else{ //等于0取原价 @@ -1252,7 +1251,6 @@ puse.setPrice(goodsAssemble.getPrice()); } } - }else{ puse.setPrice(0D); } @@ -1356,11 +1354,7 @@ //赠送项目是否计算消耗业绩否则 赠送产品按原价计算消耗 boolean zsConsumeAchieve = projServicesService.skipServiceOrderStep(Dictionary.ZS_CONSUME_ACHIEVE); if(zsConsumeAchieve){ - if(sysOrderItem.getPrice()>0){ - puse.setPrice(sysOrderItem.getZkPrice()); - }else{ - puse.setPrice(sysOrderItem.getShoppingGoods().getSealPice()); - } + puse.setPrice(sysOrderItem.getShoppingGoods().getSealPice()); }else{ puse.setPrice(0D); } @@ -1692,7 +1686,7 @@ int sub = sysProjUse.getSurplusCount() - item.getCount(); if (sub < 0) { - throw new GlobleException("项目余次不足"); + throw new GlobleException("项目余次不足"); }else if(sub==0){ sysProjUse.setIsOver(Dictionary.FLAG_YES_Y); sysProjUse.setStatus(Dictionary.TAOCAN_STATUS_WX); -- Gitblit v1.9.1