| | |
| | | order.setOrderStatus(OrderStatus.COMPLETED.getCode()); |
| | | order.setIsCommission(0); |
| | | order.setAfterSaleTime(LocalDateTime.now().plusDays(days)); |
| | | order.setEndTime(LocalDateTime.now()); |
| | | orderMapper.updateById(order); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public R cancelOrder(Long orderId) { |
| | | Order order = this.getById(orderId); |
| | | if(Arrays.asList(4, 5, 6, 7, 8).contains(order.getOrderStatus())){ |
| | | if(Arrays.asList(5, 6, 7).contains(order.getOrderStatus())){ |
| | | return R.fail("无效的操作"); |
| | | } |
| | | order.setOrderStatus(5); |
| | |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(vipDemotion ? appUser.getVipId() - 1 : appUser.getVipId()).getData(); |
| | | int earnPoint1 = getPoint; |
| | | if(null != pointSetting && 1 == pointSetting.getBuyPointOpen()){ |
| | | earnPoint1 = getPoint / (100 - pointSetting.getBuyPoint()); |
| | | earnPoint1 = new BigDecimal(getPoint).divide(pointSetting.getBuyPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | appUser.setLavePoint(lavePoint - getPoint); |
| | | appUser.setShopPoint(appUser.getShopPoint() - earnPoint1); |