Parcourir la source

Merge remote-tracking branch 'origin/dev' into dev

ouxq il y a 8 ans
Parent
commit
d8557e1f65

+ 1 - 0
.gitignore

@@ -33,6 +33,7 @@ tmp/
 # Java
 ## Compiled class file
 *.class
+test/
 
 ## Log file
 *.log

+ 1 - 0
src/main/java/com/uas/platform/b2c/trade/presale/service/impl/CartServiceImpl.java

@@ -397,6 +397,7 @@ public class CartServiceImpl implements CartService {
 		Map<String, Object> map = new HashMap<String, Object>();
 		Map<String, List<Cart>> contentMap = new HashMap<>();
 		info.sorting("storeUuid", Sort.Direction.DESC);
+		info.sorting("id", Sort.Direction.DESC);
 		// 获取当前页的购物车记录信息
 		Page<Cart> carts = cartDao.findAll(new Specification<Cart>() {
 			@Override

+ 65 - 64
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_cart_ctrl.js

@@ -11,7 +11,7 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		 * */
 		var enIdFilter = $filter('EncryptionFilter');
 		$scope.cartExist = true;
-		$scope.isLoading = false;
+		$scope.isDataLoading = false;
 		$scope.errors = null;
 		$scope.goodsInfo = [];
 		$scope.carts = [];
@@ -37,60 +37,53 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		$scope.cartIsEmpty = true;
 		$scope.countByPage = 0;
 		$scope.cartMap = [];
+		/**
+		 * 全选状态信息
+		 */
+		$scope.isChooseAll = false;
 
 		$scope.loadData = function (){
-			if(!$scope.isLoading) {
-				$scope.isLoading = true;
-				Cart.getPageInfo($scope.pageInfo, function(data) {
-					$scope.isLoading = false;
-					$scope.total = data.totalElements;
-					$scope.pageNum = data.totalPages;
-
-					angular.forEach(data.content, function (cart) {
-						if(cart.currencyName.indexOf("RMB") > -1) {
-							cart.buyCurrency = "RMB";
-						}else {
-							cart.buyCurrency = "USD";
-						}
-						cart.isSelect = false;
-						//计算分段和统计一下价格
-						$scope.getPrice(cart);
-
-						//便于后期循环
-						$scope.carts.push(cart);
-						$scope.disabledAddAndSub(cart);
-						$scope.countByPage += 1;
-						var isContain = false;
-						for (var i = 0; i < $scope.cartMap.length; i++) {
-							if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
-								$scope.cartMap[i].arr.push(cart);
-								isContain = true;
-							}
-						}
-						if(!isContain) {
-							var obj = {};
-							obj.name = cart.storeName;
-							obj.arr = [];
-							obj.arr.push(cart);
-							$scope.cartMap.push(obj);
+			Cart.getPageInfo($scope.pageInfo, function(data) {
+				$scope.isDataLoading = false;
+				$scope.total = data.totalElements;
+				$scope.pageNum = data.totalPages;
+
+				angular.forEach(data.content, function (cart) {
+					cart.buyCurrency = cart.currencyName.indexOf("RMB") > -1 ? "RMB" : "USD";
+					cart.isSelect = false;
+					//计算分段和统计一下价格
+					$scope.getPrice(cart);
+
+					//便于后期循环
+					$scope.carts.push(cart);
+					$scope.disabledAddAndSub(cart);
+					$scope.countByPage += 1;
+					var isContain = false;
+					for (var i = 0; i < $scope.cartMap.length; i++) {
+						if(angular.equals($scope.cartMap[i].name, cart.storeName)) {
+							$scope.cartMap[i].arr.push(cart);
+							isContain = true;
 						}
-					});
-					if(!$scope.carts.length) {
-						$scope.cartIsEmpty = true;
-					}else {
-						$scope.cartIsEmpty = false;
 					}
-					//设置全选的复选框
-					$scope.isChooseAll = $scope.isAllSelect($scope.carts);
+					if(!isContain) {
+						var obj = {};
+						obj.name = cart.storeName;
+						obj.arr = [];
+						obj.arr.push(cart);
+						$scope.cartMap.push(obj);
+					}
+				});
+				$scope.cartIsEmpty = !$scope.carts.length ? true : false;
+				//设置全选的复选框
+				$scope.isChooseAll = $scope.isAllSelect($scope.carts);
 
-					//设置店铺复选框的状态
-					angular.forEach($scope.cartMap, function (store) {
-						$scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
-					});
-				},function() {
-					toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
+				//设置店铺复选框的状态
+				angular.forEach($scope.cartMap, function (store) {
+					$scope.selectedStore[store.name] = $scope.isAllSelect(store.arr);
 				});
-			}
+			},function() {
+				toaster.pop('error', "提示", "获取购物车信息失败,请刷新页面");
+			});
 		};
 
 		$scope.loadData();
@@ -100,8 +93,11 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		 */
 		$scope.scrollLoadData = function () {
 			if($scope.pageInfo.page < $scope.pageNum) {
-				$scope.pageInfo.page++;
-				$scope.loadData();
+				if(!$scope.isDataLoading) {
+					$scope.isDataLoading = true;
+					$scope.pageInfo.page++;
+					$scope.loadData();
+				}
 			}
 		};
 
@@ -232,12 +228,15 @@ define(["app/app", 'jquery-summernote'], function(app) {
 			if (c.number < c.goods.minBuyQty || !c.number) {
 				toaster.pop("info", "提示", "该商品最少购买" + c.goods.minBuyQty + "件");
 				c.number = c.goods.minBuyQty;
-			}else if(c.number > c.goods.reserve){
+			}else if(c.number <= c.goods.reserve){
+				c.number = Number(NumberService.sub(Number(c.number), c.number % c.goods.minPackQty));
+			}else{
 				toaster.pop("info", "提示", "库存不足");
 				if(c.number > c.goods.reserve) {
 					c.number = Number(NumberService.sub(c.goods.reserve, c.goods.reserve % c.goods.minPackQty));
 				}
 			}
+
 			$scope.disabledAddAndSub(c);
 			$scope.getPrice(c);
 			//计算总金额,统计购买器件数
@@ -572,11 +571,6 @@ define(["app/app", 'jquery-summernote'], function(app) {
 		 * 选中操作
 		 **********************************************************************/
 
-		/**
-		 * 全选状态信息
-		 */
-		$scope.isChooseAll = false;
-
 		/**
 		 * 全选操作
 		 */
@@ -613,13 +607,18 @@ define(["app/app", 'jquery-summernote'], function(app) {
 
 		//检查是否所有的状态都已经选中或者取消了。
 		$scope.isAllSelect = function (carts) {
-			var isAllChecked = true;//假定都选中,
-			angular.forEach(carts, function(cart) {
-				if(cart.status != 1 && !cart.isSelect) {
-					isAllChecked = false;
+			var isAllChecked = true;//假定都选中
+			var isAlldisabled = true;
+			for(var i = 0; i < carts.length; i++) {
+				var cart = carts[i];
+				if(cart.status != 1) {
+					isAlldisabled = false;
+					if(!cart.isSelect) {
+						isAllChecked = false;
+					}
 				}
-			});
-			return isAllChecked;
+			}
+			return !isAlldisabled&&isAllChecked;
         };
         /**
 		 * 店铺选中状态信息
@@ -930,7 +929,9 @@ define(["app/app", 'jquery-summernote'], function(app) {
 				uuid: commodity.uuid,
 				batchCode: commodity.batchCode,
 				number: number ? number : commodity.minBuyQty,
-				currencyName: currency ? currency == 'RMB-USD' ? 'RMB' : currency : ''
+				currencyName: currency ? currency == 'RMB-USD' ? 'RMB' : currency : '',
+				minPackQty : commodity.minPackQty,
+				storeUuid : commodity.storeid
 			};
 			var goodsList = [];
 			goodsList.push(cart);

+ 6 - 2
src/main/webapp/resources/view/admin/store/fragments/violations_detail.html

@@ -279,6 +279,9 @@
 		background: #3f7ae3;
 		color: #fff;
 	}
+	.violation-content .violation-text .text-input textarea:focus{
+		border: #66afe9 1px solid;
+	}
 </style>
 <div>
 	<div class="violation-handler" ng-if="violations.disposeOperator">
@@ -298,7 +301,8 @@
 					<i ng-if="violations.disposition === 'CLOSE_PERMANENT'">永久暂停店铺营业</i>
 				</p>
 				<p>处罚日期:<i>{{violations.disposeOperator.operateTime | date: 'yyyy-MM-dd HH:mm:ss'}} 至 {{(violations.disposeEndTime | date: 'yyyy-MM-dd HH:mm:ss') || '永久'}}</i></p>
-				<p>具体原因:<i ng-bind="violations.reason">近3个月内有5个订单被买家投诉为虚假发货,严重违反了优软商城诚信交易原则,现予以关闭店铺的处罚!</i></p>
+				<p style="display: inline-block;
+    width: 800px;">具体原因:<i ng-bind="violations.reason">近3个月内有5个订单被买家投诉为虚假发货,严重违反了优软商城诚信交易原则,现予以关闭店铺的处罚!</i></p>
 			</div>
 			<div class="qualification-list" ng-if="violations.disposeProof && violations.disposeProof.length > 0">
 				<ul class="qualification">
@@ -381,7 +385,7 @@
 	<!-- 恢复经营 -->
 	<div class="com-del-box" ng-if="showRestoreConfirmDialog">
 		<div class="title">
-			<a ng-click="wantRestoreStore(false)"><i class="fa fa-close fa-lg"></i></a>
+			<a ng-click="wantRestoreStore(false)"><i class="fa fa-close fa-lg" style="font-size: 16px;"></i></a>
 		</div>
 		<div class="content">
 			<p style="line-height: 20px; padding-top: 20px;"><i class="fa fa-exclamation-circle"></i>是否要恢复店铺经营<br/><span style="color: #f00">处置执行中</span></p>

+ 8 - 2
src/main/webapp/resources/view/admin/store/fragments/violations_handler.html

@@ -42,8 +42,8 @@
 		width: 100%;
 		height: 100%;
 		background: #fff;
-		border: none;
 		padding: 10px;
+		border-radius: 0;
 	}
 	.violation-content .violation-text .count_tip{
 		position: absolute;
@@ -158,6 +158,12 @@
 		padding-left: 10px;
 		border: none;
 	}
+	.violation-text .content .form-control:focus,.violation-content .violation-text .text-input textarea:focus{
+		border: #66afe9 1px solid;
+	}
+	.violation-content .violation-text .text-input textarea{
+		border: none;
+	}
 	.violation-text .content select.form-control option:first-child{
 		color: #999;
 	}
@@ -228,7 +234,7 @@
 		<div class="violation-text">
 			<span class="title"><em>*</em>处置原因:</span>
 			<div class="text-input">
-				<textarea placeholder="请填写违规处置的原因" maxlength="200" ng-model="violations.reason"></textarea>
+				<textarea placeholder="请填写违规处置的原因" maxlength="200" ng-model="violations.reason" class="form-control"></textarea>
 				<p class="count_tip"><span><em ng-bind="(violations.reason || '').length">0</em>/200</span></p>
 			</div>
 		</div>

+ 1 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_cart.html

@@ -583,7 +583,7 @@
 								<div class="btn-wrap">
 									<span class="number">
 										<a class="reduce" ng-disabled="cart.minusDisabled" ng-click="reduce(cart)">-</a>
-										<input type="text" ng-model="cart.number" ng-blur="blurNum(cart)">
+										<input type="text" ng-disabled="cart.status == 1" ng-model="cart.number" ng-blur="blurNum(cart)">
 										<a class="add" ng-disabled="cart.addDisabled" ng-click="add(cart)">+</a>
 									</span>
 									<i ng-if="cart.status == 2" style="color: #f00; margin-left: 32px;">库存紧张</i>

+ 9 - 3
src/main/webapp/resources/view/vendor/forstore/vendor_store_close.html

@@ -176,12 +176,18 @@
         padding: 10px;
         font-size: 14px;
         line-height: 25px;
+        border-radius: 0;
+    }
+    .appeal-content .appeal-text .text-input textarea:focus{
+        border: #5078cb 1px solid;
     }
     .appeal-content .appeal-text .count_tip{
         position: absolute;
         bottom: 0;
-        width: 100%;
+        width: 99%;
         margin: 0 auto;
+        margin-bottom: 2px;
+        margin-left: 2px;
         height: 20px;
         line-height: 20px;
         display: inline-block;
@@ -268,7 +274,7 @@
 </style>
 <div class="store-close fr">
     <h3><i class="fa fa-exclamation-circle"></i>抱歉,店铺关闭通知!</h3>
-    <div class="close-title">
+    <div class="close-title" style="margin-bottom: 20px;">
         <p>
             违规类型:<i ng-if="violations.type === 'FICTITIOUS_TRADE'">虚假交易</i>
 			<i ng-if="violations.type === 'FICTITIOUS_ADVERTISE'">虚假宣传</i>
@@ -307,7 +313,7 @@
         <div class="appeal-text">
             <span class="title"><em>*</em>申述说明:</span>
             <div class="text-input">
-                <textarea placeholder="请填写您的申述说明" maxlength="1000" ng-model="complaint.complaintInfo"></textarea>
+                <textarea placeholder="请填写您的申述说明" maxlength="1000" ng-model="complaint.complaintInfo" class="form-control"></textarea>
                 <p class="count_tip"><span><em ng-bind="(complaint.complaintInfo || '').length">0</em>/1000</span></p>
             </div>
         </div>

+ 34 - 0
src/test/java/com/uas/platform/b2c/RegistForMall.java

@@ -0,0 +1,34 @@
+package com.uas.platform.b2c;
+
+import com.alibaba.fastjson.JSON;
+import com.uas.account.entity.UserSpaceDetail;
+import com.uas.sso.common.util.HttpUtil;
+import com.uas.sso.common.util.HttpUtil.ResponseWrap;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.StringUtils;
+
+import java.util.Date;
+
+public class RegistForMall {
+
+	public static void main(String args[]) throws Exception {
+		UserSpaceDetail detail = new UserSpaceDetail();
+		detail.setName("B2B公司研发测试数据-不要购买-wangyuchao");
+		detail.setShortName("B2B公司");
+		detail.setAdminName("余佳");
+		detail.setAdminTel("15989329613");
+		detail.setAdminEmail("yuj@usoftchina.com");
+		detail.setBusinessCode("11122233344456789");
+		detail.setRegisterDate(new Date().getTime());
+		detail.setTel("15989329613");
+		detail.setFax("11-2222222");
+		String url = "http://113.105.74.135:8001/api/userspace";
+		if (!StringUtils.isEmpty(url)) {
+			ResponseWrap res = HttpUtil.doPost(url,
+					new ModelMap("_operate", "registForMall").addAttribute("detail", JSON.toJSON(detail)));
+			System.out.println(res.getContent());
+			if (!res.isSuccess())
+				throw new Exception(res.getContent());
+		}
+	}
+}