Просмотр исходного кода

单据消息红点
部分注释爆红问题

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

wangmh 8 лет назад
Родитель
Сommit
e72a68057f
65 измененных файлов с 2052 добавлено и 822 удалено
  1. 6 14
      src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java
  2. 54 5
      src/main/java/com/uas/platform/b2b/controller/MakeOrderController.java
  3. 11 6
      src/main/java/com/uas/platform/b2b/controller/PurcProductController.java
  4. 98 9
      src/main/java/com/uas/platform/b2b/controller/PurchaseTenderController.java
  5. 62 12
      src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java
  6. 104 5
      src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java
  7. 54 5
      src/main/java/com/uas/platform/b2b/controller/SaleInquiryMouldController.java
  8. 70 27
      src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java
  9. 74 18
      src/main/java/com/uas/platform/b2b/controller/SaleOrderChangeController.java
  10. 168 72
      src/main/java/com/uas/platform/b2b/controller/SnapshotController.java
  11. 20 0
      src/main/java/com/uas/platform/b2b/controller/VendorController.java
  12. 13 1
      src/main/java/com/uas/platform/b2b/dao/CustomerDao.java
  13. 9 3
      src/main/java/com/uas/platform/b2b/dao/MakeOrderDao.java
  14. 4 6
      src/main/java/com/uas/platform/b2b/dao/ProductDao.java
  15. 9 0
      src/main/java/com/uas/platform/b2b/dao/PurchaseApCheckDao.java
  16. 24 2
      src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryItemDao.java
  17. 8 2
      src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryMouldDao.java
  18. 8 0
      src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java
  19. 8 2
      src/main/java/com/uas/platform/b2b/dao/PurchaseOrderChangeDao.java
  20. 13 6
      src/main/java/com/uas/platform/b2b/dao/PurchaseTenderDao.java
  21. 20 2
      src/main/java/com/uas/platform/b2b/dao/UserOrderDao.java
  22. 9 0
      src/main/java/com/uas/platform/b2b/dao/VendorDao.java
  23. 1 1
      src/main/java/com/uas/platform/b2b/model/PurchaseOrderReceived.java
  24. 4 1
      src/main/java/com/uas/platform/b2b/service/CustomerService.java
  25. 3 3
      src/main/java/com/uas/platform/b2b/service/MakeOrderService.java
  26. 3 3
      src/main/java/com/uas/platform/b2b/service/ProductService.java
  27. 6 0
      src/main/java/com/uas/platform/b2b/service/PurchaseApCheckService.java
  28. 4 2
      src/main/java/com/uas/platform/b2b/service/PurchaseInquiryMouldService.java
  29. 18 7
      src/main/java/com/uas/platform/b2b/service/PurchaseInquiryService.java
  30. 6 0
      src/main/java/com/uas/platform/b2b/service/PurchaseNoticeService.java
  31. 4 2
      src/main/java/com/uas/platform/b2b/service/PurchaseOrderChangeService.java
  32. 3 7
      src/main/java/com/uas/platform/b2b/service/PurchaseTenderService.java
  33. 5 0
      src/main/java/com/uas/platform/b2b/service/VendorService.java
  34. 21 0
      src/main/java/com/uas/platform/b2b/service/impl/CustomerServiceImpl.java
  35. 11 6
      src/main/java/com/uas/platform/b2b/service/impl/MakeOrderServiceImpl.java
  36. 20 6
      src/main/java/com/uas/platform/b2b/service/impl/ProductServiceImpl.java
  37. 24 7
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java
  38. 15 5
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryMouldServiceImpl.java
  39. 13 18
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java
  40. 22 2
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java
  41. 14 5
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderChangeServiceImpl.java
  42. 5 2
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderServiceImpl.java
  43. 95 20
      src/main/java/com/uas/platform/b2b/service/impl/PurchaseTenderServiceImpl.java
  44. 34 4
      src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java
  45. 24 0
      src/main/webapp/resources/js/index/services/BaseInfo.js
  46. 12 0
      src/main/webapp/resources/js/index/services/Fa.js
  47. 13 1
      src/main/webapp/resources/js/index/services/Make.js
  48. 8 0
      src/main/webapp/resources/js/index/services/Product.js
  49. 93 1
      src/main/webapp/resources/js/index/services/Purc.js
  50. 9 0
      src/main/webapp/resources/tpl/index/baseInfo/prodList.html
  51. 16 3
      src/main/webapp/resources/tpl/index/fa/apCheck.html
  52. 4 4
      src/main/webapp/resources/tpl/index/fa/left.html
  53. 11 11
      src/main/webapp/resources/tpl/index/home/right.html
  54. 10 0
      src/main/webapp/resources/tpl/index/make/change.html
  55. 27 4
      src/main/webapp/resources/tpl/index/make/order.html
  56. 16 3
      src/main/webapp/resources/tpl/index/purc/inquiry.html
  57. 4 4
      src/main/webapp/resources/tpl/index/purc/left.html
  58. 1 1
      src/main/webapp/resources/tpl/index/purc/tender.html
  59. 18 0
      src/main/webapp/resources/tpl/index/purc/tenderlist.html
  60. 16 4
      src/main/webapp/resources/tpl/index/sale/change.html
  61. 26 9
      src/main/webapp/resources/tpl/index/sale/inquiry.html
  62. 27 4
      src/main/webapp/resources/tpl/index/sale/inquiry_mould.html
  63. 7 7
      src/main/webapp/resources/tpl/index/sale/left.html
  64. 511 465
      src/main/webapp/resources/tpl/index/sale/notice.html
  65. 22 3
      src/main/webapp/resources/tpl/index/sale/tenderlist.html

+ 6 - 14
src/main/java/com/uas/platform/b2b/controller/BaseInfoController.java

@@ -458,28 +458,28 @@ public class BaseInfoController {
 	}
 
 	/**
-	 * 设置消息已读
+	 * 设置单据已读
 	 * @author wangmh
 	 */
 	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
 	@ResponseBody
 	public void setReadByOrder(@RequestBody Long... sourceId) {
-		productService.setReadByOrder(sourceId);
+		productService.setReadByOrder("sale", sourceId);
 	}
 
 	/**
-	 * 获得未阅读消息对应的单据id
+	 * 获得未阅读单据id
 	 * @author wangmh
 	 */
 	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
 	@ResponseBody
 	public ModelMap getUnreadIds() {
-		List<Long> list = productService.getUnreadIds();
+		List<Long> list = productService.getUnreadIds("sale");
 		return new ModelMap("content", list);
 	}
 
 	/**
-	 * 统计未阅读信息
+	 * 统计未阅读单据各个状态数量
 	 *
 	 * @return
 	 * @author wangmh
@@ -489,19 +489,11 @@ public class BaseInfoController {
 	@ResponseStatus(value = HttpStatus.OK)
 	public ModelMap getOrderUnreadCount() {
 		final ModelMap modelMap = new ModelMap();
-		List<Object[]> list = productService.getMakeOrderCount();
+		List<Object[]> list = productService.getProductCount("sale");
 		int all = 0;
-		String key;
 		int value;
 		for(Object[] objects : list){
-			key = objects[1].toString();
-			if(Status.NOT_REPLY.toString().equals(key)){
-				key = "notReply";
-			} else if (Status.REPLIED.toString().equals(key)){
-				key = "replied";
-			}
 			value = Integer.valueOf(objects[0].toString());
-			modelMap.put(key, value);
 			all = all + value;
 		}
 		modelMap.put("all", all);

+ 54 - 5
src/main/java/com/uas/platform/b2b/controller/MakeOrderController.java

@@ -8,11 +8,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.dubbo.common.utils.CollectionUtils;
@@ -334,4 +331,56 @@ public class MakeOrderController {
 		logger.log("委外加工单", "导出Excel列表", "导出已结案Excel列表");
 		return modelAndView;
 	}
+
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByOrder(@RequestBody Long... sourceId) {
+		makeOrderService.setReadByOrder("sale", sourceId);
+	}
+
+	/**
+	 * 获得未阅读单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getUnreadIds() {
+		List<Long> list = makeOrderService.getUnreadIds("sale");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读单据各个状态数量
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getOrderUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = makeOrderService.getMakeOrderCount("sale");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+			key = objects[1].toString();
+            value = Integer.valueOf(objects[0].toString());
+            if(Status.NOT_REPLY.toString().equals(key)){
+                key = "notReply";
+                all = all + value;
+            } else if (Status.REPLIED.toString().equals(key)){
+                key = "replied";
+                all = all + value;
+            }
+            modelMap.put(key, value);
+		}
+		modelMap.put("all", all);
+		return modelMap;
+	}
 }

+ 11 - 6
src/main/java/com/uas/platform/b2b/controller/PurcProductController.java

@@ -11,11 +11,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Sort.Direction;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.uas.platform.b2b.model.FileUpload;
@@ -74,7 +70,7 @@ public class PurcProductController {
 	/**
 	 * 导出Excel
 	 * 
-	 * @param params
+	 * @param keyword
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)
@@ -243,4 +239,13 @@ public class PurcProductController {
 		purcProductService.switchPorduct(status);
 	}
 
+    /**
+     * 设置单据已读
+     * @author wangmh
+     */
+    @RequestMapping(value = "/setRead", method = RequestMethod.POST)
+    @ResponseBody
+    public void setReadByOrder(@RequestBody Long... sourceId) {
+        productService.setReadByOrder("purc", sourceId);
+    }
 }

+ 98 - 9
src/main/java/com/uas/platform/b2b/controller/PurchaseTenderController.java

@@ -2,10 +2,7 @@ package com.uas.platform.b2b.controller;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.usermodel.Workbook;
@@ -17,11 +14,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.dubbo.common.utils.CollectionUtils;
@@ -784,5 +777,101 @@ public class PurchaseTenderController {
         return map;
     }
 
+    /**
+     * 设置消息已读
+     * @author wangmh
+     */
+    @RequestMapping(value = "/setRead", method = RequestMethod.POST)
+    @ResponseBody
+    public void setReadByOrder(@RequestBody Long... sourceId) {
+        purchaseTenderService.setReadByOrder("sale", sourceId);
+    }
+
+    /**
+     * 获得未阅读消息对应的单据id
+     * @author wangmh
+     */
+    @RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+    @ResponseBody
+    public ModelMap getUnreadIds() {
+        List<Long> list = purchaseTenderService.getUnreadIds("sale");
+        return new ModelMap("content", list);
+    }
+
+    /**
+     * 统计未阅读单据各个状态数量
+     *
+     * @return
+     * @author wangmh
+     */
+    @RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+    @ResponseBody
+    @ResponseStatus(value = HttpStatus.OK)
+    public ModelMap getOrderUnreadCount() {
+        final ModelMap modelMap = new ModelMap();
+        List<Object[]> list = purchaseTenderService.getTenderCount("sale");
+        String key;
+        int value;
+        for(Object[] objects : list){
+            key = objects[1].toString();
+            value = Integer.valueOf(objects[0].toString());
+            if("待投标".equals(key)){
+                key = "notReply";
+                modelMap.put(key, value);
+            }
+        }
+        System.out.println(new Date().getTime());
+        return modelMap;
+    }
 
+    /**
+     * 设置单据已读
+     * @author wangmh
+     */
+    @RequestMapping(value = "/setRead/purc", method = RequestMethod.POST)
+    @ResponseBody
+    public ModelMap setReadByPurcOrder(@RequestBody Long... sourceId) {
+        ModelMap modelMap = new ModelMap();
+        purchaseTenderService.setReadByOrder("purc", sourceId);
+        return modelMap;
+    }
+
+    /**
+     * 获得未阅读单据id
+     * @author wangmh
+     */
+    @RequestMapping(value = "/getUnreadIds/purc", method = RequestMethod.GET)
+    @ResponseBody
+    public ModelMap getPurcUnreadIds() {
+        List<Long> list = purchaseTenderService.getUnreadIds("purc");
+        return new ModelMap("content", list);
+    }
+
+    /**
+     * 统计未阅读单据各个状态数量
+     *
+     * @return
+     * @author wangmh
+     */
+    @RequestMapping(value = "/unread/purc", method = RequestMethod.GET, headers = "Accept=application/json")
+    @ResponseBody
+    @ResponseStatus(value = HttpStatus.OK)
+    public ModelMap getPurcOrderUnreadCount() {
+        final ModelMap modelMap = new ModelMap();
+        List<Object[]> list = purchaseTenderService.getTenderCount("purc");
+        String key;
+        int value;
+        int all = 0;
+        for(Object[] objects : list){
+            key = objects[1].toString();
+            value = Integer.valueOf(objects[0].toString());
+            if("待评标".equals(key)){
+                key = "notReply";
+                all = all + value;
+                modelMap.put(key, value);
+            }
+        }
+        modelMap.put("all", all);
+        return modelMap;
+    }
 }

+ 62 - 12
src/main/java/com/uas/platform/b2b/controller/SaleApCheckController.java

@@ -14,11 +14,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.fastjson.JSONObject;
@@ -107,7 +103,6 @@ public class SaleApCheckController {
 	/**
 	 * 作为卖家,获取应收对账单(全部)
 	 * 
-	 * @param json
 	 * @return
 	 */
 	@RequestMapping(value = "/getAll", method = RequestMethod.GET)
@@ -283,7 +278,6 @@ public class SaleApCheckController {
 	 * 作为卖家,获取应收对账单(全部)
 	 * 
 	 * @param params
-	 * @param keyword
 	 * @param searchFilter
 	 * @return
 	 */
@@ -419,7 +413,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 全部
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", method = RequestMethod.GET)
@@ -442,7 +436,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 已确认
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.DONE, method = RequestMethod.GET)
@@ -465,7 +459,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 未对账
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.TODO, method = RequestMethod.GET)
@@ -488,7 +482,7 @@ public class SaleApCheckController {
 	/**
 	 * 导出 - 已做废
 	 * 
-	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/allxls", params = RequestState.END, method = RequestMethod.GET)
@@ -511,7 +505,9 @@ public class SaleApCheckController {
 	/**
 	 * 全部导出
 	 * 
-	 * @param params
+	 * @param keyword
+	 * @param fromDate
+	 * @param endDate
 	 * @return
 	 */
 	@RequestMapping(value = "/xls", method = RequestMethod.GET)
@@ -537,4 +533,58 @@ public class SaleApCheckController {
 		logger.log("客户应收对账单", "导出Excel列表", "导出全部Excel列表");
 		return modelAndView;
 	}
+
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByOrder(@RequestBody Long... sourceId) {
+		purchaseApCheckService.setReadByOrder("purc", sourceId);
+	}
+
+	/**
+	 * 获得未阅读单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getUnreadIds() {
+		List<Long> list = purchaseApCheckService.getUnreadIds("purc");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读单据各个状态数量
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getOrderUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = purchaseApCheckService.getApCheckCount("purc");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+			key = objects[1].toString();
+			value = Integer.valueOf(objects[0].toString());
+			if("已作废".equals(key)){
+				key = "cancelled";
+				all = all + value;
+			} else if ("已确认".equals(key)){
+				key = "replied";
+				all = all + value;
+			} else if ("未对账".equals(key)){
+				key = "notReply";
+			}
+			modelMap.put(key, value);
+		}
+		modelMap.put("all", all);
+		return modelMap;
+	}
 }

+ 104 - 5
src/main/java/com/uas/platform/b2b/controller/SaleInquiryController.java

@@ -11,11 +11,7 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.fastjson.JSON;
@@ -730,4 +726,107 @@ public class SaleInquiryController {
 	public ModelMap addItemAttaches(Long itemId, FileUpload uploadItem) throws Exception{
 		return purchaseInquiryService.addAttaches(itemId, uploadItem);
 	}
+
+	/**
+	 * 设置消息已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByOrder(@RequestBody Long... sourceId) {
+		purchaseInquiryService.setReadByOrder("sale", sourceId);
+	}
+
+	/**
+	 * 获得未阅读消息对应的单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getUnreadIds() {
+		List<Long> list = purchaseInquiryService.getUnreadIds("sale");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读信息
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getInquiryUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = purchaseInquiryService.getInquiryCount("sale");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+			key = objects[1].toString();
+			if(Status.NOT_REPLY.toString().equals(key)){
+				key = "notReply";
+			} else if (Status.REPLIED.toString().equals(key)){
+				key = "replied";
+			}
+			value = Integer.valueOf(objects[0].toString());
+			modelMap.put(key, value);
+			all = all + value;
+		}
+		modelMap.put("all", all);
+		return modelMap;
+	}
+
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead/purc", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByPurcOrder(@RequestBody Long... sourceId) {
+		purchaseInquiryService.setReadByOrder("purc", sourceId);
+	}
+
+	/**
+	 * 获得未阅读单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds/purc", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getPurcUnreadIds() {
+		List<Long> list = purchaseInquiryService.getUnreadIds("purc");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读单据各个状态数量
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread/purc", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getPurcInquiryUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = purchaseInquiryService.getInquiryCount("purc");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+			key = objects[1].toString();
+            value = Integer.valueOf(objects[0].toString());
+            if(Status.NOT_REPLY.toString().equals(key)){
+                key = "notReply";
+                all = all + value;
+            } else if (Status.REPLIED.toString().equals(key)){
+                key = "replied";
+                all = all + value;
+            }
+            modelMap.put(key, value);
+        }
+        modelMap.put("all", all);
+		return modelMap;
+	}
 }

+ 54 - 5
src/main/java/com/uas/platform/b2b/controller/SaleInquiryMouldController.java

@@ -9,12 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.fastjson.JSON;
@@ -561,4 +558,56 @@ public class SaleInquiryMouldController {
 		return modelAndView;
 	}
 
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByPurcOrder(@RequestBody Long... sourceId) {
+		purchaseInquiryMouldService.setReadByOrder("sale", sourceId);
+	}
+
+	/**
+	 * 获得未阅读单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getPurcUnreadIds() {
+		List<Long> list = purchaseInquiryMouldService.getUnreadIds("sale");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读单据各个状态数量
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getPurcInquiryUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = purchaseInquiryMouldService.getInquiryMouldCount("sale");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+            key = objects[1].toString();
+            value = Integer.valueOf(objects[0].toString());
+            if(Status.NOT_REPLY.toString().equals(key)){
+                key = "notReply";
+                all = all + value;
+            } else if (Status.REPLIED.toString().equals(key)){
+                key = "replied";
+                all = all + value;
+            }
+            modelMap.put(key, value);
+		}
+		modelMap.put("all", all);
+		return modelMap;
+	}
+
 }

+ 70 - 27
src/main/java/com/uas/platform/b2b/controller/SaleNoticeController.java

@@ -1,30 +1,7 @@
 package com.uas.platform.b2b.controller;
 
-import java.io.UnsupportedEncodingException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Controller;
-import org.springframework.ui.ModelMap;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.servlet.ModelAndView;
-
-import com.uas.platform.b2b.model.PurchaseNotice;
-import com.uas.platform.b2b.model.SaleSend;
-import com.uas.platform.b2b.model.SaleSendAll;
-import com.uas.platform.b2b.model.SaleSendItem;
-import com.uas.platform.b2b.model.SearchFilter;
+import com.alibaba.fastjson.JSONObject;
+import com.uas.platform.b2b.model.*;
 import com.uas.platform.b2b.search.SearchService;
 import com.uas.platform.b2b.service.PurchaseNoticeService;
 import com.uas.platform.b2b.service.UserService;
@@ -44,6 +21,21 @@ import com.uas.search.b2b.model.SPage;
 import com.uas.search.b2b.model.Sort;
 import com.uas.search.b2b.model.Sort.Type;
 import com.uas.search.b2b.util.SearchConstants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.UnsupportedEncodingException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 卖家对送货提醒的操作
@@ -372,7 +364,6 @@ public class SaleNoticeController {
 	/**
 	 * 作为卖家,针对送货提醒批量发货
 	 * 
-	 * @param noticeId
 	 * @param json
 	 * @return
 	 */
@@ -765,7 +756,7 @@ public class SaleNoticeController {
 	/**
 	 * 更新明细行中的条码打印状态
 	 * 
-	 * @param ids
+	 * @param data
 	 */
 	@RequestMapping(value = "/updatePrintStatus", method = RequestMethod.POST)
 	@ResponseBody
@@ -773,4 +764,56 @@ public class SaleNoticeController {
 		List<SaleSendItem> saleSendItems = FlexJsonUtils.fromJsonArray(data, SaleSendItem.class);
 		purchaseNoticeService.updatePrintStatus(saleSendItems);
 	}
+
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByOrder(@RequestBody Long... sourceId) {
+		purchaseNoticeService.setReadByOrder("sale", sourceId);
+	}
+
+	/**
+	 * 获得未阅读单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getUnreadIds() {
+		List<Long> list = purchaseNoticeService.getUnreadIds("sale");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读单据各个状态数量
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getOrderUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = purchaseNoticeService.getNoticeCount("sale");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+			key = objects[1].toString();
+            value = Integer.valueOf(objects[0].toString());
+            if(Status.NOT_REPLY.toString().equals(key)){
+                key = "notReply";
+                all = all + value;
+            } else if (Status.REPLIED.toString().equals(key)){
+                key = "replied";
+                all = all + value;
+            }
+            modelMap.put(key, value);
+		}
+		modelMap.put("all", all);
+		return modelMap;
+	}
 }

+ 74 - 18
src/main/java/com/uas/platform/b2b/controller/SaleOrderChangeController.java

@@ -9,12 +9,9 @@ import org.springframework.data.domain.Page;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.alibaba.fastjson.JSON;
@@ -65,7 +62,8 @@ public class SaleOrderChangeController {
 	/**
 	 * 作为卖家,收到的采购变更单(全部)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(method = RequestMethod.GET)
@@ -97,7 +95,8 @@ public class SaleOrderChangeController {
 	/**
 	 * 作为卖家,收到的采购变更单(待处理)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(params = RequestState.TODO, method = RequestMethod.GET)
@@ -130,7 +129,8 @@ public class SaleOrderChangeController {
 	/**
 	 * 作为卖家,收到的采购变更单(已处理)
 	 * 
-	 * @param json
+	 * @param params
+	 * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(params = RequestState.DONE, method = RequestMethod.GET)
@@ -162,8 +162,9 @@ public class SaleOrderChangeController {
 
 	/**
 	 * 作为卖家,收到的采购变更单(已处理)
-	 * 
-	 * @param json
+	 *
+     * @param params
+     * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(params = RequestState.UNREAD, method = RequestMethod.GET)
@@ -194,8 +195,9 @@ public class SaleOrderChangeController {
 
 	/**
 	 * 作为卖家,收到的采购变更单(全部)
-	 * 
-	 * @param json
+	 *
+     * @param params
+     * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/info", method = RequestMethod.GET)
@@ -217,8 +219,9 @@ public class SaleOrderChangeController {
 
 	/**
 	 * 作为卖家,收到的采购变更单(待处理)
-	 * 
-	 * @param json
+	 *
+     * @param params
+     * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/info", params = RequestState.TODO, method = RequestMethod.GET)
@@ -242,8 +245,9 @@ public class SaleOrderChangeController {
 
 	/**
 	 * 作为卖家,收到的采购变更单(已处理)
-	 * 
-	 * @param json
+	 *
+     * @param params
+     * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/info", params = RequestState.DONE, method = RequestMethod.GET)
@@ -267,8 +271,9 @@ public class SaleOrderChangeController {
 
 	/**
 	 * 作为卖家,收到的采购变更单(无需处理)
-	 * 
-	 * @param json
+	 *
+     * @param params
+     * @param searchFilter
 	 * @return
 	 */
 	@RequestMapping(value = "/info", params = RequestState.UNREAD, method = RequestMethod.GET)
@@ -376,4 +381,55 @@ public class SaleOrderChangeController {
 		return modelAndView;
 	}
 
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByOrder(@RequestBody Long... sourceId) {
+		purchaseOrderChangeService.setReadByOrder("sale", sourceId);
+	}
+
+	/**
+	 * 获得未阅读单据id
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/getUnreadIds", method = RequestMethod.GET)
+	@ResponseBody
+	public ModelMap getUnreadIds() {
+		List<Long> list = purchaseOrderChangeService.getUnreadIds("sale");
+		return new ModelMap("content", list);
+	}
+
+	/**
+	 * 统计未阅读单据各个状态数量
+	 *
+	 * @return
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/unread", method = RequestMethod.GET, headers = "Accept=application/json")
+	@ResponseBody
+	@ResponseStatus(value = HttpStatus.OK)
+	public ModelMap getOrderUnreadCount() {
+		final ModelMap modelMap = new ModelMap();
+		List<Object[]> list = purchaseOrderChangeService.getChangeCount("sale");
+		int all = 0;
+		String key;
+		int value;
+		for(Object[] objects : list){
+			key = objects[1].toString();
+			value = Integer.valueOf(objects[0].toString());
+			if(Status.NOT_REPLY.toString().equals(key)){
+				key = "notReply";
+				all = all + value;
+			} else if (Status.REPLIED.toString().equals(key)){
+				key = "replied";
+				all = all + value;
+			}
+			modelMap.put(key, value);
+		}
+		modelMap.put("all", all);
+		return modelMap;
+	}
 }

+ 168 - 72
src/main/java/com/uas/platform/b2b/controller/SnapshotController.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2b.controller;
 
 import java.util.List;
 
+import com.uas.platform.b2b.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
@@ -13,29 +14,6 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.uas.platform.b2b.core.util.ThreadUtils;
 import com.uas.platform.b2b.model.User;
-import com.uas.platform.b2b.service.AddPartnerService;
-import com.uas.platform.b2b.service.CartService;
-import com.uas.platform.b2b.service.MakeAcceptService;
-import com.uas.platform.b2b.service.MakeOrderChangeService;
-import com.uas.platform.b2b.service.MakeOrderService;
-import com.uas.platform.b2b.service.MakeReturnService;
-import com.uas.platform.b2b.service.PagingReleaseService;
-import com.uas.platform.b2b.service.PurchaseAcceptService;
-import com.uas.platform.b2b.service.PurchaseApBillService;
-import com.uas.platform.b2b.service.PurchaseApCheckService;
-import com.uas.platform.b2b.service.PurchaseBadInService;
-import com.uas.platform.b2b.service.PurchaseBadOutService;
-import com.uas.platform.b2b.service.PurchaseInquiryMouldService;
-import com.uas.platform.b2b.service.PurchaseInquiryService;
-import com.uas.platform.b2b.service.PurchaseMRBService;
-import com.uas.platform.b2b.service.PurchaseNoticeService;
-import com.uas.platform.b2b.service.PurchaseOrderChangeService;
-import com.uas.platform.b2b.service.PurchaseOrderService;
-import com.uas.platform.b2b.service.PurchaseProofingService;
-import com.uas.platform.b2b.service.PurchaseReturnService;
-import com.uas.platform.b2b.service.PurchaseTenderService;
-import com.uas.platform.b2b.service.SaleARCheckService;
-import com.uas.platform.b2b.service.SaleQuotationService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.Status;
 
@@ -118,6 +96,15 @@ public class SnapshotController {
 	@Autowired
 	private PurchaseApCheckService purchaseApCheckService;
 
+	@Autowired
+	private ProductService productService;
+
+	@Autowired
+	private CustomerService customerService;
+
+	@Autowired
+	private VendorService vendorService;
+
 	/**
 	 * 统计待处理事项
 	 * 
@@ -464,15 +451,46 @@ public class SnapshotController {
 		//并行处理
 		ThreadUtils.task(new Runnable() {
 
+			@Override
+			public void run() {
+				//客户资料
+				SystemSession.setUser(user);
+				int count = 0;
+				List<Object[]> list = vendorService.getVendorCount("sale");
+				for (Object[] objects : list){
+					count = count + Integer.valueOf(objects[0].toString());
+				}
+				System.out.println("customer:" + count);
+				modelMap.put("customer", count);
+				SystemSession.clear();
+			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//产品导入
+				SystemSession.setUser(user);
+				int count = 0;
+				List<Object[]> list = productService.getProductCount("sale");
+				for (Object[] objects : list){
+					count = count + Integer.valueOf(objects[0].toString());
+				}
+				System.out.println("product:" + count);
+				modelMap.put("product", count);
+				SystemSession.clear();
+			}
+		}).task(new Runnable() {
+
 			@Override
 			public void run() {
 				//客户采购询价
 				SystemSession.setUser(user);
 				int count = 0;
-				List<Object[]> list = purchaseInquiryService.getInquiryCount();
+				List<Object[]> list = purchaseInquiryService.getInquiryCount("sale");
 				for (Object[] objects : list){
 					count = count + Integer.valueOf(objects[0].toString());
 				}
+				System.out.println("inquiry:" + count);
 				modelMap.put("inquiry", count);
 				SystemSession.clear();
 			}
@@ -483,10 +501,11 @@ public class SnapshotController {
 				//客户模具询价
 				SystemSession.setUser(user);
 				int count = 0;
-				List<Object[]> list = purchaseInquiryMouldService.getInquiryMouldCount();
+				List<Object[]> list = purchaseInquiryMouldService.getInquiryMouldCount("sale");
 				for (Object[] objects : list){
 					count = count + Integer.valueOf(objects[0].toString());
 				}
+				System.out.println("mould:" + count);
 				modelMap.put("mould", count);
 				SystemSession.clear();
 			}
@@ -499,15 +518,24 @@ public class SnapshotController {
 //				modelMap.put("quotation", saleQuotationService.getQuotationUnreadCount());
 //				SystemSession.clear();
 //			}
-//		}).task(new Runnable() {
-//
-//			@Override
-//			public void run() {
-//				//客户招标
-//				SystemSession.setUser(user);
-//				modelMap.put("tender", tenderService.getTenderUnreadCount());
-//				SystemSession.clear();
-//			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//客户招标
+				SystemSession.setUser(user);
+				int count = 0;
+				List<Object[]> list = tenderService.getTenderCount("sale");
+				for (Object[] objects : list){
+					if ("待投标".equals(objects[1].toString())) {
+						count = count + Integer.valueOf(objects[0].toString());
+						break;
+					}
+				}
+				System.out.println("tender:" + count);
+				modelMap.put("tender", count);
+				SystemSession.clear();
+			}
 		}).task(new Runnable() {
 
 			@Override
@@ -519,6 +547,7 @@ public class SnapshotController {
 				for (Object[] objects : list){
 					count = count + Integer.valueOf(objects[0].toString());
 				}
+				System.out.println("order:" + count);
 				modelMap.put("order", count);
 				SystemSession.clear();
 			}
@@ -529,10 +558,11 @@ public class SnapshotController {
 				//客户采购变更单
 				SystemSession.setUser(user);
 				int count = 0;
-				List<Object[]> list = purchaseOrderChangeService.getChangeCount();
+				List<Object[]> list = purchaseOrderChangeService.getChangeCount("sale");
 				for (Object[] objects : list){
 					count = count + Integer.valueOf(objects[0].toString());
 				}
+				System.out.println("change:" + count);
 				modelMap.put("change", count);
 				SystemSession.clear();
 			}
@@ -543,10 +573,11 @@ public class SnapshotController {
 				//客户委外单
 				SystemSession.setUser(user);
 				int count = 0;
-				List<Object[]> list = makeOrderService.getMakeOrderCount();
+				List<Object[]> list = makeOrderService.getMakeOrderCount("sale");
 				for (Object[] objects : list){
 					count = count + Integer.valueOf(objects[0].toString());
 				}
+				System.out.println("makeOrder:" + count);
 				modelMap.put("makeOrder", count);
 				SystemSession.clear();
 			}
@@ -561,18 +592,25 @@ public class SnapshotController {
 //				for (Object[] objects : list){
 //					count = count + Integer.valueOf(objects[0].toString());
 //				}
+//				System.out.println(count);
 //				modelMap.put("makeChange", count);
 //				SystemSession.clear();
 //			}
-//		}).task(new Runnable() {
-//
-//			@Override
-//			public void run() {
-//				//客户发货提醒
-//				SystemSession.setUser(user);
-//				modelMap.put("notice", purchaseNoticeService.getNoticeUnreadCount());
-//				SystemSession.clear();
-//			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//客户发货提醒
+				SystemSession.setUser(user);
+				int count = 0;
+				List<Object[]> list = purchaseNoticeService.getNoticeCount("sale");
+				for (Object[] objects : list){
+					count = count + Integer.valueOf(objects[0].toString());
+				}
+				System.out.println("notice:" + count);
+				modelMap.put("notice", count);
+				SystemSession.clear();
+			}
 //		}).task(new Runnable() {
 //
 //			@Override
@@ -663,24 +701,72 @@ public class SnapshotController {
 //				modelMap.put("makeReturns", makeReturnService.getReturnUnreadCount());
 //				SystemSession.clear();
 //			}
-//		}).task(new Runnable() {
-//
-//			@Override
-//			public void run() {
-//				//采购招标
-//				SystemSession.setUser(user);
-//				modelMap.put("purcTender", tenderService.getPurchaseTenderUnreadCount());
-//				SystemSession.clear();
-//			}
-//		}).task(new Runnable() {
-//
-//			@Override
-//			public void run() {
-//				//采购询价
-//				SystemSession.setUser(user);
-//				modelMap.put("purcInquiry", purchaseInquiryService.getPurchaseInquiryUnreadCount());
-//				SystemSession.clear();
-//			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//供应商资料
+				SystemSession.setUser(user);
+				List<Object[]> list = vendorService.getVendorCount("purc");
+				int count = 0;
+				for(Object[] objects : list){
+						count = count + Integer.valueOf(objects[0].toString());
+				}
+				System.out.println("purcVendor:" + count);
+				modelMap.put("purcVendor", count);
+				SystemSession.clear();
+			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//采购物料
+				SystemSession.setUser(user);
+				List<Object[]> list = productService.getProductCount("purc");
+				int count = 0;
+				for(Object[] objects : list){
+					count = count + Integer.valueOf(objects[0].toString());
+				}
+				System.out.println("purcProduct:" + count);
+				modelMap.put("purcProduct", count);
+				SystemSession.clear();
+			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//采购招标
+				SystemSession.setUser(user);
+				List<Object[]> list = tenderService.getTenderCount("purc");
+				int count = 0;
+				for(Object[] objects : list){
+					if("待评标".equals(objects[1].toString())){
+						count = count + Integer.valueOf(objects[0].toString());
+						break;
+					}
+				}
+				System.out.println("purcTender:" + count);
+				modelMap.put("purcTender", count);
+				SystemSession.clear();
+			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//采购询价
+				SystemSession.setUser(user);
+				List<Object[]> list = purchaseInquiryService.getInquiryCount("purc");
+				int count = 0;
+				for(Object[] objects : list){
+					if(Status.REPLIED.value() == Integer.valueOf(objects[1].toString())){
+						count = count + Integer.valueOf(objects[0].toString());
+						break;
+					}
+				}
+				System.out.println("purcInquiry:" + count);
+				modelMap.put("purcInquiry", count);
+				SystemSession.clear();
+			}
 		}).task(new Runnable() {
 
 			@Override
@@ -695,6 +781,7 @@ public class SnapshotController {
 						break;
 					}
 				}
+				System.out.println("purcOrder:" + count);
 				modelMap.put("purcOrder", count);
 				SystemSession.clear();
 			}
@@ -725,15 +812,24 @@ public class SnapshotController {
 //				modelMap.put("apBill", purchaseApBillService.getApBillUnreadCount());
 //				SystemSession.clear();
 //			}
-//		}).task(new Runnable() {
-//
-//			@Override
-//			public void run() {
-//				//应收对账单
-//				SystemSession.setUser(user);
-//				modelMap.put("apCheck", purchaseApCheckService.getApCheckUnreadCount());
-//				SystemSession.clear();
-//			}
+		}).task(new Runnable() {
+
+			@Override
+			public void run() {
+				//应收对账单
+				SystemSession.setUser(user);
+				List<Object[]> list = purchaseApCheckService.getApCheckCount("purc");
+				int count = 0;
+				for(Object[] objects : list){
+					if("已确认".equals(objects[1].toString())){
+						count = count + Integer.valueOf(objects[0].toString());
+						break;
+					}
+				}
+				System.out.println("apCheck:" + count);
+				modelMap.put("apCheck", count);
+				SystemSession.clear();
+			}
 //		}).task(new Runnable() {
 //
 //			@Override

+ 20 - 0
src/main/java/com/uas/platform/b2b/controller/VendorController.java

@@ -232,4 +232,24 @@ public class VendorController {
 	public Vendor findByBusinessCode(String businessCode) {
 		return vendorService.findByBusinessCode(businessCode);
 	}
+
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/customer/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setReadByIds(@RequestBody Long... sourceIds) {
+		vendorService.setReadByIds("sale", sourceIds);
+	}
+
+	/**
+	 * 设置单据已读
+	 * @author wangmh
+	 */
+	@RequestMapping(value = "/vendor/setRead", method = RequestMethod.POST)
+	@ResponseBody
+	public void setVendorReadByIds(@RequestBody Long... sourceIds) {
+		vendorService.setReadByIds("purc", sourceIds);
+	}
 }

+ 13 - 1
src/main/java/com/uas/platform/b2b/dao/CustomerDao.java

@@ -1,12 +1,24 @@
 package com.uas.platform.b2b.dao;
 
 import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
 import org.springframework.stereotype.Repository;
 
 import com.uas.platform.b2b.model.Customer;
 import com.uas.platform.core.data.repository.GenericRepository;
 
+import java.util.List;
+
 @Repository
 public interface CustomerDao extends JpaSpecificationExecutor<Customer>, GenericRepository<Customer, Long> {
-	
+
+    /**
+     * 获得每种单据状态的未读数量
+     *
+     * @Param ids 单据id
+     * @return
+     */
+    @Query("select count(p), p.status from Customer p where p.id in :ids group by p.status")
+    List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 9 - 3
src/main/java/com/uas/platform/b2b/dao/MakeOrderDao.java

@@ -81,13 +81,19 @@ public interface MakeOrderDao extends JpaSpecificationExecutor<MakeOrder>, JpaRe
 
 	/**
 	 * 根据企业UU查询委外加工单数量(主记录)
-	 * @param enUU
+	 * @param vendUU
 	 * @return
 	 */
 	@Query("select count(m) from MakeOrder m where m.vendUU = :vendUU")
 	public Long getOrderCountByVendUU(@Param("vendUU")Long vendUU);
 
 
-	@Query("select count(p), p.status from MakeOrder p where p.id in (select u.sourceId from UserOrders u where u.table='make$orders' and u.category=:category and u.enUU=:enUU and u.userUU=:userUU and u.readStatus=0) group by p.status")
-	public List<Object[]> getUnreadCountEveryStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("category") String category);
+	/**
+	 * 获得每种单据状态的数量
+	 *
+	 * @Param ids 单据id
+	 * @return
+	 */
+	@Query("select count(p), p.status from MakeOrder p where p.id in :ids group by p.status")
+	List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 4 - 6
src/main/java/com/uas/platform/b2b/dao/ProductDao.java

@@ -213,14 +213,12 @@ public interface ProductDao extends JpaSpecificationExecutor<Product>, JpaReposi
 	public Integer findProductBusinessStatusById(Long id);
 
 	/**
-	 * 获得每种单据状态的未读数量
+	 * 获得每种单据状态的数量
 	 *
-	 * @param enUU 企业UU
-	 * @param userUU 用户UU
-	 * @param category 分类(用于区分供应商(purc)和客户(sale),值为sale or purc
+	 * @param ids 单据id
 	 * @return
 	 */
-	@Query("select count(p), p.status from Product p where p.id in (select u.sourceId from UserOrders u where u.table=:table and u.category=:category and u.enUU=:enUU and u.userUU=:userUU and u.readStatus=0) group by p.status")
-	public List<Object[]> getUnreadCountEveryStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("table") String table, @Param("category") String category);
+	@Query("select count(p), p.status from Product p where p.id in :ids group by p.status")
+	public List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 
 }

+ 9 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseApCheckDao.java

@@ -54,4 +54,13 @@ public interface PurchaseApCheckDao extends JpaSpecificationExecutor<PurchaseApC
 	 */
 	@Query("select count(s) from PurchaseApCheck s where s.enUu=:enUu and s.checkStatus=:checkStatus")
 	public long getCountByenUUAndStatus(@Param("enUu") Long enUu, @Param("checkStatus") String checkStatus);
+
+	/**
+	 * 获得每种单据状态的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p), p.checkStatus from PurchaseApCheck p where p.id in :ids group by p.checkStatus")
+	List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 24 - 2
src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryItemDao.java

@@ -166,6 +166,28 @@ public interface PurchaseInquiryItemDao extends JpaSpecificationExecutor<Purchas
 	 */
     List<PurchaseInquiryItem> findByVendUUAndInvalidStatus(Long uu, short value);
 
-	@Query("select count(p), p.status from PurchaseInquiryItem p where p.id in (select u.sourceId from UserOrders u where u.table='v$purc$inquiryitems' and u.category=:category and u.enUU=:enUU and u.userUU=:userUU and u.readStatus=0) group by p.status")
-    List<Object[]> getUnreadCountEveryStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("category") String category);
+	/**
+	 * 获得每种单据状态的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@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);
 }

+ 8 - 2
src/main/java/com/uas/platform/b2b/dao/PurchaseInquiryMouldDao.java

@@ -145,6 +145,12 @@ public interface PurchaseInquiryMouldDao
 	 */
 	public PurchaseInquiryMould findByEnuuAndErpSourceId(Long enuu, Long erpSourceId);
 
-	@Query("select count(p), p.status from PurchaseInquiryMould p where p.id in (select u.sourceId from UserOrders u where u.table='v$purc$inquiry_mould' and u.category=:category and u.enUU=:enUU and u.userUU=:userUU and u.readStatus=0) group by p.status")
-	public List<Object[]> getUnreadCountEveryStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("category") String category);
+	/**
+	 * 获得每种单据状态的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p), p.status from PurchaseInquiryMould p where p.id in :ids group by p.status")
+	List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 8 - 0
src/main/java/com/uas/platform/b2b/dao/PurchaseNoticeDao.java

@@ -130,4 +130,12 @@ public interface PurchaseNoticeDao extends JpaSpecificationExecutor<PurchaseNoti
 	@Query("select count(p) from PurchaseNotice p where p.vendUU = :vendUU")
 	public long countByVendUU(@Param("vendUU")Long vendUU);
 
+	/**
+	 * 获得每种单据状态的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p), p.status from PurchaseNotice p where p.id in :ids group by p.status")
+	List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 8 - 2
src/main/java/com/uas/platform/b2b/dao/PurchaseOrderChangeDao.java

@@ -90,6 +90,12 @@ public interface PurchaseOrderChangeDao extends JpaSpecificationExecutor<Purchas
 	@Query("select count(p) from PurchaseOrderChange p where p.vendUU = :vendUU")
 	public long countByVendUU(@Param("vendUU")Long vendUU);
 
-	@Query("select count(p), p.status from PurchaseOrderChange p where p.id in (select u.sourceId from UserOrders u where u.table='purc$changes' and u.category=:category and u.enUU=:enUU and u.userUU=:userUU and u.readStatus=0) group by p.status")
-    List<Object[]> getUnreadCountEveryStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("category") String category);
+	/**
+	 * 获得每种单据状态的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p), p.status from PurchaseOrderChange p where p.id in :ids group by p.status")
+	List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 13 - 6
src/main/java/com/uas/platform/b2b/dao/PurchaseTenderDao.java

@@ -18,14 +18,21 @@ public interface PurchaseTenderDao extends JpaSpecificationExecutor<PurchaseTend
     List<PurchaseTender> findByEnUUAndCode(Long uu, String code);
 
     /**
-     * 获得每种单据状态的未读数量
+     * 获得待评标的数量
      *
-     * @param enUU 企业UU
-     * @param userUU 用户UU
-     * @param category 分类(用于区分供应商(purc)和客户(sale),值为sale or purc
+     * @param ids 单据id
      * @return
      */
-    @Query("select count(p), p.status from PurchaseTender p where p.id in (select u.sourceId from UserOrders u where u.table=:table and u.category=:category and u.enUU=:enUU and u.userUU=:userUU and u.readStatus=0) group by p.status")
-    public List<Object[]> getUnreadCountEveryStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("table") String table, @Param("category") String category);
+    @Query("select count(p) from PurchaseTender p where p.id in :ids and p.overdue = 1 and p.status = '待评标' and p.result <> 1")
+    public Integer getEvaluationCount(@Param("ids") List<Long> ids);
+
+    /**
+     * 获得待投标的数量
+     *
+     * @param ids 单据id
+     * @return
+     */
+    @Query("select count(p) from PurchaseTender p where p.id in :ids and p.overdue <> 1")
+    public Integer getTenterCount(@Param("ids") List<Long> ids);
 
 }

+ 20 - 2
src/main/java/com/uas/platform/b2b/dao/UserOrderDao.java

@@ -16,10 +16,28 @@ import java.util.List;
 @Repository
 public interface UserOrderDao extends JpaSpecificationExecutor<UserOrders>, JpaRepository<UserOrders, Long> {
 
+    /**
+     * 获取单据未读id
+     * @param enUU 企业UU号
+     * @param userUU 用户UU号
+     * @param table 表名
+     * @param category 分类(sale or purc)
+     * @return
+     */
     @Query("select o.sourceId from UserOrders o where o.userUU=:userUU and o.enUU=:enUU and o.table=:table and o.category=:category and o.readStatus=210")
     List<Long> getUnreadIds(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("table") String table, @Param("category") String category);
 
+    /**
+     * 将单据设为已读
+     * @param enUU 企业UU号
+     * @param userUU 用户UU号
+     * @param table 表名
+     * @param category 分类(sale or purc)
+     * @param status 阅读状态(Status.READ.value() or Status.NOT_READ.value())
+     * @param sourceIds 需要设置已读的id
+     * @return
+     */
     @Modifying
-    @Query("update UserOrders o set o.readStatus=211 where o.userUU=:userUU and o.enUU=:enUU and o.table=:table and o.category=:category and o.sourceId in :sourceId")
-    void setRead(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("table") String table, @Param("category") String category, @Param("sourceId") Long[] sourceId);
+    @Query("update UserOrders o set o.readStatus=:status where o.userUU=:userUU and o.enUU=:enUU and o.table=:table and o.category=:category and o.sourceId in :sourceIds")
+    void setReadStatus(@Param("enUU") Long enUU, @Param("userUU") Long userUU, @Param("table") String table, @Param("category") String category, @Param("status") Short status, @Param("sourceIds") Long... sourceIds);
 }

+ 9 - 0
src/main/java/com/uas/platform/b2b/dao/VendorDao.java

@@ -112,4 +112,13 @@ public interface VendorDao extends JpaSpecificationExecutor<Vendor>, GenericRepo
 	 */
 	@Query("from Vendor v where v.vendEnUU = :vendEnUU and v.myEnterprise.enName = :enName")
 	public Vendor findByVendAndCustName(@Param("vendEnUU") long vendEnUU, @Param("enName") String enName);
+
+	/**
+	 * 获得每种单据状态的未读数量
+	 *
+	 * @Param ids 未读单据id
+	 * @return
+	 */
+	@Query("select count(p), p.status from Vendor p where p.id in :ids group by p.status")
+	List<Object[]> getUnreadCountEveryStatus(@Param("ids") List<Long> ids);
 }

+ 1 - 1
src/main/java/com/uas/platform/b2b/model/PurchaseOrderReceived.java

@@ -142,7 +142,7 @@ public class PurchaseOrderReceived {
 	 */
 	@OneToMany(mappedBy = "order", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.MERGE }, fetch = FetchType.EAGER)
 	@OrderBy("number")
-	@Where(clause = "nvl(pd_acceptqty,0)<nvl(pd_qty,0)+nvl(pd_returnqty,0)")
+//	@Where(clause = "nvl(pd_acceptqty,0)<nvl(pd_qty,0)+nvl(pd_returnqty,0)")
 	private Set<PurchaseOrderReceivedItem> orderItems;
 	
 	/**

+ 4 - 1
src/main/java/com/uas/platform/b2b/service/CustomerService.java

@@ -110,5 +110,8 @@ public interface CustomerService {
 	 * @param custIds 多个id用逗号隔开
 	 */
 	public void deleteCustomers(String custIds);
-	
+
+	List<Object[]> getCustomerCount(String sale);
+
+	List<Long> getUnreadIds(String sale);
 }

+ 3 - 3
src/main/java/com/uas/platform/b2b/service/MakeOrderService.java

@@ -232,9 +232,9 @@ public interface MakeOrderService {
 
 	Integer getPurchaseOrderUnreadCount();
 
-    List<Object[]> getMakeOrderCount();
+    List<Object[]> getMakeOrderCount(String category);
 
-    void setReadByOrder(Long[] sourceId);
+    void setReadByOrder(String category, Long[] sourceId);
 
-	List<Long> getUnreadIds();
+	List<Long> getUnreadIds(String category);
 }

+ 3 - 3
src/main/java/com/uas/platform/b2b/service/ProductService.java

@@ -172,9 +172,9 @@ public interface ProductService {
 	 */
 	public SPage<Product> findProductInfoByPageInfo(PageInfo pageInfo, String keyword);
 
-    List<Object[]> getMakeOrderCount();
+	List<Long> getUnreadIds(String category);
 
-	List<Long> getUnreadIds();
+	void setReadByOrder(String category, Long[] sourceId);
 
-	void setReadByOrder(Long[] sourceId);
+	List<Object[]> getProductCount(String category);
 }

+ 6 - 0
src/main/java/com/uas/platform/b2b/service/PurchaseApCheckService.java

@@ -136,4 +136,10 @@ public interface PurchaseApCheckService {
 	public long getCountByenUUAndStatus();
 
     Integer getApCheckUnreadCount();
+
+    List<Object[]> getApCheckCount(String category);
+
+    List<Long> getUnreadIds(String category);
+
+	void setReadByOrder(String category, Long[] sourceId);
 }

+ 4 - 2
src/main/java/com/uas/platform/b2b/service/PurchaseInquiryMouldService.java

@@ -241,7 +241,9 @@ public interface PurchaseInquiryMouldService {
 	 */
 	void reCheck(Long[] ids);
 
-	public Integer getInquiryMouldUnreadCount();
+    List<Object[]> getInquiryMouldCount(String category);
 
-    List<Object[]> getInquiryMouldCount();
+    void setReadByOrder(String category, Long[] sourceId);
+
+	List<Long> getUnreadIds(String category);
 }

+ 18 - 7
src/main/java/com/uas/platform/b2b/service/PurchaseInquiryService.java

@@ -247,13 +247,24 @@ public interface PurchaseInquiryService {
     List<PurchaseInquiryItem> findNotUploadInquiryReplyInvalid();
     ModelMap addAttaches(Long itemId, FileUpload uploadItem) throws Exception;
 
-    public Integer getInquiryUnreadCount();
-
-	Integer getPurchaseInquiryUnreadCount();
-
-    List<Object[]> getInquiryCount();
+	/**
+	 * 统计单据各个状态为阅读的数量
+	 * @param category 分类(sale or purc)
+	 * @return 根据单据状态获取未读单据数量 Object[0]为数量,Object[1]为单据状态
+	 */
+    List<Object[]> getInquiryCount(String category);
 
-    void setReadByOrder(Long[] sourceId);
+	/**
+	 * 设置订单已读
+	 * @param category 分类(sale or purc)
+	 * @param sourceIds 单据id
+	 */
+    void setReadByOrder(String category, Long[] sourceIds);
 
-	List<Long> getUnreadIds();
+	/**
+	 * 获得用户未阅读单据的id
+	 * @param category 分类(sale or purc)
+	 * @return 单据id集合
+	 */
+	List<Long> getUnreadIds(String category);
 }

+ 6 - 0
src/main/java/com/uas/platform/b2b/service/PurchaseNoticeService.java

@@ -306,4 +306,10 @@ public interface PurchaseNoticeService {
 	Integer getSendUnreadCount();
 
     SPage<PurchaseNotice> findAllNoticesByPageInfo(PageInfo pageInfo, String keyword, SearchFilter filter);
+
+	List<Long> getUnreadIds(String category);
+
+	void setReadByOrder(String category, Long[] sourceId);
+
+    List<Object[]> getNoticeCount(String category);
 }

+ 4 - 2
src/main/java/com/uas/platform/b2b/service/PurchaseOrderChangeService.java

@@ -107,7 +107,9 @@ public interface PurchaseOrderChangeService {
 	 */
 	public Long getAllCount();
 
-	Integer getChangeUnreadCount();
+	public List<Long> getUnreadIds(String category);
 
-    List<Object[]> getChangeCount();
+	public void setReadByOrder(String category, Long[] sourceId);
+
+	List<Object[]> getChangeCount(String category);
 }

+ 3 - 7
src/main/java/com/uas/platform/b2b/service/PurchaseTenderService.java

@@ -193,13 +193,9 @@ public interface PurchaseTenderService {
      */
     void publishOrSave(PurchaseTender purchaseTender, List<TenderContactInfo> contactInfos);
 
-    Integer getTenderUnreadCount();
+    List<Object[]> getTenderCount(String category);
 
-    Integer getPurchaseTenderUnreadCount();
+    List<Long> getUnreadIds(String category);
 
-    List<Object[]> getOrderCount();
-
-    List<Long> getUnreadIds();
-
-    void setReadByOrder(Long[] sourceId);
+    void setReadByOrder(String category, Long[] sourceId);
 }

+ 5 - 0
src/main/java/com/uas/platform/b2b/service/VendorService.java

@@ -106,4 +106,9 @@ public interface VendorService {
 	 */
 	public Vendor findByBusinessCode(String businessCode);
 
+    List<Object[]> getVendorCount(String category);
+
+	List<Long> getUnreadIds(String category);
+
+    void setReadByIds(String sale, Long[] sourceIds);
 }

+ 21 - 0
src/main/java/com/uas/platform/b2b/service/impl/CustomerServiceImpl.java

@@ -1,9 +1,11 @@
 package com.uas.platform.b2b.service.impl;
 
 import com.uas.platform.b2b.dao.CustomerDao;
+import com.uas.platform.b2b.dao.UserOrderDao;
 import com.uas.platform.b2b.model.Customer;
 import com.uas.platform.b2b.model.User;
 import com.uas.platform.b2b.service.CustomerService;
+import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.persistence.criteria.PredicateFactory;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
@@ -11,11 +13,13 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
 
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
+import java.util.ArrayList;
 import java.util.List;
 
 @Service
@@ -24,6 +28,9 @@ public class CustomerServiceImpl implements CustomerService {
 	@Autowired
 	private CustomerDao customerDao;
 
+	@Autowired
+	private UserOrderDao userOrderDao;
+
 	public Page<Customer> findAllByPageInfo(final Long enUU, final PageInfo pageInfo) {
 		Page<Customer> customers = customerDao.findAll(new Specification<Customer>() {
 
@@ -96,4 +103,18 @@ public class CustomerServiceImpl implements CustomerService {
 		}
 	}
 
+	@Override
+	public List<Object[]> getCustomerCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)) {
+			return new ArrayList<>();
+		}
+		return customerDao.getUnreadCountEveryStatus(ids);
+	}
+
+	@Override
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "sale$customers", category);
+	}
+
 }

+ 11 - 6
src/main/java/com/uas/platform/b2b/service/impl/MakeOrderServiceImpl.java

@@ -446,17 +446,22 @@ public class MakeOrderServiceImpl implements MakeOrderService {
 	}
 
 	@Override
-	public List<Object[]> getMakeOrderCount() {
-		return makeOrderDao.getUnreadCountEveryStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "sale");
+	public List<Object[]> getMakeOrderCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return makeOrderDao.getUnreadCountEveryStatus(ids);
 	}
 
 	@Override
-	public void setReadByOrder(Long[] sourceId) {
-		userOrderDao.setRead(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "make$orders", "sale", sourceId);
+	@Transactional
+	public void setReadByOrder(String category, Long[] sourceId) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "make$orders", category, (short)Status.READ.value(), sourceId);
 	}
 
 	@Override
-	public List<Long> getUnreadIds() {
-		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "make$orders", "sale");
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "make$orders", category);
 	}
 }

+ 20 - 6
src/main/java/com/uas/platform/b2b/service/impl/ProductServiceImpl.java

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
@@ -447,17 +448,30 @@ public class ProductServiceImpl implements ProductService {
 	 */
 
 	@Override
-	public List<Object[]> getMakeOrderCount() {
-		return productDao.getUnreadCountEveryStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "products", "sale");
+	public List<Object[]> getProductCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return productDao.getUnreadCountEveryStatus(ids);
 	}
 
 	@Override
-	public List<Long> getUnreadIds() {
-		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "products", "sale");
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "products", category);
 	}
 
 	@Override
-	public void setReadByOrder(Long[] sourceId) {
-		userOrderDao.setRead(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "products", "sale", sourceId);
+	@Transactional
+	public void setReadByOrder(String category, Long[] sourceIds) {
+        Long[] temp = sourceIds;
+        if (sourceIds == null || sourceIds.length == 0){
+            List<Long> ids = userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "products", category);
+			if (CollectionUtils.isEmpty(ids)){
+				return;
+			}
+			temp = ids.toArray(new Long[ids.size()]);
+        }
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "products", category, (short) Status.READ.value(), temp);
 	}
 }

+ 24 - 7
src/main/java/com/uas/platform/b2b/service/impl/PurchaseApCheckServiceImpl.java

@@ -12,6 +12,7 @@ import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
+import com.uas.platform.b2b.dao.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
@@ -23,13 +24,6 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.util.StringUtils;
 
 import com.uas.platform.b2b.core.util.ContextUtils;
-import com.uas.platform.b2b.dao.PagingReleaseCountDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckDoneDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckEndDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckIndexDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckItemDao;
-import com.uas.platform.b2b.dao.PurchaseApCheckTodoDao;
 import com.uas.platform.b2b.event.PurchaseApCheckSaveEvent;
 import com.uas.platform.b2b.model.Product;
 import com.uas.platform.b2b.model.PurchaseApCheck;
@@ -78,6 +72,9 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 	@Autowired
 	private PagingReleaseCountDao pagingReleaseCountDao;
 
+	@Autowired
+	private UserOrderDao userOrderDao;
+
 	@Override
 	public List<PurchaseApCheck> findNotUploadAPcheck() {
 		return purchaseApCheckDao.findByCustUuAndStatusAndCheckStatus(SystemSession.getUser().getEnterprise().getUu(),
@@ -519,4 +516,24 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
 		return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
 				SystemSession.getUser().getUserUU(), "purc", "PURC$APCHECK");
 	}
+
+	@Override
+	public List<Object[]> getApCheckCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return purchaseApCheckDao.getUnreadCountEveryStatus(ids);
+	}
+
+	@Override
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$apcheck", category);
+	}
+
+	@Override
+	@Transactional
+	public void setReadByOrder(String category, Long[] sourceId) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$apcheck", category, (short) Status.READ.value(), sourceId);
+	}
 }

+ 15 - 5
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryMouldServiceImpl.java

@@ -62,6 +62,7 @@ import com.uas.platform.core.model.Status;
 import com.uas.platform.core.persistence.criteria.PredicateUtils;
 import com.uas.search.b2b.model.PageParams;
 import com.uas.search.b2b.model.SPage;
+import org.springframework.transaction.annotation.Transactional;
 
 @Service
 public class PurchaseInquiryMouldServiceImpl implements PurchaseInquiryMouldService {
@@ -550,13 +551,22 @@ public class PurchaseInquiryMouldServiceImpl implements PurchaseInquiryMouldServ
 	}
 
 	@Override
-	public Integer getInquiryMouldUnreadCount(){
-		return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
-				SystemSession.getUser().getUserUU(), "sale", "PURC$INQUIRYMOULD");
+	public List<Object[]> getInquiryMouldCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return purchaseInquiryMouldDao.getUnreadCountEveryStatus(ids);
 	}
 
+    @Override
+	@Transactional
+    public void setReadByOrder(String category, Long[] sourceId) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$inquiry_mould", category, (short) Status.READ.value(), sourceId);
+    }
+
 	@Override
-	public List<Object[]> getInquiryMouldCount() {
-		return purchaseInquiryMouldDao.getUnreadCountEveryStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "sale");
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$inquiry_mould", category);
 	}
 }

+ 13 - 18
src/main/java/com/uas/platform/b2b/service/impl/PurchaseInquiryServiceImpl.java

@@ -350,6 +350,7 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 	}
 
 	@Override
+	@Transactional
 	public PurchaseInquiryItem reply(PurchaseInquiryItem inquiryItem) {
 		PurchaseInquiryItem item = purchaseInquiryItemDao.findOne(inquiryItem.getId());
 		if (!item.isReplyable())
@@ -374,6 +375,8 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 			inquiryItems.add(purchaseInquiryItem);
 			ContextUtils.publishEvent(new PurchaseInquiryItemReplyReleaseEvent(inquiryItems));
 		}
+		// 将采购员单据设置未读
+		userOrderDao.setReadStatus(purchaseInquiryItem.getEnterprise().getUu(), purchaseInquiryItem.getUserUU(), "v$purc$inquiryitems", "purc", (short) Status.NOT_READ.value(), purchaseInquiryItem.getId());
 		return purchaseInquiryItem;
 	}
 
@@ -551,30 +554,22 @@ public class PurchaseInquiryServiceImpl implements PurchaseInquiryService {
 	}
 
 	@Override
-	public Integer getInquiryUnreadCount(){
-		return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
-				SystemSession.getUser().getUserUU(), "sale", "PURC$INQUIRYITEMS");
-	}
-
-	@Override
-	public Integer getPurchaseInquiryUnreadCount(){
-		return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
-				SystemSession.getUser().getUserUU(), "purc", "PURC$INQUIRYITEMS");
-	}
-
-	@Override
-	public List<Object[]> getInquiryCount() {
-		return purchaseInquiryItemDao.getUnreadCountEveryStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "sale");
+	public List<Object[]> getInquiryCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return purchaseInquiryItemDao.getUnreadCountEveryStatus(ids);
 	}
 
 	@Override
 	@Transactional
-	public void setReadByOrder(Long[] sourceId) {
-		userOrderDao.setRead(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$inquiryitems", "sale", sourceId);
+	public void setReadByOrder(String category, Long[] sourceIds) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$inquiryitems", category, (short) Status.READ.value(), sourceIds);
 	}
 
 	@Override
-	public List<Long> getUnreadIds() {
-		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$inquiryitems", "sale");
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$inquiryitems", category);
 	}
 }

+ 22 - 2
src/main/java/com/uas/platform/b2b/service/impl/PurchaseNoticeServiceImpl.java

@@ -91,7 +91,7 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 
 	@Autowired
 	private VendorDao vendorDao;
-	
+
 	@Override
 	public void save(List<PurchaseNotice> notices) {
 		notices = purchaseNoticeDao.save(notices);
@@ -801,8 +801,9 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 	 * 发货单明细条码明细生成
 	 * 
 	 * @param sItem
-	 * @param aqtyA
+	 * @param qty
 	 * @param enUU
+	 * @param barcodeSet
 	 */
 	private void insertBar(SaleSendItem sItem, double qty, Long enUU, B2bCodeSet barcodeSet) {
 		BarSendNotify barSendNotify = new BarSendNotify();
@@ -951,4 +952,23 @@ public class PurchaseNoticeServiceImpl implements PurchaseNoticeService {
 				SystemSession.getUser().getUserUU(), "purc", "SALE$SEND");
 	}
 
+	@Override
+	public List<Object[]> getNoticeCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return purchaseNoticeDao.getUnreadCountEveryStatus(ids);
+	}
+
+	@Override
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$notice", category);
+	}
+
+	@Override
+	@Transactional
+	public void setReadByOrder(String category, Long[] sourceId) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$notice", category, (short) Status.READ.value(), sourceId);
+	}
 }

+ 14 - 5
src/main/java/com/uas/platform/b2b/service/impl/PurchaseOrderChangeServiceImpl.java

@@ -403,13 +403,22 @@ public class PurchaseOrderChangeServiceImpl implements PurchaseOrderChangeServic
 	}
 
 	@Override
-	public Integer getChangeUnreadCount(){
-		return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
-				SystemSession.getUser().getUserUU(),"sale","PURC$CHANGES");
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$changes", category);
 	}
 
 	@Override
-	public List<Object[]> getChangeCount() {
-		return purchaseOrderChangeDao.getUnreadCountEveryStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "sale");
+	@Transactional
+	public void setReadByOrder(String category, Long[] sourceId) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$changes", category, (short) Status.READ.value(), sourceId);
+	}
+
+	@Override
+	public List<Object[]> getChangeCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return purchaseOrderChangeDao.getUnreadCountEveryStatus(ids);
 	}
 }

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

@@ -234,6 +234,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 	}
 
 	@Override
+	@Transactional
 	public PurchaseOrderReply reply(PurchaseOrderReply reply) {
 		PurchaseOrderReply purchaseOrderReply = reply(reply, true);
 		// 单条回复产生消息
@@ -293,6 +294,8 @@ 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;
 	}
 
@@ -1096,8 +1099,8 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
 
 	@Override
 	@Transactional
-	public void setReadByOrder(String category, Long[] sourceId) {
-		userOrderDao.setRead(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$orders", category, sourceId);
+	public void setReadByOrder(String category, Long[] sourceIds) {
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$orders", category, (short) Status.READ.value(), sourceIds);
 	}
 
 	@Override

+ 95 - 20
src/main/java/com/uas/platform/b2b/service/impl/PurchaseTenderServiceImpl.java

@@ -1,7 +1,9 @@
 package com.uas.platform.b2b.service.impl;
 
+import com.uas.platform.b2b.core.util.ThreadTask;
 import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.model.*;
+import com.uas.platform.b2b.openapi.model.Sale;
 import com.uas.platform.b2b.service.AttachService;
 import com.uas.platform.b2b.service.PurchaseTenderService;
 import com.uas.platform.b2b.support.SystemSession;
@@ -9,6 +11,7 @@ import com.uas.platform.b2b.temporary.model.PurcTenderProd;
 import com.uas.platform.b2b.temporary.model.TenderContactInfo;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.Status;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
@@ -17,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.ui.ModelMap;
 import org.springframework.util.CollectionUtils;
 
@@ -71,6 +75,15 @@ public class PurchaseTenderServiceImpl implements PurchaseTenderService {
     @Autowired
     private UserOrderDao userOrderDao;
 
+    @Autowired
+    private RoleDao roleDao;
+
+    @Autowired
+    private VendorDao vendorDao;
+
+    @Autowired
+    private DistributeDao distributeDao;
+
 
     /**
      *  发布或保存(新录入单据)
@@ -86,6 +99,7 @@ public class PurchaseTenderServiceImpl implements PurchaseTenderService {
                 publishOpen(purchaseTender);
             } else {
                 publish(purchaseTender, contactInfos);
+                saveUserOrders(purchaseTender);
             }
         } else {
             if (purchaseTender.getIfOpen() == Constant.YES) {
@@ -96,6 +110,63 @@ public class PurchaseTenderServiceImpl implements PurchaseTenderService {
         }
     }
 
+    /**
+     * 保存
+     *
+     * @param purchaseTender 采购招标
+     * @return
+     */
+    private void saveUserOrders(final PurchaseTender purchaseTender) {
+        ThreadTask.getInstance().execute(new Runnable() {
+            @Override
+            public void run() {
+                /* 添加供应商的阅读记录*/
+                List<SaleTender> saleTenders = saleTenderDao.findByEnUUAndCode(purchaseTender.getEnUU(), purchaseTender.getCode());
+                List<UserOrders> list = new ArrayList<>();
+                for (SaleTender saleTender : saleTenders) {
+
+
+                    Set<Long> userUUs = new HashSet<>();
+                    // 添加管理员
+                    List<Role> roles = roleDao.findByEnUUAndIssys(saleTender.getVendUU(), Constant.YES);
+                    if (!CollectionUtils.isEmpty(roles)) {
+                        List<User> admins = userDao.findByRole(roles.get(0).getId());
+                        for (User admin : admins) {
+                            if (!userUUs.contains(admin.getUserUU())) {
+                                userUUs.add(admin.getUserUU());
+                            }
+                        }
+                    }
+                    List<Vendor> vendors = vendorDao.findByMyEnUUAndVendUU(saleTender.getEnUU(), saleTender.getVendUU());
+                    // 查找有权限的用户
+                    if (!CollectionUtils.isEmpty(vendors)) {
+                        Long vendorId = vendors.get(0).getId();
+                        List<Distribute> distributes = distributeDao.findByVendorId(vendorId);
+                        if (!CollectionUtils.isEmpty(distributes)) {
+                            for (Distribute distribute : distributes) {
+                                if (!userUUs.contains(distribute.getUserUU())) {
+                                    userUUs.add(distribute.getUserUU());
+                                }
+                            }
+                        }
+                    }
+                    UserOrders userOrders;
+                    for (Long userUU : userUUs) {
+                        if (userUU == null) {
+                            continue;
+                        }
+                        userOrders = new UserOrders(userUU, saleTender.getVendUU(), purchaseTender.getId(), "sale", "v$purc$tender");
+                        list.add(userOrders);
+                    }
+					/* 添加采购员的阅读记录*/
+                    userOrders = new UserOrders(purchaseTender.getUseruu(), purchaseTender.getEnUU(), purchaseTender.getId(), "purc", "v$purc$tender");
+                    list.add(userOrders);
+                }
+                userOrderDao.save(list);
+            }
+        });
+    }
+
     private void publishOpen(PurchaseTender tender) {
         tender.setIsPublish(Constant.YES);
         tender.setStatus("待投标");
@@ -675,32 +746,36 @@ public class PurchaseTenderServiceImpl implements PurchaseTenderService {
     }
 
     @Override
-    public Integer getTenderUnreadCount() {
-        return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
-                SystemSession.getUser().getUserUU(), "sale", "PURC$TENDER");
-    }
-
-    @Override
-    public Integer getPurchaseTenderUnreadCount() {
-        return pagingReleaseCountDao.getUnreadCount(SystemSession.getUser().getEnterprise().getUu(),
-                SystemSession.getUser().getUserUU(), "purc", "PURC$TENDER");
-    }
-
-    @Override
-    public List<Object[]> getOrderCount() {
-        return purchaseTenderDao.getUnreadCountEveryStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$tender", "sale");
+    public List<Object[]> getTenderCount(String category) {
+        List<Long> ids = getUnreadIds(category);
+        List<Object[]> list = new ArrayList<>();
+        if (CollectionUtils.isEmpty(ids)){
+            return list;
+        }
+        Object[] objects = new Object[2];
+        if ("sale".equals(category)) {
+            objects[1] = "待投标";
+            objects[0] = purchaseTenderDao.getTenterCount(ids);
+        } else if ("purc".equals(category)){
+            objects[1] = "待评标";
+            objects[0] = purchaseTenderDao.getEvaluationCount(ids);
+        }
+        if (objects[0] == null){
+            objects[0] = 0;
+        }
+        list.add(objects);
+        return list;
     }
 
     @Override
-    public List<Long> getUnreadIds() {
-        return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$tender", "sale");
+    public List<Long> getUnreadIds(String category) {
+        return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$tender", category);
     }
 
     @Override
-    public void setReadByOrder(Long[] sourceId) {
-        userOrderDao.setRead(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$tender", "sale", sourceId);
+    @Transactional
+    public void setReadByOrder(String category, Long[] sourceId) {
+        userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "v$purc$tender", category, (short) Status.READ.value(), sourceId);
     }
-
-
 }
 

+ 34 - 4
src/main/java/com/uas/platform/b2b/service/impl/VendorsServiceImpl.java

@@ -1,9 +1,6 @@
 package com.uas.platform.b2b.service.impl;
 
-import com.uas.platform.b2b.dao.DistributeDao;
-import com.uas.platform.b2b.dao.EnterpriseDao;
-import com.uas.platform.b2b.dao.VendorContactDao;
-import com.uas.platform.b2b.dao.VendorDao;
+import com.uas.platform.b2b.dao.*;
 import com.uas.platform.b2b.model.Distribute;
 import com.uas.platform.b2b.model.Enterprise;
 import com.uas.platform.b2b.model.Vendor;
@@ -12,10 +9,12 @@ import com.uas.platform.b2b.service.VendorService;
 import com.uas.platform.b2b.support.SystemSession;
 import com.uas.platform.core.model.Constant;
 import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.Status;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import javax.persistence.criteria.CriteriaBuilder;
@@ -41,6 +40,9 @@ public class VendorsServiceImpl implements VendorService {
 	@Autowired
 	private EnterpriseDao enterPriseDao;
 
+	@Autowired
+	private UserOrderDao userOrderDao;
+
 	@Override
 	public List<Vendor> findMyVendors() {
 		return vendorDao.findByMyEnUU(SystemSession.getUser().getEnterprise().getUu());
@@ -215,4 +217,32 @@ public class VendorsServiceImpl implements VendorService {
 		return vendor;
 	}
 
+	@Override
+	public List<Object[]> getVendorCount(String category) {
+		List<Long> ids = getUnreadIds(category);
+		if (CollectionUtils.isEmpty(ids)){
+			return new ArrayList<>();
+		}
+		return vendorDao.getUnreadCountEveryStatus(ids);
+	}
+
+	@Override
+	public List<Long> getUnreadIds(String category) {
+		return userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$vendors", category);
+	}
+
+    @Override
+	@Transactional
+    public void setReadByIds(String category, Long[] sourceIds) {
+		Long[] temp = sourceIds;
+		if (sourceIds == null || sourceIds.length == 0){
+			List<Long> ids = userOrderDao.getUnreadIds(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$vendors", category);
+			if (CollectionUtils.isEmpty(ids)){
+				return;
+			}
+			temp = ids.toArray(new Long[ids.size()]);
+		}
+		userOrderDao.setReadStatus(SystemSession.getUser().getEnterprise().getUu(), SystemSession.getUser().getUserUU(), "purc$vendors", category, (short) Status.READ.value(), temp);
+	}
+
 }

+ 24 - 0
src/main/webapp/resources/js/index/services/BaseInfo.js

@@ -69,6 +69,18 @@ define(['ngResource'], function() {
 			toggle: {
 				url: 'product/baseInfo/toggle/:status',
 				method: 'POST'
+			},
+			setRead:{
+				url: 'product/baseInfo/setRead',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'product/baseInfo/getUnreadIds',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'product/baseInfo/unread',
+				method: 'GET'
 			}
 		})
 	}]).factory('GetProductInfoNewest', ['$resource', function($resource) {
@@ -85,6 +97,18 @@ define(['ngResource'], function() {
 				params: {
 					_state: 'nonstandard'
 				}
+			},
+			setRead:{
+				url: 'product/baseInfo/setRead',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'product/baseInfo/getUnreadIds',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'product/baseInfo/unread',
+				method: 'GET'
 			}
 		})
 	}]).factory('ComponentActive', ['$resource', function($resource) {

+ 12 - 0
src/main/webapp/resources/js/index/services/Fa.js

@@ -95,6 +95,18 @@ define([ 'ngResource'], function() {
 			},
 			cancel: {
 				url: 'sale/apCheck/cancel'
+			},
+			setRead:{
+				url: 'sale/apCheck/setRead',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'sale/apCheck/getUnreadIds',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'sale/apCheck/unread',
+				method: 'GET'
 			}
 		});
 	}]).factory('ApbillAdjustment', ['$resource', function($resource) {

+ 13 - 1
src/main/webapp/resources/js/index/services/Make.js

@@ -42,7 +42,19 @@ define([ 'ngResource'], function() {
 					_state: 'end'
 				}
 			},
-			getAll: {}
+			getAll: {},
+			setRead:{
+				url: 'make/orders/setRead',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'make/orders/getUnreadIds',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'make/orders/unread',
+				method: 'GET'
+			}
 		});
 	}]).factory('MakeChange', ['$resource', function($resource) {
 		return $resource('make/changes/:id', {}, {

+ 8 - 0
src/main/webapp/resources/js/index/services/Product.js

@@ -148,6 +148,10 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'nonstandard'
 				}
+			},
+			setRead:{
+				url: 'purcProduct/setRead',
+				method: 'POST'
 			}
 		})
 	}]).factory('PurcProductNewest', ['$resource', function($resource) {
@@ -164,6 +168,10 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'nonstandard'
 				}
+			},
+			setRead:{
+				url: 'purcProduct/setRead',
+				method: 'POST'
 			}
 		})
 	}]).factory('ProductAll', ['$resource', function($resource) {

+ 93 - 1
src/main/webapp/resources/js/index/services/Purc.js

@@ -247,6 +247,18 @@ define([ 'ngResource'], function() {
 				params: {
 					_state: 'done'
 				}
+			},
+			setRead:{
+				url: 'sale/changes/setRead',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'sale/changes/getUnreadIds',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'sale/changes/unread',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcChanges', ['$resource', function($resource) {
@@ -265,6 +277,18 @@ 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) {
@@ -550,6 +574,18 @@ define([ 'ngResource'], function() {
 			getUnreadCount:{
 				url: 'tender/unread',
 				method: 'GET'
+			},
+			setPurcRead:{
+				url: 'tender/setRead/purc',
+				method: 'POST'
+			},
+			getPurcUnreadIds:{
+				url: 'tender/getUnreadIds/purc',
+				method: 'GET'
+			},
+			getPurcUnreadCount:{
+				url: 'tender/unread/purc',
+				method: 'GET'
 			}
 		});
 	}]).factory('PurcInquiryMould', ['$resource', function($resource) {
@@ -607,6 +643,18 @@ define([ 'ngResource'], function() {
 				params: {
 					id: 'id'
 				}
+			},
+			setRead:{
+				url: 'sale/mould/setRead',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'sale/mould/getUnreadIds',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'sale/mould/unread',
+				method: 'GET'
 			}
 		});
     }]).factory('PurcInquiryMouldSql', ['$resource', function($resource) {
@@ -628,7 +676,19 @@ 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', {}, {
@@ -876,6 +936,18 @@ 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) {
@@ -1080,6 +1152,14 @@ define([ 'ngResource'], function() {
 			enterpriseInfo: {
 				url: 'account/enterprise/info/:bussinessCode',
 				method: 'GET'
+			},
+			setRead:{
+				url: 'vendor/customer/setRead',
+				method: 'POST'
+			},
+			setVendorRead:{
+				url: 'vendor/vendor/setRead',
+				method: 'POST'
 			}
 		});
 	}]).factory('Quotation', ['$resource', function($resource){
@@ -1349,6 +1429,18 @@ define([ 'ngResource'], function() {
 			transtoInquiry: {
 				url: 'purc/inquiry/transtoInquiry/:id',
 				method: 'POST'
+			},
+			setRead:{
+				url: 'sale/inquiry/setRead/purc',
+				method: 'POST'
+			},
+			getUnreadIds:{
+				url: 'sale/inquiry/getUnreadIds/purc',
+				method: 'GET'
+			},
+			getUnreadCount:{
+				url: 'sale/inquiry/unread/purc',
+				method: 'GET'
 			}
 		});
 	}]);

+ 9 - 0
src/main/webapp/resources/tpl/index/baseInfo/prodList.html

@@ -195,6 +195,15 @@ width: 80px;
 	background: #327ebe;
     color: #fff !important;
   }
+.menu .new-dot{
+    width: 20px;
+    height: 20px;
+    line-height: 20px;
+    font-size: 12px;
+    color: #fff;
+    font-weight: inherit;
+    top: -2px;
+}
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">

+ 16 - 3
src/main/webapp/resources/tpl/index/fa/apCheck.html

@@ -114,6 +114,15 @@
 		margin-top: -17px;
 		margin-right: 14px;
 	}
+	.menu .new-dot{
+		width: 20px;
+		height: 20px;
+		line-height: 20px;
+		font-size: 12px;
+		color: #fff;
+		font-weight: inherit;
+		top: -2px;
+	}
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
@@ -139,7 +148,9 @@
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
 								ng-class="{'btn-info':active=='done'}"
-								ng-click="setActive('done')">已确认</button>
+								ng-click="setActive('done')">已确认
+							<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
@@ -148,7 +159,9 @@
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已作废</button>
+							ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已作废
+							<b class="new-dot" ng-if="unread.cancelled > 0">{{unread.cancelled > 99 ? '99+' : unread.cancelled}}</b>
+						</button>
 					</div>
 				</div>
 			</div>
@@ -242,7 +255,7 @@
 						<span class="text-num" title="录单时间">{{::check.recordDate | date:'MM月dd日 HH:mm'}} <i class="fa fa-clock-o"></i></span>&nbsp;&nbsp;&nbsp;
 						<span><i class="fa fa-star" ng-class="{'text-default':check.status==201}"></i> {{::check.custName}}</span>
 						<span style="margin-left: 100px;">单据编号:</span>
-						<span class="text-num"><a ui-sref="fa.apCheck_detail({id:check.id})" title="点击查看详情">{{::check.code}}</a></span>
+						<span class="text-num"><a ui-sref="fa.apCheck_detail({id:check.id})" title="点击查看详情" ng-click="setOrdersRead(check.id)">{{::check.code}}</a></span>
 					</div>
 					<div class="static">
 						<p><span class="f14 text-num">{{::check.beginDate | date:'yyyy/MM/dd'}} - {{::check.endDate | date:'yyyy/MM/dd'}}</span></p>

+ 4 - 4
src/main/webapp/resources/tpl/index/fa/left.html

@@ -1,10 +1,10 @@
-<div class="left-nav">
+<div class="left-nav" ng-controller="TodoCtrl">
 	<div class="nav-label">
 		<i></i>应收
 	</div>
 	<ul class="list-unstyled">
-		<li ui-sref-active="active"><a ui-sref="fa.apBill">发票</a></li>
-		<li ui-sref-active="active"><a ui-sref="fa.apCheck">应收对账单</a></li>
+		<li ui-sref-active="active"><a ui-sref="fa.apBill"><em class="new-dot" ng-if="false"></em>发票</a></li>
+		<li ui-sref-active="active"><a ui-sref="fa.apCheck"><em class="new-dot" ng-if="unread.apCheck > 0"></em>应收对账单</a></li>
 		<!-- <li ui-sref-active="active"><a ui-sref="fa.adjustList">货款调账</a></li> -->
 	</ul>
 </div>
@@ -13,6 +13,6 @@
 		<i></i>应付
 	</div>
 	<ul class="list-unstyled">
-		<li ui-sref-active="active"><a ui-sref="fa.arCheck">应付对账单</a></li>
+		<li ui-sref-active="active"><a ui-sref="fa.arCheck"><em class="new-dot" ng-if="false"></em>应付对账单</a></li>
 	</ul>
 </div>

+ 11 - 11
src/main/webapp/resources/tpl/index/home/right.html

@@ -162,28 +162,28 @@
 							<a href="#/sale/tender">
 								<div class="menu01-3"></div>
 								<p>投标</p>
-								<b class="new-dot" ng-if="false"></b>
+								<b class="new-dot" ng-if="unread.tender > 0">{{unread.tender > 99 ? '99+' : unread.tender}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
 							<a href="#/sale/notice">
 								<div class="menu01-4"></div>
 								<p>发货</p>
-								<b class="new-dot" ng-if="false"></b>
+								<b class="new-dot" ng-if="unread.notice > 0">{{unread.notice > 99 ? '99+' : unread.notice}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
-							<a href="#/sale/prodList">
+							<a href="#/sale/prodList" ng-click="setOrdersRead('product')">
 								<div class="menu01-5"></div>
 								<p>产品库</p>
-								<!--<b class="new-dot" ng-if="unread.product > 0"></b>-->
+								<b class="new-dot" ng-if="unread.product > 0">{{unread.product > 99 ? '99+' : unread.product}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
-							<a href="#/sale/customer">
+							<a href="#/sale/customer" ng-click="setOrdersRead('customer')">
 								<div class="menu01-6"></div>
 								<p>客户资料</p>
-								<!--<b class="new-dot" ng-if="unread.customer > 0"></b>-->
+								<b class="new-dot" ng-if="unread.customer > 0">{{unread.customer > 99 ? '99+' : unread.customer}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
@@ -214,14 +214,14 @@
 							<a href="#/purc/purchaseinquiry">
 								<div class="menu02-2"></div>
 								<p>询价(求购)</p>
-								<b class="new-dot" ng-if="unread.purcInquiry>0">{{unread.purcInquiry>99?'99+':unread.purcInquiry}}</b>
+								<b class="new-dot" ng-if="unread.purcInquiry > 0">{{unread.purcInquiry > 99 ? '99+' : unread.purcInquiry}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
 							<a href="#/purc/tender">
 								<div class="menu02-3"></div>
 								<p>招标</p>
-								<b class="new-dot" ng-if="false"></b>
+								<b class="new-dot" ng-if="unread.purcTender > 0">{{unread.purcTender > 99 ? '99+' : unread.purcTender}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
@@ -233,14 +233,14 @@
 							<a href="#/purc/product">
 								<div class="menu02-5"></div>
 								<p>物料库</p>
-								<!--<b class="new-dot" ng-if="unread.purcProduct > 0"></b>-->
+								<b class="new-dot" ng-if="unread.purcProduct > 0">{{unread.purcProduct > 99 ? '99+' : unread.purcProduct}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
 							<a href="#/purc/vendor">
 								<div class="menu02-6"></div>
 								<p>供应商资料</p>
-								<!--<b class="new-dot" ng-if="unread.purcCustomer > 0"></b>-->
+								<b class="new-dot" ng-if="unread.purcVendor > 0">{{unread.purcVendor > 99 ? '99+' : unread.purcVendor}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">
@@ -269,7 +269,7 @@
 							<a href="#/fa/apCheck">
 								<div class="menu03-2"></div>
 								<p>应收对账</p>
-								<b class="new-dot" ng-if="false"></b>
+								<b class="new-dot" ng-if="unread.apCheck > 0">{{unread.apCheck > 99 ? '99+' : unread.apCheck}}</b>
 							</a>
 						</div>
 						<div class="col-md-4">

+ 10 - 0
src/main/webapp/resources/tpl/index/make/change.html

@@ -91,6 +91,16 @@
 	padding-left: 20px;
 }
 
+.menu .new-dot{
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	font-size: 12px;
+	color: #fff;
+	font-weight: inherit;
+	top: -2px;
+}
+
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">

+ 27 - 4
src/main/webapp/resources/tpl/index/make/order.html

@@ -107,6 +107,16 @@
 	border-radius: 4px; 
 }
 
+.menu .new-dot{
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	font-size: 12px;
+	color: #fff;
+	font-weight: inherit;
+	top: -2px;
+}
+
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
@@ -126,15 +136,21 @@
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
+							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">
+							全部<b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已回复</button>
+							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">
+							已回复<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待回复</button>
+							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">
+							待回复<b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
@@ -229,13 +245,20 @@
 		<tr class="order-hd" ng-dbclick="order.$collapsed=!order.$collapsed" ng-class="{'text-bold': order.display>0}">
 			<td class="first" colspan="4">
 				<div class="order-main">
+					<a href="javascript:void(0)" ng-if="!isUnread(order.id)">
+						<i class="fa fa-circle-thin"></i>
+					</a>
+					<a href="javascript:void(0)" ng-if="isUnread(order.id)">
+						<i class="fa fa-circle" style="color: #f40;"></i>
+					</a>&nbsp;&nbsp;
 					<!--<span> <input type="checkbox" class="selector"
 						ng-model="order.$selected" ng-click="checkOne(order)">
 					</span> -->
 					<span class="text-num text-bold" ng-bind="::order.date | date:'yyyy-MM-dd'"></span>
 					<span ng-bind="::order.enterprise.enName"></span>
 					<span>订单号:
-					  <a class="text-num" ng-bind="::order.code" ui-sref="sale.makeorder_detail({id:order.id})" target="_self"></a></span>
+					  <a class="text-num" ng-bind="::order.code" ui-sref="sale.makeorder_detail({id:order.id})" target="_self"
+						 ng-click="setOrdersRead(order.id)"></a></span>
 				</div>
 			</td>
 			<td colspan="1" class="order-sum">{{::order.currency}}: <span

+ 16 - 3
src/main/webapp/resources/tpl/index/purc/inquiry.html

@@ -284,7 +284,16 @@ margin-left: 55px;
 	margin-right: 3px;
 }#public .menu .btn-group{
 	height: inherit !important;
- }
+}
+	.menu .new-dot{
+		width: 20px;
+		height: 20px;
+		line-height: 20px;
+		font-size: 12px;
+		color: #fff;
+		font-weight: inherit;
+		top: -2px;
+	}
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
@@ -305,11 +314,15 @@ margin-left: 55px;
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
+								ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
+							<b class="new-dot" ng-if="unread.replied>0">{{unread.replied>99?'99+':unread.replied}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已报价</button>
+								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已报价
+							<b class="new-dot" ng-if="unread.replied>0">{{unread.replied>99?'99+':unread.replied}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"

+ 4 - 4
src/main/webapp/resources/tpl/index/purc/left.html

@@ -3,10 +3,10 @@
 		<i></i>采购管理
 	</div>
 	<ul class="list-unstyled">
-		<li ui-sref-active="active"><a ui-sref="purc.vendor">供应商资料</a></li>
+		<li ui-sref-active="active"><a ui-sref="purc.vendor" ng-click="setOrdersRead('vendor')"><em class="new-dot" ng-if="unread.purcVendor > 0"></em>供应商资料</a></li>
 	</ul>
 	<ul class="list-unstyled">
-		<li ui-sref-active="active"><a ui-sref="purc.product">采购物料</a></li>
+		<li ui-sref-active="active"><a ui-sref="purc.product"  ng-click="setOrdersRead('purcProduct')"><em class="new-dot" ng-if="unread.purcProduct > 0"></em>采购物料</a></li>
 	</ul>
 	<ul class="list-unstyled">
 		<li ui-sref-active="active"><a ui-sref="purc.tenderlist"><em class="new-dot" ng-if="unread.purcTender > 0"></em>采购招标</a></li>
@@ -18,10 +18,10 @@
 		<li ui-sref-active="active"><a ui-sref="purc.order"><em class="new-dot" ng-if="unread.purcOrder > 0"></em>采购订单</a></li>
 	</ul>
 	<ul class="list-unstyled">
-		<li ui-sref-active="active"><a ui-sref="purc.deputy"><em class="new-dot" ng-if="unread.purcDeputy > 0"></em>代采订单</a></li>
+		<li ui-sref-active="active"><a ui-sref="purc.deputy"><em class="new-dot" ng-if="false"></em>代采订单</a></li>
 	</ul>
 	<ul class="list-unstyled">
-		<li ui-sref-active="active"><a ui-sref="purc.makeoutorder"><em class="new-dot" ng-if="unread.purcMakeOrder > 0"></em>委外订单</a></li>
+		<li ui-sref-active="active"><a ui-sref="purc.makeoutorder"><em class="new-dot" ng-if="false"></em>委外订单</a></li>
 	</ul>
 	<!-- 测试 -->
 	<!-- <ul class="list-unstyled">

+ 1 - 1
src/main/webapp/resources/tpl/index/purc/tender.html

@@ -1011,7 +1011,7 @@ input[type="radio"], input[type="checkbox"] {
                 </div>
                 <div class="col-xs-12" ng-show="!isSave" style="padding: 30px;">
                     <div class="col-xs-2 pull-right btn-publish">
-                        <button class="btn" ng-disabled="tenderForm.$invalid" ng-click="save(true)">发布</button>
+                        <button class="btn" ng-disabled="tenderForm.$invalid" ng-click="save(true)">发布1</button>
                     </div>
                     <div class="col-xs-2 pull-right btn-save">
                         <button class="btn" ng-disabled="tenderForm.$invalid" ng-click="save(false)">保存</button>

+ 18 - 0
src/main/webapp/resources/tpl/index/purc/tenderlist.html

@@ -140,6 +140,16 @@
         line-height: 25px;
         padding: 10px 20px;
     }
+
+    .block .new-dot{
+        width: 20px;
+        height: 20px;
+        line-height: 20px;
+        font-size: 12px;
+        color: #fff;
+        font-weight: inherit;
+        top: -2px;
+    }
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div id="public">
@@ -165,11 +175,13 @@
                         <div class="btn-group">
                             <button type="button" class="btn btn-select"
                                     ng-class="{'btn-selected':active=='all'}" ng-click="setActive('all')">全部
+                                <b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b>
                             </button>
                         </div>
                         <div class="btn-group">
                             <button type="button" class="btn btn-select"
                                     ng-class="{'btn-selected':active=='done'}" ng-click="setActive('done')">待评标
+                                <b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b>
                             </button>
                         </div>
                         <div class="btn-group">
@@ -386,6 +398,12 @@
             <tr>
                 <td class="prod-notnum" width="300">
                     <div>
+                        <a href="javascript:void(0)" ng-if="!isUnread(tender.id)">
+                            <i class="fa fa-circle-thin"></i>
+                        </a>
+                        <a href="javascript:void(0)" ng-if="isUnread(tender.id)">
+                            <i class="fa fa-circle" style="color: #f40;"></i>
+                        </a>&nbsp;&nbsp;
                         标题:{{tender.title}}
                     </div>
                     <div>

+ 16 - 4
src/main/webapp/resources/tpl/index/sale/change.html

@@ -92,6 +92,15 @@
 	padding-left: 20px;
 }
 
+.menu .new-dot{
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	font-size: 12px;
+	color: #fff;
+	font-weight: inherit;
+	top: -2px;
+}
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block"  id="public">
@@ -110,15 +119,15 @@
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
+							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部<b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已处理</button>
+							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已处理<b class="new-dot" ng-if="unread.replied > 0">{{unread.all>99?'99+':unread.replied}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待确认</button>
+							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待确认<b class="new-dot" ng-if="unread.notReply > 0">{{unread.all>99?'99+':unread.notReply}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
@@ -235,7 +244,10 @@
 					<span
 							ng-bind="::change.enterprise.enName"></span>
 					<span>流水号:<a
-						class="text-num" ng-bind="::change.code" ui-sref="sale.change_detail({id:change.id})" target="_self"></a></span><span>订单:<a
+						class="text-num" ng-bind="::change.code" ui-sref="sale.change_detail({id:change.id})" target="_self"
+						ng-click="setOrdersRead(change.id)"></a>
+					</span>
+					<span>订单:<a
 						class="text-num text-bold" ng-bind="::change.orderCode" ui-sref="sale.order_detail({id:change.orderId})" target="_blank"></a></span>
 				</div>
 			</td>

+ 26 - 9
src/main/webapp/resources/tpl/index/sale/inquiry.html

@@ -125,6 +125,15 @@
 	.order-table{
 		background: #fff;
 	}
+	.menu .new-dot{
+		width: 20px;
+		height: 20px;
+		line-height: 20px;
+		font-size: 12px;
+		color: #fff;
+		font-weight: inherit;
+		top: -2px;
+	}
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
@@ -143,15 +152,15 @@
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
+								ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部<b class="new-dot" ng-if="unread.all>0">{{unread.all>99?'99+':unread.all}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已报价</button>
+								ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已报价<b class="new-dot" ng-if="unread.replied>0">{{unread.replied>99?'99+':unread.replied}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-								ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待报价</button>
+								ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待报价<b class="new-dot" ng-if="unread.notReply>0">{{unread.notReply>99?'99+':unread.notReply}}</b></button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
@@ -316,12 +325,20 @@
 						<!--<span> <input type="checkbox" class="selector"
 									  ng-model="inquiryItem.$selected">
 						</span> -->
-					<span class="text-num text-bold" title="{{inquiryItem.inquiry.date}}"
+					<a href="javascript:void(0)" ng-if="!isUnread(inquiryItem.id)">
+						<i class="fa fa-circle-thin"></i>
+					</a>
+					<a href="javascript:void(0)" ng-if="isUnread(inquiryItem.id)">
+						<i class="fa fa-circle" style="color: #f40;"></i>
+					</a>
+					&nbsp;&nbsp;<span class="text-num text-bold" title="{{inquiryItem.inquiry.date}}"
 									  ng-bind="::inquiryItem.inquiry.date | date:'yyyy-MM-dd'"></span>
 					<span
 							ng-bind="::inquiryItem.inquiry.enterprise.enName"></span>
-					<span>流水号:<a
-						class="text-num" ng-bind="::inquiryItem.inquiry.code" ui-sref="sale.inquiry_detail({id:inquiryItem.inquiry.id})" target="_self"></a></span>
+					<span>{{inquiryItem.id}}流水号:<a
+						class="text-num" ng-bind="::inquiryItem.inquiry.code" ui-sref="sale.inquiry_detail({id:inquiryItem.inquiry.id})" target="_self"
+						ng-click="setOrdersRead(inquiryItem.id)"></a>
+					</span>
 				</div>
 			</td>
 			<td>
@@ -541,7 +558,7 @@
 								<a ng-click="inquiryItem.$editing=!inquiryItem.$editing; cancel()">取消</a>
 							</div>
 							<div>
-								<button ng-click="onReplyClick(inquiryItem, true)"
+								<button ng-click="onReplyClick(inquiryItem, true);setOrdersRead(inquiryItem.id)"
 										ng-disabled="!isValid(inquiryItem, true)"
 										class="btn btn-link btn-xs text-inverse">
 									保存并<br>确认报价
@@ -573,12 +590,12 @@
 								<a ng-click="inquiryItem.$editing=!inquiryItem.$editing; cancel()">取消</a>
 							</div>
 							<div>
-								<button ng-click="onReplyClick(inquiryItem)"
+								<button ng-click="onReplyClick(inquiryItem);setOrdersRead(inquiryItem.id)"
 										ng-disabled="!isValid(inquiryItem)"
 										class="btn btn-link btn-xs text-default">保存</button>
 							</div>
 							<div>
-								<button ng-click="onReplyClick(inquiryItem, true)"
+								<button ng-click="onReplyClick(inquiryItem, true);setOrdersRead(inquiryItem.id)"
 										ng-disabled="!isValid(inquiryItem, true)"
 										class="btn btn-link btn-xs text-inverse">
 									保存并<br>确认报价

+ 27 - 4
src/main/webapp/resources/tpl/index/sale/inquiry_mould.html

@@ -163,6 +163,15 @@ tbody td div.text-mould {
 .order-table{
 	background: #fff;
 }
+.menu .new-dot{
+	width: 20px;
+	height: 20px;
+	line-height: 20px;
+	font-size: 12px;
+	color: #fff;
+	font-weight: inherit;
+	top: -2px;
+}
 /* 清楚ie下的输入框X */
 ::-ms-clear, ::-ms-reveal{display: none;}
 </style>
@@ -183,15 +192,21 @@ tbody td div.text-mould {
 				<div class="btn-group btn-group-sm btn-group-justified">
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
+							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
+							<b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已报价</button>
+							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已报价
+							<b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b>
+						</button>
 					</div>
 					<div class="btn-group btn-group-sm">
 						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待报价</button>
+							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待报价
+							<b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b>
+						</button>
 					</div>
 					<!--<div class="btn-group btn-group-sm">-->
 						<!--<button type="button" class="btn btn-default btn-line"-->
@@ -340,11 +355,19 @@ tbody td div.text-mould {
 			<tr class="order-hd">
 				<td class="first" colspan="3">
 					<div class="order-main">
+						<a href="javascript:void(0)" ng-if="!isUnread(inquiryMould.id)">
+							<i class="fa fa-circle-thin"></i>
+						</a>
+						<a href="javascript:void(0)" ng-if="isUnread(inquiryMould.id)">
+							<i class="fa fa-circle" style="color: #f40;"></i>
+						</a>&nbsp;&nbsp;
 						<!--<span> <input type="checkbox" class="selector"
 							ng-model="inquiryMould.$selected">
 						</span>--> <span class="text-num text-bold" title="{{inquiryMould.date}}" ng-bind="::inquiryMould.date | date:'yyyy-MM-dd'"></span>
 						<span ng-bind="::inquiryMould.enterprise.enName"></span>
-						<span>流水号:<a class="text-num" ng-bind="::inquiryMould.code" ui-sref="sale.inquiry_mould_detail({id:inquiryMould.id})" target="_self"></a></span>
+						<span>流水号:<a class="text-num" ng-bind="::inquiryMould.code" ui-sref="sale.inquiry_mould_detail({id:inquiryMould.id})" target="_self"
+							ng-click="setOrdersRead(inquiryMould.id)"></a>
+						</span>
 						币别:<span ng-bind="inquiryMould.currency"></span>
 					</div>
 				</td>

+ 7 - 7
src/main/webapp/resources/tpl/index/sale/left.html

@@ -4,10 +4,10 @@
 			<i></i>基础资料
 		</div>
 		<ul class="list-unstyled">
-			<li ui-sref-active="active"><a ui-sref="sale.customer">客户资料</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.customer" ng-click="setOrdersRead('customer')"><em class="new-dot" ng-if="unread.customer > 0"></em>客户资料</a></li>
 		</ul>
 		<ul class="list-unstyled">
-			<li ui-sref-active="active"><a ui-sref="sale.prodList">产品导入</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.prodList" ng-click="setOrdersRead('product')"><em class="new-dot" ng-if="unread.product > 0"></em>产品导入</a></li>
 		</ul>
 	</div>
 	<!-- <div class="left-nav">
@@ -26,9 +26,9 @@
 		</div>
 		<ul class="list-unstyled">
 			<li ui-sref-active="active"><a ui-sref="sale.inquiry" ng-click="getUnread()"><em class="new-dot" ng-if="unread.inquiry > 0"></em>客户采购询价</a></li>
-			<li ui-sref-active="active"><a ui-sref="sale.inquirymould" ng-click="getUnread()"><em class="new-dot" ng-if="false"></em>客户模具询价</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.inquirymould" ng-click="getUnread()"><em class="new-dot" ng-if="unread.mould > 0"></em>客户模具询价</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.quotation.list"><em class="new-dot" ng-if="false"></em>主动报价</a></li>
-			<li ui-sref-active="active"><a ui-sref="sale.tenderlist"><em class="new-dot" ng-if="false"></em>客户招标</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.tenderlist"><em class="new-dot" ng-if="unread.tender > 0"></em>客户招标</a></li>
 		</ul>
 	</div>
 	<div class="left-nav">
@@ -37,10 +37,10 @@
 		</div>
 		<ul class="list-unstyled">
 			<li ui-sref-active="active"><a ui-sref="sale.order" ng-click="getUnread()"><em class="new-dot" ng-if="unread.order > 0"></em>客户采购订单</a></li>
-			<li ui-sref-active="active"><a ui-sref="sale.change"><em class="new-dot" ng-if="false"></em>客户采购变更单</a></li>
-			<li ui-sref-active="active"><a ui-sref="sale.maketodo.order"><em class="new-dot" ng-if="false"></em>客户委外单</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.change"><em class="new-dot" ng-if="unread.change > 0"></em>客户采购变更单</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.maketodo.order"><em class="new-dot" ng-if="unread.makeOrder > 0"></em>客户委外单</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.makechange"><em class="new-dot" ng-if="false"></em>委外变更单</a></li>
-			<li ui-sref-active="active"><a ui-sref="sale.notice"><em class="new-dot" ng-if="false"></em>客户发货提醒</a></li>
+			<li ui-sref-active="active"><a ui-sref="sale.notice"><em class="new-dot" ng-if="unread.notice > 0"></em>客户发货提醒</a></li>
 			<li ui-sref-active="active"><a ui-sref="sale.send"><em class="new-dot" ng-if="false"></em>发货单</a></li>
 		</ul>
 	</div>

+ 511 - 465
src/main/webapp/resources/tpl/index/sale/notice.html

@@ -1,485 +1,531 @@
 <style>
-.order-table .header>th {
-	height: 38px;
-	text-align: center;
-	background: #f5f5f5;
-	border-top: 1px solid #e8e8e8;
-	border-bottom: 1px solid #e8e8e8;
-}
-
-.order-table .sep-row {
-	height: 10px;
-}
-
-.order-table .selector {
-	vertical-align: middle;
-	margin: 0 0 2px 0;
-}
-
-.toolbar label {
-	margin-right: 10px;
-	margin-bottom: 0;
-}
-
-.toolbar .select_all {
-	margin: 0 6px 0 10px;
-	line-height: 20px;
-}
-
-.toolbar .btn {
-	-moz-border-radius: 2px;
-	margin-right: 5px;
-	border: 1px solid #dcdcdc;
-	border-radius: 2px;
-	-webkit-border-radius: 2px;
-}
-
-.order-table .order-hd {
-	background: #f5f5f5;
-	height: 40px;
-	line-height: 40px;
-}
-
-.order-table .order-hd td.first {
-	padding-left: 20px;
-}
-
-.order-table .order-hd .order-main span {
-	margin-right: 8px;
-}
-
-.order-table .order-hd .order-code {
-	font-style: normal;
-	font-family: verdana;
-}
-
-.order-table .order-hd .order-sum {
-	padding: 0 5px;
-}
-
-.order-table .order-hd .dropdown-toggle {
-	line-height: 40px;
-	display: block;
-	/*padding: 0 10px;*/
-}
-
-.order-table>tbody {
-	border: 1px solid transparent;
-}
-
-.order-table>tbody:hover {
-	border-color: #56a022;
-	border-width: 2px;
-}
-
-.order-table .operates {
-	display: none;
-}
-
-.order-table>tbody:hover .operates {
-	display: block;
-}
-
-.order-table .order-bd {
-	border-bottom: 1px solid #e6e6e6;
-}
-
-.order-table .order-bd>td {
-	padding: 10px 5px;
-	vertical-align: top;
-	position: relative;
-}
-
-.order-table .order-bd .product {
-	padding-left: 20px;
-}
-
-.input-xs,.input-group-xs>.form-control,.input-group-xs>.input-group-addon,.input-group-xs>.input-group-btn>.btn
-	{
-	height: 26px;
-	padding: 0 5px;
-	font-size: 12px;
-	line-height: 1.5;
-	border-radius: 3px;
-}
-
-.order-snapshot .title {
-	border-top: 1px dashed #ddd;
-}
-
-.order-snapshot .dl-horizontal dt {
-	width: 60px;
-	text-align: left;
-	font-weight: normal;
-	color: #999;
-	padding: 4px 0;
-}
-
-.order-snapshot .dl-horizontal dd {
-	margin-left: 80px;
-	padding: 4px 0;
-}
-/*arrow*/
-.order-send {
-	position: relative;
-}
-
-.order-send.arrow-border:before,.arrow-border:after {
-	content: '';
-	position: absolute;
-	top: 20px;
-	width: 0;
-	height: 0;
-	border: 7px solid transparent;
-}
-
-.order-send.arrow-border.arrow-bottom-right:before {
-	content: '';
-	position: absolute;
-	left: -13px;
-	border-bottom-color: #fff;
-	border-right-color: #fff;
-	margin-top: -10px;
-}
-.padding-20 {
-	padding: 20px;
-}
-
-/* 动画 */
-.repeat.ng-enter,
-.repeat.ng-leave {
-  -webkit-transition: 0.5s linear all;
-  transition: 0.5s linear all;
-}
-
-.repeat.ng-enter,
-.repeat.ng-leave.ng-leave-active {
-  opacity: 0;
-}
-
-.repeat.ng-leave,
-.repeat.ng-enter.ng-enter-active {
-  opacity: 1;
-}
-
-/* 固定表头 */
-.fixedHeader {
-	background-color: #f5f5f5; 
-	position: relative; 
-}
+    .order-table .header > th {
+        height: 38px;
+        text-align: center;
+        background: #f5f5f5;
+        border-top: 1px solid #e8e8e8;
+        border-bottom: 1px solid #e8e8e8;
+    }
 
+    .order-table .sep-row {
+        height: 10px;
+    }
+
+    .order-table .selector {
+        vertical-align: middle;
+        margin: 0 0 2px 0;
+    }
+
+    .toolbar label {
+        margin-right: 10px;
+        margin-bottom: 0;
+    }
+
+    .toolbar .select_all {
+        margin: 0 6px 0 10px;
+        line-height: 20px;
+    }
+
+    .toolbar .btn {
+        -moz-border-radius: 2px;
+        margin-right: 5px;
+        border: 1px solid #dcdcdc;
+        border-radius: 2px;
+        -webkit-border-radius: 2px;
+    }
+
+    .order-table .order-hd {
+        background: #f5f5f5;
+        height: 40px;
+        line-height: 40px;
+    }
+
+    .order-table .order-hd td.first {
+        padding-left: 20px;
+    }
+
+    .order-table .order-hd .order-main span {
+        margin-right: 8px;
+    }
+
+    .order-table .order-hd .order-code {
+        font-style: normal;
+        font-family: verdana;
+    }
+
+    .order-table .order-hd .order-sum {
+        padding: 0 5px;
+    }
+
+    .order-table .order-hd .dropdown-toggle {
+        line-height: 40px;
+        display: block;
+        /*padding: 0 10px;*/
+    }
+
+    .order-table > tbody {
+        border: 1px solid transparent;
+    }
+
+    .order-table > tbody:hover {
+        border-color: #56a022;
+        border-width: 2px;
+    }
+
+    .order-table .operates {
+        display: none;
+    }
+
+    .order-table > tbody:hover .operates {
+        display: block;
+    }
+
+    .order-table .order-bd {
+        border-bottom: 1px solid #e6e6e6;
+    }
+
+    .order-table .order-bd > td {
+        padding: 10px 5px;
+        vertical-align: top;
+        position: relative;
+    }
+
+    .order-table .order-bd .product {
+        padding-left: 20px;
+    }
+
+    .input-xs, .input-group-xs > .form-control, .input-group-xs > .input-group-addon, .input-group-xs > .input-group-btn > .btn {
+        height: 26px;
+        padding: 0 5px;
+        font-size: 12px;
+        line-height: 1.5;
+        border-radius: 3px;
+    }
+
+    .order-snapshot .title {
+        border-top: 1px dashed #ddd;
+    }
+
+    .order-snapshot .dl-horizontal dt {
+        width: 60px;
+        text-align: left;
+        font-weight: normal;
+        color: #999;
+        padding: 4px 0;
+    }
+
+    .order-snapshot .dl-horizontal dd {
+        margin-left: 80px;
+        padding: 4px 0;
+    }
+
+    /*arrow*/
+    .order-send {
+        position: relative;
+    }
+
+    .order-send.arrow-border:before, .arrow-border:after {
+        content: '';
+        position: absolute;
+        top: 20px;
+        width: 0;
+        height: 0;
+        border: 7px solid transparent;
+    }
+
+    .order-send.arrow-border.arrow-bottom-right:before {
+        content: '';
+        position: absolute;
+        left: -13px;
+        border-bottom-color: #fff;
+        border-right-color: #fff;
+        margin-top: -10px;
+    }
+
+    .padding-20 {
+        padding: 20px;
+    }
+
+    /* 动画 */
+    .repeat.ng-enter,
+    .repeat.ng-leave {
+        -webkit-transition: 0.5s linear all;
+        transition: 0.5s linear all;
+    }
+
+    .repeat.ng-enter,
+    .repeat.ng-leave.ng-leave-active {
+        opacity: 0;
+    }
+
+    .repeat.ng-leave,
+    .repeat.ng-enter.ng-enter-active {
+        opacity: 1;
+    }
+
+    /* 固定表头 */
+    .fixedHeader {
+        background-color: #f5f5f5;
+        position: relative;
+    }
+
+    .menu .new-dot {
+        width: 20px;
+        height: 20px;
+        line-height: 20px;
+        font-size: 12px;
+        color: #fff;
+        font-weight: inherit;
+        top: -2px;
+    }
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div class="block" id="public">
-<div class="loading in" ng-class="{'in': loading}">
-	<i></i>
-</div>
-<div class="pub-com_head">
-	<span>客户发货提醒</span>
-	<div class="p-right">
-		<a href="sale/notice/xls?_state={{active}}&keyword={{keywordXls}}&fromDate={{fromDateXls}}&endDate={{endDateXls}}" target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
-	</div>
-</div>
-<div class="menu condition block">
-		<div class="row">
-			<div class="col-xs-4">
-				<div class="btn-group btn-group-sm btn-group-justified">
-					<div class="btn-group btn-group-sm">
-						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部</button>
-					</div>
-					<div class="btn-group btn-group-sm">
-						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已发货</button>
-					</div>
-					<div class="btn-group btn-group-sm">
-						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待发货</button>
-					</div>
-					<div class="btn-group btn-group-sm" title="暂时还未到可发货日期">
-						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">备料中</button>
-					</div>
-					<div class="btn-group btn-group-sm">
-						<button type="button" class="btn btn-default btn-line"
-							ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已取消</button>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
-<!--<div class="height10">&nbsp;</div>-->
-	<div class="condition block">
-		<div class="search-bg condition block" style="padding: 10px 15px;">
-			<div class="row">
-				<div id="topSearch" style="float: left">
-					<a ng-click="changeDateZone(1);condition.$open=false" title="最近一个月" ng-class="{'active':condition.dateZone=='1'}">最近一个月</a>
-					<a ng-click="changeDateZone(3);condition.$open=false" title="最近三个月" ng-class="{'active':condition.dateZone=='3'}">最近三个月</a>
-					<a ng-click="changeDateZone(6);condition.$open=false" title="最近六个月" ng-class="{'active':condition.dateZone=='6'}">最近六个月</a>
-					<a ng-click="condition.$open=!condition.$open;changeDateZone(-1)" title="自定义" ng-class="{'active':condition.dateZone=='-1'}" >自定义</a>
-				</div>
-				<div class="col-xs-6" style="float: right;">
-					<div class="search">
-						<div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick"
-							 on-toggle="searchAdvance=open">
-							<input type="search" class="form-control input-sm" ng-model="keyword"
-								   ng-search="onSearch()" placeholder="输入单据编号、客户名称、物料名称搜索" style="width: 100%"/>
-							<a class="btn input-group-addon" ng-click="onSearch()">搜索</a>
-						</div>
-					</div>
-				</div>
-			</div>
-			<div class="more-list more" ng-class="{'open': condition.$open}">
-				<form class="form-inline">
-					<div class="form-group ">
-						<label>日期:</label>
-						<div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
-							<ul class="dropdown-menu">
-								<li><a ng-click="changeDateZone(1)">一个月内</a></li>
-								<li><a ng-click="changeDateZone(6)">半年内</a></li>
-								<li><a ng-click="changeDateZone()">半年前</a></li>
-							</ul>
-						</div>
-						<div class="form-group input-group input-group-xs input-trigger">
-							<input type="text" ng-model="condition.dateFrom"
-								   class="form-control" placeholder="从"
-								   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
-								   ng-required="true" max-date = "condition.dateTo"
-								   current-text="今天" clear-text="清除" close-text="关闭"
-								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
-							<span class="input-group-btn">
+    <div class="loading in" ng-class="{'in': loading}">
+        <i></i>
+    </div>
+    <div class="pub-com_head">
+        <span>客户发货提醒</span>
+        <div class="p-right">
+            <a href="sale/notice/xls?_state={{active}}&keyword={{keywordXls}}&fromDate={{fromDateXls}}&endDate={{endDateXls}}"
+               target="_self" class="text-simple" title="导出Excel表格"><i class="fa fa-file-excel-o fa-fw"></i>导出</a>
+        </div>
+    </div>
+    <div class="menu condition block">
+        <div class="row">
+            <div class="col-xs-4">
+                <div class="btn-group btn-group-sm btn-group-justified">
+                    <div class="btn-group btn-group-sm">
+                        <button type="button" class="btn btn-default btn-line"
+                                ng-class="{'btn-info':active=='all'}" ng-click="setActive('all')">全部
+                            <b class="new-dot" ng-if="unread.all > 0">{{unread.all>99?'99+':unread.all}}</b>
+                        </button>
+                    </div>
+                    <div class="btn-group btn-group-sm">
+                        <button type="button" class="btn btn-default btn-line"
+                                ng-class="{'btn-info':active=='done'}" ng-click="setActive('done')">已发货
+                            <b class="new-dot" ng-if="unread.replied > 0">{{unread.replied>99?'99+':unread.replied}}</b>
+                        </button>
+                    </div>
+                    <div class="btn-group btn-group-sm">
+                        <button type="button" class="btn btn-default btn-line"
+                                ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待发货
+                            <b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b>
+                        </button>
+                    </div>
+                    <div class="btn-group btn-group-sm" title="暂时还未到可发货日期">
+                        <button type="button" class="btn btn-default btn-line"
+                                ng-class="{'btn-info':active=='waiting'}" ng-click="setActive('waiting')">备料中
+                        </button>
+                    </div>
+                    <div class="btn-group btn-group-sm">
+                        <button type="button" class="btn btn-default btn-line"
+                                ng-class="{'btn-info':active=='end'}" ng-click="setActive('end')">已取消
+                        </button>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <!--<div class="height10">&nbsp;</div>-->
+    <div class="condition block">
+        <div class="search-bg condition block" style="padding: 10px 15px;">
+            <div class="row">
+                <div id="topSearch" style="float: left">
+                    <a ng-click="changeDateZone(1);condition.$open=false" title="最近一个月"
+                       ng-class="{'active':condition.dateZone=='1'}">最近一个月</a>
+                    <a ng-click="changeDateZone(3);condition.$open=false" title="最近三个月"
+                       ng-class="{'active':condition.dateZone=='3'}">最近三个月</a>
+                    <a ng-click="changeDateZone(6);condition.$open=false" title="最近六个月"
+                       ng-class="{'active':condition.dateZone=='6'}">最近六个月</a>
+                    <a ng-click="condition.$open=!condition.$open;changeDateZone(-1)" title="自定义"
+                       ng-class="{'active':condition.dateZone=='-1'}">自定义</a>
+                </div>
+                <div class="col-xs-6" style="float: right;">
+                    <div class="search">
+                        <div class="form-group form-group-sm has-feedback" dropdown auto-close="outsideClick"
+                             on-toggle="searchAdvance=open">
+                            <input type="search" class="form-control input-sm" ng-model="keyword"
+                                   ng-search="onSearch()" placeholder="输入单据编号、客户名称、物料名称搜索" style="width: 100%"/>
+                            <a class="btn input-group-addon" ng-click="onSearch()">搜索</a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="more-list more" ng-class="{'open': condition.$open}">
+                <form class="form-inline">
+                    <div class="form-group ">
+                        <label>日期:</label>
+                        <div class="btn-group btn-menu" dropdown is-open="condition.$dateZoneOpen">
+                            <ul class="dropdown-menu">
+                                <li><a ng-click="changeDateZone(1)">一个月内</a></li>
+                                <li><a ng-click="changeDateZone(6)">半年内</a></li>
+                                <li><a ng-click="changeDateZone()">半年前</a></li>
+                            </ul>
+                        </div>
+                        <div class="form-group input-group input-group-xs input-trigger">
+                            <input type="text" ng-model="condition.dateFrom"
+                                   class="form-control" placeholder="从"
+                                   datepicker-popup="yyyy-MM-dd" is-open="condition.$fromOpened"
+                                   ng-required="true" max-date="condition.dateTo"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-focus="openFilterDatePicker($event, condition, '$fromOpened')">
+                            <span class="input-group-btn">
 							<button type="button" class="btn btn-default"
-									ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
+                                    ng-click="openFilterDatePicker($event, condition, '$fromOpened')">
 								<i class="fa fa-calendar"></i>
 							</button>
 						</span>
-						</div>
-						<div class="form-group input-group input-group-xs input-trigger">
-							<input type="text" ng-model="condition.dateTo"
-								   class="form-control" placeholder="到"
-								   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
-								   ng-required="true" min-date = "condition.dateFrom"
-								   current-text="今天" clear-text="清除" close-text="关闭"
-								   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
-								   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
-							<span class="input-group-btn">
+                        </div>
+                        <div class="form-group input-group input-group-xs input-trigger">
+                            <input type="text" ng-model="condition.dateTo"
+                                   class="form-control" placeholder="到"
+                                   datepicker-popup="yyyy-MM-dd" is-open="condition.$toOpened"
+                                   ng-required="true" min-date="condition.dateFrom"
+                                   current-text="今天" clear-text="清除" close-text="关闭"
+                                   datepicker-options="{formatDayTitle: 'yyyy年M月', formatMonth: 'M月', showWeeks: false}"
+                                   ng-focus="openFilterDatePicker($event, condition, '$toOpened')">
+                            <span class="input-group-btn">
 							<button type="button" class="btn btn-default"
-									ng-click="openFilterDatePicker($event, condition, '$toOpened')">
+                                    ng-click="openFilterDatePicker($event, condition, '$toOpened')">
 								<i class="fa fa-calendar"></i>
 							</button>
 						</span>
-						</div>
-					</div>
-				</form>
-			</div>
-		</div>
-	</div>
-
-<table class="order-table block" ng-table="tableParams">
-	<thead>
-		<tr class="header">
-			<th width="200">产品</th>
-			<th width="150">备注</th>
-			<th width="160">数量</th>
-			<th width="140">价格</th>
-			<th width="140">交货日期</th>
-			<th width="100">操作</th>
-		</tr>
-		<tr class="sep-row">
-			<td colspan="6"></td>
-		</tr>
-		<tr class="toolbar toolbar-top">
-			<td colspan="5">
-				<div>
-					<label><input type="checkbox" class="selector select_all"
-						ng-model="checkboxes.checked" ng-click="checkAll()">全选</label> <a href="javascript:void(0)"
-						ng-disabled="active!='todo'" ng-click="sendByBatch()" class="btn btn-default btn-xs">批量发货</a>
-					<span class="text-muted">
+                        </div>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <table class="order-table block" ng-table="tableParams">
+        <thead>
+        <tr class="header">
+            <th width="200">产品</th>
+            <th width="150">备注</th>
+            <th width="160">数量</th>
+            <th width="140">价格</th>
+            <th width="140">交货日期</th>
+            <th width="100">操作</th>
+        </tr>
+        <tr class="sep-row">
+            <td colspan="6"></td>
+        </tr>
+        <tr class="toolbar toolbar-top">
+            <td colspan="5">
+                <div>
+                    <label><input type="checkbox" class="selector select_all"
+                                  ng-model="checkboxes.checked" ng-click="checkAll()">全选</label> <a
+                        href="javascript:void(0)"
+                        ng-disabled="active!='todo'" ng-click="sendByBatch()" class="btn btn-default btn-xs">批量发货</a>
+                    <span class="text-muted">
 						&nbsp;&nbsp;<i class="fa fa-exclamation-triangle"></i>批量发货要求对应订单的客户相同、币别相同、收款方式相同。
 						
 					</span>
-				</div> <!-- 分页 -->
-			</td>
-			<td class="text-center">
-
-			</td>
-		</tr>
-		<tr class="sep-row">
-			<td colspan="6"></td>
-		</tr>
-	</thead>
-	<tbody ng-repeat="notice in $data track by notice.id">
-		<tr class="order-hd">
-			<td class="first" colspan="3">
-				<div class="order-main">
+                </div> <!-- 分页 -->
+            </td>
+            <td class="text-center">
+
+            </td>
+        </tr>
+        <tr class="sep-row">
+            <td colspan="6"></td>
+        </tr>
+        </thead>
+        <tbody ng-repeat="notice in $data track by notice.id">
+        <tr class="order-hd">
+            <td class="first" colspan="3">
+                <div class="order-main">
 					<span> <input type="checkbox" ng-disabled="notice.waiting" class="selector"
-						ng-model="notice.$selected" ng-click="checkOne(notice)">
+                                         ng-model="notice.$selected" ng-click="checkOne(notice)">
 					</span>
-					<span class="text-num text-bold"
-						ng-bind="::notice.date | date:'yyyy-MM-dd'"></span>
-					<span
-							ng-bind="notice.orderItem.order.enterprise.enName"></span>
-				</div>
-			</td>
-			<td class="text-right" colspan="2" class="order-sum"><a
-				class="dropdown-toggle" ui-sref="sale.order_detail({id:notice.orderItem.order.id})" target="_self"> <span
-					class="text-num text-bold" ng-bind="::notice.orderItem.order.code"></span>
-					第{{notice.orderItem.number}}行 <i class="fa fa-fw fa-angle-down"></i>
-			</a>
-				<div class="dropdown-menu order-snapshot" style="padding: 10px 15px">
-					<div class="text-center text-bold title">订单快照</div>
-					<dl class="dl-horizontal">
-						<dt>日期</dt>
-						<dd>{{::notice.orderItem.order.date | date : 'yyyy-MM-dd'}}</dd>
-						<dt>采购员</dt>
-						<dd>{{::notice.orderItem.order.user.userName}}</dd>
-						<dt>付款条件</dt>
-						<dd>{{::notice.orderItem.order.payments}}</dd>
-						<dt>付款币别</dt>
-						<dd>{{::notice.orderItem.order.currency}}</dd>
-						<dt>交货地址</dt>
-						<dd>{{::notice.orderItem.order.shipAddress}}</dd>
-						<dt>备注</dt>
-						<dd>{{::notice.orderItem.order.remark}}</dd>
-					</dl>
-				</div></td>
-			<td class="text-center">
-				<div class="operates">
-					<!-- <a ng-click="print(notice)" class="text-muted" title="打印"><i
-						class="fa fa-print fa-lg"></i></a> -->
-				</div>
-			</td>
-		</tr>
-		<tr class="order-bd">
-			<td class="product">
-				<div class="text-num text-bold">
-					<span ng-bind="::notice.orderItem.product.code"></span>
-				</div>
-				<div>
-					<span ng-bind="::notice.orderItem.product.title"></span>
-				</div>
-				<div class="text-muted text-ellipsis"
-					ng-bind="::notice.orderItem.product.spec"></div>
-				<div class="text-bold text-inverse" ng-if="notice.orderItem.factory">送货工厂:<span ng-bind="::notice.orderItem.factory"></span></div>						
-			</td>
-			<td class="text-center">
-				<div ng-show="!notice.$editing">{{notice.remark}}</div>
-				<div ng-if="notice.$editing">
-					<input type="text" class="form-control input-xs"
-						ng-model="notice.send.code" placeholder="送货单号">
-				</div>
-				<div style="margin: 5px auto" ng-if="notice.$editing" ng-click="autoCode(notice)">
-					<button style="width: 100%;" class="btn btn-default btn-xs">生成随机单号</button>
-				</div>
-			</td>
-			<td class="br-l">
-				<div ng-show="notice.endQty >= notice.qty" class="text-center dropdown">
-					<a href="javascript:void(0);" class="dropdown-toggle text-default" ng-mouseenter="getSends(notice)">发货记录<i class="fa fa-fw fa-angle-down"></i></a>
-					<div class="dropdown-menu order-send arrow-border arrow-bottom-right" style="padding: 10px 15px">
-						<span ng-if="notice.endQty ==0" class="text-muted">还未发货</span>
-						<span ng-show="notice.getSendsing" class="text-muted">加载中...</span>
-						<span ng-show="notice.getSendsError" class="text-muted">加载失败</span>
-						<ul class="list-unstyled list-menu" ng-if="notice.sends">
-							<li ng-repeat="send in notice.sends">
-								<div ng-class="{'text-inverse': $index==0}">
-									{{::send.send.date | date:'MM-dd HH:mm'}}
-								</div>
-								<div class="text-muted">{{::send.send.recorder}} 发货 {{::send.qty}} {{::send.orderItem.product.unit}}</div>
-								<div class="text-muted">单号:{{::send.send.code}}
-									<i class="fa fa-truck fa-flip-horizontal pull-right text-muted"></i>
-								</div>
-								<code ng-if="send.replyRemark"><i class="fa fa-fw fa-warning"></i><span ng-bind="::send.replyRemark"></span></code>
-							</li>
-						</ul>
-					</div>
-				</div>
-				<div ng-show="!notice.endQty || notice.endQty < notice.qty">
-					<div ng-show="!notice.$editing">
-						<ul>
-							<li>本次需求:{{::notice.qty}}</li>
-							<li>剩余未发:<span class="text-num text-inverse"
-										   ng-bind="notice.qty-(notice.endQty || 0)"></span></li>
-							<li><span>[订单数:{{::notice.orderItem.qty}}]</span></li>
-							<li class="dropdown dropdown-submenu"><a ng-click="" class="dropdown-toggle" ng-mouseenter="getSends(notice)"><span
-									ng-class="{'text-muted' : notice.endQty == null || notice.endQty == 0,'text-default': notice.endQty > 0}">[已发货:{{notice.endQty}}]</span></a>
-								<div class="dropdown-menu order-send arrow-border arrow-bottom-right"
-									style="padding: 10px 15px; width: 240px;">
-									<span ng-if="notice.endQty ==0" class="text-muted">还未发货</span>
-									<span ng-show="notice.getSendsing" class="text-muted">加载中...</span>
-									<span ng-show="notice.getSendsError" class="text-muted">加载失败</span>
-									<ul class="list-unstyled list-menu" ng-if="notice.sends">
-										<li ng-repeat="send in notice.sends">
-											<div ng-class="{'text-inverse': $index==0}">
-												{{::send.send.date | date:'MM-dd HH:mm'}}
-											</div>
-											<div class="text-muted">{{::send.send.recorder}} 发货 {{::send.qty}} {{::send.orderItem.product.unit}}</div>
-											<div class="text-muted">单号:{{::send.send.code}}
-												<i class="fa fa-truck fa-flip-horizontal pull-right text-muted"></i>
-											</div>
-											<code ng-if="send.replyRemark"><i class="fa fa-fw fa-warning"></i><span ng-bind="::send.replyRemark"></span></code>
-										</li>
-									</ul>
-								</div>
-							</li>
-						</ul>
-					</div>
-					<div style="margin: 0 auto" ng-if="notice.$editing"
-						ng-init="notice.send.qty=notice.qty-(notice.endQty || 0)">
-						<input type="text" class="form-control input-xs"
-							ng-model="notice.send.qty" placeholder="数量">
-					</div>
-					<div style="margin: 5px auto" ng-if="notice.$editing" >
+                    <a href="javascript:void(0)" ng-if="!isUnread(notice.id)">
+                        <i class="fa fa-circle-thin"></i>
+                    </a>
+                    <a href="javascript:void(0)" ng-if="isUnread(notice.id)">
+                        <i class="fa fa-circle" style="color: #f40;"></i>
+                    </a>&nbsp;&nbsp;
+                    <span class="text-num text-bold"
+                          ng-bind="::notice.date | date:'yyyy-MM-dd'"></span>
+                    <span
+                            ng-bind="notice.orderItem.order.enterprise.enName"></span>
+                </div>
+            </td>
+            <td class="text-right" colspan="2" class="order-sum"><a
+                    class="dropdown-toggle" ui-sref="sale.order_detail({id:notice.orderItem.order.id})" target="_self"> <span
+                    class="text-num text-bold" ng-bind="::notice.orderItem.order.code" ng-click="setOrdersRead(notice.id)"></span>
+                第{{notice.orderItem.number}}行 <i class="fa fa-fw fa-angle-down"></i>
+            </a>
+                <div class="dropdown-menu order-snapshot" style="padding: 10px 15px">
+                    <div class="text-center text-bold title">订单快照</div>
+                    <dl class="dl-horizontal">
+                        <dt>日期</dt>
+                        <dd>{{::notice.orderItem.order.date | date : 'yyyy-MM-dd'}}</dd>
+                        <dt>采购员</dt>
+                        <dd>{{::notice.orderItem.order.user.userName}}</dd>
+                        <dt>付款条件</dt>
+                        <dd>{{::notice.orderItem.order.payments}}</dd>
+                        <dt>付款币别</dt>
+                        <dd>{{::notice.orderItem.order.currency}}</dd>
+                        <dt>交货地址</dt>
+                        <dd>{{::notice.orderItem.order.shipAddress}}</dd>
+                        <dt>备注</dt>
+                        <dd>{{::notice.orderItem.order.remark}}</dd>
+                    </dl>
+                </div>
+            </td>
+            <td class="text-center">
+                <div class="operates">
+                    <!-- <a ng-click="print(notice)" class="text-muted" title="打印"><i
+                        class="fa fa-print fa-lg"></i></a> -->
+                </div>
+            </td>
+        </tr>
+        <tr class="order-bd">
+            <td class="product">
+                <div class="text-num text-bold">
+                    <span ng-bind="::notice.orderItem.product.code"></span>
+                </div>
+                <div>
+                    <span ng-bind="::notice.orderItem.product.title"></span>
+                </div>
+                <div class="text-muted text-ellipsis"
+                     ng-bind="::notice.orderItem.product.spec"></div>
+                <div class="text-bold text-inverse" ng-if="notice.orderItem.factory">送货工厂:<span
+                        ng-bind="::notice.orderItem.factory"></span></div>
+            </td>
+            <td class="text-center">
+                <div ng-show="!notice.$editing">{{notice.remark}}</div>
+                <div ng-if="notice.$editing">
+                    <input type="text" class="form-control input-xs"
+                           ng-model="notice.send.code" placeholder="送货单号">
+                </div>
+                <div style="margin: 5px auto" ng-if="notice.$editing" ng-click="autoCode(notice)">
+                    <button style="width: 100%;" class="btn btn-default btn-xs">生成随机单号</button>
+                </div>
+            </td>
+            <td class="br-l">
+                <div ng-show="notice.endQty >= notice.qty" class="text-center dropdown">
+                    <a href="javascript:void(0);" class="dropdown-toggle text-default" ng-mouseenter="getSends(notice)">发货记录<i
+                            class="fa fa-fw fa-angle-down"></i></a>
+                    <div class="dropdown-menu order-send arrow-border arrow-bottom-right" style="padding: 10px 15px">
+                        <span ng-if="notice.endQty ==0" class="text-muted">还未发货</span>
+                        <span ng-show="notice.getSendsing" class="text-muted">加载中...</span>
+                        <span ng-show="notice.getSendsError" class="text-muted">加载失败</span>
+                        <ul class="list-unstyled list-menu" ng-if="notice.sends">
+                            <li ng-repeat="send in notice.sends">
+                                <div ng-class="{'text-inverse': $index==0}">
+                                    {{::send.send.date | date:'MM-dd HH:mm'}}
+                                </div>
+                                <div class="text-muted">{{::send.send.recorder}} 发货 {{::send.qty}}
+                                    {{::send.orderItem.product.unit}}
+                                </div>
+                                <div class="text-muted">单号:{{::send.send.code}}
+                                    <i class="fa fa-truck fa-flip-horizontal pull-right text-muted"></i>
+                                </div>
+                                <code ng-if="send.replyRemark"><i class="fa fa-fw fa-warning"></i><span
+                                        ng-bind="::send.replyRemark"></span></code>
+                            </li>
+                        </ul>
+                    </div>
+                </div>
+                <div ng-show="!notice.endQty || notice.endQty < notice.qty">
+                    <div ng-show="!notice.$editing">
+                        <ul>
+                            <li>本次需求:{{::notice.qty}}</li>
+                            <li>剩余未发:<span class="text-num text-inverse"
+                                           ng-bind="notice.qty-(notice.endQty || 0)"></span></li>
+                            <li><span>[订单数:{{::notice.orderItem.qty}}]</span></li>
+                            <li class="dropdown dropdown-submenu"><a ng-click="" class="dropdown-toggle"
+                                                                     ng-mouseenter="getSends(notice)"><span
+                                    ng-class="{'text-muted' : notice.endQty == null || notice.endQty == 0,'text-default': notice.endQty > 0}">[已发货:{{notice.endQty}}]</span></a>
+                                <div class="dropdown-menu order-send arrow-border arrow-bottom-right"
+                                     style="padding: 10px 15px; width: 240px;">
+                                    <span ng-if="notice.endQty ==0" class="text-muted">还未发货</span>
+                                    <span ng-show="notice.getSendsing" class="text-muted">加载中...</span>
+                                    <span ng-show="notice.getSendsError" class="text-muted">加载失败</span>
+                                    <ul class="list-unstyled list-menu" ng-if="notice.sends">
+                                        <li ng-repeat="send in notice.sends">
+                                            <div ng-class="{'text-inverse': $index==0}">
+                                                {{::send.send.date | date:'MM-dd HH:mm'}}
+                                            </div>
+                                            <div class="text-muted">{{::send.send.recorder}} 发货 {{::send.qty}}
+                                                {{::send.orderItem.product.unit}}
+                                            </div>
+                                            <div class="text-muted">单号:{{::send.send.code}}
+                                                <i class="fa fa-truck fa-flip-horizontal pull-right text-muted"></i>
+                                            </div>
+                                            <code ng-if="send.replyRemark"><i class="fa fa-fw fa-warning"></i><span
+                                                    ng-bind="::send.replyRemark"></span></code>
+                                        </li>
+                                    </ul>
+                                </div>
+                            </li>
+                        </ul>
+                    </div>
+                    <div style="margin: 0 auto" ng-if="notice.$editing"
+                         ng-init="notice.send.qty=notice.qty-(notice.endQty || 0)">
+                        <input type="text" class="form-control input-xs"
+                               ng-model="notice.send.qty" placeholder="数量">
+                    </div>
+                    <div style="margin: 5px auto" ng-if="notice.$editing">
 						<textarea cols="2" type="text" class="form-control input-xs"
-							ng-model="notice.send.remark" placeholder="备注"></textarea>
-					</div>
-				</div>
-			</td>
-			<td class="text-center br-l text-num">{{::currency(notice.orderItem.order.currency)}}{{::notice.orderItem.price | number:6}}</td>
-			<td class="text-center br-l">
-				<div><span ng-bind="::notice.delivery | date : 'yyyy-MM-dd'"></span></div>
-				<div style="margin-top: 10px;" ng-if="notice.waiting" class="text-inverse">
-					可发货日期<br>
-					<span ng-bind="::sendDate(notice) | date : 'yyyy-MM-dd'"></span>
-				</div>
-			</td>
-			<td class="text-center br-l">
-				<div ng-if="notice.endQty>=notice.qty" class="block">
-					<span class="text-trans success">已发货</span>
-				</div>
-				<div ng-if="notice.end" class="block">
-					<span class="text-trans warning">已取消</span>
-				</div>
-				<div ng-if="(!notice.endQty || notice.endQty<notice.qty) && !notice.end && !notice.waiting">
-					<div ng-show="!notice.$editing">
-						<div ng-show="!isInTruck(notice.id)">
-							<div class="br-b">
-								<a ng-click="notice.$editing=!notice.$editing"><i class="fa fa-send-o fa-lg"></i><br>发 货</a>
-							</div>
-							<div>
-								<a ng-click="addtoTruck(notice)" class="text-simple"><i class="fa fa-ambulance fa-lg"></i><br>加入货车</a>
-							</div>
-						</div>
-						<div ng-show="isInTruck(notice.id)">
-							<div class="text-inverse">已加入<br>货车</div>
-							<div><a ng-click="delFromTruck(notice)" class="text-simple">取出<i class="fa fa-fw fa-share"></i></a></div>
-						</div>
-					</div>
-					<div ng-show="notice.$editing">
-						<div>
-							<a ng-click="notice.$editing=!notice.$editing">取消</a>
-						</div>
-						<br>
-						<div>
-							<a ng-click="lockClick(notice);onReplyClick(notice);" ng-disabled="lockstatus" class="btn btn-link btn-xs text-inverse">确认发货</a>
-						</div>
-					</div>
-				</div>
-				<div ng-if="(!notice.endQty || notice.endQty<notice.qty) && !notice.end && notice.waiting" class="text-muted">
-					<div title="暂时不可发货"><i class="fa fa-cog fa-lg"></i><br>备料中</div>
-				</div>
-			</td>
-		</tr>
-	</tbody>
-</table>
+                                  ng-model="notice.send.remark" placeholder="备注"></textarea>
+                    </div>
+                </div>
+            </td>
+            <td class="text-center br-l text-num">
+                {{::currency(notice.orderItem.order.currency)}}{{::notice.orderItem.price | number:6}}
+            </td>
+            <td class="text-center br-l">
+                <div><span ng-bind="::notice.delivery | date : 'yyyy-MM-dd'"></span></div>
+                <div style="margin-top: 10px;" ng-if="notice.waiting" class="text-inverse">
+                    可发货日期<br>
+                    <span ng-bind="::sendDate(notice) | date : 'yyyy-MM-dd'"></span>
+                </div>
+            </td>
+            <td class="text-center br-l">
+                <div ng-if="notice.endQty>=notice.qty" class="block">
+                    <span class="text-trans success">已发货</span>
+                </div>
+                <div ng-if="notice.end" class="block">
+                    <span class="text-trans warning">已取消</span>
+                </div>
+                <div ng-if="(!notice.endQty || notice.endQty<notice.qty) && !notice.end && !notice.waiting">
+                    <div ng-show="!notice.$editing">
+                        <div ng-show="!isInTruck(notice.id)">
+                            <div class="br-b">
+                                <a ng-click="notice.$editing=!notice.$editing"><i class="fa fa-send-o fa-lg"></i><br>发 货</a>
+                            </div>
+                            <div>
+                                <a ng-click="addtoTruck(notice)" class="text-simple"><i
+                                        class="fa fa-ambulance fa-lg"></i><br>加入货车</a>
+                            </div>
+                        </div>
+                        <div ng-show="isInTruck(notice.id)">
+                            <div class="text-inverse">已加入<br>货车</div>
+                            <div><a ng-click="delFromTruck(notice)" class="text-simple">取出<i
+                                    class="fa fa-fw fa-share"></i></a></div>
+                        </div>
+                    </div>
+                    <div ng-show="notice.$editing">
+                        <div>
+                            <a ng-click="notice.$editing=!notice.$editing">取消</a>
+                        </div>
+                        <br>
+                        <div>
+                            <a ng-click="lockClick(notice);onReplyClick(notice);" ng-disabled="lockstatus"
+                               class="btn btn-link btn-xs text-inverse">确认发货</a>
+                        </div>
+                    </div>
+                </div>
+                <div ng-if="(!notice.endQty || notice.endQty<notice.qty) && !notice.end && notice.waiting"
+                     class="text-muted">
+                    <div title="暂时不可发货"><i class="fa fa-cog fa-lg"></i><br>备料中</div>
+                </div>
+            </td>
+        </tr>
+        </tbody>
+    </table>
 </div>

+ 22 - 3
src/main/webapp/resources/tpl/index/sale/tenderlist.html

@@ -185,6 +185,15 @@
     #public .menu{
         border-bottom: 0 !important;
     }
+    .menu .new-dot{
+        width: 20px;
+        height: 20px;
+        line-height: 20px;
+        font-size: 12px;
+        color: #fff;
+        font-weight: inherit;
+        top: -2px;
+    }
 </style>
 <link rel="stylesheet" href="static/css/public.css">
 <div id="public">
@@ -212,7 +221,9 @@
                     </div>
                     <div class="btn-group btn-group-sm">
                         <button type="button" class="btn btn-default btn-line"
-                                ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待投标</button>
+                                ng-class="{'btn-info':active=='todo'}" ng-click="setActive('todo')">待投标
+                            <b class="new-dot" ng-if="unread.notReply > 0">{{unread.notReply>99?'99+':unread.notReply}}</b>
+                        </button>
                     </div>
                     <div class="btn-group btn-group-sm">
                         <button type="button" class="btn btn-default btn-line"
@@ -405,12 +416,20 @@
             <tbody class="not-done" ng-repeat="tender in $data" ng-show="active != 'done' && active != 'waiting'">
             <tr>
                 <td class="list-notnum" width=300">
-                    <div>招标企业:{{tender.enterprise.enName}}</div>
+                    <div>
+                        <a href="javascript:void(0)" ng-if="!isUnread(tender.id)">
+                            <i class="fa fa-circle-thin"></i>
+                        </a>
+                        <a href="javascript:void(0)" ng-if="isUnread(tender.id)">
+                            <i class="fa fa-circle" style="color: #f40;"></i>
+                        </a>&nbsp;&nbsp;
+                        招标企业:{{tender.enterprise.enName}}
+                    </div>
                     <div>
                         招标标题:{{tender.title}}
                     </div>
                     <div>
-                        单号:<a ui-sref="sale.tender({id:tender.id})" target="_self" title="点击查看详情">{{tender.code}}</a>
+                        单号:<a ui-sref="sale.tender({id:tender.id})" target="_self" title="点击查看详情" ng-click="setOrdersRead(tender.id)">{{tender.code}}</a>
                     </div>
                     <div>
                         <strong ng-if="tender.ifOpen == 0">指定招标</strong>