Browse Source

Merge branch 'fix_#2_store' into dev

huxz 8 years ago
parent
commit
480e545a79

+ 2 - 1
src/main/java/com/uas/platform/b2c/prod/store/api/StoreInController.java

@@ -93,6 +93,7 @@ public class StoreInController {
 	 * @param keyword	查询关键字
 	 * @return
 	 */
+	@Deprecated
 	@RequestMapping(value = "/stores", method = RequestMethod.GET, params = "op=page")
 	public Page<StoreIn> findStoresByPage(PageParams params, String keyword) {
 		PageInfo pageInfo = new PageInfo(params);
@@ -125,7 +126,7 @@ public class StoreInController {
 	 * @param keyword		查询关键字
 	 */
 	@RequestMapping(value = "/stores", method = RequestMethod.GET, params = "op=pageByType")
-	public Page<StoreIn> pageStoresByTypesAndKeyword(PageParams params, String types, @RequestParam(required = false) String keyword) {
+	public Page<StoreIn> pageStoresByTypesAndKeywordWhenUserVisitList(PageParams params, String types, @RequestParam(required = false) String keyword) {
 		PageInfo pageInfo = new PageInfo(params);
 		return storeService.pageStoresByTypesAndKeyword(pageInfo, types, keyword);
 	}

+ 9 - 3
src/main/java/com/uas/platform/b2c/prod/store/controller/StoreInformationController.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.prod.store.controller;
 
 import com.uas.platform.b2c.prod.store.model.StoreIn;
+import com.uas.platform.b2c.prod.store.model.StoreStatus;
 import com.uas.platform.b2c.prod.store.service.StoreInService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,10 +40,15 @@ public class StoreInformationController {
 		System.out.println("根据店铺UUID获取模板信息");
 		StoreIn store = storeService.findByUuid(uuid);
 		if (store == null) {
-			return "redirect:/index";
+			return "store_none";
+		}
+
+		// 判断店铺是否开店状态
+		if (StoreStatus.OPENED == store.getStatus()) {
+			return "store_default";
+		} else {
+			return "store_close";
 		}
-		// TODO huxz 添加分类信息
-		return "store_default";
 	}
 
 }

+ 14 - 0
src/main/java/com/uas/platform/b2c/prod/store/model/StoreViolations.java

@@ -63,6 +63,12 @@ public class StoreViolations {
 	@Column(name = "vi_create_time")
 	private Date createTime;
 
+	/**
+	 * 违规处理修改时间
+	 */
+	@Column(name = "vi_update_time")
+	private Date updateTime;
+
 	/**
 	 * 违规处理记录是否处于当前违规申述处理流程
 	 */
@@ -365,4 +371,12 @@ public class StoreViolations {
 	public void setCurrent(Boolean current) {
 		this.current = current;
 	}
+
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
 }

+ 6 - 0
src/main/java/com/uas/platform/b2c/prod/store/service/impl/StoreViolationsServiceImpl.java

@@ -78,6 +78,7 @@ public class StoreViolationsServiceImpl implements StoreViolationsService {
 		violations.setDisposeProofJson(StoreBusinessUtils.fromResourcesAboutViolations(violations.getDisposeProof()));
 		violations.setDisposeOperator(operator);
 		violations.setCreateTime(operator.getOperateTime());
+		violations.setUpdateTime(operator.getOperateTime());
 
 		// 计算处置结束时间
 		int index = violations.getDisposition().indexOf('_');
@@ -150,6 +151,7 @@ public class StoreViolationsServiceImpl implements StoreViolationsService {
 		violations.setStatus(ViolationsStatus.COMPLAINT);
 		violations.setComplaintProofJson(StoreBusinessUtils.fromResourcesAboutViolations(violations.getComplaintProof()));
 		violations.setComplaintOperator(operator);
+		violations.setUpdateTime(operator.getOperateTime());
 
 		violationsDao.save(violations);
 
@@ -197,6 +199,8 @@ public class StoreViolationsServiceImpl implements StoreViolationsService {
 			storeIn.setStatus(StoreStatus.CLOSED);	// 申述失败设置店铺状态为违规关店状态
 		}
 
+		violations.setUpdateTime(operator.getOperateTime());
+
 		violationsDao.save(violations);
 
 		storeIn.setUpdateTime(new Date());
@@ -273,6 +277,7 @@ public class StoreViolationsServiceImpl implements StoreViolationsService {
 		violations.setRestoreOperator(operator);
 		violations.setRestore(true);
 		violations.setStatus(ViolationsStatus.DONE);
+		violations.setUpdateTime(operator.getOperateTime());
 		violationsDao.save(violations);
 
 		storeIn.setUpdateTime(new Date());
@@ -299,6 +304,7 @@ public class StoreViolationsServiceImpl implements StoreViolationsService {
 
 				violations.setStatus(ViolationsStatus.DONE);
 				violations.setCurrent(false);
+				violations.setUpdateTime(new Date());
 
 				violationsDao.save(violations);
 

+ 47 - 0
src/main/webapp/WEB-INF/views/normal/store_close.html

@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html lang="zh-CN">
+<head>
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+<meta name="renderer" content="webkit">
+<title i18n="home.title"></title>
+<base href="../"/>
+<meta name="description" content="优软商城,电子元器件搜索引擎" />
+<meta name="keywords"
+	content="优软商城,B2B,B2C,行业门户,网上贸易,电子商务,网上贸易,网上交易,交易市场,在线交易,供求信息,采购,求购信息,供应信息" />
+<link href="static/img/all/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/angular/toaster.css" />
+<link rel="stylesheet" href="static/lib/fontawesome/css/font-awesome.min.css" />
+<link rel="stylesheet" href="static/css/common/common.css" />
+<link rel="stylesheet" href="static/lib/angular/ng-table.css">
+<script type="text/javascript" src="static/js/common/bd_pv.js"></script>
+</head>
+<body>
+	<!-- 消息提示框  Start-->
+	<toaster-container
+		toaster-options="{'position-class': 'toast-bottom-center'}"></toaster-container>
+	<!-- 消息提示框 End -->
+	<!-- Loading Start -->
+	<div id="loading" class="loading">
+		<i></i>
+	</div>
+	<!-- Loading End -->
+
+	<!-- top 置顶栏 Start -->
+	<div ng-include src="'static/view/common/site-nav.html'"></div>
+	<!-- top 置顶栏 End -->
+
+	<div ng-include src="'static/view/store/default/store-close.html'"></div>
+
+	<!-- 页脚 Start -->
+	<div ng-include src="'static/view/common/footer.html'"></div>
+	<!-- 页脚 End -->
+
+	<!-- 侧边栏Start -->
+	<div ng-include src="'static/view/common/sidebar.html'"></div>
+	<!-- 侧边栏End -->
+	<script type="text/javascript" src="static/lib/require.js"
+		data-main="static/js/store/main.js"></script>
+</body>
+</html>

+ 47 - 0
src/main/webapp/WEB-INF/views/normal/store_none.html

@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<html lang="zh-CN">
+<head>
+<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+<meta name="renderer" content="webkit">
+<title i18n="home.title"></title>
+<base href="../"/>
+<meta name="description" content="优软商城,电子元器件搜索引擎" />
+<meta name="keywords"
+	content="优软商城,B2B,B2C,行业门户,网上贸易,电子商务,网上贸易,网上交易,交易市场,在线交易,供求信息,采购,求购信息,供应信息" />
+<link href="static/img/all/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/angular/toaster.css" />
+<link rel="stylesheet" href="static/lib/fontawesome/css/font-awesome.min.css" />
+<link rel="stylesheet" href="static/css/common/common.css" />
+<link rel="stylesheet" href="static/lib/angular/ng-table.css">
+<script type="text/javascript" src="static/js/common/bd_pv.js"></script>
+</head>
+<body>
+	<!-- 消息提示框  Start-->
+	<toaster-container
+		toaster-options="{'position-class': 'toast-bottom-center'}"></toaster-container>
+	<!-- 消息提示框 End -->
+	<!-- Loading Start -->
+	<div id="loading" class="loading">
+		<i></i>
+	</div>
+	<!-- Loading End -->
+
+	<!-- top 置顶栏 Start -->
+	<div ng-include src="'static/view/common/site-nav.html'"></div>
+	<!-- top 置顶栏 End -->
+
+	<div ng-include src="'static/view/store/default/store-none.html'"></div>
+
+	<!-- 页脚 Start -->
+	<div ng-include src="'static/view/common/footer.html'"></div>
+	<!-- 页脚 End -->
+
+	<!-- 侧边栏Start -->
+	<div ng-include src="'static/view/common/sidebar.html'"></div>
+	<!-- 侧边栏End -->
+	<script type="text/javascript" src="static/lib/require.js"
+		data-main="static/js/store/main.js"></script>
+</body>
+</html>

+ 2 - 1
src/main/webapp/resources/js/admin/app.js

@@ -282,7 +282,7 @@
 			controllerUrl : 'app/controllers/StoreInfoListCtrl'
 		})).state('store_info_detail', angularAMD.route({
 			// 店铺详情,违规处理页面
-			url: '/store/:uuid/detail',
+			url: '/store/:uuid/detail/:type',
 			templateUrl : 'static/view/admin/store/store_info_detail.html',
 			controller : 'StoreInfoDetailCtrl',
 			controllerUrl : 'app/controllers/store/StoreInfoDetailCtrl'
@@ -749,6 +749,7 @@
 			if (data == 'AGENCY') return '代理商';
 			if (data == 'DISTRIBUTION') return '经销商';
 			if (data == 'ORIGINAL_FACTORY') return '原厂';
+			if (data == 'CONSIGNMENT') return '寄售';
 			return '暂无类型信息'
 		};
 	});

+ 1 - 1
src/main/webapp/resources/js/admin/controllers/StoreInfoListCtrl.js

@@ -149,7 +149,7 @@ define([ 'app/app' ], function(app) {
 		 */
 		$scope.goStoreDetail = function (store) {
 			if (store && store.uuid) {
-				$state.go('store_info_detail', { uuid : store.uuid });
+				$state.go('store_info_detail', { uuid : store.uuid, type: store.type });
 			} else {
 				toaster.pop('error', '店铺信息不能为空');
 			}

+ 1 - 0
src/main/webapp/resources/js/admin/controllers/store/StoreInfoDetailCtrl.js

@@ -5,6 +5,7 @@ define([ 'app/app' ], function(app) {
 
 		// 店铺UUID
 		$scope.storeUuid = $stateParams.uuid;
+		$scope.storeType = $stateParams.type;
 
 		// Tab 选项,ENTERPRISE,VIOLATIONS
 		$scope.tabSelected = 'ENTERPRISE';

+ 5 - 2
src/main/webapp/resources/js/common/module/store_admin_violations_module.js

@@ -223,7 +223,10 @@ define([ 'ngResource', 'common/query/storeViolations', 'ngTable', 'ngSanitize',
 		function active() {
 			$scope.violationsTableParams = new ngTableParams({
 				page : 1,
-				count : 10
+				count : 10,
+				sorting: {
+					updateTime: 'DESC'
+				}
 			}, {
 				total : 0,
 				getData : function($defer, params) {
@@ -287,7 +290,7 @@ define([ 'ngResource', 'common/query/storeViolations', 'ngTable', 'ngSanitize',
 			} else if ($scope.isShow === 'UP') {
 				$scope.isShow = 'ALL';
 
-				$scope.violationsTableParams.sorting({});
+				$scope.violationsTableParams.sorting({updateTime: 'DESC'});
 			}
 			$scope.violationsTableParams.page(1);
 			$scope.violationsTableParams.reload();

+ 1 - 6
src/main/webapp/resources/view/admin/store/fragments/violations_list.html

@@ -137,12 +137,7 @@
 						<p ng-if="!violations.disposition" class="blue">违规店铺</p>
 					</td>
 					<td ng-bind="violations.createTime | date: 'yyyy-MM-dd HH:mm:ss'">2017-05-09 10:28:30</td>
-					<td>
-						<span ng-if="violations.restoreOperator" ng-bind="violations.restoreOperator.operateTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>
-						<span ng-if="violations.authOperator && !violations.restoreOperator" ng-bind="violations.authOperator.operateTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>
-						<span ng-if="violations.complaintOperator && !violations.authOperator && !violations.restoreOperator" ng-bind="violations.complaintOperator.operateTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>
-						<span ng-if="violations.createTime && !violations.complaintOperator && !violations.authOperator && !violations.restoreOperator" ng-bind="violations.createTime | date: 'yyyy-MM-dd HH:mm:ss'"></span>
-					</td>
+					<td ng-bind="violations.updateTime | date: 'yyyy-MM-dd HH:mm:ss'">2017-05-09 10:28:30</td>
 					<td>
 						<span ng-if="violations.restoreOperator" ng-bind="violations.restoreOperator.name"></span>
 						<span ng-if="violations.authOperator && !violations.restoreOperator" ng-bind="violations.authOperator.name"></span>

+ 1 - 1
src/main/webapp/resources/view/admin/store/store_info_detail.html

@@ -104,7 +104,7 @@
 		<div class="col-sm-8">
 			<div class="btn-group" role="group">
 				<a role="presentation" class="btn btn-default" ng-class="{ 'btn-primary': tabSelected === 'ENTERPRISE' }" ng-click="switchTab('ENTERPRISE')">企业信息</a>
-				<a role="presentation" class="btn btn-default" ng-class="{ 'btn-primary': tabSelected === 'VIOLATIONS' }" ng-click="switchTab('VIOLATIONS')">违规</a>
+				<a role="presentation" class="btn btn-default" ng-class="{ 'btn-primary': tabSelected === 'VIOLATIONS' }" ng-click="switchTab('VIOLATIONS')" ng-if="storeType !== 'CONSIGNMENT'">违规</a>
 			</div>
 		</div>
 	</div>

+ 23 - 0
src/main/webapp/resources/view/store/default/store-close.html

@@ -0,0 +1,23 @@
+<style>
+	.store_error_show {
+		display: table;
+		min-height: 340px;
+		width: 100%;
+	}
+	.store_error_tip {
+		display: table-cell;
+		vertical-align: middle;
+		text-align: center;
+	}
+	.store_error_tip > span {
+		font-size: 16px;
+	}
+</style>
+<div class="container">
+	<div class="store_error_show">
+		<div class="store_error_tip">
+			<img src="static/img/store/common/default.png" alt="店铺图片"/>
+			<span>该店铺处于关闭状态,请<a href="index">返回首页</a></span>
+		</div>
+	</div>
+</div>

+ 23 - 0
src/main/webapp/resources/view/store/default/store-none.html

@@ -0,0 +1,23 @@
+<style>
+	.store_error_show {
+		display: table;
+		min-height: 340px;
+		width: 100%;
+	}
+	.store_error_tip {
+		display: table-cell;
+		vertical-align: middle;
+		text-align: center;
+	}
+	.store_error_tip > span {
+		font-size: 16px;
+	}
+</style>
+<div class="container">
+	<div class="store_error_show">
+		<div class="store_error_tip">
+			<img src="static/img/store/common/default.png" alt="店铺图片"/>
+			<span>该店铺还未开通,请<a href="index">返回首页</a></span>
+		</div>
+	</div>
+</div>