|
@@ -1,14 +1,24 @@
|
|
|
package com.bizmatics.controller.web;
|
|
|
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import com.bizmatics.common.core.bean.ApiResult;
|
|
|
+import com.bizmatics.model.DeviceAttribute;
|
|
|
+import com.bizmatics.model.WcBlackoutPlan;
|
|
|
+import com.bizmatics.model.vo.DeviceAttributeVo;
|
|
|
+import com.bizmatics.model.vo.WcBlackoutPlanVo;
|
|
|
+import com.bizmatics.service.DeviceAttributeService;
|
|
|
+import com.bizmatics.service.WcBlackoutPlanService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
|
- * 前端控制器
|
|
|
+ * 前端控制器
|
|
|
* </p>
|
|
|
*
|
|
|
* @author ya
|
|
@@ -18,5 +28,62 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/wcBlackoutPlan")
|
|
|
public class WcBlackoutPlanController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private WcBlackoutPlanService wcBlackoutPlanService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 停电计划-新增
|
|
|
+ *
|
|
|
+ * @param wcBlackoutPlan
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("plannedOutageAdd")
|
|
|
+ public ApiResult<Void> plannedOutageAdd(@RequestBody WcBlackoutPlan wcBlackoutPlan) {
|
|
|
+ wcBlackoutPlanService.plannedOutageAdd(wcBlackoutPlan);
|
|
|
+ return ApiResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 停电计划-修改
|
|
|
+ *
|
|
|
+ * @param wcBlackoutPlan
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("plannedOutageUpdate")
|
|
|
+ public ApiResult<Void> plannedOutageUpdate(@RequestBody WcBlackoutPlan wcBlackoutPlan) {
|
|
|
+ wcBlackoutPlanService.plannedOutageUpdate(wcBlackoutPlan);
|
|
|
+ return ApiResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 停电计划-注销
|
|
|
+ *
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("plannedOutageDel")
|
|
|
+ public ApiResult<Void> plannedOutageDel(@RequestParam int id) {
|
|
|
+ wcBlackoutPlanService.plannedOutageDel(id);
|
|
|
+ return ApiResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 停电计划-查询
|
|
|
+ *
|
|
|
+ * @param startTime 开始时间
|
|
|
+ * @param endTime 结束时间
|
|
|
+ * @param type 状态 1.未执行 2.执行中 3.已执行
|
|
|
+ * @param id 停电计划ID
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @GetMapping("plannedOutageList")
|
|
|
+ public ApiResult<List<WcBlackoutPlanVo>> plannedOutageList(@RequestParam(required = false) String startTime,
|
|
|
+ @RequestParam( required = false) String endTime,
|
|
|
+ @RequestParam(value = "type", required = false, defaultValue = "0") int type,
|
|
|
+ @RequestParam(value = "id", required = false, defaultValue = "0") int id) {
|
|
|
+ return ApiResult.success(wcBlackoutPlanService.plannedOutageList(startTime, endTime, type,id));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|