hejq 8 лет назад
Родитель
Сommit
9e02817ed5

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

@@ -387,9 +387,11 @@ public class SaleNoticeController {
 			send = purchaseNoticeService.send(send);
 			tokenService.delete(token);
 		}
-		if (send != null) {
-			logger.log("客户送货提醒", "给同一客户多个送货提醒填写数量并确认发货", send.sendDescription(), null, send.getId());
-			map.put("id", send.getId());
+		if (null != send ) {
+		    if(null != send.getId()) {
+                logger.log("客户送货提醒", "给同一客户多个送货提醒填写数量并确认发货", send.sendDescription(), null, send.getId());
+                map.put("id", send.getId());
+            }
 			return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
 		} else {
 			throw new IllegalOperatorException("程序错误");

+ 8 - 4
src/main/webapp/resources/js/index/app.js

@@ -7036,11 +7036,15 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             } else {
                 if (!isSumbit) {
                     PurcNotice.sendByBatch({token: token}, $scope.saleSend, function (data) {
-                        toaster.pop('success', '提示', '发货成功,跳转至发货单:' + $scope.saleSend.code);
-                        $modalInstance.close('success');
-                        $state.go('sale.send_detail', {id: data.id});
+                        if(data.id) {
+                            toaster.pop('success', '提示', '发货成功,跳转至发货单:' + $scope.saleSend.code);
+                            $modalInstance.close('success');
+                            $state.go('sale.send_detail', {id: data.id});
+                        } else if(data.info) {
+                            toaster.pop('error', '提示', '发货失败,请刷新页面重试');
+                        }
                     }, function (response) {
-                        toaster.pop('error', '错误', response.data);
+                        toaster.pop('error', '错误', '发货失败');
                     });
                     isSumbit = true;
                     return true;