YunaiV 2023-10-14 17:45:49 +08:00
parent 970e524088
commit 3110e427fb
6 changed files with 27 additions and 12 deletions

View File

@ -20,7 +20,8 @@ public enum TradeOrderOperateTypeEnum {
ADMIN_DELIVERY(20, "已发货,快递公司:{deliveryName},快递单号:{logisticsNo}"),
MEMBER_RECEIVE(30, "用户已收货"),
SYSTEM_RECEIVE(31, "到期未收货,系统自动确认收货"),
PICK_UP_RECEIVE(32, "自提收货"),
ADMIN_PICK_UP_RECEIVE(32, "管理员自提收货"),
MEMBER_PICK_UP_RECEIVE(32, "用户自提收货"),
MEMBER_COMMENT(33, "用户评价"),
SYSTEM_COMMENT(34, "到期未评价,系统自动评价"),
MEMBER_CANCEL(40, "取消订单"),

View File

@ -126,11 +126,17 @@ public class TradeOrderController {
return success(true);
}
// TODO @疯狂1订单列表界面增加一个核销按钮点击后弹窗出一个核销码输入的窗口
//
//2输入核销码后点击确认基于 code 查询对应的订单之后弹窗展示
//
//3新的弹窗下面有个确认核销按钮确认后进行订单核销逻辑注意只有门店自提的订单才可以核销
// TODO 这里的 id 应该是 pickUpVerifyCode 参数哈
@PutMapping("/pick-up")
@Operation(summary = "订单核销")
@PreAuthorize("@ss.hasPermission('trade:order:pick-up')")
public CommonResult<Boolean> pickUpOrder(@RequestParam("id") Long id) {
tradeOrderUpdateService.pickUpOrder(id);
tradeOrderUpdateService.pickUpOrderByMember(id);
return success(true);
}

View File

@ -120,14 +120,14 @@ public interface TradeOrderUpdateService {
*
* @param id 订单编号
*/
void pickUpOrder(Long id);
void pickUpOrderByMember(Long id);
/**
* 管理员核销订单
*
* @param pickUpVerifyCode 自提核销码
*/
void pickUpOrder(String pickUpVerifyCode);
void pickUpOrderByAdmin(String pickUpVerifyCode);
// =================== Order Item ===================
@ -178,9 +178,9 @@ public interface TradeOrderUpdateService {
* @param combinationRecordId 拼团记录编号
* @param headId 团长编号
*/
// TODO 芋艿 review 拼团
void updateOrderCombinationInfo(Long orderId, Long activityId, Long combinationRecordId, Long headId);
// TODO 芋艿拼团取消不调这个接口哈
/**
* 取消支付订单
*

View File

@ -670,17 +670,18 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
}
@Override
public void pickUpOrder(Long id) {
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.MEMBER_PICK_UP_RECEIVE)
public void pickUpOrderByMember(Long id) {
getSelf().pickUpOrder(tradeOrderMapper.selectById(id));
}
@Override
public void pickUpOrder(String pickUpVerifyCode) {
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.ADMIN_PICK_UP_RECEIVE)
public void pickUpOrderByAdmin(String pickUpVerifyCode) {
getSelf().pickUpOrder(tradeOrderMapper.selectOneByPickUpVerifyCode(pickUpVerifyCode));
}
@Transactional(rollbackFor = Exception.class)
@TradeOrderLog(operateType = TradeOrderOperateTypeEnum.PICK_UP_RECEIVE)
public void pickUpOrder(TradeOrderDO order) {
if (order == null) {
throw exception(ORDER_NOT_FOUND);
@ -688,7 +689,6 @@ public class TradeOrderUpdateServiceImpl implements TradeOrderUpdateService {
if (ObjUtil.notEqual(DeliveryTypeEnum.PICK_UP.getType(), order.getDeliveryType())) {
throw exception(ORDER_RECEIVE_FAIL_DELIVERY_TYPE_NOT_PICK_UP);
}
// todo 校验核销操作人
receiveOrder0(order);
}

View File

@ -18,10 +18,10 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService;
import cn.iocoder.yudao.module.system.service.permission.RoleService;
import cn.iocoder.yudao.module.system.service.social.SocialUserService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -30,6 +30,7 @@ import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@ -101,6 +102,9 @@ public class AuthController {
// 1.2 获得角色列表
Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId());
if (CollUtil.isEmpty(roleIds)) {
return success(AuthConvert.INSTANCE.convert(user, Collections.emptyList(), Collections.emptyList()));
}
List<RoleDO> roles = roleService.getRoleList(roleIds);
roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色
@ -154,4 +158,4 @@ public class AuthController {
return success(authService.socialLogin(reqVO));
}
}
}

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.convert.auth;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
import cn.iocoder.yudao.module.system.api.sms.dto.code.SmsCodeUseReqDTO;
import cn.iocoder.yudao.module.system.api.social.dto.SocialUserBindReqDTO;
@ -46,6 +47,9 @@ public interface AuthConvert {
* @return 菜单树
*/
default List<AuthPermissionInfoRespVO.MenuVO> buildMenuTree(List<MenuDO> menuList) {
if (CollUtil.isEmpty(menuList)) {
return Collections.emptyList();
}
// 移除按钮
menuList.removeIf(menu -> menu.getType().equals(MenuTypeEnum.BUTTON.getType()));
// 排序保证菜单的有序性