Pu Zhibing
2 天以前 11d649e0de6490c53efe6df0ee10212ee6088d14
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("只有分公司管理员可以操作");
        }