فهرست منبع

采购订单批量回复设置一度
采购询价单红点数量显示错误
app.js文件红点请求优化

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@10281 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

wangmh 8 سال پیش
والد
کامیت
d2fadc69c2

+ 18 - 16
src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryItemDao.java

@@ -174,20 +174,22 @@ public interface PurchaseInquiryItemDao extends JpaSpecificationExecutor<Purchas
 	 */
 	@Query("select count(p), p.status from PurchaseInquiryItem p where p.id in :ids group by p.status")
     List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
-//	/**
-//	 * 获得已报价的未读数量
-//	 *
-//	 * @Param ids 未读单据id
-//	 * @return
-//	 */
-//	@Query("select count(p), p.status from PurchaseInquiryItem p where p.id in :ids and p.agreed is null and p.invalid <> 1 and p.status=201")
-//    List<Object[]> getUnreadCount(@Param("ids") List<Long> ids);
-//	/**
-//	 * 获得待报价的未读数量
-//	 *
-//	 * @Param ids 未读单据id
-//	 * @return
-//	 */
-//	@Query("select count(p), p.status from PurchaseInquiryItem p where p.id in :ids and p.inquiry.overdue=0 and p.inquiry.check <> 1 group by p.status")
-//    List<Object[]> getUnreadCount2(@Param("ids") List<Long> ids);
+
+	/**
+	 * 获得已报价的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p) from PurchaseInquiryItem p where p.id in :ids and p.agreed is null and p.invalid <> 1 and p.status=201")
+    Integer getOfferCount(@Param("ids") List<Long> ids);
+
+	/**
+	 * 获得待报价的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p) from PurchaseInquiryItem p where p.id in :ids and p.inquiry.overdue=0 and p.inquiry.check <> 1 and p.status=200")
+	Integer getNotOfferCount(@Param("ids") List<Long> ids);
 }

+ 16 - 1
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -559,7 +559,22 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 		if (CollectionUtils.isEmpty(ids)){
 			return new ArrayList<>();
 		}
-		return purchaseInquiryItemDao.getUnreadCountEveryStatus(ids);
+		List<Object[]> list = new ArrayList<>();
+		Object[] objects = new Object[2];
+		objects[0] = purchaseInquiryItemDao.getOfferCount(ids);
+		objects[1] = 201;
+		if (objects[0] == null){
+			objects[0] = 0;
+		}
+        list.add(objects);
+        objects = new Object[2];
+		objects[0] = purchaseInquiryItemDao.getNotOfferCount(ids);
+		objects[1] = 200;
+		if (objects[0] == null){
+			objects[0] = 0;
+		}
+        list.add(objects);
+		return list;
 	}
 
 	@Override

+ 0 - 2
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java

@@ -294,8 +294,6 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 				XingePusher.pushByUser(user, "新增采购单回复", "单号:" + order.getCode() + ",供应商:" + vendor.getEnName(), "", "");
 			}
 		}
-		// 将采购企业采购员的 单据设置成未读
-		userOrderDao.setReadStatus(order.getEnUU(), order.getUserUU(), "purc$orders", "purc", (short) Status.NOT_READ.value(), order.getId());
 		return reply;
 	}
 

+ 47 - 35
src/main/webapp/resources/js/index/app.js

@@ -2392,7 +2392,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
             //获得各分类未阅读数量
             var getUnreadCount = function () {
-                getService().getUnreadCount(null, function (data) {
+                PurcOrders.getUnreadCount(null, function (data) {
                     $scope.unread = data;
                 });
             };
@@ -2402,7 +2402,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.setOrdersRead = function (id) {
                 var sourceId = [];
                 sourceId.push(id);
-                getService().setRead({}, sourceId, function (message) {
+                PurcOrders.setRead({}, sourceId, function (message) {
                     // $scope.getUnreadIds();
                     getUnreadCount();
                 });
@@ -2410,7 +2410,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
             //获取未读单据id
             var getUnreadIds = function () {
-                getService().getUnreadIds({}, "", function (message) {
+                PurcOrders.getUnreadIds({}, "", function (message) {
                     $scope.unreadCode = message.content;
                 });
             };
@@ -2427,7 +2427,6 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.getReply = function (item) {
                 if (!item.replies) {
                     PurcOrderItem.getReply({orderItemId: item.id}, function (replies) {
-                        change.html
                         item.replies = replies;
                     });
                 }
@@ -2709,6 +2708,19 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             });
         };
 
+        //批量设置消息已读
+        $scope.setOrdersReadByBatch = function () {
+            var sourceId = [];
+            angular.forEach($scope.tableParams.data, function (order) {
+                if (order.$selected == true) {
+                    sourceId.push(order.id);
+                }
+            });
+            PurcOrderItem.setRead({}, sourceId, function (message) {
+                getUnreadCount();
+            });
+        };
+
         var getUnreadIds = function () {
         	PurcOrderItem.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
@@ -3048,7 +3060,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getUnreadCount(null, function(data){
+            PurcChange.getUnreadCount(null, function(data){
                 $scope.unread = data;
                 console.log(data);
             });
@@ -3059,7 +3071,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setRead({}, sourceId, function (message) {
+            PurcChange.setRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
@@ -3067,7 +3079,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获取未读单据id
         var getUnreadIds = function (){
-            getService().getUnreadIds({}, "", function (message) {
+            PurcChange.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };
@@ -3239,7 +3251,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getUnreadCount(null, function (data) {
+            PurcInquiry.getUnreadCount(null, function (data) {
                 $scope.unread = data;
                 console.log(data);
             });
@@ -3249,14 +3261,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setRead({}, sourceId, function (message) {
+            PurcInquiry.setRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
         };
 
         var getUnreadIds = function () {
-            getService().getUnreadIds({}, "", function (message) {
+            PurcInquiry.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };
@@ -4183,7 +4195,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getUnreadCount(null, function(data){
+            PurchaseInquiry.getUnreadCount(null, function(data){
                 $scope.unread = data;
             });
         };
@@ -4193,7 +4205,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setRead({}, sourceId, function (message) {
+            PurchaseInquiry.setRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
@@ -4201,7 +4213,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得未读单据id
         var getUnreadIds = function (){
-            getService().getUnreadIds({}, "", function (message) {
+            PurchaseInquiry.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };
@@ -4833,7 +4845,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getUnreadCount(null, function(data){
+            PurcInquiryMould.getUnreadCount(null, function(data){
                 $scope.unread = data;
                 console.log(data);
             });
@@ -4844,7 +4856,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setRead({}, sourceId, function (message) {
+            PurcInquiryMould.setRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
@@ -4852,7 +4864,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获取未读单据id
         var getUnreadIds = function (){
-            getService().getUnreadIds({}, "", function (message) {
+            PurcInquiryMould.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };
@@ -5758,7 +5770,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getUnreadCount(null, function (data) {
+            PurcNotice.getUnreadCount(null, function (data) {
                 $scope.unread = data;
                 console.log(data);
             });
@@ -5769,14 +5781,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setRead({}, sourceId, function (message) {
+            PurcNotice.setRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
         };
 
         var getUnreadIds = function () {
-            getService().getUnreadIds({}, "", function (message) {
+            PurcNotice.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };
@@ -9846,7 +9858,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
             //获得各分类未阅读数量
             var getUnreadCount = function () {
-                getService().getUnreadCount(null, function (data) {
+                MakeOrder.getUnreadCount(null, function (data) {
                     $scope.unread = data;
                     console.log(data);
                 });
@@ -9857,14 +9869,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             $scope.setOrdersRead = function (id) {
                 var sourceId = [];
                 sourceId.push(id);
-                getService().setRead({}, sourceId, function (message) {
+                MakeOrder.setRead({}, sourceId, function (message) {
                     // $scope.getUnreadIds();
                     getUnreadCount();
                 });
             };
 
             var getUnreadIds = function () {
-                getService().getUnreadIds({}, "", function (message) {
+                MakeOrder.getUnreadIds({}, "", function (message) {
                     $scope.unreadCode = message.content;
                 });
             };
@@ -10879,13 +10891,13 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
             }
         });
 
-//        //设置单据已读
-//        var setOrdersRead = function () {
-//            var ids = [];
-//            GetProductInfo.setRead({}, ids, function (message) {
-//            });
-//        };
-//        setOrdersRead();
+       //设置单据已读
+       var setOrdersRead = function () {
+           var ids = [];
+           GetProductInfo.setRead({}, ids, function (message) {
+           });
+       };
+       setOrdersRead();
 
         // 搜索框回车
         $scope.onSearch = function () {
@@ -15206,7 +15218,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getPurcUnreadCount(null, function(data){
+            PurcTender.getPurcUnreadCount(null, function(data){
                 $scope.unread = data;
                 console.log(data);
             });
@@ -15217,7 +15229,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setPurcRead({}, sourceId, function (message) {
+            PurcTender.setPurcRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
@@ -15225,7 +15237,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获取未读单据id
         var getUnreadIds = function (){
-            getService().getPurcUnreadIds({}, "", function (message) {
+            PurcTender.getPurcUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };
@@ -16455,7 +16467,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
 
         //获得各分类未阅读数量
         var getUnreadCount = function () {
-            getService().getUnreadCount(null, function (data) {
+            PurcTender.getUnreadCount(null, function (data) {
                 $scope.unread = data;
                 console.log(data);
             });
@@ -16466,14 +16478,14 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
         $scope.setOrdersRead = function (id) {
             var sourceId = [];
             sourceId.push(id);
-            getService().setRead({}, sourceId, function (message) {
+            PurcTender.setRead({}, sourceId, function (message) {
                 // $scope.getUnreadIds();
                 getUnreadCount();
             });
         };
 
         var getUnreadIds = function () {
-            getService().getUnreadIds({}, "", function (message) {
+            PurcTender.getUnreadIds({}, "", function (message) {
                 $scope.unreadCode = message.content;
             });
         };

+ 3 - 75
src/main/webapp/resources/js/index/services/Purc.js

@@ -163,18 +163,6 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'waiting'
 				}
-			},
-			setRead:{
-				url: 'sale/orders/setRead/purc',
-				method: 'POST'
-			},
-			getUnreadIds:{
-				url: 'sale/orders/getUnreadIds/purc',
-				method: 'GET'
-			},
-			getUnreadCount:{
-				url: 'sale/orders/unread/purc',
-				method: 'GET'
 			}
 		});
 	}]).factory('PurcOrders', ['$resource', function($resource) {
@@ -277,18 +265,6 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'unread'
 				}
-			},
-			setRead:{
-				url: 'sale/changes/setRead',
-				method: 'POST'
-			},
-			getUnreadIds:{
-				url: 'sale/changes/getUnreadIds',
-				method: 'GET'
-			},
-			getUnreadCount:{
-				url: 'sale/changes/unread',
-				method: 'GET'
 			}
 		});
 	}]).factory('PurcInquiry', ['$resource', function($resource) {
@@ -404,19 +380,7 @@ define([ 'ngResource'], function() {
                 params: {
                     _state: 'invalid'
                 }
-			},
-			getUnreadIds:{
-				url: 'sale/inquiry/getUnreadIds',
-				method: 'GET'
-			},
-			getUnreadCount:{
-				url: 'sale/inquiry/unread',
-				method: 'GET'
-			},
-			setRead:{
-				url: 'sale/inquiry/setRead',
-				method: 'POST'
-            }
+			}
         });
     }]).factory('PurcTender', ['$resource', function($resource) {
     	return $resource('tender', {}, {
@@ -676,19 +640,7 @@ define([ 'ngResource'], function() {
                 params: {
                     _state: 'invalid'
                 }
-            },
-			setRead:{
-				url: 'sale/mould/setRead',
-				method: 'POST'
-			},
-			getUnreadIds:{
-				url: 'sale/mould/getUnreadIds',
-				method: 'GET'
-			},
-			getUnreadCount:{
-				url: 'sale/mould/unread',
-				method: 'GET'
-			}
+            }
         });
 	}]).factory('PurcNotice', ['$resource', function($resource) {
 		return $resource('sale/notice/:id', {}, {
@@ -757,19 +709,7 @@ define([ 'ngResource'], function() {
                 params: {
                     _state: 'waiting'
                 }
-            },
-			setRead:{
-				url: 'sale/notice/setRead',
-				method: 'POST'
-			},
-			getUnreadIds:{
-				url: 'sale/notice/getUnreadIds',
-				method: 'GET'
-			},
-			getUnreadCount:{
-				url: 'sale/notice/unread',
-				method: 'GET'
-			}
+            }
         });
 	}]).factory('SaleSend', ['$resource', function($resource) {
 		return $resource('sale/notice/sends/:id', {}, {
@@ -936,18 +876,6 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'todo'
 				}
-			},
-			setRead:{
-				url: 'sale/changes/setRead',
-				method: 'POST'
-			},
-			getUnreadIds:{
-				url: 'sale/changes/getUnreadIds',
-				method: 'GET'
-			},
-			getUnreadCount:{
-				url: 'sale/changes/unread',
-				method: 'GET'
 			}
 		});
 	}]).factory('PurcInquiryHis', ['$resource', function($resource) {

+ 1 - 1
src/main/webapp/resources/tpl/index/sale/order.html

@@ -324,7 +324,7 @@
 				<div>
 					<label><input type="checkbox" class="selector select_all"
 						ng-model="checkboxes.checked" ng-click="checkAll()">全选</label> <a ng-if="active=='todo'" href="javascript:void(0)"
-						class="btn btn-default btn-xs" ng-click="replyByBatch()" title="选中的单据按照客户需求的数量和交期默认回复">&nbsp;批量回复&nbsp;</a>
+						class="btn btn-default btn-xs" ng-click="replyByBatch();setOrdersReadByBatch()" title="选中的单据按照客户需求的数量和交期默认回复">&nbsp;批量回复&nbsp;</a>
 						<!--<div class="btn-group dropdown">
   							<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
     							&nbsp;&nbsp;标记为&nbsp;&nbsp;<span class="caret"></span>&nbsp;