From 194d0b6ac2097b050aaa795c5df943dbb0593d74 Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 30 Dec 2021 16:59:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BC=98=E5=8C=96es=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=8C=E6=8A=8A=E5=8D=95=E6=AC=A1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=BC=98=E5=8C=96=E4=B8=BA=E6=89=B9=E9=87=8F=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lili/listener/GoodsMessageListener.java | 3 +- .../search/service/EsGoodsIndexService.java | 10 +- .../serviceimpl/EsGoodsIndexServiceImpl.java | 101 ++++++++++++------ 3 files changed, 73 insertions(+), 41 deletions(-) diff --git a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java index ce934a8f..95c07362 100644 --- a/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java +++ b/consumer/src/main/java/cn/lili/listener/GoodsMessageListener.java @@ -144,7 +144,6 @@ public class GoodsMessageListener implements RocketMQListener { break; case DELETE_GOODS_INDEX_PROMOTIONS: BasePromotions promotions = JSONUtil.toBean(new String(messageExt.getBody()), BasePromotions.class); - log.info("删除索引信息: {}", promotions); if (CharSequenceUtil.isNotEmpty(promotions.getScopeId())) { this.goodsIndexService.deleteEsGoodsPromotionByPromotionId(Arrays.asList(promotions.getScopeId().split(",")), promotions.getId()); } else { @@ -264,7 +263,7 @@ public class GoodsMessageListener implements RocketMQListener { this.goodsIndexService.updateEsGoodsIndexAllByList(promotions, esPromotionKey); } } catch (Exception e) { - log.error("生成商品索引促销信息执行异常",e); + log.error("生成商品索引促销信息执行异常", e); } } diff --git a/framework/src/main/java/cn/lili/modules/search/service/EsGoodsIndexService.java b/framework/src/main/java/cn/lili/modules/search/service/EsGoodsIndexService.java index 0535adcf..6ff46c49 100644 --- a/framework/src/main/java/cn/lili/modules/search/service/EsGoodsIndexService.java +++ b/framework/src/main/java/cn/lili/modules/search/service/EsGoodsIndexService.java @@ -6,6 +6,7 @@ import cn.lili.modules.goods.entity.dto.GoodsParamsDTO; import cn.lili.modules.promotion.entity.dos.BasePromotions; import cn.lili.modules.promotion.entity.dos.PromotionGoods; import cn.lili.modules.search.entity.dos.EsGoodsIndex; +import org.elasticsearch.action.update.UpdateRequest; import java.util.List; import java.util.Map; @@ -25,9 +26,11 @@ public interface EsGoodsIndexService { /** * 获取es生成索引进度 + * * @return */ Map getProgress(); + /** * 添加商品索引 * @@ -99,14 +102,13 @@ public interface EsGoodsIndexService { * @param id id(skuId) * @param promotion 促销信息 * @param key 促销信息的key - * @param price 促销价格 */ - void updateEsGoodsIndexPromotions(String id, BasePromotions promotion, String key, Double price); + UpdateRequest updateEsGoodsIndexPromotions(String id, BasePromotions promotion, String key); /** * 更新商品索引的促销信息 * - * @param ids id(skuId) + * @param ids id(skuId) * @param promotion 促销信息 * @param key 促销信息的key */ @@ -140,7 +142,7 @@ public interface EsGoodsIndexService { /** * 删除索引中指定的促销活动id的促销活动 * - * @param skuIds 商品skuId + * @param skuIds 商品skuId * @param promotionId 促销活动Id */ void deleteEsGoodsPromotionByPromotionId(List skuIds, String promotionId); diff --git a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java index 629ae01a..f3c3d105 100644 --- a/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/search/serviceimpl/EsGoodsIndexServiceImpl.java @@ -23,9 +23,7 @@ import cn.lili.modules.goods.entity.enums.GoodsStatusEnum; import cn.lili.modules.goods.entity.enums.GoodsWordsTypeEnum; import cn.lili.modules.goods.service.*; import cn.lili.modules.promotion.entity.dos.BasePromotions; -import cn.lili.modules.promotion.entity.dos.Pintuan; import cn.lili.modules.promotion.entity.dos.PromotionGoods; -import cn.lili.modules.promotion.entity.dos.Seckill; import cn.lili.modules.promotion.entity.enums.PromotionsStatusEnum; import cn.lili.modules.promotion.service.PromotionService; import cn.lili.modules.promotion.tools.PromotionTools; @@ -39,6 +37,7 @@ import lombok.extern.slf4j.Slf4j; import org.assertj.core.util.IterableUtil; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.bulk.BulkRequest; +import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.index.query.BoolQueryBuilder; @@ -355,20 +354,14 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements } @Override - public void updateEsGoodsIndexPromotions(String id, BasePromotions promotion, String key, Double price) { + public UpdateRequest updateEsGoodsIndexPromotions(String id, BasePromotions promotion, String key) { EsGoodsIndex goodsIndex = findById(id); if (goodsIndex != null) { - //如果有促销活动开始,则将促销金额写入 - if (price != null) { - goodsIndex.setPromotionPrice(price); - } else { - //否则促销金额为商品原价 - goodsIndex.setPromotionPrice(goodsIndex.getPrice()); - } //更新索引 - this.updateGoodsIndexPromotion(goodsIndex, key, promotion); + return this.updateGoodsIndexPromotion(goodsIndex, key, promotion); } else { log.error("更新索引商品促销信息失败!skuId 为 {} 的索引不存在!", id); + return null; } } @@ -381,24 +374,40 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements */ @Override public void updateEsGoodsIndexPromotions(List ids, BasePromotions promotion, String key) { + BulkRequest bulkRequest = new BulkRequest(); + log.info("修改商品活动索引"); + log.info("商品ids: {}", ids); + log.info("活动关键字: {}", key); + log.info("活动: {}", promotion); for (String id : ids) { - this.updateEsGoodsIndexPromotions(id, promotion, key, null); + UpdateRequest updateRequest = this.updateEsGoodsIndexPromotions(id, promotion, key); + if (updateRequest != null) { + bulkRequest.add(updateRequest); + } } + this.executeBulkUpdateRequest(bulkRequest); } + @Override public void updateEsGoodsIndexByList(List promotionGoodsList, BasePromotions promotion, String key) { + BulkRequest bulkRequest = new BulkRequest(); + log.info("修改商品活动索引"); + log.info("促销商品信息: {}", promotionGoodsList); + log.info("活动关键字: {}", key); + log.info("活动: {}", promotion); if (promotionGoodsList != null) { //循环更新 促销商品索引 for (PromotionGoods promotionGoods : promotionGoodsList) { - Double price = null; - if (promotion instanceof Seckill || promotion instanceof Pintuan) { - price = promotionGoods.getPrice(); + promotion.setStartTime(promotionGoods.getStartTime()); + promotion.setEndTime(promotionGoods.getEndTime()); + UpdateRequest updateRequest = this.updateEsGoodsIndexPromotions(promotionGoods.getSkuId(), promotion, key); + if (updateRequest != null) { + bulkRequest.add(updateRequest); } - this.updateEsGoodsIndexPromotions(promotionGoods.getSkuId(), promotion, key, price); } } - + this.executeBulkUpdateRequest(bulkRequest); } /** @@ -422,15 +431,12 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements } else { //否则是平台活动 Iterable all = goodsIndexRepository.findAll(); -// 查询出全部商品 + //查询出全部商品 goodsIndices = new ArrayList<>(IterableUtil.toCollection(all)); } List skuIds = goodsIndices.stream().map(EsGoodsIndex::getId).collect(Collectors.toList()); this.deleteEsGoodsPromotionByPromotionId(skuIds, promotion.getId()); - //更新商品索引 - for (EsGoodsIndex goodsIndex : goodsIndices) { - this.updateGoodsIndexPromotion(goodsIndex, key, promotion); - } + this.updateEsGoodsIndexPromotions(skuIds, promotion, key); } @Override @@ -456,21 +462,32 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements @Override public void deleteEsGoodsPromotionByPromotionId(List skuIds, String promotionId) { + BulkRequest bulkRequest = new BulkRequest(); + log.info("删除商品活动索引"); + log.info("商品skuIds: {}", skuIds); + log.info("活动Id: {}", promotionId); if (skuIds != null && !skuIds.isEmpty()) { for (String skuId : skuIds) { EsGoodsIndex goodsIndex = findById(skuId); //商品索引不为空 if (goodsIndex != null) { - this.removePromotionByPromotionId(goodsIndex, promotionId); + UpdateRequest updateRequest = this.removePromotionByPromotionId(goodsIndex, promotionId); + if (updateRequest != null) { + bulkRequest.add(updateRequest); + } } else { log.error("更新索引商品促销信息失败!skuId 为 【{}】的索引不存在!", skuId); } } } else { for (EsGoodsIndex goodsIndex : this.goodsIndexRepository.findAll()) { - this.removePromotionByPromotionId(goodsIndex, promotionId); + UpdateRequest updateRequest = this.removePromotionByPromotionId(goodsIndex, promotionId); + if (updateRequest != null) { + bulkRequest.add(updateRequest); + } } } + this.executeBulkUpdateRequest(bulkRequest); } @@ -480,15 +497,16 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements * @param goodsIndex 索引 * @param promotionId 促销活动id */ - private void removePromotionByPromotionId(EsGoodsIndex goodsIndex, String promotionId) { + private UpdateRequest removePromotionByPromotionId(EsGoodsIndex goodsIndex, String promotionId) { Map promotionMap = goodsIndex.getPromotionMap(); if (promotionMap != null && !promotionMap.isEmpty()) { //如果存在同促销ID的活动删除 List collect = promotionMap.keySet().stream().filter(i -> i.split("-")[1].equals(promotionId)).collect(Collectors.toList()); collect.forEach(promotionMap::remove); goodsIndex.setPromotionMap(promotionMap); - this.updatePromotionsByScript(goodsIndex.getId(), promotionMap); + return this.getGoodsIndexPromotionUpdateRequest(goodsIndex.getId(), promotionMap); } + return null; } /** @@ -594,11 +612,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements * @param key 关键字 * @param promotion 活动 */ - private void updateGoodsIndexPromotion(EsGoodsIndex goodsIndex, String key, BasePromotions promotion) { - log.info("修改商品活动索引"); - log.info("商品索引: {}", goodsIndex); - log.info("关键字: {}", key); - log.info("活动: {}", promotion); + private UpdateRequest updateGoodsIndexPromotion(EsGoodsIndex goodsIndex, String key, BasePromotions promotion) { Map promotionMap; //数据非空处理,如果空给一个新的信息 if (goodsIndex.getPromotionMap() == null || goodsIndex.getPromotionMap().isEmpty()) { @@ -613,7 +627,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements } else { promotionMap.put(key, promotion); } - this.updatePromotionsByScript(goodsIndex.getId(), promotionMap); + return this.getGoodsIndexPromotionUpdateRequest(goodsIndex.getId(), promotionMap); } /** @@ -622,7 +636,7 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements * @param id 索引id * @param promotionMap 促销信息 */ - private void updatePromotionsByScript(String id, Map promotionMap) { + private UpdateRequest getGoodsIndexPromotionUpdateRequest(String id, Map promotionMap) { JSONObject jsonObject = JSONUtil.parseObj(promotionMap); jsonObject.setDateFormat("yyyy-MM-dd HH:mm:ss"); String s = jsonObject.toString(); @@ -633,10 +647,27 @@ public class EsGoodsIndexServiceImpl extends BaseElasticsearchService implements updateRequest.id(id); updateRequest.retryOnConflict(5); updateRequest.script(new Script("ctx._source." + "promotionMap" + "=" + promotionsStr + ";")); + return updateRequest; + } + + /** + * 执行批量更新商品索引 + * + * @param bulkRequest 批量请求 + */ + private void executeBulkUpdateRequest(BulkRequest bulkRequest) { + if (bulkRequest.requests().isEmpty()) { + return; + } try { - client.update(updateRequest, RequestOptions.DEFAULT); + BulkResponse responses = this.client.bulk(bulkRequest, RequestOptions.DEFAULT); + if (responses.hasFailures()) { + log.info("批量更新商品索引的促销信息中出现部分异常:{}", responses.buildFailureMessage()); + } else { + log.info("批量更新商品索引的促销信息结果:{}", responses.status()); + } } catch (IOException e) { - log.error("更新商品索引促销信息错误", e); + log.error("批量更新商品索引的促销信息出现异常!", e); } } From d4ca3d58176c3b4ac9c30c618a2df28fd3e444cf Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 30 Dec 2021 17:00:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=89=8D=E5=90=8E=E7=AB=AF=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/service/SeckillService.java | 8 +++ .../serviceimpl/SeckillApplyServiceImpl.java | 50 ++++++++----------- .../serviceimpl/SeckillServiceImpl.java | 45 ++++++++++++----- 3 files changed, 62 insertions(+), 41 deletions(-) diff --git a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillService.java b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillService.java index b0edb0b5..2b916e61 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/service/SeckillService.java +++ b/framework/src/main/java/cn/lili/modules/promotion/service/SeckillService.java @@ -54,6 +54,14 @@ public interface SeckillService extends AbstractPromotionsService { */ void updateEsGoodsSeckill(Seckill seckill, List seckillApplies); + /** + * 删除商品索引限时抢购信息 + * + * @param seckill 限时抢购信息 + * @param skuIds 商品skuId列表 + */ + void deleteEsGoodsSeckill(Seckill seckill, List skuIds); + /** * 设置秒杀活动的每个参与活动商品的详细时间 * diff --git a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java index 108597d0..c8df9dbb 100644 --- a/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java +++ b/framework/src/main/java/cn/lili/modules/promotion/serviceimpl/SeckillApplyServiceImpl.java @@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateUtil; -import cn.hutool.core.text.CharSequenceUtil; import cn.lili.cache.Cache; import cn.lili.cache.CachePrefix; import cn.lili.common.enums.PromotionTypeEnum; @@ -27,7 +26,6 @@ import cn.lili.modules.promotion.mapper.SeckillApplyMapper; import cn.lili.modules.promotion.service.PromotionGoodsService; import cn.lili.modules.promotion.service.SeckillApplyService; import cn.lili.modules.promotion.service.SeckillService; -import cn.lili.modules.promotion.tools.PromotionCacheKeys; import cn.lili.modules.promotion.tools.PromotionTools; import cn.lili.mybatis.util.PageUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -58,7 +56,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl> cache; + private Cache cache; /** * 规格商品 */ @@ -78,28 +76,17 @@ public class SeckillApplyServiceImpl extends ServiceImpl getSeckillTimeline() { //秒杀活动缓存key - return getSeckillTimelineToCache(null); + return getSeckillTimelineInfo(); } @Override public List getSeckillGoods(Integer timeline) { List seckillGoodsVoS = new ArrayList<>(); - //秒杀活动缓存key - String seckillCacheKey = PromotionCacheKeys.getSeckillTimelineKey(DateUtil.format(DateUtil.beginOfDay(new DateTime()), "yyyyMMdd")); - List cacheSeckill = cache.get(seckillCacheKey); - if (cacheSeckill == null || cacheSeckill.isEmpty()) { - //如缓存中不存在,则单独获取 - List seckillTimelineToCache = getSeckillTimelineToCache(seckillCacheKey); - Optional first = seckillTimelineToCache.stream().filter(i -> i.getTimeLine().equals(timeline)).findFirst(); - if (first.isPresent()) { - seckillGoodsVoS = first.get().getSeckillGoodsList(); - } - } else { - //如缓存中存在,则取缓存中转为展示的信息 - Optional first = cacheSeckill.stream().filter(i -> i.getTimeLine().equals(timeline)).findFirst(); - if (first.isPresent()) { - seckillGoodsVoS = first.get().getSeckillGoodsList(); - } + //获取 + List seckillTimelineToCache = getSeckillTimelineInfo(); + Optional first = seckillTimelineToCache.stream().filter(i -> i.getTimeLine().equals(timeline)).findFirst(); + if (first.isPresent()) { + seckillGoodsVoS = first.get().getSeckillGoodsList(); } return seckillGoodsVoS; } @@ -191,6 +178,7 @@ public class SeckillApplyServiceImpl extends ServiceImpl().eq(SeckillApply::getSeckillId, seckillId).in(SeckillApply::getSkuId, skuIds)); this.saveBatch(originList); //保存促销活动商品信息 @@ -201,12 +189,14 @@ public class SeckillApplyServiceImpl extends ServiceImpl getSeckillTimelineToCache(String seckillCacheKey) { + private List getSeckillTimelineInfo() { List timelineList = new ArrayList<>(); LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); //查询当天时间段内的秒杀活动活动 @@ -321,9 +311,6 @@ public class SeckillApplyServiceImpl extends ServiceImpl map = new HashMap<>(); - // es促销key - map.put("esPromotionKey", promotionKey); - // 促销类型全路径名 - map.put("promotionsType", Seckill.class.getName()); - // 促销实体 - map.put("promotions", seckill); - //更新商品促销消息 - String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.UPDATE_GOODS_INDEX_PROMOTIONS.name(); - //发送mq消息 - rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(map), RocketmqSendCallbackBuilder.commonCallback()); } } + if (!seckillApplies.isEmpty()) { + log.info("更新限时抢购商品状态:{}", seckill); + String promotionKey = PromotionTypeEnum.SECKILL.name() + "-" + seckill.getId(); + Map map = new HashMap<>(); + // es促销key + map.put("esPromotionKey", promotionKey); + // 促销类型全路径名 + map.put("promotionsType", Seckill.class.getName()); + // 促销实体 + map.put("promotions", seckill); + //更新商品促销消息 + String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.UPDATE_GOODS_INDEX_PROMOTIONS.name(); + //发送mq消息 + rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(map), RocketmqSendCallbackBuilder.commonCallback()); + } } } + /** + * 删除商品索引限时抢购信息 + * + * @param seckill 限时抢购信息 + * @param skuIds 商品skuId列表 + */ + @Override + public void deleteEsGoodsSeckill(Seckill seckill, List skuIds) { + seckill.setScopeType(PromotionsScopeTypeEnum.PORTION_GOODS.name()); + seckill.setScopeId(ArrayUtil.join(skuIds.toArray(), ",")); + //删除商品促销消息 + String destination = rocketmqCustomProperties.getGoodsTopic() + ":" + GoodsTagsEnum.DELETE_GOODS_INDEX_PROMOTIONS.name(); + //发送mq消息 + rocketMQTemplate.asyncSend(destination, JSONUtil.toJsonStr(seckill), RocketmqSendCallbackBuilder.commonCallback()); + } + @Override public void setSeckillApplyTime(Seckill seckill, SeckillApply seckillApply) { //下一个时间,默认为当天结束时间 From 814533a2c22318431c2da3895ef3893490a1b3cd Mon Sep 17 00:00:00 2001 From: paulGao Date: Thu, 30 Dec 2021 17:01:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=94=80?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BD=A3=E9=87=91=E6=8F=90=E7=8E=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=A0=A1=E9=AA=8C=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/DistributionCashBuyerController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionCashBuyerController.java b/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionCashBuyerController.java index 4b6d310e..7ec0aa65 100644 --- a/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionCashBuyerController.java +++ b/buyer-api/src/main/java/cn/lili/controller/distribution/DistributionCashBuyerController.java @@ -13,6 +13,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -33,6 +34,7 @@ import javax.validation.constraints.NotNull; @RestController @Api(tags = "买家端,分销商品佣金提现接口") @RequestMapping("/buyer/distribution/cash") +@Validated public class DistributionCashBuyerController { /** @@ -55,7 +57,7 @@ public class DistributionCashBuyerController { public ResultMessage cash(@Max(value = 1000, message = "提现金额单次最多允许提现1000元") @Min(value = 1, message = "提现金额单次最少提现金额为1元") @NotNull @ApiIgnore Double price) { - if (distributionCashService.cash(price)) { + if (Boolean.TRUE.equals(distributionCashService.cash(price))) { return ResultUtil.success(); } throw new ServiceException(ResultCode.ERROR);