报错修改

This commit is contained in:
2025-09-24 11:05:51 +08:00
parent 307ebac8fa
commit a31bdc2396
19 changed files with 103 additions and 273 deletions

View File

@@ -30,14 +30,11 @@ import java.util.List;
@RestController
@RequestMapping("/admin/shopInfo")
public class ShopInfoController {
private final ShopInfoService shopInfoService;
@Resource
private ShopInfoService shopInfoService;
@Resource
private AuthorizationService authorizationService;
public ShopInfoController(ShopInfoService shopInfoService) {
this.shopInfoService = shopInfoService;
}
/**
* 店铺列表, 只允许管理员调用
* 权限标识: shopInfo:list
@@ -99,19 +96,7 @@ public class ShopInfoController {
*/
@GetMapping("branchList")
public CzgResult<List<ShopBranchSelectDTO>> findShopBranch() {
Long shopId = StpKit.USER.getShopId(0L);
String tokenValue = StpKit.USER.getTokenInfo().getTokenValue();
Long headId = StpKit.USER.getHeadId();
List<TokenSign> tokenSignList = StpKit.USER.getSession().getTokenSignList();
if (headId != null && CollUtil.isEmpty(tokenSignList)) {
shopId = StpKit.USER.getHeadShopId();
} else {
long count = tokenSignList.stream().filter(obj -> tokenValue.equals(obj.getValue())).count();
if (headId != null && count == 0) {
shopId = StpKit.USER.getHeadShopId();
}
}
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch(shopId);
List<ShopBranchSelectDTO> data = shopInfoService.findShopBranch(StpKit.USER.getShopId());
return CzgResult.success(data);
}

View File

@@ -149,7 +149,7 @@ public class ShopUserController {
@PutMapping("/money")
public CzgResult<Boolean> editMoney(@RequestBody @Validated ShopUserMoneyEditDTO shopUserMoneyEditDTO) {
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.ADMIN_IN);
return CzgResult.success(shopUserService.updateMoney(StpKit.USER.getHeadShopIdBySession(), shopUserMoneyEditDTO) > 0L);
return CzgResult.success(shopUserService.updateMoney(shopUserMoneyEditDTO) > 0L);
}
}

View File

@@ -34,7 +34,7 @@ public class UserController {
*/
@PutMapping
public CzgResult<Boolean> update(@RequestBody UserInfoEditDTO userInfoEditDTO) {
return CzgResult.success(userInfoService.updateInfo(StpKit.USER.getUsableShopId(), StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
return CzgResult.success(userInfoService.updateInfo(StpKit.USER.getShopId(), StpKit.USER.getLoginIdAsLong(), userInfoEditDTO));
}
/**

View File

@@ -2,13 +2,13 @@
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.31:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
username: root
password: Chaozg123.
url: jdbc:mysql://192.168.0.68:3306/czg_cashier?useUnicode=true&characterEncoding=utf-8
username: qijin
password: Star*0217
data:
redis:
host: 192.168.1.31
host: 192.168.0.68
port: 6379
password: Chaozg123.
timeout: 1000