国家库权限验证

busUser
anthonyywj2 3 years ago
parent 7a647193a4
commit 100baa337e

@ -24,13 +24,15 @@ import java.util.Map;
public class AsyncDiDlHelper {
@Value("${UDI_SERVER_URL}")
private String udiUrl;
@Resource
HttpClient httpClient;
public List<ProductInfoEntity> dlByTime(String udiUrl, int page, int limit, String updateTime) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("page", page);
paramMap.put("limit", limit);
paramMap.put("updateTime", updateTime);
String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncUdi", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/udiwms/syncUdi", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> udiDlDeviceResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
@ -51,7 +53,7 @@ public class AsyncDiDlHelper {
paramMap.put("page", page);
paramMap.put("limit", limit);
paramMap.put("updateTime", updateTime);
String response = HttpClient.mipsGet(udiUrl + "/udidl/udiwms/syncCompany", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/udiwms/syncCompany", paramMap);
try {
BaseResponse<List<UdiCompanyEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<UdiCompanyEntity>>>() {
@ -70,7 +72,7 @@ public class AsyncDiDlHelper {
public List<ProductInfoEntity> dlByDi(String deviceId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("deviceId", deviceId);
String response = HttpClient.mipsGet(udiUrl + "/udidl/device/serchDlByDi", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/device/serchDlByDi", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
@ -92,7 +94,7 @@ public class AsyncDiDlHelper {
public BaseResponse<List<ProductInfoEntity>> dlByDiRes(String deviceId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("deviceId", deviceId);
String response = HttpClient.mipsGet(udiUrl + "/udidl/device/serchDlByDi", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/device/serchDlByDi", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
@ -108,7 +110,7 @@ public class AsyncDiDlHelper {
public BaseResponse<List<ProductInfoEntity>> dlLastVersionByDi(String deviceId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("deviceId", deviceId);
String response = HttpClient.mipsGet(udiUrl + "/udidl/device/dlLastVersionByDi", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/device/dlLastVersionByDi", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
@ -131,7 +133,7 @@ public class AsyncDiDlHelper {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("uuid", uuid);
String response = HttpClient.mipsGet(udiUrl + "/udidl/device/searchDlByUuid", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/device/searchDlByUuid", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {

@ -295,7 +295,7 @@ public class BasicUpdateProductService {
paramMap.put("zczbhhzbapzbh", productInfoFilterRequest.getZczbhhzbapzbh());
paramMap.put("uuid", productInfoFilterRequest.getUuid());
String response = httpClient.mipsGetHead(udiUrl + "/udidl/device/filterAllUdi", paramMap);
String response = httpClient.mipsGetUdiHead(udiUrl + "/udidl/device/filterAllUdi", paramMap);
try {
BaseResponse<PageSimpleResponse<UdiInfoEntity>> udiDlDeviceResponse =

@ -61,8 +61,6 @@ public class IoTransInoutService {
UdiRelevanceService udiRelevanceService;
@Resource
private UdiInfoService udiInfoService;
@Value("${UDI_SERVER_URL}")
private String udiUrl;
@Resource
private CodesTempService codesTempService;

@ -20,8 +20,10 @@ import java.util.Map;
@Service
public class HttpClient {
@Value("${UDI_KEY}")
private String udiKey;
@Value("${UDI_APPID}")
private String appId;
@Value("${UDI_SECRET}")
private String appSecret;
private static final Logger logger = LoggerFactory.getLogger(HttpClient.class);
@ -162,11 +164,12 @@ public class HttpClient {
}
public String mipsGetHead(String url, Map params) {
public String mipsGetUdiHead(String url, Map params) {
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", "application/json");
headers.add("key", udiKey);
headers.add("appId", appId);
headers.add("appSecret", appSecret);
StringBuffer stringBuffer = new StringBuffer(url);
if (params instanceof Map) {
Iterator iterator = ((Map) params).entrySet().iterator();
@ -187,7 +190,6 @@ public class HttpClient {
}
RestTemplate restTemplate = new RestTemplate();
String accessTokenRequestUrl = url;//"http://127.0.0.1:9997/mips/druginfo/list";
logger.info(accessTokenRequestUrl+"---"+udiKey);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(headers), String.class);
// String response = restTemplate.getForObject(accessTokenRequestUrl, String.class, new HttpEntity<String>(headers));
return response.getBody();

@ -1,5 +1,5 @@
# \u751F\u4EA7\u73AF\u5883
server.port=9906
server.port=9907
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.jdbc-url=jdbc:mysql://127.0.0.1:3306/spms_ph?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
spring.datasource.username=root
@ -20,7 +20,8 @@ spring.servlet.multipart.max-request-size=200MB
server.connectionTimeout=180000
#file_path=/home/glxpdata/udiwms
file_path=D:/glxpdata/udiwms
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_APPID=SPMS_DEV
UDI_SECRET=563ecd2323064aafb013ac50621575f9
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
#UDI_SERVER_URL=http://127.0.0.1:9994
#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server

@ -19,7 +19,8 @@ server.connectionTimeout=180000
logging.level.com.glxp.sale.admin.dao=debug
#file_path=/home/glxpdata/udiwms
file_path=D:/glxpdata/udiwms
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_APPID=SPMS_DEV
UDI_SECRET=563ecd2323064aafb013ac50621575f9
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
spring.jackson.time-zone=GMT+8

@ -32,7 +32,8 @@ logging.level.com.glxp.api.admin.dao.thrsys=debug
file_path=/home/glxpdata/udiwms
#file_path=D:/glxpdata/udiwms
#UDI\u6570\u636E\u4E0B\u8F7D
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_APPID=SPMS_DEV
UDI_SECRET=563ecd2323064aafb013ac50621575f9
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
#UDI_SERVER_URL=http://127.0.0.1:9994
#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server

@ -32,15 +32,11 @@ logging.level.com.glxp.api.admin.dao.thrsys=debug
file_path=/home/glxpdata/udiwms
#file_path=D:/glxpdata/udiwms
#UDI\u6570\u636E\u4E0B\u8F7D
UDI_KEY=6b137c66-6286-46c6-8efa-c2f5dd9237df
UDI_APPID=SPMS_DEV
UDI_SECRET=563ecd2323064aafb013ac50621575f9
UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server_test
#UDI_SERVER_URL=http://127.0.0.1:9994
#UDI_SERVER_URL=https://www.udims.com/UDI_DL_Server
#UCLOD\u670D\u52A1
#UCLOD_SERVER_URL=http://127.0.0.1:9997
#UCLOD_SERVER_URL=http://127.0.0.1:8080/UDIC_UCLOUD_SERVER
UCLOD_SERVER_URL=http://139.9.178.73/UDIC_UCLOUD_SERVER
#mips\u670D\u52A1\u5730\u5740
UDIC_MIPSDOWNLOAD_URL=http://127.0.0.1:8080/UDIC_MIPSDL_Server
#UDIC_MIPSDOWNLOAD_URL = http://127.0.0.1:9997
UDIC_U8_URL="https://api.yonyoucloud.com/apis/u8c/uapbd/invmandoc_query"

Loading…
Cancel
Save