From 9ff1c9a2df642e6286be4903f841172f2073a7e8 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 22 Jul 2021 16:39:06 +0800 Subject: [PATCH] fix --- gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java b/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java index 9e0743d..e76dca1 100644 --- a/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java +++ b/gc-order/src/main/java/com/xzx/gc/order/service/JhyOrderService.java @@ -63,7 +63,9 @@ public void addJhyOrder(AddJhyOrderDto orderDto) { JhyInfo jhyInfo = jhyInfoMapper.selectJhyInfoByUserId(orderDto.getUserId()); if (jhyInfo != null && JhyInfo.CHECK_PASS.equals(jhyInfo.getStatus())) { - throw new RestException(-3, "集货员不能下单"); + if (JhyInfo.IS_JHY_Y.equals(jhyInfo.getIsJhy())) { + throw new RestException(-3, "集货员不能下单"); + } } AddressInfo addressInfo = addressMapper.selectByPrimaryKey(orderDto.getAddressId()); @@ -150,6 +152,10 @@ throw new RestException(-3, "不是集货员"); } + if (JhyInfo.IS_JHY_N.equals(jhyInfo.getIsJhy())) { + throw new RestException(-3, "暂无法抢单"); + } + JhyOrder order = jhyOrderMapper.selectByPrimaryKey(orderId); if (order == null) { throw new RestException(-3, "订单不存在"); @@ -197,13 +203,11 @@ orderItems.setTitle(environmentalInfo.getTitle()); orderItems.setPrice(new BigDecimal(environmentalInfo.getPrice())); BigDecimal total = orderItems.getPrice().multiply(BigDecimal.valueOf(40)).multiply(weight); - log.info("======>{}, {}, {}", total, orderItems.getPrice(), weight); orderItems.setScore(total.setScale(0, BigDecimal.ROUND_DOWN).toString()); orderItems.setWeight(weight); jhyOrderItemsMapper.insert(orderItems); totalScore = totalScore.add(total); - log.info("=====>>>{}", totalScore); } JhyOrder order = jhyOrderMapper.selectByPrimaryKey(confirmDto.getOrderId()); -- Gitblit v1.9.1