| | |
| | | public R refundPayMoney(Order order) { |
| | | //开始退款 |
| | | Integer payMethod = order.getPayMethod(); |
| | | BigDecimal paymentAmount = order.getPaymentAmount(); |
| | | BigDecimal expressAmount = order.getExpressAmount() == null ? BigDecimal.ZERO : order.getExpressAmount(); |
| | | BigDecimal paymentAmount = order.getPaymentAmount().add(expressAmount); |
| | | AppUser appUser = appUserClient.getAppUserById(order.getAppUserId()); |
| | | if (1 == payMethod) { |
| | | //微信退款 |
| | |
| | | if (3 == payMethod) { |
| | | //开始运费退款,积分支付,运费是单独进行支付的,所以需要单独退款 |
| | | if (null != order.getExpressAmount() && BigDecimal.ZERO.compareTo(order.getExpressAmount()) < 0) { |
| | | BigDecimal expressAmount = order.getExpressAmount(); |
| | | if (1 == order.getExpressPayMethod()) { |
| | | //微信退款 |
| | | RefundResult refund = PaymentUtil.refund(order.getOrderNumber(), "R" + order.getOrderNumber(), expressAmount.doubleValue(), "/order/order/refundExpressPayMoneyCallback"); |
| | |
| | | order.setRefundTime(LocalDateTime.now()); |
| | | |
| | | shopPointClient.deleteShopPointCopy(order.getId(), Arrays.asList(1,2,3)); |
| | | shopBalanceStatementClient.deleteShopBalanceStatementCopy(order.getId(), Arrays.asList(1,2,3)); |
| | | appUserGiveawayTemporaryClient.delAppUserGiveawayTemporary(order.getId()); |
| | | shopGiveawayTemporaryClient.delShopGiveawayTemporary(order.getId()); |
| | | return R.ok(); |
| | |
| | | Long days = jsonObject.getLong("days"); |
| | | order.setAfterSaleTime(LocalDateTime.now().plusDays(days)); |
| | | this.updateById(order); |
| | | commissionService.calculationCommissionShop(order.getId()); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | for (int i = 1; i <= lastRowNum; i++) { |
| | | Row row = sheet.getRow(i); |
| | | // 订单编号 |
| | | if (row.getCell(0) == null){ |
| | | throw new ServiceException("第" + i + "行订单编号为空", 500); |
| | | } |
| | | row.getCell(0).setCellType(CellType.STRING); |
| | | String orderNum = row.getCell(0).getStringCellValue(); |
| | | // 快递单号 |
| | | if (row.getCell(1) == null){ |
| | | throw new ServiceException("第" + i + "行快递单号为空", 500); |
| | | } |
| | | row.getCell(1).setCellType(CellType.STRING); |
| | | String expressNum = row.getCell(1).getStringCellValue(); |
| | | // 快递公司名称 |
| | | if (row.getCell(2) == null){ |
| | | throw new ServiceException("第" + i + "行快递公司为空", 500); |
| | | } |
| | | row.getCell(2).setCellType(CellType.STRING); |
| | | String expressName = row.getCell(2).getStringCellValue(); |
| | | // 省区划代码 |
| | | if (row.getCell(3) == null){ |
| | | throw new ServiceException("第" + i + "行省区划代码为空", 500); |
| | | } |
| | | row.getCell(3).setCellType(CellType.STRING); |
| | | String provinceCode = row.getCell(3).getStringCellValue(); |
| | | // 市区划代码 |
| | | if (row.getCell(4) == null){ |
| | | throw new ServiceException("第" + i + "行市区划代码为空", 500); |
| | | } |
| | | row.getCell(4).setCellType(CellType.STRING); |
| | | String cityCode = row.getCell(4).getStringCellValue(); |
| | | Order order = this.getOne(new LambdaQueryWrapper<Order>() |