| | |
| | | import com.sandu.ximon.admin.param.VnnoxParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.service.LedPlayerEntityService; |
| | | import com.sandu.ximon.admin.service.PoleBindingService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.admin.service.VnnoxService; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.domain.LedV2RegisterResultEntity; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.AdministratorEnums; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private LedPlayerEntityService ledPlayerEntityService; |
| | | @Autowired |
| | | private VnnoxAPIUtil vnnoxAPIUtil; |
| | | @Autowired |
| | | private PoleBindingService bindingService; |
| | | @Autowired |
| | | private PoleService poleService; |
| | | |
| | | /** |
| | | * 截屏 |
| | |
| | | public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | LambdaQueryWrapper<LedPlayerEntity> wrapper = Wrappers.lambdaQuery(LedPlayerEntity.class); |
| | | |
| | | if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) { |
| | | //wrapper.eq(LedPlayerEntity::get) |
| | | return ResponseUtil.success(""); // todo |
| | |
| | | ); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.list(wrapper); |
| | | List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | entities.forEach( |
| | | led -> { |
| | | PoleBinding binding = bindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class) |
| | | .eq(PoleBinding::getDeviceType, 1).eq(PoleBinding::getDeviceCode, led.getSn())); |
| | | if (binding != null) { |
| | | led.setPoleId(poleService.getById(binding.getPoleId()).getId()); |
| | | led.setPoleName(poleService.getById(binding.getPoleId()).getPoleName()); |
| | | } |
| | | } |
| | | ); |
| | | return ResponseUtil.success(entities); |
| | | } |
| | | } |
| | |
| | | return ResponseUtil.success(online); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/getVnnoxInfo/{sn}") |
| | | public ResponseVO<Object> getBySnAndPlayerId(@PathVariable String sn) { |
| | | return ResponseUtil.success(ledPlayerEntityService.getBySnAndPlayerId(sn)); |
| | | } |
| | | } |