核销使用

This commit is contained in:
2025-03-07 09:56:08 +08:00
parent cf09ad1267
commit 974ca671c1

View File

@@ -2,11 +2,11 @@ package com.czg.controller.admin;
import cn.hutool.http.server.HttpServerRequest; import cn.hutool.http.server.HttpServerRequest;
import cn.hutool.http.server.HttpServerResponse; import cn.hutool.http.server.HttpServerResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.czg.account.dto.SysLoginDTO; import com.czg.account.dto.SysLoginDTO;
import com.czg.account.service.AuthorizationService; import com.czg.account.entity.ShopInfo;
import com.czg.account.service.PermissionService; import com.czg.account.service.*;
import com.czg.account.service.ShopInfoService;
import com.czg.account.service.ShopTableService;
import com.czg.account.vo.LoginVO; import com.czg.account.vo.LoginVO;
import com.czg.annotation.SaAdminCheckPermission; import com.czg.annotation.SaAdminCheckPermission;
import com.czg.annotation.SaStaffCheckPermission; import com.czg.annotation.SaStaffCheckPermission;
@@ -16,14 +16,17 @@ import com.czg.sa.StpKit;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
/** /**
* 商户登录相关 * 商户登录相关
*
* @author Administrator * @author Administrator
*/ */
@RestController @RestController
@@ -35,6 +38,8 @@ public class AuthorizationController {
private PermissionService permissionService; private PermissionService permissionService;
@Resource @Resource
private ShopInfoService shopInfoService; private ShopInfoService shopInfoService;
@Resource
private ShopStaffService shopStaffService;
/** /**
@@ -75,4 +80,19 @@ public class AuthorizationController {
// return CzgResult.success(Map.of("token", StpKit.USER.getShopId())); // return CzgResult.success(Map.of("token", StpKit.USER.getShopId()));
return CzgResult.success( shopInfoService.getById(1)); return CzgResult.success( shopInfoService.getById(1));
} }
/**
* 核销获取 信息使用
* 通过token 获取登录信息
*/
@GetMapping("/userInfo")
public CzgResult<Map<String, Object>> getUserInfo() {
String account = StpKit.USER.getAccount();
ShopInfo shopInfo = shopInfoService.queryChain().select(ShopInfo::getId, ShopInfo::getShopName).one();
if (account.contains("@")) {
account = account.split("@")[1];
}
Map<String, Object> map = Map.of("shopId", shopInfo.getId(), "shopName", shopInfo.getShopName(), "account", account);
return CzgResult.success(map);
}
} }