gaodd hace 1 año
padre
commit
d7daa2c40c

+ 6 - 0
src/main/java/com/chinaitop/depot/DepotStorageApplication.java

@@ -7,7 +7,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
7
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
8
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
8
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
9
 import org.springframework.cloud.openfeign.EnableFeignClients;
9
 import org.springframework.cloud.openfeign.EnableFeignClients;
10
+import org.springframework.context.annotation.Bean;
10
 import org.springframework.transaction.annotation.EnableTransactionManagement;
11
 import org.springframework.transaction.annotation.EnableTransactionManagement;
12
+import org.springframework.web.client.RestTemplate;
11
 
13
 
12
 @EnableFeignClients
14
 @EnableFeignClients
13
 @EnableEurekaClient
15
 @EnableEurekaClient
@@ -21,4 +23,8 @@ public class DepotStorageApplication {
21
         SpringApplication.run(DepotStorageApplication.class, args);
23
         SpringApplication.run(DepotStorageApplication.class, args);
22
     }
24
     }
23
 
25
 
26
+    @Bean
27
+    public RestTemplate restTemplate() {
28
+        return new RestTemplate();
29
+    }
24
 }
30
 }

+ 6 - 6
src/main/java/com/chinaitop/depot/business/service/impl/BusinessDrugStandingBookServiceImpl.java

@@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
9
 import com.github.pagehelper.PageHelper;
9
 import com.github.pagehelper.PageHelper;
10
 import org.apache.commons.lang.StringUtils;
10
 import org.apache.commons.lang.StringUtils;
11
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
12
+import org.springframework.beans.factory.annotation.Value;
12
 import org.springframework.context.annotation.Bean;
13
 import org.springframework.context.annotation.Bean;
13
 import org.springframework.stereotype.Service;
14
 import org.springframework.stereotype.Service;
14
 import org.springframework.transaction.annotation.Transactional;
15
 import org.springframework.transaction.annotation.Transactional;
@@ -45,11 +46,10 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
45
     
46
     
46
     @Resource
47
     @Resource
47
     private RestTemplate restTemplate;
48
     private RestTemplate restTemplate;
49
+    
50
+    @Value("${jsgjjsjUrl}")
51
+    private String jsgjjsjUrl;
48
 
52
 
49
-    @Bean
50
-    public RestTemplate restTemplate() {
51
-        return new RestTemplate();
52
-    }
53
 
53
 
54
     /**
54
     /**
55
      * 入库新增台账数据.
55
      * 入库新增台账数据.
@@ -726,7 +726,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
726
 		/**
726
 		/**
727
          * restTemplate调用
727
          * restTemplate调用
728
          */
728
          */
729
-        String url = "http://localhost:9022/recPublish/sendMessage";//
729
+        //String url = "http://localhost:9022/recPublish/sendMessage";//
730
         // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
730
         // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
731
         MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
731
         MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
732
 		//Map<String, Object>  sendMap = new HashMap<String, Object>();
732
 		//Map<String, Object>  sendMap = new HashMap<String, Object>();
@@ -742,7 +742,7 @@ public class BusinessDrugStandingBookServiceImpl implements BusinessDrugStanding
742
 		sendMap.add("tableName", tableName);
742
 		sendMap.add("tableName", tableName);
743
 		sendMap.add("orgId",orgId);
743
 		sendMap.add("orgId",orgId);
744
 
744
 
745
-       String result = (String) restTemplate.postForObject(url, sendMap, String.class);
745
+       String result = (String) restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
746
     }
746
     }
747
 
747
 
748
 }
748
 }

+ 6 - 7
src/main/java/com/chinaitop/depot/risk/service/impl/StorageSafeManageServiceImpl.java

@@ -9,6 +9,7 @@ import com.chinaitop.depot.utils.ParameterUtil;
9
 import com.fasterxml.jackson.core.JsonProcessingException;
9
 import com.fasterxml.jackson.core.JsonProcessingException;
10
 import com.fasterxml.jackson.databind.ObjectMapper;
10
 import com.fasterxml.jackson.databind.ObjectMapper;
11
 
11
 
12
+import org.springframework.beans.factory.annotation.Value;
12
 import org.springframework.context.annotation.Bean;
13
 import org.springframework.context.annotation.Bean;
13
 import org.springframework.stereotype.Service;
14
 import org.springframework.stereotype.Service;
14
 import org.springframework.util.LinkedMultiValueMap;
15
 import org.springframework.util.LinkedMultiValueMap;
@@ -31,11 +32,9 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
31
     @Resource
32
     @Resource
32
     private RestTemplate restTemplate;
33
     private RestTemplate restTemplate;
33
 
34
 
34
-    @Bean
35
-    public RestTemplate restTemplate() {
36
-        return new RestTemplate();
37
-    }
38
-
35
+    @Value("${jsgjjsjUrl}")
36
+    private String jsgjjsjUrl;
37
+    
39
     @Override
38
     @Override
40
     public List<StorageSafeManageWithBLOBs> findbyConditions(Integer orgId, Integer fxlx, Integer fxfj) throws Exception {
39
     public List<StorageSafeManageWithBLOBs> findbyConditions(Integer orgId, Integer fxlx, Integer fxfj) throws Exception {
41
 
40
 
@@ -145,7 +144,7 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
145
    		/**
144
    		/**
146
             * restTemplate调用
145
             * restTemplate调用
147
             */
146
             */
148
-           String url = "http://localhost:9022/recPublish/sendMessage";//
147
+           //String url = "http://localhost:9022/recPublish/sendMessage";//
149
            // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
148
            // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
150
            MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
149
            MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
151
    		//Map<String, Object>  sendMap = new HashMap<String, Object>();
150
    		//Map<String, Object>  sendMap = new HashMap<String, Object>();
@@ -161,6 +160,6 @@ public class StorageSafeManageServiceImpl implements StorageSafeManageService {
161
    		sendMap.add("tableName", tableName);
160
    		sendMap.add("tableName", tableName);
162
    		sendMap.add("orgId",orgId);
161
    		sendMap.add("orgId",orgId);
163
 
162
 
164
-          String result = (String) restTemplate.postForObject(url, sendMap, String.class);
163
+          String result = (String) restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
165
        }
164
        }
166
 }
165
 }

+ 4 - 1
src/main/resources/bootstrap-dev.yml

@@ -48,4 +48,7 @@ api:
48
 reportUrl: http://101.36.160.140:8097
48
 reportUrl: http://101.36.160.140:8097
49
 logging:
49
 logging:
50
   level:
50
   level:
51
-    com.chinaitop.depot.risk.mapper: debug
51
+    com.chinaitop.depot.risk.mapper: debug
52
+    
53
+jsgjjsjUrl: http://localhost:9022/recPublish/sendMessage
54
+    

+ 3 - 1
src/main/resources/bootstrap-prod.yml

@@ -43,4 +43,6 @@ api:
43
   safety:
43
   safety:
44
     host: localhost
44
     host: localhost
45
     port: 8765
45
     port: 8765
46
-reportUrl: http://101.36.160.140:8097
46
+reportUrl: http://101.36.160.140:8097
47
+
48
+jsgjjsjUrl: http://localhost:9022/recPublish/sendMessage