| | |
| | | import com.oying.modules.sh.domain.vo.ProductInfo; |
| | | import com.oying.modules.sh.service.*; |
| | | import com.oying.utils.*; |
| | | import com.oying.utils.enums.GenerateEnum; |
| | | import com.oying.utils.enums.OrderStatusEnum; |
| | | import com.oying.utils.enums.PayStateEnum; |
| | | import com.oying.utils.enums.PayTypeEnum; |
| | | import com.oying.utils.enums.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | order.setOrderStatusDescribe(OrderStatusEnum.ZERO.getValue()); |
| | | order.setOrderRemark(submit.getRemark() != null ? submit.getRemark() : ""); |
| | | order.setOrderTime(submit.getDateTime()); |
| | | order.setSendPrice(store.getDeliveryFee()); |
| | | order.setSendType(SendTypeEnum.LY.getKey()); |
| | | order.setUserId(SecurityUtils.getCurrentUserId()); |
| | | order.setUsername(SecurityUtils.getCurrentUsername()); |
| | | order.setStoreId(submit.getStoreId()); |
| | | order.setStoreName(store.getStoreName()); |
| | | order.setStoreLogo(store.getLogoImageUrl()); |
| | | order.setSendPrice(store.getDeliveryFee()); |
| | | order.setStoreAddress(store.getAddress()); |
| | | order.setStoreLongitude(BigDecimal.valueOf(store.getLongitude())); |
| | | order.setStoreLatitude(BigDecimal.valueOf(store.getLatitude())); |
| | | order.setOrderDescribe(DESCRIBE + submit.getStoreId()); |
| | | order.setOriginalPrice(amount); |
| | | order.setPaidPrice(amount); |
| | |
| | | UserAddress address = userAddressService.getById(submit.getAddressId()); |
| | | OrderAddressSnapshot addressSnapshot = getOrderAddressSnapshot(orderNum, address); |
| | | |
| | | |
| | | addressSnapshotService.save(addressSnapshot); |
| | | orderMapper.insert(order); |
| | | productSnapshotService.saveBatch(snapshots); |
| | |
| | | order.setProductSnapshots(new HashSet<>(snapshots)); |
| | | OrderResponse response = new OrderResponse(order, addressSnapshot, null); |
| | | |
| | | operationLogService.create(response, OrderStatusEnum.ZERO); |
| | | operationLogService.create(response, OrderStatusEnum.ZERO, null); |
| | | return order; |
| | | } |
| | | |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void statusOrder(StatusOrder statusOrder) { |
| | | operationLog(getByOrderNum(statusOrder.getOrderNum()), statusOrder.getStatus()); |
| | | operationLog(getByOrderNum(statusOrder.getOrderNum()), statusOrder.getStatus(), null); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void operationLog(OrderResponse order, OrderStatusEnum stateEnum) { |
| | | operationLogService.create(order, stateEnum); |
| | | public void operationLog(OrderResponse order, OrderStatusEnum stateEnum, String cardName) { |
| | | operationLogService.create(order, stateEnum, null); |
| | | } |
| | | |
| | | @Override |
| | |
| | | swiftPassService.closeOrder(orderNum, anEnum); |
| | | break; |
| | | } |
| | | operationLogService.create(response, OrderStatusEnum.NINE); |
| | | operationLogService.create(response, OrderStatusEnum.NINE, null); |
| | | orderMapper.updateCloseStatus(orderNum, PayStateEnum.CLOSED.getKey(), PayStateEnum.CLOSED.getValue()); |
| | | } |
| | | |