|
@@ -0,0 +1,34 @@
|
|
|
+package org.jeecg.modules.openApi.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
|
|
|
+import org.jeecg.modules.system.util.JsonChangeUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+
|
|
|
+ * 测试取数类
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/openApi/test")
|
|
|
+public class TestController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISenYuDataSourceOne senYuDataSourceOne;
|
|
|
+
|
|
|
+ @GetMapping(value = "/Query")
|
|
|
+ public JSONObject save(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ String sql="select * from Inventory where cInvCode='0101000001'";
|
|
|
+ List<Map<String, Object>> list=senYuDataSourceOne.queryForList(sql);
|
|
|
+ List<JSONObject> listJSONObject= JsonChangeUtils.toListJson(list);
|
|
|
+ return listJSONObject.get(0);
|
|
|
+ }
|
|
|
+}
|