diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java index 0d24409c5..3fa254e75 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java @@ -65,14 +65,16 @@ public class RechargeOrderController { @PutMapping("/update") @Operation(summary = "更新订单") + @TenantIgnore @PreAuthorize("@ss.hasPermission('shop:recharge-order:update')") public CommonResult updateRechargeOrder(@Valid @RequestBody RechargeOrderUpdateReqVO updateReqVO) { rechargeOrderService.updateRechargeOrder(updateReqVO); return success(true); } - @PutMapping("/updateByIds") + @PostMapping("/updateByIds") @Operation(summary = "批量更新订单状态") + @TenantIgnore public CommonResult updateByIds(@Valid @RequestBody BatchOrderUpdateReqVO updateReqVO) { rechargeOrderService.updateByIds(updateReqVO); return success(true); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java index 975308f75..8c1d2f419 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java @@ -2,19 +2,23 @@ package cn.iocoder.yudao.module.shop.service.recharge; import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.util.NumberUtil; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.AppUserInfoReqDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; +import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; import cn.iocoder.yudao.module.shop.controller.app.member.vo.PromoterMemberOrderVO; import cn.iocoder.yudao.module.shop.controller.app.member.vo.ShoppingMemberOrderVO; +import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert; +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; import cn.iocoder.yudao.module.shop.dal.mysql.order.StoreOrderMapper; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper; +import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper; import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest; -import cn.iocoder.yudao.module.shop.request.member.RefundRequest; import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse; import cn.iocoder.yudao.module.system.api.tenant.TenantApi; import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO; @@ -23,32 +27,23 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.validation.annotation.Validated; +import javax.annotation.Resource; import java.math.BigDecimal; import java.time.DayOfWeek; -import java.time.LocalDate; import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAdjusters; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; -import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; -import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderConvert; -import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper; - import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.shop.enums.ErrorCodeConstants.*; -import static java.util.stream.Collectors.toMap; +import static cn.iocoder.yudao.module.shop.enums.ErrorCodeConstants.RECHARGE_ORDER_NOT_EXISTS; /** * 订单 Service 实现类 @@ -145,8 +140,9 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { orderDOS.forEach(e -> { e.setStatus(updateReqVO.getStatus()); }); + rechargeOrderMapper.updateBatch(orderDOS, orderDOS.size()); } - return null; + return Boolean.TRUE; } @Override diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml index 695cf9ce8..ac084accb 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml @@ -264,7 +264,9 @@ and a.promoter_id =#{data.promoterId} - + + and a.status =#{data.status} +