Commit 8e233941 by yangyang

标采接口服务管理(重庆)

parent 0e85000e
......@@ -5,7 +5,10 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
......@@ -20,4 +23,13 @@ public class PublicapiApplication {
SpringUtil.applicationContext = applicationContext;
}
@Bean
public RestTemplate restTemplate(){
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setConnectTimeout(100000);
factory.setReadTimeout(100000);
RestTemplate restTemplate = new RestTemplate(factory);
return restTemplate;
}
}
......@@ -15,10 +15,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
......@@ -36,7 +35,8 @@ public class CqController {
private String xdhAjUrl;
@Autowired
TbStAsjqgMapper tbStAsjqgMapper;
@Autowired
RestTemplate restTemplate;
@OperLog(message = "模板手机号导入", operation = OperationType.QUERY)
@PostMapping("import")
@ApiOperation(value = "模板手机号导入", notes = "传入excel")
......@@ -1355,4 +1355,18 @@ public class CqController {
return resultCar;
}
// ZJHM R-500000000000-00000728
@OperLog(message = "标采人像查询接口服务", operation = OperationType.QUERY)
@GetMapping("bcrxcxRequest")
@ApiOperation(value = "标采人像查询接口服务", notes = "标采人像查询接口服务")
public JSONObject bcrxcxRequest(@RequestParam String sfzh) {
ResponseEntity<JSONObject> result = null;
try {
result = restTemplate.getForEntity("http://77.1.24.41/cj/public/personPhotoes?token=4177E0BF686742BA84B04C8D1B6A97E7&sfzh="+sfzh, JSONObject.class);
} catch (Exception e) {
e.printStackTrace();
}
return result.getBody();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment