Browse Source

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

guq 7 years ago
parent
commit
ed7cdb9c00
42 changed files with 405 additions and 275 deletions
  1. 3 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java
  2. 2 2
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/BankinformationServiceImpl.java
  3. 3 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/CustomerServiceImpl.java
  4. 4 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/VendorServiceImpl.java
  5. 4 1
      applications/document/document-server/src/main/java/com/usoftchina/saas/document/service/impl/WarehouseServiceImpl.java
  6. 1 1
      applications/document/document-server/src/main/resources/application.yml
  7. 6 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/FundtransferServiceImpl.java
  8. 43 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthreceiptsServiceImpl.java
  9. 12 3
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/OthspendingsServiceImpl.java
  10. 8 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/PaybalanceServiceImpl.java
  11. 8 0
      applications/money/money-server/src/main/java/com/usoftchina/saas/money/service/impl/RecbalanceServiceImpl.java
  12. 2 0
      applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml
  13. 2 0
      applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml
  14. 2 0
      applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml
  15. 6 0
      applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml
  16. 1 1
      applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml
  17. 6 0
      applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml
  18. 1 1
      applications/money/money-server/src/main/resources/mapper/RecbalancedetMapper.xml
  19. 4 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  20. 11 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  21. 9 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml
  22. 4 4
      base-servers/auth/auth-server/src/main/java/com/usoftchina/saas/auth/controller/AuthController.java
  23. 5 0
      framework/core/src/main/java/com/usoftchina/saas/utils/RegexpUtils.java
  24. 0 28
      framework/server-starter/src/main/java/com/usoftchina/saas/server/error/ServletErrorUtils.java
  25. 41 0
      framework/server-starter/src/main/java/com/usoftchina/saas/server/web/ServletUtils.java
  26. 14 1
      frontend/saas-portal-web/config/env.js
  27. 59 4
      frontend/saas-portal-web/src/js/main.js
  28. 2 1
      frontend/saas-web/Dockerfile
  29. 1 1
      frontend/saas-web/app.json
  30. 8 6
      frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js
  31. 17 9
      frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js
  32. 0 89
      frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js~2496f4a5e0d652d0a04afaa39f7ce066459fbea1
  33. 0 110
      frontend/saas-web/app/view/core/dbfind/types/ProductDbfindTrigger.js~2496f4a5e0d652d0a04afaa39f7ce066459fbea1
  34. 3 3
      frontend/saas-web/app/view/core/dbfind/types/VendorDbfindTrigger.js
  35. 79 1
      frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js
  36. 15 2
      frontend/saas-web/app/view/core/query/QueryFormPanel.js
  37. 1 1
      frontend/saas-web/app/view/core/query/QueryPanelController.js
  38. 2 2
      frontend/saas-web/app/view/document/kind/ChildForm.js
  39. 3 1
      frontend/saas-web/app/view/document/product/FormPanel.js
  40. 1 1
      frontend/saas-web/app/view/money/othspendings/FormPanel.js
  41. 2 0
      frontend/saas-web/app/view/stock/make/QueryPanel.js
  42. 10 0
      frontend/saas-web/set-token.html

+ 3 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/exception/BizExceptionCode.java

@@ -46,6 +46,9 @@ public enum BizExceptionCode implements BaseExceptionCode {
     DEAL_FAILED(79800, "编号:<u>%s</u>处理失败,%s"),
     USING_EXISTS(79504, ""),
 
+    VENDOR_ISCLOSE(79505, "供应商已关闭"),
+    PRODUCT_ISCLOSE(79506, "物料已关闭"),
+    CUSTOMER_ISCLOSE(79507, "客户资料已关闭"),
 
 
     //采购 70000-71999

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

@@ -45,7 +45,6 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
     @Override
     public boolean save(Bankinformation bankinformation){
         bankinformation.setCompanyId(BaseContextHolder.getCompanyId());
-        bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
         bankinformation.setBk_income(new Double(0));
         bankinformation.setBk_spending(new Double(0));
 
@@ -56,10 +55,11 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
             if (bktion != null){
                 throw new BizException(500, BizExceptionCode.ACCOUNT_EXISTS.getMessage());
             }
+            bankinformation.setBk_thisamount(bankinformation.getBk_beginamount());
             bankinformationMapper.insertSelective(bankinformation);
         }else {
+            Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode());
             if (bktion != null){
-                Long id = bankinformationMapper.selectBankId(bankinformation.getBk_bankcode());
                 if (id.equals(bankinformation.getId())){
                     bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
                 }else {

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

@@ -22,6 +22,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.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -119,7 +120,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         //返回对象
         DocBaseDTO baseDTO = null;
         Long cu_id = main.getId();
-        String cu_code = main.getCu_code();
+        String cu_code = main.getCu_code().trim().toUpperCase();
         Customer customer = BeanMapper.map(main,Customer.class);
         customer.setCompanyId(companyId);
         customer.setCreatorId(userId);
@@ -132,6 +133,7 @@ public class CustomerServiceImpl extends CommonBaseServiceImpl<CustomerMapper, C
         customer.setCu_leftamount(beginapamount-beginprepayamount+recamount-preamount);
 
         //编号校验
+        cu_code = RegexpUtils.replaceSpecCharacter(cu_code);
         cu_code = pushMaxnubmer(cu_code, cu_id);
         //单号赋值
         customer.setCu_code(cu_code);

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

@@ -25,6 +25,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.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -115,7 +116,9 @@ public class VendorServiceImpl extends CommonBaseServiceImpl<VendorMapper, Vendo
         Vendor main = vendorListDTO.getMain();
         main.setCompanyId(BaseContextHolder.getCompanyId());
         List<Vendorcontact> items = vendorListDTO.getItems();
-        String code = pushMaxnubmer(main.getVe_code(), main.getId());
+        String ve_code = main.getVe_code().trim().toUpperCase();
+        ve_code = RegexpUtils.replaceSpecCharacter(ve_code);
+        String code = pushMaxnubmer(ve_code, main.getId());
         if(main.getId() == 0){
             int count = getMapper().getCountByCode(code, companyId);
             if(count > 0){

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

@@ -17,6 +17,7 @@ import com.usoftchina.saas.document.mapper.WarehouseMapper;
 import com.usoftchina.saas.document.service.WarehouseService;
 import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.page.PageRequest;
+import com.usoftchina.saas.utils.RegexpUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -106,7 +107,9 @@ public class WarehouseServiceImpl extends CommonBaseServiceImpl<WarehouseMapper,
         DocBaseDTO docBaseDTO = null;
         Long companyId = BaseContextHolder.getCompanyId();
         if(record.getId() == 0){
-            String code = pushMaxnubmer(record.getWh_code(), record.getId());
+            String whcode = record.getWh_code().trim().toUpperCase();
+            whcode = RegexpUtils.replaceSpecCharacter(whcode);
+            String code = pushMaxnubmer(whcode, record.getId());
             record.setCompanyId(BaseContextHolder.getCompanyId());
             record.setCreatorId(BaseContextHolder.getUserId());
             record.setCreateTime(new Date());

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

@@ -47,7 +47,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@127.0.0.1:8500/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@192.168.0.181:8510/eureka/
 management:
   endpoints:
     web:

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

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -70,6 +71,7 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         }else {
             fundtransfer.setCompanyId(BaseContextHolder.getCompanyId());
             fundtransfer.setFt_recorder(BaseContextHolder.getUserName());
+            fundtransfer.setCreatorName(BaseContextHolder.getUserName());
             fundtransferMapper.insertSelective(fundtransfer);
             id = fundtransfer.getId();
 
@@ -99,6 +101,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         Fundtransfer fundtransfer = fundtran.getMain();
         fundtransfer.setFt_status(Status.AUDITED.getDisplay());
         fundtransfer.setFt_statuscode(Status.AUDITED.name());
+        fundtransfer.setFt_auditman(BaseContextHolder.getUserName());
+        fundtransfer.setFt_auditdate(new Date());
         fundtransfer.setCompanyId(companyId);
         this.changBankUntil(fundtran);
         DocBaseDTO docBaseDTO = this.insert(fundtran);
@@ -186,6 +190,8 @@ public class FundtransferServiceImpl extends CommonBaseServiceImpl<FundtransferM
         fundtransfer.setId(Long.valueOf(id));
         fundtransfer.setFt_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         fundtransfer.setFt_statuscode(Status.UNAUDITED.name());
+        fundtransfer.setFt_auditman(null);
+        fundtransfer.setFt_auditdate(null);
         fundtransferMapper.updateByPrimaryKeySelective(fundtransfer);
 
         //删除中间表

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

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -78,6 +79,8 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         }else {
             othreceipts.setCompanyId(BaseContextHolder.getCompanyId());
             othreceipts.setOr_recorder(BaseContextHolder.getUserName());
+            othreceipts.setCreatorName(BaseContextHolder.getUserName());
+            othreceipts.setCreateTime(new Date());
             othreceiptsMapper.insertSelective(othreceipts);
             id = othreceipts.getId();
             baseDTO = getBaseDTOById(id);
@@ -106,6 +109,8 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         Othreceipts othreceipts = othte.getMain();
         othreceipts.setOr_status(Status.AUDITED.getDisplay());
         othreceipts.setOr_statuscode(Status.AUDITED.name());
+        othreceipts.setOr_auditman(BaseContextHolder.getUserName());
+        othreceipts.setOr_auditdate(new Date());
         this.changBankUntil(othte);
         DocBaseDTO docBaseDTO = this.insert(othte);
         Long id = docBaseDTO.getId();
@@ -197,11 +202,14 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
         othreceipts.setId(Long.valueOf(id));
         othreceipts.setOr_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         othreceipts.setOr_statuscode(Status.UNAUDITED.name());
+        othreceipts.setOr_auditman(null);
+        othreceipts.setOr_auditdate(null);
         othreceiptsMapper.updateByPrimaryKeySelective(othreceipts);
 
         //删除中间表
         othreceipts = othreceiptsMapper.selectByPrimaryKey(id);
         banksubledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单");
+        subledgerMapper.deleteByPrimaryKey(othreceipts.getOr_code(), "其他收入单");
 
         //更新资金
         Double amount = banksubledgerMapper.selectThisamount(othreceipts.getOr_bankcode());
@@ -213,6 +221,41 @@ public class OthreceiptsServiceImpl extends CommonBaseServiceImpl<OthreceiptsMap
                     othreceipts.getOr_bankcode(), "-");
         }
 
+        //资金账号表
+        int bk_inid = othreceipts.getOr_bankid();
+
+        Double or_amount = othreceipts.getOr_amount();
+        //收款
+        Bankinformation bankinformation = bankinformationMapper.selectByPrimaryKey(bk_inid);
+        Double beginamount = bankinformation.getBk_beginamount();
+        Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
+        Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
+        bankinformation.setBk_thisamount(beginamount + incomme - spending - or_amount);
+        bankinformation.setBk_income(incomme - or_amount);
+        bankinformation.setBk_spending(spending);
+        bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
+
+        //客户付款
+        /**
+         * 更新客户资料
+         * cu_preamount=nvl(cu_preamount,0)+rb_preamount,
+         * cu_recamount=nvl(cu_recamount,0)-rb_rbdamount,
+         * cu_leftamount=cu_beginaramount-cu_beginprerecamount+cu_recamount-cu_preamount;
+         */
+        Customer customerData = recbalanceMapper.selectCustomerByPrimaryKey(othreceipts.getOr_custid());
+        Double preamount = customerData.getCu_preamount()==null?new Double(0):customerData.getCu_preamount();
+        Double beginapamount = customerData.getCu_beginaramount()==null?new Double(0):customerData.getCu_beginaramount();
+        Double beginprepayamount= customerData.getCu_beginprerecamount()==null?new Double(0):customerData.getCu_beginprerecamount();
+        Double recamount = customerData.getCu_recamount()==null?new Double(0):customerData.getCu_recamount();
+
+        Customer customer = new Customer();
+        customer.setId(Long.valueOf(othreceipts.getOr_custid()));
+        customer.setCu_preamount(preamount);
+        customer.setCu_recamount(recamount-or_amount);
+        customer.setCu_leftamount(beginapamount+beginprepayamount-recamount+or_amount+preamount);
+        recbalanceMapper.updateCustomerByPrimaryKeySelective(customer);
+
+
         //计算期间金额
         Statsinfo statsinfo = new Statsinfo();
         List<Integer> ymList = othreceiptsdetailMapper.selectYm(id);

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

@@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -73,6 +74,8 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         }else {
             othspendings.setCompanyId(BaseContextHolder.getCompanyId());
             othspendings.setOs_recorder(BaseContextHolder.getUserName());
+            othspendings.setCreatorName(BaseContextHolder.getUserName());
+            othspendings.setCreateTime(new Date());
             othspendingsMapper.insertSelective(othspendings);
             id = othspendings.getId();
 
@@ -143,6 +146,8 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         othspendings.setOs_status(Status.AUDITED.getDisplay());
         othspendings.setOs_statuscode(Status.AUDITED.name());
         othspendings.setCompanyId(companyId);
+        othspendings.setOs_auditdate(new Date());
+        othspendings.setOs_auditman(BaseContextHolder.getUserName());
         this.changBankUntil(othsp);
         DocBaseDTO docBaseDTO = this.insert(othsp);
         Long id = docBaseDTO.getId();
@@ -172,6 +177,7 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);
         bankinformation.setBk_income(incomme);
         bankinformation.setBk_spending(spending + bk_amount);
+        bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
 
         /**
          * ve_preamount=nvl(ve_preamount,0)+pb_preamount,
@@ -228,11 +234,13 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         othspendings.setId(Long.valueOf(id));
         othspendings.setOs_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         othspendings.setOs_statuscode(Status.UNAUDITED.name());
+        othspendings.setOs_auditman(null);
+        othspendings.setOs_auditdate(null);
         othspendingsMapper.updateByPrimaryKeySelective(othspendings);
 
         //删除中间表
         othspendings = othspendingsMapper.selectByPrimaryKey(id);
-        banksubledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他收入单");
+        banksubledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单");
         subledgerMapper.deleteByPrimaryKey(othspendings.getOs_code(), "其他支出单");
 
         //资金
@@ -255,9 +263,10 @@ public class OthspendingsServiceImpl extends CommonBaseServiceImpl<OthspendingsM
         Double beginamount = bankinformation.getBk_beginamount();
         Double spending = bankinformation.getBk_spending() == null ? new Double(0) : bankinformation.getBk_spending();
         Double incomme = bankinformation.getBk_income() == null ? new Double(0) : bankinformation.getBk_income();
-        bankinformation.setBk_thisamount(beginamount + incomme - spending - bk_amount);
+        bankinformation.setBk_thisamount(beginamount + incomme - spending + bk_amount);
         bankinformation.setBk_income(incomme);
-        bankinformation.setBk_spending(spending + bk_amount);
+        bankinformation.setBk_spending(spending - bk_amount);
+        bankinformationMapper.updateByPrimaryKeySelective(bankinformation);
 
         /**
          * ve_preamount=nvl(ve_preamount,0)+pb_preamount,

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

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -78,6 +79,8 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         }else {
             paybalance.setCompanyId(BaseContextHolder.getCompanyId());
             paybalance.setPb_recorder(BaseContextHolder.getUserName());
+            paybalance.setCreatorName(BaseContextHolder.getUserName());
+            paybalance.setCreateTime(new Date());
             paybalanceMapper.insertSelective(paybalance);
             pbId = paybalance.getId();
             baseDTO = getBaseDTOById(pbId);
@@ -188,6 +191,9 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         paybalance.setCompanyId(companyId);
         paybalance.setPb_status(Status.AUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.AUDITED.name());
+        paybalance.setPb_auditman(BaseContextHolder.getUserName());
+        paybalance.setPb_auditdate(new Date());
+        pay.setMain(paybalance);
         Subledger subledger = this.changSubledgerUntil(paybalance);
         if (subledger.getSl_code() == null){
             subledgerMapper.insertSelective(subledger);
@@ -338,6 +344,8 @@ public class PaybalanceServiceImpl extends CommonBaseServiceImpl<PaybalanceMappe
         paybalance.setId(Long.valueOf(id));
         paybalance.setPb_status(com.usoftchina.saas.commons.po.Status.UNAUDITED.getDisplay());
         paybalance.setPb_statuscode(Status.UNAUDITED.name());
+        paybalance.setPb_auditman(null);
+        paybalance.setPb_auditdate(null);
         paybalanceMapper.updateByPrimaryKeySelective(paybalance);
 
         //删除中间表

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

@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.util.Date;
 import java.util.Iterator;
 import java.util.List;
 
@@ -76,6 +77,8 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         }else {
             recbalance.setCompanyId(BaseContextHolder.getCompanyId());
             recbalance.setRb_recorder(BaseContextHolder.getUserName());
+            recbalance.setCreatorName(BaseContextHolder.getUserName());
+            recbalance.setCreateTime(new Date());
             recbalanceMapper.insertSelective(recbalance);
             rbId = recbalance.getId();
 
@@ -224,6 +227,9 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         recbalance.setCompanyId(companyId);
         recbalance.setRb_status(Status.AUDITED.getDisplay());
         recbalance.setRb_statuscode(Status.AUDITED.name());
+        recbalance.setRb_auditman(BaseContextHolder.getUserName());
+        recbalance.setRb_auditdate(new Date());
+        rec.setMain(recbalance);
         Subledger subledger = this.changSubledgerUntil(recbalance);
         if (subledger.getSl_code() == null){
             subledgerMapper.insertSelective(subledger);
@@ -363,6 +369,8 @@ public class RecbalanceServiceImpl extends CommonBaseServiceImpl<RecbalanceMappe
         recbalance.setId(id);
         recbalance.setRb_status(Status.UNAUDITED.getDisplay());
         recbalance.setRb_statuscode(Status.UNAUDITED.name());
+        recbalance.setRb_auditman(null);
+        recbalance.setRb_auditdate(null);
         recbalanceMapper.updateByPrimaryKeySelective(recbalance);
 
         //删除中间表

+ 2 - 0
applications/money/money-server/src/main/resources/mapper/FundtransferMapper.xml

@@ -225,6 +225,8 @@
       <if test="ft_text5 != null" >
         ft_text5 = #{ft_text5,jdbcType=VARCHAR},
       </if>
+        ft_auditman = #{ft_auditman,jdbcType=VARCHAR},
+        ft_auditdate = #{ft_auditdate,jdbcType=TIMESTAMP}
     </set>
     where ft_id = #{id,jdbcType=INTEGER}
   </update>

+ 2 - 0
applications/money/money-server/src/main/resources/mapper/OthreceiptsMapper.xml

@@ -300,6 +300,8 @@
       <if test="or_text5 != null" >
         or_text5 = #{or_text5,jdbcType=VARCHAR},
       </if>
+      or_auditman = #{or_auditman,jdbcType=VARCHAR},
+      or_auditdate = #{or_auditdate,jdbcType=TIMESTAMP}
     </set>
     where or_id = #{id,jdbcType=INTEGER}
   </update>

+ 2 - 0
applications/money/money-server/src/main/resources/mapper/OthspendingsMapper.xml

@@ -295,6 +295,8 @@
       <if test="os_text5 != null" >
         os_text5 = #{os_text5,jdbcType=VARCHAR},
       </if>
+      os_auditman = #{os_auditman,jdbcType=VARCHAR},
+      os_auditdate = #{os_auditdate,jdbcType=TIMESTAMP}
     </set>
     where os_id = #{id,jdbcType=INTEGER}
   </update>

+ 6 - 0
applications/money/money-server/src/main/resources/mapper/PaybalanceMapper.xml

@@ -414,6 +414,12 @@
       <if test="pb_text5 != null">
         pb_text5 = #{pb_text5,jdbcType=VARCHAR},
       </if>
+      <if test="pb_auditman !=null">
+        pb_auditman = #{pb_auditman,jdbcType=VARCHAR},
+      </if>
+      <if test="pb_auditdate !=null">
+        pb_auditdate = #{pb_auditdate,jdbcType=TIMESTAMP}
+      </if>
     </set>
     where pb_id = #{id,jdbcType=INTEGER}
   </update>

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/PaybalancedetMapper.xml

@@ -32,7 +32,7 @@
     select 
     <include refid="Base_Column_List" />
     from paybalancedet
-    where pd_pbid = #{id,jdbcType=INTEGER} order by pd_id desc
+    where pd_pbid = #{id,jdbcType=INTEGER} order by pd_detno asc
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer" >
     delete from paybalancedet

+ 6 - 0
applications/money/money-server/src/main/resources/mapper/RecbalanceMapper.xml

@@ -581,6 +581,12 @@
       <if test="rb_text5 != null">
         rb_text5 = #{rb_text5,jdbcType=VARCHAR},
       </if>
+      <if test="rb_auditman !=null">
+        rb_auditman = #{rb_auditman,jdbcType=VARCHAR},
+      </if>
+    <if test="rb_auditdate !=null">
+      rb_auditdate = #{rb_auditdate,jdbcType=TIMESTAMP}
+    </if>
     </set>
     where rb_id = #{id,jdbcType=INTEGER}
   </update>

+ 1 - 1
applications/money/money-server/src/main/resources/mapper/RecbalancedetMapper.xml

@@ -90,7 +90,7 @@
     select 
     <include refid="Base_Column_List" />
     from recbalancedet
-    where rd_rbid = #{id,jdbcType=INTEGER} order by rd_id desc
+    where rd_rbid = #{id,jdbcType=INTEGER} order by rd_detno asc
   </select>
   <delete id="deleteItem" parameterType="java.lang.Integer">
     delete from recbalancedet

+ 4 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java

@@ -32,4 +32,8 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer checkTurnInstatus(Long id);
 
     void updateCreator(@Param("userId") Long userId,@Param("userName") String userName,@Param("id") Long pu_id);
+
+    Integer validateVendor(@Param("id") Long id);
+
+    Integer validateProduct(@Param("id") Long id);
 }

+ 11 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -499,6 +499,17 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     public Result singleAudit(Long id) {
         DocBaseDTO docBaseDTO = getBaseDTOById(id);
         Result result = Result.success(docBaseDTO);
+        //检查供应商是否开启状态
+        Integer count =0;
+        count = purchaseMapper.validateVendor(id);
+        if (count != 0) {
+            throw new BizException(BizExceptionCode.VENDOR_ISCLOSE);
+        }
+        //检查物料是否开启状态
+        count = purchaseMapper.validateProduct(id);
+        if (count != 0) {
+            throw new BizException(BizExceptionCode.PRODUCT_ISCLOSE);
+        }
         //检查最小包装数
         result.setMessage(purchasedetailMapper.checkzxbzs(id));
         commonService.commonAudit("purchase", "pu_id=" + id, "pu_status",

+ 9 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -436,5 +436,14 @@
     update purchase set creatorId = #{userId} , creatorName=#{userName} where pu_id=#{id}
   </update>
 
+  <select id="validateVendor" resultType="int" >
+    select count(1) from vendor where ve_id = (select pu_vendid from purchase where pu_id=#{id}) and ve_statuscode='CLOSE';
+  </select>
+
+  <select id="validateProduct" resultType="int" >
+    select count(1) from purchasedetail left join product on PD_PRODID=pr_id where  pd_puid=#{id} and pr_statuscode='CLOSE';
+  </select>
+
+
 
 </mapper>

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

@@ -21,7 +21,7 @@ import com.usoftchina.saas.exception.BizException;
 import com.usoftchina.saas.exception.ExceptionCode;
 import com.usoftchina.saas.page.PageDefault;
 import com.usoftchina.saas.page.PageRequest;
-import com.usoftchina.saas.server.error.ServletErrorUtils;
+import com.usoftchina.saas.server.web.ServletUtils;
 import com.usoftchina.saas.socket.api.SocketMessageApi;
 import com.usoftchina.saas.utils.BeanMapper;
 import com.usoftchina.saas.utils.CollectionUtils;
@@ -136,7 +136,7 @@ public class AuthController {
                     accountDTO = createAccountByCookieInfo(info);
                 } else {
                     logger.error(result.getMessage());
-                    ServletErrorUtils.writeJsonPMessage(response, callback, false);
+                    ServletUtils.writeJsonPMessage(response, callback, false);
                     return;
                 }
             } else {
@@ -147,7 +147,7 @@ public class AuthController {
                     Result updateResult = accountApi.update(BeanMapper.map(accountDTO, AccountUpdateDTO.class));
                     if (!updateResult.isSuccess()) {
                         logger.error(updateResult.getMessage());
-                        ServletErrorUtils.writeJsonPMessage(response, callback, false);
+                        ServletUtils.writeJsonPMessage(response, callback, false);
                         return;
                     }
                 }
@@ -170,7 +170,7 @@ public class AuthController {
                 socketMessageApi.sendToClient(clientId, "/sso/callback",
                         JsonUtils.toJsonString(new AuthDTO(tokenDTO, accountDTO)));
             }
-            ServletErrorUtils.writeJsonPMessage(response, callback, true);
+            ServletUtils.writeJsonPMessage(response, callback, true);
         }
     }
 

+ 5 - 0
framework/core/src/main/java/com/usoftchina/saas/utils/RegexpUtils.java

@@ -56,6 +56,11 @@ public class RegexpUtils {
         return m.matches();
     }
 
+    /**
+     * 特殊字符替换
+     * @param str
+     * @return
+     */
     public static String replaceSpecCharacter(String str){
         Pattern p = Pattern.compile(SPECCHARACTER_EXP);
         Matcher m = p.matcher(str);

+ 0 - 28
framework/server-starter/src/main/java/com/usoftchina/saas/server/error/ServletErrorUtils.java

@@ -50,32 +50,4 @@ public class ServletErrorUtils {
         writer.flush();
     }
 
-    public static void writeMessage(HttpServletResponse response, String text) throws IOException {
-        response.setContentType(MediaType.TEXT_HTML_VALUE);
-        response.setCharacterEncoding("UTF-8");
-        PrintWriter writer = response.getWriter();
-        writer.print(text);
-        writer.flush();
-    }
-
-    /**
-     * 输出jsonp
-     *
-     * @param response
-     * @param callbackFn
-     * @param success
-     * @throws IOException
-     */
-    public static void writeJsonPMessage(HttpServletResponse response, String callbackFn, boolean success) throws IOException {
-        response.setContentType(MediaType.TEXT_HTML_VALUE);
-        response.setCharacterEncoding("UTF-8");
-        PrintWriter writer = response.getWriter();
-        writer.print(buildJsonPMessage(callbackFn, success));
-        writer.flush();
-    }
-
-    public static String buildJsonPMessage(String callbackFn, boolean success) {
-        return String.format("%s({success:\"%s\"})", callbackFn, success ? 1 : 0);
-    }
-
 }

+ 41 - 0
framework/server-starter/src/main/java/com/usoftchina/saas/server/web/ServletUtils.java

@@ -0,0 +1,41 @@
+package com.usoftchina.saas.server.web;
+
+import org.springframework.http.MediaType;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * @author yingp
+ * @date 2018/11/19
+ */
+public class ServletUtils {
+    public static void writeMessage(HttpServletResponse response, String text) throws IOException {
+        response.setContentType(MediaType.TEXT_HTML_VALUE);
+        response.setCharacterEncoding("UTF-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(text);
+        writer.flush();
+    }
+
+    /**
+     * 输出jsonp
+     *
+     * @param response
+     * @param callbackFn
+     * @param success
+     * @throws IOException
+     */
+    public static void writeJsonPMessage(HttpServletResponse response, String callbackFn, boolean success) throws IOException {
+        response.setContentType(MediaType.TEXT_HTML_VALUE);
+        response.setCharacterEncoding("UTF-8");
+        PrintWriter writer = response.getWriter();
+        writer.print(buildJsonPMessage(callbackFn, success));
+        writer.flush();
+    }
+
+    public static String buildJsonPMessage(String callbackFn, boolean success) {
+        return String.format("%s({success:\"%s\"})", callbackFn, success ? 1 : 0);
+    }
+}

+ 14 - 1
frontend/saas-portal-web/config/env.js

@@ -1,16 +1,29 @@
 if (process.env.NODE_ENV == 'production') {
     window.env = {
         profile: 'production',
+        frontend: {
+            // 前端地址
+            baseUrl: 'http://192.168.0.181'
+        },
         server: {
+            // 后端接口网关
             baseUrl: 'http://192.168.0.181:8560',
+            // 账户中心接口
             ssoUrl: 'http://192.168.253.12:32323'
         }
     }
 } else {
     window.env = {
         profile: 'development',
+        frontend: {
+            // 前端地址
+            baseUrl: 'http://192.168.0.181'
+            // baseUrl: 'http://127.0.0.1:1841'
+        },
         server: {
-            baseUrl: 'http://192.168.0.174:8560',
+            // 后端接口网关
+            baseUrl: 'http://192.168.0.181:8560',
+            // 账户中心接口
             ssoUrl: 'http://192.168.253.12:32323'
         }
     }

+ 59 - 4
frontend/saas-portal-web/src/js/main.js

@@ -103,6 +103,33 @@ $(document).ready(function(){
             }
         };
     })();
+    var Session = (function(){
+        var key = 'session';
+        return {
+            load: function() {
+                return Store.get(key);
+            },
+            loadData: function(data) {
+                data.span = data.timestamp - new Date().getTime();
+                Store.set(key, data);
+            },
+            isValid: function() {
+                var token = this.load();
+                return token && token.timestamp + token.expire * 1000 > new Date().getTime() + token.span;
+            },
+            get: function(prop) {
+                var token = this.load();
+                return token ? token[prop] : null;
+            },
+            set: function(prop, value) {
+                var token = this.load();
+                if (token) {
+                    token[prop] = value;
+                    Store.set(key, token);
+                }
+            }
+        }
+    })();
     var setUserProfile = function(account) {
         if (account) {
             $(".login").css("display","none");
@@ -115,17 +142,38 @@ $(document).ready(function(){
         }
     };
     // 已经登录过从Store取出信息
-    setUserProfile(Store.get('account'));
+    setUserProfile(Session.get('account'));
     // socket
     var listenOnCallback = function(clientId, resolve) {
         var socket = new SockJS(env.server.baseUrl + "/ws");
         stompClient = Stomp.over(socket);
         stompClient.connect({}, function(frame) {
             stompClient.subscribe('/clients/' + clientId + '/sso/callback', function(message){
-                resolve(JSON.parse(message.body));
+                stompClient.disconnect(function(){
+                    resolve(JSON.parse(message.body));
+                });
             });
         });
     };
+    // 系统页面token
+    var Frontend = (function(){
+        var frame;
+        return {
+            init: function() {
+                $('body').append('<iframe id="frontend" hidden src="' + 
+                    env.frontend.baseUrl + '/set-token.html"></iframe>');
+                frame = window.frames[window.frames.length - 1];
+            },
+            set: function(session, callback) {
+                window.addEventListener('message', callback, false);
+                frame.postMessage(JSON.stringify(session), '*');
+            },
+            redirect: function() {
+                window.location.href = env.frontend.baseUrl;
+            }
+        };
+    })();
+    Frontend.init();
     // 关闭弹窗X
     $(".tc-on").click(function(){
         $('#box-zc').css('display','none');
@@ -142,11 +190,18 @@ $(document).ready(function(){
                 encodeURIComponent(env.server.baseUrl + '/api/auth/sso/callback/' + clientId));
             $('#box').show();
             listenOnCallback(clientId, function(data){
-                var account = data.account;
-                Store.set('account', account);
+                var session = data.token, account = data.account;
+                account.companies = account.companies || [];
+                session.account = account;
+                Session.loadData(session);
                 setUserProfile(account);
                 $('#box').hide();
                 $(".zhezhao").css("display","none");
+                // 系统页面token设置
+                Frontend.set(session, function(){
+                    // TODO
+                    Frontend.redirect();
+                });
             });
         } else {
             $('#box').hide();

+ 2 - 1
frontend/saas-web/Dockerfile

@@ -2,4 +2,5 @@ FROM hub.c.163.com/library/nginx
 MAINTAINER USOFTCHINA <yingp@usoftchina.com>
 RUN rm /etc/nginx/conf.d/default.conf
 ADD runtime/nginx/default.conf /etc/nginx/conf.d/
-COPY build/production/saas/ /usr/share/nginx/html/
+COPY build/production/saas/ /usr/share/nginx/html/
+COPY set-token.html /usr/share/nginx/html/

+ 1 - 1
frontend/saas-web/app.json

@@ -296,7 +296,7 @@
         },*/
         "compressor":null,
         "server": {
-            "basePath": "http://192.168.253.181:8560",
+            "basePath": "http://192.168.0.181:8560",
             "urlPattern": "^\/api\/"
         }
     },

+ 8 - 6
frontend/saas-web/app/view/core/dbfind/DbfindGridPanel.js

@@ -36,7 +36,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                             condition = [];
                         }
                         //添加默认条件
-                        if(me.ownerCt.trigger.defaultCondition) {
+                        if(me.up('window').trigger.defaultCondition) {
                             condition.push({
                                 type: 'condition',
                                 value: me.ownerCt.trigger.defaultCondition
@@ -71,11 +71,7 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
                     },'->',{
                         xtype:'button',
                         text:'新增',
-                        handler:function(b){
-                            var grid = me;
-                            var trigger = grid.ownerCt.trigger;
-                            saas.util.BaseUtil.openTab(trigger.addXtype, '新增'+trigger.addTitle,trigger.addXtype + '_add');
-                        }
+                        handler: me.onAddClick.bind(me)
                     }])
                 },{
                     xtype: 'pagingtoolbar',
@@ -267,5 +263,11 @@ Ext.define('saas.view.core.dbfind.DbfindGridPanel', {
         }
 
         return conditionValue;
+    },
+
+    onAddClick: function(){
+        var grid = this;
+        var trigger = grid.ownerCt.trigger;
+        saas.util.BaseUtil.openTab(trigger.addXtype, '新增'+trigger.addTitle,trigger.addXtype + '_add');
     }
 });

+ 17 - 9
frontend/saas-web/app/view/core/dbfind/DbfindTrigger.js

@@ -122,6 +122,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
     	}
     },
     onTriggerClick:function(f){
+        var me = this;
         this.fireEvent('beforetriggerclick', this);
         f.blur(f);
         //判断dbfindtrigger归属
@@ -135,6 +136,21 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
         var box = panelEl.getBox();
         var height = box.height;
         var width = box.width;
+
+        var dbItem = {
+            xtype:'dbfindgridpanel',
+            columns: f.dbColumns,
+            dataUrl: f.dataUrl,
+            dbfinds: f.dbfinds,
+            belong: f.belong,
+            dbSearchFields:f.dbSearchFields?f.dbSearchFields:[],
+            dbfindtrigger:f,
+        };
+
+        if(me.onAddClick) {
+            dbItem.onAddClick = me.onAddClick;
+        }
+
         var win = panel.add(Ext.create('Ext.window.Window', {   
             trigger:f,
             belong:f.ownerCt,  
@@ -148,15 +164,7 @@ Ext.define('saas.view.core.dbfind.DbfindTrigger', {
             closable: true,
             layout:'fit',
             renderTo:panel.getEl(),
-            items:[{
-                xtype:'dbfindgridpanel',
-                columns: f.dbColumns,
-                dataUrl: f.dataUrl,
-                dbfinds: f.dbfinds,
-                belong: f.belong,
-                dbSearchFields:f.dbSearchFields?f.dbSearchFields:[],
-                dbfindtrigger:f
-            }]
+            items:[dbItem]
         }));
         win.show();
     },

+ 0 - 89
frontend/saas-web/app/view/core/dbfind/types/CustomerDbfindTrigger.js~2496f4a5e0d652d0a04afaa39f7ce066459fbea1

@@ -1,89 +0,0 @@
-/**
- * 客户资料放大镜
- */
-Ext.define('saas.view.core.dbfind.types.CustomerDbfindTrigger', {
-    extend: 'saas.view.core.dbfind.DbfindTrigger',
-    xtype: 'customerDbfindTrigger',
-
-    dataUrl: '/api/document/customer/dbfind',
-    addXtype: 'document-customer-formpanel',
-    addTitle: '客户资料',
-    defaultCondition: "cu_statuscode='OPEN'",
-    
-    dbtpls: [{
-        field: 'cu_code',
-        width: 100
-    }, {
-        field: 'cu_name',
-        width: 100
-    }],
-    dbSearchFields: [{
-        emptyText: '输入客户编号或客户名称',
-        xtype: "textfield",
-        name: "search",
-        getCondition: function (v) {
-            return "(upper(cu_code) like '%" + v.toUpperCase() + "%' or upper(cu_name) like '%" + v.toUpperCase() + "%')";
-        },
-        allowBlank: true,
-        columnWidth: 0.25
-    }],
-    dbColumns: [{
-        conditionCode: 'id',
-        text: "客户ID",
-        dataIndex: "id",
-        width: 0,
-        xtype: "",
-    }, {
-        conditionCode: 'cu_code',
-        text: "客户编号",
-        dataIndex: "cu_code",
-        width: 150,
-        xtype: "",
-    }, {
-        conditionCode: 'cu_name',
-        text: "客户名称",
-        dataIndex: "cu_name",
-        width: 180,
-        xtype: "",
-    }, {
-        conditionCode: 'cu_type',
-        text: "客户类型",
-        dataIndex: "cu_type",
-        width: 150,
-        xtype: "",
-    }, {
-        text: "业务员编号",
-        dataIndex: "cu_sellercode",
-        width:150
-    }, {
-        text: "业务员",
-        dataIndex: "cu_sellername",
-        width:180
-    }, {
-        text: "税率",
-        dataIndex: "cu_taxrate",
-        xtype: 'numbercolumn',
-        width:80,
-        renderer: function (v) {
-            return Ext.util.Format.number(v, '0');
-        }
-    }, {
-        text: "承付天数",
-        dataIndex: "cu_promisedays",
-        width:100,
-        xtype: 'numbercolumn',
-        renderer: function (v) {
-            return Ext.util.Format.number(v, '0');
-        }
-    }, {
-        text: "额度",
-        dataIndex: "cu_credit",
-        width:100,
-        xtype: 'numbercolumn',
-    }, {
-        text: "客户地址",
-        dataIndex: "ca_address",
-        width: 250
-    }]
-
-});

+ 0 - 110
frontend/saas-web/app/view/core/dbfind/types/ProductDbfindTrigger.js~2496f4a5e0d652d0a04afaa39f7ce066459fbea1

@@ -1,110 +0,0 @@
-/**
- * 物料资料放大镜(单选)
- */
-Ext.define('saas.view.core.dbfind.types.ProductDbfindTrigger', {
-    extend: 'saas.view.core.dbfind.DbfindTrigger',
-    xtype: 'productDbfindTrigger',
-
-    dataUrl:'/api/document/product/list',
-    addXtype: 'document-product-formpanel',
-    addTitle: '物料资料',
-    dbtpls:[{
-        field:'pr_code',width:100
-    },{
-        field:'pr_detail',width:100
-    }],
-    defaultCondition: "pr_statuscode='OPEN'",
-    dbSearchFields:[{
-        emptyText:'输入物料编号、名称或规格',
-        xtype : "textfield", 
-        name : "search", 
-        width: 200,
-        getCondition: function(v) {
-            return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
-        },
-        allowBlank : true, 
-        columnWidth : 0.25
-    }],
-    dbColumns:[{
-        text: "物料ID",
-        hidden: true,
-        dataIndex: "id",
-    }, {
-        text: "物料编号",       
-        dataIndex: "pr_code",
-        width: 200,
-    }, {
-        text: "物料名称",
-        width: 200,
-        dataIndex: "pr_detail",
-    }, {
-        text: "规格",
-        dataIndex: "pr_spec",
-        width: 100,
-    }, {
-        text: "单位",
-        dataIndex: "pr_spec",
-        width: 100,
-    },{
-        text: "仓库id",
-        dataIndex: "pr_whid",
-        hidden: true,
-    },{
-        text: "仓库编号",
-        dataIndex: "pr_whcode",
-        hidden: true,
-    },{
-        text: "仓库",
-        dataIndex: "pr_whname",
-        width: 200,
-        hidden: true
-    },{
-        text: "总库存数",
-        dataIndex: "po_onhand",
-        width: 100,
-        xtype: 'numbercolumn',
-        renderer : function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join();
-            return Ext.util.Format.number(v, format);
-        },                            
-        align:'end'
-    },{
-        text: "类型",
-        dataIndex: "pr_kind",
-        width: 100,
-    },{
-        text: "型号",
-        dataIndex: "pr_orispeccode",
-        width: 100,
-    },{
-        text: "品牌",
-        dataIndex: "pr_brand",
-        width: 100,
-    },{
-        text: "供应商",
-        dataIndex: "pr_vendname",
-        width: 100,
-    },{
-        text: "最小包装",
-        dataIndex: "pr_zxbzs",
-        width: 100,
-        xtype: 'numbercolumn',
-        align: 'end',
-        renderer : function(v) {
-            if(!v) {
-                return 0;
-            }
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join();
-            return Ext.util.Format.number(v, format);
-        }
-    },{
-        text: "L/T",
-        dataIndex: "pr_leadtime",
-        width: 100,
-    }]
-
-});

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

@@ -73,15 +73,15 @@ Ext.define('saas.view.core.dbfind.types.VendorDbfindTrigger', {
         }
     }, {
         text: "纳税人识别号",
-        dataIndex: "ve_bankaccount",
+        dataIndex: "ve_nsrzh",
         width: 150
     }, {
         text: "开户银行",
-        dataIndex: "ve_bankaccount",
+        dataIndex: "ve_bankcode",
         width: 150
     }, {
         text: "银行账户",
-        dataIndex: "ve_bankcode",
+        dataIndex: "ve_bankaccount",
         width: 200
     }]
 

+ 79 - 1
frontend/saas-web/app/view/core/dbfind/types/WarehouseDbfindTrigger.js

@@ -49,6 +49,84 @@ Ext.define('saas.view.core.dbfind.types.WarehouseDbfindTrigger', {
         flex: 1,
         dataIndex: "wh_type",
         xtype: "",
-    }]
+    }],
+
+    onAddClick: function() {
+        var me=this;
+        var tab = saas.util.BaseUtil.getCurrentTab();
+        // this.isEdit = !!record;
+        this.dialog = tab.add({
+            autoScroll:true,
+            xtype: 'document-kind-childwin',
+            bind: {
+                title: '新增仓库资料'
+            },
+            dataKind: 'warehouse',
+            belong: {
+                columns: [{
+                    text: '编号',
+                    dataIndex: 'wh_code',
+                    width: 200
+                },{
+                    text: '仓库名称',
+                    dataIndex: 'wh_description',
+                    width: 200
+                },{
+                    text: '类型',
+                    dataIndex: 'wh_type',
+                    width: 200
+                },{  
+                    text: '仓库状态码',
+                    dataIndex: 'wh_status',
+                    hidden:true,
+                },{
+                    text: '仓库状态',
+                    dataIndex: 'wh_statuscode',
+                    width:90,
+                    xtype: 'actioncolumn',
+                    align : 'center',
+                    items: [{
+                        iconCls:'',
+                        getClass: function(v, meta, rec) {
+                            if(rec.get('wh_statuscode')=='OPEN'){
+                                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('wh_statuscode')=='OPEN'?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.showToast('操作成功');
+                                    grid.store.load();
+                                }
+                            })
+                            .catch(function(res) {
+                                console.error(res);
+                                saas.util.BaseUtil.showToast('操作失败: ' + res.message);
+                            });
+                        }
+                    }]
+                }],
+                keyField:'id',
+                reqUrl: '/api/document/warehouse/save',
+                delUrl: '/api/document/warehouse/delete'
+            },
+            // _parent:this.getView(),
+            // record:record,
+            session: true
+        });
+        this.dialog.show();
+    }
 
 });

+ 15 - 2
frontend/saas-web/app/view/core/query/QueryFormPanel.js

@@ -15,7 +15,7 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
         labelAlign: 'right',
         labelWidth: 90,
         columnWidth: 0.25,
-        blankText: '该字段不能为空'
+        blankText: '该字段不能为空',
 	},
 
     dockedItems: [{
@@ -30,6 +30,19 @@ Ext.define('saas.view.core.query.QueryFormPanel', {
             text: '查询',
             handler: 'onQuery'
         },'->']
-    }]
+    }],
+
+    listeners: {
+        beforerender: function(form) {
+            var fiels = form.getForm().getFields();
+            fiels.each(function(f) {
+                f.on && f.on({
+                    keydown: {
+                        fn: 'onQuery',
+                    }
+                });
+            });
+        }
+    }
 
 });

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

@@ -13,7 +13,7 @@ Ext.define('saas.view.core.query.QueryPanelController', {
         });
         this.queryWin.show();
     },
-    onQuery: function (btn) {
+    onQuery: function () {
         var me = this,
         queryPanel = me.getView(),
         viewModel = me.getViewModel(),

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

@@ -416,8 +416,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
         .then(function(localJson) {
             me.setLoading(false);
             if(localJson.success){
-                saas.util.BaseUtil.showToast('保存成功');
-                var grid = form.ownerCt._parent.lookup('document-kind-Grid');
+                var grid = form.ownerCt._parent ? form.ownerCt._parent.lookup('document-kind-Grid') : null;
                 if(grid){
                     grid.store.load();
                 }
@@ -426,6 +425,7 @@ Ext.define('KitchenSink.view.binding.ChildForm', {
                         typeof combo.setValue == 'function' && combo.setValue(params._value);
                     });
                 }
+                saas.util.BaseUtil.showToast('保存成功');
                 form.ownerCt.close();
             }
         })

+ 3 - 1
frontend/saas-web/app/view/document/product/FormPanel.js

@@ -201,7 +201,9 @@ Ext.define('saas.view.document.product.FormPanel', {
     }, {
         xtype: 'numberfield',
         fieldLabel: 'L/T',
-        name: 'pr_leadtime'
+        name: 'pr_leadtime',
+        minValue: 0,
+        maxLength: 10
     }, {
         xtype: 'checkbox',
         fieldLabel: '期初设置',

+ 1 - 1
frontend/saas-web/app/view/money/othspendings/FormPanel.js

@@ -97,7 +97,7 @@ Ext.define('saas.view.money.othspendings.FormPanel', {
                         this.dialog = form.getController().getView().add({
                             xtype: 'document-kind-childwin',
                             bind: {
-                                title: '新增收入类别'
+                                title: '新增支出类别'
                             },
                             dataKind:'inoutkind',
                             belong:document.etc['inoutkind'],

+ 2 - 0
frontend/saas-web/app/view/stock/make/QueryPanel.js

@@ -26,12 +26,14 @@ Ext.define('saas.view.stock.make.QueryPanel', {
         allowBlank: true,
         editable:false,
         columnWidth: 0.25,
+        emptyText :'全部',
         queryMode: 'local',
         displayField: 'name',
         valueField: 'value',
         store: Ext.create('Ext.data.ArrayStore', {
             fields: ['name', 'value'],
             data: [
+                ["全部", "ALL"],
                 ["组装", "组装"],
                 ["拆件", "拆件"]
             ]

+ 10 - 0
frontend/saas-web/set-token.html

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