From e1543fa85e1e6669d8eb62215cb24aca31a2cdcf Mon Sep 17 00:00:00 2001 From: tangqian Date: Fri, 9 Jun 2023 17:09:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/member/service/promoter/PromoterServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java index 477c28494..b62b10bf5 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java @@ -145,6 +145,7 @@ public class PromoterServiceImpl implements PromoterService { } else { memberUserDO.setMobile(updateReqVO.getMobile()); memberUserDO.setNickname(updateReqVO.getNickname()); + memberUserDO.setTenantId(updateReqVO.getTenantId()); memberUserService.updateById(memberUserDO); } } From 24467a92a6e0d9114d45870cb511a12db8e09bc3 Mon Sep 17 00:00:00 2001 From: tangqian Date: Fri, 9 Jun 2023 18:24:13 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recharge/RechargeOrderController.java | 7 +++++++ .../recharge/vo/BatchOrderUpdateReqVO.java | 21 +++++++++++++++++++ .../recharge/vo/RechargeOrderBaseVO.java | 2 +- .../recharge/RechargeOrderService.java | 2 ++ .../recharge/RechargeOrderServiceImpl.java | 11 ++++++++++ .../mapper/recharge/RechargeOrderMapper.xml | 1 + .../promoter/vo/AppPromoterCreateReqVO.java | 2 +- .../admin/promoter/vo/PromoterBaseVO.java | 2 +- 8 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/BatchOrderUpdateReqVO.java 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 e726f5ee2..0d24409c5 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 @@ -71,6 +71,13 @@ public class RechargeOrderController { return success(true); } + @PutMapping("/updateByIds") + @Operation(summary = "批量更新订单状态") + public CommonResult updateByIds(@Valid @RequestBody BatchOrderUpdateReqVO updateReqVO) { + rechargeOrderService.updateByIds(updateReqVO); + return success(true); + } + @DeleteMapping("/delete") @Operation(summary = "删除订单") @Parameter(name = "id", description = "编号", required = true) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/BatchOrderUpdateReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/BatchOrderUpdateReqVO.java new file mode 100644 index 000000000..a8c2b400e --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/BatchOrderUpdateReqVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.util.List; + +/** + * @Title:BatchOrderUpdateReqVO + * @Description: TODO + * @author: tangqian + * @date: 2023/6/9 17:45 + * @version: V1.0.0 + */ +@Getter +@Setter +public class BatchOrderUpdateReqVO implements Serializable { + private List ids; + private Boolean status; +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java index be86d0bfa..a20ccd48b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java @@ -75,7 +75,7 @@ public class RechargeOrderBaseVO { @NotNull(message = "支付方式不能为空") private String payType; - @Schema(description = "订单状态(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)", required = true, example = "2") + @Schema(description = "订单状态(0:待发货;1:已发货)", required = true, example = "2") @NotNull(message = "订单状态(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)不能为空") private Boolean status; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java index 8adfbc846..a672ec54b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java @@ -91,4 +91,6 @@ public interface RechargeOrderService { ShoppingMemberOrderVO shoppingOrderCount(Integer type, Long loginUserId); List findPromoterDrawExcel(PromoterDrawReqExcelVO excelVO); + + Boolean updateByIds(BatchOrderUpdateReqVO updateReqVO); } 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 eee8767fb..975308f75 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 @@ -138,6 +138,17 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { return rechargeOrderMapper.findPromoterDrawExcel(excelVO); } + @Override + public Boolean updateByIds(BatchOrderUpdateReqVO updateReqVO) { + List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery().in(RechargeOrderDO::getId, updateReqVO.getIds())); + if (!CollectionUtils.isEmpty(orderDOS)) { + orderDOS.forEach(e -> { + e.setStatus(updateReqVO.getStatus()); + }); + } + return null; + } + @Override public PageResult findPromoterDrawPage(PromoterDrawReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); 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 299df9a38..695cf9ce8 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 @@ -116,6 +116,7 @@ a.pay_price, a.paid, a.refund_status, + a.status, CONVERT(a.pay_price*e.member_commission/100, DECIMAL(15,2)) as commissionPrice, a.paid, d.parent_organization_name diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/AppPromoterCreateReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/AppPromoterCreateReqVO.java index 55ce24a60..05cea1126 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/AppPromoterCreateReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/AppPromoterCreateReqVO.java @@ -21,7 +21,7 @@ import java.io.Serializable; public class AppPromoterCreateReqVO implements Serializable { @Schema(description = "推广员名称", required = true, example = "5841") @NotEmpty(message = "推广员名称不能为空") - @Size(max = 10,message = "推广员名称最长不能超过{max}") +// @Size(max = 10,message = "推广员名称最长不能超过{max}") private String nickname; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/PromoterBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/PromoterBaseVO.java index d550dbad9..d9bbe3c88 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/PromoterBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/promoter/vo/PromoterBaseVO.java @@ -20,7 +20,7 @@ public class PromoterBaseVO { @Schema(description = "推广员名称", required = true, example = "5841") @NotEmpty(message = "推广员名称不能为空") - @Size(max = 10,message = "推广员名称最长不能超过{max}") +// @Size(max = 10,message = "推广员名称最长不能超过{max}") private String nickname; From 5eec2d9820aaee1c1b2bc9a848001cd9b953aa6f Mon Sep 17 00:00:00 2001 From: tangqian Date: Fri, 9 Jun 2023 19:08:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recharge/RechargeOrderController.java | 4 ++- .../recharge/RechargeOrderServiceImpl.java | 30 ++++++++----------- .../mapper/recharge/RechargeOrderMapper.xml | 4 ++- 3 files changed, 19 insertions(+), 19 deletions(-) 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} +