| | |
| | | private PowerInfService service; |
| | | |
| | | |
| | | @ApiOperation(value = "添加机房") |
| | | @ApiOperation(value = "添加电源") |
| | | @PostMapping("addPower") |
| | | public Response addPower(@RequestBody PowerInf pinf){ |
| | | return service.addPower(pinf); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除机房") |
| | | @ApiOperation(value = "删除电源") |
| | | @GetMapping("delPower") |
| | | public Response delPower(@RequestParam Integer pid){ |
| | | return service.delPower(pid); |
| | | } |
| | | |
| | | @ApiOperation(value = "修改机房") |
| | | @ApiOperation(value = "修改电源") |
| | | @PostMapping("updatePower") |
| | | public Response updatePower(@RequestBody PowerInf pinf){ |
| | | return service.updatePower(pinf); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询机房") |
| | | @ApiOperation(value = "查询电源") |
| | | @PostMapping("getPower") |
| | | public Response getPower(@RequestBody PowerDto dto){ |
| | | return service.getPower(dto); |
| | |
| | | //回写登录时间到数据库 |
| | | userService.updateLoginTime(userInf.getId()); |
| | | //查询用户对应的权限组id并返回给前端 |
| | | LinkedList<Object> dataList = new LinkedList<>(); |
| | | dataList.add(userInf); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("user",userInf); |
| | | PermitgroupUsr permitGroup = permitGroupUserService.getPermitGroup(userInf.getId()); |
| | | if(permitGroup == null){ |
| | | return response.set(1, false, "当前用户没有对应的权限组,登录失败"); |
| | |
| | | int permitGroupId = permitGroup.getPermitGroupId(); |
| | | //查询权限组信息 |
| | | List<Permitgroup> permitgroupList=permitGroupService.getPermitGroup(permitGroupId); |
| | | dataList.add(permitgroupList); |
| | | map.put("permit",permitgroupList); |
| | | } |
| | | //查询用户对应的班组标识 |
| | | dataList.add(bjService.getGroupFlag(userInf.getId().intValue())); |
| | | map.put("teamFlag",bjService.getGroupFlag(userInf.getId().intValue())); |
| | | CommonUtil.record( UserLogTypeEnum.CATEGORY_SYSTEM.getType(), UserLogTypeEnum.LOGIN.getType(),UserLogTypeEnum.LOGIN.getName(), UserLogTypeEnum.LOGIN.getName()); |
| | | return response.setII(1, true, dataList, "登录成功"); |
| | | return response.setII(1, true, map, "登录成功"); |
| | | } |
| | | return response.set(1, false,"认证未通过"); |
| | | } |
| | |
| | | @Autowired(required = false) |
| | | private StationInfMapper sinfMapper; |
| | | |
| | | //添加机房 |
| | | //添加电源 |
| | | public Response addPower(PowerInf addpinf) { |
| | | /* //判断添加锁的时候机房是不是新机房 |
| | | String fullName=addpinf.getProvice()+"_"+addpinf.getCity()+"_"+addpinf.getCountry()+"_"+addsinf.getStationName(); |
| | |
| | | newSinf.setCountry(addsinf.getCountry()); |
| | | newSinf.setStationName(addsinf.getStationName()); |
| | | mapper.insert(newSinf);*/ |
| | | return new Response().set(1,true,"添加机房"); |
| | | return new Response().set(1,true,"添加电源"); |
| | | } |
| | | //删除机房 |
| | | //删除电源 |
| | | public Response delPower(Integer pid) { |
| | | /* UpdateWrapper wrapper=new UpdateWrapper(); |
| | | wrapper.eq("station_id",stationId); |
| | | mapper.delete(wrapper);*/ |
| | | return new Response().set(1,true); |
| | | } |
| | | //修改机房 |
| | | //修改电源 |
| | | public Response updatePower(PowerInf pinf) { |
| | | UpdateWrapper wrapper=new UpdateWrapper(); |
| | | /*wrapper.eq("station_id",sinf.getStationId()); |
| | |
| | | mapper.update((StationInf) ActionUtil.objeNull,wrapper);*/ |
| | | return new Response().set(1,true); |
| | | } |
| | | //查询机房 |
| | | //查询电源 |
| | | public Response getPower(PowerDto dto) { |
| | | PageHelper.startPage(dto.getPageNum(),dto.getPageSize()); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | |
| | | } |
| | | List<StationInf> list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询机房"); |
| | | return new Response().setII(1,list!=null,pageInfo,"查询电源"); |
| | | } |
| | | |
| | | } |