gaodd преди 1 година
родител
ревизия
799a123d83

+ 8 - 0
src/main/java/com/chinaitop/depot/DepotSystemApplication.java

@@ -5,7 +5,9 @@ import org.springframework.boot.SpringApplication;
5 5
 import org.springframework.boot.autoconfigure.SpringBootApplication;
6 6
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
7 7
 import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
8
+import org.springframework.context.annotation.Bean;
8 9
 import org.springframework.transaction.annotation.EnableTransactionManagement;
10
+import org.springframework.web.client.RestTemplate;
9 11
 
10 12
 import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
11 13
 
@@ -19,4 +21,10 @@ public class DepotSystemApplication {
19 21
 	public static void main(String[] args) {
20 22
 		SpringApplication.run(DepotSystemApplication.class, args);
21 23
 	}
24
+	
25
+	
26
+	@Bean
27
+    public RestTemplate restTemplate() {
28
+        return new RestTemplate();
29
+    }
22 30
 }

+ 1 - 1
src/main/java/com/chinaitop/depot/system/mapper/UserInfoMapper.xml

@@ -828,6 +828,6 @@
828 828
 		left join basic_enum e5 on e5.enumid=a.xl
829 829
 		left join basic_enum e6 on e6.enumid=a.sex
830 830
 		left join province_all.biz_unit_info dw on dw.id = b.unit_info_id
831
-		where length(a.real_name)<12 and b.org_class_id=5318 and a.user_id = #{id}
831
+		where length(a.real_name) &lt;12 and b.org_class_id=5318 and a.user_id = #{id}
832 832
   </select>
833 833
 </mapper>

+ 3 - 5
src/main/java/com/chinaitop/depot/system/service/impl/OrgInfoServiceImpl.java

@@ -31,10 +31,6 @@ public class OrgInfoServiceImpl implements OrgInfoService {
31 31
 	@Resource
32 32
     private RestTemplate restTemplate;
33 33
 
34
-    @Bean
35
-    public RestTemplate restTemplate() {
36
-        return new RestTemplate();
37
-    }
38 34
     
39 35
     @Value("${jsgjjsjUrl}")
40 36
     private String jsgjjsjUrl;
@@ -250,6 +246,8 @@ public class OrgInfoServiceImpl implements OrgInfoService {
250 246
    		sendMap.add("tableName", tableName);
251 247
    		sendMap.add("orgId", orgId);
252 248
 
253
-          String result = (String) restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
249
+   		System.out.println(jsgjjsjUrl);
250
+   		
251
+          restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
254 252
        }
255 253
 }

+ 5 - 6
src/main/java/com/chinaitop/depot/system/service/impl/UserInfoServiceImpl.java

@@ -11,6 +11,7 @@ import java.util.Map;
11 11
 import javax.annotation.Resource;
12 12
 
13 13
 import org.apache.commons.lang3.StringUtils;
14
+import org.springframework.beans.factory.annotation.Value;
14 15
 import org.springframework.context.annotation.Bean;
15 16
 import org.springframework.stereotype.Service;
16 17
 import org.springframework.transaction.annotation.Transactional;
@@ -53,10 +54,8 @@ public class UserInfoServiceImpl implements UserInfoService {
53 54
 	@Resource
54 55
     private RestTemplate restTemplate;
55 56
 
56
-    @Bean
57
-    public RestTemplate restTemplate() {
58
-        return new RestTemplate();
59
-    }
57
+    @Value("${jsgjjsjUrl}")
58
+    private String jsgjjsjUrl;
60 59
     
61 60
 
62 61
 	@Override
@@ -377,7 +376,7 @@ public class UserInfoServiceImpl implements UserInfoService {
377 376
    		/**
378 377
             * restTemplate调用
379 378
             */
380
-           String url = "http://localhost:9022/recPublish/sendMessage";//
379
+           //String url = "http://localhost:9022/recPublish/sendMessage";//
381 380
            // 发送post请求,并打印结果,以String类型接收响应结果JSON字符串
382 381
            MultiValueMap<String, Object> sendMap = new LinkedMultiValueMap<>();
383 382
    		//Map<String, Object>  sendMap = new HashMap<String, Object>();
@@ -393,7 +392,7 @@ public class UserInfoServiceImpl implements UserInfoService {
393 392
    		sendMap.add("tableName", tableName);
394 393
    		sendMap.add("orgId",orgId);
395 394
 
396
-          String result = (String) restTemplate.postForObject(url, sendMap, String.class);
395
+          restTemplate.postForObject(jsgjjsjUrl, sendMap, String.class);
397 396
        }
398 397
 
399 398
 }

+ 1 - 1
src/main/resources/application-dev.yml

@@ -27,7 +27,7 @@ spring:
27 27
 eureka:
28 28
   client:
29 29
     serviceUrl:
30
-      defaultZone: http://localhost:9001/eureka/
30
+      defaultZone: http://172.16.0.46:9001/eureka/
31 31
   instance:
32 32
     hostname: 172.16.0.46
33 33
     # 每隔10s发送一次心跳(默认30s)

+ 1 - 1
src/main/resources/application.yml

@@ -4,7 +4,7 @@ server:
4 4
     uri-encoding: utf-8
5 5
 spring:
6 6
   application:
7
-    name: depot-system
7
+    name: depot-system-g
8 8
   profiles:
9 9
     active: dev
10 10
 mybatis: