From dda268997ca8f8a364f7c19b45d7a43a50a98efe Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期二, 25 十月 2022 18:00:11 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java | 77 ++++++++++++++++++++++++++++++++++----
1 files changed, 68 insertions(+), 9 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java
index 3ca62af..c81b710 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java
@@ -10,6 +10,7 @@
import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils;
import com.sandu.ximon.admin.utils.VnnoxAPIUtil;
import com.sandu.ximon.admin.vo.EquipmentInfomation;
+import com.sandu.ximon.dao.bo.LEDNovaGroupListBo;
import com.sandu.ximon.dao.domain.LedPlayerEntity;
import com.sandu.ximon.dao.enums.OrderByEnums;
import com.sandu.ximon.dao.mapper.LedPlayerEntityMapper;
@@ -53,10 +54,7 @@
*/
List<String> listCode = new ArrayList<>(1);
listCode.add(ledPlayerEntity.getSn());
- String content = "{ 璁惧id:" + ledPlayerEntity.getId() + "璁惧code锛�" + ledPlayerEntity.getSn()
- + "璇虹摝playId:" + ledPlayerEntity.getPlayerId()
- + "璇虹摝璁惧鍚嶇О:" + ledPlayerEntity.getName() +
- "}";
+ String content = "{ 璁惧id:" + ledPlayerEntity.getId() + "璁惧code锛�" + ledPlayerEntity.getSn() + "璇虹摝playId:" + ledPlayerEntity.getPlayerId() + "璇虹摝璁惧鍚嶇О:" + ledPlayerEntity.getName() + "}";
StoreOperationRecordsUtils.storeOperationData(listCode, null, "璇虹摝璁惧鏂板", content);
/**
@@ -91,7 +89,7 @@
*/
public EquipmentInfomation getBySnAndPlayerSnInfo(String sn) {
EquipmentInfomation equipmentInfo = new EquipmentInfomation();
- equipmentInfo.setEquipmentType("璇虹摝LED");
+ equipmentInfo.setEquipmentType("NLED");
if (sn == null || sn.trim().length() == 0) {
return equipmentInfo;
}
@@ -118,7 +116,16 @@
}
- public List<LedPlayerEntity> ledPlayerEntityList(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq) {
+ /**
+ * 璇虹摝鍒楄〃
+ *
+ * @param baseConditionVO
+ * @param keyword
+ * @param order
+ * @param seq
+ * @return
+ */
+ public List<LedPlayerEntity> ledPlayerEntityList(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq, Long groupId) {
//鎺掑簭瀛楁
String orderByResult = OrderByEnums.VNNOX_ID.getCode();
//姝e簭銆佸�掑彊
@@ -150,15 +157,67 @@
String orderBy = orderByResult + " " + orderBySeq;
- PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy);
+ if (baseConditionVO != null) {
+ PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy);
+ }
List<LedPlayerEntity> list;
//瓒呯
if (SecurityUtils.getClientId() == null) {
- list = ledPlayerEntityMapper.ledPlayerEntityList(keyword, null);
+ list = ledPlayerEntityMapper.ledListByGroupId(keyword, null, groupId);
} else {
- list = ledPlayerEntityMapper.ledPlayerEntityList(keyword, SecurityUtils.getUserId());
+ list = ledPlayerEntityMapper.ledListByGroupId(keyword, SecurityUtils.getUserId(), groupId);
}
return SpringContextHolder.getBean(VnnoxService.class).setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list));
}
+ /**
+ * 璇虹摝鍒楄〃锛堢敤浜庨椤垫暟鎹粺璁★級
+ *
+ * @return
+ */
+ public List<LedPlayerEntity> ledPlayerEntityListOnHome() {
+ List<LedPlayerEntity> list;
+ //瓒呯
+ if (SecurityUtils.getClientId() == null) {
+ list = ledPlayerEntityMapper.ledPlayerEntityList(null, null);
+ } else {
+ list = ledPlayerEntityMapper.ledPlayerEntityList(null, SecurityUtils.getUserId());
+ }
+ return list == null ? new ArrayList<>() : list;
+ }
+
+ /**
+ * 璇虹摝鍒楄〃锛堢敤浜庣粦瀹氾級
+ *
+ * @param keyword
+ * @return
+ */
+ public List<LedPlayerEntity> ledPlayerEntityListOnBinding(String keyword) {
+
+ List<LedPlayerEntity> list;
+ //瓒呯
+ if (SecurityUtils.getClientId() == null) {
+ list = ledPlayerEntityMapper.ledPlayerEntityListOnBinding(keyword, null);
+ } else {
+ list = ledPlayerEntityMapper.ledPlayerEntityListOnBinding(keyword, SecurityUtils.getUserId());
+ }
+ return SpringContextHolder.getBean(VnnoxService.class).setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list));
+ }
+
+ /**
+ * 鑾峰彇鏁寸粍鐨勫睆骞�
+ *
+ * @param groupId
+ */
+ public List<LEDNovaGroupListBo> getListByGroupId(Long groupId) {
+ List<LEDNovaGroupListBo> listByGroupId = baseMapper.getListByGroupId(groupId, SecurityUtils.getClientId());
+ listByGroupId.forEach(
+ bo -> {
+ if (bo.getName() == null || bo.getName().equals("")) {
+ bo.setName(bo.getPlayerName());
+ }
+ }
+ );
+ return listByGroupId;
+ }
}
--
Gitblit v1.9.3