diff --git a/src/main/java/com/cultural/heritage/controller/book/BookingDateController.java b/src/main/java/com/cultural/heritage/controller/book/BookingDateController.java index 73114d4..8f2a256 100644 --- a/src/main/java/com/cultural/heritage/controller/book/BookingDateController.java +++ b/src/main/java/com/cultural/heritage/controller/book/BookingDateController.java @@ -70,8 +70,8 @@ public class BookingDateController { // 删除这个预约日期关联的所有时间点 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("bookingDateId", id); - boolean remove = bookingTimeService.remove(queryWrapper); - ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间点删除失败"); + bookingTimeService.remove(queryWrapper); +// ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间点删除失败"); // 删除这个预约日期 boolean success = bookingDateService.removeById(id); diff --git a/src/main/java/com/cultural/heritage/controller/book/PhotoCategoryController.java b/src/main/java/com/cultural/heritage/controller/book/PhotoCategoryController.java index 49fc339..ea9779d 100644 --- a/src/main/java/com/cultural/heritage/controller/book/PhotoCategoryController.java +++ b/src/main/java/com/cultural/heritage/controller/book/PhotoCategoryController.java @@ -149,18 +149,17 @@ public class PhotoCategoryController { // 获取预约时间表 List bookingTimeList = commonService.findByFieldInTargetField(bookingDateList, bookingTimeService, BookingDate::getId, "bookingDateId"); // 批量删除预约时间 - boolean removeTime = bookingTimeService.removeBatchByIds(bookingTimeList); - ThrowUtils.throwIf(!removeTime, ErrorCode.OPERATION_ERROR, "预约时间删除失败"); + bookingTimeService.removeBatchByIds(bookingTimeList); +// ThrowUtils.throwIf(!removeTime, ErrorCode.OPERATION_ERROR, "预约时间删除失败"); // 批量删除预约日期 - boolean removeDate = bookingDateService.removeBatchByIds(bookingDateList); - ThrowUtils.throwIf(!removeDate, ErrorCode.OPERATION_ERROR, "预约日期批量删除失败"); + bookingDateService.removeBatchByIds(bookingDateList); +// ThrowUtils.throwIf(!removeDate, ErrorCode.OPERATION_ERROR, "预约日期批量删除失败"); // 删除该类别下所有写真产品 - if (!photoProductsList.isEmpty()) { - boolean remove = photoProductsService.removeBatchByIds(photoProductsList); - ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "写真产品批量删除失败"); - } + photoProductsService.removeBatchByIds(photoProductsList); +// ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "写真产品批量删除失败"); + // 删除写真类别 boolean result = photoCategoryService.removeById(id); ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "写真类别删除失败"); diff --git a/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java b/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java index 80a3145..a605eb4 100644 --- a/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java +++ b/src/main/java/com/cultural/heritage/controller/book/PhotoProductsController.java @@ -183,11 +183,11 @@ public class PhotoProductsController { // 获取预约时间列表 List bookingTimeList = commonService.findByFieldInTargetField(bookingDateList, bookingTimeService, BookingDate::getId, "bookingDateId"); // 删除写真产品下的预约时间 - boolean remove = bookingTimeService.removeBatchByIds(bookingTimeList); - ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间批量删除失败"); + bookingTimeService.removeBatchByIds(bookingTimeList); +// ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间批量删除失败"); // 删除写真产品下的预约日期 - boolean success = bookingDateService.removeBatchByIds(bookingDateList); - ThrowUtils.throwIf(!success, ErrorCode.OPERATION_ERROR, "预约日期批量删除失败"); + bookingDateService.removeBatchByIds(bookingDateList); +// ThrowUtils.throwIf(!success, ErrorCode.OPERATION_ERROR, "预约日期批量删除失败"); // 删除写真产品 boolean result = photoProductsService.removeById(id); ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "写真产品删除失败"); @@ -215,11 +215,11 @@ public class PhotoProductsController { // 获取写真产品的预约时间 List bookingTimeList = commonService.findByFieldInTargetField(bookingDateList, bookingTimeService, BookingDate::getId, "bookingDateId"); // 删除写真产品下的预约时间 - boolean remove = bookingTimeService.removeBatchByIds(bookingTimeList); - ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间批量删除失败"); + bookingTimeService.removeBatchByIds(bookingTimeList); +// ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间批量删除失败"); // 删除写真产品下的预约日期 - boolean success = bookingDateService.removeBatchByIds(bookingDateList); - ThrowUtils.throwIf(!success, ErrorCode.OPERATION_ERROR, "预约日期批量删除失败"); + bookingDateService.removeBatchByIds(bookingDateList); +// ThrowUtils.throwIf(!success, ErrorCode.OPERATION_ERROR, "预约日期批量删除失败"); // 批量删除写真产品 boolean result = photoProductsService.removeBatchByIds(idList); ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "写真产品批量删除失败"); diff --git a/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java b/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java index 747ec81..91759a6 100644 --- a/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java +++ b/src/main/java/com/cultural/heritage/controller/good/AppointmentDateController.java @@ -90,8 +90,8 @@ public class AppointmentDateController { // 删除这个预约日期关联的所有时间段 QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("appointmentDateId", id); - boolean remove = timePeriodService.remove(queryWrapper); - ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间段删除失败"); + timePeriodService.remove(queryWrapper); +// ThrowUtils.throwIf(!remove, ErrorCode.OPERATION_ERROR, "预约时间段删除失败"); // 删除这个预约日期 boolean success = appointmentDateService.removeById(id); diff --git a/src/main/java/com/cultural/heritage/controller/good/CategoryController.java b/src/main/java/com/cultural/heritage/controller/good/CategoryController.java index f4ab089..5f5365e 100644 --- a/src/main/java/com/cultural/heritage/controller/good/CategoryController.java +++ b/src/main/java/com/cultural/heritage/controller/good/CategoryController.java @@ -101,8 +101,8 @@ public class CategoryController { String typeName = category.getTypeName(); List goodList = commonService.findByFieldEqTargetField("type", typeName, goodService); - boolean isSuccess = goodService.removeBatchByIds(goodList); - ThrowUtils.throwIf(!isSuccess, ErrorCode.OPERATION_ERROR, "商品批量删除失败"); + goodService.removeBatchByIds(goodList); +// ThrowUtils.throwIf(!isSuccess, ErrorCode.OPERATION_ERROR, "商品批量删除失败"); // 删除当前类别 boolean result = categoryService.removeById(id); @@ -130,8 +130,8 @@ public class CategoryController { List goodList = commonService.findByFieldInTargetField(categoryList, goodService, Category::getTypeName, "type"); // 批量删除商品 - boolean result = goodService.removeBatchByIds(goodList); - ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "商品批量删除失败"); + goodService.removeBatchByIds(goodList); +// ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR, "商品批量删除失败"); // 批量删除当前类别 boolean remove = categoryService.removeBatchByIds(categoryList); @@ -176,8 +176,8 @@ public class CategoryController { // 修改原有类别下所有商品的类名 UpdateWrapper goodUpdateWrapper = new UpdateWrapper<>(); goodUpdateWrapper.eq("type", originTypeName).set("type", targetTypeName); - boolean update = goodService.update(goodUpdateWrapper); - ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "商品类名更新失败"); + goodService.update(goodUpdateWrapper); +// ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "商品类名更新失败"); return ResultUtils.success(true, "类别更新成功"); } diff --git a/src/main/java/com/cultural/heritage/service/wx/WeChatService.java b/src/main/java/com/cultural/heritage/service/wx/WeChatService.java index 8fb6f28..4bdaa9e 100644 --- a/src/main/java/com/cultural/heritage/service/wx/WeChatService.java +++ b/src/main/java/com/cultural/heritage/service/wx/WeChatService.java @@ -66,7 +66,7 @@ public interface WeChatService { RefundNotification getRefundInfo(HttpServletRequest request); /** - * 退款回调(商品类) + * 全额退款回调(商品类) */ boolean refundCallback(RefundNotification refundNotification); diff --git a/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java b/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java index 88ed53a..ed38274 100644 --- a/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java +++ b/src/main/java/com/cultural/heritage/service/wx/impl/WeChatServiceImpl.java @@ -419,8 +419,8 @@ public class WeChatServiceImpl implements WeChatService { Good good = goodService.getById(id); ThrowUtils.throwIf(good == null, ErrorCode.OPERATION_ERROR, "当前商品不存在"); good.setInventory(good.getInventory() + orderItems.getQuantity()); - boolean update = goodService.updateById(good); - ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "商品库存恢复失败"); + goodService.updateById(good); +// ThrowUtils.throwIf(!update, ErrorCode.OPERATION_ERROR, "商品库存恢复失败"); } System.out.println("---------------------------微信退款回调(结束)-------------------------------"); return true; @@ -508,12 +508,11 @@ public class WeChatServiceImpl implements WeChatService { private void dealUserPointsByGood(Order order, boolean isAdd) { BigDecimal totalAmount = order.getTotalAmount(); CouponSnapshot couponSnapshot = order.getCouponSnapshot(); - if (isAdd) { - if (couponSnapshot != null) { - BigDecimal conditionAmount = couponSnapshot.getConditionAmount(); - totalAmount = totalAmount.add(conditionAmount); - } + if (couponSnapshot != null) { + BigDecimal conditionAmount = couponSnapshot.getConditionAmount(); + totalAmount = totalAmount.add(conditionAmount); } + totalAmount = totalAmount.multiply(new BigDecimal("100")); userService.addOrSubUserPoints(order.getUserId(), isAdd, totalAmount.intValue()); } @@ -523,6 +522,7 @@ public class WeChatServiceImpl implements WeChatService { */ private void dealUserPointsByPhoto(AdvanceOrder advanceOrder, boolean isAdd) { BigDecimal totalAmount = advanceOrder.getTotalAmount(); + totalAmount = totalAmount.multiply(new BigDecimal("100")); userService.addOrSubUserPoints(advanceOrder.getUserId(), isAdd, totalAmount.intValue()); } @@ -760,8 +760,8 @@ public class WeChatServiceImpl implements WeChatService { good.setInventory(quantity + inventory); good.setUpdateTime(DateUtil.date()); } - boolean updateBatch = goodService.updateBatchById(goodList); - ThrowUtils.throwIf(!updateBatch, ErrorCode.SYSTEM_ERROR, "商品库存恢复失败"); + goodService.updateBatchById(goodList); +// ThrowUtils.throwIf(!updateBatch, ErrorCode.SYSTEM_ERROR, "商品库存恢复失败"); }