| | |
| | | @Autowired |
| | | private ITSiteTypeService siteTypeService; |
| | | |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | |
| | | @ResponseBody |
| | | public Object list() { |
| | | Page<TSiteType> page = new PageFactory<TSiteType>().defaultPage(); |
| | | Page<TSiteType> page1 = siteTypeService.page(page, new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState,3)); |
| | | Page<TSiteType> page1 = siteTypeService.page(page, new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState,3).orderByDesc(TSiteType::getId)); |
| | | return super.packForBT(page1); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public Object delete(Integer id) { |
| | | try { |
| | | List<TSite> list = siteService.list(new LambdaQueryWrapper<TSite>().eq(TSite::getSiteTypeId, id)); |
| | | if(list.size()>0){ |
| | | return "5002"; |
| | | } |
| | | TSiteType byId = siteTypeService.getById(id); |
| | | byId.setState(3); |
| | | siteTypeService.updateById(byId); |