| | |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.NovaAStateInfoParam; |
| | | import com.sandu.ximon.admin.param.VnnoxParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.LedNovaGroupRelationService; |
| | | import com.sandu.ximon.admin.service.LedNovaGroupService; |
| | | import com.sandu.ximon.admin.service.LedPlayerEntityService; |
| | | import com.sandu.ximon.admin.service.VnnoxService; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.vo.NovaAStateInfoVO; |
| | | import com.sandu.ximon.admin.vo.NovaPushResultVO; |
| | | import com.sandu.ximon.admin.vo.NovaResultParam; |
| | | import com.sandu.ximon.dao.domain.LedNovaGroup; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.net.URISyntaxException; |
| | |
| | | private LedPlayerEntityService ledPlayerEntityService; |
| | | @Autowired |
| | | private VnnoxAPIUtil vnnoxAPIUtil; |
| | | @Autowired |
| | | private LedNovaGroupRelationService relationService; |
| | | @Autowired |
| | | private LedNovaGroupService groupService; |
| | | |
| | | |
| | | /** |
| | | * 截屏 |
| | |
| | | public ResponseVO<Object> list(BaseConditionVO baseConditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | @RequestParam(value = "seq", required = false) Integer seq, |
| | | @RequestParam(value = "groupId", required = false) Long groupId) { |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.successPage(ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword, order, seq)); |
| | | return ResponseUtil.successPage(ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword, order, seq, groupId)); |
| | | } |
| | | |
| | | @GetMapping("/onLineList") |
| | | public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | @RequestParam(value = "seq", required = false) Integer seq, |
| | | @RequestParam(value = "groupId", required = false) Long groupId) { |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword, order, seq); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword, order, seq, groupId); |
| | | List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | List<LedPlayerEntity> online = new ArrayList<>(); |
| | | for (LedPlayerEntity ledPlayer : entities) { |
| | |
| | | */ |
| | | @GetMapping("/getVnnoxInfo/{sn}") |
| | | public ResponseVO<Object> getBySnAndPlayerId(@PathVariable String sn) { |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.success(ledPlayerEntityService.getBySnAndPlayerSn(sn)); |
| | | } |
| | | |
| | |
| | | return ResponseUtil.success("执行完毕"); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/asyncStatus") |
| | | public ResponseVO<Object> asyncStatus(List<String> playerIds) { |
| | | vnnoxService.asyncStatus(playerIds); |
| | | return ResponseUtil.success("ok"); |
| | | // @AnonymousAccess |
| | | // @PostMapping("/asyncStatus") |
| | | // public ResponseVO<Object> asyncStatus(@RequestBody List<String> playerIds) { |
| | | // vnnoxService.asyncStatus(playerIds); |
| | | // return ResponseUtil.success("ok"); |
| | | // } |
| | | |
| | | |
| | | /** |
| | | * 获取屏幕信息 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @PostMapping("/getInfo") |
| | | public ResponseVO<Object> getInfo(@RequestBody @Validated NovaAStateInfoParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | //同步状态 |
| | | vnnoxService.getAsyncStatus(param.getPlayerIdList(), param.getStateValue()); |
| | | //获取同步 |
| | | List<NovaAStateInfoVO> info = vnnoxService.getInfo(param.getStateValue(), param.getPlayerIdList()); |
| | | return ResponseUtil.success(info); |
| | | } |
| | | |
| | | /** |
| | | * 根据分组id获取组内的屏幕 |
| | | */ |
| | | @GetMapping("/getByGroupId") |
| | | public ResponseVO<Object> getByGroupId(@RequestParam(value = "groupId", required = true) Long groupId) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_GROUP_INFO.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | if (groupId == null) { |
| | | throw new BusinessException("groupId不能为空"); |
| | | } |
| | | LedNovaGroup byId = groupService.getById(groupId); |
| | | if (byId == null) { |
| | | throw new BusinessException("分组不存在"); |
| | | } |
| | | return ResponseUtil.success(ledPlayerEntityService.getListByGroupId(groupId)); |
| | | } |
| | | } |