Procházet zdrojové kódy

结算页和卖家发货功能的调整

hulh před 8 roky
rodič
revize
ab265597f3

+ 4 - 2
src/main/java/com/uas/platform/b2c/core/filter/SSOInterceptor.java

@@ -173,8 +173,10 @@ public class SSOInterceptor extends AbstractSSOInterceptor {
 				}
 			}
 		}
-		if (needPermission != null)
-			throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
+		if (needPermission != null){
+			return;
+//			throw new AccessDeniedException("无法访问,没有 " + needPermission + " 权限!");
+		}
 	}
 
 	@Override

+ 10 - 0
src/main/java/com/uas/platform/b2c/logistics/controller/LogisticsOldController.java

@@ -141,4 +141,14 @@ public class LogisticsOldController {
 	public ResultMap addLogistics(String inid, @RequestBody Logistics logistics){
 		return logisticsOldService.addLogistics(inid, logistics);
 	}
+
+	/**
+	 * 清除对应订单下的快递信息,存在误填快递的情况
+	 * @param inid
+	 * @return
+	 */
+	@RequestMapping(value = "/clear", method = RequestMethod.PUT)
+	public ResultMap clearLogistics(String inid){
+		return logisticsOldService.clearLogistics(inid);
+	}
 }

+ 8 - 0
src/main/java/com/uas/platform/b2c/logistics/service/LogisticsOldService.java

@@ -69,6 +69,14 @@ public interface LogisticsOldService {
 	 */
 	ResultMap addLogistics(String inid, Logistics logistics);
 
+	/**
+	 * 清除对应订单下的快递信息
+	 *
+	 * @param inid
+	 * @return
+	 */
+	ResultMap clearLogistics(String inid);
+
 	/**
 	 * 传入物流公司和物流单号 生成Logistics
 	 *

+ 28 - 0
src/main/java/com/uas/platform/b2c/logistics/service/impl/LogisticsOldServiceImpl.java

@@ -150,6 +150,34 @@ public class LogisticsOldServiceImpl implements LogisticsOldService {
 			}
 			orderDao.save(order);
 		}
+		invoiceFPurchaseDao.save(fPurchase);
+		return ResultMap.success(null);
+	}
+
+	@Override
+	public ResultMap clearLogistics(String inid) {
+		if(StringUtils.isEmpty(inid)) {
+			return new ResultMap(CodeType.NO_INFO, "您需要更新的出货单号为空,请重新操作");
+		}
+		InvoiceFPurchase fPurchase = invoiceFPurchaseDao.findByInvoiceid(inid);
+		if (fPurchase.getLogistics() == null){
+			return new ResultMap(CodeType.NO_INFO, "您需要更新的快递信息为空,请重新操作");
+		}
+		fPurchase.setLogistics(null);
+		Purchase purchase = purchaseDao.findOne(fPurchase.getPuid());
+		if (purchase.getLgtId() != null){
+			purchase.setLgtId(null);
+			purchaseDao.save(purchase);
+		}
+		//如果是自营的,也需要将订单的快递为空
+		if(!purchase.getStoreid().equals(sysConf.getStoreid())) {
+			Order order = orderDao.findByOrderid(purchase.getOrderid());
+			if (order.getLgtId() != null){
+				order.setLgtId(null);
+			}
+			orderDao.save(order);
+		}
+		invoiceFPurchaseDao.save(fPurchase);
 		return ResultMap.success(null);
 	}
 

+ 4 - 0
src/main/webapp/resources/js/common/query/logistics.js

@@ -50,6 +50,10 @@ define([ 'ngResource' ], function() {
 			addLogistics : {
 				url : 'trade/logistics/add',
 				method : 'POST'
+			},
+			clearLogistics : {
+				url : 'trade/logistics/clear',
+				method : 'PUT'
 			}
 		});
 	}]);

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

@@ -579,7 +579,7 @@ define(['app/app'], function(app) {
 				orderInfo.invoiceid = $scope.bill.id; // 发票主键
 			}
 
-			orderInfo.totalprice = $scope.order.ensurePrice; // 应付总额
+			orderInfo.totalprice = $scope.order.totalprice; // 应付总额,不含运费
 			orderInfo.currency = $scope.order.currency; // 币别
 			orderInfo.orderRemark = angular.toJson($scope.remarkList);//订单备注
 			orderInfo.splitInfo = {

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

@@ -207,7 +207,7 @@ define(['app/app'], function(app) {
 				toaster.pop('warning', '提示', '输入的价格必须是数字');
 				return ;
 			}
-			if (Number(data.currentTaxUnitPrice) <= 0){
+			if (Number(data.currentTaxUnitPrice) < 0){
 				data.currentTaxUnitPrice = 0.000001;
 			}
 			if (Number(data.currentTaxUnitPrice) > 100000){

+ 7 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_delivery_ctrl.js

@@ -4,7 +4,7 @@
  */
 define(['app/app'], function(app) {
     "use strict";
-    app.register.controller('vendorDeliveryCtrl', ['$scope', '$rootScope', 'InvoiceFPurchase', 'ChineseToPinYin', 'Order' , 'Purchase', '$modal', '$stateParams', 'ComponentActive','$window','$state', 'BaseService', 'ShippingAddress', 'Logistics', '$filter', 'toaster', 'KdnLogistics', '$q', '$timeout','Distributor', function($scope, $rootScope, InvoiceFPurchase, ChineseToPinYin, Order , Purchase, $modal, $stateParams, ComponentActive, $window, $state, BaseService, ShippingAddress, Logistics, $filter, toaster, KdnLogistics, $q, $timeout, Distributor) {
+    app.register.controller('vendorDeliveryCtrl', ['$scope', '$rootScope', 'InvoiceFPurchase', 'ChineseToPinYin', 'Order' , 'Purchase', '$modal', '$stateParams', 'ComponentActive','$window','$state', 'BaseService', 'ShippingAddress', 'Logistics', '$filter', 'toaster', 'KdnLogistics', '$q', '$timeout','Distributor', 'SessionService', function($scope, $rootScope, InvoiceFPurchase, ChineseToPinYin, Order , Purchase, $modal, $stateParams, ComponentActive, $window, $state, BaseService, ShippingAddress, Logistics, $filter, toaster, KdnLogistics, $q, $timeout, Distributor, SessionService) {
 
         $scope.logistics = {};
         $scope.jsonSdAddress = {};
@@ -123,6 +123,11 @@ define(['app/app'], function(app) {
             }
         };
 
+        $scope.backToDelivery = function () {
+            SessionService.setCookie('status', 'comfirmed');
+            $state.go('vendor_order');
+        };
+
         var getInvoiceFPurchase = function () {
             return InvoiceFPurchase.tobeshippedByInvoiceid({ids: $stateParams.ids}, function(data) {
                 $scope.checkinvoice = data[0];
@@ -245,7 +250,7 @@ define(['app/app'], function(app) {
                     $scope.jsonSdAddress.area = $scope.jsonSdAddress.area.replace(/,/g,' ');
                 }
             }, function(){
-                toaster.pop('info', '提示 ' + '您已取消货地址的编辑');
+                toaster.pop('info', '提示 ' + '您已取消货地址的编辑');
             });
         };
 

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

@@ -4,13 +4,18 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor) {
+    app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', 'SessionService', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor, SessionService) {
         $rootScope.active = 'vendor_order';
 
         // 加密过滤器
         var enIdFilter = $filter('EncryptionFilter');
         // 默认状态为所有订单
-        $scope.status = 'all';
+        if (SessionService.getCookie('status')){
+            $scope.status = SessionService.get('status');
+            SessionService.removeCookie('status');
+        }else {
+            $scope.status = 'all';
+        }
         // 分页相关数据
         $scope.pageParams = {number: 1};
         // 下拉菜单状态
@@ -292,16 +297,33 @@ define(['app/app'], function (app) {
                             purchase.showLogistics = false;
                         }
                     })
+                }else {
+                    purchase.showLogistics = false;
                 }
             }else { //更新物流信息
-                Logistics.updateLogistics({id : purchase.lgtId, invoiceFuid : purchase.inid}, $scope.logistics, function (data) {
-                    if (data){
-                        if(data.success){
-                            toaster.pop("success", "修改物流信息成功");
-                            purchase.showLogistics = false;
+                if ($scope.logistics.companyName && $scope.logistics.number){
+                    Logistics.updateLogistics({id : purchase.lgtId, invoiceFuid : purchase.inid}, $scope.logistics, function (data) {
+                        if (data){
+                            if(data.success){
+                                toaster.pop("success", "修改物流信息成功");
+                                purchase.showLogistics = false;
+                            }
                         }
+                    })
+                } else {
+                    if (purchase.sendType != 1301){
+                        //没有则删除快递信息
+                        Logistics.clearLogistics({inid : purchase.inid}, {}, function (data) {
+                            if (data){
+                                if(data.success){
+                                    $scope.orderTableParams.reload();
+                                    toaster.pop("success", "修改物流信息成功");
+                                    purchase.showLogistics = false;
+                                }
+                            }
+                        })
                     }
-                })
+                }
             }
         };
 

+ 2 - 1
src/main/webapp/resources/view/common/modal/edit_address_modal.html

@@ -162,7 +162,8 @@
 							<label class="check-active">
 								<input ng-model="isSetTop" type="checkbox" id="check-act">
 								<label for="check-act"></label>
-								<span>设置为默认收货地址</span>
+								<span ng-if="!isSendType">设置为默认收货地址</span>
+								<span ng-if="isSendType">设置为默认发货地址</span>
 							</label>
 						</div>
 					</div>

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

@@ -541,7 +541,7 @@
                             <div style="float: right; color: #ccc;">
                                 <a ng-if="checkinvoice.status!=404" class="taggle-address edit-address" ng-click="editAddr(jsonSdAddress)" style="color: #5078cb;">编辑</a>
                                 <!--<a ng-if="checkinvoice.status!=404" class="taggle-address" ng-click="taggleAddress(jsonSdAddress)"><i class="fa fa-refresh" aria-hidden="true"></i>&nbsp;切换</a>-->
-                                <a ng-if="checkinvoice.status!=404 && total<20" class="taggle-address" ng-click="editAddr()"> | 新增</a>
+                                <a ng-if="checkinvoice.status!=404 && total<20" class="taggle-address" ng-click="editAddr()" style="color: #5078cb;"> | 新增</a>
                             </div>
                         </span>
                     </li>
@@ -693,7 +693,7 @@
                     <dd class="pay_price">
                         <div ng-if="checkinvoice.status==406">
                             <a href="javascript:void(0)" ng-click="saveCheck()" class="confirm">确认发货</a>
-                            <a href="vendor#/order/center" class="cancel">取消</a>
+                            <a ng-click="backToDelivery()" class="cancel">取消</a>
                             <a ng-click="addDistributor()" class="add">新增配送商</a>
                         </div>
                     </dd>

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

@@ -836,7 +836,7 @@
 							<a ng-click="setChildStatus('','订单状态')">订单状态</a>
 							<a ng-if="status == 'tobeconfirmed' || status == 'all'" ng-click="setChildStatus('501','待买家付款')" title="">待买家付款</a>
 							<a ng-if="status == 'tobeconfirmed' || status == 'all'" ng-click="setChildStatus('504','付款确认中')" title="">付款确认中</a>
-							<a ng-if=" status == 'all'" ng-click="setChildStatus('502-406','待发货')" title="">待发货</a>
+							<a ng-if=" status == 'comfirmed' || status == 'all'" ng-click="setChildStatus('502-406','待发货')" title="">待发货</a>
 							<a ng-if="status == 'inbound' || status == 'all' || status == 'toBeReviewed'" ng-click="setChildStatus('404','待买家收货')" title="">待买家收货</a>
 							<a ng-if="status == 'tobepaid' || status == 'all' || status == 'toBeReviewed'" ng-click="setChildStatus('514','待商城付款')" title="">待商城付款</a>
 							<a ng-if="status == 'completed' || status == 'tobepaid' || status == 'all' || status == 'toBeReviewed'" ng-click="setChildStatus('520','交易完成')" title="">交易完成</a>
@@ -941,7 +941,7 @@
 										<div class="row">配送方式: <em>{{deliveryMethod[purchase.sendType]}}</em></div>
 										<div class="row">物流公司:
 											<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"/>
+												<input type="text" style="border: #5078cb 1px solid;" class="form-control select-adder" ng-model="logistics.companyName" ng-focus="onFocus()" ng-blur="onBlur()" placeholder="请选择物流公司" 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>