Bläddra i källkod

调整卖家发货和修改物流页面

hulh 8 år sedan
förälder
incheckning
fc36191792

+ 35 - 0
src/main/java/com/uas/platform/b2c/logistics/service/impl/DistributionRuleServiceImpl.java

@@ -263,6 +263,41 @@ public class DistributionRuleServiceImpl implements DistributionRuleService{
 		return distributionRuleDao.findShippingMethodByEnuuAndActive(enuu, ShortConstant.YES_SHORT);
 	}
 
+	public Map<String, Map<String, Object>> findRuleMatchArea(List<String> uuidArray, String area){
+		if (area == null){
+			throw new IllegalOperatorException("地址信息缺失,请重新确认收货地址");
+		}
+		for (String uuid : uuidArray){
+			findRuleMatchArea(uuid, area);
+		}
+		return null;
+	}
+
+	public Map<String, Object> findRuleMatchArea(String uuid, String area){
+		StoreIn store = storeInDao.findByUuid(uuid);
+		if (store == null){
+			throw new IllegalOperatorException("店铺信息,请刷新后重试");
+		}
+		List<DistributionRule> allRuleList = distributionRuleDao.findAllByEnuu(store.getEnUU());
+		List<DistributionRule> ruleList = new ArrayList<>();
+		List<Integer> methodList = new ArrayList<>();
+		for (DistributionRule rule : allRuleList){
+			if (!methodList.contains(rule.getShippingMethod())){
+				List<RuleQtyArea> qtyArea = rule.getAreas();
+				Map<String, Map<String, List<String>>> resultMap = convertArea(qtyArea);
+				boolean isContains = containsArea(resultMap, area);
+				if (isContains){
+					methodList.add(rule.getShippingMethod());
+				}
+			}
+
+			if (methodList.size() == 3){
+				break;
+			}
+		}
+		return null;
+	}
+
 	/**
 	 * 根据配送方式获取匹配地区的配送规则列表
 	 * @param method

+ 3 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -79,6 +79,7 @@ define(['app/app'], function(app) {
 		var getOrderData = function() {
 			return Order.findStatusByOrderid({enOrderid : $stateParams.orderid}, function (response) {
 
+				$scope.storeArray = [];
 				if (response.status == 501){
 					Order.orderContainGoods({enOrderid : $stateParams.orderid}, function(data) {
 						$scope.order = data;
@@ -97,6 +98,7 @@ define(['app/app'], function(app) {
 							if($scope.$$orderDetailsMap[detail.storeName]) {
 								$scope.$$orderDetailsMap[detail.storeName].push(detail);
 							}else {
+								$scope.storeArray.push(detail.storeid);
 								$scope.$$orderDetailsMap[detail.storeName] = [];
 								$scope.remarkList[detail.storeid] = "";
 								$scope.$$orderDetailsMap[detail.storeName].push(detail);
@@ -124,6 +126,7 @@ define(['app/app'], function(app) {
 						if($scope.$$orderDetailsMap[detail.storeName]) {
 							$scope.$$orderDetailsMap[detail.storeName].push(detail);
 						}else {
+							$scope.storeArray.push(detail.storeid);
 							$scope.$$orderDetailsMap[detail.storeName] = [];
 							$scope.$$orderDetailsMap[detail.storeName].push(detail);
 						}

+ 1 - 1
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_deliveryRule_ctrl.js

@@ -153,7 +153,7 @@ define([ 'app/app' ], function(app) {
             }
             if(Number(data.num) < 0 || Number(data.num) % 1 != 0) {
                 data.num = 1;
-                toaster.pop('warning', '提示', '运费必须是整数');
+                toaster.pop('warning', '提示', '请输入大于0的整数');
                 return false;
             }
             if(Number(data.num) > 100000){

+ 8 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -204,9 +204,14 @@ define(['app/app'], function (app) {
             $scope.showNameUl = true;
         };
         $scope.onBlur = function () {
-            setTimeout(function () {
-                $scope.showNameUl = false;
-            }, 120);
+            if ($scope.time){
+                clearTimeout($scope.time);
+            }
+            $scope.time = setTimeout(function () {
+                $scope.$apply(function () {
+                    $scope.showNameUl = false;
+                });
+            }, 200);
         };
         // 选中物流
         $scope.showText = function (name) {

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

@@ -79,7 +79,7 @@
         line-height: 23px;
         max-height: 120px;
         overflow-y: auto;
-        width: 190px;
+        width: 170px;
         display: block;
         overflow-x: hidden;
         border-radius: 0;
@@ -667,8 +667,8 @@
                         <div ng-if="checkinvoice.sendType==1301">
                             <span style="width: 10%; margin-left: 22px;">物流公司 :&nbsp;</span>
                             <span class="input-ul">
-                                <input id="addr" style="border: #5078cb 1px solid;" type="text" class="form-control" ng-focus="getItemFocus()" ng-blur="onItemBlur()" ng-keydown="onKeyup()" ng-model="logistics.companyName" placeholder="请选择物流公司" autocomplete="off" maxlength="15" readonly="readonly">
-                                <em name="companyName" ng-click="changeShowLogistics()" class="btn-position"><i class="fa fa-caret-down" aria-hidden="true"></i></em>
+                                <input id="addr" style="border: #5078cb 1px solid;" type="text" class="form-control select-adder" ng-focus="getItemFocus()" ng-blur="onItemBlur()" ng-keydown="onKeyup()" ng-model="logistics.companyName" placeholder="请选择物流公司" autocomplete="off" maxlength="15" readonly="readonly" >
+                                <!--<em name="companyName" ng-click="changeShowLogistics()" class="btn-position"><i class="fa fa-caret-down" aria-hidden="true"></i></em>-->
                                 <ul id="ulContent" ng-if="showCompanyName" class="dropdown-menu">
                                     <li ng-click="showText('请选择物流公司')">请选择物流公司</li>
                                     <li ng-click="showText(data.companyName)" ng-repeat="data in data_list" ng-class="{'active': $index==selectIndex}" ng-bind="data.companyName"></li>

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

@@ -941,8 +941,8 @@
 										<div class="row">配送方式: <em>{{deliveryMethod[purchase.sendType]}}</em></div>
 										<div class="row">物流公司:
 											<em>
-												<input type="text" style="border: #5078cb 1px solid;" class="form-control" ng-model="logistics.companyName" ng-focus="onFocus()" ng-blur="onBlur()" readonly="readonly"/>
-												<em name="companyName" class="btn-position" ng-click="showName()"><i class="fa fa-caret-down"></i></em>
+												<input type="text" style="border: #5078cb 1px solid;" class="form-control select-adder" ng-model="logistics.companyName" ng-focus="onFocus()" ng-blur="onBlur()" readonly="readonly"/>
+												<!--<em name="companyName" class="btn-position" ng-click="showName()"><i class="fa fa-caret-down"></i></em>-->
 												<ul class="dropdown-menu" ng-class="{'active': showNameUl}">
 													<li ng-click="showText('请选择物流公司')">请选择物流公司</li>
                             						<li ng-click="showText(data.companyName)" ng-repeat="data in data_list" ng-bind="data.companyName"></li>
@@ -950,7 +950,7 @@
 											</em>
 										</div>
 										<div class="row">物流单号: <em>
-											<input type="text" class="form-control" ng-model="logistics.number"/>
+											<input type="text" class="form-control" ng-model="logistics.number" maxlength="20" autocomplete="off"/>
 										</em></div>
 										<div class="edit-deal">
 											<a ng-click="cancelModify(purchase)" class="off">取消</a>