|
|
@@ -1,10 +1,18 @@
|
|
|
package com.uas.eis.controller;
|
|
|
|
|
|
+import com.uas.eis.dao.BaseDao;
|
|
|
import com.uas.eis.utils.JacksonUtil;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.jdbc.support.rowset.SqlRowSet;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.net.Socket;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
@@ -15,8 +23,33 @@ import java.util.Map;
|
|
|
* 测试用
|
|
|
*/
|
|
|
@RestController
|
|
|
+@Transactional
|
|
|
public class TestController {
|
|
|
|
|
|
+ private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ BaseDao baseDao;
|
|
|
+
|
|
|
+ @GetMapping(value = "/test/jdbc")
|
|
|
+ public void testJdbc(Integer id){
|
|
|
+ SqlRowSet rs = baseDao.getJdbcTemplate().queryForRowSet("select pi_inoutno from prodinout where rownum=1");
|
|
|
+ if(rs.next()){
|
|
|
+ System.out.println(rs.getString("pi_inoutno"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/test/socket")
|
|
|
+ public void testSocket(Integer id){
|
|
|
+ logger.error("test");
|
|
|
+ try{
|
|
|
+ Socket socket = new Socket("scope2015.oicp.net",1521);
|
|
|
+ System.out.println("connect success");
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping(value = "/test/stock")
|
|
|
public Map<String,Object> testStock(@RequestBody String str){
|
|
|
System.out.println("request body:" + str);
|