Commit 3110e427fb6554941ef30f4c81cf145206f93d55
1 parent
970e5240
同步 https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/647/files
Showing
6 changed files
with
27 additions
and
12 deletions
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/order/TradeOrderOperateTypeEnum.java
| @@ -20,7 +20,8 @@ public enum TradeOrderOperateTypeEnum { | @@ -20,7 +20,8 @@ public enum TradeOrderOperateTypeEnum { | ||
| 20 | ADMIN_DELIVERY(20, "已发货,快递公司:{deliveryName},快递单号:{logisticsNo}"), | 20 | ADMIN_DELIVERY(20, "已发货,快递公司:{deliveryName},快递单号:{logisticsNo}"), |
| 21 | MEMBER_RECEIVE(30, "用户已收货"), | 21 | MEMBER_RECEIVE(30, "用户已收货"), |
| 22 | SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"), | 22 | SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"), |
| 23 | - PICK_UP_RECEIVE(32, "自提收货"), | 23 | + ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"), |
| 24 | + MEMBER_PICK_UP_RECEIVE(32, "用户自提收货"), | ||
| 24 | MEMBER_COMMENT(33, "用户评价"), | 25 | MEMBER_COMMENT(33, "用户评价"), |
| 25 | SYSTEM_COMMENT(34, "到期未评价,系统自动评价"), | 26 | SYSTEM_COMMENT(34, "到期未评价,系统自动评价"), |
| 26 | MEMBER_CANCEL(40, "取消订单"), | 27 | MEMBER_CANCEL(40, "取消订单"), |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/admin/order/TradeOrderController.java
| @@ -126,11 +126,17 @@ public class TradeOrderController { | @@ -126,11 +126,17 @@ public class TradeOrderController { | ||
| 126 | return success(true); | 126 | return success(true); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | + // TODO @疯狂:1、在【订单列表】界面,增加一个【核销按钮】。点击后,弹窗出一个核销码输入的窗口。 | ||
| 130 | + // | ||
| 131 | + //2、输入核销码后,点击确认,基于 code 查询对应的订单,之后弹窗展示。 | ||
| 132 | + // | ||
| 133 | + //3、新的弹窗,下面有个【确认核销】按钮。确认后,进行订单核销逻辑。注意,只有门店自提的订单,才可以核销。 | ||
| 134 | + // TODO 这里的 id 应该是 pickUpVerifyCode 参数哈; | ||
| 129 | @PutMapping("/pick-up") | 135 | @PutMapping("/pick-up") |
| 130 | @Operation(summary = "订单核销") | 136 | @Operation(summary = "订单核销") |
| 131 | @PreAuthorize("@ss.hasPermission('trade:order:pick-up')") | 137 | @PreAuthorize("@ss.hasPermission('trade:order:pick-up')") |
| 132 | public CommonResult<Boolean> pickUpOrder(@RequestParam("id") Long id) { | 138 | public CommonResult<Boolean> pickUpOrder(@RequestParam("id") Long id) { |
| 133 | - tradeOrderUpdateService.pickUpOrder(id); | 139 | + tradeOrderUpdateService.pickUpOrderByMember(id); |
| 134 | return success(true); | 140 | return success(true); |
| 135 | } | 141 | } |
| 136 | 142 |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateService.java
| @@ -120,14 +120,14 @@ public interface TradeOrderUpdateService { | @@ -120,14 +120,14 @@ public interface TradeOrderUpdateService { | ||
| 120 | * | 120 | * |
| 121 | * @param id 订单编号 | 121 | * @param id 订单编号 |
| 122 | */ | 122 | */ |
| 123 | - void pickUpOrder(Long id); | 123 | + void pickUpOrderByMember(Long id); |
| 124 | 124 | ||
| 125 | /** | 125 | /** |
| 126 | * 【管理员】核销订单 | 126 | * 【管理员】核销订单 |
| 127 | * | 127 | * |
| 128 | * @param pickUpVerifyCode 自提核销码 | 128 | * @param pickUpVerifyCode 自提核销码 |
| 129 | */ | 129 | */ |
| 130 | - void pickUpOrder(String pickUpVerifyCode); | 130 | + void pickUpOrderByAdmin(String pickUpVerifyCode); |
| 131 | 131 | ||
| 132 | // =================== Order Item =================== | 132 | // =================== Order Item =================== |
| 133 | 133 | ||
| @@ -178,9 +178,9 @@ public interface TradeOrderUpdateService { | @@ -178,9 +178,9 @@ public interface TradeOrderUpdateService { | ||
| 178 | * @param combinationRecordId 拼团记录编号 | 178 | * @param combinationRecordId 拼团记录编号 |
| 179 | * @param headId 团长编号 | 179 | * @param headId 团长编号 |
| 180 | */ | 180 | */ |
| 181 | - // TODO 芋艿:再 review 拼团 | ||
| 182 | void updateOrderCombinationInfo(Long orderId, Long activityId, Long combinationRecordId, Long headId); | 181 | void updateOrderCombinationInfo(Long orderId, Long activityId, Long combinationRecordId, Long headId); |
| 183 | 182 | ||
| 183 | + // TODO 芋艿:拼团取消,不调这个接口哈; | ||
| 184 | /** | 184 | /** |
| 185 | * 取消支付订单 | 185 | * 取消支付订单 |
| 186 | * | 186 | * |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderUpdateServiceImpl.java
| @@ -670,17 +670,18 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | @@ -670,17 +670,18 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | ||
| 670 | } | 670 | } |
| 671 | 671 | ||
| 672 | @Override | 672 | @Override |
| 673 | - public void pickUpOrder(Long id) { | 673 | + @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.MEMBER_PICK_UP_RECEIVE) |
| 674 | + public void pickUpOrderByMember(Long id) { | ||
| 674 | getSelf().pickUpOrder(tradeOrderMapper.selectById(id)); | 675 | getSelf().pickUpOrder(tradeOrderMapper.selectById(id)); |
| 675 | } | 676 | } |
| 676 | 677 | ||
| 677 | @Override | 678 | @Override |
| 678 | - public void pickUpOrder(String pickUpVerifyCode) { | 679 | + @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_PICK_UP_RECEIVE) |
| 680 | + public void pickUpOrderByAdmin(String pickUpVerifyCode) { | ||
| 679 | getSelf().pickUpOrder(tradeOrderMapper.selectOneByPickUpVerifyCode(pickUpVerifyCode)); | 681 | getSelf().pickUpOrder(tradeOrderMapper.selectOneByPickUpVerifyCode(pickUpVerifyCode)); |
| 680 | } | 682 | } |
| 681 | 683 | ||
| 682 | @Transactional(rollbackFor = Exception.class) | 684 | @Transactional(rollbackFor = Exception.class) |
| 683 | - @TradeOrderLog(operateType = TradeOrderOperateTypeEnum.PICK_UP_RECEIVE) | ||
| 684 | public void pickUpOrder(TradeOrderDO order) { | 685 | public void pickUpOrder(TradeOrderDO order) { |
| 685 | if (order == null) { | 686 | if (order == null) { |
| 686 | throw exception(ORDER_NOT_FOUND); | 687 | throw exception(ORDER_NOT_FOUND); |
| @@ -688,7 +689,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | @@ -688,7 +689,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService { | ||
| 688 | if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) { | 689 | if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) { |
| 689 | throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP); | 690 | throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP); |
| 690 | } | 691 | } |
| 691 | - // todo 校验核销操作人? | ||
| 692 | receiveOrder0(order); | 692 | receiveOrder0(order); |
| 693 | } | 693 | } |
| 694 | 694 |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java
| @@ -18,10 +18,10 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService; | @@ -18,10 +18,10 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService; | ||
| 18 | import cn.iocoder.yudao.module.system.service.permission.RoleService; | 18 | import cn.iocoder.yudao.module.system.service.permission.RoleService; |
| 19 | import cn.iocoder.yudao.module.system.service.social.SocialUserService; | 19 | import cn.iocoder.yudao.module.system.service.social.SocialUserService; |
| 20 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; | 20 | import cn.iocoder.yudao.module.system.service.user.AdminUserService; |
| 21 | -import io.swagger.v3.oas.annotations.tags.Tag; | 21 | +import io.swagger.v3.oas.annotations.Operation; |
| 22 | import io.swagger.v3.oas.annotations.Parameter; | 22 | import io.swagger.v3.oas.annotations.Parameter; |
| 23 | import io.swagger.v3.oas.annotations.Parameters; | 23 | import io.swagger.v3.oas.annotations.Parameters; |
| 24 | -import io.swagger.v3.oas.annotations.Operation; | 24 | +import io.swagger.v3.oas.annotations.tags.Tag; |
| 25 | import lombok.extern.slf4j.Slf4j; | 25 | import lombok.extern.slf4j.Slf4j; |
| 26 | import org.springframework.validation.annotation.Validated; | 26 | import org.springframework.validation.annotation.Validated; |
| 27 | import org.springframework.web.bind.annotation.*; | 27 | import org.springframework.web.bind.annotation.*; |
| @@ -30,6 +30,7 @@ import javax.annotation.Resource; | @@ -30,6 +30,7 @@ import javax.annotation.Resource; | ||
| 30 | import javax.annotation.security.PermitAll; | 30 | import javax.annotation.security.PermitAll; |
| 31 | import javax.servlet.http.HttpServletRequest; | 31 | import javax.servlet.http.HttpServletRequest; |
| 32 | import javax.validation.Valid; | 32 | import javax.validation.Valid; |
| 33 | +import java.util.Collections; | ||
| 33 | import java.util.List; | 34 | import java.util.List; |
| 34 | import java.util.Set; | 35 | import java.util.Set; |
| 35 | 36 | ||
| @@ -101,6 +102,9 @@ public class AuthController { | @@ -101,6 +102,9 @@ public class AuthController { | ||
| 101 | 102 | ||
| 102 | // 1.2 获得角色列表 | 103 | // 1.2 获得角色列表 |
| 103 | Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId()); | 104 | Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId()); |
| 105 | + if (CollUtil.isEmpty(roleIds)) { | ||
| 106 | + return success(AuthConvert.INSTANCE.convert(user, Collections.emptyList(), Collections.emptyList())); | ||
| 107 | + } | ||
| 104 | List<RoleDO> roles = roleService.getRoleList(roleIds); | 108 | List<RoleDO> roles = roleService.getRoleList(roleIds); |
| 105 | roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色 | 109 | roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色 |
| 106 | 110 | ||
| @@ -154,4 +158,4 @@ public class AuthController { | @@ -154,4 +158,4 @@ public class AuthController { | ||
| 154 | return success(authService.socialLogin(reqVO)); | 158 | return success(authService.socialLogin(reqVO)); |
| 155 | } | 159 | } |
| 156 | 160 | ||
| 157 | -} | ||
| 158 | \ No newline at end of file | 161 | \ No newline at end of file |
| 162 | +} |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/auth/AuthConvert.java
| 1 | package cn.iocoder.yudao.module.system.convert.auth; | 1 | package cn.iocoder.yudao.module.system.convert.auth; |
| 2 | 2 | ||
| 3 | +import cn.hutool.core.collection.CollUtil; | ||
| 3 | import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; | 4 | import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO; |
| 4 | import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; | 5 | import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO; |
| 5 | import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; | 6 | import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO; |
| @@ -46,6 +47,9 @@ public interface AuthConvert { | @@ -46,6 +47,9 @@ public interface AuthConvert { | ||
| 46 | * @return 菜单树 | 47 | * @return 菜单树 |
| 47 | */ | 48 | */ |
| 48 | default List<AuthPermissionInfoRespVO.MenuVO> buildMenuTree(List<MenuDO> menuList) { | 49 | default List<AuthPermissionInfoRespVO.MenuVO> buildMenuTree(List<MenuDO> menuList) { |
| 50 | + if (CollUtil.isEmpty(menuList)) { | ||
| 51 | + return Collections.emptyList(); | ||
| 52 | + } | ||
| 49 | // 移除按钮 | 53 | // 移除按钮 |
| 50 | menuList.removeIf(menu -> menu.getType().equals(MenuTypeEnum.BUTTON.getType())); | 54 | menuList.removeIf(menu -> menu.getType().equals(MenuTypeEnum.BUTTON.getType())); |
| 51 | // 排序,保证菜单的有序性 | 55 | // 排序,保证菜单的有序性 |