|
@@ -4,6 +4,7 @@ import com.welampiot.common.BaseResult;
|
|
|
import com.welampiot.dto.LoopDTO;
|
|
|
import com.welampiot.service.LoopService;
|
|
|
import com.welampiot.utils.ToolUtils;
|
|
|
+import com.welampiot.vo.LoopDetailVO;
|
|
|
import com.welampiot.vo.LoopVO;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* ClassName: LoopController
|
|
@@ -24,7 +26,7 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
*/
|
|
|
@RestController
|
|
|
@CrossOrigin
|
|
|
-@RequestMapping("/api/LoopController")
|
|
|
+@RequestMapping("/api/loopController")
|
|
|
public class LoopController {
|
|
|
|
|
|
@Autowired
|
|
@@ -33,6 +35,11 @@ public class LoopController {
|
|
|
@Autowired
|
|
|
private ToolUtils toolUtils;
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取回路列表
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@RequestMapping(value = "/getList", method = RequestMethod.POST)
|
|
|
public BaseResult<LoopDTO> getList(HttpServletRequest request){
|
|
|
Integer id = request.getParameter("id") == null ? 0 : Integer.parseInt(request.getParameter("id"));
|
|
@@ -50,4 +57,35 @@ public class LoopController {
|
|
|
return BaseResult.success(loopList);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取回路详情
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/details",method = RequestMethod.POST)
|
|
|
+ public BaseResult<LoopDTO> details(HttpServletRequest request){
|
|
|
+ Integer version = request.getParameter("version") == null ? 0 : Integer.parseInt(request.getParameter("version"));
|
|
|
+ Integer id = request.getParameter("id") == null ? 0 : Integer.parseInt(request.getParameter("id"));
|
|
|
+ if (id == 0) return toolUtils.response("0001", version);
|
|
|
+ LoopDetailVO loopDetail = loopService.getLoopDetail(id, version,toolUtils.getSectionList(request));
|
|
|
+ if (loopDetail == null) return toolUtils.response("0001",version);
|
|
|
+ return BaseResult.success(loopDetail);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取回路下拉列表
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/nav", method = RequestMethod.POST)
|
|
|
+ public BaseResult<LoopDTO> nav(HttpServletRequest request){
|
|
|
+ Integer version = request.getParameter("version") == null ? 0 : Integer.parseInt(request.getParameter("version"));
|
|
|
+ List sectionList = toolUtils.getSectionList(request);
|
|
|
+ if (sectionList == null) return toolUtils.response("0001", version);
|
|
|
+ LoopVO loopDropDownList = loopService.getLoopDropDownList(sectionList);
|
|
|
+ LoopVO[] array = {};
|
|
|
+ if (loopDropDownList == null) return BaseResult.success(array);
|
|
|
+ return BaseResult.success(loopDropDownList);
|
|
|
+ }
|
|
|
+
|
|
|
}
|