if (ShopCommonEnum.SHOW_1.getValue().equals(status)) { XbuyAllStoreProduct xbuyAllStoreProduct = yxStoreProductService.xbuyAllProduct(id); XbuyStoreProduct xbuyStoreProduct = yxStoreProductService.xbuyProduct(id); List typeList = new LinkedList<>(); String note = "请下架以下平台商品:"; boolean isThrow = false; if (xbuyStoreProduct != null && xbuyStoreProduct.getIsShow().equals(ShopCommonEnum.SHOW_1.getValue())) { typeList.add(1); note += "积分后台;"; isThrow = true; } if (xbuyAllStoreProduct != null && xbuyAllStoreProduct.getIsShow().equals(ShopCommonEnum.SHOW_1.getValue())) { note += "支付宝后台;"; isThrow = true; } if (isThrow) { throw new YshopException(note); }

优化一下代码 if ShopCommonEnumSHOW_1getValueequalsstatus XbuyAllStoreProduct xbuyAllStoreProduct = yxStoreProductServicexbuyAllProductid; XbuyStoreProduct xbuyStore

原文地址: https://www.cveoy.top/t/topic/hsiK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录