From 25e3153ff1256c321d4985070b5f07db930026ec Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期三, 20 四月 2022 11:48:47 +0800
Subject: [PATCH] fix
---
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java | 108 +++---------------------------------------------------
1 files changed, 6 insertions(+), 102 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java
index db591c3..614f7f4 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/XiXunController.java
@@ -115,31 +115,10 @@
if (!permissionConfig.check(MenuEnum.LED_PROGRAM_LIST.getCode())) {
return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
}
+ LambdaQueryWrapper<PoleXixunPlayerEntity> wrapper = xiXunPlayerService.XixunPlayerList(keyword);
PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
- LambdaQueryWrapper<PoleXixunPlayerEntity> wrapper = Wrappers.lambdaQuery(PoleXixunPlayerEntity.class).like(PoleXixunPlayerEntity::getProgramName, keyword);
-// if(AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())){
-// boolean clientId = clientService.findClientId();
-// if(clientId){
-// wrapper= wrapper.eq(PoleXixunPlayerEntity::getUserId,SecurityUtils.getUserId());
-// }
-// wrapper= wrapper.eq(PoleXixunPlayerEntity::getClientId,clientService.getClientId());
-// }
-// wrapper=Wrappers.lambdaQuery(PoleXixunPlayerEntity.class);
-// if(StrUtil.isNotBlank(keyword)){
-// wrapper.like(PoleXixunPlayerEntity::getLightemitName,keyword).or(
-// lambdaQueryWrapper -> {
-// lambdaQueryWrapper.like(PoleXixunPlayerEntity::getLightemitControlCode, keyword);
-// }
-// );
-// }
-// return ResponseUtil.success(poleLightemitService.list(wrapper));
- if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) {
-
- return ResponseUtil.success(xiXunPlayerService.list(wrapper)); // todo
- } else {
- return ResponseUtil.success(xiXunPlayerService.list(wrapper));
- }
+ return ResponseUtil.success(xiXunPlayerService.list(wrapper));
}
@@ -216,7 +195,9 @@
@GetMapping("/listLed")
public ResponseVO<Object> listLed(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword,
@RequestParam(value = "isOnLine", required = false) boolean isOnLine) {
-
+ if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) {
+ return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
+ }
List<PoleLightemitEntity> poleLightemitEntityList = poleLightemitService.listLed(keyword, isOnLine);
CommonPage commonPage = CommonPage.restPage(poleLightemitEntityList);
@@ -227,89 +208,14 @@
commonPage.setTotalPage(size / baseConditionVO.getPageSize());
}
return ResponseUtil.success(commonPage);
-
-
-// if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) {
-// return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
-// }
-// PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
-// LambdaQueryWrapper<PoleLightemitEntity> wrapper = Wrappers.lambdaQuery(PoleLightemitEntity.class);
-// if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) {
-// boolean clientId = clientService.findClientId();
-// if (clientId) {
-// wrapper = wrapper.eq(PoleLightemitEntity::getUserId, SecurityUtils.getUserId());
-// }
-// wrapper = wrapper.eq(PoleLightemitEntity::getClientId, clientService.getClientId());
-// }
-// wrapper = Wrappers.lambdaQuery(PoleLightemitEntity.class);
-// if (StrUtil.isNotBlank(keyword)) {
-// wrapper.like(PoleLightemitEntity::getLightemitName, keyword).or(
-// lambdaQueryWrapper -> {
-// lambdaQueryWrapper.like(PoleLightemitEntity::getLightemitControlCode, keyword);
-// }
-// );
-// }
-// List<PoleBinding> bindings = bindingService.list(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, 1));
-// List<PoleLightemitEntity> list = poleLightemitService.list(wrapper);
-// if (isOnLine) {
-// List<PoleLightemitEntity> results = poleLightemitService.ledOnline(list);
-// results.forEach(
-// led -> {
-// bindings.forEach(
-// bind -> {
-// if (bind.getDeviceCode() != null && led.getLightemitControlCode() == bind.getDeviceCode()) {
-// led.setStreetlightId(bind.getPoleId());
-// System.out.println("鏈夋病鏈夎繍琛屽埌杩欓噷?---------------" + bind.getPoleId());
-// led.setStreetlightName(poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, bind.getPoleId())).getPoleName());
-// }
-// }
-// );
-// }
-// );
-// CommonPage commonPage = CommonPage.restPage(results);
-// int size = results.size();
-// commonPage.setTotal((long) size);
-// commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1);
-// if (size % baseConditionVO.getPageSize() == 0) {
-// commonPage.setTotalPage(size / baseConditionVO.getPageSize());
-// }
-// return ResponseUtil.success(commonPage);
-// } else {
-// poleLightemitService.ledOnlineCheck(list);
-// list.forEach(
-// led -> {
-// bindings.forEach(
-// bind -> {
-// if (bind.getDeviceCode() != null && led.getLightemitControlCode().equals(bind.getDeviceCode())) {
-// led.setStreetlightId(bind.getPoleId());
-// System.out.println("鏈夋病鏈夎繍琛屽埌杩欓噷?---------------" + bind.getPoleId());
-// led.setStreetlightName(poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, bind.getPoleId())).getPoleName());
-// }
-// }
-// );
-// }
-// );
-// CommonPage commonPage = CommonPage.restPage(list);
-// int size = list.size();
-// commonPage.setTotal((long) size);
-// commonPage.setTotalPage(size / baseConditionVO.getPageSize() + 1);
-// if (size % baseConditionVO.getPageSize() == 0) {
-// commonPage.setTotalPage(size / baseConditionVO.getPageSize());
-// }
-// return ResponseUtil.success(commonPage);
-// // return ResponseUtil.success(list);
-// }
-//// return ResponseUtil.success(poleLightemitService.list(wrapper));
}
/**
- *
- *
* @param
* @return
*/
@GetMapping("/getbycode")
- public ResponseVO<Object> getLedByLightControlCode(String lightemitControlCode) {
+ public ResponseVO<Object> getLedByLightControlCode(String lightemitControlCode) {
return ResponseUtil.success(poleLightemitService.getLedByLightControlCode(lightemitControlCode));
}
@@ -471,8 +377,6 @@
scheduleService.ledschedulepush(id, lightemitIds);
return ResponseUtil.success("璁剧疆鎴愬姛");
}
-
-
}
--
Gitblit v1.9.3