Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

liusw 8 лет назад
Родитель
Сommit
ece4d02798

+ 5 - 4
pom.xml

@@ -26,6 +26,11 @@
             <artifactId>ps-entity</artifactId>
             <artifactId>ps-entity</artifactId>
         </dependency>
         </dependency>
 
 
+        <dependency>
+            <groupId>com.uas.account</groupId>
+            <artifactId>sso-integration</artifactId>
+        </dependency>
+
         <!-- httpClient -->
         <!-- httpClient -->
         <dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>
             <groupId>org.apache.httpcomponents</groupId>
@@ -56,10 +61,6 @@
             <groupId>org.springframework.boot</groupId>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
             <artifactId>spring-boot-starter-web</artifactId>
         </dependency>
         </dependency>
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-security</artifactId>
-        </dependency>
         <dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-configuration-processor</artifactId>
             <artifactId>spring-boot-configuration-processor</artifactId>

+ 2 - 0
src/main/java/com/uas/ps/inquiry/Application.java

@@ -1,5 +1,6 @@
 package com.uas.ps.inquiry;
 package com.uas.ps.inquiry;
 
 
+import com.uas.account.sso.integration.config.EnableSSO;
 import com.uas.ps.core.util.ContextUtils;
 import com.uas.ps.core.util.ContextUtils;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -23,6 +24,7 @@ import java.io.PrintStream;
 @EnableTransactionManagement
 @EnableTransactionManagement
 @SpringBootApplication
 @SpringBootApplication
 @EnableWebMvc
 @EnableWebMvc
+@EnableSSO
 public class Application {
 public class Application {
     public static void main(String[] args) throws FileNotFoundException {
     public static void main(String[] args) throws FileNotFoundException {
         File logFile = new File("logs/log.log");
         File logFile = new File("logs/log.log");

+ 2 - 1
src/main/java/com/uas/ps/inquiry/CorsConfig.java

@@ -21,7 +21,8 @@ public class CorsConfig extends WebMvcConfigurerAdapter {
                 .allowedOrigins("*")
                 .allowedOrigins("*")
                 .allowCredentials(true)
                 .allowCredentials(true)
                 .allowedMethods("GET", "POST", "DELETE", "PUT")
                 .allowedMethods("GET", "POST", "DELETE", "PUT")
-                .maxAge(3600);
+                .maxAge(3600)
+                .allowedHeaders("Access-Control-Allow-Origin: *");
     }
     }
 
 
 }
 }

+ 6 - 3
src/main/java/com/uas/ps/inquiry/service/impl/PublicInquiryServiceImpl.java

@@ -770,11 +770,14 @@ public class PublicInquiryServiceImpl implements PublicInquiryService {
      */
      */
     @Override
     @Override
     public List<InquiryMessage> getMessageList(Long enuu, Integer size) {
     public List<InquiryMessage> getMessageList(Long enuu, Integer size) {
-        if (size == 0) {
+        if (size == 0 || size == null) {
             size = 10;
             size = 10;
         }
         }
-        String sql = "select * from (select p.id_id id, p.id_prid productId, p.id_date as date, i.in_enuu enuu from purc$puinquiryitems p left join purc$puinquiry i on i.in_id = p.id_inid where i.in_isopen = 1 and i.in_enuu <> " +
-                enuu + " and COALESCE(p.id_overdue, 0) <> 1 order by p.id_id desc) i limit " + size;
+        String sql = "select * from (select p.id_id id, p.id_prid productId, p.id_date as date, i.in_enuu enuu from purc$puinquiryitems p left join purc$puinquiry i on i.in_id = p.id_inid where i.in_isopen = 1";
+        if (enuu != null) {
+            sql = sql + " and i.in_enuu <> " + enuu ;
+        }
+        sql = sql + " and COALESCE(p.id_overdue, 0) <> 1 order by p.id_id desc) i limit " + size;
         List<PurcInquiryItem> items = jdbcTemplate.query(sql, new BeanPropertyRowMapper<PurcInquiryItem>(PurcInquiryItem.class));
         List<PurcInquiryItem> items = jdbcTemplate.query(sql, new BeanPropertyRowMapper<PurcInquiryItem>(PurcInquiryItem.class));
         List<InquiryMessage> messages = new ArrayList<InquiryMessage>();
         List<InquiryMessage> messages = new ArrayList<InquiryMessage>();
         if (!CollectionUtils.isEmpty(items)) {
         if (!CollectionUtils.isEmpty(items)) {

+ 2 - 9
src/main/resources/application.yml

@@ -8,12 +8,5 @@ spring:
     hbm2ddl:
     hbm2ddl:
      auto: update
      auto: update
 
 
-security:
- basic:
-  enabled: true
-  path: /
- user:
-  name: inquiry-admin
-  password: select111***
-  role: ADMIN
- ignored: false
+sso:
+ secretKey: 0taQcW073Z7G628g5H