Browse Source

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

zhoudw 7 years ago
parent
commit
f0be5bb1c3
56 changed files with 1458 additions and 311 deletions
  1. 4 44
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  2. 2 0
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/FundinouttypeServiceImpl.java
  3. 4 12
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  4. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/mapper/SubledgerMapper.java
  5. 44 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VendorAdd.java
  6. 2 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  7. 4 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  8. 4 2
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  9. 11 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  10. 11 8
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  11. 2 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/VerificationServiceImpl.java
  12. 15 0
      applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml
  13. 23 0
      base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/api/AccountCacheTest.java
  14. 18 0
      base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/service/AccountServiceTest.java
  15. 1 0
      base-servers/auth/pom.xml
  16. 32 0
      base-servers/auth/sso-api/pom.xml
  17. 51 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserApi.java
  18. 8 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserSpaceApi.java
  19. 85 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoResult.java
  20. 251 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUser.java
  21. 191 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpace.java
  22. 20 0
      base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpaceList.java
  23. 18 0
      base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoTest.java
  24. 47 0
      base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoUserApiTest.java
  25. 3 0
      base-servers/auth/sso-api/src/test/resources/application.yml
  26. 7 0
      framework/core/src/main/java/com/usoftchina/saas/cache/RedisHashCache.java
  27. 55 0
      framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java
  28. 1 1
      frontend/saas-portal-web/config/index.js
  29. 1 8
      frontend/saas-portal-web/src/App.vue
  30. 8 30
      frontend/saas-portal-web/src/components/conenter/addgongsi.vue
  31. 30 42
      frontend/saas-portal-web/src/components/conenter/company.vue
  32. 1 5
      frontend/saas-portal-web/src/components/conenter/enterprise.vue
  33. 37 12
      frontend/saas-portal-web/src/components/conenter/home.vue
  34. 7 38
      frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue
  35. 1 0
      frontend/saas-portal-web/src/main.js
  36. 3 0
      frontend/saas-portal-web/static/css/gongsi.css
  37. 0 21
      frontend/saas-portal-web/static/js/mains.js
  38. 1 1
      frontend/saas-web/app/view/core/base/GridPanel.js
  39. 2 1
      frontend/saas-web/app/view/core/form/DataMultiCombo.js
  40. 1 1
      frontend/saas-web/app/view/core/query/QueryGridPanel.js
  41. 1 1
      frontend/saas-web/app/view/core/report/ReportPanelController.js
  42. 57 2
      frontend/saas-web/app/view/document/kind/ChildForm.js
  43. 10 0
      frontend/saas-web/app/view/document/kind/Kind.js
  44. 233 20
      frontend/saas-web/app/view/money/report/AccountDetails.js
  45. 27 21
      frontend/saas-web/app/view/money/report/AccountDetailsController.js
  46. 1 1
      frontend/saas-web/app/view/money/report/AccountDetailsMode.js
  47. 16 4
      frontend/saas-web/app/view/money/verification/FormPanel.js
  48. 14 3
      frontend/saas-web/app/view/money/verification/FormPanelModel.js
  49. 1 1
      frontend/saas-web/app/view/sale/report/SaleProfit.js
  50. 2 5
      frontend/saas-web/app/view/sale/report/SaleProfitController.js
  51. 6 2
      frontend/saas-web/app/view/sale/saleIn/QueryPanel.js
  52. 6 2
      frontend/saas-web/app/view/sale/saleOut/QueryPanel.js
  53. 2 3
      frontend/saas-web/app/view/stock/stockamount/DataList.js
  54. 52 2
      frontend/saas-web/app/view/sys/account/DataList.js
  55. 22 1
      frontend/saas-web/app/view/sys/account/DataListController.js
  56. 0 5
      frontend/saas-web/resources/json/navigation.json

+ 4 - 44
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java

@@ -23,6 +23,7 @@ import com.usoftchina.saas.document.service.CustomerService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.utils.BeanMapper;
+import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -266,29 +267,21 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         //插入中间表
         Double amount = (customer.getCu_beginaramount() == null ? new Double(0) : customer.getCu_beginaramount())
                 - (customer.getCu_beginprerecamount() == null ? new Double(0) : customer.getCu_beginprerecamount());
-        if (amount != new Double(0)){
             Subledger subledger = new Subledger();
             subledger.setSl_code("期初余额");
             subledger.setSl_kind("期初余额");
             subledger.setSl_vendid(0);
             subledger.setSl_custid(Math.toIntExact(customer.getId()));
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            String dates = date2String(customer.getCu_begindate(), "yyyy-MM");
-            dates = dates + "-01";
-            Date date = null;
-            try {
-                date = string2Date(dates, "yyyy-MM-dd");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            subledger.setSl_date(date);
+            subledger.setSl_date(DateUtils.getFirstDay(customer.getCu_begindate()));
+            subledger.setSl_ym(DateUtils.getYm(customer.getCu_begindate()));
             if (amount > new Double(0)){
                 subledger.setSl_amount(amount);
             }else {
                 subledger.setSl_preamount(amount);
             }
             subledger.setSl_orderamount(Math.abs(amount));
-            subledger.setSl_namount(amount);
+            subledger.setSl_namount(Math.abs(amount));
 
             Subledger subledger1 = subledgerMapper.selectByKindCodeCustid("期初余额","期初余额",
                     Math.toIntExact(customer.getId()));
@@ -297,7 +290,6 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
             }else {
                 subledgerMapper.updateByPrimaryKeySelective(subledger);
             }
-        }
 
         baseDTO = getBaseDTOById(cu_id);
         //日志记录
@@ -503,38 +495,6 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         return cu_code;
     }
 
-    /**
-     * String转Date类型
-     *
-     * @param dateStr
-     *            时间字符串
-     * @return Date类型时间
-     * @throws Exception
-     *             异常
-     */
-    public static Date string2Date(String dateStr, String format) throws Exception {
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        if (dateStr != null) {
-            return sdf.parse(dateStr);
-        }else {
-            return null;
-        }
-    }
 
-    /**
-     * Date转String
-     *
-     * @param date
-     *            Date类型时间
-     * @return 时间字符串
-     */
-    public static String date2String(Date date, String format) {
-        SimpleDateFormat sdf = new SimpleDateFormat(format);
-        if (date != null) {
-            return sdf.format(date);
-        }else {
-            return null;
-        }
-    }
 
 }

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

@@ -13,6 +13,7 @@ import com.usoftchina.saas.document.service.FundinouttypeService;
 import com.usoftchina.saas.exception.BizException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
 
 import java.util.Date;
@@ -66,6 +67,7 @@ public class FundinouttypeServiceImpl extends CommonBaseServiceImpl<Fundinouttyp
      * @param id
      * @return
      */
+    @Transactional
     @Override
     public boolean removeByPrimaryKey(Long id){
         Fundinouttype fundinouttype = getMapper().selectByPrimaryKey(id);

+ 4 - 12
applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java

@@ -26,6 +26,7 @@ import com.usoftchina.saas.document.mapper.VendorcontactMapper;
 import com.usoftchina.saas.document.service.VendorService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -220,29 +221,21 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         //插入中间表
         Double amount = (main.getVe_beginapamount() == null ? new Double(0) : main.getVe_beginapamount())
                 - (main.getVe_beginprepayamount() == null ? new Double(0) : main.getVe_beginprepayamount());
-        if (amount != new Double(0)){
             Subledger subledger = new Subledger();
             subledger.setSl_code("期初余额");
             subledger.setSl_kind("期初余额");
             subledger.setSl_vendid(Math.toIntExact(main.getId()));
             subledger.setSl_custid(0);
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
-            String dates = date2String(main.getVe_begindate(), "yyyy-MM");
-            dates = dates + "-01";
-            Date date = null;
-            try {
-                date = string2Date(dates, "yyyy-MM-dd");
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            subledger.setSl_date(date);
+            subledger.setSl_date(DateUtils.getFirstDay(main.getVe_begindate()));
+            subledger.setSl_ym(DateUtils.getYm(main.getVe_begindate()));
             if (amount > new Double(0)){
                 subledger.setSl_amount(amount);
             }else {
                 subledger.setSl_preamount(amount);
             }
             subledger.setSl_orderamount(Math.abs(amount));
-            subledger.setSl_namount(amount);
+            subledger.setSl_namount(Math.abs(amount));
 
             Subledger subledger1 = subledgerMapper.selectByKindCodeVendid("期初余额","期初余额",
                     Math.toIntExact(main.getId()));
@@ -251,7 +244,6 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
             }else {
                 subledgerMapper.updateByPrimaryKeySelective(subledger);
             }
-        }
 
         return generateMsgObj(main.getId(), code);
     }

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

@@ -2,6 +2,7 @@ package com.usoftchina.saas.money.mapper;
 
 import com.usoftchina.saas.money.po.Recbalance;
 import com.usoftchina.saas.money.po.Subledger;
+import com.usoftchina.saas.money.po.VendorAdd;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.bind.annotation.PostMapping;
 
@@ -26,4 +27,5 @@ public interface SubledgerMapper {
     int updateByPrimaryKey(Subledger record);
 
     List<Subledger> selectSubledgerBycondition(@Param("con") String con, @Param("companyId") Long companyId);
+    VendorAdd selectAdd(@Param("sl_vendid") Integer sl_vendid, @Param("sl_ym") Integer sl_ym);
 }

+ 44 - 0
applications/money/money-server/src/main/java/com/usoftchina/saas/money/po/VendorAdd.java

@@ -0,0 +1,44 @@
+package com.usoftchina.saas.money.po;
+
+/**
+ * @author heqw
+ * @date 2018/11/23 11:44
+ **/
+public class VendorAdd {
+    private Double beginamount;
+    private Double nowamount;
+    private Double nowpay;
+    private Double nowbalance;
+
+    public Double getBeginamount() {
+        return beginamount;
+    }
+
+    public void setBeginamount(Double beginamount) {
+        this.beginamount = beginamount;
+    }
+
+    public Double getNowamount() {
+        return nowamount;
+    }
+
+    public void setNowamount(Double nowamount) {
+        this.nowamount = nowamount;
+    }
+
+    public Double getNowpay() {
+        return nowpay;
+    }
+
+    public void setNowpay(Double nowpay) {
+        this.nowpay = nowpay;
+    }
+
+    public Double getNowbalance() {
+        return nowbalance;
+    }
+
+    public void setNowbalance(Double nowbalance) {
+        this.nowbalance = nowbalance;
+    }
+}

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

@@ -290,8 +290,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
             fundtransfer.setFt_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             fundtransfer.setFt_statuscode(Status.AUDITED.name());
             Fundtran fundtran = this.select(Math.toIntExact(fundtransfer.getId()));
-            this.changBankUntil(fundtran);
-            this.insert(fundtran);
+//            this.changBankUntil(fundtran);
+            this.audit(fundtran);
 //            fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
         }
     }

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

@@ -18,6 +18,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.OthreceiptsService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -172,6 +173,7 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
             subledger.setSl_custid(othreceipts.getOr_custid());
             subledger.setSl_vendid(0);
             subledger.setSl_date(othreceipts.getOr_date());
+            subledger.setSl_ym(DateUtils.getYm(othreceipts.getOr_date()));
             subledger.setSl_amount(or_amount);
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
             subledgerMapper.insertSelective(subledger);
@@ -340,8 +342,8 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
             othreceipts.setOr_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             othreceipts.setOr_statuscode(Status.AUDITED.name());
             Othte othte = this.select(Math.toIntExact(othreceipts.getId()));
-            this.changBankUntil(othte);
-            this.insert(othte);
+//            this.changBankUntil(othte);
+            this.audit(othte);
 //            othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
         }
     }

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

@@ -17,6 +17,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.OthspendingsService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -209,6 +210,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             subledger.setSl_custid(0);
             subledger.setSl_vendid(othspendings.getOs_vendid());
             subledger.setSl_date(othspendings.getOs_date());
+            subledger.setSl_ym(DateUtils.getYm(othspendings.getOs_date()));
             subledger.setSl_amount(bk_amount);
             subledger.setCompanyId(BaseContextHolder.getCompanyId());
             subledgerMapper.insertSelective(subledger);
@@ -335,8 +337,8 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
             othspendings.setOs_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             othspendings.setOs_statuscode(Status.AUDITED.name());
             Othsp othsp = this.select(Math.toIntExact(othspendings.getId()));
-            this.changBankUntil(othsp);
-            this.insert(othsp);
+//            this.changBankUntil(othsp);
+            this.audit(othsp);
 //            othspendingsMapper.updateByPrimaryKeySelective(othspendings);
         }
     }

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

@@ -18,6 +18,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.PaybalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -445,14 +446,15 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
             paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             paybalance.setPb_statuscode(Status.AUDITED.name());
             Pay pay = this.select(Math.toIntExact(paybalance.getId()));
-            Subledger subledger = this.changSubledgerUntil(pay.getMain());
-            if (subledger.getSl_code() == null){
-                subledgerMapper.insertSelective(subledger);
-            }else {
-                subledgerMapper.updateByPrimaryKeySelective(subledger);
-            }
-            this.changBankUntil(pay);
-            paybalanceMapper.updateByPrimaryKeySelective(paybalance);
+            this.audit(pay);
+//            Subledger subledger = this.changSubledgerUntil(pay.getMain());
+//            if (subledger.getSl_code() == null){
+//                subledgerMapper.insertSelective(subledger);
+//            }else {
+//                subledgerMapper.updateByPrimaryKeySelective(subledger);
+//            }
+//            this.changBankUntil(pay);
+//            paybalanceMapper.updateByPrimaryKeySelective(paybalance);
         }
     }
 
@@ -516,6 +518,7 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
 //        subledger.setSl_vendid(paybalance.getPb_vendid());
         subledger.setSl_vendid(1);
         subledger.setSl_date(paybalance.getPb_date());
+        subledger.setSl_ym(DateUtils.getYm(paybalance.getPb_date()));
         if (paybalance.getPb_pdamount() == null){
             subledger.setSl_amount((double) 0);
         }else {

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

@@ -18,6 +18,7 @@ import com.usoftchina.saas.money.mapper.*;
 import com.usoftchina.saas.money.po.*;
 import com.usoftchina.saas.money.service.RecbalanceService;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -450,14 +451,15 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
             recbalance.setRb_status(com.usoftchina.saas.commons.po.Status.AUDITED.getDisplay());
             recbalance.setRb_statuscode(Status.AUDITED.name());
             Rec rec = this.select(Math.toIntExact(recbalance.getId()));
-            Subledger subledger = this.changSubledgerUntil(rec.getMain());
-            if (subledger.getSl_code() == null){
-                subledgerMapper.insertSelective(subledger);
-            }else {
-                subledgerMapper.updateByPrimaryKeySelective(subledger);
-            }
-            this.changBankUntil(rec);
-            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
+            this.audit(rec);
+//            Subledger subledger = this.changSubledgerUntil(rec.getMain());
+//            if (subledger.getSl_code() == null){
+//                subledgerMapper.insertSelective(subledger);
+//            }else {
+//                subledgerMapper.updateByPrimaryKeySelective(subledger);
+//            }
+//            this.changBankUntil(rec);
+//            recbalanceMapper.updateByPrimaryKeySelective(recbalance);
         }
     }
 
@@ -518,6 +520,7 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         subledger.setSl_custid(recbalance.getRb_custid());
         subledger.setSl_vendid(0);
         subledger.setSl_date(recbalance.getRb_date());
+        subledger.setSl_ym(DateUtils.getYm(recbalance.getRb_date()));
         if (recbalance.getRb_rdamount() == null){
             subledger.setSl_amount((double) 0);
         }else {

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

@@ -695,6 +695,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      */
     private void updateResAuditCustomer(VerificationDTO verificationDTO){
         String kind = verificationDTO.getVc_kind();
+        kind = transferKind(kind);
         if(kind.equals("receipts_offset_receivable")){
             Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(verificationDTO.getVc_custid());
             Double preamount = customerData.getCu_preamount()==null?new Double(0):customerData.getCu_preamount();
@@ -780,6 +781,7 @@ public class VerificationServiceImpl extends CommonBaseServiceImpl<VerificationM
      */
     private void updateResAuditVendor(VerificationDTO verificationDTO){
         String kind = verificationDTO.getVc_kind();
+        kind = transferKind(kind);
         if(kind.equals("prepaid_offset_payable")){
             Vendor vendorData = paybalanceMapper.selectVendorByPrimaryKey(verificationDTO.getVc_vendid());
             Double preamount = vendorData.getVe_preamount()==null?new Double(0):vendorData.getVe_preamount();

+ 15 - 0
applications/money/money-server/src/main/resources/mapper/SubledgerMapper.xml

@@ -20,6 +20,12 @@
     <result column="sl_discount" property="sl_discount" jdbcType="DOUBLE" />
     <result column="sl_ym" property="sl_ym" jdbcType="INTEGER" />
   </resultMap>
+
+  <resultMap id="BaseAddMap" type="com.usoftchina.saas.money.po.VendorAdd" >
+    <result column="beginamount" property="beginamount" jdbcType="DOUBLE" />
+    <result column="nowamount" property="nowamount" jdbcType="DOUBLE" />
+    <result column="nowpay" property="beginamount" jdbcType="DOUBLE" />
+  </resultMap>
   <sql id="Base_Column_List" >
     sl_id, sl_code, sl_kind, sl_custid, sl_vendid, sl_date, sl_amount, sl_preamount, 
     sl_yamount, sl_namount, sl_remark, companyId, updaterId, updateTime, sl_orderamount, 
@@ -247,4 +253,13 @@
         where sl_code = #{sl_code,jdbcType=VARCHAR}
     </select>
 
+  <select id="selectAdd" resultMap="BaseAddMap">
+    select a.sl_orderamount as beginamount, b.sl_orderamount as nowamount, c.sl_orderamount as nowpay FROM
+(select sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '期初余额') a
+left join (select sum(sl_orderamount) sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '采购验收单' or sl_kind = '采购验退单'
+group by sl_vendid,sl_ym) b on a.sl_vendid=b.sl_vendid
+left join (select sum(sl_orderamount) sl_orderamount,sl_vendid,sl_ym from subledger where sl_kind = '付款单' or sl_kind = '其他支出单'
+group by sl_vendid,sl_ym) c on a.sl_vendid=c.sl_vendid
+ where a.sl_vendid=#{sl_vendid,jdbcType=INTEGER} and a.sl_ym=#{sl_ym, jdbcType=INTEGER}
+  </select>
 </mapper>

+ 23 - 0
base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/api/AccountCacheTest.java

@@ -0,0 +1,23 @@
+package com.usoftchina.saas.account.api;
+
+import com.usoftchina.saas.account.cache.AccountCache;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest
+public class AccountCacheTest {
+
+    @Test
+    public void hdel() {
+        AccountCache.of(43).hdel();
+        System.out.println(AccountCache.of(43).exists());
+    }
+}

+ 18 - 0
base-servers/account/account-server/src/test/java/com/usoftchina/saas/account/service/AccountServiceTest.java

@@ -1,13 +1,19 @@
 package com.usoftchina.saas.account.service;
 
+import com.usoftchina.saas.account.cache.AccountCache;
 import com.usoftchina.saas.account.constant.AccountType;
+import com.usoftchina.saas.account.dto.AccountDTO;
 import com.usoftchina.saas.account.po.Account;
+import com.usoftchina.saas.utils.CollectionUtils;
 import org.junit.*;
 import org.junit.runner.RunWith;
 import org.junit.runners.MethodSorters;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+import java.util.Set;
 //import org.springframework.transaction.annotation.Transactional;
 
 @RunWith(SpringRunner.class)
@@ -54,4 +60,16 @@ public class AccountServiceTest {
         Assert.assertTrue(removed);
     }
 
+    @Test
+    public void testD_clearAccountCacheByRoleId() {
+        long roleId = 25;
+        List<Account> accounts = accountService.findByRoleId(roleId);
+        if (!CollectionUtils.isEmpty(accounts)) {
+            accounts.forEach(account -> accountService.clearCache(account.getId()));
+        }
+        AccountCache.current().keys().forEach(System.out::println);
+
+        AccountCache.of(43).getAccount();
+    }
+
 }

+ 1 - 0
base-servers/auth/pom.xml

@@ -18,6 +18,7 @@
         <module>auth-server</module>
         <module>auth-client</module>
         <module>auth-common</module>
+        <module>sso-api</module>
     </modules>
 
 </project>

+ 32 - 0
base-servers/auth/sso-api/pom.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>auth</artifactId>
+        <groupId>com.usoftchina.saas</groupId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>sso-api</artifactId>
+    <description>account center api</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.saas</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
+        <!-- test -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

+ 51 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserApi.java

@@ -0,0 +1,51 @@
+package com.usoftchina.sso.api;
+
+import com.usoftchina.sso.dto.SsoResult;
+import com.usoftchina.sso.dto.SsoUser;
+import com.usoftchina.sso.dto.SsoUserSpaceList;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@FeignClient(url = "${sso.base-url}", name = "sso-server", fallback = SsoUserApi.DefaultFallback.class)
+@RequestMapping("/api/user")
+public interface SsoUserApi {
+
+    /**
+     * 手机号查找用户
+     *
+     * @param userUU
+     * @return
+     */
+    @GetMapping("/info")
+    SsoResult<SsoUser> getUserByUu(@RequestParam("userUU") Long userUU);
+
+    /**
+     * 手机号查找绑定企业
+     *
+     * @param mobile
+     * @return
+     */
+    @GetMapping("/getSpace")
+    @Deprecated
+    SsoUserSpaceList getUserSpacesByMobile(@RequestParam("mobile") String mobile);
+
+    @Component
+    class DefaultFallback implements SsoUserApi{
+        @Override
+        public SsoResult<SsoUser> getUserByUu(Long userUU) {
+            return SsoResult.fallback();
+        }
+
+        @Override
+        public SsoUserSpaceList getUserSpacesByMobile(String mobile) {
+            return null;
+        }
+    }
+}

+ 8 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/api/SsoUserSpaceApi.java

@@ -0,0 +1,8 @@
+package com.usoftchina.sso.api;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+public interface SsoUserSpaceApi {
+}

+ 85 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoResult.java

@@ -0,0 +1,85 @@
+package com.usoftchina.sso.dto;
+
+import com.usoftchina.saas.exception.ExceptionCode;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+public class SsoResult<T> {
+    private boolean success;
+
+    private boolean error;
+
+    private String errCode;
+
+    private String errMsg;
+
+    private String errDetail;
+
+    private T content;
+
+    public SsoResult() {
+    }
+
+    /**
+     * 异常返回
+     *
+     * @return
+     */
+    public static SsoResult fallback() {
+        SsoResult result = new SsoResult();
+        result.setError(true);
+        result.setErrCode(String.valueOf(ExceptionCode.SYSTEM_BUSY.getCode()));
+        result.setErrMsg(ExceptionCode.SYSTEM_BUSY.getMessage());
+        return result;
+    }
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public boolean isError() {
+        return error;
+    }
+
+    public void setError(boolean error) {
+        this.error = error;
+    }
+
+    public String getErrMsg() {
+        return errMsg;
+    }
+
+    public void setErrMsg(String errMsg) {
+        this.errMsg = errMsg;
+    }
+
+    public String getErrCode() {
+        return errCode;
+    }
+
+    public void setErrCode(String errCode) {
+        this.errCode = errCode;
+    }
+
+    public String getErrDetail() {
+        return errDetail;
+    }
+
+    public void setErrDetail(String errDetail) {
+        this.errDetail = errDetail;
+    }
+
+    public T getContent() {
+        return content;
+    }
+
+    public void setContent(T content) {
+        this.content = content;
+    }
+}

+ 251 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUser.java

@@ -0,0 +1,251 @@
+package com.usoftchina.sso.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SsoUser implements Serializable{
+    /**
+     *
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * uu号
+     */
+    private Long userUU;
+
+    /**
+     * 会员名
+     */
+    private String vipName;
+
+    /**
+     * 手机号
+     */
+    private String mobile;
+
+    /**
+     * 手机号所属区域(continent or Hongkong)
+     */
+    private String mobileArea;
+
+    /**
+     * 手机号认证状态
+     */
+    private Short mobileValidCode;
+
+    /**
+     * 用户密码
+     */
+    private String password;
+
+    /**
+     * 用户erp密码
+     */
+    private String erpPassword;
+
+    /**
+     * 盐值
+     */
+    private String salt;
+
+    /**
+     * 用户邮箱
+     */
+    private String email;
+
+    /**
+     * 用户邮箱认证状态
+     */
+    private Short emailValidCode;
+
+    /**
+     * 身份认证状态
+     */
+    private Short identityValidCode;
+
+    /**
+     * 账户是否冻结(1、冻结)
+     */
+    private Short lock;
+
+    /**
+     * 企业uu号
+     */
+    private Long spaceUU;
+
+    /**
+     * 企业名称
+     */
+    private String spaceName;
+
+    /**
+     * 营业执照号
+     */
+    private String businessCode;
+
+    /**
+     * 企业域名
+     */
+    private String spaceDomain;
+
+    /**
+     * 应用唯一标志
+     */
+    private String appId;
+
+    /**
+     * 上次登录时间
+     */
+    private Long lastLoginTime;
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public String getVipName() {
+        return vipName;
+    }
+
+    public void setVipName(String vipName) {
+        this.vipName = vipName;
+    }
+
+    public String getMobile() {
+        return mobile;
+    }
+
+    public void setMobile(String mobile) {
+        this.mobile = mobile;
+    }
+
+    public String getMobileArea() {
+        return mobileArea;
+    }
+
+    public void setMobileArea(String mobileArea) {
+        this.mobileArea = mobileArea;
+    }
+
+    public Short getMobileValidCode() {
+        return mobileValidCode;
+    }
+
+    public void setMobileValidCode(Short mobileValidCode) {
+        this.mobileValidCode = mobileValidCode;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getErpPassword() {
+        return erpPassword;
+    }
+
+    public void setErpPassword(String erpPassword) {
+        this.erpPassword = erpPassword;
+    }
+
+    public String getSalt() {
+        return salt;
+    }
+
+    public void setSalt(String salt) {
+        this.salt = salt;
+    }
+
+    public String getEmail() {
+        return email;
+    }
+
+    public void setEmail(String email) {
+        this.email = email;
+    }
+
+    public Short getEmailValidCode() {
+        return emailValidCode;
+    }
+
+    public void setEmailValidCode(Short emailValidCode) {
+        this.emailValidCode = emailValidCode;
+    }
+
+    public Short getIdentityValidCode() {
+        return identityValidCode;
+    }
+
+    public void setIdentityValidCode(Short identityValidCode) {
+        this.identityValidCode = identityValidCode;
+    }
+
+    public Short getLock() {
+        return lock;
+    }
+
+    public void setLock(Short lock) {
+        this.lock = lock;
+    }
+
+    public Long getSpaceUU() {
+        return spaceUU;
+    }
+
+    public void setSpaceUU(Long spaceUU) {
+        this.spaceUU = spaceUU;
+    }
+
+    public String getSpaceName() {
+        return spaceName;
+    }
+
+    public void setSpaceName(String spaceName) {
+        this.spaceName = spaceName;
+    }
+
+    public String getBusinessCode() {
+        return businessCode;
+    }
+
+    public void setBusinessCode(String businessCode) {
+        this.businessCode = businessCode;
+    }
+
+    public String getSpaceDomain() {
+        return spaceDomain;
+    }
+
+    public void setSpaceDomain(String spaceDomain) {
+        this.spaceDomain = spaceDomain;
+    }
+
+    public String getAppId() {
+        return appId;
+    }
+
+    public void setAppId(String appId) {
+        this.appId = appId;
+    }
+
+    public Long getLastLoginTime() {
+        return lastLoginTime;
+    }
+
+    public void setLastLoginTime(Long lastLoginTime) {
+        this.lastLoginTime = lastLoginTime;
+    }
+}

+ 191 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpace.java

@@ -0,0 +1,191 @@
+package com.usoftchina.sso.dto;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import java.io.Serializable;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class SsoUserSpace implements Serializable{
+    /**
+     * 企业uu号
+     */
+    private Long spaceUU;
+
+    /**
+     * 企业名称
+     */
+    private String spaceName;
+
+    /**
+     * 法定代表人
+     */
+    private String corporation;
+
+    /**
+     * 注册日期
+     */
+    private Long registerDate;
+
+    /**
+     * 管理员
+     */
+    private SsoUser admin;
+
+    /**
+     * 营业执照号
+     */
+    private String businessCode;
+
+    /**
+     * 营业执照
+     */
+    private String businessCodeImage;
+
+    /**
+     * 注册地址
+     */
+    private String regAddress;
+
+    /**
+     * 企业信息认证状态
+     */
+    private Short validCode;
+
+    /**
+     * logo图片
+     */
+    private String logoImage;
+
+    /**
+     * 企业联系电话
+     */
+    private String telephone;
+
+    /**
+     * 行业
+     */
+    private String profession;
+
+    /**
+     * 经营范围标签,逗号分隔
+     */
+    private String tags;
+
+    private String accessSecret;
+
+    public Long getSpaceUU() {
+        return spaceUU;
+    }
+
+    public void setSpaceUU(Long spaceUU) {
+        this.spaceUU = spaceUU;
+    }
+
+    public String getSpaceName() {
+        return spaceName;
+    }
+
+    public void setSpaceName(String spaceName) {
+        this.spaceName = spaceName;
+    }
+
+    public String getCorporation() {
+        return corporation;
+    }
+
+    public void setCorporation(String corporation) {
+        this.corporation = corporation;
+    }
+
+    public Long getRegisterDate() {
+        return registerDate;
+    }
+
+    public void setRegisterDate(Long registerDate) {
+        this.registerDate = registerDate;
+    }
+
+    public SsoUser getAdmin() {
+        return admin;
+    }
+
+    public void setAdmin(SsoUser admin) {
+        this.admin = admin;
+    }
+
+    public String getBusinessCode() {
+        return businessCode;
+    }
+
+    public void setBusinessCode(String businessCode) {
+        this.businessCode = businessCode;
+    }
+
+    public String getBusinessCodeImage() {
+        return businessCodeImage;
+    }
+
+    public void setBusinessCodeImage(String businessCodeImage) {
+        this.businessCodeImage = businessCodeImage;
+    }
+
+    public String getRegAddress() {
+        return regAddress;
+    }
+
+    public void setRegAddress(String regAddress) {
+        this.regAddress = regAddress;
+    }
+
+    public Short getValidCode() {
+        return validCode;
+    }
+
+    public void setValidCode(Short validCode) {
+        this.validCode = validCode;
+    }
+
+    public String getLogoImage() {
+        return logoImage;
+    }
+
+    public void setLogoImage(String logoImage) {
+        this.logoImage = logoImage;
+    }
+
+    public String getTelephone() {
+        return telephone;
+    }
+
+    public void setTelephone(String telephone) {
+        this.telephone = telephone;
+    }
+
+    public String getProfession() {
+        return profession;
+    }
+
+    public void setProfession(String profession) {
+        this.profession = profession;
+    }
+
+    public String getTags() {
+        return tags;
+    }
+
+    public void setTags(String tags) {
+        this.tags = tags;
+    }
+
+    public String getAccessSecret() {
+        return accessSecret;
+    }
+
+    public void setAccessSecret(String accessSecret) {
+        this.accessSecret = accessSecret;
+    }
+}

+ 20 - 0
base-servers/auth/sso-api/src/main/java/com/usoftchina/sso/dto/SsoUserSpaceList.java

@@ -0,0 +1,20 @@
+package com.usoftchina.sso.dto;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+public class SsoUserSpaceList implements Serializable{
+    private List<SsoUserSpace> spaces;
+
+    public List<SsoUserSpace> getSpaces() {
+        return spaces;
+    }
+
+    public void setSpaces(List<SsoUserSpace> spaces) {
+        this.spaces = spaces;
+    }
+}

+ 18 - 0
base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoTest.java

@@ -0,0 +1,18 @@
+package com.usoftchina.sso.test;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@SpringBootApplication(scanBasePackages = "com.usoftchina")
+@EnableFeignClients("com.usoftchina.sso")
+public class SsoTest {
+
+    public static void main(String[] args) {
+        SpringApplication.run(SsoTest.class, args);
+    }
+}

+ 47 - 0
base-servers/auth/sso-api/src/test/java/com/usoftchina/sso/test/SsoUserApiTest.java

@@ -0,0 +1,47 @@
+package com.usoftchina.sso.test;
+
+import com.usoftchina.saas.utils.CollectionUtils;
+import com.usoftchina.sso.api.SsoUserApi;
+import com.usoftchina.sso.dto.SsoResult;
+import com.usoftchina.sso.dto.SsoUser;
+import com.usoftchina.sso.dto.SsoUserSpaceList;
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.MethodSorters;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+/**
+ * @author yingp
+ * @date 2018/11/23
+ */
+@RunWith(SpringRunner.class)
+@SpringBootTest
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class SsoUserApiTest {
+
+    @Autowired
+    private SsoUserApi ssoUserApi;
+
+    final static long userUU = 200040149;
+
+    final static String mobile = "13798490565";
+
+    @Test
+    public void testA_getUserByUu() {
+        SsoResult<SsoUser> result = ssoUserApi.getUserByUu(userUU);
+        if (result.isSuccess()) {
+            System.out.println(result.getContent().getVipName());
+        }
+    }
+
+    @Test
+    public void testB_getUserSpacesByMobile() {
+        SsoUserSpaceList list = ssoUserApi.getUserSpacesByMobile(mobile);
+        if (null != list && !CollectionUtils.isEmpty(list.getSpaces())) {
+            list.getSpaces().forEach(space -> System.out.println(space.getSpaceName()));
+        }
+    }
+}

+ 3 - 0
base-servers/auth/sso-api/src/test/resources/application.yml

@@ -0,0 +1,3 @@
+sso:
+  base-url: http://192.168.253.12:32323
+#  base-url: https://sso.ubtob.com

+ 7 - 0
framework/core/src/main/java/com/usoftchina/saas/cache/RedisHashCache.java

@@ -4,6 +4,7 @@ import org.springframework.data.redis.core.BoundHashOperations;
 import org.springframework.data.redis.core.RedisTemplate;
 
 import java.util.Optional;
+import java.util.Set;
 import java.util.function.Supplier;
 
 /**
@@ -27,6 +28,10 @@ public abstract class RedisHashCache<K, F, V> extends BaseRedisCache<K, V> {
         return super.getRedisTemplate().boundHashOps(key());
     }
 
+    public Set<F> keys() {
+        return this.getBoundHashOperations().keys();
+    }
+
     /**
      * 获取
      *
@@ -89,4 +94,6 @@ public abstract class RedisHashCache<K, F, V> extends BaseRedisCache<K, V> {
     public void hdel() {
         this.getBoundHashOperations().delete(this.field());
     }
+
+
 }

+ 55 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/DateUtils.java

@@ -493,4 +493,59 @@ public class DateUtils {
         return true;
     }
 
+    /**
+     * String转Date类型
+     *
+     * @param dateStr
+     *            时间字符串
+     * @return Date类型时间
+     * @throws Exception
+     *             异常
+     */
+    public static Date string2Date(String dateStr, String format) throws Exception {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        if (dateStr != null) {
+            return sdf.parse(dateStr);
+        }else {
+            return null;
+        }
+    }
+
+    /**
+     * Date转String
+     *
+     * @param date
+     *            Date类型时间
+     * @return 时间字符串
+     */
+    public static String date2String(Date date, String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        if (date != null) {
+            return sdf.format(date);
+        }else {
+            return null;
+        }
+    }
+
+    //取月份第一天
+    public static Date getFirstDay(Date date){
+        String dates = date2String(date, "yyyy-MM");
+        dates = dates + "-01";
+        Date d = null;
+        try {
+            d = string2Date(dates, "yyyy-MM-dd");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return d;
+    }
+
+    //获取期间
+    public static int getYm(Date date){
+        String dates = date2String(date, "yyyyMM");
+//        dates = dates + "01";
+        int d = Integer.parseInt(dates);
+        return d;
+    }
+
 }

+ 1 - 1
frontend/saas-portal-web/config/index.js

@@ -14,7 +14,7 @@ module.exports = {
 
     // Various Dev Server settings
     // host: 'localhost', // can be overwritten by process.env.HOST
-    host: '127.0.0.1', // can be overwritten by process.env.HOST
+    host: '192.168.253.183', // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 1 - 8
frontend/saas-portal-web/src/App.vue

@@ -18,12 +18,5 @@ export default {
 </script>
 
 <style>
-/* #app {
-  font-family: 'Avenir', Helvetica, Arial, sans-serif;
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-  text-align: center;
-  color: #2c3e50;
-  margin-top: 60px;
-} */
+
 </style>

+ 8 - 30
frontend/saas-portal-web/src/components/conenter/addgongsi.vue

@@ -36,17 +36,6 @@
                                 <input ref="address" class="qy-xiangxi" type="text" placeholder="输入企业详细地址">
                             </div>
                         </li>
-                        <!-- <li>
-                            <span class="qy-biaoti">公司标签</span>
-                            <div class="addbiaoqian">
-                                <span v-if= "tjbiaoqian" class="tj-biaoqian">暂无标签</span>
-                                <span v-else v-for="(b , i) in biaoqian" :key="i" class="qy-biaoqian tj-bqleft">{{b}}</span>
-                            </div>
-                            <div class="tj-gsbiaoqian">
-                                <input type="text" ref="biaoqian" name="" id="biaoqian" placeholder="请输入小于等于10个字符">
-                                <span @click= "addbiaoqian" class="dianji">添加标签</span>
-                            </div>
-                        </li> -->
                     </ul>
                 </div>
             </div>
@@ -64,7 +53,7 @@
                         <li><span class="qy-biaoti">手机号</span><span>{{mytoken.account.mobile}}</span></li>
                         <li>
                             <span class="qy-biaoti">邮箱</span>
-                            <input ref="email" type="email">
+                            <input @input="email" ref="email" type="email">
                         </li>
                     </ul>
                 </div>
@@ -78,8 +67,6 @@ import VDistpicker from 'v-distpicker'
     export default {
         data(){
             return {
-                tjbiaoqian:true,//标签切换
-                biaoqian:[],//标签数组
                 province:'',//省
                 city:'',//市
                 area:'',//区
@@ -91,13 +78,7 @@ import VDistpicker from 'v-distpicker'
             VDistpicker
         },
         mounted(){
-            this.$ajax.get('../../../static/data.json')
-            .then(res=>{
-                // console.log('请求成功',res.data);
-            })
-            .catch(err=>{
-                // console.log('请求失败',err);
-            });
+
         },
         methods: {
             //取消添加企业
@@ -133,6 +114,11 @@ import VDistpicker from 'v-distpicker'
                     this.$refs.usname.innerHTML = ''
                 }
             },
+            
+            email(){
+                let email = this.$refs.email.value;//邮箱
+
+            },
             //保存
             Preservation(){
                 let qyname = this.$refs.qyname.value;//公司名字
@@ -140,7 +126,6 @@ import VDistpicker from 'v-distpicker'
                 let address = this.province+this.city+this.area+this.$refs.address.value;//公司详细地址
                 let name = this.$refs.name.value;//个人姓名
                 let email = this.$refs.email.value;//邮箱
-                // let mobile = this.$store.state.data.mobile;//手机号
                 let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
                 let token = String(mytoken.token);
                 let uu = mytoken.account.uu;
@@ -149,7 +134,7 @@ import VDistpicker from 'v-distpicker'
                 let account = {'realname':name,'email':email,'mobile':mobile, 'uu':uu}
                 if (name != '' && qyname != '') {
                     this.$ajax({
-                        url:"http://192.168.253.31:8560/api/account/accountCenter/companyAccount/save",
+                        url: this.$url.api+"/api/account/accountCenter/companyAccount/save",
                         method: 'post',
                         data: {
                             companyRegDTO:company,
@@ -189,13 +174,6 @@ import VDistpicker from 'v-distpicker'
             qyarea(qu){
                 this.area = qu.value;
             },
-            //添加标签
-            addbiaoqian(){
-                let text = this.$refs.biaoqian.value;
-                this.biaoqian.push(text);
-                this.tjbiaoqian = false;
-                this.$refs.biaoqian.value = '';
-            },
         }
     }
 </script>

+ 30 - 42
frontend/saas-portal-web/src/components/conenter/company.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+    <iframe hidden :src="setTokenPage"></iframe>
     <!-- 遮罩 -->
     <div class="zhezhao"></div>
     <!-- 设置默认弹窗 -->
@@ -8,7 +9,7 @@
       <div v-if="moren">
         <div class="tc-text tc-queren"><span>是否确认设为默认企业?</span></div>
         <div class="tc-anniu">
-          <button @click="addmoren">确认</button>
+          <button @click="setDefault">确认</button>
           <button @click="guanbitc">取消</button>
         </div>
       </div>
@@ -23,13 +24,13 @@
       <div v-if="ktsass">
         <div class="tc-text tc-queren"><span>是否确认开通saas服务?</span></div>
         <div class="tc-anniu">
-          <button @click="addsass">确认</button>
+          <button @click="confirmSaas">确认</button>
           <button @click="guanbitc">取消</button>
         </div>
       </div>
       <div v-else>
         <div class="tc-text tc-conent"><span>开通成功</span></div>
-        <div style="margin-top: 40px;"><span @click="offfuwu" class="gs-btn1 dianji">进入服务</span></div>
+        <div style="margin-top: 40px;"><span @click="showServeWin" class="gs-btn1 dianji">进入服务</span></div>
       </div>
     </div>
     <!-- 该企业已开通服务弹窗 -->
@@ -59,7 +60,7 @@
         <div class="gs-qiyebox">
             <!-- 点击查看企业详情 -->
             <div v-for="(d , i) in arr " :key="i" class="gs-xiangqing xs">
-                <div class="left gs-xqleft" @click= "chakanxq">
+                <div class="left gs-xqleft" @click= "getEnterpriseInfo(d)">
                     <div class="gs-lefttext">
                         <p class="gs-qynema"><span>企业名称:</span>{{d.address}}</p>
                         <p><span>管理员:</span>{{d.name}}</p>
@@ -68,37 +69,30 @@
                 </div>
                 <div class="right gs-xqright">
                     <div class="gs-border">
-                        <span v-if= "d.saas_" class="gs-btn1 dianji" @click="jinru(d.id)">进入服务</span>
-                        <span v-else @click= "kaitong" class="gs-btn1 kaitong xs">开通服务</span>
+                        <span v-if= "d.saas_" class="gs-btn1 dianji" @click="selectServe(d.id)">进入服务</span>
+                        <span v-else @click= "showOpenServeWin" class="gs-btn1 kaitong xs">开通服务</span>
                     </div>
                     <div>
                         <span v-if = "d.default_" class="gs-btn2 gs-btn3">默认企业</span>
-                        <span v-else @click="szmoren(i)" class="gs-btn2 xs">设为默认</span>
+                        <span v-else @click="showDefaultWin(i)" class="gs-btn2 xs">设为默认</span>
                         
                     </div>
                 </div>
             </div>
             <div class="gs-xiangqing dotted">
                 <p class="gs-tianja">
-                    <span @click= "tianjia"><router-link to="/addenterprise">+添加企业</router-link></span>
+                    <span @click= "addEnterprise"><router-link to="/addenterprise">+添加企业</router-link></span>
                 </p>
             </div>
         </div>
       </div>
-      <!-- <div class="gs-xiangqing dotted">
-        <p class="gs-tianja">
-          <span @click="tianjia"><router-link to="/addenterprise">+添加企业</router-link></span>
-        </p>
-      </div> -->
-    <!-- </div>
-  </div> -->
 </template>
 
 <script>
+ import Session from '@/utils/session'
     export default {
         data(){
             return {
-                biaoqian: [],//标签数组
                 index:0,
                 ktsass: true,//开通sass
                 moren: true,//开通默认
@@ -107,15 +101,20 @@
                 arr: []//企业列表信息
             }
         },
+        computed :{
+            setTokenPage() {
+                return this.$url.web + '/set-token.html'
+            }
+        },
         mounted(){
             this.boxheight();
             // console.log("我是子路由的"+this.comdata)
-            this.addqy();
             let mytoken = JSON.parse(localStorage.getItem('app-state-session'));
             let token = String(mytoken.token);
             // console.log(mytoken.account)
+            console.log(this.$url.api)
             this.$ajax({
-                    url:"http://192.168.253.31:8560/api/account/accountCenter/company/list",
+                    url: "/api/account/accountCenter/company/list",
                     method: 'get',
                     params: {
                         mobile: mytoken.account.mobile
@@ -135,17 +134,17 @@
         },
         methods: {
             //设置默认弹窗
-            szmoren(i){
+            showDefaultWin(i){
                 this.index = i;
                 $(".szmoren").css("display","block");
                 $(".zhezhao").css("display","block");
             },
             //确认默认
-            addmoren(){
+            setDefault(){
                 let i = this.index;
                 let token = this.mytoken.token;
                 this.$ajax({
-                    url:'http://192.168.253.31:8560/api/account/accountCenter/bind/defaultCompany',
+                    url: '/api/account/accountCenter/bind/defaultCompany',
                     method: 'post',
                     data:{
                         companyId: this.arr[i].id,
@@ -166,14 +165,14 @@
                 
             },
             //进入服务
-            jinru(id){
+            selectServe(id){
                 let token = this.mytoken.token;
                 const frame = window.frames[window.frames.length - 1];
                 this.$ajax({
-                    url: 'http://192.168.253.31:8560/api/auth/switch/company?companyId='+id,
+                    url: '/api/auth/switch/company?companyId='+id,//http://192.168.253.31:8560
                     method :'get',
                     headers: {
-                        "Authorization":token,
+                        "Authorization":token
                     }
                 })
                 .then(res=>{
@@ -182,11 +181,8 @@
                     session.account.companyId=id;
                     session.span = session.timestamp - new Date().getTime();
                     session.token=mytoken;
-                    debugger
-                    localStorage.setItem('app-state-session',JSON.stringify(session));
                     frame.postMessage(JSON.stringify(session), '*');
-                    // window.location.href = 'http://192.168.0.181';
-                    // console.log('请求成功',res)
+                    window.location.href = me.$url.web
                 })
                 .catch(err=>{
                     console.log('请求失败',err)
@@ -194,36 +190,28 @@
             
             },
             //开通sass
-            kaitong(){
+            showOpenServeWin(){
                 $(".ktsass").css('display','block');
                 $(".zhezhao").css("display","block");
                 this.ktsass = true;
             },
-            addsass(){//确认sass
+            confirmSaas(){//确认sass
                 this.ktsass = false;
             },
             //进入服务
-            offfuwu(){
+            showServeWin(){
                 $(".ktsass").css('display','none');
                 $(".zhezhao").css("display","none");
             },
             //查看企业详情
-            chakanxq(){
+            getEnterpriseInfo(d){
                 document.documentElement.scrollTop = 0;
-                this.$router.push({name:'details',});
+                this.$router.push({path:'/details',query:{content:d}});
             },
              //添加企业
-            tianjia(){
+            addEnterprise(){
                 document.documentElement.scrollTop = 0;
             },
-            addqy(){
-
-            },
-             //添加企业标签
-            addbiaoqian(){
-                this.biaoqian.push(this.$refs.biaoqian.value)
-                this.tjbiaoqian = false;
-            },
             //关闭弹窗
             guanbitc(){
                 $(".tanchuang").css("display","none");

+ 1 - 5
frontend/saas-portal-web/src/components/conenter/enterprise.vue

@@ -17,15 +17,11 @@
             </div>
             <div class="collapse navbar-collapse navbar-right" role="navigation">
                 <ul id="nav" class="nav navbar-nav menu">
-                    <!-- <li><a href="#"><span>首页</span></a></li> -->
                     <li><router-link to="/home"><a href="#"><span>首页</span></a></router-link></li>
-                    <li><a href="#"><span>特色</span></a></li>
-                    <!-- <li><router-link to="/enterprise"><a href="#"><span>特色</span></a></router-link></li> -->
-                    <li><a href="#"><span>功能</span></a></li>
                     <li><a href="https://uas.usoftchina.com/about" target="_blank"><span>关于我们</span></a></li>
                     <li>
                         <a href="#"><span class="">{{mytoken.realname}}</span></a>
-                        <a href=""><span class="">账户中心</span></a>
+                        <a href=""><span class="">退出</span></a>
                     </li>
                 </ul>
             </div>

+ 37 - 12
frontend/saas-portal-web/src/components/conenter/home.vue

@@ -18,9 +18,9 @@
             <div class="collapse navbar-collapse navbar-right" role="navigation">
           <ul id="nav" class="nav navbar-nav menu">
             <li><a href="#"><span>首页</span></a></li>
-            <!-- <li><a href="#feature"><span>特色</span></a></li> -->
             <li @click="home">
-              <router-link to="/enterprise"><a href="#"><span>特色</span></a></router-link>
+              <a href="#"><span>特色</span></a>
+              <!-- <router-link to="/enterprise"><a href="#"><span>特色</span></a></router-link> -->
             </li>
             <li><a href="#service"><span>功能</span></a></li>
             <li><a href="#prototype"><span>帮助中心</span></a></li>
@@ -33,8 +33,10 @@
 							<span class="user-info">
 								<img src="/static/img/assets/denglu3x.png" alt="">
 								<span id="user-info">{{account.realname || account.username}}</span>
-							</span>|
-              <a href="#">账户管理</a>
+							</span>
+              <span>退出</span>    |
+              <router-link to="/enterprise"><a href="#"><span>账户管理</span></a></router-link>
+              <!-- <a href="#">账户管理</a> -->
             </li>
           </ul>
         </div>
@@ -45,15 +47,20 @@
 
     <main class="site-content" role="main">
       <!-- 遮罩 -->
-      <div class="zhezhao" v-if="isLogin || isRegister"></div>
+      <div class="zhezhao" v-if="isLogin || isRegister || isexperience"></div>
       <div class="box" v-if="isLogin || isRegister">
         <div>
-          <img @click="closeModal" class="tc-on xs" style="float: right;padding: 10px"
+          <img @click="closeModal" class="tc-on shut"
                src="/static/img/qiye/chahao.png" alt="">
         </div>
         <iframe width="430" height="440" :src="ssoPage"></iframe>
         <iframe hidden :src="setTokenPage"></iframe>
       </div>
+      <div class="tiyan" v-if="isexperience">
+        我是体验
+        <img @click="Closeexperience" class="tc-on shut"
+               src="/static/img/qiye/chahao.png" alt="">
+      </div>
 
       <!--Home Slider==================================== -->
       <section id="home-slider">
@@ -68,7 +75,7 @@
               </div>
               <!-- 首页内容 -->
               <div class="my-text">
-                <button class='my-tiyan'>立即体验</button>
+                <button class='my-tiyan' @click="experience">立即体验</button>
 
               </div>
               <div class="slide-caption">
@@ -317,7 +324,8 @@
         isLogin: false,
         isRegister: false,
         clientId: null,
-        account: null
+        account: null,
+        isexperience: false
       }
     },
     mounted() {
@@ -353,6 +361,7 @@
           Session.set(session)
           const frame = window.frames[window.frames.length - 1]
           window.addEventListener('message', () => {
+           if(me.isLogin){
             me.isLogin = false
             if (!account.companyId) {
               // 添加企业
@@ -361,6 +370,7 @@
               // 跳转应用页面
               window.location.href = me.$url.web
             }
+           } 
           }, false)
           frame.postMessage(JSON.stringify(session), '*')
         })
@@ -382,20 +392,35 @@
           me.isLogin = false
           me.isRegister = false
         })
+      },
+      //体验
+      experience(){
+        this.isexperience = true;
+      },
+      //关闭体验
+      Closeexperience(){
+        this.isexperience = false;
       }
     }
   }
 </script>
 
 <style scoped>
-.tc-guanbi {
-	cursor: pointer;
+.shut {
+  cursor: pointer;
+  position: absolute;
+  top: 10px;
+  right: 10px;
 }
 .tiyan {
-	display: none;
+  position: absolute;
+  top: 50%;
+  left: 50%;
 	width: 400px;
 	height: 200px;
 	margin-left: -200px;
-    margin-top: -100px;
+  margin-top: -100px;
+  z-index: 10001;
+  background: white;
 }
 </style>

+ 7 - 38
frontend/saas-portal-web/src/components/conenter/qiyexiangxi.vue

@@ -1,7 +1,7 @@
 <template>
     <div>
         <!-- 企业详细信息 -->
-        <div v-if= "xiugai">
+        <div v-if="xiugai">
             <div class="gs-worp qy-worp" style="width:100%">
                 <div class="qy-title">
                     <span><img @click= "gobick" style="float: left;padding: 20px; cursor:pointer" src="../../../static/img/fanhui.png" alt=""></span>
@@ -10,10 +10,9 @@
                 </div>
                 <div class="qy-conent">
                     <ul>
-                        <li><span class="qy-biaoti">公司名称</span><span>飞飞有限公司</span></li>
+                        <li><span class="qy-biaoti">公司名称</span><span>{{content.address}}</span></li>
                         <li><span class="qy-biaoti">所属行业</span><span>飞飞有限公司</span></li>
-                        <li><span class="qy-biaoti">公司地址</span><span>飞飞有限公司</span></li>
-                        <!-- <li><span class="qy-biaoti">营业范围</span><span class="qy-biaoqian">飞飞标签</span><span class="qy-biaoqian">飞飞标签</span></li> -->
+                        <li><span class="qy-biaoti">公司地址</span><span>{{content.address}}</span></li>
                     </ul>
                 </div>
             </div>
@@ -44,7 +43,7 @@
                     <ul>
                         <li>
                             <span class="qy-biaoti"><span class="xingxing">*</span>公司名称</span>
-                            <span>飞飞有限公司</span>
+                            <span>{{content.address}}</span>
                         </li>
                         <li>
                             <span class="qy-biaoti">所属行业</span>
@@ -52,30 +51,8 @@
                         </li>
                         <li>
                             <span class="qy-biaoti">公司地址</span>
-                            <span>飞飞有限公司</span>
+                            <span>{{content.address}}</span>
                         </li>
-                        <!-- <li style="height:60px;">
-                            <span class="qy-biaoti"><span class="xingxing">*</span>注册地址</span>
-                            <span>飞飞有限公司</span>
-                        </li>
-                        <li>
-                            <span class="qy-biaoti">所属行业</span>
-                            <input type="text">
-                        </li>
-                        <li class="over">
-                            <span class="qy-biaoti">公司标签</span>
-                            <div class="addbiaoqian">
-                                <div style="overflow: hidden;padding-top: 5px;">
-                                    <span v-for="(b , i) in biaoqian" :key="i" class="xg-biaoqian tj-bqleft">
-                                        {{b}}
-                                        <img class="qcbiaoqian xs" @click="qcbiaoqian(i)" src="../../../static/img/qiye/CHA HAO.png"/>
-                                    </span>
-                                </div>
-                                <div>
-                                    <input style="100%" type="text" placeholder="飞飞公司" />
-                                </div>
-                            </div>
-                        </li> -->
                     </ul>
                 </div>
             </div>
@@ -101,15 +78,11 @@
         data(){
             return {
                 xiugai:true,
-                biaoqian: [
-                    'feifei',
-                    '飞飞公司',
-                    '飞飞企业',
-                ]
+                content: this.$route.query.content,
             }
         },
         mounted(){
-
+            // console.log(this.content)
         },
         methods: {//修改企业信息
             xiugaiqiye(){
@@ -126,10 +99,6 @@
                 document.documentElement.scrollTop = 0;
                 this.xiugai = true;
             },
-            //清除标签
-            qcbiaoqian(i){
-                this.biaoqian.splice(i,1);
-            },
             //返回
             gobick(){
                 // this.$router.go(-1); 

+ 1 - 0
frontend/saas-portal-web/src/main.js

@@ -12,6 +12,7 @@ Vue.config.productionTip = false
 
 // 注入url配置
 Vue.prototype.$url = process.env.BASE_URL
+Axios.defaults.baseURL = 'http://192.168.253.31:8560'
 /* eslint-disable no-new */
 new Vue({
   el: '#app',

+ 3 - 0
frontend/saas-portal-web/static/css/gongsi.css

@@ -141,6 +141,9 @@
     position: absolute;
     top: 50%;
     left: 50%;
+    width: 70%;
+    margin-left: 30%;
+    height: 50%;
     transform: translate(-100%,-50%);
 }
 .gs-xqright {

+ 0 - 21
frontend/saas-portal-web/static/js/mains.js

@@ -36,55 +36,34 @@ $(function() {
             } ),
 
             init = function() {
-
                 initEvents();
-
             },
             initEvents = function() {
-
                 // add navigation events
                 $navArrows.children( ':last' ).on( 'click', function() {
-
                     slitslider.next();
                     return false;
-
                 } );
 
                 $navArrows.children( ':first' ).on( 'click', function() {
-
                     slitslider.previous();
                     return false;
-
                 } );
-
                 $nav.each( function( i ) {
-
                     $( this ).on( 'click', function( event ) {
-
                         var $dot = $( this );
-
                         if( !slitslider.isActive() ) {
-
                             $nav.removeClass( 'nav-dot-current' );
                             $dot.addClass( 'nav-dot-current' );
-
                         }
-
                         slitslider.jump( i + 1 );
                         return false;
-
                     } );
-
                 } );
-
             };
-
             return { init : init };
-
     })();
-
     Page.init();
-
 });
 
 

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

@@ -183,7 +183,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                     grid.saveDocumentAs({
                         type: 'xlsx',
                         title: grid.ownerCt._title + '列表',
-                        fileName: grid.ownerCt._title + '列表.xlsx'
+                        fileName: grid.ownerCt._title + '列表'+Ext.Date.format(new Date(),'Y-m-d_H-i-s')+'.xlsx'
                     });
                     grid.store.exportPageSize = null;
                     grid.store.exportNumber = null;

+ 2 - 1
frontend/saas-web/app/view/core/form/DataMultiCombo.js

@@ -72,11 +72,12 @@ Ext.define('saas.view.core.form.DataMultiCombo', {
         if (!me.menu) {
 
             me.menu = Ext.create('Ext.menu.Menu',{
+                style:'max-height: 195px;overflow-y:scroll;',
                 hideOnParentHide: false,
                 items: me.getMenuItems(),
                 listeners:{
                     mouseleave:me.onMouseLeave,
-                    scope:me
+                    scope:me,
                 }
             });
         }

+ 1 - 1
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -338,7 +338,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
                     grid.saveDocumentAs({
                         type: 'xlsx',
                         title: grid.addTitle + '列表',
-                        fileName: grid.addTitle + '列表.xlsx'
+                        fileName: grid.addTitle + '列表'+ Ext.Date.format(new Date(),'Y-m-d_H-i-s') +'.xlsx'
                     });
                     grid.store.exportPageSize = null;
                     grid.store.exportNumber = null;

+ 1 - 1
frontend/saas-web/app/view/core/report/ReportPanelController.js

@@ -30,7 +30,7 @@ Ext.define('saas.view.core.report.ReportPanelController', {
                 }
                 //font:
             },
-            fileName: title + '.' + (btn.cfg.ext || btn.cfg.type)
+            fileName: title + Ext.Date.format(new Date(),'Y-m-d_H-i-s') +'.' + (btn.cfg.ext || btn.cfg.type)
         }, btn.cfg);
         grid.store.exportPageSize = 5000;
         grid.store.exportNumber = 1;

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

@@ -247,7 +247,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 beforeLabelTextTpl: "",
             },{
                 xtype:'textfield',
-                fieldLabel: '联系电话',
+                fieldLabel: '手机号码',
                 name: 'mobile',
                 readOnly:true,
                 editable:false,
@@ -256,7 +256,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 beforeLabelTextTpl: "",
             },{
                 xtype:'textfield',
-                fieldLabel: '联系邮件',
+                fieldLabel: '邮箱',
                 name: 'email',
                 readOnly:true,
                 editable:false,
@@ -265,6 +265,61 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                 beforeLabelTextTpl: "",
             }]
         },
+        accountadd:{
+            items:[{
+                xtype:'textfield',
+                fieldLabel: '手机号码',
+                name: 'mobile',
+                hideTrigger:true,
+                allowBlank:false,
+                maxLength: 30,
+                regex:/^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/,
+                regexText:'请输入正确的手机号码',
+                listeners:{
+                    blur:function(f,a,b,c){
+                        if(f.value&&f.value!=''&&f.isValid()){
+                            // var url = 'https://sso.ubtob.com' + '/api/user/checkMobile?mobile='+f.value;
+                            // saas.util.BaseUtil.request({url })
+                            // .then(function(res) {
+                            //     if(res.success) {
+                            //     }
+                            // })
+                            // .catch(function(response) {
+                            // });
+                            // Ext.Ajax.request({
+                            //     url: Ext.manifest.server.accountPath + '/api/user/checkMobile',
+                            //     params: {
+                            //         mobile: f.value
+                            //     },
+                            //     method: 'GET',
+                            //     headers:{
+                            //         'Access-Control-Allow-Origin': '*',
+                            //         "Content-Type": 'application/json;charset=UTF-8'
+                            //     },
+                            //     success: function (response) {
+                            //         debugger
+                            //     },
+                            //     failure: function (response) {
+                            //         debugger
+                            //     }
+                            // });
+                        }
+                    }
+                }
+            },{
+                xtype:'textfield',
+                fieldLabel: '真实姓名',
+                name: 'realname',
+                allowBlank:false,
+                maxLength: 30,
+            },{
+                xtype:'textfield',
+                fieldLabel: '邮箱',
+                name: 'email',
+                allowBlank:false,
+                maxLength: 30,
+            }]
+        },
         warehouse:{
             items:[{
                 xtype:'hidden',

+ 10 - 0
frontend/saas-web/app/view/document/kind/Kind.js

@@ -258,6 +258,16 @@ Ext.define('saas.view.document.kind.Kind', {
             }],
             reqUrl:'/api/account/account/bind/roles',
         },
+        accountadd:{
+            columns:[{
+                dataIndex:'realname',
+            },{
+                dataIndex: 'mobile',
+            },{
+                dataIndex: 'email',
+            }],
+            reqUrl: 'http://192.168.253.31:8560/api/account/account/register/add',
+        },
         employee:{
             columns: [{
                 text: '人员编号',

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

@@ -1,37 +1,67 @@
 Ext.define('saas.view.money.report.AccountDetails', {
-    extend: 'saas.view.core.report.ReportPanel',
+    extend: 'Ext.grid.Panel',
     xtype: 'monry-report-accountdetails',
 
     controller: 'money-report-accountdetails',
     viewModel: 'money-report-accountdetails',
 
     viewName: 'money-report-accountdetails',
+    autoScroll: true,
+    frame:true,
+    layout:'fit',
+    //工具类
+    FormUtil: Ext.create('saas.util.FormUtil'),
+    BaseUtil: Ext.create('saas.util.BaseUtil'),
 
     // groupField: null,
-    listUrl: '/api/money/report/accountdetails',
+    dataUrl: '/api/money/report/accountdetails',
     defaultCondition: null,
     reportTitle: '核销对账表',
     QueryWidth:0.25,
     //筛选:客户/供应商、日期、单据类型(必填)
-    searchItems: [ {
-        xtype: 'vendorDbfindTrigger',
-        name: 've_name',
-        fieldLabel: '供应商名称',
-        columnWidth: 0.25,
-        // allowBlank:false
-    }, {
-        xtype: 'customerDbfindTrigger',
-        name: 'cu_name',
-        fieldLabel: '用户名称',
-        columnWidth: 0.25,
-        // allowBlank:false
+    tbar: [{
+        width: 150,
+        name: 'sl_kind',
+        xtype: 'textfield',
+        emptyText : '单据类型'
     },{
-        xtype: 'condatefield',
+        width: 400,
         name: 'date',
-        fieldLabel: '单据日期',
-        columnWidth: 0.5
-    }],
-    reportColumns: [
+        xtype: 'condatefield',
+        emptyText : '单据日期'
+    },{
+        width: 200,
+        name: 've_name',
+        xtype: 'textfield',
+        emptyText : '供应商名称'
+    },{
+            width: 200,
+            name: 'cu_name',
+            xtype: 'textfield',
+            emptyText : '客户名称'
+    },{
+        cls:'x-formpanel-btn-orange',
+        xtype:'button',
+        text:'查询',
+        listeners: {
+            click:function(b){
+                var grid = b.ownerCt.ownerCt;
+                var tbar = b.ownerCt;
+                grid.condition = '';
+                var items = [];
+                var fields = tbar.items.items.map(f => f.name);
+                Ext.each(fields, function(f, index){
+                    var field = tbar.down('[name='+f+']');
+                    if(field){
+                        items.push(field);
+                    }
+                });
+                grid.condition = grid.getCondition(items);
+                grid.store.loadPage(1);
+            }
+        }
+    },'->'],
+    columns: [
         {
             text: 'id',
             dataIndex: 'pi_id',
@@ -97,5 +127,188 @@ Ext.define('saas.view.money.report.AccountDetails', {
             //     var format = '0,000.' + xr.join();
             //     return Ext.util.Format.number(v, format);
             // }
-        }]
+        }],
+
+    dbSearchFields: [],
+    condition:'',
+
+    initComponent: function() {
+        var me = this;
+        if(me.columns){
+            var fields = me.columns.map(column => column.dataIndex);
+            me.store = Ext.create('Ext.data.Store',{
+                fields:fields,
+                autoLoad: true,
+                pageSize: 11,
+                data: [],
+                proxy: {
+                    timeout:8000,
+                    type: 'ajax',
+                    url: me.dataUrl,
+                    actionMethods: {
+                        read: 'GET'
+                    },
+                    reader: {
+                        type: 'json',
+                        rootProperty: 'data.list.list',
+                        totalProperty: 'data.list.total',
+                    }
+                },
+                listeners: {
+                    beforeload: function (store, op) {
+                        var condition = me.condition;
+                        if (Ext.isEmpty(condition)) {
+                            condition = "";
+                        }
+                        Ext.apply(store.proxy.extraParams, {
+                            number: op._page,
+                            size: store.pageSize,
+                            condition: JSON.stringify(condition)
+                        });
+                    }
+                }
+            });
+
+            Ext.apply(me, {
+                dockedItems:[{
+                    xtype: 'pagingtoolbar',
+                    dock: 'bottom',
+                    displayInfo: true,
+                    store: me.store
+                }]
+            });
+        }
+        me.callParent(arguments);
+    },
+
+    getGridSelected:function(type){
+        var isErrorSelect = false;
+        var checkField = this.statusCodeField;
+        var me = this,
+            items = me.selModel.getSelection(),
+            data = new Array() ;
+        Ext.each(items, function(item, index){
+            if(!Ext.isEmpty(item.data[me.idField])){
+                var o = new Object();
+                if(me.idField){
+                    o['id'] = item.data[me.idField];
+                }
+                if(me.codeField){
+                    o['code'] = item.data[me.codeField];
+                }
+                if(type&&type==item.data[checkField]){
+                    isErrorSelect = true
+                }
+                data.push(o);
+            }
+        });
+        if(isErrorSelect){
+            return false;
+        }
+        return data;
+    },
+
+    /**
+     * 获得过滤条件
+     */
+    getCondition: function(items) {
+        var me = this,
+            conditions = [];
+
+        for(var i = 0; i < items.length; i++) {
+            var item = items[i];
+            var field = item.name,
+                func = item.getCondition,
+                value = item.value,
+                condition;
+
+            if(typeof func == 'function') {
+                condition = {
+                    type: 'condition',
+                    value: func(value)
+                }
+            }else {
+                var xtype = item.xtype || 'textfield',
+                    type = item.fieldType || me.getDefaultFieldType(xtype),
+                    operation = item.operation || me.getDefaultFieldOperation(xtype),
+                    conditionValue = me.getConditionValue(xtype, value);
+
+                if(!conditionValue) {
+                    continue;
+                }
+                condition = {
+                    type: type,
+                    field: field,
+                    operation: operation,
+                    value: conditionValue
+                }
+            }
+            conditions.push(condition);
+        };
+        return conditions;
+    },
+
+    getDefaultFieldType: function(xtype) {
+        var type;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            type = 'number';
+        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+            type = 'date';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+            type = 'enum';
+        }else {
+            type = 'string';
+        }
+
+        return type;
+    },
+
+    getDefaultFieldOperation: function(xtype) {
+        var operation;
+
+        if(Ext.Array.contains(['numberfield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['datefield'], xtype)) {
+            operation = '=';
+        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+            operation = 'between';
+        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+            operation = 'in';
+        }else {
+            operation = 'like';
+        }
+
+        return operation;
+    },
+
+    /**
+     * 处理部分字段值
+     */
+    getConditionValue: function(xtype, value) {
+        var conditionValue;
+        if(xtype == 'datefield') {
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
+        }else if(xtype == 'condatefield') {
+            var from = value.from,
+                to = value.to;
+
+            conditionValue = Ext.Date.format(new Date(from), 'Y-m-d 00:00:00') + ',' + Ext.Date.format(new Date(to), 'Y-m-d 23:59:59');
+        }else if(xtype == 'combobox' || xtype == 'combo') {
+            conditionValue = '\'' + value + '\'';
+        }else if(xtype == 'multicombo') {
+            conditionValue = value.map(function(v) {
+                return '\'' + v.value + '\'';
+            }).join(',');
+        }else {
+            conditionValue = value;
+        }
+
+        return conditionValue;
+    },
+
+    refresh:function(){
+        //debugger
+    }
+
 });

+ 27 - 21
frontend/saas-web/app/view/money/report/AccountDetailsController.js

@@ -1,28 +1,34 @@
 Ext.define('saas.view.money.report.AccountDetailsController', {
-    extend: 'saas.view.core.report.ReportPanelController',
+    extend: 'saas.view.core.base.BasePanelController',
     alias: 'controller.money-report-accountdetails',
+    // init: function (form) {
+    //     this.control({
+    //         // 供应商编号
+    //         'dbfindtrigger[name=ve_name]':{
+    //             beforerender:function(f){
+    //                 Ext.apply(f,{
+    //                     dbfinds:[{
+    //                         from:'ve_name',to:'ve_name'
+    //                     }],
+    //                 }) ;
+    //             }
+    //         },
+    //         // 客户编号
+    //         'dbfindtrigger[name=cu_name]':{
+    //             beforerender:function(f){
+    //                 Ext.apply(f,{
+    //                     dbfinds:[{
+    //                         from:'cu_name',to:'cu_name'
+    //                     }],
+    //                 }) ;
+    //             }
+    //         }
+    //     });
+    // }
+
     init: function (form) {
+        var me = this;
         this.control({
-            // 供应商编号
-            'dbfindtrigger[name=ve_name]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'ve_name',to:'ve_name'
-                        }],
-                    }) ;
-                }
-            },
-            // 客户编号
-            'dbfindtrigger[name=cu_name]':{
-                beforerender:function(f){
-                    Ext.apply(f,{
-                        dbfinds:[{
-                            from:'cu_name',to:'cu_name'
-                        }],
-                    }) ;
-                }
-            }
         });
     }
 });

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

@@ -1,4 +1,4 @@
 Ext.define('saas.view.money.report.AccountDetailsModel', {
-    extend: 'saas.view.core.report.ReportPanelModel',
+    extend: 'saas.view.core.base.BasePanelModel',
     alias: 'viewmodel.money-report-accountdetails'
 });

+ 16 - 4
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -46,7 +46,18 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 ['receivable_offset_payable', '应收冲应付'],
                 ['receivable_to_receivable', '应收转应收'],
                 ['payable_to_payable', '应付转应付']
-            ]
+            ],
+            listeners:{
+                beforerender:function(f){
+                    f.firstLoad=true;
+                },
+                change:function(f){
+                    if(f.bindError){
+                        f.setValue(f.defaultValue);
+                        f.bindError = false
+                    }
+                }
+            }
         }],
 
         detail1: {
@@ -268,14 +279,13 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 }
             }, {
                 text: "本次核销金额",
-                xtype: 'numbercolumn',
                 dataIndex: "vcd_nowbalance",
-                width:150,
+                xtype: 'numbercolumn',
                 editor : {
                     xtype : "numberfield",
                     decimalPrecision: 2
                 },
-                allowBlank : false,
+                width: 110,
                 renderer : function(v) {
                     var arr = (v + '.').split('.');
                     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -304,6 +314,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 xtype: 'hidden',
                 fieldLabel: '客户名称',
                 name: 'vc_custid',
+                allowBlank : false,
                 listeners: {
                     change: 'clearDetails'
                 }
@@ -339,6 +350,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 xtype: 'hidden',
                 name: 'vc_vendid',
                 fieldLabel: '供应商名称',
+                allowBlank : false,
                 listeners: {
                     change: 'clearDetails'
                 }

+ 14 - 3
frontend/saas-web/app/view/money/verification/FormPanelModel.js

@@ -7,10 +7,21 @@ Ext.define('saas.view.money.verification.FormPanelModel', {
             bind: '{vc_kind}',
             get: function(v) {
                 var form = this.getView();
+                var vc_kind = form.down('[name=vc_kind]');
                 form.acitveType = v;
-                //form.initFormItems();
-
-                return v;
+                if(form.initId==0||!vc_kind.firstLoad){
+                    form.initFormItems();
+                }
+                if(vc_kind.firstLoad){
+                    vc_kind.firstLoad = false;
+                    if(vc_kind.defaultValue!=v&&vc_kind.defaultValue==vc_kind.value){
+                        vc_kind.bindError = true;
+                        return vc_kind.value;
+                    }
+                }else{
+                    return v;
+                }
+                
             }
         }
     }

+ 1 - 1
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -20,7 +20,7 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         columnWidth: 0.2
     }, {
         xtype: 'productDbfindTrigger',
-        name: 'pr_code',
+        name: 'pr_detail',
         fieldLabel: '物料',
         columnWidth: 0.2
     }, {

+ 2 - 5
frontend/saas-web/app/view/sale/report/SaleProfitController.js

@@ -21,13 +21,10 @@ Ext.define('saas.view.sale.report.SaleProfitController', {
                 }
             },
             //放大镜赋值关系 以及 tpl模板
-            'dbfindtrigger[name=pr_code]':{
+            'dbfindtrigger[name=pr_detail]':{
                 beforerender:function(f){
                     Ext.apply(f,{
-                        dbfinds:[
-                        {
-                            from:'pr_code',to:'pr_code'
-                        }, {
+                        dbfinds:[{
                             from:'pr_detail',to:'pr_detail'
                         }, {
                             from:'pr_spec',to:'pr_spec'

+ 6 - 2
frontend/saas-web/app/view/sale/saleIn/QueryPanel.js

@@ -151,7 +151,7 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             text: '明细序号',
             dataIndex: 'pd_detno',
             xtype: 'numbercolumn',
-            width: 80
+            width: 100
         }, {
             text: '关联销售单号',
             dataIndex: 'pd_ordercode',
@@ -160,7 +160,11 @@ Ext.define('saas.view.sale.saleIn.QueryPanel', {
             text: '订单序号',
             dataIndex: 'pd_orderdetno',
             xtype:'numbercolumn',
-            width: 80
+            width: 100,
+            renderer : function(v) {
+                var format = '0'
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '物料编号',
             dataIndex: 'pd_prodcode',

+ 6 - 2
frontend/saas-web/app/view/sale/saleOut/QueryPanel.js

@@ -152,7 +152,7 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             text: '明细序号',
             dataIndex: 'pd_detno',
             xtype: 'numbercolumn',
-            width: 80
+            width: 100
         }, {
             text: '关联销售单号',
             dataIndex: 'pd_ordercode',
@@ -161,7 +161,11 @@ Ext.define('saas.view.sale.saleout.QueryPanel', {
             text: '订单序号',
             dataIndex: 'pd_orderdetno',
             xtype:'numbercolumn',
-            width: 80
+            width: 100,
+            renderer : function(v) {
+                var format = '0'
+                return Ext.util.Format.number(v, format);
+            }
         }, {
             text: '物料编号',
             dataIndex: 'pd_prodcode',

+ 2 - 3
frontend/saas-web/app/view/stock/stockamount/DataList.js

@@ -90,12 +90,11 @@ Ext.define('saas.view.stock.stockamount.DataList', {
     {
         text : "数量",
         xtype: 'numbercolumn',
-        align: 'end',
         dataIndex : "rc_number", 
         width : 110.0, 
         renderer : function(v) {
             var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length>3?3:arr[1].length)).fill('0');
+            var xr = (new Array(arr[1].length>8?8:arr[1].length)).fill('0');
             var format = '0.' + xr.join();
             return Ext.util.Format.number(v, format);
         }
@@ -117,7 +116,7 @@ Ext.define('saas.view.stock.stockamount.DataList', {
         text : "金额", 
         xtype: 'numbercolumn',
         dataIndex : "rc_amount", 
-        flex : 1.0, 
+        width : 110.0,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length>2?2:arr[1].length)).fill('0');

+ 52 - 2
frontend/saas-web/app/view/sys/account/DataList.js

@@ -42,7 +42,19 @@ Ext.define('saas.view.sys.account.DataList', {
                 grid.store.loadPage(1);
             }
         }
-    },'->'],
+    },'->',{
+        xtype:'button',
+        text:'新增',
+        listeners: {
+            click: 'onAdd'
+        }
+    },{
+        xtype:'button',
+        text:'刷新',
+        listeners: {
+            click: 'onRefresh'
+        }
+    }],
 
     columns : [{
         text : 'id', 
@@ -84,7 +96,45 @@ Ext.define('saas.view.sys.account.DataList', {
     },{
         text : '关联角色', 
         dataIndex : 'roleNames', 
-        width : 110.0
+        width : 220.0
+    },{
+        text: '账户状态',
+        dataIndex: 'em_class',
+        width:90,
+        xtype: 'actioncolumn',
+        align : 'center',
+        items: [{
+            iconCls:'',
+            getClass: function(v, meta, rec) {
+                if(rec.get('em_class')=='正式'){
+                    return 'x-grid-checkcolumn-checked-btn';
+                }else{
+                    return 'x-grid-checkcolumn-btn';
+                }
+            },
+            handler: function(view, rowIndex, colIndex) {
+                var rec = view.getStore().getAt(rowIndex);
+                var type=rec.get('em_class')=='正式'?true:false;
+                //  禁用/启用
+                var form = this.ownerCt.ownerCt.ownerCt;
+                var grid = this.ownerCt.ownerCt;
+                saas.util.BaseUtil.request({
+                    url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
+                    params: '',
+                    method: 'POST',
+                })
+                .then(function(localJson) {
+                    if(localJson.success){
+                        saas.util.BaseUtil.showSuccessToast('操作成功');
+                        grid.store.load();
+                    }
+                })
+                .catch(function(res) {
+                    console.error(res);
+                    saas.util.BaseUtil.showErrorToast('操作失败: ' + res.message);
+                });
+            }
+        }]
     }],
 
     dbSearchFields: [],

+ 22 - 1
frontend/saas-web/app/view/sys/account/DataListController.js

@@ -6,5 +6,26 @@ Ext.define('saas.view.sys.account.DataListController', {
         var me = this;
         this.control({
         });
-    }
+    },
+
+    onAdd:function(b){
+        var document = Ext.create('saas.view.document.kind.Kind',{});
+        var form = this.view;
+        this.dialog = form.add({
+            xtype: 'document-kind-childwin',
+            bind: {
+                title: '新增账户资料'
+            },
+            dataKind:'accountadd',
+            belong:document.etc['accountadd'],
+            _parent:form,
+            record:null,
+            session: true
+        });
+        this.dialog.show();
+    },
+    onRefresh:function(){
+        var me = this;
+        me.view.items.items[0].store.load();
+    },
 });

+ 0 - 5
frontend/saas-web/resources/json/navigation.json

@@ -159,11 +159,6 @@
             "text": "资金转存",
             "addType": "money-fundtransfer-formpanel",
             "viewType": "money-fundtransfer-querypanel"
-        }, {
-            "id": "verification",
-            "text": "核销单",
-            "addType": "money-verification-formpanel",
-            "viewType": "money-verification-querypanel"
         }]
     }, {
         "text": "报表",