| | |
| | | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private ITCheckFacilitatorService tCheckFacilitatorService; |
| | | |
| | | @Autowired |
| | | private ShiroExtUtil shiroExtUtil; |
| | | |
| | | /** |
| | | * 跳转到代检车车检点首页 |
| | |
| | | @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>() |
| | |
| | | @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; |
| | | } |
| | |
| | | @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("只有分公司管理员可以操作"); |
| | | } |
| | |
| | | @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("只有分公司管理员可以操作"); |
| | | } |