Browse Source

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

hy 7 years ago
parent
commit
774d2fc219

+ 5 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/CommonController.java

@@ -19,6 +19,11 @@ public class CommonController {
         return Result.success();
     }
 
+    @GetMapping("/{caller}/import")
+    public Result importExcel(){
+        return Result.success();
+    }
+
     @GetMapping("/{caller}/print")
     public Result print() {
         return Result.success();

+ 2 - 2
applications/commons/commons-server/src/main/resources/mapper/HomePageMapper.xml

@@ -121,7 +121,7 @@
         select concat('[',five_profit,',',other_profit,']') from (
       (
         #前5数据
-        select group_concat('{"x":"',custname,'","y":',profit,',"z":"',shortname,'"}') five_profit   from (
+        select group_concat('{"x":"',custname,'","y":',profit/10000,',"z":"',shortname,'"}') five_profit   from (
         select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) profit,
         pi_custcode,max(pi_custname) custname,max(ifnull(cu_shortname,'')) shortname  from prodinout left join prodiodetail on pi_id=pd_piid left join customer on cu_id=pi_custid
         where
@@ -130,7 +130,7 @@
         )five_profit_,
 	  (
 	    #其它的数据
-		select concat('{"z":"其它","x":"其它","y":',all_profit - five_profit,'}') other_profit from (
+		select concat('{"z":"其它","x":"其它","y":',(all_profit - five_profit)/10000,'}') other_profit from (
         #总共
         (
         select sum((ifnull(pd_netprice,0)- ifnull(pd_price,0))*(ifnull(pd_outqty,0) - ifnull(pd_inqty,0))) all_profit

+ 12 - 0
base-servers/account/account-dto/src/main/java/com/usoftchina/saas/account/dto/RoleDTO.java

@@ -25,6 +25,18 @@ public class RoleDTO extends CommonBaseDTO implements Serializable{
      * 描述
      */
     private String description;
+    /**
+     * 角色
+     */
+    private Integer type;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
 
     public Long getCompanyId() {
         return companyId;

+ 1 - 1
frontend/saas-web/app/view/home/Home.js

@@ -47,7 +47,7 @@ Ext.define('saas.view.home.Home', {
             xtype: 'month-sale',
             padding: '0 0 0 14',
         }, {
-            xtype: 'month-purchase',
+            xtype: 'profit-detail',
             padding: '0 0 0 14',
         }, {
             xtype: 'key-data',

+ 72 - 35
frontend/saas-web/app/view/home/HomeModel.js

@@ -87,41 +87,41 @@ Ext.define('saas.view.home.HomeModel', {
             }
         },
 
-        month_purchase: {
-            model: 'saas.model.chart.DataXY',
-            autoLoad: true,
-            proxy: {
-                type: 'ajax',
-                // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
-                url: '/api/commons/homePage/purchaseData?sixMonths=false',
-                timeout: 8000,
-                actionMethods: {
-                    read: 'GET'
-                },
-                reader: {
-                    type: 'json',
-                    rootProperty: 'data',
-                },
-                listeners: {
-                    exception: function(proxy, response, operation, eOpts) {
-                        var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(false);
-                    }
-                }
-            },
-            listeners: {
-                beforeload: function() {
-                    var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(true);
-                },
-                load: function(s, d) {
-                    var p = Ext.getCmp('month_purchase');
-                        p && p.setLoading(false);
-                    var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
-                    Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
-                }
-            }
-        },
+        // month_purchase: {
+        //     model: 'saas.model.chart.DataXY',
+        //     autoLoad: true,
+        //     proxy: {
+        //         type: 'ajax',
+        //         // url: 'http://192.168.253.58:8920/homePage/purchaseData?sixMonths=false',
+        //         url: '/api/commons/homePage/purchaseData?sixMonths=false',
+        //         timeout: 8000,
+        //         actionMethods: {
+        //             read: 'GET'
+        //         },
+        //         reader: {
+        //             type: 'json',
+        //             rootProperty: 'data',
+        //         },
+        //         listeners: {
+        //             exception: function(proxy, response, operation, eOpts) {
+        //                 var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(false);
+        //             }
+        //         }
+        //     },
+        //     listeners: {
+        //         beforeload: function() {
+        //             var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(true);
+        //         },
+        //         load: function(s, d) {
+        //             var p = Ext.getCmp('month_purchase');
+        //                 p && p.setLoading(false);
+        //             var sum = Ext.util.Format.number(s.sum('y'), '0.00') || 0;
+        //             Ext.getCmp('home').getViewModel().set('month_purchase_amount', sum+'')
+        //         }
+        //     }
+        // },
 
         month_io: {
             fields: ['x', 'main', 'other'],
@@ -315,5 +315,42 @@ Ext.define('saas.view.home.HomeModel', {
                 }
             } 
         },
+
+        profit_detail: {
+            fields: ['x', 'y', 'z'],
+            autoLoad: true,
+            proxy: {
+                type: 'ajax',
+                // url: 'http://192.168.253.58:8560/api/commons/homePage/monthProfit',
+                url: '/api/commons/homePage/monthProfit',
+                timeout: 8000,
+                // header: {
+                //     Authorization: 'eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJnIiwiYXBwSWQiOiJ0cmFkZS1hcHAiLCJ1c2VySWQiOjM4LCJjb21wYW55SWQiOjIxLCJ1c2VyTmFtZSI6ImciLCJyZWFsTmFtZSI6Iue-pCIsImV4cCI6MTU0NjIyNTg5Mn0.oe6BmpVchOlL6PoR7UspHbThFEJ_HLlKTHBpV4P9wSA4YbL2Pv5sAah2U6M2q7nmu0J1DV5WwMaMClI19Us7n-8fSgNeQrl1IsVFO4sf5nSC3SrUJk0sraBq5dLAqONfAIj9qFOuyduL6tXkV2av5IfmikT1uMk8okTJKDtHj8U'
+                // },
+                actionMethods: {
+                    read: 'GET'
+                },
+                reader: {
+                    type: 'json',
+                    rootProperty: 'data',
+                },
+                listeners: {
+                    exception: function(proxy, response, operation, eOpts) {
+                        var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(false);
+                    }
+                }
+            },
+            listeners: {
+                beforeload: function() {
+                    var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(true);
+                },
+                load: function(s, d) {
+                    var p = Ext.getCmp('profit_detail');
+                        p && p.setLoading(false);
+                }
+            } 
+        },
     },
 });

+ 91 - 0
frontend/saas-web/app/view/home/charts/ProfitDetail.js

@@ -0,0 +1,91 @@
+Ext.define('saas.view.home.charts.ProfitDetail', {
+    extend: 'saas.view.core.chart.ChartBase',
+    xtype: 'profit-detail',
+
+    id: 'profit_detail',
+
+    bind: {
+        title: '毛利润分析(万元)'
+    },
+
+    initComponent: function() {
+        var me = this;
+
+        Ext.apply(me, {
+            items: [{
+                xtype: 'cartesian',
+                colors: [
+                    '#34BAF6'
+                ],
+                bind: {
+                    insetPadding: '{insetPadding}',
+                    store: '{profit_detail}',
+                },
+                axes: [{
+                    type: 'category',
+                    fields: ['x'],
+                    position: 'bottom',
+                    label: {
+                        fontSize: '12px',
+                        fillStyle: '#485465',
+                    },
+                    style: {
+                        fill: '#F7F8FA',
+                        strokeStyle: 'transparent'
+                    },
+                    renderer: me.onCategoryLabelRender
+                },{
+                    type: 'numeric',
+                    fields: ['y'],
+                    position: 'left',
+                    adjustByMajorUnit: true,
+                    grid: {
+                        even: {
+                            stroke: '#F7F8FA'
+                        },
+                        odd: {
+                            stroke: '#F7F8FA',
+                        }
+                    },
+                    label: {
+                        fontSize: '12px',
+                        fillStyle: '#485465',
+                        textAlign: 'end'
+                    },
+                    style: {
+                        fill: '#fff',
+                        strokeStyle: 'transparent'
+                    },
+                    minimum: 0
+                }],
+                series: [{
+                    type: 'bar',
+                    xField: 'x',
+                    yField: ['y'],
+                    bind: {
+                        style: {
+                            lineWidth: 0,
+                            strokeStyle: 'transparent',
+                            maxBarWidth: '{maxBarWidth}',
+                        },
+                    },
+                    tooltip: {
+                        trackMouse: true,
+                        renderer: me.onBarTipRender
+                    }
+                }]
+            }]
+        });
+
+        me.callParent(arguments);
+    },
+
+    onCategoryLabelRender: function(axis, label, layoutContent, lastLabel) {
+        return label.substr(0,2) + '...';
+    },
+
+    onBarTipRender: function (tooltip, record, item) {
+        tooltip.setHtml(record.get('x') + ': ' + record.get('y') + '万元');
+    },
+
+});