|
@@ -3,8 +3,10 @@ package com.welampiot.controller;
|
|
import com.welampiot.common.BaseResult;
|
|
import com.welampiot.common.BaseResult;
|
|
import com.welampiot.dto.AirSwitchInfoDTO;
|
|
import com.welampiot.dto.AirSwitchInfoDTO;
|
|
import com.welampiot.dto.ElectricBoxDTO;
|
|
import com.welampiot.dto.ElectricBoxDTO;
|
|
|
|
+import com.welampiot.service.AirSwitchInfoService;
|
|
import com.welampiot.service.ElectricBoxService;
|
|
import com.welampiot.service.ElectricBoxService;
|
|
import com.welampiot.utils.ToolUtils;
|
|
import com.welampiot.utils.ToolUtils;
|
|
|
|
+import com.welampiot.vo.AirSwitchInfoReturnVO;
|
|
import com.welampiot.vo.ElectricBoxReturnVO;
|
|
import com.welampiot.vo.ElectricBoxReturnVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
@@ -30,6 +32,9 @@ public class ElectricBoxController {
|
|
@Autowired
|
|
@Autowired
|
|
private ElectricBoxService electricBoxService;
|
|
private ElectricBoxService electricBoxService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private AirSwitchInfoService airSwitchInfoService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ToolUtils toolUtils;
|
|
private ToolUtils toolUtils;
|
|
|
|
|
|
@@ -53,7 +58,6 @@ public class ElectricBoxController {
|
|
dto.setSectionList(toolUtils.getSectionList(request));
|
|
dto.setSectionList(toolUtils.getSectionList(request));
|
|
|
|
|
|
ElectricBoxReturnVO electricBoxList = electricBoxService.getElectricBoxListBySectionId(dto);
|
|
ElectricBoxReturnVO electricBoxList = electricBoxService.getElectricBoxListBySectionId(dto);
|
|
- System.out.println(electricBoxList);
|
|
|
|
return BaseResult.success(electricBoxList);
|
|
return BaseResult.success(electricBoxList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -66,9 +70,14 @@ public class ElectricBoxController {
|
|
public BaseResult<AirSwitchInfoDTO> airSwitchList(HttpServletRequest request){
|
|
public BaseResult<AirSwitchInfoDTO> airSwitchList(HttpServletRequest request){
|
|
Integer boxId = request.getParameter("boxId") == null ? 0 : Integer.parseInt(request.getParameter("boxId"));
|
|
Integer boxId = request.getParameter("boxId") == null ? 0 : Integer.parseInt(request.getParameter("boxId"));
|
|
Integer online = request.getParameter("online") == null ? 0 : Integer.parseInt(request.getParameter("online"));
|
|
Integer online = request.getParameter("online") == null ? 0 : Integer.parseInt(request.getParameter("online"));
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- return BaseResult.success();
|
|
|
|
|
|
+ AirSwitchInfoReturnVO airSwitchInfoReturnVO;
|
|
|
|
+ if (online == 1){
|
|
|
|
+ airSwitchInfoReturnVO = airSwitchInfoService.getAirSwitchInfo(boxId,1);
|
|
|
|
+ }else if (online == 2){
|
|
|
|
+ airSwitchInfoReturnVO = airSwitchInfoService.getAirSwitchInfo(boxId,2);
|
|
|
|
+ }else {
|
|
|
|
+ airSwitchInfoReturnVO = airSwitchInfoService.getAirSwitchInfo(boxId,online);
|
|
|
|
+ }
|
|
|
|
+ return BaseResult.success(airSwitchInfoReturnVO);
|
|
}
|
|
}
|
|
}
|
|
}
|