| | |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @RestController |
| | | @RequestMapping("circle") |
| | | @Api(tags = "动环管理") |
| | |
| | | int userId = ActionUtil.getUser().getUId().intValue(); |
| | | Response res = new Response(); |
| | | //校验机房站点是否存在,存在则不需要新建StationId |
| | | StationInf sinf = sinfService.judgeStationName(circleInf.getStationName()); |
| | | if (sinf!=null) { |
| | | circleInf.setStationId(sinf.getStationId()); |
| | | Battinf binf = service.judgeBattStationName3(circleInf); |
| | | if (binf!=null) { |
| | | circleInf.setStationId(binf.getStationId()); |
| | | }else { |
| | | //站点不存在,需要新建站点记录 |
| | | String nextStationId = binfService.getNextStationId(); |
| | |
| | | if(circleInf.getSubList()!=null){ |
| | | circleInf.setSubCount(circleInf.getSubList().size()); |
| | | } |
| | | circleInf.setCircleInuseDate(new Date()); |
| | | if (service.add(circleInf)>0){ |
| | | //添加机房站点到用户对应的包机组 |
| | | binfService.insertUserBattgroupBaojigroupBattgroupSelect(circleInf.getStationId(),0,userId); |
| | |
| | | return service.getCinf(cinf,pageCurr,pageSize); |
| | | } |
| | | |
| | | @PostMapping("getConditionCid") |
| | | @ApiOperation(value = "获取动环下拉资产信息") |
| | | public Response getConditionCid(){ |
| | | return service.getConditionCid(); |
| | | } |
| | | |
| | | @GetMapping("getCinfById") |
| | | @ApiOperation(value = "根据id获取动环信息") |
| | | public Response getCinfById(@RequestParam int deviceId){ |
| | | return service.getCinfById(deviceId); |
| | | } |
| | | |
| | | @PostMapping("getSub") |
| | | @ApiOperation(value = "获取子件信息") |
| | | public Response getSub(@RequestBody SubInf sub,@RequestParam int pageCurr,@RequestParam int pageSize){ |