fanxw 1 年之前
父節點
當前提交
070ee1b3aa

+ 4 - 0
pom.xml

@@ -60,6 +60,10 @@
60 60
             <artifactId>mybatis-spring-boot-starter</artifactId>
61 61
             <version>1.3.1</version>
62 62
         </dependency>
63
+        <dependency>  
64
+		    <groupId>org.springframework.boot</groupId>  
65
+		    <artifactId>spring-boot-starter-security</artifactId>  
66
+		</dependency>
63 67
         <dependency>
64 68
             <groupId>mysql</groupId>
65 69
             <artifactId>mysql-connector-java</artifactId>

+ 24 - 0
src/main/java/com/WebSecurityConfig.java

@@ -0,0 +1,24 @@
1
+package com;
2
+
3
+import org.springframework.context.annotation.Configuration;
4
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
5
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
6
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
7
+
8
+@Configuration
9
+@EnableWebSecurity
10
+public class WebSecurityConfig 
11
+extends WebSecurityConfigurerAdapter 
12
+{
13
+
14
+	@Override
15
+    protected void configure(HttpSecurity http) throws Exception {
16
+		http.authorizeRequests()
17
+		.antMatchers("/**")
18
+		.permitAll() //允许所有用户访问所有资源
19
+        .and()
20
+        .csrf().disable(); // 禁用CSRF(防止伪造的跨域攻击)
21
+
22
+        super.configure(http);
23
+    }
24
+}

+ 1 - 1
src/main/java/com/chinaitop/depot/intelligent/basicdata/mapper/WareHouseBasicInfoMapper.xml

@@ -49,7 +49,7 @@
49 49
         t1.lypz,
50 50
         t1.lyxz,
51 51
         t1.lydj,
52
-        t1.kcsl,
52
+        t1.kcsl*1000,
53 53
         to_char(t1.rksj,'yyyy-MM-dd HH24:mi:ss') AS rq,
54 54
         to_char(t1.rksj,'yyyy-MM-dd HH24:mi:ss') AS rcrq,
55 55
         to_char(t1.input_time,'yyyy-MM-dd HH24:mi:ss') AS cjsj,

+ 6 - 14
src/main/java/com/chinaitop/depot/intelligent/grainsituation/service/impl/TemperatureRecordServiceImpl.java

@@ -82,23 +82,15 @@ public class TemperatureRecordServiceImpl implements TemperatureRecordService {
82 82
     @Override
83 83
     public List<TTestdataLayer> findByHouseAndTime(String lqId, String vCfCode, String vDatatime, String orgId) {
84 84
         TTestdataLayerExample tTestdataLayerExample = new TTestdataLayerExample();
85
-        tTestdataLayerExample.setDistinct(true);
85
+        //tTestdataLayerExample.setDistinct(true);
86 86
         TTestdataLayerExample.Criteria criteria = tTestdataLayerExample.createCriteria();
87
-        if (StringUtils.isNotBlank(orgId))
87
+        if (StringUtils.isNotBlank(orgId)) {
88 88
             criteria.andOrgIdEqualTo(orgId);
89
-        if (StringUtils.isNotBlank(lqId))
89
+        }
90
+        if (StringUtils.isNotBlank(lqId)) {
90 91
             criteria.andLqIdEqualTo(lqId);
91
-        /*if (StringUtils.isNotBlank(vCfCode))
92
-            criteria.andLhouseEqualTo(vCfCode);
93
-        if (StringUtils.isNotBlank(vDatatime))
94
-            criteria.andLtimeEqualTo(DateUtils.stringToData(vDatatime));*/
95
-//        boolean result = ArrayUtils.contains(SPECIAL_ORG, orgId);
96
-//        if (result) {
97
-//        	tTestdataLayerExample.setOrderByClause("layerNumber ASC");
98
-//        } else {
99
-//        	tTestdataLayerExample.setOrderByClause("layerNumber DESC");
100
-//        }
101
-        
92
+        }
93
+
102 94
         tTestdataLayerExample.setOrderByClause("layerNumber ASC");
103 95
         
104 96
         List<TTestdataLayer> tTestdata = tTestdataLayerMapper.selectByExample(tTestdataLayerExample);

+ 5 - 1
src/main/resources/bootstrap.yml

@@ -22,7 +22,7 @@ num_version3: :20013
22 22
 eureka:
23 23
   client:
24 24
     service-url:
25
-      defaultZone: http://localhost:9001/eureka/
25
+      defaultZone: http://tj_admin:Admin_1234@${eureka.instance.hostname}:9001/eureka/
26 26
   instance:
27 27
     hostname: 172.16.0.16
28 28
     prefer-ip-address: true
@@ -32,6 +32,10 @@ eureka:
32 32
     lease-expiration-duration-in-seconds: 30
33 33
     status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
34 34
 
35
+management:
36
+  server:
37
+    port: -1
38
+
35 39
 spring:
36 40
   application:
37 41
     name: depot-intelligent