Browse Source

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

guq 7 years ago
parent
commit
5681787330

+ 1 - 0
README.md

@@ -160,6 +160,7 @@
 | --------   | :----:  | :----: | :------:  | :------:  |
 | 10.10.100.103 |  centos  | mykey.key |  CentOS6, RabbitMQ  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.123 |  centos  | mykey.key |  CentOS6, MongoDB  | Cpu: 8, Mem: 8G, Disk: 60G |
+| 10.10.100.127 |  centos  | mykey.key |  CentOS6, Nginx  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.160 |  centos  | mykey.key |  CentOS6, ELK  | Cpu: 8, Mem: 8G, Disk: 60G |
 | 10.10.100.173 |  centos  | mykey.key |  CentOS6, Redis  | Cpu: 4, Mem: 8G, Disk: 35G |
 | 10.10.100.23 |  root  | 62cddbcc624b1b072d84117cc0e5a4db |  CentOS7, Docker  | Cpu: 40, Mem: 128G, Disk: 800G |

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

@@ -86,7 +86,7 @@ public enum BizExceptionCode implements BaseExceptionCode {
     BANK_AMOUNT_NOTENOUGH(74004, "资金账号不足"),
     SUBLEDGER_NOT_EXIS(74005,"来源单据不存在"),
     CHECK_SETACOUNT_EXIS(74006, "不能删除单据日期小于等于结账期间<u>%s</u>的单据"),
-    VERIFICATION_CHECK_BALANCE(74007,"保存失败,本次核销金额不相等!"),
+    VERIFICATION_CHECK_BALANCE(74007,"本次核销金额不相等!"),
     DELETE_NOT_EXIS(74008,"删除失败,当前单据不存在!"),
     DOCUMENTS_AUDITED(74009,"存在已审核单据:%S"),
     DOCUMENTS_UNAUDITED(74009,"存在未审核单据:%S"),

+ 1 - 1
applications/storage/storage-server/src/main/resources/mapper/StockTakingMapper.xml

@@ -263,7 +263,7 @@
 
   <select id="checkUnPostStockProfit" resultType="int">
     select
-    count(*)
+    count(a.st_prodid)
     from
     (select pd_prodid,pd_whid from prodiodetail left join prodinout on pd_piid = pi_id
     where prodinout.companyId=#{companyId,jdbcType=INTEGER} and (pi_remark='盘盈单' or pi_remark='盘亏单')) b

+ 5 - 0
base-servers/auth/auth-common/pom.xml

@@ -44,6 +44,11 @@
             <scope>compile</scope>
             <optional>true</optional>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 17 - 0
base-servers/auth/auth-common/src/test/java/com/usoftchina/saas/auth/common/jwt/JwtHelperTest.java

@@ -0,0 +1,17 @@
+package com.usoftchina.saas.auth.common.jwt;
+
+import static org.junit.Assert.*;
+
+public class JwtHelperTest {
+    @org.junit.Test
+    public void generateToken() throws Exception {
+    }
+
+    @org.junit.Test
+    public void getInfoFromToken() throws Exception {
+        String token = "eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJzdWx5IiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjQzLCJjb21wYW55SWQiOjEsInVzZXJOYW1lIjoic3VseSIsInJlYWxOYW1lIjoi6IuP54G16LCjIiwiZXhwIjoxNTQzNDExNzY0fQ.KMZV5H4tH4ifYBmY7rV4HSsW1fZHU2k-Yl47b9C3bt6S1_BqzTO-RbVDNMR-WXHpHFwXiq0aoHbqaA512z_-icLPcmeCb2TmnERisgjhnqn7OYordtAWahNlZfiaExnnttLvcNHQSiOWK9vYxxHnf2gC34XdKI0Bo8QZRSR3eo8";
+        String keyPath = "pub.key";
+        JwtInfo info = JwtHelper.getInfoFromToken(token, keyPath);
+    }
+
+}

BIN
base-servers/auth/auth-common/src/test/resources/pub.key


+ 8 - 0
base-servers/zipkin-server/src/main/resources/config/application-docker-prod.yml

@@ -9,5 +9,13 @@ zipkin:
   collector:
     rabbitmq:
       uri: amqp://saas:select123***@10.10.100.103:5672/docker
+  storage:
+    type: elasticsearch
+    elasticsearch:
+      hosts: 10.10.100.160:9200
+      index: zipkin
+      index-shards: 5
+      index-replicas: 1
+      max-requests: 64
 logging:
   destination: 10.10.100.160:5000

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

@@ -300,6 +300,7 @@ Ext.define('saas.view.core.base.GridPanel', {
                 width:70,
                 dataIndex:'actioncolumn',
                 text:'操作',
+                align: 'center',
                 items: [{
                     tooltip: '编辑',
                     iconCls: 'x-fa fa-pencil fa-fw',

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

@@ -438,7 +438,7 @@ Ext.define('saas.view.core.form.FormPanel', {
     isValid: function() {
         var me = this;
         var viewModel = me.getViewModel();
-        var formItems = me.formItems;
+        var formItems = me.formItems || [];
         var valid = !Ext.Array.findBy(formItems, function(f) {
             return !f.isValid();
         });

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

@@ -166,7 +166,7 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
             dockedItems: [{
                 xtype: 'toolbar',
                 dock: 'top',
-                hidden: !me.showtool,
+                hidden: me.simpleMode,
                 defaults: { // defaults 将会应用所有的子组件上,而不是父容器
                     listeners: {
                         'mouseover':function(){
@@ -270,6 +270,11 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         me.callParent(arguments);
     },
     listeners: {
+        afterrender: function(grid) {
+            if(grid.simpleMode) {
+                grid.headerCt.child('gridcolumn[isCheckerHd]').hide();
+            }
+        },
         boxready: function(grid, width, height, eOpts) {
             var store = grid.getStore(),
             gridBodyBox = grid.body.dom.getBoundingClientRect(),

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

@@ -129,7 +129,7 @@ Ext.define('saas.view.core.query.QueryPanel', {
         }
 
         me.queryGridConfig['columns']=columns;
-        me.queryGridConfig['showtool'] = !me.simpleMode;
+        me.queryGridConfig['simpleMode'] = me.simpleMode;
         Ext.apply(queryGrid,me.queryGridConfig);
     },
 

+ 81 - 43
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -218,24 +218,28 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     type: 'json',
                     // rootProperty: 'data.list',
                     rootProperty: function(data) {
-                        var grid = me.items.items[1],
-                        columns = grid.columns,
-                        summaryData = data.data.calculate || [];
-
-                        Ext.Array.each(columns, function(c) {
-                            var type = c.summaryType,
-                            name = c.dataIndex;
-
-                            var d = Ext.Array.findBy(summaryData, function(s) {
-                                return s.hasOwnProperty(name);
-                            })
-                            if(type && d) {
-                                c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
-                            }else {
-                                c.summaryValue = 0;
-                            }
-                        });
-                        return data.data.list.list;
+                        try {
+                            var grid = me.items.items[1],
+                            columns = grid.columns,
+                            summaryData = data.data.calculate || [];
+    
+                            Ext.Array.each(columns, function(c) {
+                                var type = c.summaryType,
+                                name = c.dataIndex;
+    
+                                var d = Ext.Array.findBy(summaryData, function(s) {
+                                    return s.hasOwnProperty(name);
+                                })
+                                if(type && d) {
+                                    c.summaryValue = Ext.util.Format.number(d[name], c.format || '0.00');
+                                }else {
+                                    c.summaryValue = 0;
+                                }
+                            });
+                            return data.data.list.list;
+                        }catch(e) {
+                            saas.util.BaseUtil.showErrorToast(e.message);
+                        }
                     },
                     totalProperty: 'data.list.total',
                 },
@@ -390,6 +394,22 @@ Ext.define('saas.view.core.report.ReportPanel', {
             if(defaultValue) {
                 viewModel.set('form.' + bind, defaultValue);
             }
+
+            item.enableKeyEvents = true;
+            item.listeners = item.listeners || {};
+            Ext.applyIf(item.listeners, {
+                keydown: {
+                    fn: function(th, e, eOpts) {
+                        if(e.keyCode == 13) {
+                            if(!th.fireEvent('beforequery', th)) {
+                                return;
+                            }else {
+                                me.getController().onQuery()
+                            }
+                        }
+                    }
+                }
+            });
         });
 
         return items;
@@ -397,7 +417,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     getConditions: function() {
         var me = this,
-        formItems = me.searchItems,
+        form = me.down('form'),
+        formItems = form.items.items,
         viewModel = me.getViewModel(),
         viewModelData = viewModel.getData(),
         bindItems = viewModelData['form'],
@@ -419,10 +440,10 @@ Ext.define('saas.view.core.report.ReportPanel', {
                     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);
+                // var xtype = item.xtype || 'textfield',
+                type = item.fieldType || me.getDefaultFieldType(item),
+                operation = item.operation || me.getDefaultFieldOperation(item),
+                conditionValue = me.getConditionValue(item, value);
     
                 if(!conditionValue) {
                     continue;
@@ -440,14 +461,16 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return conditions;
     },
 
-    getDefaultFieldType: function(xtype) {
-        var type;
+    getDefaultFieldType: function(field) {
+        var me = this,
+        xtypes = field.getXTypes().split('/'),
+        type;
 
-        if(Ext.Array.contains(['numberfield'], xtype)) {
+        if(me.isContainsAny(xtypes, ['numberfield'])) {
             type = 'number';
-        }else if(Ext.Array.contains(['datefield', 'condatefield'], xtype)) {
+        }else if(me.isContainsAny(xtypes, ['datefield', 'condatefield'])) {
             type = 'date';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo', 'radiofield', 'radio'], xtype)) {
+        }else if(me.isContainsAny(xtypes, ['combobox', 'multicombo', 'combo', 'radiofield', 'radio'])) {
             type = 'enum';
         }else {
             type = 'string';
@@ -456,16 +479,29 @@ Ext.define('saas.view.core.report.ReportPanel', {
         return type;
     },
 
-    getDefaultFieldOperation: function(xtype) {
-        var operation;
+    /**
+     * 只要arr1和arr2中存在相同项即返回真
+     */
+    isContainsAny: function(arr1, arr2) {
+        for(var i = 0; i < arr2.length; i++) {
+            var a2 = arr2[i];
+            if(!!arr1.find(function(a1) {return a1==a2})) {
+                return true;
+            }
+        }
+        return false;
+    },
+
+    getDefaultFieldOperation: function(field) {
+        var me = this,
+        xtypes = field.getXTypes().split('/'),
+        operation;
 
-        if(Ext.Array.contains(['numberfield'], xtype)) {
-            operation = '=';
-        }else if(Ext.Array.contains(['datefield'], xtype)) {
+        if(me.isContainsAny(xtypes, ['numberfield', 'datefield', 'dbfindtrigger'])) {
             operation = '=';
-        }else if(Ext.Array.contains(['condatefield'], xtype)) {
+        }else if(me.isContainsAny(xtypes, ['condatefield'])) {
             operation = 'between';
-        }else if(Ext.Array.contains(['combobox', 'multicombo', 'combo'], xtype)) {
+        }else if(me.isContainsAny(xtypes, ['multidbfindtrigger', 'combobox', 'multicombo', 'combo'])) {
             operation = 'in';
         }else {
             operation = 'like';
@@ -477,21 +513,23 @@ Ext.define('saas.view.core.report.ReportPanel', {
     /**
      * 处理部分字段值
      */
-    getConditionValue: function(xtype, value) {
-        var conditionValue;
-        if(xtype == 'datefield') {
+    getConditionValue: function(field, value) {
+        var me = this,
+        xtypes = field.getXTypes().split('/'),
+        conditionValue;
+        if(me.isContainsAny(xtypes, ['datefield'])) {
             conditionValue = Ext.Date.format(new Date(from), 'Y-m-d H:i:s');
-        }else if(xtype == 'condatefield') {
+        }else if(me.isContainsAny(xtypes, ['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') {
+        }else if(me.isContainsAny(xtypes, ['combobox', 'combo'])) {
             conditionValue = '\'' + value + '\'';
-        }else if(xtype == 'multicombo') {
-            conditionValue = value.map(function(v) {
+        }else if(me.isContainsAny(xtypes, ['multicombo'])) {
+            conditionValue = value.map ? value.map(function(v) {
                 return '\'' + v.value + '\'';
-            }).join(',');
+            }).join(',') : '';
         }else {
             conditionValue = value;
         }

+ 5 - 5
frontend/saas-web/app/view/home/InfoCard.js

@@ -39,31 +39,31 @@ Ext.define('saas.view.home.InfoCard', {
         Ext.apply(me, {
             cards: {
                 unship: {
-                    title: '未出货销售订单',
+                    title: '待出货销售',
                     color: 'yellow',
                     viewType: 'sale-sale-querypanel',
                     condition: 'sale.companyid=' + companyId + ' and sa_statuscode=\'AUDITED\' and exists (select 1 from saledetail detail where sd_id=saledetail.sd_id and  IFNULL(sd_sendqty,0)<ifnull(sd_qty,0) and TO_DAYS(sd_delivery)-TO_DAYS(now())<= 7)'
                 },
                 unstorage: {
-                    title: '未入库采购订单',
+                    title: '待入库采购',
                     color: 'purple',
                     viewType: 'purchase-purchase-querypanel',
                     condition: 'purchase.companyId=' + companyId + ' and pu_statuscode=\'AUDITED\' and exists (select 1 from purchasedetail detail where pd_id=purchasedetail.pd_id and IFNULL(pd_acceptqty,0) < ifnull(pd_qty,0) and TO_DAYS(PD_DELIVERY)-TO_DAYS(now()) <= 7)'
                 },
                 unpay: {
-                    title: '未付款验收单',
+                    title: '待付款',
                     color: 'red',
                     viewType: 'purchase-purchasein-querypanel',
                     condition: 'pi_class in(\'采购验收单\',\'采购验退单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(ve_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 unreceive: {
-                    title: '未收款出货',
+                    title: '待收款',
                     color: 'pink',
                     viewType: 'sale-saleout-querypanel',
                     condition: 'pi_class in(\'出货单\',\'销售退货单\') and prodinout.companyId=' + companyId + ' and TO_DAYS(pi_date+ifnull(cu_promisedays,0))-TO_DAYS(now()) <= 7 and exists (select 1 from subledger where sl_code=pi_inoutno and sl_kind=pi_class and subledger.companyId=' + companyId + ' and ifnull(sl_namount,0)<>0)'
                 },
                 unauditcheck: {
-                    title: '未审核验收',
+                    title: '未审核验收',
                     color: 'blue',
                     viewType: 'purchase-purchasein-querypanel',
                     condition: 'pi_statuscode<>\'AUDITED\' and pi_class=\'采购验收单\' and prodinout.companyId=' + companyId

+ 1 - 0
frontend/saas-web/app/view/home/InfoCard.scss

@@ -31,6 +31,7 @@ $max-card-width: 235px;
                         }
 
                         h3 {
+                            text-align: center;
                             font-size: 16px;
                         }
             

+ 1 - 3
frontend/saas-web/app/view/main/Main.js

@@ -54,9 +54,7 @@ Ext.define('saas.view.main.Main', {
                     },
                     arrowVisible: true,
                     menu: {
-                        items: [{
-                            xtype: 'menuseparator'
-                        }]
+                        items: []
                     }
                 },
                 '->',

+ 1 - 1
frontend/saas-web/app/view/main/Navigation.scss

@@ -1,5 +1,5 @@
 $nav-font-size: 16px;
-$nav-font-color: #9697AC;
+$nav-font-color: #EEEEF2;
 $nav-font-color-over: #fff;
 
 .x-navpanel {

+ 5 - 0
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -20,6 +20,11 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         fieldLabel: '客户名称',
         columnWidth: 0.2,
         allowBlank: false,
+        listeners: {
+            beforequery: function(f) {
+                return !!f.value;
+            }
+        }
     }, {
         xtype: 'monthdatefield',
         name: 'ym',

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

@@ -19,7 +19,12 @@ Ext.define('saas.view.money.report.VendorCheck', {
         name: 'pi_vendname',
         fieldLabel: '供应商名称',
         columnWidth: 0.2,
-        allowBlank:false
+        allowBlank:false,
+        listeners: {
+            beforequery: function(f) {
+                return !!f.value;
+            }
+        }
     }, {
         xtype: 'monthdatefield',
         name: 'ym',

+ 21 - 9
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -590,18 +590,30 @@ Ext.define('saas.view.money.verification.FormPanel', {
         },
 
         defaultConditions: {
-            receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0',
+            receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
                 'ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                ' and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
-            prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0',
+                ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
                 'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                ' and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')'],
-            receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0',
-                'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0'],
+                ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+            ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+                ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+                '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
             receivable_to_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-            ' and sl_kind in (\'期初余额\',\'出货单\',\'销售退货单\')'],
-            payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-            ' and sl_kind in (\'期初余额\',\'采购验收单\',\'采购验退单\')']
+            ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'],
+            payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+            ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
+            '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))']
         }
     },