Browse Source

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@752 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 years ago
parent
commit
95db7ff021

+ 5 - 3
src/main/java/com/uas/platform/b2b/controller/SaleStatController.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2b.controller;
 
 import java.util.List;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.ui.ModelMap;
@@ -15,6 +16,7 @@ import com.uas.platform.b2b.model.SaleStatYear;
 import com.uas.platform.b2b.service.SaleStatService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.util.ArrayUtils;
 
 /**
  * 平台销售数据统计
@@ -42,15 +44,15 @@ public class SaleStatController {
 		PageInfo info = new PageInfo(1, 15, 0);
 		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		info.sorting(Direction.DESC, "year", "month", "day");
-		map.put("day", saleStatService.findDayByPageInfo(info).getContent());
+		map.put("day", ArrayUtils.reverse(saleStatService.findDayByPageInfo(info).getContent()));
 		info = new PageInfo(1, 12, 0);
 		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		info.sorting(Direction.DESC, "year", "month");
-		map.put("month", saleStatService.findMonthByPageInfo(info).getContent());
+		map.put("month", ArrayUtils.reverse(saleStatService.findMonthByPageInfo(info).getContent()));
 		info = new PageInfo(1, 10, 0);
 		info.filter("enUU", SystemSession.getUser().getEnterprise().getUu());
 		info.sorting(Direction.DESC, "year");
-		map.put("year", saleStatService.findYearByPageInfo(info).getContent());
+		map.put("year", ArrayUtils.reverse(saleStatService.findYearByPageInfo(info).getContent()));
 		return map;
 	}
 

+ 60 - 0
src/main/webapp/WEB-INF/views/normal/public.html

@@ -0,0 +1,60 @@
+<!DOCTYPE HTML>
+<html lang="zh-CN">
+<head>
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+<meta name="baidu-site-verification" content="S0kf5fz0uA" />
+<meta charset="utf-8">
+<title>优软商务平台</title>
+<meta name="keywords"
+	content="优软商务平台,优软B2B平台,商务平台,B2B平台,B2B,电子商务,ERP,UAS,UBTOB.COM,USOFTCHINA.COM,优软">
+<meta name="description" content="优软商务平台,企业供销信息交流平台。">
+<link href="static/img/icon/u.png" rel="icon" type="image/x-icon" />
+<link rel="stylesheet" href="static/lib/bootstrap/css/bootstrap.min.css" />
+<link rel="stylesheet"
+	href="static/lib/fontawesome/css/font-awesome.min.css" />
+<link rel="stylesheet" href="static/lib/angular/toaster.css" />
+<base target="_blank" />
+</head>
+<body>
+	<!-- header Start -->
+	<nav id="top" class="navbar" style="margin-bottom: 0;">
+		<div class="container">
+			<div class="navbar-header">
+				<a class="navbar-brand title"></a> <b></b> <span>商务平台</span>
+			</div>
+			<div class="navbar-right">
+				<p class="navbar-text">
+					第一次使用商务平台? <a href="signup">立即注册</a>
+				</p>
+			</div>
+		</div>
+	</nav>
+	<!-- header End -->
+	<!-- main Start -->
+	<div id="banner"></div>
+	<!-- main End -->
+	<div class="navbar navbar-fixed-bottom" id="footer">
+		<!-- footer inner -->
+		<div class="container">
+			<div class="link-group">
+				<ul class="list-inline text-center">
+					<li><a href="#">关于优软</a></li>
+					<li><a href="#">联系我们</a></li>
+					<li><a href="#">在线客服</a></li>
+					<li><a href="#">客服中心</a></li>
+					<li><a href="#">联系邮箱</a></li>
+					<li><a href="#">服务条款 </a></li>
+					<li><a href="#">投诉反馈 </a></li>
+					<li>© 2014-2015 深圳市优软科技有限公司. 版权所有.</li>
+				</ul>
+			</div>
+		</div>
+	</div>
+	<!-- 消息提示框  Start-->
+	<toaster-container
+		toaster-options="{'position-class': 'toast-top-center'}"></toaster-container>
+	<!-- 消息提示框 End -->
+	<script type="text/javascript" src="static/lib/require.js"
+		data-main="static/js/public/main.js"></script>
+</body>
+</html>

+ 56 - 54
src/main/webapp/resources/js/index/app.js

@@ -357,58 +357,7 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 		};
 	});
 	app.controller('SaleStatCtrl', function($scope, SaleStat){
-		$scope.charts = {
-				day : {
-					chartType : "line",
-					series: ['销售额'],
-					data: [],
-					config : {
-						"labels": false,
-						 "title": "销售额统计(日线)",
-						 "legend": {
-							 "display": true,
-							 "position": "right"
-						 },
-						 colors : [ '#4D9934'],
-						 "innerRadius": 0,
-						 "lineLegend": "lineEnd"
-					}
-				},
-				month: {
-						chartType : "line",
-						series: ['销售额'],
-						data: [],
-						config : {
-							"labels": false,
-							 "title": "销售额统计(月线)",
-							 "legend": {
-								 "display": true,
-								 "position": "right"
-							 },
-							 colors : [ '#4D9934'],
-							 "innerRadius": 0,
-							 "lineLegend": "lineEnd"
-						}
-				},
-				year: {
-					chartType : "line",
-					series: ['销售额'],
-					data: [],
-					config : {
-						"labels": false,
-						 "title": "销售额统计(年线)",
-						 "legend": {
-							 "display": true,
-							 "position": "right"
-						 },
-						 colors : [ '#4D9934'],
-						 "innerRadius": 0,
-						 "lineLegend": "lineEnd"
-					}
-			}
-		};
 		SaleStat.get({}, function(data){
-			var charts = {};
 			var p = [], q = [], r = [];
 			angular.forEach(data.day, function(d){
 				p.push({x: d.day, y: [(d.total || 0)], tooltip: (d.total || 0)});
@@ -419,9 +368,62 @@ define([ 'toaster', 'charts', 'ngTable', 'common/services', 'service/Purc', 'ser
 			angular.forEach(data.year, function(d){
 				r.push({x: d.year, y: [(d.total || 0)], tooltip: (d.total || 0)});
 			});
-			$scope.charts.day.data = p;
-			$scope.charts.month.data = q;
-			$scope.charts.year.data = r;
+			$scope.charts = {
+					day : {
+						chartType : "line",
+						datas: {
+							series: ['销售额'],
+							data: p
+						},
+						config : {
+							"labels": false,
+							 "title": "销售额统计(近15日线)",
+							 "legend": {
+								 "display": true,
+								 "position": "right"
+							 },
+							 colors : [ '#4D9934'],
+							 "innerRadius": 0,
+							 "lineLegend": "lineEnd"
+						}
+					},
+					month: {
+							chartType : "line",
+							datas: {
+								series: ['销售额'],
+								data: q
+							},
+							config : {
+								"labels": false,
+								 "title": "销售额统计(近12月线)",
+								 "legend": {
+									 "display": true,
+									 "position": "right"
+								 },
+								 colors : [ '#4D9934'],
+								 "innerRadius": 0,
+								 "lineLegend": "lineEnd"
+							}
+					},
+					year: {
+						chartType : "line",
+						datas: {
+							series: ['销售额'],
+							data: r
+						},
+						config : {
+							"labels": false,
+							 "title": "销售额统计(近10年线)",
+							 "legend": {
+								 "display": true,
+								 "position": "right"
+							 },
+							 colors : [ '#4D9934'],
+							 "innerRadius": 0,
+							 "lineLegend": "lineEnd"
+						}
+				}
+			};
 		});
 	});
 	app.controller('NoticeCtrl', function($scope, SnapshotService){

+ 8 - 0
src/main/webapp/resources/js/public/app.js

@@ -0,0 +1,8 @@
+define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap'], function() {
+	'use strict';
+	var app = angular.module('myApp', [ 'toaster', 'ngTable', 'ui.router', 'common.services', 'ui.bootstrap']);
+	app.init = function() {
+		angular.bootstrap(document, [ 'myApp' ]);
+	};
+	return app;
+});

+ 32 - 0
src/main/webapp/resources/js/public/main.js

@@ -0,0 +1,32 @@
+require.config({
+	baseUrl : 'static',
+	paths : {
+		'app' : 'js/index',
+		'angular' : 'lib/angular/angular',
+		'ngAnimate': 'lib/angular/angular-animate.min',
+		'toaster' : 'lib/angular/angular-toaster.min',
+		'common' : 'js/common',
+		'service' : 'js/public/services',
+		'ui.router' : 'lib/angular/angular-ui-router.min',
+		'ui.bootstrap' : 'lib/angular/ui-bootstrap-tpls',
+		'ngTable' : 'lib/angular/ng-table',
+		'ngResource' : 'lib/angular/angular-resource.min'
+	},
+	shim : {
+		'angular' : {
+			'exports' : 'angular'
+		},
+		'ngAnimate' : ['angular'],
+		'ngResource' : ['angular'],
+		'toaster' : ['angular', 'ngAnimate'],
+		'ui.router' : ['angular'],
+		'ui.bootstrap' : [ 'angular' ],
+		'ngTable' : {
+			'exports' : 'ngTable',
+			'deps' : [ 'angular' ]
+		}
+	}
+});
+require([ 'app/app' ], function(app) {
+	app.init();
+});

+ 3 - 1
src/main/webapp/resources/tpl/index/account/index.html

@@ -1,10 +1,12 @@
 <!-- 交易信息 Start -->
 <div class="line-charts data-wrap block" ng-controller="SaleStatCtrl">
-	<ul class="list-unstyled">
+	<ul class="list-unstyled" ng-if="charts">
 		<li id="day-stat" class="chart" ac-chart="charts.day.chartType"
 			ac-data="charts.day.datas" ac-config="charts.day.config"></li>
 		<li id="month-stat" class="chart" ac-chart="charts.month.chartType"
 			ac-data="charts.month.datas" ac-config="charts.month.config"></li>
+		<li id="year-stat" class="chart" ac-chart="charts.year.chartType"
+			ac-data="charts.year.datas" ac-config="charts.year.config"></li>
 	</ul>
 </div>
 <!-- 交易信息 End -->

+ 0 - 0
src/main/webapp/resources/tpl/public/serve/help.html


+ 0 - 0
src/main/webapp/resources/tpl/public/serve/question.html