Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

rainco 7 years ago
parent
commit
0e22ebf73c
57 changed files with 317 additions and 211 deletions
  1. 5 1
      applications/commons/commons-server/pom.xml
  2. 2 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/CommonsApplication.java
  3. 5 74
      applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductReserveCostDTO.java
  4. 4 0
      applications/document/document-server/pom.xml
  5. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java
  6. 4 1
      applications/document/document-server/src/main/resources/application.yml
  7. 4 0
      applications/money/money-server/pom.xml
  8. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/MoneyApplicatiion.java
  9. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  10. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  11. 32 17
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  12. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/PurchaseApplication.java
  13. 4 0
      applications/sale/sale-server/pom.xml
  14. 2 0
      applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java
  15. 4 0
      applications/storage/storage-server/pom.xml
  16. 2 0
      applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/StorageApplication.java
  17. 10 12
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  18. 1 1
      base-servers/datacenter/datacenter-dto/src/main/java/com/usoftchina/saas/dc/dto/DataSourceInfoDTO.java
  19. 4 9
      base-servers/socket/socket-api/src/main/java/com/usoftchina/saas/socket/api/SocketMessageApi.java
  20. 60 0
      base-servers/socket/socket-api/src/main/java/com/usoftchina/saas/socket/dto/ClientMessage.java
  21. 4 0
      base-servers/socket/socket-server/pom.xml
  22. 14 8
      base-servers/socket/socket-server/src/main/java/com/usoftchina/saas/socket/controller/MessageController.java
  23. 1 0
      framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java
  24. 8 5
      frontend/saas-portal-web/src/components/conenter/home.vue
  25. 0 25
      frontend/saas-portal-web/src/pages/remove-token/remove-token.html
  26. 0 0
      frontend/saas-portal-web/src/pages/remove-token/remove-token.js
  27. 0 15
      frontend/saas-portal-web/src/pages/remove-token/remove-token.vue
  28. 15 0
      frontend/saas-portal-web/static/set-token.html
  29. 15 1
      frontend/saas-portal-web/yarn.lock
  30. 1 0
      frontend/saas-web/app/view/core/base/BasePanel.scss
  31. 3 5
      frontend/saas-web/app/view/core/base/GridPanel.js
  32. 5 2
      frontend/saas-web/app/view/core/dbfind/types/AccountDbfindTrigger.js
  33. 3 0
      frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js
  34. 3 0
      frontend/saas-web/app/view/core/dbfind/types/BomDbfindTrigger.js
  35. 3 0
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js
  36. 3 0
      frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js
  37. 3 0
      frontend/saas-web/app/view/core/dbfind/types/OriOrderMutiDbfindTrigger.js
  38. 3 0
      frontend/saas-web/app/view/core/dbfind/types/ProductAddMultiDbfindTrigger.js
  39. 3 0
      frontend/saas-web/app/view/core/dbfind/types/ProductDbfindTrigger.js
  40. 3 0
      frontend/saas-web/app/view/core/dbfind/types/ProductMultiDbfindTrigger.js
  41. 3 0
      frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js
  42. 3 0
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  43. 3 0
      frontend/saas-web/app/view/core/form/RemoteCombo.js
  44. 1 1
      frontend/saas-web/app/view/document/kind/ChildForm.js
  45. 2 2
      frontend/saas-web/app/view/money/report/AccountDetails.js
  46. 2 1
      frontend/saas-web/app/view/money/report/PayDetail.js
  47. 2 1
      frontend/saas-web/app/view/money/report/RecDetail.js
  48. 7 0
      frontend/saas-web/app/view/money/report/TotalRecDetail.js
  49. 6 6
      frontend/saas-web/app/view/sys/guide/FormPanel.js
  50. 25 9
      frontend/saas-web/app/view/viewport/ViewportController.js
  51. 1 1
      frontend/saas-web/electron/login.html
  52. 6 2
      frontend/saas-web/electron/main.js
  53. 2 11
      frontend/saas-web/index.html
  54. BIN
      frontend/saas-web/resources/images/guide/background.png
  55. BIN
      frontend/saas-web/resources/images/guide/font-background.png
  56. 4 1
      frontend/saas-web/resources/othcss/imagehover.css
  57. 7 0
      pom.xml

+ 5 - 1
applications/commons/commons-server/pom.xml

@@ -66,10 +66,14 @@
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>datacenter-client</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.poi</groupId>
             <artifactId>poi-ooxml</artifactId>
-            <version>3.17</version>
         </dependency>
     </dependencies>
 

+ 2 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/CommonsApplication.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.commons;
 
 import com.usoftchina.saas.auth.client.EnableAuthClient;
+import com.usoftchina.saas.server.jdbc.EnableDynamicDataSource;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -15,6 +16,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @SpringBootApplication
 @EnableEurekaClient
 @EnableTransactionManagement
+@EnableDynamicDataSource
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.commons.mapper")
 @EnableAuthClient

+ 5 - 74
applications/document/document-dto/src/main/java/com.usoftchina.saas.document.dto/ProductReserveCostDTO.java

@@ -1,12 +1,14 @@
 package com.usoftchina.saas.document.dto;
 
 import com.usoftchina.saas.base.dto.CommonBaseDTO;
+import lombok.Data;
 
 import java.io.Serializable;
 
 /**
  * 物料库存数量金额表
  */
+@Data
 public class ProductReserveCostDTO extends CommonBaseDTO implements Serializable {
 
     /**
@@ -36,85 +38,14 @@ public class ProductReserveCostDTO extends CommonBaseDTO implements Serializable
     /**
      * 数量
      */
-    private String rc_number;
+    private Double rc_number;
     /**
      * 单价
      */
-    private String rc_price;
+    private Double rc_price;
     /**
      * 金额
      */
-    private String rc_amount;
+    private Double rc_amount;
 
-    public String getRc_prodCode() {
-        return rc_prodCode;
-    }
-
-    public void setRc_prodCode(String rc_prodCode) {
-        this.rc_prodCode = rc_prodCode;
-    }
-
-    public String getRc_prodDetail() {
-        return rc_prodDetail;
-    }
-
-    public void setRc_prodDetail(String rc_prodDetail) {
-        this.rc_prodDetail = rc_prodDetail;
-    }
-
-    public String getRc_prodSpec() {
-        return rc_prodSpec;
-    }
-
-    public void setRc_prodSpec(String rc_prodSpec) {
-        this.rc_prodSpec = rc_prodSpec;
-    }
-
-    public String getRc_prodUnit() {
-        return rc_prodUnit;
-    }
-
-    public void setRc_prodUnit(String rc_prodUnit) {
-        this.rc_prodUnit = rc_prodUnit;
-    }
-
-    public String getRc_whCode() {
-        return rc_whCode;
-    }
-
-    public void setRc_whCode(String rc_whCode) {
-        this.rc_whCode = rc_whCode;
-    }
-
-    public String getRc_whName() {
-        return rc_whName;
-    }
-
-    public void setRc_whName(String rc_whName) {
-        this.rc_whName = rc_whName;
-    }
-
-    public String getRc_number() {
-        return rc_number;
-    }
-
-    public void setRc_number(String rc_number) {
-        this.rc_number = rc_number;
-    }
-
-    public String getRc_price() {
-        return rc_price;
-    }
-
-    public void setRc_price(String rc_price) {
-        this.rc_price = rc_price;
-    }
-
-    public String getRc_amount() {
-        return rc_amount;
-    }
-
-    public void setRc_amount(String rc_amount) {
-        this.rc_amount = rc_amount;
-    }
 }

+ 4 - 0
applications/document/document-server/pom.xml

@@ -79,6 +79,10 @@
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>account-dto</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>datacenter-client</artifactId>
+        </dependency>
     </dependencies>
 
     <build>

+ 2 - 0
applications/document/document-server/src/main/java/com/usoftchina/saas/document/DocumentApplication.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.document;
 
 import com.usoftchina.saas.auth.client.EnableAuthClient;
+import com.usoftchina.saas.server.jdbc.EnableDynamicDataSource;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.document.mapper")
+@EnableDynamicDataSource
 public class DocumentApplication {
     public static void main(String[] args) {
         SpringApplication.run(DocumentApplication.class, args);

+ 4 - 1
applications/document/document-server/src/main/resources/application.yml

@@ -73,4 +73,7 @@ mybatis:
   type-aliases-package: com.usoftchina.saas.document.entities
   mapper-locations: classpath:mapper/*.xml
 auth:
-  public-key: auth/pub.key
+  public-key: auth/pub.key
+ribbon:
+  ReadTimeout: 6000
+  ConnectTimeout: 6000

+ 4 - 0
applications/money/money-server/pom.xml

@@ -11,6 +11,10 @@
 
     <artifactId>money-server</artifactId>
     <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>datacenter-client</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>server-starter</artifactId>

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/MoneyApplicatiion.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.money;
 
 import com.usoftchina.saas.auth.client.EnableAuthClient;
+import com.usoftchina.saas.server.jdbc.EnableDynamicDataSource;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -19,6 +20,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableFeignClients("com.usoftchina.saas")
 @EnableAuthClient
 @MapperScan("com.usoftchina.saas.money.mapper")
+@EnableDynamicDataSource
 public class MoneyApplicatiion {
     public static void main(String[] args) {
         SpringApplication.run(MoneyApplicatiion.class, args);

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java

@@ -300,8 +300,10 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
                         switch (status) {
                             case  "已付款" :
                                 statuscode = Status.PAYALL.name();
+                                break;
                             case "部分付款":
                                 statuscode = Status.PAYPART.name();
+                                break;
                             default: statuscode = Status.PAYNONE.name();
                         }
                     }else{

+ 2 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java

@@ -346,8 +346,10 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
                         switch (status) {
                             case  "已收款" :
                                 statuscode = Status.RECALL.name();
+                                break;
                             case "部分收款":
                                 statuscode = Status.RECPART.name();
+                                break;
                             default: statuscode = Status.RECNONE.name();
                         }
                     }else{

+ 32 - 17
applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java

@@ -218,7 +218,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 total1 += nowbalanceDet;
 
                 //单据金额
-                Double amount = det.getVd_amount();
+                Double amount = det.getSl_namount();
                 //核销金额
                 if(amount.doubleValue()>0 && nowbalanceDet.doubleValue()<0){
                     String msg = BizExceptionCode.MONEY_NOWAMOUNT_POSITIVE.getMessage();
@@ -262,7 +262,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 Double namount = det.getSl_namount()==null?new Double(0):det.getSl_namount();
                 Double nowbalance = det.getVd_nowbalance()==null?new Double(0):det.getVd_nowbalance();
                 if(namount.doubleValue()<nowbalance.doubleValue()){
-                    throw new BizException(500, BizExceptionCode.VERIFICATION_CHECK_BALANCE.getMessage());
+                    throw new BizException(500, BizExceptionCode.RECALANCE_OUTNOWBALANCE.getMessage());
                 }
             }
         }
@@ -270,14 +270,15 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
     }
 
     //插入中间表
-    private Subledger changSubledgerUntil(VerificationDTO verification){
+    private Subledger changSubledgerUntil(VerificationDTO verification, int cs){
         Subledger subledger = new Subledger();
         String kind = verification.getVc_kind();
         subledger.setCompanyId(BaseContextHolder.getCompanyId());
         subledger.setSl_code(verification.getVc_code());
+        Double amount1 = verification.getVc_amount1()==null?new Double(0):verification.getVc_amount1();
+        Double amount2 = verification.getVc_amount2()==null?new Double(0):verification.getVc_amount2();
 
-        if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable") ||
-                kind.equals("receivable_offset_payable")){
+        if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable") ){
 
             /*
              ['receipts_offset_receivable', '预收冲应收'],
@@ -286,27 +287,31 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
                 ['receivable_to_receivable', '应收转应收'],
                 ['payable_to_payable', '应付转应付']
              */
-            subledger.setSl_custid(0);
+            subledger.setSl_custid(verification.getVc_custid());
             subledger.setSl_vendid(verification.getVc_vendid());
+            subledger.setSl_amount(-amount2);
+            subledger.setSl_preamount(-amount1);
         }else{
-            subledger.setSl_custid(verification.getVc_custid());
-            subledger.setSl_vendid(0);
+            if( cs == 2){
+                subledger.setSl_custid(verification.getVc_turncustid());
+                subledger.setSl_vendid(verification.getVc_turnvendid());
+                subledger.setSl_amount(amount1);
+                subledger.setSl_preamount(new Double(0));
+            } else {
+                subledger.setSl_custid(verification.getVc_custid());
+                subledger.setSl_vendid(verification.getVc_vendid());
+                subledger.setSl_amount(-amount1);
+                subledger.setSl_preamount(new Double(0));
+            }
         }
-        Double amount1 = verification.getVc_amount1()==null?new Double(0):verification.getVc_amount1();
-        Double amount2 = verification.getVc_amount2()==null?new Double(0):verification.getVc_amount2();
+
         subledger.setSl_date(verification.getVc_date());
         subledger.setSl_ym(DateUtils.getYm(verification.getVc_date()));
-        subledger.setSl_amount(-amount2);
         subledger.setSl_orderamount(new Double(0));
         subledger.setSl_yamount(new Double(0));
         subledger.setSl_remark(verification.getVc_remark());
         subledger.setSl_discount(new Double(0));
         subledger.setSl_ym(DateUtils.getYm(verification.getVc_date()));
-        if(kind.equals("receipts_offset_receivable") || kind.equals("prepaid_offset_payable")){
-            subledger.setSl_preamount(-amount1);
-        }else{
-            subledger.setSl_preamount(new Double(0));
-        }
         kind = transferKind(kind);
         subledger.setSl_kind(kind);
         return subledger;
@@ -553,10 +558,20 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
         formData.getMain().setVc_auditdate(new Date());
         baseDTO = this.saveFormData(formData);
         Long id = baseDTO.getId();
+
             VerificationDTO verificationDTO = formData.getMain();
-            Subledger subledger = changSubledgerUntil(verificationDTO);
+
+            Subledger subledger = changSubledgerUntil(verificationDTO, 1);
             subledgerMapper.insertSelective(subledger);
 
+        if ("receivable_to_receivable".equals(verificationDTO.getVc_kind()) ||
+                "receivable_offset_payable".equals(verificationDTO.getVc_kind())
+                || "payable_to_payable".equals(verificationDTO.getVc_kind())){
+            Subledger subledger1 = changSubledgerUntil(verificationDTO,2);
+            subledgerMapper.insertSelective(subledger1);
+
+        }
+
             //更新客户或者供应商的金额
             updateAuditCustomer(verificationDTO);
             updateAuditVendor(verificationDTO);

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/PurchaseApplication.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.purchase;
 
 import com.usoftchina.saas.auth.client.EnableAuthClient;
+import com.usoftchina.saas.server.jdbc.EnableDynamicDataSource;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -18,6 +19,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableFeignClients("com.usoftchina.saas")
 @EnableAuthClient
 @MapperScan("com.usoftchina.saas.purchase.mapper")
+@EnableDynamicDataSource
 public class PurchaseApplication {
     public static void main(String[] args) {
         SpringApplication.run(PurchaseApplication.class, args);

+ 4 - 0
applications/sale/sale-server/pom.xml

@@ -12,6 +12,10 @@
     <artifactId>sale-server</artifactId>
     
     <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>datacenter-client</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>sale-dto</artifactId>

+ 2 - 0
applications/sale/sale-server/src/main/java/com/usoftchina/saas/sale/SaleApplication.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.sale;
 
 import com.usoftchina.saas.auth.client.EnableAuthClient;
+import com.usoftchina.saas.server.jdbc.EnableDynamicDataSource;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -17,6 +18,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
 @EnableEurekaClient
 @EnableFeignClients("com.usoftchina.saas")
 @EnableAuthClient
+@EnableDynamicDataSource
 public class SaleApplication  {
     public static void main(String[] args) {
         SpringApplication.run(SaleApplication.class, args);

+ 4 - 0
applications/storage/storage-server/pom.xml

@@ -12,6 +12,10 @@
     <artifactId>storage-server</artifactId>
 
     <dependencies>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>datacenter-client</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.usoftchina.saas</groupId>
             <artifactId>document-api</artifactId>

+ 2 - 0
applications/storage/storage-server/src/main/java/com/usoftchina/saas/storage/StorageApplication.java

@@ -1,6 +1,7 @@
 package com.usoftchina.saas.storage;
 
 import com.usoftchina.saas.auth.client.EnableAuthClient;
+import com.usoftchina.saas.server.jdbc.EnableDynamicDataSource;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
@@ -14,6 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
 @EnableTransactionManagement
 @EnableFeignClients("com.usoftchina.saas")
 @MapperScan("com.usoftchina.saas.storage.mapper")
+@EnableDynamicDataSource
 public class StorageApplication {
 
     public static void main(String[] args) {

+ 10 - 12
base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java

@@ -25,6 +25,7 @@ import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.server.web.ServletUtils;
 import com.usoftchina.saas.socket.api.SocketMessageApi;
+import com.usoftchina.saas.socket.dto.ClientMessage;
 import com.usoftchina.saas.utils.*;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -33,7 +34,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -219,8 +219,8 @@ public class AuthController {
      * @param info
      * @return
      */
-    @GetMapping(value = "/sso/callback/{clientId}", produces = {"application/javascript"})
-    public String ssoCallback(HttpServletRequest request, HttpServletResponse response,
+    @GetMapping("/sso/callback/{clientId}")
+    public void ssoCallback(HttpServletRequest request, HttpServletResponse response,
                             @PathVariable(required = false) String clientId, CookieInfo info, String callback) throws IOException{
         if (null != info && null != info.getMobile()) {
             AccountDTO accountDTO = null;
@@ -231,8 +231,8 @@ public class AuthController {
                     accountDTO = createAccountByCookieInfo(info);
                 } else {
                     logger.error(result.getMessage());
-                    //ServletUtils.writeJsonPMessage(response, callback, false);
-                    return "successCallback({success:'0'})";
+                    ServletUtils.writeJsonPMessage(response, callback, false);
+                    return;
                 }
             } else {
                 accountDTO = result.getData();
@@ -242,8 +242,8 @@ public class AuthController {
                     Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
-                        //ServletUtils.writeJsonPMessage(response, callback, false);
-                        return "successCallback({success:'0'})";
+                        ServletUtils.writeJsonPMessage(response, callback, false);
+                        return;
                     }
                 }
             }
@@ -262,13 +262,11 @@ public class AuthController {
                 JwtInfo jwtInfo = new JwtInfo(appId, companyId, accountDTO.getId(), accountDTO.getUsername(), accountDTO.getRealname());
                 JwtToken jwtToken = JwtHelper.generateToken(jwtInfo, privateKeyPath, expire);
                 TokenDTO tokenDTO = BeanMapper.map(jwtToken, TokenDTO.class);
-                socketMessageApi.sendToClient(clientId, "/sso/callback",
-                        JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
+                socketMessageApi.sendToClient(new ClientMessage(clientId, "/sso/callback",
+                        JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO))));
             }
-            //ServletUtils.writeJsonPMessage(response, callback, true);
-            return "successCallback({success:'1'})";
+            ServletUtils.writeJsonPMessage(response, callback, true);
         }
-        return "successCallback({success:'0'})";
     }
 
     /**

+ 1 - 1
base-servers/datacenter/datacenter-dto/src/main/java/com/usoftchina/saas/dc/dto/DataSourceInfoDTO.java

@@ -93,7 +93,7 @@ public class DataSourceInfoDTO implements Connectable, Serializable{
 
     @Override
     public String url() {
-        return String.format("jdbc:mysql://%s:%s/%s?characterEncoding=utf-8&useSSL=false",
+        return String.format("jdbc:mysql://%s:%s/%s?characterEncoding=utf-8&useSSL=false&allowMultiQueries=true",
                 dbHost, dbPort, dbRealName);
     }
 

+ 4 - 9
base-servers/socket/socket-api/src/main/java/com/usoftchina/saas/socket/api/SocketMessageApi.java

@@ -1,9 +1,10 @@
 package com.usoftchina.saas.socket.api;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.socket.dto.ClientMessage;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestBody;
 
 /**
  * @author yingp
@@ -14,24 +15,18 @@ public interface SocketMessageApi {
     /**
      * 发送信息给指定用户
      *
-     * @param clientId
-     * @param dest
      * @param message
      * @return
      */
     @PostMapping("/message/clients")
-    Result sendToClient(@RequestParam("clientId") String clientId,
-                        @RequestParam(value = "dest", required = false) String dest,
-                        @RequestParam("message") String message);
+    Result sendToClient(@RequestBody ClientMessage message);
 
     /**
      * 广播信息
      *
-     * @param dest
      * @param message
      * @return
      */
     @PostMapping("/message/clients/all")
-    Result sendToAllClients(@RequestParam(value = "dest", required = false) String dest,
-                            @RequestParam("message") String message);
+    Result sendToAllClients(@RequestBody ClientMessage message);
 }

+ 60 - 0
base-servers/socket/socket-api/src/main/java/com/usoftchina/saas/socket/dto/ClientMessage.java

@@ -0,0 +1,60 @@
+package com.usoftchina.saas.socket.dto;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/12/12
+ */
+public class ClientMessage implements Serializable{
+    /**
+     * 客户端ID
+     */
+    private String clientId;
+    /**
+     * destination
+     */
+    private String dest;
+    /**
+     * 消息内容
+     */
+    private String message;
+
+    public ClientMessage() {
+    }
+
+    public ClientMessage(String dest, String message) {
+        this.dest = dest;
+        this.message = message;
+    }
+
+    public ClientMessage(String clientId, String dest, String message) {
+        this.clientId = clientId;
+        this.dest = dest;
+        this.message = message;
+    }
+
+    public String getClientId() {
+        return clientId;
+    }
+
+    public void setClientId(String clientId) {
+        this.clientId = clientId;
+    }
+
+    public String getDest() {
+        return dest;
+    }
+
+    public void setDest(String dest) {
+        this.dest = dest;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+}

+ 4 - 0
base-servers/socket/socket-server/pom.xml

@@ -35,6 +35,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>socket-api</artifactId>
+        </dependency>
     </dependencies>
     <build>
         <plugins>

+ 14 - 8
base-servers/socket/socket-server/src/main/java/com/usoftchina/saas/socket/controller/MessageController.java

@@ -1,6 +1,10 @@
 package com.usoftchina.saas.socket.controller;
 
 import com.usoftchina.saas.base.Result;
+import com.usoftchina.saas.exception.ExceptionCode;
+import com.usoftchina.saas.socket.api.SocketMessageApi;
+import com.usoftchina.saas.socket.dto.ClientMessage;
+import com.usoftchina.saas.utils.BizAssert;
 import org.springframework.messaging.simp.SimpMessagingTemplate;
 import org.springframework.web.bind.annotation.*;
 
@@ -12,7 +16,7 @@ import javax.annotation.Resource;
  */
 @RestController
 @RequestMapping("/message")
-public class MessageController {
+public class MessageController implements SocketMessageApi{
 
     @Resource
     private SimpMessagingTemplate simpMessagingTemplate;
@@ -20,39 +24,41 @@ public class MessageController {
     /**
      * 发送信息给指定用户
      *
-     * @param clientId
-     * @param dest
      * @param message
      * @return
      */
+    @Override
     @PostMapping("/clients")
-    public Result sendToClient(@RequestParam String clientId, String dest, @RequestParam String message) {
+    public Result sendToClient(@RequestBody ClientMessage message) {
+        BizAssert.hasText(message.getClientId(), ExceptionCode.ILLEGAL_ARGUMENTS);
+        BizAssert.hasText(message.getDest(), ExceptionCode.ILLEGAL_ARGUMENTS);
         /**
          * 前端使用
          * <pre>
          *     stomp.subscribe('/clients/{clientId}/{dest}', function(message){});
          * </pre>
          */
-        simpMessagingTemplate.convertAndSendToUser(clientId, dest, message);
+        simpMessagingTemplate.convertAndSendToUser(message.getClientId(), message.getDest(), message.getMessage());
         return Result.success();
     }
 
     /**
      * 广播信息
      *
-     * @param dest
      * @param message
      * @return
      */
+    @Override
     @PostMapping("/clients/all")
-    public Result sendToAllClients(String dest, @RequestParam String message) {
+    public Result sendToAllClients(@RequestBody ClientMessage message) {
+        BizAssert.hasText(message.getDest(), ExceptionCode.ILLEGAL_ARGUMENTS);
         /**
          * 前端使用
          * <pre>
          *     stomp.subscribe('/clients/{dest}', function(message){});
          * </pre>
          */
-        simpMessagingTemplate.convertAndSend(dest, message);
+        simpMessagingTemplate.convertAndSend(message.getDest(), message.getMessage());
         return Result.success();
     }
 }

+ 1 - 0
framework/core/src/main/java/com/usoftchina/saas/exception/ExceptionCode.java

@@ -10,6 +10,7 @@ public enum ExceptionCode implements BaseExceptionCode {
     SYSTEM_TIMEOUT(-2, "系统超时,请稍候再试"),
 
     INVALID_DEFAULT_PAGE(10001, "无效默认分页参数"),
+    ILLEGAL_ARGUMENTS(20001, "参数错误"),
     // jwt token 相关 start
     // 过期
     JWT_TOKEN_EXPIRED(40001, "token超时,请检查 token 的有效期"),

+ 8 - 5
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -269,11 +269,14 @@
         withCredentials:true
       })
       .then(res=>{
-        const data=res.data.data,session = data.token, account = data.account
-        account.companies = account.companies || []
-        session.account = account
-        Session.set(session);
-        this.account = Session.getAccount();
+        const data=res.data.data;
+        if(data&&data!=null){
+          const session = data.token, account = data.account
+          account.companies = account.companies || []
+          session.account = account
+          Session.set(session);
+          this.account = Session.getAccount();
+        }
       })
     },
     mounted() {

+ 0 - 25
frontend/saas-portal-web/src/pages/remove-token/remove-token.html

@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>Document</title>
-</head>
-<body>
-    <div id="app">hello</div>
-    <script>
-        // iframe接收消息
-        window.addEventListener('message', function(e) {
-            if (e.data == 'removeToken') {
-                if (e.source != window.parent) {
-                    return;
-                }
-                var storeKey = 'app-state-session';
-                localStorage.removeItem(storeKey);
-                window.parent.postMessage("success", "*");
-            }
-        });
-    </script>
-</body>
-</html>

+ 0 - 0
frontend/saas-portal-web/src/pages/remove-token/remove-token.js


+ 0 - 15
frontend/saas-portal-web/src/pages/remove-token/remove-token.vue

@@ -1,15 +0,0 @@
-<template>
-    <div>
-
-    </div>
-</template>
-
-<script>
-    export default {
-        
-    }
-</script>
-
-<style scoped>
-
-</style>

+ 15 - 0
frontend/saas-portal-web/static/set-token.html

@@ -0,0 +1,15 @@
+<script>
+    // iframe接收消息
+	window.addEventListener('message', function(e) {
+		if (e.source != window.parent) {
+            return;
+        }
+        var storeKey = 'app-state-session';
+        if (e.data) {
+            localStorage.setItem(storeKey, e.data);
+        } else {
+            localStorage.removeItem(storeKey);
+        }
+        window.parent.postMessage("success", "*");
+    });
+</script>

+ 15 - 1
frontend/saas-portal-web/yarn.lock

@@ -2901,7 +2901,7 @@ glob@7.0.5:
     once "^1.3.0"
     path-is-absolute "^1.0.0"
 
-glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2:
+glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3:
   version "7.1.3"
   resolved "http://registry.npm.taobao.org/glob/download/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
   dependencies:
@@ -6941,6 +6941,12 @@ uuid@^3.0.1, uuid@^3.3.2:
   version "3.3.2"
   resolved "http://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
 
+v-distpicker@^1.0.20:
+  version "1.0.21"
+  resolved "http://registry.npm.taobao.org/v-distpicker/download/v-distpicker-1.0.21.tgz#50356c68220586ada9131fe1160fabf0cf805294"
+  dependencies:
+    vue "^2.5.17"
+
 validate-npm-package-license@^3.0.1:
   version "3.0.4"
   resolved "http://registry.npm.taobao.org/validate-npm-package-license/download/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
@@ -7029,10 +7035,18 @@ vue-template-es2015-compiler@^1.5.3, vue-template-es2015-compiler@^1.6.0:
   version "1.6.0"
   resolved "http://registry.npm.taobao.org/vue-template-es2015-compiler/download/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18"
 
+vue@^2.5.17:
+  version "2.5.21"
+  resolved "http://registry.npm.taobao.org/vue/download/vue-2.5.21.tgz#3d33dcd03bb813912ce894a8303ab553699c4a85"
+
 vue@^2.5.2:
   version "2.5.17"
   resolved "http://registry.npm.taobao.org/vue/download/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada"
 
+vuex@^3.0.1:
+  version "3.0.1"
+  resolved "http://registry.npm.taobao.org/vuex/download/vuex-3.0.1.tgz#e761352ebe0af537d4bb755a9b9dc4be3df7efd2"
+
 w3c-hr-time@^1.0.1:
   version "1.0.1"
   resolved "http://registry.npm.taobao.org/w3c-hr-time/download/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045"

+ 1 - 0
frontend/saas-web/app/view/core/base/BasePanel.scss

@@ -39,6 +39,7 @@
     }
 }
 .x-basepanel-pagingtoolbar{
+    padding: 6px 0 5px 8px;
     border:1px solid #abdaff !important;
     border-top-width: 0 !important;
 }

+ 3 - 5
frontend/saas-web/app/view/core/base/GridPanel.js

@@ -111,7 +111,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                         text: '禁用',
                         handler: function(){
                             var form = this.ownerCt.ownerCt.ownerCt;
-                            me.onVastDeal(form._batchCloseUrl,'CLOSE');
+                            me.onVastDeal(form._batchCloseUrl,'BANNED');
                         },
                         menu: {
                             cls:'x-query-menu',
@@ -253,10 +253,8 @@ Ext.define('saas.view.core.base.GridPanel', {
         boxready: function(grid, width, height, eOpts) {
             var store = grid.getStore(),
             gridBodyBox = grid.body.dom.getBoundingClientRect(),
-            gridBodyBoxHeight = gridBodyBox.height;
-
-            var pageSize = Math.floor(gridBodyBoxHeight / 32);
-
+            gridBodyBoxHeight = gridBodyBox.height;//可能有滚动条
+            var pageSize = Math.floor(gridBodyBoxHeight / 33);
             store.setPageSize(pageSize);
         },
         itemClick: function(view,record,a,index,c) {

+ 5 - 2
frontend/saas-web/app/view/core/dbfind/types/AccountDbfindTrigger.js

@@ -15,7 +15,7 @@ Ext.define('saas.view.core.dbfind.types.AccountDbfindTrigger', {
     }],
     defaultCondition: "d.status=1",
     dbSearchFields:[{
-        emptyText:'输入账户名称或真实姓名',
+        emptyText:'输入账户名称或姓名',
         xtype : "textfield", 
         name : "search", 
         getCondition: function(v) {
@@ -34,7 +34,7 @@ Ext.define('saas.view.core.dbfind.types.AccountDbfindTrigger', {
     },{
         text: "账号名称",
         dataIndex: "username",
-        hidden:true
+        // hidden:true
     }, {
         text: "姓名",
         dataIndex: "realname",
@@ -51,6 +51,9 @@ Ext.define('saas.view.core.dbfind.types.AccountDbfindTrigger', {
         text: "岗位角色",
         dataIndex: "roleNames",
         width: 200
+    }, {
+        dataIndex: "",
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/BankInfoDbfindTrigger.js

@@ -56,5 +56,8 @@ Ext.define('saas.view.core.dbfind.types.BankInfoDbfindTrigger', {
         xtype: "datecolumn",
         dataIndex: "bk_date",
         width: 110
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/BomDbfindTrigger.js

@@ -52,6 +52,9 @@ Ext.define('saas.view.core.dbfind.types.BomDbfindTrigger', {
         text: "版本",
         width: 80,
         dataIndex: "bo_version"
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js

@@ -68,6 +68,9 @@ Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
         text: "备注",
         dataIndex: "cu_remark",
         width: 250
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/EmployeeDbfindTrigger.js

@@ -53,6 +53,9 @@ Ext.define('saas.view.core.dbfind.types.EmployeeDbfindTrigger', {
         text: "邮箱",
         dataIndex: "em_email",
         width: 180
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/OriOrderMutiDbfindTrigger.js

@@ -56,5 +56,8 @@ Ext.define('saas.view.core.dbfind.types.OriOrderMutiDbfindTrigger', {
         "dataIndex": "sl_date",
         "width": 110,
         xtype: 'datecolumn'
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/ProductAddMultiDbfindTrigger.js

@@ -100,6 +100,9 @@ Ext.define('saas.view.core.dbfind.types.ProductAddMultiDbfindTrigger', {
         dataIndex: "pr_saleprice",
         xtype: 'numbercolumn',
         hidden:true
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/ProductDbfindTrigger.js

@@ -100,5 +100,8 @@ Ext.define('saas.view.core.dbfind.types.ProductDbfindTrigger', {
         dataIndex: "po_avprice",
         xtype: 'numbercolumn',
         hidden:true
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/ProductMultiDbfindTrigger.js

@@ -107,6 +107,9 @@ Ext.define('saas.view.core.dbfind.types.ProductMultiDbfindTrigger', {
         dataIndex: "po_avprice",
         xtype: 'numbercolumn',
         hidden:true
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js

@@ -68,6 +68,9 @@ Ext.define('saas.view.core.dbfind.types.VendorDbfindTrigger', {
         text: "备注",
         dataIndex: "ve_remark",
         width: 250
+    }, {
+        dataIndex: '',
+        flex: 1
     }]
 
 });

+ 3 - 0
frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js

@@ -44,6 +44,9 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
         text: "仓库类型",
         dataIndex: "wh_type",
         width: 110
+    }, {
+        dataIndex: '',
+        flex: 1
     }],
 
     onAddClick: function() {

+ 3 - 0
frontend/saas-web/app/view/core/form/RemoteCombo.js

@@ -7,6 +7,9 @@ Ext.define('saas.view.core.form.RemoteCombo', {
     displayField: 'display',
     valueField: 'value',
     queryMode: 'local',//只在组件加载的时候请求一次
+    listConfig: {
+        maxHeight: (Ext.isIE?screen.height:window.innerHeight)*0.5-50,
+    },
     initComponent: function() {
         var me = this;
         Ext.applyIf(this,{

+ 1 - 1
frontend/saas-web/app/view/document/kind/ChildForm.js

@@ -216,7 +216,7 @@ Ext.define('saas.view.document.kind.ChildForm', {
                         grid.store.load();
                     }
                 }
-                if(relativeField&&relativeValue&&form.ownerCt._parent){
+                if(relativeField&&relativeValue&&form.ownerCt._parent&&form.ownerCt._parent.xtype!='document-kind'){
                     var grid = form.ownerCt._parent.down('grid');
                     var rec = grid.getSelectionModel().getLastSelected();
                     rec.set(relativeField,relativeValue);

+ 2 - 2
frontend/saas-web/app/view/money/report/AccountDetails.js

@@ -10,7 +10,7 @@ Ext.define('saas.view.money.report.AccountDetails', {
     // groupField: null,
     listUrl: '/api/money/report/accountdetails',
     defaultCondition: null,
-    reportTitle: '核销对账表',
+    reportTitle: '核销明细表',
     QueryWidth: 0.2,
     //筛选:客户/供应商、日期、单据类型(必填)
     searchItems: [{
@@ -26,7 +26,7 @@ Ext.define('saas.view.money.report.AccountDetails', {
         datas: [
             ["采购验收单", "采购验收单"],
             ["采购验退单", "采购验退单"],
-            ["出货单", "出货单"],
+            ["出货单", "销售出货单"],
             ["销售退货单", "销售退货单"],
             ["完工入库单", "完工入库单"],
             ["生产领料单", "生产领料单"],

+ 2 - 1
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -129,8 +129,9 @@ Ext.define('saas.view.money.report.PayDetail', {
                 var d = data[i];
                 var n = Number(d[dataIndex]);
                 var v = isNaN(n) ? 0 : n;
+                var gv = d[groupField];
 
-                lasts[groupField] = v;
+                lasts[gv] = v;
             }
 
             keys = Ext.Object.getAllKeys(lasts);

+ 2 - 1
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -137,8 +137,9 @@ Ext.define('saas.view.money.report.RecDetail', {
                 var d = data[i];
                 var n = Number(d[dataIndex]);
                 var v = isNaN(n) ? 0 : n;
+                var gv = d[groupField];
 
-                lasts[groupField] = v;
+                lasts[gv] = v;
             }
 
             keys = Ext.Object.getAllKeys(lasts);

+ 7 - 0
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -100,6 +100,13 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
+        },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join('');
+            return Ext.util.Format.number(v, format);
         }
     }, {
         text: '应收余额',

+ 6 - 6
frontend/saas-web/app/view/sys/guide/FormPanel.js

@@ -63,7 +63,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '<figure style="margin: 0 185px 0 180px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'baseSet\')">',
                         '<img class="',
                             '<tpl if="!baseSet">x-guide-mask </tpl>',
-                            '" src="resources/images/guide/baseSet.png" style="background: #d5efff;" align ="center" width="135" height="90" alt="基础设置"  >',
+                            '" src="resources/images/guide/baseSet.png" align ="center" width="135" height="90" alt="基础设置"  >',
                         '<figcaption>',
                         '公司信息、权限和账户管理',
                         '</figcaption>',
@@ -72,7 +72,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '<figure style="margin:0 185px 0 0;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'warehouse\')">',
                         '<img class="',
                         '<tpl if="!warehouse">x-guide-mask </tpl>',
-                        '"src="resources/images/guide/warehouse.png" style="background: #d5efff;" align ="center" width="135" height="90" alt="仓库资料"  >',
+                        '"src="resources/images/guide/warehouse.png" align ="center" width="135" height="90" alt="仓库资料"  >',
                         '<figcaption>',
                         '仓库信息管理',
                         '</figcaption>',
@@ -81,7 +81,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '<figure style="margin:0 185px 0 0;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'product\')">',
                         '<img class="',
                         '<tpl if="!product">x-guide-mask </tpl>',
-                        '"src="resources/images/guide/product.png" style="background: #d5efff;" align ="center" width="135" height="90" alt="物料资料"  >',
+                        '"src="resources/images/guide/product.png" align ="center" width="135" height="90" alt="物料资料"  >',
                         '<figcaption>',
                         '物料信息管理',
                         '</figcaption>',
@@ -122,7 +122,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '<figure style="margin: 40px 185px 0 182px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'customer\')">',
                         '<img class="',
                         '<tpl if="!customer">x-guide-mask </tpl>',
-                        '"src="resources/images/guide/customer.png" style="background: #ffffff;" align ="center" width="135" height="90" alt="客户资料"  >',
+                        '"src="resources/images/guide/customer.png" align ="center" width="135" height="90" alt="客户资料"  >',
                         '<figcaption>',
                         '客户信息管理',
                         '</figcaption>',
@@ -131,7 +131,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '<figure style="margin: 0px 185px 0 0px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'vendor\')">',
                         '<img class="',
                         '<tpl if="!vendor">x-guide-mask </tpl>',
-                        '"src="resources/images/guide/vendor.png" style="background: #ffffff;" align ="center" width="135" height="90" alt="供应商资料"  >',
+                        '"src="resources/images/guide/vendor.png" align ="center" width="135" height="90" alt="供应商资料"  >',
                         '<figcaption>',
                         '供应商信息管理',
                         '</figcaption>',
@@ -140,7 +140,7 @@ Ext.define('saas.view.sys.guide.FormPanel', {
                         '<figure style="margin: 0 185px 0 0px;cursor: pointer;" align="center" class="imghvr-zoom-out" onClick="showInformation(\'begin\',\'{begin}\')">',
                         '<img class="',
                         '<tpl if="!begin">x-guide-mask </tpl>',
-                        '" src="resources/images/guide/begin.png" style="background: #ffffff;" align ="center" width="135" height="90" alt="开始使用"  >',
+                        '" src="resources/images/guide/begin.png" align ="center" width="135" height="90" alt="开始使用"  >',
                         '<figcaption>',
                         '开启U企云服务',
                         '</figcaption>',

+ 25 - 9
frontend/saas-web/app/view/viewport/ViewportController.js

@@ -23,8 +23,11 @@ Ext.define('saas.view.viewport.ViewportController', {
     },
 
     mainviewboxready: function() {
-        //初始化accountPage地址
-        document.getElementsByName('accountPage')[0].setAttribute('src',getTokenPage());
+        //初始化setSessionPage地址
+        Ext.DomHelper.insertHtml('beforeEnd', document.body, 
+            '<iframe name="setSessionPage" hidden src="' + 
+            Ext.manifest.server.accountCenter + '/static/set-token.html"></iframe>');
+
         if(!Ext.isChrome && !Ext.isFirefox) {
             saas.util.BaseUtil.showConfirm('温馨提示', '为了更好地呈现页面效果,推荐使用Chrome浏览器或火狐浏览器');
         }
@@ -77,7 +80,7 @@ Ext.define('saas.view.viewport.ViewportController', {
             var hasValidCookie = Ext.util.Cookies.get('uid')?me.getAccountCookie():false;
             if(!hasValidCookie){
                 if(window.location.host.indexOf('.usoftchina.com')>-1){
-                    window.location.href = Ext.manifest.server.accountCenter
+                    me.redirectPortal();
                 }else{
                     me.redirectTo('login', {replace: true});
                 }
@@ -122,8 +125,8 @@ Ext.define('saas.view.viewport.ViewportController', {
                         me.saveSession(session);
                     }
                     hasValidCookie = true
-                }else{
-                    window.location.href = Ext.manifest.server.accountCenter
+                } else{
+                    me.redirectPortal();
                 }
             },
             failure: function(response, opts) {
@@ -202,10 +205,8 @@ Ext.define('saas.view.viewport.ViewportController', {
             me.originalRoute = Ext.History.getToken();
             me.terminateSession();
             view.unmask();
-            //跳转到账户中心
-            const frame = window.frames[window.frames.length - 1];
-            frame.postMessage('removeToken','*');
-            window.location.href = getAccountPage();
+            me.syncSessionToPortal();
+            me.redirectPortal();
             //me.redirectTo('login', {replace: true});
         });
     },
@@ -221,6 +222,7 @@ Ext.define('saas.view.viewport.ViewportController', {
                 .then(function(newSession) {
                     newSession.get('account').companyId = companyId;
                     me.initiateSession(newSession);
+                    me.syncSessionToPortal(newSession);
                 })
                 .catch(function(error) {
                     saas.util.BaseUtil.showErrorToast(error.message);
@@ -230,6 +232,20 @@ Ext.define('saas.view.viewport.ViewportController', {
                     window.location.reload();
                 }); 
         }        
+    },
+    /**
+     * 同步session到门户
+     * @param {} session 
+     */
+    syncSessionToPortal: function(session) {
+        const frame = window.frames[window.frames.length - 1];
+        frame.postMessage(session ? JSON.stringify(session) : '', '*');
+    },
+    /**
+     * 跳转门户
+     */
+    redirectPortal: function() {
+        window.location.href = Ext.manifest.server.accountCenter;
     }
 });
 

+ 1 - 1
frontend/saas-web/electron/login.html

@@ -47,7 +47,7 @@
                 var session = data.token, account = data.account;
                 account.companies = account.companies || [];
                 session.account = account;
-                ipc.send('session.change', session);
+                ipc.send('session.change', JSON.stringify(session));
             });
             var frame = document.createElement("iframe");
             frame.setAttribute("src", "https://sso.ubtob.com/sassLogin?appId=sp&baseUrl=" + 

+ 6 - 2
frontend/saas-web/electron/main.js

@@ -10,7 +10,7 @@ let mainWindow;
 ipcMain.on('session.change', (event, arg) => {
     if (arg) {
         loginWindow && loginWindow.close();
-        createMainWindow();
+        createMainWindow(arg);
     } else {
         mainWindow && mainWindow.close();
         createLoginWindow();
@@ -34,7 +34,7 @@ function createLoginWindow() {
     });
 }
 
-function createMainWindow () {
+function createMainWindow (session) {
     mainWindow = new BrowserWindow({ width: 1280, height: 720, show: false });
     mainWindow.once('ready-to-show', function(){
         mainWindow.maximize();
@@ -50,6 +50,10 @@ function createMainWindow () {
         mainWindow.webContents.openDevTools();
     }
 
+    mainWindow.webContents.on("did-finish-load", function() {
+        mainWindow.webContents.executeJavaScript('\
+            localStorage.setItem("app-state-session", decodeURIComponent("' + encodeURIComponent(session) + '"))');
+    });
     mainWindow.on('closed', function () {
         mainWindow = null;
     });

+ 2 - 11
frontend/saas-web/index.html

@@ -6,21 +6,12 @@
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">
 
     <title>云进销存 - U企云服</title>
-    <link rel="icon" href="/resources/images/favicon.png" type="image/x-icon">
+    <link rel="icon" href="./resources/images/favicon.png" type="image/x-icon">
     <!-- 图片动画效果样式导入 -->
-    <link type="text/css" rel="stylesheet" href="/resources/othcss/imagehover.css" />
+    <link type="text/css" rel="stylesheet" href="./resources/othcss/imagehover.css" />
 
     <!-- The line below must be kept intact for Sencha Cmd to build your application -->
     <script id="microloader" data-app="a20e1670-7932-41f6-8e9c-55b77cba3f26" type="text/javascript" src="bootstrap.js"></script>
-    <script>
-        function getTokenPage(){
-            return Ext.manifest.server.accountCenter + "/remove-token.html"
-        }
-        function getAccountPage(){
-            return Ext.manifest.server.accountCenter
-        }
-    </script>
 </head>
-<iframe name="accountPage" hidden></iframe>
 <body class="launching"></body>
 </html>

BIN
frontend/saas-web/resources/images/guide/background.png


BIN
frontend/saas-web/resources/images/guide/font-background.png


+ 4 - 1
frontend/saas-web/resources/othcss/imagehover.css

@@ -13,7 +13,7 @@
   display: inline-block;
   margin: 0px;
   max-width: 100%;
-  background-color: rgb(52, 186, 246);
+  /* background-color: rgb(52, 186, 246); */
   color: #fff;
   overflow: hidden;
   -webkit-backface-visibility: hidden;
@@ -754,6 +754,9 @@
   -webkit-transform: scale(1);
   transform: scale(1);
   opacity: 1;
+  background-position: center;
+  background-repeat: no-repeat;
+  background-image: url(../../../../resources/images/guide/font-background.png);
   -webkit-transition-delay: 0.3s;
   transition-delay: 0.3s;
 }

+ 7 - 0
pom.xml

@@ -43,6 +43,7 @@
         <docker.registry.name>saas</docker.registry.name>
         <guava.version>18.0</guava.version>
         <fastdfs.client.version>1.26.3</fastdfs.client.version>
+        <poi.version>3.17</poi.version>
     </properties>
 
     <repositories>
@@ -371,6 +372,12 @@
                 <artifactId>commons-compress</artifactId>
                 <version>${commons.compress.version}</version>
             </dependency>
+            <!--excel-->
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi-ooxml</artifactId>
+                <version>${poi.version}</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>