瀏覽代碼

swagger控制

fanxw 1 年之前
父節點
當前提交
7febb203ba

+ 2 - 0
src/main/java/com/chinaitop/SwaggerConfig.java

@@ -1,6 +1,7 @@
1 1
 package com.chinaitop;
2 2
 
3 3
 import org.springframework.beans.factory.annotation.Value;
4
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
4 5
 import org.springframework.context.annotation.Bean;
5 6
 import org.springframework.context.annotation.Configuration;
6 7
 import springfox.documentation.builders.ApiInfoBuilder;
@@ -13,6 +14,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
13 14
 
14 15
 @Configuration
15 16
 @EnableSwagger2
17
+@ConditionalOnProperty(name = "swagger.enable", havingValue = "true")
16 18
 public class SwaggerConfig {
17 19
 
18 20
 	@Value("${eureka.instance.hostname}")

+ 1 - 18
src/main/java/com/chinaitop/depot/storage/controller/JkqCrkController.java

@@ -51,10 +51,6 @@ public class JkqCrkController {
51 51
 	@Resource
52 52
 	private StorageKcglJkqyqApplyDefaultService storageKcglJkqyqApplyDefaultService;
53 53
 
54
-	// 获取出入库ip地址
55
-	@Value("${report-Url}")
56
-	private String changeUrl;
57
-	
58 54
 	@RequestMapping(value="/getApplyList", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
59 55
 	@ApiOperation(value="架空期申请查询", notes = "支持分页")
60 56
 	@ApiImplicitParams({
@@ -479,20 +475,7 @@ public class JkqCrkController {
479 475
 		}
480 476
 		jso = jso + str + "]}";
481 477
 		try {
482
-		String url = changeUrl+"/business-management/changeStoragehous/saveJcq";
483
-        String count= HTTPUtils.doPost(url,jso);
484
-        if(count.contains("Success") || count.contains("200")){
485
-        	if(isUpload == 0) {
486
-        		dataKcglJkq.setIsUpload(1);
487
-        		dataKcglJkq.setYqsqNo(yqsqNo);
488
-        		storageKcglJkqyqApplyDefaultService.updateJkqStatus(dataKcglJkq);
489
-        		dataKcglJkq1.setIsUpload(1);
490
-        		dataKcglJkq1.setYqsqNo(yqsqNo);
491
-        		storageKcglJkqyqApplyDefaultService.updateJkq1Status(dataKcglJkq1);
492
-        	}
493
-            modelMap.put("status", "success");
494
-            modelMap.put("msg", "成功!");
495
-        }
478
+
496 479
 	 } catch (Exception e){
497 480
             e.printStackTrace();
498 481
             modelMap.put("status", "error");

+ 18 - 18
src/main/java/com/chinaitop/depot/storage/controller/StorageChangeStoragehouseTaskController.java

@@ -67,8 +67,8 @@ public class StorageChangeStoragehouseTaskController {
67 67
 	private String url;
68 68
 	
69 69
 	// 获取出入库ip地址
70
-	@Value("${report-Url}")
71
-	private String changeUrl;
70
+//	@Value("${report-Url}")
71
+//	private String changeUrl;
72 72
 	/**
73 73
 	 * 得到当前倒仓主表中数据
74 74
 	 * 
@@ -557,14 +557,14 @@ public class StorageChangeStoragehouseTaskController {
557 557
 		str = str.substring(0, str.length()-1);
558 558
 		jso = jso + str + "]}";
559 559
 		try {
560
-		String url = changeUrl+"/business-management/changeStoragehous/save";
561
-		
562
-        String count= HTTPUtils.doPost(url,jso);
563
-        
564
-        if(count.contains("Success") || count.contains("200")){
565
-            modelMap.put("status", "success");
566
-            modelMap.put("msg", "成功!");
567
-        }
560
+//		String url = changeUrl+"/business-management/changeStoragehous/save";
561
+//		
562
+//        String count= HTTPUtils.doPost(url,jso);
563
+//        
564
+//        if(count.contains("Success") || count.contains("200")){
565
+//            modelMap.put("status", "success");
566
+//            modelMap.put("msg", "成功!");
567
+//        }
568 568
 	 } catch (Exception e){
569 569
             e.printStackTrace();
570 570
             modelMap.put("status", "error");
@@ -626,14 +626,14 @@ public class StorageChangeStoragehouseTaskController {
626 626
 		str = str.substring(0, str.length()-1);
627 627
 		jso = jso + str + "]}";
628 628
 		try {
629
-		String url = changeUrl+"/business-management/changeStoragehous/save";
630
-		
631
-        String count= HTTPUtils.doPost(url,jso);
632
-        
633
-        if(count.contains("Success") || count.contains("200")){
634
-            modelMap.put("status", "success");
635
-            modelMap.put("msg", "成功!");
636
-        }
629
+//		String url = changeUrl+"/business-management/changeStoragehous/save";
630
+//		
631
+//        String count= HTTPUtils.doPost(url,jso);
632
+//        
633
+//        if(count.contains("Success") || count.contains("200")){
634
+//            modelMap.put("status", "success");
635
+//            modelMap.put("msg", "成功!");
636
+//        }
637 637
 	 } catch (Exception e){
638 638
             e.printStackTrace();
639 639
             modelMap.put("status", "error");

+ 11 - 6
src/main/resources/bootstrap.yml

@@ -10,6 +10,7 @@ eureka:
10 10
       defaultZone: http://tj_admin:Admin_1234@${eureka.instance.hostname}:9001/eureka/
11 11
   instance:
12 12
     hostname: 172.16.0.16
13
+    #hostname: localhost
13 14
     prefer-ip-address: true
14 15
     # 每隔10s发送一次心跳(默认30s)
15 16
     lease-renewal-interval-in-seconds: 10
@@ -24,18 +25,22 @@ management:
24 25
   server:
25 26
     port: -1
26 27
 
28
+#是否开启swaggeer? true开启,false关闭,生产环境要求关闭
29
+swagger:
30
+  enable: true
31
+
27 32
 spring:
28 33
   application:
29 34
     name: depot-qualitycheck
30 35
   # 数据库配置
31 36
   datasource:
32 37
     type: com.alibaba.druid.pool.DruidDataSource
33
-    url: jdbc:gbasedbt-sqli://101.36.160.140:19089/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GB18030,GB18030-2000,5488;DB_LOCALE=zh_cn.GB18030-2000;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
34
-    username: gbasedbt
35
-    password: cDbK2S0go8
36
-    #url: jdbc:gbasedbt-sqli://10.223.3.63:9088/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
38
+    #url: jdbc:gbasedbt-sqli://101.36.160.140:19089/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GB18030,GB18030-2000,5488;DB_LOCALE=zh_cn.GB18030-2000;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
37 39
     #username: gbasedbt
38
-    #password: GBase123
40
+    #password: cDbK2S0go8
41
+    url: jdbc:gbasedbt-sqli://200.2.68.126:9088/depot:INFORMIXSERVER=gbaseserver;NEWCODESET=GBK,8859-1,819;GL_USEGLU=1;IFX_USE_STRENC=true;characterEncoding=utf8;
42
+    username: gbasedbt
43
+    password: GBase123
39 44
     driver-class-name: com.gbasedbt.jdbc.IfxDriver
40 45
 
41 46
   # 缓存配置
@@ -68,7 +73,7 @@ cxf:
68 73
 crk-webservice: /Base/webServices/StoreChangeServer?wsdl
69 74
 
70 75
 #省平台倒仓审批接口
71
-report-Url: http://172.16.2.10:88/api
76
+#report-Url: http://172.16.2.10:88/api
72 77
 
73 78
 #给市平台推自检/出库数据的接口
74 79
 reportForSPT-Url: http://172.16.0.72:8888