Browse Source

仅医美机构可见bugfix2

chao 3 năm trước cách đây
mục cha
commit
2fa6b2aa4e

+ 4 - 4
src/main/java/com/caimei365/commodity/components/PriceUtilService.java

@@ -100,7 +100,7 @@ public class PriceUtilService {
         // 根据用户Id查询超级会员id
         Integer svipUserId = priceMapper.getSvipUserIdByUserId(userId);
         // 超级会员标识
-        boolean svipUserFlag = null != svipUserId;
+        boolean isSuperVip = null != svipUserId;
         // 根据商品id,用户身份 查询商品活动
         PromotionsVo promotions = promotionsMapper.getPricePromotions(price.getProductId(), identity);
         price.setRepurchaseFlag(0);
@@ -108,7 +108,7 @@ public class PriceUtilService {
         // 用户身份: 2-会员机构, 4-普通机构
         price.setUserIdentity(identity);
         // 设置价格标志(协销|价格公开|仅对医美机构公开|仅对会员机构公开)
-        boolean setFlag = identity == 1 || priceFlag == 0 || (priceFlag == 3 && clubType == 1) || (priceFlag == 2 && identity == 2);
+        boolean setFlag = identity == 1 || priceFlag == 0 || (priceFlag == 3 && clubType == 1) || (priceFlag == 2 && (identity == 2 || isSuperVip));
         if (setFlag) {
             // 设置划线价
             price.setOriginalPrice(price.getPrice());
@@ -122,14 +122,14 @@ public class PriceUtilService {
                 if (1 == price.getSvipPriceType()) {
                     // 折扣价
                     price.setSvipPriceTag(MathUtil.div(price.getSvipDiscount(), 10, 1) + "折");
-                    if (svipUserFlag) {
+                    if (isSuperVip) {
                         // 超级会员用户设置优惠价
                         svipDiscountPrice = MathUtil.div(MathUtil.mul(price.getPrice(), price.getSvipDiscount()), 100, 2);
                         price.setPrice(svipDiscountPrice.doubleValue());
                     }
                 } else if (2 == price.getSvipPriceType()) {
                     // 直接优惠价
-                    if (svipUserFlag) {
+                    if (isSuperVip) {
                         // 超级会员用户设置优惠价
                         price.setPrice(svipDiscountPrice.doubleValue());
                     }