From e55c8b0a92eb9715edd90c31dfd4de51a47b588b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 17:40:08 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java | 70 +++++++++++++++++++++++++++++++----
1 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java
index 543084d..16a2b10 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PlayPlanNvController.java
@@ -6,7 +6,6 @@
import com.github.pagehelper.PageHelper;
import com.sandu.common.domain.ResponseVO;
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.PlayPlanParam;
import com.sandu.ximon.admin.security.PermissionConfig;
@@ -15,6 +14,7 @@
import com.sandu.ximon.admin.vo.NovaPushResultVO;
import com.sandu.ximon.dao.domain.PlayPlanNv;
import com.sandu.ximon.dao.enums.MenuEnum;
+import com.sandu.ximon.dao.enums.OrderByEnums;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -65,12 +65,19 @@
return ResponseUtil.success(playPlanNvService.deletePlan(plianIds));
}
- @PostMapping(value = "/push/{plianId}", produces = "application/json;charset=UTF-8")
- public ResponseVO<Object> pushToLed(@PathVariable Long plianId, @RequestBody List<NovaPushResultVO> playerIds) {
+ /**
+ * 瀹氭椂鑺傜洰
+ *
+ * @param planId
+ * @param playerIds
+ * @return
+ */
+ @PostMapping(value = "/push/{planId}", produces = "application/json;charset=UTF-8")
+ public ResponseVO<Object> pushToLed(@PathVariable Long planId, @RequestBody List<NovaPushResultVO> playerIds) {
if (!permissionConfig.check(MenuEnum.LED_N_PLAY_PLAN_PUSH.getCode())) {
return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
}
- return ResponseUtil.success(playPlanNvService.pushToLed(plianId, playerIds));
+ return ResponseUtil.success(playPlanNvService.pushToLed(planId, playerIds));
}
@@ -82,12 +89,61 @@
return ResponseUtil.success(playPlanNvService.pushSchedule(planId, playerIds));
}
+
+ /**
+ * 瀹炴椂鑺傜洰
+ *
+ * @param pid
+ * @param playerIds
+ * @return
+ */
+ @PostMapping(value = "/pushProgram/{pid}", produces = "application/json;charset=UTF-8")
+ public ResponseVO<Object> pushProgram(@PathVariable Long pid, @RequestBody List<NovaPushResultVO> playerIds) {
+ if (!permissionConfig.check(MenuEnum.LED_N_PLAY_PLAN_PUSH.getCode())) {
+ return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
+ }
+ return ResponseUtil.success(playPlanNvService.pushProgram(pid, playerIds));
+ }
+
+
@GetMapping("/listPlan")
- public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) {
+ public ResponseVO<Object> list(BaseConditionVO baseConditionVO,
+ @RequestParam(value = "order", required = false) Integer order,
+ @RequestParam(value = "seq", required = false) Integer seq,
+ @RequestParam(value = "keyword", required = false) String keyword) {
if (!permissionConfig.check(MenuEnum.PLAYPLAN_LIST.getCode())) {
return ResponseUtil.fail("缂哄皯瀵瑰簲鐢ㄦ埛鏉冮檺");
}
- PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
+ //鎺掑簭瀛楁
+ String orderByResult = "id";
+ //姝e簭銆佸�掑彊
+ String orderBySeq = OrderByEnums.ASC.getCode();
+ if (order != null) {
+ switch (order) {
+ case 1:
+ orderByResult = OrderByEnums.LED_N_PLAY_PLAN_CREATE_TIME.getCode();
+ break;
+ default:
+ }
+ }
+ if (seq != null) {
+ switch (seq) {
+ case 1:
+ orderBySeq = " ASC";
+ break;
+ case 2:
+ orderBySeq = " DESC";
+ break;
+ default:
+ break;
+ }
+ }
+ //鎺掑簭鏂瑰紡
+ String orderBy = orderByResult + " " + orderBySeq;
+
+ if (baseConditionVO != null) {
+ PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy);
+ }
LambdaQueryWrapper<PlayPlanNv> wrapper = Wrappers.lambdaQuery(PlayPlanNv.class);
if (SecurityUtils.getClientId() != null) {
@@ -100,9 +156,7 @@
}
List<PlayPlanNv> list = playPlanNvService.list(wrapper);
list.forEach(plan -> {
-// plan.setPlan(JSON.parseObject(plan.getSchedule(), Map.class));
plan.setPlan(JSON.parseObject(plan.getSchedules(), List.class));
-// plan.setPlan(JSON.parseArray(plan.getSchedule(), SchedulesDTO.class));
});
return ResponseUtil.successPage(list);
}
--
Gitblit v1.9.3