From a0af42a6acfc7a0ebbb92bffc1816525e508af70 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期五, 17 十月 2025 16:54:06 +0800 Subject: [PATCH] 修改bug --- management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/checkCar/TCheckFacilitatorController.java | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/checkCar/TCheckFacilitatorController.java b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/checkCar/TCheckFacilitatorController.java index ef77521..0f2c43a 100644 --- a/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/checkCar/TCheckFacilitatorController.java +++ b/management/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/checkCar/TCheckFacilitatorController.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.stylefeng.guns.core.base.controller.BaseController; +import com.stylefeng.guns.core.beetl.ShiroExtUtil; import com.stylefeng.guns.core.exception.GunsException; import com.stylefeng.guns.core.shiro.ShiroKit; import org.springframework.stereotype.Controller; @@ -29,6 +30,9 @@ @Autowired private ITCheckFacilitatorService tCheckFacilitatorService; + + @Autowired + private ShiroExtUtil shiroExtUtil; /** * 跳转到代检车车检点首页 @@ -63,8 +67,8 @@ @RequestMapping(value = "/list") @ResponseBody public Object list(String name, String phone) { - Integer roleType = ShiroKit.getUser().getRoleType(); - Integer companyId = ShiroKit.getUser().getObjectId(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); + Integer companyId = shiroExtUtil.getUser().getObjectId(); // 分公司管理员只能查看本分公司的代检车车检点 return tCheckFacilitatorService.selectList(new EntityWrapper<TCheckFacilitator>() @@ -80,13 +84,13 @@ @RequestMapping(value = "/add") @ResponseBody public Object add(TCheckFacilitator tCheckFacilitator) { - String name = ShiroKit.getUser().getName(); - Integer roleType = ShiroKit.getUser().getRoleType(); + String name = shiroExtUtil.getUser().getName(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); if (roleType != 2) { throw new GunsException("只有分公司管理员可以操作"); } tCheckFacilitator.setCreateBy(name); - tCheckFacilitator.setCompanyId(ShiroKit.getUser().getObjectId()); + tCheckFacilitator.setCompanyId(shiroExtUtil.getUser().getObjectId()); tCheckFacilitatorService.insert(tCheckFacilitator); return SUCCESS_TIP; } @@ -97,7 +101,7 @@ @RequestMapping(value = "/delete") @ResponseBody public Object delete(@RequestParam Integer tCheckFacilitatorId) { - Integer roleType = ShiroKit.getUser().getRoleType(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); if (roleType != 2) { throw new GunsException("只有分公司管理员可以操作"); } @@ -111,8 +115,8 @@ @RequestMapping(value = "/update") @ResponseBody public Object update(TCheckFacilitator tCheckFacilitator) { - String name = ShiroKit.getUser().getName(); - Integer roleType = ShiroKit.getUser().getRoleType(); + String name = shiroExtUtil.getUser().getName(); + Integer roleType = shiroExtUtil.getUser().getRoleType(); if (roleType != 2) { throw new GunsException("只有分公司管理员可以操作"); } -- Gitblit v1.7.1