Kaynağa Gözat

Merge branch 'dev-mysql' into feature_release-tomysql

wangdy 8 yıl önce
ebeveyn
işleme
a476484e44
47 değiştirilmiş dosya ile 5163 ekleme ve 51 silme
  1. 2 2
      src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java
  2. 31 0
      src/main/java/com/uas/platform/b2c/trade/order/dao/OrderDao.java
  3. 9 0
      src/main/java/com/uas/platform/b2c/trade/order/dao/PurchaseDao.java
  4. 41 0
      src/main/java/com/uas/platform/b2c/trade/order/model/Order.java
  5. 10 1
      src/main/java/com/uas/platform/b2c/trade/order/service/OrderService.java
  6. 16 0
      src/main/java/com/uas/platform/b2c/trade/order/service/PurchaseService.java
  7. 58 22
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java
  8. 10 0
      src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java
  9. 6 2
      src/main/java/com/uas/platform/b2c/trade/order/status/OrderStatus.java
  10. 6 1
      src/main/java/com/uas/platform/b2c/trade/order/status/PurchaseStatus.java
  11. 298 0
      src/main/java/com/uas/platform/b2c/trade/rate/controller/RateController.java
  12. 24 0
      src/main/java/com/uas/platform/b2c/trade/rate/dao/RateBuyerDao.java
  13. 39 0
      src/main/java/com/uas/platform/b2c/trade/rate/dao/RateGoodsDao.java
  14. 33 0
      src/main/java/com/uas/platform/b2c/trade/rate/dao/RateTemplateDao.java
  15. 23 0
      src/main/java/com/uas/platform/b2c/trade/rate/dao/RateVendorDao.java
  16. 194 0
      src/main/java/com/uas/platform/b2c/trade/rate/model/RateBuyer.java
  17. 260 0
      src/main/java/com/uas/platform/b2c/trade/rate/model/RateGoods.java
  18. 111 0
      src/main/java/com/uas/platform/b2c/trade/rate/model/RateTemplate.java
  19. 158 0
      src/main/java/com/uas/platform/b2c/trade/rate/model/RateVendor.java
  20. 125 0
      src/main/java/com/uas/platform/b2c/trade/rate/service/RateService.java
  21. 295 0
      src/main/java/com/uas/platform/b2c/trade/rate/service/impl/RateServiceImpl.java
  22. 36 0
      src/main/java/com/uas/platform/b2c/trade/rate/status/RateType.java
  23. 256 0
      src/main/java/com/uas/platform/b2c/trade/rate/task/RateTask.java
  24. 10 1
      src/main/resources/spring/task.xml
  25. BIN
      src/main/webapp/resources/img/user/images/rate1.png
  26. BIN
      src/main/webapp/resources/img/user/images/rate2.png
  27. BIN
      src/main/webapp/resources/img/user/images/rate3.png
  28. BIN
      src/main/webapp/resources/img/user/images/rateBad.png
  29. BIN
      src/main/webapp/resources/img/user/images/rateGood.png
  30. BIN
      src/main/webapp/resources/img/vendor/images/rate-add.png
  31. BIN
      src/main/webapp/resources/img/vendor/images/rate-box-del.png
  32. 82 0
      src/main/webapp/resources/js/common/query/rate.js
  33. 1 0
      src/main/webapp/resources/js/index/app.js
  34. 20 2
      src/main/webapp/resources/js/usercenter/app.js
  35. 95 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/add_rate_ctrl.js
  36. 20 4
      src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js
  37. 105 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/first_rate_ctrl.js
  38. 86 0
      src/main/webapp/resources/js/usercenter/controllers/forstore/show_rate_ctrl.js
  39. 8 9
      src/main/webapp/resources/js/vendor/app.js
  40. 318 0
      src/main/webapp/resources/js/vendor/controllers/forstore/show_rate_ctrl.js
  41. 246 2
      src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js
  42. 425 0
      src/main/webapp/resources/view/usercenter/forstore/add_rate.html
  43. 26 3
      src/main/webapp/resources/view/usercenter/forstore/buyer_order.html
  44. 354 0
      src/main/webapp/resources/view/usercenter/forstore/first_rate.html
  45. 405 0
      src/main/webapp/resources/view/usercenter/forstore/show_rate.html
  46. 607 0
      src/main/webapp/resources/view/vendor/forstore/showRate.html
  47. 314 2
      src/main/webapp/resources/view/vendor/forstore/vendor_order.html

+ 2 - 2
src/main/java/com/uas/platform/b2c/trade/order/controller/OrderController.java

@@ -460,14 +460,14 @@ public class OrderController {
 	 * @return model map
 	 */
 	@RequestMapping(value = "/individual", method = RequestMethod.GET)
-	public ModelMap findIndividualOrders(PageParams params, String keyword, String status, Integer available, Long startDate, Long endDate, String exType) {
+	public ModelMap findIndividualOrders(PageParams params, String keyword, String status,Boolean isRate, Integer available, Long startDate, Long endDate, String exType) {
 		PageInfo pageInfo = new PageInfo(params);
 		Date start = startDate != null ? new Date(startDate) : null;
 		Date end = endDate != null ? new Date(endDate) : null;
 
 		assert logger != null;
 		logger.log("买家订单管理", "买家获取买家订单信息");
-		return orderService.findOrdersByInternal(pageInfo, keyword, status, available, false, start, end, exType);
+		return orderService.findOrdersByInternal(pageInfo, keyword, status, available, false, start, end, exType,isRate);
 	}
 
 	/**

+ 31 - 0
src/main/java/com/uas/platform/b2c/trade/order/dao/OrderDao.java

@@ -68,6 +68,15 @@ public interface OrderDao extends JpaSpecificationExecutor<Order>, JpaRepository
 	@Query("select o from trade.Order o where o.orderid in (:orderids)")
 	List<Order> findByOrderIds(@Param("orderids") List<String> orderids);
 
+	/**
+	 * 根据某个状态之后的订单
+	 *
+	 * @param status the status
+	 * @return  orders
+	 */
+	@Query(nativeQuery = true, value="selcet * from trade$order a where a.or_status >=:status ")
+	List<Order> findByAfterStatus(@Param("status") Integer status);
+
 	/**
 	 * Gets count by buyeruu and status.
 	 *
@@ -79,6 +88,17 @@ public interface OrderDao extends JpaSpecificationExecutor<Order>, JpaRepository
 	@Query(value="select count(*) from trade.Order a where a.buyeruu=:buyeruu and a.buyerenuu = :buyerenuu and a.used = 1 and a.status=:status and a.proofingid is null and a.orderids is null")
 	int getCountByBuyeruuAndStatus(@Param("buyeruu") Long buyeruu, @Param("buyerenuu") Long buyerenuu, @Param("status") Integer status);
 
+	/**
+	 * Gets count by buyeruu and status.
+	 *
+	 * @param buyeruu   the buyeruu
+	 * @param buyerenuu the buyerenuu
+	 * @param status    the status
+	 * @return the count by buyeruu and status
+	 */
+	@Query(value="select count(*) from trade.Order a where a.buyeruu=:buyeruu and a.buyerenuu = :buyerenuu and a.used = 1 and a.status=:status and a.proofingid is null and a.orderids is null and a.rateStatus is null")
+	int getCountByBuyeruuAndStatusAndRate(@Param("buyeruu") Long buyeruu, @Param("buyerenuu") Long buyerenuu, @Param("status") Integer status);
+
 	/**
 	 * Gets count by buyeruu and status and dissociative.
 	 *
@@ -90,6 +110,17 @@ public interface OrderDao extends JpaSpecificationExecutor<Order>, JpaRepository
 	@Query(value="select count(1) from trade.Order a where a.buyeruu=:buyeruu and a.used = 1 and a.dissociative = :dissociative and a.status=:status and a.proofingid is null and a.orderids is null")
 	int getCountByBuyeruuAndStatusAndDissociative(@Param("buyeruu") Long buyeruu, @Param("dissociative") Integer dissociative, @Param("status") Integer status);
 
+	/**
+	 * Gets count by buyeruu and status and dissociative.
+	 *
+	 * @param buyeruu      the buyeruu
+	 * @param dissociative the dissociative
+	 * @param status       the status
+	 * @return the count by buyeruu and status and dissociative
+	 */
+	@Query(value="select count(1) from trade.Order a where a.buyeruu=:buyeruu and a.used = 1 and a.dissociative = :dissociative and a.status=:status and a.proofingid is null and a.orderids is null and a.rateStatus is null")
+	int getCountByBuyeruuAndStatusAndDissociativeAndRate(@Param("buyeruu") Long buyeruu, @Param("dissociative") Integer dissociative, @Param("status") Integer status);
+
 	/**
 	 * Gets count by buyeruu.
 	 *

+ 9 - 0
src/main/java/com/uas/platform/b2c/trade/order/dao/PurchaseDao.java

@@ -29,6 +29,15 @@ public interface PurchaseDao extends JpaSpecificationExecutor<Purchase>, JpaRepo
 	 */
 	List<Purchase> findByStatus(Integer status);
 
+	/**
+	 * 根据之后的状态查找采购单
+	 *
+	 * @param status the status
+	 * @return list
+	 */
+	@Query(nativeQuery = true, value = "select * from trade$purchase where pu_status >= :status")
+	List<Purchase> findByAfterStatus(@Param("status") Integer status);
+
 	/**
 	 * 根据状态和企业UU查询采购单
 	 *

+ 41 - 0
src/main/java/com/uas/platform/b2c/trade/order/model/Order.java

@@ -278,6 +278,12 @@ public class Order extends Document implements Serializable {
 	@StatusColumn
 	private Integer status;
 
+	/**
+	 * 评论状态
+	 */
+	@Column(name = "or_ratestatus")
+	private Integer rateStatus;
+
 	/**
 	 * 付款时间
 	 */
@@ -1120,6 +1126,14 @@ public class Order extends Document implements Serializable {
 		this.status = status;
 	}
 
+	public Integer getRateStatus() {
+		return rateStatus;
+	}
+
+	public void setRateStatus(Integer rateStatus) {
+		this.rateStatus = rateStatus;
+	}
+
 	/**
 	 * Gets return status.
 	 *
@@ -1339,6 +1353,33 @@ public class Order extends Document implements Serializable {
 		this.statushistory = addStatusHistory(this.statushistory, uu, this.status);
 	}
 
+	/**
+	 * Sets status TO_BE_REVIEWED.
+	 * 被初评的记录
+	 *
+	 * @param uu the uu
+	 */
+	public void setStatusToBeReviewed(Long uu) {
+		this.rateStatus = Status.TO_BE_REVIEWED.value();
+	}
+	/**
+	 * Sets status TO_BE_AFTERREVIEWED.
+	 * 被追平的记录
+	 *
+	 * @param uu the uu
+	 */
+	public void setStatusToBeAfterReviewed(Long uu) {
+		this.rateStatus = Status.TO_BE_AFTERREVIEWED.value();
+	}
+	/**
+	 * Sets status REVIEWED.
+	 *
+	 * @param uu the uu
+	 */
+	public void setStatusReviewed(Long uu) {
+		this.rateStatus = Status.REVIEWED.value();
+	}
+
 	/**
 	 * Sets status un available.
 	 *

+ 10 - 1
src/main/java/com/uas/platform/b2c/trade/order/service/OrderService.java

@@ -287,6 +287,15 @@ public interface OrderService {
 	 */
 	List<Order> findByStatus(Integer status);
 
+	/**
+	 * 根据类别查找
+	 *
+	 * @param status the status
+	 * @return list list
+	 * @TODO 查找某个状态之后的订单
+	 */
+	List<Order> findByAfterStatus(Integer status);
+
 	/**
 	 * 通过批次号查询到对应商品
 	 *
@@ -359,7 +368,7 @@ public interface OrderService {
 	 * @param exType    异常类型
 	 * @return model map
 	 */
-	ModelMap findOrdersByInternal(PageInfo pageInfo, String keyword, String status, Integer available, boolean isProof, Date startDate, Date endDate, String exType);
+	ModelMap findOrdersByInternal(PageInfo pageInfo, String keyword, String status, Integer available, boolean isProof, Date startDate, Date endDate, String exType, Boolean isRate);
 
 	/**
 	 * 买家根据订单状态查看订单

+ 16 - 0
src/main/java/com/uas/platform/b2c/trade/order/service/PurchaseService.java

@@ -131,6 +131,22 @@ public interface PurchaseService {
 	 */
 	Page<Purchase> findPageByStatus(PageInfo pageInfo, String keyword);
 
+	/**
+	 * 根据状态查找采购单
+	 *
+	 * @param status the status
+	 * @return list
+	 */
+	List<Purchase> findByStatus(Integer status);
+
+	/**
+	 * 根据之后的状态查找采购单
+	 *
+	 * @param status the status
+	 * @return list
+	 */
+	List<Purchase> findByAfterStatus(Integer status);
+
 	/**
 	 * 平台管理员获取采购单
 	 *

+ 58 - 22
src/main/java/com/uas/platform/b2c/trade/order/service/impl/OrderServiceImpl.java

@@ -3,6 +3,7 @@ package com.uas.platform.b2c.trade.order.service.impl;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.sun.org.apache.xpath.internal.operations.Bool;
 import com.uas.api.b2c_erp.buyer.model.B2cOrder;
 import com.uas.api.exception.B2CException;
 import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
@@ -1532,6 +1533,11 @@ public class OrderServiceImpl implements OrderService {
         return orderDao.findByStatus(status);
     }
 
+    @Override
+    public List<Order> findByAfterStatus(Integer status) {
+        return orderDao.findByAfterStatus(status);
+    }
+
     @Override
     public List<Order> findOnes() {
         Long uu = SystemSession.getUser().getUserUU();
@@ -1852,7 +1858,7 @@ public class OrderServiceImpl implements OrderService {
     }
 
     @Override
-    public ModelMap findOrdersByInternal(final PageInfo pageInfo, String keyword, String status, Integer available, boolean isProof, Date startDate, Date endDate, String exType) {
+    public ModelMap findOrdersByInternal(final PageInfo pageInfo, String keyword, String status, Integer available, boolean isProof, Date startDate, Date endDate, String exType, Boolean isRate) {
         ModelMap modelMap = new ModelMap();
         final Long userUU = SystemSession.getUser().getUserUU();
         final Long enUU = SystemSession.getUser().getEnterprise() != null ? SystemSession.getUser().getEnterprise().getUu() : null;
@@ -1939,6 +1945,9 @@ public class OrderServiceImpl implements OrderService {
                 pageInfo.filter("status", Short.parseShort(status));
             }
         }
+        if (null != isRate && isRate == true) {
+            pageInfo.expression(PredicateUtils.isNull("rateStatus"));
+        }
         Page<Order> pageOrders = orderDao.findAll(new Specification<Order>() {
             @Override
             public Predicate toPredicate(Root<Order> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
@@ -2522,29 +2531,56 @@ public class OrderServiceImpl implements OrderService {
             totalCount = 0;
             // 各种异常类型的订单总数
             int normal = 0, notify = 0, apply = 0, returnCount = 0, exchange = 0, refund = 0;
-            for (String statusStr : statusArr) {
-                if (enUU != null) {
-                    int count = orderDao.getCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                    totalCount += count;
-
-                    normal += orderDao.getNormalCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                    notify += orderDao.getNotifyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                    apply += orderDao.getApplyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                    returnCount += orderDao.getReturnCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                    exchange += orderDao.getExchangeCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                    refund += orderDao.getRefundCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
-                } else {
-                    int count = orderDao.getCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
-                    totalCount += count;
-
-                    normal += orderDao.getNormalCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
-                    notify += orderDao.getNotifyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
-                    apply += orderDao.getApplyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
-                    returnCount += orderDao.getReturnCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
-                    exchange += orderDao.getExchangeCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
-                    refund += orderDao.getRefundCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+            if (orderStatus.equals(OrderStatus.TOBECOMMENT)){     //如果是评论的话,特殊处理
+                for (String statusStr : statusArr) {
+                    if (enUU != null) {
+                        int count = orderDao.getCountByBuyeruuAndStatusAndRate(userUU, enUU, Integer.parseInt(statusStr));
+                        totalCount += count;
+
+                        normal += orderDao.getNormalCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        notify += orderDao.getNotifyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        apply += orderDao.getApplyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        returnCount += orderDao.getReturnCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        exchange += orderDao.getExchangeCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        refund += orderDao.getRefundCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                    } else {
+                        int count = orderDao.getCountByBuyeruuAndStatusAndDissociativeAndRate(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        totalCount += count;
+
+                        normal += orderDao.getNormalCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        notify += orderDao.getNotifyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        apply += orderDao.getApplyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        returnCount += orderDao.getReturnCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        exchange += orderDao.getExchangeCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        refund += orderDao.getRefundCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                    }
+                }
+            }else{
+                for (String statusStr : statusArr) {
+                    if (enUU != null) {
+                        int count = orderDao.getCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        totalCount += count;
+
+                        normal += orderDao.getNormalCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        notify += orderDao.getNotifyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        apply += orderDao.getApplyCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        returnCount += orderDao.getReturnCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        exchange += orderDao.getExchangeCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                        refund += orderDao.getRefundCountByBuyeruuAndStatus(userUU, enUU, Integer.parseInt(statusStr));
+                    } else {
+                        int count = orderDao.getCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        totalCount += count;
+
+                        normal += orderDao.getNormalCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        notify += orderDao.getNotifyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        apply += orderDao.getApplyCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        returnCount += orderDao.getReturnCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        exchange += orderDao.getExchangeCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                        refund += orderDao.getRefundCountByBuyeruuAndStatusAndDissociative(userUU, Type.PERSONAL.value(), Integer.parseInt(statusStr));
+                    }
                 }
             }
+
             map.put(orderStatus.status(), totalCount);
 
             if (!"unavailable".equals(orderStatus.status()) && !"success".equals(orderStatus.status())) {

+ 10 - 0
src/main/java/com/uas/platform/b2c/trade/order/service/impl/PurchaseServiceImpl.java

@@ -658,6 +658,16 @@ public class PurchaseServiceImpl implements PurchaseService {
 		}, pageInfo);
 	}
 
+	@Override
+	public List<Purchase> findByStatus(Integer status) {
+		return purchaseDao.findByStatus(status);
+	}
+
+	@Override
+	public List<Purchase> findByAfterStatus(Integer status) {
+		return purchaseDao.findByAfterStatus(status);
+	}
+
 	@Override
 	public Purchase findByPurchaseid(String purchaseid) {
 		Purchase purchase = purchaseDao.findByPurchaseid(purchaseid);

+ 6 - 2
src/main/java/com/uas/platform/b2c/trade/order/status/OrderStatus.java

@@ -10,7 +10,7 @@ public enum OrderStatus {
 	/**
 	 * {@code all 所有状态}
 	 */
-	ALL("all", "503-504-505-406-407-403-408-404-405-520-602-603-315-604-605-606"),
+	ALL("all", "503-504-505-406-407-403-408-404-405-520-523-522-602-603-315-604-605-606"),
 	/**
 	 * {@code tobepaid 待付款}
 	 */
@@ -35,7 +35,11 @@ public enum OrderStatus {
 	/**
 	 * {@code unavailable 已失效}
 	 */
-	UNAVAILABLE("unavailable", "602-603-315-604-605-606");
+	UNAVAILABLE("unavailable", "602-603-315-604-605-606"),
+	/**
+	 * {@code unavailable 待评价}
+	 */
+	TOBECOMMENT("tobecomment", "520-405");
 
 	/**
 	 * 状态名称

+ 6 - 1
src/main/java/com/uas/platform/b2c/trade/order/status/PurchaseStatus.java

@@ -34,7 +34,12 @@ public enum PurchaseStatus {
 	/**
 	 * {@code unavailable 售后中}
 	 */
-	TOBEREVIEWED("toBeReviewed","404-503");
+	TOBEREVIEWED("toBeReviewed","404-503"),
+
+	/**
+	 * {@code unavailable 待评价}
+	 */
+	TOBERATE("toBeRate","520");
 
 	/**
 	 * 状态名称

+ 298 - 0
src/main/java/com/uas/platform/b2c/trade/rate/controller/RateController.java

@@ -0,0 +1,298 @@
+package com.uas.platform.b2c.trade.rate.controller;
+
+
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
+import com.uas.platform.b2c.fa.payment.utils.StringUtils;
+import com.uas.platform.b2c.trade.order.dao.OrderDao;
+import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.order.model.OrderDetail;
+import com.uas.platform.b2c.trade.order.model.Purchase;
+import com.uas.platform.b2c.trade.rate.model.RateBuyer;
+import com.uas.platform.b2c.trade.rate.model.RateGoods;
+import com.uas.platform.b2c.trade.rate.model.RateTemplate;
+import com.uas.platform.b2c.trade.rate.model.RateVendor;
+import com.uas.platform.b2c.trade.rate.service.RateService;
+import com.uas.platform.b2c.trade.support.CodeType;
+import com.uas.platform.b2c.trade.support.ResultMap;
+import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.PageParams;
+import com.uas.platform.core.model.Status;
+import com.uas.platform.core.util.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 评价接口类
+ * Created by wangdy on 2017-08-30.
+ */
+@RestController
+@RequestMapping("/rate")
+public class RateController {
+
+    @Autowired
+    private RateService rateService;
+
+    @Autowired
+    private OrderDao   orderDao;
+
+    @Autowired
+    private PurchaseDao purchaseDao;
+
+    /**
+     * 买家评价卖家店铺
+     *
+     * @param json storeid,enuu,3个星级
+     * @return the result map
+     */
+    @RequestMapping(value = "/rateVendor/{orderId}", method = RequestMethod.POST)
+    public ResultMap saveRateVendor(@PathVariable("orderId") String orderId, @RequestBody String json) {
+        RateVendor rateVendor = FastjsonUtils.fromJson(json, RateVendor.class);
+        if(null == rateVendor.getStoreId() || null == rateVendor.getEnuu() || null== rateVendor.getVendorLevel()){
+            return new ResultMap(CodeType.ERROR_STATE.code(),"参数有误");
+        }
+        RateVendor result = rateService.saveRateVendor(orderId,rateVendor);
+        return new ResultMap(CodeType.OK.code(), "评价成功", result);
+
+    }
+
+
+    /**
+     * 买家评价商品
+     *
+     * @param json 匿名,
+     * @return the result map
+     */
+    @RequestMapping(value = "/rateGoods/{orderId}", method = RequestMethod.POST)
+    public ResultMap saveRateGoods(@PathVariable("orderId") String orderId, @RequestBody String json) {
+        List<RateGoods> rateGoodsList = FastjsonUtils.fromJsonArray(json, RateGoods.class);
+        rateService.saveRateGoods(orderId,rateGoodsList);
+        return new ResultMap(CodeType.OK.code(), "评价成功");
+
+    }
+    /**
+     * 买家初评
+     *
+     * @param json 匿名,
+     * @return the result map
+     */
+    @RequestMapping(value = "/buyerRate/{orderId}", method = RequestMethod.POST)
+    public ResultMap savebuyerRate(@PathVariable("orderId") String orderId, @RequestBody String json) {
+        List<RateGoods> rateGoodsList = FastjsonUtils.fromJsonArray(FastjsonUtils.parseObject(json).get("goodsRate").toString(),RateGoods.class);
+        RateVendor rateVendor = FastjsonUtils.fromJson(FastjsonUtils.parseObject(json).get("vendorRate").toString(),RateVendor.class);
+        if(null == rateVendor.getStoreId() || null == rateVendor.getEnuu() || null == rateVendor.getVendorLevel()){
+            return new ResultMap(CodeType.ERROR_STATE.code(),"参数有误");
+        }
+        rateService.savebuyerRate(orderId,rateVendor,rateGoodsList);
+        return new ResultMap(CodeType.OK.code(), "评价成功");
+    }
+    /**
+     * 买家追评评价商品
+     *
+     * @param json 匿名,
+     * @return the result map
+     */
+    @RequestMapping(value = "/afterRateGoods/{orderId}", method = RequestMethod.POST)
+    public ResultMap saveAfterRateGoods(@PathVariable("orderId") String orderId, @RequestBody String json) {
+        List<RateGoods> rateGoodsList = FastjsonUtils.fromJsonArray(json, RateGoods.class);
+        for (RateGoods rateGoods : rateGoodsList){
+            //默认匿名评价
+            rateGoods.setIsAnony(rateGoods.getIsAnony() == null ? 1 : rateGoods.getIsAnony());
+            rateGoods.setUserUU(SystemSession.getUser().getUserUU());
+            rateGoods.setUserEnuu(SystemSession.getUser().getEnterprise().getUu());
+            rateGoods.setOrderId(orderId);
+            rateGoods.setBuyerAfterRateTime(new Date(System.currentTimeMillis()));
+
+        }
+        //订单状态变更
+        Order order = orderDao.findByOrderid(orderId);
+        if (order.getRateStatus().intValue() != Status.TO_BE_AFTERREVIEWED.value()) {
+            throw new IllegalOperatorException("当前订单未完成初评,不能追评!");
+        }
+        rateService.saveAfterRateGoods(rateGoodsList);
+        order.setStatusReviewed(SystemSession.getUser().getUserUU());
+        orderDao.save(order);
+        return new ResultMap(CodeType.OK.code(), "追评成功");
+
+    }
+
+    /**
+     * 卖家评价买家
+     *
+     * @param json 匿名,
+     * @return the result map
+     */
+    @RequestMapping(value = "/rateBuyer/{purchaseId}", method = RequestMethod.POST)
+    public ResultMap saveRateBuyer(@PathVariable("purchaseId") String purchaseId, @RequestBody String json) {
+        Purchase purchase = purchaseDao.findByPurchaseid(purchaseId);
+        Order order = orderDao.findByOrderid(purchase.getOrderid());
+        if (order.getStatus() < Status.RECEIVED.value()){
+            throw new IllegalOperatorException("当前订单未完成,不能评价");
+        }
+        RateBuyer rateBuyer = FastjsonUtils.fromJson(json, RateBuyer.class);
+        rateBuyer.setVendorUseruu(SystemSession.getUser().getUserUU());
+        rateBuyer.setEnuu(SystemSession.getUser().getEnterprise().getUu());
+        rateBuyer.setPurchaseId(purchaseId);
+        rateBuyer.setVendorRateTime(new Date(System.currentTimeMillis()));
+        RateBuyer result = rateService.saveRateBuyer(rateBuyer);
+        //TODO 改变采购单状态 //不用改变
+        /*Purchase purchase = purchaseDao.findByPurchaseid(purchaseId);
+        if (purchase.getStatus().intValue() != Status.COMPLETED.value()) {
+            throw new IllegalOperatorException("当前订单未完成,不能评价");
+        }
+        purchase.setTobeRate(SystemSession.getUser().getUserUU());
+        purchaseDao.save(purchase);*/
+        return new ResultMap(CodeType.OK.code(), "评价成功",result);
+
+    }
+
+    /**
+     * 卖家追评价买家
+     *
+     * @param json 匿名,
+     * @return the result map
+     */
+    @RequestMapping(value = "/afterRateBuyer/{purchaseId}", method = RequestMethod.POST)
+    public ResultMap saveAfterRateBuyer(@PathVariable("purchaseId") String purchaseId, @RequestBody String json) {
+        Purchase purchase = purchaseDao.findByPurchaseid(purchaseId);
+        Order order = orderDao.findByOrderid(purchase.getOrderid());
+        RateBuyer rateBuyer0 = rateService.getRateBuyerByOrderId(order.getOrderid());
+        if (null == rateBuyer0) {
+            throw new IllegalOperatorException("当前订单未初评,不能追评");
+        }
+        RateBuyer rateBuyerlater = rateService.getRateBuyerByOrderId(purchase.getOrderid());
+        RateBuyer rateBuyer = FastjsonUtils.fromJson(json, RateBuyer.class);
+        rateBuyerlater.setVendorAfterRate(rateBuyer.getVendorAfterRate());
+        rateBuyerlater.setVendorAfterRateTime(new Date(System.currentTimeMillis()));
+        RateBuyer result = rateService.saveRateBuyer(rateBuyerlater);
+
+        return new ResultMap(CodeType.OK.code(), "追评成功",result);
+
+    }
+
+    /**
+     * 保存或修改评价模版
+     *
+     * @param json 匿名,
+     * @return the result map
+     */
+    @RequestMapping(value = "/rateTemplate/{storeuuid}", method = RequestMethod.POST)
+    public ResultMap saveRateTemplate(@PathVariable("storeuuid") String storeuuid, @RequestBody String json) {
+        RateTemplate rateTemplate = FastjsonUtils.fromJson(json, RateTemplate.class);
+        rateTemplate.setUserUU(SystemSession.getUser().getUserUU());
+        rateTemplate.setStoreId(storeuuid);
+
+        rateTemplate.setCreateTime(new Date(System.currentTimeMillis()));
+        RateTemplate result = rateService.saveRateTemplate(rateTemplate);
+
+        return new ResultMap(CodeType.OK.code(), "创建成功",result);
+    }
+
+    /**
+     * 卖家为商品评价添加回复(初评)
+     *
+     * @param  returnMeg
+     * @return the result map
+     */
+    @RequestMapping(value = "/rateReply/{orderId}", method = RequestMethod.POST)
+    public ResultMap saveReply(@PathVariable("orderId") String orderId, @RequestParam Long goodsId, @RequestParam String returnMeg) {
+        RateGoods result = rateService.saveReply(orderId,goodsId,returnMeg);
+        return new ResultMap(CodeType.OK.code(), "回复成功",result);
+    }
+
+    /**
+     * 卖家为商品评价添加回复(追评)
+     *
+     * @param  returnMeg
+     * @return the result map
+     */
+    @RequestMapping(value = "/afterRateReply/{orderId}", method = RequestMethod.POST)
+    public ResultMap saveAfterReply(@PathVariable("orderId") String orderId, @RequestParam Long goodsId, @RequestParam String returnMeg) {
+        RateGoods result = rateService.saveAfterReply(orderId,goodsId,returnMeg);
+        return new ResultMap(CodeType.OK.code(), "回复成功",result);
+    }
+    /**
+     * 卖家为商品评价添加回复(批量回复)
+     *
+     * @param  orderId
+     * @return the result map
+     */
+    @RequestMapping(value = "/allRateReply/{orderId}", method = RequestMethod.POST)
+    public ResultMap saveAllReply(@PathVariable("orderId") String orderId, @RequestBody String json) {
+        List<RateGoods> rateGoodsList = FastjsonUtils.fromJsonArray(json, RateGoods.class);
+        for (RateGoods rateGoods : rateGoodsList){
+            if (!StringUtils.isEmpty(rateGoods.getAfterReturnMeg())){
+                rateGoods.setAfterReturnMegTime(new Date(System.currentTimeMillis()));
+            }
+            if (!StringUtils.isEmpty(rateGoods.getReturnMeg())){
+                rateGoods.setReturnMegTime(new Date(System.currentTimeMillis()));
+            }
+        }
+        rateService.saveAfterRateGoods(rateGoodsList);
+        return new ResultMap(CodeType.OK.code(), "批量回复成功");
+    }
+
+    /***************************查询操作******************************************/
+
+    /**
+     * 查询该企业下的所有模版信息
+     * @param storeuuid
+     * @return
+     */
+    @RequestMapping(value = "/rateTemplate/{storeuuid}", method = RequestMethod.GET)
+    public ResultMap getRateTemplate(@PathVariable("storeuuid") String storeuuid){
+        List<RateTemplate> result = rateService.getRateTempalteByStoreId(storeuuid);
+        return new ResultMap(CodeType.OK.code(), "查询成功",result);
+    }
+
+    /**
+     * 查询该订单的买家评价卖家
+     * @param orderId
+     * @return
+     */
+    @RequestMapping(value = "/rateVendor/{orderId}", method = RequestMethod.GET)
+    public ResultMap getRateVendor(@PathVariable("orderId")String orderId){
+        RateVendor result = rateService.getRateVendorByOrderId(orderId);
+        return new ResultMap(CodeType.OK.code(), "查询成功",result);
+    }
+
+    /**
+     * 查询该订单的买家评价商品(根据订单id)
+     * @param orderId
+     * @return
+     */
+    @RequestMapping(value = "/rateGoodsByOrderId/{orderId}", method = RequestMethod.GET)
+    public ResultMap getRateGoodsByOrderId(@PathVariable("orderId")String orderId,PageParams params){
+        PageInfo pageInfo = new PageInfo(params);
+        Page<RateGoods> result = rateService.getRateGoodsByOrderId(orderId,pageInfo);
+        return new ResultMap(CodeType.OK.code(), "查询成功",result);
+    }
+    /**
+     * 查询该订单的买家评价商品(根据goodsId)
+     * @param goodsId
+     * @return
+     */
+    @RequestMapping(value = "/rateGoodsByGoodsId/{goodsId}", method = RequestMethod.GET)
+    public ResultMap getRateGoodsByGoodsId(@PathVariable("goodsId")Long goodsId){
+        RateGoods result = rateService.getRateGoodsByGoodsId(goodsId);
+        return new ResultMap(CodeType.OK.code(), "查询成功",result);
+    }
+
+    /**
+     * 查询该订单的卖家评价买家
+     * @param orderId
+     * @return
+     */
+    @RequestMapping(value = "/rateBuyer/{orderId}", method = RequestMethod.GET)
+    public ResultMap getRateBuyer(@PathVariable("orderId")String orderId){
+        RateBuyer result = rateService.getRateBuyerByOrderId(orderId);
+        return new ResultMap(CodeType.OK.code(), "查询成功",result);
+    }
+
+}

+ 24 - 0
src/main/java/com/uas/platform/b2c/trade/rate/dao/RateBuyerDao.java

@@ -0,0 +1,24 @@
+package com.uas.platform.b2c.trade.rate.dao;
+
+import com.uas.platform.b2c.trade.rate.model.RateBuyer;
+import com.uas.platform.b2c.trade.rate.model.RateVendor;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Created by wangdy on 2017-08-30.
+ */
+
+@Repository
+public interface RateBuyerDao extends JpaSpecificationExecutor<RateBuyer>, JpaRepository<RateBuyer, Long> {
+
+    /**
+     * 根据订单id获取
+     * @param orderId
+     * @return
+     */
+    List<RateBuyer> findByOrderId(String orderId);
+}

+ 39 - 0
src/main/java/com/uas/platform/b2c/trade/rate/dao/RateGoodsDao.java

@@ -0,0 +1,39 @@
+package com.uas.platform.b2c.trade.rate.dao;
+
+import com.uas.platform.b2c.trade.rate.model.RateGoods;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Created by wangdy on 2017-08-30.
+ */
+
+@Repository
+public interface RateGoodsDao extends JpaSpecificationExecutor<RateGoods>, JpaRepository<RateGoods, Long> {
+
+    /**
+     * 根据商品id获取
+     * @param goodsId
+     * @return
+     */
+    List<RateGoods> findByGoodsId(Long goodsId);
+
+    /**
+     * 根据订单id获取
+     * @param orderId
+     * @return
+     */
+    List<RateGoods> findByOrderId(String orderId);
+
+
+    /**
+     * 根据订单和商品id定位唯一的一条商品评价
+     * @param orderId
+     * @param goodsId
+     * @return
+     */
+    List<RateGoods> findByOrderIdAndGoodsId(String orderId,Long goodsId);
+}

+ 33 - 0
src/main/java/com/uas/platform/b2c/trade/rate/dao/RateTemplateDao.java

@@ -0,0 +1,33 @@
+package com.uas.platform.b2c.trade.rate.dao;
+
+import com.uas.platform.b2c.trade.rate.model.RateTemplate;
+import org.springframework.data.jpa.repository.JpaRepository;
+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 java.util.List;
+
+/**
+ * Created by wangdy on 2017-08-30.
+ */
+
+@Repository
+public interface RateTemplateDao extends JpaSpecificationExecutor<RateTemplate>, JpaRepository<RateTemplate, Long> {
+
+    /**
+     * 根据创建者uu获取
+     * @param userUU
+     * @return
+     */
+    List<RateTemplate> findByUserUU(Long userUU);
+
+    /**
+     * 根据店铺id获取
+     * @param storeId
+     * @return
+     */
+    @Query("select r from RateTemplate r where r.storeId = :storeId order by r.createTime desc")
+    List<RateTemplate> findByStoreId(@Param("storeId") String storeId);
+}

+ 23 - 0
src/main/java/com/uas/platform/b2c/trade/rate/dao/RateVendorDao.java

@@ -0,0 +1,23 @@
+package com.uas.platform.b2c.trade.rate.dao;
+
+import com.uas.platform.b2c.trade.rate.model.RateVendor;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Created by wangdy on 2017-08-30.
+ */
+
+@Repository
+public interface RateVendorDao extends JpaSpecificationExecutor<RateVendor>, JpaRepository<RateVendor, Long> {
+
+    /**
+     * 根据订单id获取
+     * @param orderId
+     * @return
+     */
+    List<RateVendor> findByOrderId(String orderId);
+}

+ 194 - 0
src/main/java/com/uas/platform/b2c/trade/rate/model/RateBuyer.java

@@ -0,0 +1,194 @@
+package com.uas.platform.b2c.trade.rate.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by wangdy on 2017-08-29.
+ * 卖家对买家的评价
+ */
+@Entity
+@Table(name = "b2c$rate$buyer")
+public class RateBuyer implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 买家uu
+     */
+    @Column(name = "user_uu")
+    private Long userUU;
+
+    /**
+     * 买家企业uu
+     */
+    @Column(name = "user_enuu")
+    private Long userEnuu;
+
+    /**
+     * 订单id
+     */
+    @Column(name = "order_id")
+    private String orderId;
+
+    /**
+     * 采购单id
+     */
+    @Column(name = "purchase_id")
+    private String purchaseId;
+
+    /**
+     * 卖家企业uu
+     */
+    @Column(name = "enuu")
+    private Long enuu;
+
+    /**
+     * 评价人uu
+     */
+    @Column(name = "vendor_useruu")
+    private Long vendorUseruu;
+    /**
+     * 卖家店铺id
+     */
+    @Column(name = "store_id")
+    private String storeId;
+
+    /**
+     * 评价等级
+     */
+    @Column(name = "ratelevel")
+    private Short level;
+
+    /**
+     * 卖家初评
+     */
+    @Column(name = "vendor_rate", length = 400)
+    private String vendorRate;
+
+    /**
+     * 卖家追评
+     */
+    @Column(name = "Vendor_afterrate", length = 400)
+    private String vendorAfterRate;
+
+
+    @Column(name = "vendor_ratetime")
+    private Date vendorRateTime;
+
+    @Column(name = "Vendor_afterrateTime")
+    private Date vendorAfterRateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public Long getUserEnuu() {
+        return userEnuu;
+    }
+
+    public void setUserEnuu(Long userEnuu) {
+        this.userEnuu = userEnuu;
+    }
+
+    public String getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public Short getLevel() {
+        return level;
+    }
+
+    public void setLevel(Short level) {
+        this.level = level;
+    }
+
+    public String getVendorRate() {
+        return vendorRate;
+    }
+
+    public void setVendorRate(String vendorRate) {
+        this.vendorRate = vendorRate;
+    }
+
+    public String getVendorAfterRate() {
+        return vendorAfterRate;
+    }
+
+    public void setVendorAfterRate(String vendorAfterRate) {
+        this.vendorAfterRate = vendorAfterRate;
+    }
+
+    public Date getVendorRateTime() {
+        return vendorRateTime;
+    }
+
+    public void setVendorRateTime(Date vendorRateTime) {
+        this.vendorRateTime = vendorRateTime;
+    }
+
+    public Date getVendorAfterRateTime() {
+        return vendorAfterRateTime;
+    }
+
+    public void setVendorAfterRateTime(Date vendorAfterRateTime) {
+        this.vendorAfterRateTime = vendorAfterRateTime;
+    }
+
+    public String getPurchaseId() {
+        return purchaseId;
+    }
+
+    public void setPurchaseId(String purchaseId) {
+        this.purchaseId = purchaseId;
+    }
+
+    public Long getVendorUseruu() {
+        return vendorUseruu;
+    }
+
+    public void setVendorUseruu(Long vendorUseruu) {
+        this.vendorUseruu = vendorUseruu;
+    }
+}

+ 260 - 0
src/main/java/com/uas/platform/b2c/trade/rate/model/RateGoods.java

@@ -0,0 +1,260 @@
+package com.uas.platform.b2c.trade.rate.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 商品评价
+ *
+ * Created by wangdy on 2017-08-29.
+ * 买家对商品的评价
+ */
+@Entity
+@Table(name = "b2c$rate$goods")
+public class RateGoods implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 买家uu
+     */
+    @Column(name = "user_uu")
+    private Long userUU;
+
+    /**
+     * 买家企业uu
+     */
+    @Column(name = "user_enuu")
+    private Long userEnuu;
+
+    /**
+     * 商品id
+     */
+    @Column(name = "goods_id")
+    private Long goodsId;
+
+    /**
+     * 订单id
+     */
+    @Column(name = "order_id")
+    private String orderId;
+
+    /**
+     * 卖家企业uu
+     */
+    @Column(name = "enuu")
+    private Long enuu;
+
+    /**
+     * 卖家店铺id
+     */
+    @Column(name = "store_id")
+    private String storeId;
+
+    /**
+     * 评价等级
+     */
+    @Column(name = "ratelevel")
+    private Short level;
+
+    /**
+     * 买家是否匿名评价
+     */
+    @Column(name = "is_anony")
+    private Short isAnony;
+
+    /**
+     * 买家初评
+     */
+    @Column(name = "buyer_rate", length = 400)
+    private String buyerRate;
+
+
+
+    /**
+     * 买家追评
+     */
+    @Column(name = "buyer_afterrate", length = 400)
+    private String buyerAfterRate;
+
+    /**
+     * 初评卖家回复
+     */
+    @Column(name = "return_meg", length = 400)
+    private String returnMeg;
+
+    /**
+     * 追评卖家回复
+     */
+    @Column(name = "afterreturn_meg", length = 400)
+    private String afterReturnMeg;
+
+
+
+    /**********买家初评追评时间*************/
+
+    @Column(name = "buyer_ratetime")
+    private Date buyerRateTime;
+
+
+    @Column(name = "buyer_afterratetime")
+    private Date buyerAfterRateTime;
+
+    @Column(name = "return_megtime")
+    private Date returnMegTime;
+
+
+    @Column(name = "afterreturn_megtime")
+    private Date afterReturnMegTime;
+
+
+    /****************************************/
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public Long getUserEnuu() {
+        return userEnuu;
+    }
+
+    public void setUserEnuu(Long userEnuu) {
+        this.userEnuu = userEnuu;
+    }
+
+    public Long getGoodsId() {
+        return goodsId;
+    }
+
+    public void setGoodsId(Long goodsId) {
+        this.goodsId = goodsId;
+    }
+
+    public String getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public Short getLevel() {
+        return level;
+    }
+
+    public void setLevel(Short level) {
+        this.level = level;
+    }
+
+    public Short getIsAnony() {
+        return isAnony;
+    }
+
+    public void setIsAnony(Short isAnony) {
+        this.isAnony = isAnony;
+    }
+
+    public String getBuyerRate() {
+        return buyerRate;
+    }
+
+    public void setBuyerRate(String buyerRate) {
+        this.buyerRate = buyerRate;
+    }
+
+
+    public String getBuyerAfterRate() {
+        return buyerAfterRate;
+    }
+
+    public void setBuyerAfterRate(String buyerAfterRate) {
+        this.buyerAfterRate = buyerAfterRate;
+    }
+
+
+    public Date getBuyerRateTime() {
+        return buyerRateTime;
+    }
+
+    public void setBuyerRateTime(Date buyerRateTime) {
+        this.buyerRateTime = buyerRateTime;
+    }
+
+
+    public Date getBuyerAfterRateTime() {
+        return buyerAfterRateTime;
+    }
+
+    public void setBuyerAfterRateTime(Date buyerAfterRateTime) {
+        this.buyerAfterRateTime = buyerAfterRateTime;
+    }
+
+    public String getReturnMeg() {
+        return returnMeg;
+    }
+
+    public void setReturnMeg(String returnMeg) {
+        this.returnMeg = returnMeg;
+    }
+
+    public String getAfterReturnMeg() {
+        return afterReturnMeg;
+    }
+
+    public void setAfterReturnMeg(String afterReturnMeg) {
+        this.afterReturnMeg = afterReturnMeg;
+    }
+
+    public Date getReturnMegTime() {
+        return returnMegTime;
+    }
+
+    public void setReturnMegTime(Date returnMegTime) {
+        this.returnMegTime = returnMegTime;
+    }
+
+    public Date getAfterReturnMegTime() {
+        return afterReturnMegTime;
+    }
+
+    public void setAfterReturnMegTime(Date afterReturnMegTime) {
+        this.afterReturnMegTime = afterReturnMegTime;
+    }
+}

+ 111 - 0
src/main/java/com/uas/platform/b2c/trade/rate/model/RateTemplate.java

@@ -0,0 +1,111 @@
+package com.uas.platform.b2c.trade.rate.model;
+
+import com.uas.platform.b2c.prod.store.model.StoreIn;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 评价模版
+ *
+ * Created by wangdy on 2017-08-29.
+ * 卖家的评价模版
+ */
+@Entity
+@Table(name = "b2c$rate$template")
+public class RateTemplate implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 创建人uu
+     */
+    @Column(name = "rate_templateuser")
+    private Long userUU;
+
+    /**
+     * 模版名称
+     */
+    @Column(name = "rate_templatename")
+    private String rateTemplateName;
+
+    /**
+     * 模版内容
+     */
+    @Column(name = "rate_templatecontent")
+    private String rateTemplateContent;
+
+    /**
+     * 所属店铺id
+     */
+    @Column(name = "storeid")
+    private String storeId;
+
+
+    /**
+     * 创建的时间
+     */
+    @Column(name = "createtime")
+    private Date createTime;
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public static long getSerialVersionUID() {
+        return serialVersionUID;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getRateTemplateName() {
+        return rateTemplateName;
+    }
+
+    public void setRateTemplateName(String rateTemplateName) {
+        this.rateTemplateName = rateTemplateName;
+    }
+
+    public String getRateTemplateContent() {
+        return rateTemplateContent;
+    }
+
+    public void setRateTemplateContent(String rateTemplateContent) {
+        this.rateTemplateContent = rateTemplateContent;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 158 - 0
src/main/java/com/uas/platform/b2c/trade/rate/model/RateVendor.java

@@ -0,0 +1,158 @@
+package com.uas.platform.b2c.trade.rate.model;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created by wangdy on 2017-08-29.
+ * 买家对已购买店铺的评价
+ */
+@Entity
+@Table(name = "b2c$rate$vendor")
+public class RateVendor implements Serializable{
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * ID
+     */
+    @Id
+    @GeneratedValue
+    @Column(name = "id")
+    private Long id;
+
+    /**
+     * 买家uu
+     */
+    @Column(name = "user_uu")
+    private Long userUU;
+
+    /**
+     * 买家企业uu
+     */
+    @Column(name = "user_enuu")
+    private Long userEnuu;
+
+    /**
+     * 订单id
+     */
+    @Column(name = "order_id")
+    private String orderId;
+
+    /**
+     * 卖家企业uu
+     */
+    @Column(name = "enuu")
+    private Long enuu;
+
+    /**
+     * 卖家店铺id
+     */
+    @Column(name = "store_id")
+    private String storeId;
+
+    /**
+     * 评价星级 (描述相符)
+     */
+    @Column(name = "describe_level")
+    private Short describeLevel;
+
+    /**
+     * 评价星级 (卖家服务)
+     */
+    @Column(name = "vendor_level")
+    private Short vendorLevel;
+
+    /**
+     * 评价星级 (物流服务)
+     */
+    @Column(name = "logistics_level")
+    private Short logisticsLevel;
+
+    /**
+     * 评价时间
+     */
+    @Column(name = "createtime")
+    private Date time;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getUserUU() {
+        return userUU;
+    }
+
+    public void setUserUU(Long userUU) {
+        this.userUU = userUU;
+    }
+
+    public Long getUserEnuu() {
+        return userEnuu;
+    }
+
+    public void setUserEnuu(Long userEnuu) {
+        this.userEnuu = userEnuu;
+    }
+
+    public String getOrderId() {
+        return orderId;
+    }
+
+    public void setOrderId(String orderId) {
+        this.orderId = orderId;
+    }
+
+    public Long getEnuu() {
+        return enuu;
+    }
+
+    public void setEnuu(Long enuu) {
+        this.enuu = enuu;
+    }
+
+    public String getStoreId() {
+        return storeId;
+    }
+
+    public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+
+    public Short getDescribeLevel() {
+        return describeLevel;
+    }
+
+    public void setDescribeLevel(Short describeLevel) {
+        this.describeLevel = describeLevel;
+    }
+
+    public Short getVendorLevel() {
+        return vendorLevel;
+    }
+
+    public void setVendorLevel(Short vendorLevel) {
+        this.vendorLevel = vendorLevel;
+    }
+
+    public Short getLogisticsLevel() {
+        return logisticsLevel;
+    }
+
+    public void setLogisticsLevel(Short logisticsLevel) {
+        this.logisticsLevel = logisticsLevel;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+}

+ 125 - 0
src/main/java/com/uas/platform/b2c/trade/rate/service/RateService.java

@@ -0,0 +1,125 @@
+package com.uas.platform.b2c.trade.rate.service;
+
+import com.uas.platform.b2c.trade.rate.model.RateBuyer;
+import com.uas.platform.b2c.trade.rate.model.RateGoods;
+import com.uas.platform.b2c.trade.rate.model.RateTemplate;
+import com.uas.platform.b2c.trade.rate.model.RateVendor;
+import com.uas.platform.core.model.PageInfo;
+import org.springframework.data.domain.Page;
+
+import java.util.List;
+
+/**
+ * Created by wangdy on 2017-08-30.
+ */
+public interface RateService {
+    /**
+     * 保存买家对卖家店铺评价
+     *
+     * @param  rateVendor
+     * @return order order
+     */
+    RateVendor saveRateVendor(String orderId , RateVendor rateVendor);
+
+    /**
+     * 买家对商品的初评
+     * @param rateGoodsList
+     */
+    void saveRateGoods(String orderId , List<RateGoods> rateGoodsList);
+
+    /**
+     * 买家对商品的初评
+     * @param rateGoodsList
+     */
+    void savebuyerRate(String orderId , RateVendor rateVendor , List<RateGoods> rateGoodsList);
+
+    /**
+     * (到期自动评价)买家对商品的初评
+     * @param ids
+     */
+    void autosavebuyerRate(String ids);
+
+    /**
+     * (到期自动追评价)买家对商品的初评
+     * @param ids
+     */
+    void autosaveAfterbuyerRate(String ids);
+
+    /**
+     * 买家对商品的追评
+     * @param rateGoodsList
+     */
+    void saveAfterRateGoods(List<RateGoods> rateGoodsList);
+
+
+    /**
+     * 卖家对买家的初评
+     * @param rateBuyer
+     * @return
+     */
+    RateBuyer saveRateBuyer(RateBuyer rateBuyer);
+
+    /**
+     * 卖家对卖家的追评
+     * @param rateBuyer
+     * @return
+     */
+    RateBuyer saveAfterRateBuyer(RateBuyer rateBuyer);
+
+    /**
+     * (到期自动评价)卖家对买家的初评
+     * @param ids
+     */
+    void autosaveVendorRate(String ids, boolean isFirst);
+
+    /**
+     * 保存评价模版
+     * @param rateTemplate
+     * @return
+     */
+    RateTemplate saveRateTemplate(RateTemplate rateTemplate);
+
+    /**
+     * 保存卖家对商品评价的回复(初评回复)
+     */
+    RateGoods saveReply(String orderId, Long goodsId, String reply);
+
+    /**
+     * 保存卖家对商品评价的回复(追评回复)
+     */
+    RateGoods saveAfterReply(String orderId, Long goodsId, String reply);
+
+
+    /****************************查询模版方法****************************/
+
+    /**
+     * 查询个人名下所有模版
+     * @param userUU
+     * @return
+     */
+    List<RateTemplate> getRateTemplateByUserUU(Long userUU);
+
+    /**
+     * 查询该店铺下的所有模版
+     * @param storeId
+     * @return
+     */
+    List<RateTemplate> getRateTempalteByStoreId(String storeId);
+
+
+    /******************************************************************/
+
+    /********************************查询卖家对买家的评价**********************************/
+
+    RateBuyer getRateBuyerByOrderId(String orderId);
+
+    /********************************查询买家对店铺的评价**********************************/
+
+    RateVendor getRateVendorByOrderId(String orderId);
+
+    RateGoods  getRateGoodsByGoodsId(Long goodsId);
+
+    Page<RateGoods> getRateGoodsByOrderId(String orderId, PageInfo pageInfo);
+
+
+}

+ 295 - 0
src/main/java/com/uas/platform/b2c/trade/rate/service/impl/RateServiceImpl.java

@@ -0,0 +1,295 @@
+package com.uas.platform.b2c.trade.rate.service.impl;
+
+import com.uas.platform.b2c.core.constant.SplitChar;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.trade.order.dao.OrderDao;
+import com.uas.platform.b2c.trade.order.dao.PurchaseDao;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.order.model.OrderDetail;
+import com.uas.platform.b2c.trade.order.model.Purchase;
+import com.uas.platform.b2c.trade.rate.dao.RateBuyerDao;
+import com.uas.platform.b2c.trade.rate.dao.RateGoodsDao;
+import com.uas.platform.b2c.trade.rate.dao.RateTemplateDao;
+import com.uas.platform.b2c.trade.rate.dao.RateVendorDao;
+import com.uas.platform.b2c.trade.rate.model.RateBuyer;
+import com.uas.platform.b2c.trade.rate.model.RateGoods;
+import com.uas.platform.b2c.trade.rate.model.RateTemplate;
+import com.uas.platform.b2c.trade.rate.model.RateVendor;
+import com.uas.platform.b2c.trade.rate.service.RateService;
+import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.model.PageInfo;
+import com.uas.platform.core.model.Status;
+import com.uas.platform.core.persistence.criteria.PredicateUtils;
+import org.apache.kafka.common.metrics.stats.Rate;
+import org.hibernate.criterion.LogicalExpression;
+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 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.Date;
+import java.util.List;
+
+/**
+ * Created by wangdy on 2017-08-30.
+ */
+@Service
+public class RateServiceImpl implements RateService{
+
+    @Autowired
+    RateVendorDao rateVendorDao;
+
+    @Autowired
+    RateGoodsDao rateGoodsDao;
+
+    @Autowired
+    RateTemplateDao rateTemplateDao;
+
+    @Autowired
+    RateBuyerDao  rateBuyerDao;
+
+    @Autowired
+    OrderDao orderDao;
+
+    @Autowired
+    PurchaseDao purchaseDao;
+
+    final private short isAnony = 1;
+
+    @Override
+    public RateVendor saveRateVendor(String orderId , RateVendor rateVendor) {
+        rateVendor.setUserUU(SystemSession.getUser().getUserUU());
+        rateVendor.setUserEnuu(SystemSession.getUser().getEnterprise().getUu());
+        rateVendor.setOrderId(orderId);
+        rateVendor.setTime(new Date(System.currentTimeMillis()));
+
+        return rateVendorDao.save(rateVendor);
+    }
+
+    @Override
+    public void saveRateGoods(String orderId , List<RateGoods> rateGoodsList) {
+        if (rateGoodsDao.findByOrderId(orderId) != null && rateGoodsDao.findByOrderId(orderId).size() != 0){
+            throw new RuntimeException();
+        }
+        for (RateGoods rateGoods : rateGoodsList){
+            //默认匿名评价
+            rateGoods.setIsAnony(rateGoods.getIsAnony() == null ? isAnony : rateGoods.getIsAnony());
+            rateGoods.setUserUU(SystemSession.getUser().getUserUU());
+            rateGoods.setUserEnuu(SystemSession.getUser().getEnterprise().getUu());
+            rateGoods.setOrderId(orderId);
+            rateGoods.setBuyerRateTime(new Date(System.currentTimeMillis()));
+        }
+        rateGoodsDao.save(rateGoodsList);
+        //订单状态变更
+        Order order = orderDao.findByOrderid(orderId);
+        /*if (order.getStatus().intValue() < Status.RECEIVED.value()) {
+            throw new IllegalOperatorException("当前订单不在已完成状态,不能评价!");
+        }*/
+        order.setStatusToBeAfterReviewed(SystemSession.getUser().getUserUU());
+        orderDao.save(order);
+    }
+
+    @Override
+    @Transactional
+    public void savebuyerRate(String orderId, RateVendor rateVendor, List<RateGoods> rateGoodsList) {
+        if (null != getRateVendorByOrderId(orderId)){
+            throw new RuntimeException();
+        }
+        saveRateVendor(orderId,rateVendor);
+        saveRateGoods(orderId,rateGoodsList);
+    }
+
+    @Override
+    public void autosavebuyerRate(String ids){
+            String[] idArray = ids.split(SplitChar.HYPHEN);
+            for (String id : idArray) {
+                Order order = orderDao.findByOrderid(id);
+                if(order.getRateStatus() == 523 || order.getRateStatus() == 522){continue;}
+                rateGoodsDao.delete(rateGoodsDao.findByOrderId(order.getOrderid()));
+                for (OrderDetail orderDetail : order.getOrderDetails()){
+                    RateGoods rateGoods = new RateGoods();
+                    rateGoods.setBuyerRateTime(new Date(System.currentTimeMillis()));
+                    rateGoods.setBuyerRate("此用户未及时做出评价,系统默认好评!");
+                    rateGoods.setIsAnony(isAnony);
+                    rateGoods.setEnuu(order.getSellerenuu());
+                    rateGoods.setGoodsId(orderDetail.getId());
+                    rateGoods.setLevel(isAnony);
+                    rateGoods.setOrderId(order.getOrderid());
+                    rateGoods.setStoreId(order.getStoreid());
+                    rateGoods.setUserEnuu(order.getBuyerenuu());
+                    rateGoods.setUserUU(order.getBuyeruu());
+                    rateGoodsDao.save(rateGoods);
+                }
+                RateVendor rateVendor = new RateVendor();
+                rateVendor.setUserUU(order.getBuyeruu());
+                rateVendor.setUserEnuu(order.getBuyerenuu());
+                rateVendor.setOrderId(order.getOrderid());
+                rateVendor.setTime(new Date(System.currentTimeMillis()));
+                rateVendor.setStoreId(order.getStoreid());
+                rateVendor.setEnuu(order.getSellerenuu());
+                rateVendor.setDescribeLevel((short)5);
+                rateVendor.setLogisticsLevel((short)5);
+                rateVendor.setVendorLevel((short)5);
+                rateVendorDao.save(rateVendor);
+                //订单状态变更
+                /*if (order.getStatus().intValue() < Status.RECEIVED.value()) {
+                    throw new IllegalOperatorException("当前订单不在已完成状态,不能收货!");
+                }*/
+                order.setStatusToBeAfterReviewed(SystemSession.getUser().getUserUU());
+                orderDao.save(order);
+            }
+    }
+
+    @Override
+    public void autosaveAfterbuyerRate(String ids) {
+        String[] idArray = ids.split(SplitChar.HYPHEN);
+        for (String id : idArray) {
+            //订单状态变更
+            Order order = orderDao.findByOrderid(id);
+            if (order.getRateStatus() == 522){continue;}
+            if (order.getRateStatus().intValue() != Status.TO_BE_AFTERREVIEWED.value()) {
+                throw new IllegalOperatorException("当前订单未完成初评,不能追评!");
+            }
+            order.setStatusReviewed(SystemSession.getUser().getUserUU());
+            orderDao.save(order);
+        }
+    }
+
+    @Override
+    public void saveAfterRateGoods(List<RateGoods> rateGoodsList) {
+        rateGoodsDao.save(rateGoodsList);
+    }
+
+    @Override
+    public RateBuyer saveRateBuyer(RateBuyer rateBuyer) {
+        return rateBuyerDao.save(rateBuyer);
+    }
+
+    @Override
+    public RateBuyer saveAfterRateBuyer(RateBuyer rateBuyer) {
+        return rateBuyerDao.save(rateBuyer);
+    }
+
+    @Override
+    public void autosaveVendorRate(String ids ,boolean isFirst) {
+        String[] idArray = ids.split(SplitChar.HYPHEN);
+        for (String id : idArray) {
+            //订单状态变更
+            Purchase purchase = purchaseDao.findByPurchaseid(id);
+            if(isFirst){
+                Order order = orderDao.findByOrderid(purchase.getOrderid());
+
+                if(rateBuyerDao.findByOrderId(order.getOrderid()) !=null ){continue;}
+                RateBuyer rateBuyer = new RateBuyer();
+                rateBuyer.setLevel(isAnony);
+                rateBuyer.setOrderId(purchase.getOrderid());
+                rateBuyer.setStoreId(purchase.getStoreid());
+                rateBuyer.setPurchaseId(purchase.getPurchaseid());
+                rateBuyer.setUserEnuu(purchase.getBuyerenuu());
+                rateBuyer.setUserUU(purchase.getBuyeruu());
+                rateBuyer.setVendorRate("此店铺未及时做出评价,系统默认好评!");
+                rateBuyer.setEnuu(purchase.getSellerenuu());
+                rateBuyer.setVendorRateTime(new Date(System.currentTimeMillis()));
+                rateBuyerDao.save(rateBuyer);
+                //purchase.setTobeRate(SystemSession.getUser().getUserUU());
+                //purchaseDao.save(purchase);
+            }else {
+                RateBuyer rateBuyer;
+                try {
+                     rateBuyer = rateBuyerDao.findByOrderId(purchase.getOrderid()).get(0);
+                }catch (Exception e ){
+                    continue;
+                }
+                if(rateBuyer.getVendorAfterRateTime() !=null ){continue;}
+                rateBuyer.setVendorAfterRateTime(new Date(System.currentTimeMillis()));
+                rateBuyerDao.save(rateBuyer);
+                //purchase.setTobeAfterRate(SystemSession.getUser().getUserUU());
+                //purchaseDao.save(purchase);
+            }
+
+        }
+    }
+
+
+    @Override
+    public RateTemplate saveRateTemplate(RateTemplate rateTemplate) {
+        return rateTemplateDao.save(rateTemplate);
+    }
+
+    @Override
+    public RateGoods saveReply(String orderId, Long goodsId, String reply) {
+        RateGoods rateGoods = rateGoodsDao.findByOrderIdAndGoodsId(orderId,goodsId).get(0);
+        rateGoods.setReturnMeg(reply);
+        rateGoods.setReturnMegTime(new Date(System.currentTimeMillis()));
+        return rateGoodsDao.save(rateGoods);
+    }
+
+    @Override
+    public RateGoods saveAfterReply(String orderId, Long goodsId, String reply) {
+        RateGoods rateGoods = rateGoodsDao.findByOrderIdAndGoodsId(orderId,goodsId).get(0);
+        rateGoods.setAfterReturnMeg(reply);
+        rateGoods.setAfterReturnMegTime(new Date(System.currentTimeMillis()));
+        return rateGoodsDao.save(rateGoods);
+    }
+
+    @Override
+    public List<RateTemplate> getRateTemplateByUserUU(Long userUU) {
+        return rateTemplateDao.findByUserUU(userUU);
+    }
+
+    @Override
+    public List<RateTemplate> getRateTempalteByStoreId(String storeId) {
+        return rateTemplateDao.findByStoreId(storeId);
+    }
+
+    @Override
+    public RateBuyer getRateBuyerByOrderId(String orderId) {
+        RateBuyer rateBuyer ;
+        try {
+            rateBuyer = rateBuyerDao.findByOrderId(orderId).get(0);
+        }catch (IndexOutOfBoundsException e){
+            return null;
+        }
+        return rateBuyer;
+    }
+
+    @Override
+    public RateVendor getRateVendorByOrderId(String orderId) {
+        RateVendor rateVendor;
+        try {
+            rateVendor = rateVendorDao.findByOrderId(orderId).get(0);
+        }catch (IndexOutOfBoundsException e){
+            return null;
+        }
+        return rateVendor;
+    }
+
+    @Override
+    public RateGoods getRateGoodsByGoodsId(Long goodsId) {
+        RateGoods rateGoods;
+        try {
+            rateGoods = rateGoodsDao.findByGoodsId(goodsId).get(0);
+        }catch (IndexOutOfBoundsException e){
+            return null;
+        }
+        return rateGoods;
+    }
+
+    @Override
+    public Page<RateGoods> getRateGoodsByOrderId(String orderId, final PageInfo pageInfo) {
+        pageInfo.expression(PredicateUtils.eq("orderId", orderId, true));
+        return rateGoodsDao.findAll(new Specification<RateGoods>() {
+            @Override
+            public Predicate toPredicate(Root<RateGoods> root, CriteriaQuery<?> query, CriteriaBuilder builder) {
+                query.where(pageInfo.getPredicates(root, query, builder));
+                return null;
+            }
+        }, pageInfo);
+    }
+}

+ 36 - 0
src/main/java/com/uas/platform/b2c/trade/rate/status/RateType.java

@@ -0,0 +1,36 @@
+package com.uas.platform.b2c.trade.rate.status;
+
+/**
+ * 评价类型枚举类
+ *
+ * @author wangdy
+ * @version 2017-08-30
+ */
+public enum RateType {
+    GOOD(1, "GOOD"), 	    // 好评
+    MIDDLE(2, "MIDDLE"),	// 中评
+    BAD(3, "BAD");	        // 差评
+
+    private int code;
+
+    private String value;
+
+    RateType(int code, String message) {
+        this.code = code;
+        this.value = message;
+    }
+
+    public int code() {
+        return this.code;
+    }
+
+    public String value() {
+        return this.value;
+    }
+
+    @Override
+    public String toString() {
+        return Integer.toString(code);
+    }
+}
+

+ 256 - 0
src/main/java/com/uas/platform/b2c/trade/rate/task/RateTask.java

@@ -0,0 +1,256 @@
+package com.uas.platform.b2c.trade.rate.task;
+
+/**
+ * Created by uas on 2017-08-30.
+ */
+
+import com.uas.platform.b2c.common.account.dao.EnterpriseDao;
+import com.uas.platform.b2c.common.account.dao.UserDao;
+import com.uas.platform.b2c.common.account.model.Enterprise;
+import com.uas.platform.b2c.common.account.model.User;
+import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.support.SystemSession;
+import com.uas.platform.b2c.core.support.log.UsageBufferedLogger;
+import com.uas.platform.b2c.core.utils.FastjsonUtils;
+import com.uas.platform.b2c.trade.order.dao.OrderDao;
+import com.uas.platform.b2c.trade.order.model.Order;
+import com.uas.platform.b2c.trade.order.model.Purchase;
+import com.uas.platform.b2c.trade.order.model.StatusHistory;
+import com.uas.platform.b2c.trade.order.service.OrderService;
+import com.uas.platform.b2c.trade.order.service.PurchaseService;
+import com.uas.platform.b2c.trade.presale.dao.TradeBasicPropertiesDao;
+import com.uas.platform.b2c.trade.rate.service.RateService;
+import com.uas.platform.core.exception.IllegalOperatorException;
+import com.uas.platform.core.logging.BufferedLoggerManager;
+import com.uas.platform.core.model.Status;
+import com.uas.platform.core.model.Type;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * 评价的一些自动任务
+ *
+ * @author wangdy
+ * @version 2017-08-31 8:59:06 创建文件
+ */
+@Component("RateTask")
+public class RateTask {
+
+    private final OrderDao orderDao;
+
+    private final OrderService orderService;
+
+    private final PurchaseService purchaseService;
+
+    private final TradeBasicPropertiesDao tradeBasicPropertiesDao;
+
+    private final UserDao userDao;
+
+    private final SysConf sysConf;
+
+    private final EnterpriseDao enterpriseDao;
+
+    private final RateService rateService;
+
+
+    private static final UsageBufferedLogger logger = BufferedLoggerManager.getLogger(UsageBufferedLogger.class);
+
+    @Autowired
+    public RateTask(OrderDao orderDao, OrderService orderService,PurchaseService purchaseService, TradeBasicPropertiesDao tradeBasicPropertiesDao, UserDao userDao, SysConf sysConf, EnterpriseDao enterpriseDao, RateService rateService) {
+        this.orderDao = orderDao;
+        this.orderService = orderService;
+        this.purchaseService = purchaseService;
+        this.tradeBasicPropertiesDao = tradeBasicPropertiesDao;
+        this.userDao = userDao;
+        this.sysConf = sysConf;
+        this.enterpriseDao = enterpriseDao;
+        this.rateService = rateService;
+    }
+
+    /**
+     * 对超过初评时间的订单,自动初评
+     */
+    @Transactional
+    public void autoRate() {
+
+            User user = null;
+            List<User> userUUs = userDao.findUserByUserUU(sysConf.getAdminUU());
+            if(CollectionUtils.isEmpty(userUUs)) {
+                throw new IllegalOperatorException("根据配置文件的adminUU 找不到对应的个人信息");
+            }
+            user = userUUs.get(0);
+            Enterprise enterprise = enterpriseDao.findByUu(sysConf.getEnUU());
+            user.setEnterprise(enterprise);
+            SystemSession.setUser(user);
+            String infoByType = tradeBasicPropertiesDao.findInfoByType(Type.B2C_AUTO_RECEVIED_TIME.value());
+            if(StringUtils.isEmpty(infoByType)) {
+                throw new IllegalOperatorException("买家自动初评时间为空,不能继续操作");
+            }
+            Integer automaticReceipt = null;
+            try {
+                automaticReceipt = Integer.valueOf(infoByType);
+            } catch (NumberFormatException e) {
+                e.printStackTrace();
+            }
+            //先写在代码上,20个工作日自动好评
+            automaticReceipt = 20;
+
+            List<Order> orderList = orderService.findByAfterStatus(Status.RECEIVED.value());
+            String ids = "-";
+            for (Order order : orderList) {
+                List<StatusHistory> statusHistories = FastjsonUtils.fromJsonArray(order.getStatushistory(), StatusHistory.class);
+                for (int i = statusHistories.size() - 1; i > 0 ; i--) {
+                    StatusHistory statusHistory = statusHistories.get(i);
+                    if (statusHistory.getStatus().intValue() == Status.RECEIVED.value()) {
+                        Calendar calendar = Calendar.getInstance();
+                        Date date = new Date();
+                        calendar.setTime(date);
+                        calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - automaticReceipt);
+                        Date time = calendar.getTime();
+                        time.setHours(0);
+                        time.setMinutes(0);
+                        time.setSeconds(0);
+                        Date shipTime = order.getAutoCompleteTime();
+                        shipTime.setHours(0);
+                        shipTime.setMinutes(0);
+                        shipTime.setSeconds(0);
+                        if (compareTimeIsGigger24Hours(time, shipTime)) {
+                            ids = ids + order.getOrderid() + "-";
+                        }
+                    }
+                }
+            }
+            if(ids.length() > 1) {
+                ids = ids.substring(1, ids.length() - 1);
+                rateService.autosavebuyerRate(ids);
+            }
+            logger.log("自动初评", "买家自动初评订单:" + ids);
+            autoVendorRate(automaticReceipt,true);
+    }
+    /**
+     * 对超过追评时间的订单,自动追评
+     */
+    @Transactional
+    public void autoAfterRate() {
+        try {
+            User user = null;
+            List<User> userUUs = userDao.findUserByUserUU(sysConf.getAdminUU());
+            if(CollectionUtils.isEmpty(userUUs)) {
+                throw new IllegalOperatorException("根据配置文件的adminUU 找不到对应的个人信息");
+            }
+            user = userUUs.get(0);
+            Enterprise enterprise = enterpriseDao.findByUu(sysConf.getEnUU());
+            user.setEnterprise(enterprise);
+            SystemSession.setUser(user);
+            String infoByType = tradeBasicPropertiesDao.findInfoByType(Type.B2C_AUTO_RECEVIED_TIME.value());
+            if(StringUtils.isEmpty(infoByType)) {
+                throw new IllegalOperatorException("买家自动追评时间为空,不能继续操作");
+            }
+            Integer automaticReceipt = null;
+            try {
+                automaticReceipt = Integer.valueOf(infoByType);
+            } catch (NumberFormatException e) {
+                e.printStackTrace();
+            }
+//          //先写在代码上,180个工作日自动追评价
+            automaticReceipt = 180;
+            List<Order> orderList = orderService.findByAfterStatus(Status.RECEIVED.value());
+            String ids = "-";
+            for (Order order : orderList) {
+                List<StatusHistory> statusHistories = FastjsonUtils.fromJsonArray(order.getStatushistory(), StatusHistory.class);
+                for (int i = statusHistories.size() - 1; i > 0 ; i--) {
+                    StatusHistory statusHistory = statusHistories.get(i);
+                    if (statusHistory.getStatus().intValue() == Status.RECEIVED.value()) {
+                        Calendar calendar = Calendar.getInstance();
+                        Date date = new Date();
+                        calendar.setTime(date);
+                        calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - automaticReceipt);
+                        Date time = calendar.getTime();
+                        time.setHours(0);
+                        time.setMinutes(0);
+                        time.setSeconds(0);
+                        Date shipTime = order.getAutoCompleteTime();
+                        shipTime.setHours(0);
+                        shipTime.setMinutes(0);
+                        shipTime.setSeconds(0);
+                        if (compareTimeIsGigger24Hours(time, shipTime)) {
+                            ids = ids + order.getOrderid() + "-";
+                        }
+                    }
+                }
+            }
+            if(ids.length() > 1) {
+                ids = ids.substring(1, ids.length() - 1);
+                rateService.autosaveAfterbuyerRate(ids);
+            }
+            logger.log("自动追评", "买家自动追加评价:" + ids);
+            autoVendorRate(automaticReceipt, false);
+        }catch (Exception e) {
+        } finally {
+        }
+    }
+
+    /**
+     * 卖家的 自动评价操作
+     * @param automaticReceipt
+     */
+    private void autoVendorRate(Integer automaticReceipt,boolean isFirst) {
+        try {
+            //采购单的自动初评
+            List<Purchase> purchasesList = purchaseService.findByAfterStatus(Status.TOBEPAID.value());
+            String pids = "-";
+            for (Purchase purchase : purchasesList) {
+                List<StatusHistory> statusHistories = FastjsonUtils.fromJsonArray(purchase.getStatushistory(), StatusHistory.class);
+                for (int i = statusHistories.size() - 1; i > 0 ; i--) {
+                    StatusHistory statusHistory = statusHistories.get(i);
+                    if(statusHistory.getStatus().intValue() == Status.TOBEPAID.value()) {
+                        Calendar calendar = Calendar.getInstance();
+                        Date date = new Date();
+                        calendar.setTime(date);
+                        calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) - automaticReceipt);
+                        Date time = calendar.getTime();
+                        time.setHours(0);
+                        time.setMinutes(0);
+                        time.setSeconds(0);
+                        Date shipTime = statusHistory.getTime();
+                        shipTime.setHours(0);
+                        shipTime.setMinutes(0);
+                        shipTime.setSeconds(0);
+                        if(compareTimeIsGigger24Hours(time, shipTime)) {
+                            pids = pids + purchase.getPurchaseid() + "-";
+                        }
+                    }
+                }
+
+            }
+             if(pids.length() > 1) {
+                pids = pids.substring(1, pids.length() - 1);
+                rateService.autosaveVendorRate(pids,isFirst?true:false);
+            }
+            logger.log("自动初评", "卖家自动初评订单:" + pids);
+        }catch (Exception e){}
+        finally {}
+    }
+
+    /**
+     * 比较日期的大小(只比较年、月、日),,相隔的时间是否超过24小时
+     * @param date1
+     * @param date2
+     * @return  date1 - date2 > 0 return true else false
+     */
+    private boolean compareTimeIsGigger24Hours (Date date1, Date date2) {
+        long mills = date1.getTime() - date2.getTime();
+        if(mills > 0) {
+            return true;
+        }else {
+            return false;
+        }
+    }
+}

+ 10 - 1
src/main/resources/spring/task.xml

@@ -6,9 +6,18 @@
 		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
 		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
 		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
-
+    <!--超时自动确认收货-->
     <task:scheduled-tasks>
         <task:scheduled ref="OrderTask" method="autoConfirmOrderRevice" cron="0 0 1 * * ?"/>
     </task:scheduled-tasks>
+    <!--超时自动初评-->
+    <task:scheduled-tasks>
+        <task:scheduled ref="RateTask" method="autoRate" cron="0 0 1 * * ?"/>
+    </task:scheduled-tasks>
+    <!--超时自动追评-->
+    <task:scheduled-tasks>
+        <task:scheduled ref="RateTask" method="autoAfterRate" cron="0 0 1 * * ?"/>
+       <!-- <task:scheduled ref="RateTask" method="autoAfterRate" cron="* */10 * * * ?"/>-->
+    </task:scheduled-tasks>
     <context:annotation-config />
 </beans>

BIN
src/main/webapp/resources/img/user/images/rate1.png


BIN
src/main/webapp/resources/img/user/images/rate2.png


BIN
src/main/webapp/resources/img/user/images/rate3.png


BIN
src/main/webapp/resources/img/user/images/rateBad.png


BIN
src/main/webapp/resources/img/user/images/rateGood.png


BIN
src/main/webapp/resources/img/vendor/images/rate-add.png


BIN
src/main/webapp/resources/img/vendor/images/rate-box-del.png


+ 82 - 0
src/main/webapp/resources/js/common/query/rate.js

@@ -0,0 +1,82 @@
+define([ 'ngResource' ], function() {
+    angular.module('rateServices', [ 'ngResource' ]).factory('Rate', ['$resource', function($resource) {
+        return $resource('rate/rateBuyer/:orderId', {}, {
+            //查询该订单的卖家评价买家
+            getRateBuyer : {
+                url : 'rate/rateBuyer/:orderId',
+                method : 'GET'
+            },
+            // 查询该订单的买家评价商品(根据goodsId)
+            getRateGoodsByGoodsId : {
+                url : 'rate/rateGoodsByGoodsId/:goodsId',
+                method : 'GET'
+            },
+            // 查询该订单的买家评价商品(根据订单id)
+            getRateGoodsByOrderId : {
+                url : 'rate/rateGoodsByOrderId/:orderId',
+                method : 'GET'
+            },
+            // 查询该订单的买家评价卖家
+            getRateVendor : {
+                url : 'rate/rateVendor/:orderId',
+                method : 'GET'
+            },
+            // 查询该企业下的所有模版信息
+            getRateTemplate : {
+                url : 'rate/rateTemplate/:storeuuid',
+                method : 'GET'
+            },
+
+            // 买家评价卖家店铺
+            saveRateVendor : {
+                url : 'rate/rateVendor/:orderId',
+                method : 'POST'
+            },
+            // 买家评价商品
+            saveRateGoods : {
+                url : 'rate/rateGoods/:orderId',
+                method : 'POST'
+            },
+            // 买家评价商品(合)
+            saveBuyerRate : {
+                url : 'rate/buyerRate/:orderId',
+                method : 'POST'
+            },
+            //买家追评评价商品
+            saveAfterRateGoods : {
+                url : 'rate/afterRateGoods/:orderId',
+                method : 'POST'
+            },
+            //卖家评价买家
+            saveRateBuyer : {
+                url : 'rate/rateBuyer/:purchaseId',
+                method : 'POST'
+            },
+            //卖家追评价买家
+            saveAfterRateBuyer : {
+                url : 'rate/afterRateBuyer/:purchaseId',
+                method : 'POST'
+            },
+            //保存或修改评价模版
+            saveRateTemplate : {
+                url : 'rate/rateTemplate/:storeuuid',
+                method : 'POST'
+            },
+            //卖家为商品评价添加回复(初评)
+            saveReply : {
+                url : 'rate/rateReply/:orderId',
+                method : 'POST'
+            },
+            //卖家为商品评价添加回复(追评)
+            saveAfterReply : {
+                url : 'rate/afterRateReply/:orderId',
+                method : 'POST'
+            },
+            //卖家为商品评价添加回复(批量)
+            saveAllReply : {
+                url : 'rate/allRateReply/:orderId',
+                method : 'POST'
+            }
+        });
+    }]);
+});

+ 1 - 0
src/main/webapp/resources/js/index/app.js

@@ -270,6 +270,7 @@ define([ 'angularAMD', 'ngRoute', 'ui-bootstrap', 'ngLocal', 'ngTable', 'common/
 			$('.floors-lift-item a').css('color', '#FFFFFF');
 			$('#fl_' + i + ' a').css('background-color', colors[i] || 'blue');
 			//$('#fl_' + i).addClass('active');
+			// console.log(s)
 			if((floors.offsetTop - s < fl.offsetTop) && (floors.offsetTop + floors.offsetHeight - s > fl.offsetTop + fl.offsetHeight)) {
 				fl.style.opacity = '1';
 				fl.style.pointerEvents = 'auto';

+ 20 - 2
src/main/webapp/resources/js/usercenter/app.js

@@ -1,7 +1,7 @@
 
-define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'common/services', 'common/directives','common/query/kind', 'common/query/brand', 'common/query/component', 'common/query/order', 'common/query/cart', 'common/query/goods', 'common/query/return' ,'angular-toaster', 'common/query/urlencryption', 'ui-jquery', 'common/query/bankTransfer', 'common/query/bankInfo', 'common/query/change', 'common/query/logistics', 'common/query/address' ,'angular-toaster','common/query/collection', 'common/query/proofing', 'common/query/bill', 'common/query/user','file-upload', 'file-upload-shim', 'common/query/bankInfo' , 'common/query/responseLogistics', 'common/query/payment', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/importDeclaration', 'common/query/enterprise', 'common/query/invoice', 'common/query/refund', 'common/query/recommendation', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/tradeMessageNotice', 'common/query/tradeBasicProperties', 'common/query/browsingHistory', 'common/query/internalMessage', 'common/module/chat_web_module', 'angular-filter', 'common/query/vendor'], function(angularAMD) {
+define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'common/services', 'common/directives','common/query/kind', 'common/query/brand', 'common/query/component', 'common/query/order', 'common/query/cart', 'common/query/goods', 'common/query/return' ,'angular-toaster', 'common/query/urlencryption', 'ui-jquery', 'common/query/bankTransfer', 'common/query/bankInfo', 'common/query/change', 'common/query/rate', 'common/query/logistics', 'common/query/address' ,'angular-toaster','common/query/collection', 'common/query/proofing', 'common/query/bill', 'common/query/user','file-upload', 'file-upload-shim', 'common/query/bankInfo' , 'common/query/responseLogistics', 'common/query/payment', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/importDeclaration', 'common/query/enterprise', 'common/query/invoice', 'common/query/refund', 'common/query/recommendation', 'common/query/logisticsPort', 'common/query/storeInfo', 'common/query/tradeMessageNotice', 'common/query/tradeBasicProperties', 'common/query/browsingHistory', 'common/query/internalMessage', 'common/module/chat_web_module', 'angular-filter', 'common/query/vendor'], function(angularAMD) {
 	'use strict';
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ngTable', 'common.services', 'common.directives', 'tool.directives', 'common.query.kind', 'brandServices', 'componentServices', 'orderServices', 'cartServices', 'goodsServices', 'returnServices' , 'toaster', 'urlencryptionServices', 'ui.jquery', 'bankTransfer', 'bankInfo', 'changeServices', 'logisticsServices', 'addressServices', 'toaster','collection','proofingServices', 'billServices', 'common.query.user', 'angularFileUpload', 'bankInfo', 'responseLogisticsService', 'PaymentService', 'afterSaleService', 'messageBoardServices', 'table.directives', 'importDeclaration', 'common.query.enterprise', 'invoiceServices', 'refundModule', 'recommendation','logisticsPortService', 'storeInfoServices', 'tradeMessageNoticeModule', 'tradeBasicPropertiesServices', 'BrowsingHistory', 'internalMessageServices', 'WebChatModule', 'angular.filter', 'vendorServices']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ngTable', 'common.services', 'common.directives', 'tool.directives', 'common.query.kind', 'brandServices', 'componentServices', 'orderServices', 'cartServices', 'goodsServices', 'returnServices' , 'toaster', 'urlencryptionServices', 'ui.jquery', 'bankTransfer', 'bankInfo', 'changeServices','rateServices', 'logisticsServices', 'addressServices', 'toaster','collection','proofingServices', 'billServices', 'common.query.user', 'angularFileUpload', 'bankInfo', 'responseLogisticsService', 'PaymentService', 'afterSaleService', 'messageBoardServices', 'table.directives', 'importDeclaration', 'common.query.enterprise', 'invoiceServices', 'refundModule', 'recommendation','logisticsPortService', 'storeInfoServices', 'tradeMessageNoticeModule', 'tradeBasicPropertiesServices', 'BrowsingHistory', 'internalMessageServices', 'WebChatModule', 'angular.filter', 'vendorServices']);
 	app.init = function() {
 		angularAMD.bootstrap(app);
 	};
@@ -389,6 +389,24 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 			templateUrl : 'static/view/usercenter/forstore/shipping_address_edit.html',
 			controller : 'ShippingAddressEditCtrl',
 			controllerUrl : 'app/controllers/forstore/shipping_address_edit_ctrl'
+		})).state('firstRate', angularAMD.route({
+			// 初次评价
+			url : '/rate/firstRate/:orderid',
+			templateUrl : 'static/view/usercenter/forstore/first_rate.html',
+			controller : 'firstRateCtrl',
+			controllerUrl : 'app/controllers/forstore/first_rate_ctrl'
+		})).state('addRate', angularAMD.route({
+			// 追加评价
+			url : '/rate/addRate/:orderid',
+			templateUrl : 'static/view/usercenter/forstore/add_rate.html',
+			controller : 'addRateCtrl',
+			controllerUrl : 'app/controllers/forstore/add_rate_ctrl'
+		})).state('showRate', angularAMD.route({
+			// 查看评价
+			url : '/rate/showRate/:orderid',
+			templateUrl : 'static/view/usercenter/forstore/show_rate.html',
+			controller : 'showRateCtrl',
+			controllerUrl : 'app/controllers/forstore/show_rate_ctrl'
 		}));
 	}]);
 

+ 95 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/add_rate_ctrl.js

@@ -0,0 +1,95 @@
+define(['app/app'], function(app) {
+    'use strict';
+    app.register.controller('addRateCtrl', ['$scope', '$rootScope', '$stateParams','$filter','Order', 'toaster', 'Rate','ngTableParams', function ($scope, $rootScope, $stateParams , $filter , Order , toaster , Rate ,ngTableParams) {
+        $scope.isAnony = 1;
+        $scope.goodsRate =[];
+        $scope.vendorRate = {};
+        $scope.cont = false;
+        $scope.setContFalse = function () {
+            $scope.cont = false;
+        };
+        if ($stateParams.orderid && $stateParams.orderid != '') {
+            $scope.orderid = $stateParams.orderid;
+            if (!$scope.orderid) {
+                toaster.pop('warning', '没有传入有效的订单信息');
+            }$scope.$$kdnData = {};
+            $scope.showRateTableParams = new ngTableParams({
+                page: 1,
+                count: 10
+            }, {
+                total: 0,
+                getData: function ($defer, params) {
+                    Order.get({orderid: $scope.orderid}, function (data) {
+                        if (data.length != 1) {
+                            toaster.pop('warning', '获取订单信息失败');
+                            return;
+                        }
+                        $scope.order = data[0];
+                        Rate.getRateVendor({orderId: $scope.order.orderid}, function (data) {
+                            $scope.vendorRate = data.data;
+                        });
+                        Rate.getRateGoodsByOrderId({orderId: $scope.order.orderid , page : 1 ,count :10}, function (data) {
+                            $scope.$$kdnData.totalElements = data.data.totalElements;
+                            if(Number(data.data.totalElements) > 0) {
+                                $scope.$$kdnData.start = Number(data.data.size) * (Number(data.data.number) - 1) + 1;
+                            }else {
+                                $scope.$$kdnData.start = 0;
+                            }
+                            $scope.$$kdnData.end = Number(data.data.size) * (Number(data.data.number) - 1) + Number(data.data.numberOfElements);
+                            $scope.buyerRate = data.data.content;
+                            angular.forEach($scope.buyerRate, function (item, index) {
+                                for (var i = 0; i < $scope.order.orderDetails.length; i++) {
+
+                                    if (item.goodsId == $scope.order.orderDetails[i].id) {
+
+                                        item.goodsDetail = $scope.order.orderDetails[i];
+                                    }
+                                    if (item.isAnony == 0){
+                                        $scope.isAnony = 0;
+                                    }
+                                }
+                            });
+                            console.log($scope.buyerRate);
+                        });
+                        Rate.getRateBuyer({orderId: $scope.order.orderid}, function (data) {
+                            $scope.vendorRateBuyer = data.data;
+                        });
+                    });
+                }
+            });
+        }
+
+        $scope.submit = function () {
+            $scope.count = 0;
+            for (var i = 0 ; i < $scope.buyerRate.length ; i++){
+                delete $scope.buyerRate[i].goodsDetail;
+                if($scope.buyerRate[i].buyerAfterRate){
+                    $scope.count ++;
+                }
+            }
+            if ($scope.count == 0){
+                toaster.pop('error', '您还没有填写追评内容');
+                return;
+            }
+            Rate.saveAfterRateGoods({orderId : $scope.order.orderid},$scope.buyerRate,function (data) {
+                if (data.success){
+                    window.location.href='user#/order';
+                }
+            },function (error) {
+                toaster.pop('error', '评价失败');
+            });
+
+        };
+
+        $scope.listenRateContent = function (detail) {
+            var str = detail.buyerAfterRate;
+            if (str.length > 200) {
+                var el = angular.element('#rateContent');
+                el.blur();
+                detail.buyerAfterRate = str.substring(0, 200);
+                el.focus();
+            }
+        }
+
+    }]);
+});

+ 20 - 4
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_order_ctrl.js

@@ -4,7 +4,7 @@
  */
 define(['app/app'], function (app) {
 	'use strict';
-	app.register.controller('orderCtrl', ['$scope', '$rootScope', 'Order', 'toaster', '$filter', 'OrderSimpleInfo', 'Recommendation', '$modal', 'tradeMessageNoticeService', 'tradeBasicProperties', 'NumberService', 'ChatBusinessLayer', function($scope, $rootScope, Order, toaster, $filter, OrderSimpleInfo, Recommendation, $modal, tradeMessageNoticeService, tradeBasicProperties, NumberService, ChatBusinessLayer) {
+	app.register.controller('orderCtrl', ['$scope', '$rootScope', 'Order', 'toaster', '$filter', 'OrderSimpleInfo', 'Recommendation', '$modal', 'tradeMessageNoticeService', 'tradeBasicProperties', 'NumberService', 'ChatBusinessLayer','Rate', function($scope, $rootScope, Order, toaster, $filter, OrderSimpleInfo, Recommendation, $modal, tradeMessageNoticeService, tradeBasicProperties, NumberService, ChatBusinessLayer,Rate) {
 
 		//初始化数据
 		$rootScope.active = 'buyer_order';
@@ -33,6 +33,11 @@ define(['app/app'], function (app) {
             $scope.param.page = 1;
             $scope.param.currentPage = $scope.param.page;
 			$scope.param.status = getState();
+			if ($scope.status === 'tobecomment'){
+                $scope.param.isRate = true;
+			}else{
+                $scope.param.isRate = false;
+			}
 			$scope.param.keyword = $scope.keyword;
 			// $scope.param.startDate = $scope.startDate ? $scope.startDate.getTime() : null;
 			// $scope.param.endDate = $scope.endDate ? $scope.endDate.getTime() + 86400000 : null;
@@ -73,7 +78,7 @@ define(['app/app'], function (app) {
 			var state = null;
 			switch($scope.status) {
 				case 'all' : // 全部
-					state = '503-504-505-406-407-403-408-404-405-520-602-603-315-604-605-606'; break;
+					state = '503-504-505-406-407-403-408-404-405-520-523-522-602-603-315-604-605-606'; break;
 				case 'tobepaid' : // 待付款
 					state = '503-504'; break; // 504-已付款, 放在待付款下面,商城确认收款后再放到待发货
 				case 'tobedeliver' : // 待发货
@@ -83,11 +88,11 @@ define(['app/app'], function (app) {
 				case 'received' : // 已收货
 					state = '405'; break;
 				case 'success': // 已完成
-					state = '520-405-521'; break;
+					state = '520-405'; break;
 				case 'unavailable' : // 已失效
 					state = '602-603-315-604-605-606'; break;
 				case 'tobecomment' :
-					state = '521'; break;
+					state = '520-405'; break;
 				//下面的状态栏新增的状态
 				case 'tobepay':
 					state = '503'; break;
@@ -160,6 +165,11 @@ define(['app/app'], function (app) {
 				$scope.currenctOrders = data.content;
 				angular.forEach($scope.currenctOrders, function(data){
                     data.ensurePrice = Number(NumberService.toCeil(data.ensurePrice, 2));
+					Rate.getRateBuyer({orderId:data.orderid},{},function (result) {
+						if (result.data){
+							data.isEachRate = true;
+						}
+					});
 				});
 				$scope.accumulateNotifyTime($scope.currenctOrders);
 				$scope.param.currentPage = data.number;
@@ -673,6 +683,12 @@ define(['app/app'], function (app) {
 				case 405:
 					result = '交易完成';
 					break;
+                /*case 523:
+                    result = '待追评';
+                    break;
+				case 522:
+					result = '已完成评价';
+					break;*/
 				case 602:
 				case 603:
 				case 315:

+ 105 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/first_rate_ctrl.js

@@ -0,0 +1,105 @@
+define(['app/app'], function(app) {
+    'use strict';
+    app.register.controller('firstRateCtrl', ['$scope', '$rootScope', '$stateParams','$filter','Order', 'toaster', 'Rate', function ($scope, $rootScope, $stateParams , $filter , Order , toaster , Rate) {
+
+        $scope.isAnony = 1;
+        $scope.goodsRate =[];
+        $scope.vendorRate = {};
+        $scope.$$kdnData ={};
+        $scope.$$kdnData.start=1;
+        $scope.$$kdnData.end = 1;
+        $scope.cont =false;
+        $scope.setContFalse = function () {
+            $scope.cont = false;
+        };
+
+        if ($stateParams.orderid && $stateParams.orderid != '') {
+            $scope.orderid = $stateParams.orderid;
+            if(!$scope.orderid) {
+                toaster.pop('warning', '没有传入有效的订单信息');
+            }
+            Order.get({orderid : $scope.orderid}, function (data) {
+                if(data.length != 1) {
+                    toaster.pop('warning', '获取订单信息失败');
+                    return ;
+                }
+                $scope.order = data[0];
+                $scope.$$kdnData.totalElements = $scope.order.orderDetails.length;
+                for (var i=0; i < $scope.order.orderDetails.length;i++){
+                    $scope.goodsRate[i] = {};
+                    $scope.goodsRate[i].level = 1;
+                    $scope.goodsRate[i].isAnony = $scope.isAnony;
+                }
+
+                console.log($scope.goodsRate);
+            });
+        }
+
+        $scope.submit = function () {
+            if ($scope.descObj.a == 0 || $scope.descObj.b == 0 || $scope.descObj.c == 0){
+                toaster.pop('error', '请先对店铺进行评价');
+                return;
+            }
+            for (var i=0; i < $scope.order.orderDetails.length;i++){
+                $scope.goodsRate[i].isAnony = $scope.isAnony;
+                if ( $scope.goodsRate[i].buyerRate == null){
+                    $scope.goodsRate[i].buyerRate = '此用户没有填写评价!';
+                }
+                $scope.goodsRate[i].goodsId = $scope.order.orderDetails[i].id;
+                $scope.goodsRate[i].storeId = $scope.order.orderDetails[i].storeid;
+                $scope.goodsRate[i].enuu = $scope.order.orderDetails[i].supEnuu;
+            }
+            var params = {};
+            params.goodsRate = $scope.goodsRate;
+            params.vendorRate = {enuu : $scope.order.sellerenuu,
+                storeId : $scope.order.storeid,
+                describeLevel : $scope.descObj.a,
+                vendorLevel : $scope.descObj.b,
+                logisticsLevel : $scope.descObj.c};
+            Rate.saveBuyerRate({orderId : $scope.order.orderid},params,function (data) {
+                if (data.success){
+                    window.location.href='user#/order';
+                }
+
+            },function (error) {
+                toaster.pop('error', '评价失败');
+            });
+
+        };
+
+        /**
+         * 获取买家评价店铺的信息
+         */
+
+        $scope.saveRateGoods = function () {
+            Rate.saveRateGoods({orderId : $scope.order.orderid},{}, function (data) {
+                if(data.length != 1) {
+                    toaster.pop('warning', '获取订单信息失败');
+                    return ;
+                }
+            }, function() {
+                toaster.pop('warning', '评价失败。');
+            });
+        };
+
+        $scope.descObj = {};
+        $scope.descObj.a = 0;
+        $scope.descObj.b = 0;
+        $scope.descObj.c = 0;
+
+        $scope.setLevel = function (type, level) {
+            $scope.descObj[type] = level;
+        }
+
+        $scope.listenRateContent = function ($index) {
+            var str = $scope.goodsRate[$index].buyerRate;
+            if (str.length > 200) {
+                var el = angular.element('#rateContent');
+                el.blur();
+                $scope.goodsRate[$index].buyerRate = str.substring(0, 200);
+                el.focus();
+            }
+        }
+
+    }]);
+});

+ 86 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/show_rate_ctrl.js

@@ -0,0 +1,86 @@
+define(['app/app'], function (app) {
+    'use strict';
+    app.register.controller('showRateCtrl', ['$scope', '$rootScope', '$stateParams', '$filter', 'Order', 'toaster', 'Rate', 'ngTableParams', function ($scope, $rootScope, $stateParams, $filter, Order, toaster, Rate, ngTableParams) {
+        $scope.isAnony = 1;
+        $scope.goodsRate = [];
+        $scope.cont = false;
+        $scope.setContFalse = function () {
+            $scope.cont = false;
+        };
+        $scope.vendorRate = {};
+        if ($stateParams.orderid && $stateParams.orderid != '') {
+            $scope.orderid = $stateParams.orderid;
+            if (!$scope.orderid) {
+                toaster.pop('warning', '没有传入有效的订单信息');
+            }
+            $scope.$$kdnData = {};
+            $scope.showRateTableParams = new ngTableParams({
+                page: 1,
+                count: 10
+            }, {
+                total: 0,
+                getData: function ($defer, params) {
+
+                    Order.get({orderid: $scope.orderid}, function (data) {
+                        if (data.length != 1) {
+                            toaster.pop('warning', '获取订单信息失败');
+                            return;
+                        }
+                        $scope.order = data[0];
+                        Rate.getRateVendor({orderId: $scope.order.orderid}, function (data) {
+                            $scope.vendorRate = data.data;
+                        });
+                        Rate.getRateGoodsByOrderId({orderId: $scope.order.orderid,page:1,count:10}, function (data) {
+                            $scope.$$kdnData.totalElements = data.data.totalElements;
+                            if(Number(data.data.totalElements) > 0) {
+                                $scope.$$kdnData.start = Number(data.data.size) * (Number(data.data.number) - 1) + 1;
+                            }else {
+                                $scope.$$kdnData.start = 0;
+                            }
+                            $scope.$$kdnData.end = Number(data.data.size) * (Number(data.data.number) - 1) + Number(data.data.numberOfElements);
+                            $scope.buyerRate = data.data.content;
+                            angular.forEach($scope.buyerRate, function (item, index) {
+                                for (var i = 0; i < $scope.order.orderDetails.length; i++) {
+
+                                    if (item.goodsId == $scope.order.orderDetails[i].id) {
+
+                                        item.goodsDetail = $scope.order.orderDetails[i];
+                                    }
+                                }
+                            });
+                            console.log($scope.buyerRate);
+                        });
+                        Rate.getRateBuyer({orderId: $scope.order.orderid}, function (data) {
+                            $scope.vendorRateBuyer = data.data;
+                        });
+                    });
+                }
+            });
+        }
+
+
+        $scope.submit = function () {
+            $scope.count = 0;
+            for (var i = 0; i < $scope.buyerRate.length; i++) {
+                delete $scope.buyerRate[i].goodsDetail;
+                if ($scope.buyerRate[i].buyerAfterRate) {
+                    $scope.count++;
+                }
+            }
+            if ($scope.count == 0) {
+                toaster.pop('error', '您还没有填写追评内容');
+                return;
+            }
+            Rate.saveAfterRateGoods({orderId: $scope.order.orderid}, $scope.buyerRate, function (data) {
+                if (data.success) {
+                    window.location.href = 'user#/order';
+                }
+            }, function (error) {
+                toaster.pop('error', '评价失败');
+            });
+
+        };
+
+
+    }]);
+});

+ 8 - 9
src/main/webapp/resources/js/vendor/app.js

@@ -1,4 +1,4 @@
-define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods', 'common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery', 'angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage'], function(angularAMD) {
+define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'common/query/brand', 'common/query/kind', 'common/query/component', 'common/query/goods','common/query/rate', 'common/query/cart', 'common/query/order', 'common/query/address', 'common/query/invoice', 'common/query/property', 'common/query/kindAdvice', 'common/query/propertyAdvice', 'common/query/return' , 'common/query/change', 'common/query/logistics', 'ui.router', 'ui-bootstrap', 'ui-form', 'ui-jquery', 'angular-toaster', 'ngDraggable', 'angular-sanitize', 'ngTable', 'dynamicInput', 'jquery-imagezoom', 'file-upload', 'file-upload-shim', 'common/query/urlencryption' , 'common/query/purchase', 'common/query/vendor', 'common/query/goods', 'common/query/bankTransfer', 'common/query/enterprise', 'common/query/bill', 'common/query/receipt', 'common/query/collection', 'common/query/express', 'common/query/bankInfo','common/query/charge', 'common/query/statistics', 'common/query/currency', 'jquery-chart', 'common/query/responseLogistics', 'common/query/goodsPrice', 'common/query/address' , 'common/query/search', 'common/query/urlencryption', 'common/query/releaseProInfo', 'common/query/makerDemand', 'common/query/afterSale', 'common/query/messageBoard', 'common/query/logistics', 'common/query/storeInfo', 'common/query/recommendation', 'common/query/user', 'common/query/logisticsPort', 'common/query/cms', 'common/query/material', 'common/query/storeCms', 'common/query/productImport', 'common/query/stockInOut', 'common/module/store_recommend_product', 'common/module/chat_web_module', 'common/query/standardPutOnAdmin', 'common/query/storeViolations', 'common/query/internalMessage'], function(angularAMD) {
 	'use strict';
 	/**
 	 * 自定义Array对象的属性last 方法
@@ -8,7 +8,7 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		return this.length > 0 ? this[this.length - 1] : null;
 	};
 
-	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices', 'cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices']);
+	var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ui.form', 'ui.jquery', 'toaster', 'ngDraggable', 'tool.directives', 'ngSanitize', 'common.query.kind', 'common.services', 'brandServices', 'componentServices', 'goodsServices',  'rateServices','cartServices', 'orderServices', 'addressServices', 'invoiceServices', 'common.query.propertyAdvice', 'propertyServices', 'returnServices' , 'changeServices',  'logisticsServices', 'common.query.kindAdvice', 'ngTable', 'ngDynamicInput', 'common.directives', 'angularFileUpload', 'urlencryptionServices', 'purchaseServices', 'vendorServices', 'goodsServices', 'bankTransfer', 'common.query.enterprise', 'billServices', 'receiptServices', 'collection', 'expressServices', 'bankInfo','Charge', 'statisticsServices', 'currencyService', 'responseLogisticsService', 'PriceServices', 'addressServices', 'searchService', 'urlencryptionServices', 'ReleaseProductByBatchService', 'makerDemand', 'afterSaleService', 'messageBoardServices', 'logisticsServices', 'table.directives', 'storeInfoServices', 'recommendation', 'common.query.user', 'logisticsPortService', 'cmsService', 'materialServices', 'StoreCmsServices', 'productImportModule', 'stockInOutModule', 'StoreCmsModule', 'WebChatModule', 'StandardPutOnAdminModule', 'StoreViolationsServices', 'internalMessageServices']);
 	//初始化,启动时载入app
 	app.init = function() {
 		angularAMD.bootstrap(app);
@@ -539,12 +539,6 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			templateUrl : 'static/view/vendor/forstore/vendor_take_self.html',
 			controller: 'vendorTakeSelfCtrl',
 			controllerUrl: 'app/controllers/forstore/vendor_takeSelf_ctrl'
-		})).state('vendor_deliveryRule_add', angularAMD.route({
-			title : '新增配送规则',
-			url: '/vendor_deliveryRule_add?rule',
-			templateUrl : 'static/view/vendor/forstore/vendor_delivery_add_rule.html',
-			controller: 'vendorDeliveryRuleAddCtrl',
-			controllerUrl: 'app/controllers/forstore/vendor_deliveryRule_add_ctrl'
 		})).state('messagePersonal', angularAMD.route({
 			url: '/messagePersonal',
 			templateUrl: 'static/view/vendor/forstore/messagePersonal.html',
@@ -561,7 +555,12 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			templateUrl: 'static/view/vendor/forstore/vendor-invoice.html',
 			controller: 'vendorInvoiceCtrl',
 			controllerUrl: 'app/controllers/forstore/vendor_invoice_ctrl'
-		}))
+		})).state('showRate', angularAMD.route({
+			url: '/showRate/:orderId/:buyEmail',
+			templateUrl: 'static/view/vendor/forstore/showRate.html',
+			controller: 'showRateCtrl',
+			controllerUrl: 'app/controllers/forstore/show_rate_ctrl'
+		}));
 	}]);
 
 	// 状态码  -> 描述

+ 318 - 0
src/main/webapp/resources/js/vendor/controllers/forstore/show_rate_ctrl.js

@@ -0,0 +1,318 @@
+define(['app/app'], function(app) {
+    app.register.controller('showRateCtrl', ['$scope', '$rootScope', '$stateParams','$state', 'toaster','Rate','Order','BaseService','ngTableParams', function ($scope, $rootScope, $stateParams, $state, toaster, Rate, Order, BaseService, ngTableParams) {
+
+        /***********卖家回复评论模块 *** start *****************************/
+
+        $scope.cont = false;
+        $scope.setContFalse = function () {
+            $scope.cont = false;
+        };
+        $scope.buyEmail = $stateParams.buyEmail;
+            //初始化
+        var init = function () {
+                //卖家评价买家
+                Rate.getRateBuyer({orderId: $scope.order.orderid},{},function (data) {
+                    $scope.sellerRateBuyer = data.data;
+                },function (error) {
+                    toaster.pop('error', '获取卖家评价买家数据失败');
+                })
+                //买家评价卖家
+                Rate.getRateVendor({orderId: $scope.order.orderid},{},function (data) {
+                    $scope.buyerRateSeller = data.data;
+                    // $scope.buyerRateSeller.describeLevel = $scope.range(buyerRateSeller.describeLevel);
+                    // $scope.buyerRateSeller.logisticsLevel = $scope.range(buyerRateSeller.logisticsLevel);
+                    // $scope.buyerRateSeller.vendorLevel = $scope.range(buyerRateSeller.vendorLevel);
+                },function (error) {
+                    toaster.pop('error', '获取买家评价卖家数据失败');
+                })
+            }
+
+        //分页
+        $scope.$$kdnData = {};
+        $scope.showRateTableParams = new ngTableParams({
+            page : 1,
+            count : 10
+        },{
+            total : 0,
+            getData : function ($defer, params) {
+                var param = BaseService.parseParams(params.url());
+                //买家评价商品
+                Order.get({orderid : $stateParams.orderId}, function (data) {
+                    if (data.length != 1) {
+                        toaster.pop('warning', '获取订单信息失败');
+                        return;
+                    }
+                    $scope.order = data[0];
+                    Rate.getRateGoodsByOrderId({orderId: $scope.order.orderid, page: param.page, count: param.count}, {}, function (data) {
+                        $scope.$$kdnData.totalElements = data.data.totalElements;
+                        if(Number(data.data.totalElements) > 0) {
+                            $scope.$$kdnData.start = Number(data.data.size) * (Number(data.data.number) - 1) + 1;
+                        }else {
+                            $scope.$$kdnData.start = 0;
+                        }
+                        $scope.$$kdnData.end = Number(data.data.size) * (Number(data.data.number) - 1) + Number(data.data.numberOfElements);
+                        params.total(data.data.totalElements);
+                        $defer.resolve(data.data.content);
+                        $scope.buyerRateGoods = data.data.content;
+                        angular.forEach($scope.buyerRateGoods, function (item, index) {
+                            for (var i = 0; i < $scope.order.orderDetails.length; i++) {
+                                item.showRateReply = false;
+                                item.showAddRateReply = false;
+                                if (item.goodsId == $scope.order.orderDetails[i].id) {
+
+                                    item.goodsDetail = $scope.order.orderDetails[i];
+                                }
+                            }
+                            init();
+                        });
+                    });
+                }, function () {
+                    toaster.pop('error', '获取信息失败');
+                });
+            }
+        });
+
+        // //数字->数组
+        // $scope.range = function(n) {
+        //     return new Array(n);
+        // }
+        $scope.listenRateContent = function () {
+            var str = $scope.modalTempData.rateContent
+            if (str.length > 200) {
+                var el = angular.element('#rateContent');
+                el.blur();
+                $scope.modalTempData.rateContent = str.substring(0, 200);
+                el.focus();
+            }
+        }
+
+        $scope.modalData = [];
+
+        $scope.getModal = function (detail, type) {
+            // $scope.rateContent.storeid = purchase.storeid;
+            // $scope.rateContent.purchaseid = purchase.purchaseid;
+            // $scope.rateContent.orderid = purchase.orderid;
+            if(type == 'allRate'){
+                var count= 0 ;
+                if ($scope.order.rateStatus == 523){
+                    angular.forEach($scope.buyerRateGoods,function (item,index) {
+                        if (item.buyerRate != '此用户没有填写评价!' && item.buyerRate != '此用户未及时做出评价,系统默认好评!'){
+                            if (!item.returnMeg || item.returnMeg =='' ){
+                            }else{count++;}
+                        }else{count++;}
+                    });
+                }else if ($scope.order.rateStatus == 522){
+                    angular.forEach($scope.buyerRateGoods,function (item,index) {
+                        if (item.buyerAfterRate && !item.afterReturnMeg){}else {count++;}
+                    })
+                }
+                if (count == $scope.buyerRateGoods.length){
+                    $scope.setShowRateBoxFlag(false);
+                    toaster.pop('warning', '您当前没有可回复的评价');
+                    return;
+                }
+            }
+            $scope.rateType = type;
+            if (detail) {$scope.goodsId = detail.goodsId;
+                Rate.getRateTemplate({storeuuid: detail.storeId},{},function (data) {
+                    $scope.modalData = data.data;
+                },function (error) {
+                    toaster.pop('error', '获取模板信息失败');
+                });
+                $scope.setShowRateBoxFlag(true);
+            }else {
+                Rate.getRateTemplate({storeuuid: $scope.order.storeid},{},function (data) {
+                    $scope.modalData = data.data;
+                },function (error) {
+                    toaster.pop('error', '获取模板信息失败');
+                });
+                $scope.setShowRateBoxFlag(true);
+            }
+
+        }
+
+        //控制评论模态框的显示隐藏
+        $scope.showRateBoxFlag = false;
+
+        $scope.setShowRateBoxFlag = function (flag) {
+            $scope.showRateBoxFlag = flag;
+            if (!flag){
+                $scope.rateContent.level = 1;
+                $scope.boxStatus = 2;
+                $scope.modalTempData.rateContent = '';
+                $scope.modalTempData.modalTitle = '';
+            }
+        }
+
+        //评价类型:追评addRate/初次评价firstRate,默认初评
+        $scope.rateType = 'firstRate';
+
+        $scope.setRateType = function (type) {
+            $scope.rateType = type;
+        }
+
+        /***
+         * 评价模态框状态,默认为1
+         * 1:使用模板
+         * 2:不使用模板
+         * 3:新增模板
+         * 4:修改模板
+         * ***/
+        $scope.boxStatus = 2;
+
+
+        $scope.returnStep1 = function () {
+            $scope.setBoxStatus(1);
+            $scope.modalTempData.rateContent = $scope.rateContentTemp;
+            $scope.modalTempData.modalTitle  = $scope.modalTitleTemp;
+        }
+
+        $scope.setBoxStatus = function (boxStatus) {
+            if (boxStatus == 3 || boxStatus == 4){
+                $scope.rateContentTemp = angular.copy($scope.modalTempData.rateContent);
+                $scope.modalTitleTemp = angular.copy($scope.modalTempData.modalTitle);
+            }
+            $scope.boxStatus = boxStatus;
+        }
+
+        $scope.setGo = function(){
+            if ( $scope.boxStatus == 1 ){
+                $scope.modalTempData.rateContent = '';
+                $scope.modalTempData.modalTitle = '';
+            }
+            $scope.setBoxStatus($scope.boxStatus == 1?2:1);
+        }
+
+        //控制模板列表显示
+        $scope.showModalListFlag = false;
+
+        $scope.setShowModalListFlag = function (flag) {
+            if (!($scope.isInListFlag && !flag)) {
+                $scope.showModalListFlag = flag;
+            }
+        }
+
+        //鼠标是否在模板列表中
+        $scope.isInListFlag = false;
+        $scope.setIsInListFlag = function (flag) {
+            $scope.isInListFlag = flag;
+        }
+
+        $scope.addModal = function () {
+            $scope.showModalListFlag = false;
+            $scope.setBoxStatus(3);
+            $scope.modalTempData = {};
+        }
+
+        //选择模板
+        $scope.chooseModal = function (modal) {
+            $scope.modalTempData.rateContent = modal.rateTemplateContent;
+            $scope.modalTempData.modalTitle = modal.rateTemplateName;
+            $scope.currentModal = modal;
+            $scope.showModalListFlag = false;
+        }
+
+        $scope.listenModalTitle = function () {
+            if ($scope.modalTempData.modalTitle.length > 10) {
+                $scope.modalTempData.modalTitle = $scope.modalTempData.modalTitle.substring(0, 10);
+            }
+        }
+
+        //保存模板
+        $scope.modalTempData = {};
+        $scope.saveModal = function () {
+            if(!$scope.modalTempData.modalTitle || $scope.modalTempData.modalTitle ==''){
+                toaster.pop('error', '您还没有填写模版名称');
+                return;
+            }
+            if(!$scope.modalTempData.rateContent || $scope.modalTempData.rateContent ==''){
+                toaster.pop('error', '您还没有填写模版内容');
+                return;
+            }
+            if ($scope.boxStatus == 4) {
+                $scope.currentModal.rateTemplateContent = $scope.modalTempData.rateContent;
+                $scope.currentModal.rateTemplateName = $scope.modalTempData.modalTitle;
+                Rate.saveRateTemplate({storeuuid: $scope.order.storeid},$scope.currentModal, function (data) {
+                    toaster.pop('success', '保存成功');
+                    $scope.boxStatus = 1;
+                }, function (error) {
+                    toaster.pop('error', '保存失败');
+                })
+            } else if ($scope.boxStatus == 3) {
+                Rate.saveRateTemplate({storeuuid: $scope.order.storeid},{rateTemplateName: $scope.modalTempData.modalTitle, rateTemplateContent: $scope.modalTempData.rateContent}, function (data) {
+                    toaster.pop('success', '保存成功');
+                    Rate.getRateTemplate({storeuuid: $scope.order.storeid},{},function (data) {
+                        $scope.modalData = data.data;
+                        $scope.boxStatus = 1;
+                    },function (error) {
+                        toaster.pop('error', '获取模板信息失败');
+                    });
+                    $scope.boxStatus = 1;
+                }, function (error) {
+                    toaster.pop('error', '保存失败');
+                })
+            }
+        }
+
+        //提交评论
+        $scope.rateContent = {};
+
+        $scope.submitRate = function () {
+            var param = {
+                goodsId: $scope.goodsId,
+                returnMeg: $scope.modalTempData.rateContent
+            };
+            if ($scope.rateType == "firstRate") {
+                Rate.saveReply({orderId: $scope.order.orderid, goodsId: $scope.goodsId, returnMeg: $scope.modalTempData.rateContent},{},function (data) {
+                    toaster.pop('success', '回复成功');
+                    $state.reload();
+                },function (error) {
+                    toaster.pop('error', '回复失败');
+                });
+            } else if ($scope.rateType == "addRate") {
+                Rate.saveAfterReply({orderId: $scope.order.orderid, goodsId: $scope.goodsId, returnMeg: $scope.modalTempData.rateContent},{},function (data) {
+                    toaster.pop('success', '回复成功');
+                    $state.reload();
+                },function (error) {
+                    toaster.pop('error', '回复失败');
+                });
+            } else if ($scope.rateType == "allRate") {
+                var count= 0 ;
+                if ($scope.order.rateStatus == 523){
+                    angular.forEach($scope.buyerRateGoods,function (item,index) {
+                        if (item.buyerRate != '此用户没有填写评价!'){
+                            if (!item.returnMeg || item.returnMeg =='' ){
+                                item.returnMeg = param.returnMeg;
+                            }else{count++;}
+                        }else{count++;}
+                    })
+                    if (count == $scope.buyerRateGoods.length){
+                        $scope.setShowRateBoxFlag(false);
+                        toaster.pop('warning', '所有商品都已回复完成');
+                        return;
+                    }
+                }else if ($scope.order.rateStatus == 522){
+                    angular.forEach($scope.buyerRateGoods,function (item,index) {
+                        if (item.buyerAfterRate && !item.afterReturnMeg){
+                            item.afterReturnMeg = param.returnMeg;
+                        }else {count++;}
+                    })
+                    if (count == $scope.buyerRateGoods.length){
+                        $scope.setShowRateBoxFlag(false);
+                        toaster.pop('warning', '所有商品都已回复完成');
+                        return;
+                    }
+                }
+                Rate.saveAllReply({orderId: $scope.order.orderid},$scope.buyerRateGoods,function (data) {
+                    toaster.pop('success', '批量回复成功');
+                    $state.reload();
+                },function (error) {
+                    toaster.pop('error', '回复失败');
+                });
+            }
+        }
+
+
+        /***********卖家回复评论模块 *** end *****************************/
+    }]);
+});

+ 246 - 2
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_order_ctrl.js

@@ -4,7 +4,7 @@
  */
 define(['app/app'], function (app) {
     "use strict";
-    app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', 'SessionService', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor, SessionService) {
+    app.register.controller('vendorOrderCtrl', ['$scope', '$rootScope', 'Purchase', 'ngTableParams', 'BaseService', 'toaster', '$state', '$filter', 'Return', 'Change', '$modal', 'PuExProcess', 'Recommendation', 'DateUtil', 'Loading', 'bankInfoService', 'Logistics', 'Distributor', 'SessionService','Rate', function ($scope, $rootScope, Purchase, ngTableParams, BaseService, toaster, $state, $filter, Return, Change, $modal, PuExProcess, Recommendation, DateUtil, Loading, bankInfoService, Logistics, Distributor, SessionService, Rate) {
         $rootScope.active = 'vendor_order';
 
         // 加密过滤器
@@ -125,7 +125,7 @@ define(['app/app'], function (app) {
                     state = '602-603-315-604-605-606';
                     break;
                 case 'toBeReviewed':
-                    state = '404-503';
+                    state = '404-503-520';
                     break;
                 //下面的状态栏新增的状态
                 case 'tobepay':
@@ -540,6 +540,30 @@ define(['app/app'], function (app) {
                             }
                         }
                         $scope.purchases = page.content;
+                        $scope.requestOver = 0;
+                        angular.forEach($scope.purchases, function (order) {
+                            Rate.getRateVendor({orderId:order.orderid},{},function (data) {
+                               if (data.data){
+                                   order.isEachRate = true;
+                               }
+                            });
+                            Rate.getRateBuyer({orderId:order.orderid},{},function (data) {
+                                if(data.data){
+                                    if (data.data.vendorRateTime){
+                                        order.isFirstRate = true; // 是否完成初评
+                                    }
+                                    if (data.data.vendorAfterRateTime){
+                                        order.isAfterRate = true; // 是否完成追评
+                                    }
+                                }
+                                $scope.requestOver += 1;
+                            });
+                            angular.forEach(JSON.parse(order.statushistory),function (data) {
+                                if (data.status == 520){
+                                    order.complete = data.time;
+                                }
+                            });
+                        });
                         getExMsgState(); // 获取异常消息状态
                         getReturnByPurchaseIds(); // 获取退货单信息
 
@@ -1202,6 +1226,204 @@ define(['app/app'], function (app) {
             }
         };
         /******************根据页数设置翻页的信息********end**************************/
+
+        /***********卖家评论模块 *** start *****************************/
+
+        $scope.modalData = [];
+
+        $scope.getModal = function (purchase, type) {
+            $scope.rateContent.storeid = purchase.storeid;
+            $scope.rateContent.purchaseid = purchase.purchaseid;
+            $scope.rateContent.orderid = purchase.orderid;
+            $scope.rateType = type;
+            Rate.getRateTemplate({storeuuid: $scope.rateContent.storeid},{},function (data) {
+                $scope.modalData = data.data;
+                Rate.getRateBuyer({orderId: $scope.rateContent.orderid},{},function (data) {
+                    $scope.rateBuyer = data.data;
+                });
+            },function (error) {
+               toaster.pop('error', '获取模板信息失败');
+            });
+            $scope.setShowRateBoxFlag(true);
+        }
+
+        //控制评论模态框的显示隐藏
+        $scope.showRateBoxFlag = false;
+
+        $scope.setShowRateBoxFlag = function (flag) {
+            $scope.showRateBoxFlag = flag;
+            if (!flag){
+                $scope.boxStatus = 2;
+                $scope.rateContent.level = 1;
+                $scope.modalTempData.rateContent = '';
+                $scope.modalTempData.modalTitle = '';
+            }
+        }
+
+        //评价类型:追评addRate/初次评价firstRate,默认初评
+        $scope.rateType = 'firstRate';
+
+        $scope.setRateType = function (type) {
+            $scope.rateType = type;
+        }
+
+
+        $scope.listenRateContent = function () {
+            var str = $scope.modalTempData.rateContent
+            if (str.length > 200) {
+                var el = angular.element('#rateContent');
+                el.blur();
+                $scope.modalTempData.rateContent = str.substring(0, 200);
+                el.focus();
+            }
+        }
+
+        /***
+         * 评价模态框状态,默认为1
+         * 1:使用模板
+         * 2:不使用模板
+         * 3:新增模板
+         * 4:修改模板
+         * ***/
+        $scope.boxStatus = 2;
+
+
+        $scope.returnStep1 = function () {
+            $scope.setBoxStatus(1);
+            $scope.modalTempData.rateContent = $scope.rateContentTemp;
+            $scope.modalTempData.modalTitle  = $scope.modalTitleTemp;
+        }
+
+        $scope.setBoxStatus = function (boxStatus) {
+            if (boxStatus == 3 || boxStatus == 4){
+                $scope.rateContentTemp = angular.copy($scope.modalTempData.rateContent);
+                $scope.modalTitleTemp = angular.copy($scope.modalTempData.modalTitle);
+            }
+            $scope.boxStatus = boxStatus;
+        }
+
+        $scope.setGo = function(){
+            if ( $scope.boxStatus == 1 ){
+                $scope.modalTempData.rateContent = '';
+                $scope.modalTempData.modalTitle = '';
+            }
+            $scope.setBoxStatus($scope.boxStatus == 1?2:1);
+        }
+
+        //控制模板列表显示
+        $scope.showModalListFlag = false;
+
+        $scope.setShowModalListFlag = function (flag) {
+            if (!($scope.isInListFlag && !flag)) {
+                $scope.showModalListFlag = flag;
+            }
+        }
+
+        //鼠标是否在模板列表中
+        $scope.isInListFlag = false;
+        $scope.setIsInListFlag = function (flag) {
+            $scope.isInListFlag = flag;
+        }
+
+        $scope.addModal = function () {
+            $scope.showModalListFlag = false;
+            $scope.setBoxStatus(3);
+            $scope.modalTempData = {};
+        }
+
+        //选择模板
+        $scope.chooseModal = function (modal) {
+            $scope.modalTempData.rateContent = modal.rateTemplateContent;
+            $scope.modalTempData.modalTitle = modal.rateTemplateName;
+            $scope.currentModal = modal;
+            $scope.showModalListFlag = false;
+        }
+
+        $scope.listenModalTitle = function () {
+            if ($scope.modalTempData.modalTitle.length > 10) {
+                $scope.modalTempData.modalTitle = $scope.modalTempData.modalTitle.substring(0, 10);
+            }
+        }
+
+        //保存模板
+        $scope.modalTempData = {};
+        $scope.saveModal = function () {
+            if(!$scope.modalTempData.modalTitle || $scope.modalTempData.modalTitle ==''){
+                toaster.pop('error', '您还没有填写模版名称');
+                return;
+            }
+            if(!$scope.modalTempData.rateContent || $scope.modalTempData.rateContent ==''){
+                toaster.pop('error', '您还没有填写模版内容');
+                return;
+            }
+            //storeuuid: $scope.rateContent.storeid
+            if ($scope.boxStatus == 4) {
+                $scope.currentModal.rateTemplateContent = $scope.modalTempData.rateContent;
+                $scope.currentModal.rateTemplateName = $scope.modalTempData.modalTitle;
+                Rate.saveRateTemplate({storeuuid: $scope.rateContent.storeid},$scope.currentModal, function (data) {
+                    toaster.pop('success', '保存成功');
+                    $scope.boxStatus = 1;
+                }, function (error) {
+                    toaster.pop('error', '保存失败');
+                })
+            } else if ($scope.boxStatus == 3) {
+                Rate.saveRateTemplate({storeuuid: $scope.rateContent.storeid},{rateTemplateName: $scope.modalTempData.modalTitle, rateTemplateContent: $scope.modalTempData.rateContent}, function (data) {
+                    toaster.pop('success', '保存成功');
+                    $scope.currentModal = data.data;
+                    Rate.getRateTemplate({storeuuid: $scope.rateContent.storeid},{},function (data) {
+                        $scope.modalData = data.data;
+                        Rate.getRateBuyer({orderId: $scope.rateContent.orderid},{},function (data) {
+                            $scope.rateBuyer = data.data;
+                        });
+                        $scope.boxStatus = 1;
+                    },function (error) {
+                        toaster.pop('error', '获取模板信息失败');
+                    });
+                    $scope.boxStatus = 1;
+                }, function (error) {
+                    toaster.pop('error', '保存失败');
+                })
+            }
+        }
+
+        //提交评论
+        $scope.rateContent = {
+            level: 1
+        };
+        /* $scope.rateContent.storeid = purchase.storeid;
+         $scope.rateContent.purchaseid = purchase.purchaseid;
+         $scope.rateContent.orderid = purchase.orderid;*/
+        $scope.submitRate = function () {
+            var param = {
+                orderId: $scope.rateContent.orderid,
+                purchaseId: $scope.rateContent.purchaseid,
+                storeId: $scope.rateContent.storeid,
+                level: $scope.rateContent.level
+            };
+            if ($scope.rateType == "firstRate") {
+                param.vendorRate = $scope.modalTempData.rateContent;
+                Rate.saveRateBuyer({purchaseId: $scope.rateContent.purchaseid},param,function (data) {
+                    toaster.pop('success', '评价成功');
+                    $scope.setShowRateBoxFlag(false);
+                    $scope.orderTableParams.reload();
+                },function (error) {
+                    toaster.pop('error', '评价失败');
+                });
+            } else if ($scope.rateType == "addRate") {
+                param.vendorAfterRate = $scope.modalTempData.rateContent;
+                Rate.saveAfterRateBuyer({purchaseId: $scope.rateContent.purchaseid},param,function (data) {
+                    toaster.pop('success', '评价成功');
+                    $scope.setShowRateBoxFlag(false);
+                    $scope.orderTableParams.reload();
+                },function (error) {
+                    toaster.pop('error', '评价失败');
+                });
+            }
+        }
+
+
+        /***********卖家评论模块 *** end *****************************/
+
     }]);
 
     app.register.filter('VendorStatusFilter', function () {
@@ -1238,8 +1460,30 @@ define(['app/app'], function (app) {
                 case 520:
                     result = '交易完成';
                     break;
+                case 522:
+                    result = '已完成评价';
+                    break;
             }
             return result;
         }
+
+
+    });
+    /**
+     * 与现在的时间对比,距离多少天多少小时
+     */
+    app.register.filter('restTime', function () {
+        var day = 0, hours = 0;
+        return function (time) {
+            if(!time) {
+                return null;
+            }
+            var nowTime = new Date();
+            var s1 = time - nowTime.getTime();
+            var totalHours = s1/(1000*60*60);//算多少个小时
+            day = parseInt(totalHours) / 24;
+            hours = parseInt(totalHours) % 24;
+            return "还剩 " + parseInt(day) + "天" + parseInt(hours) + "小时";
+        }
     });
 });

+ 425 - 0
src/main/webapp/resources/view/usercenter/forstore/add_rate.html

@@ -0,0 +1,425 @@
+<style>
+    .add-rate {
+        width: 1026px;
+        float: right;
+        background: #fff;
+    }
+    .add-rate .add-rate-head {
+        background: #89affa;
+        color: #fff;
+        padding: 0px 24px;
+        height: 40px;
+        line-height: 40px;
+    }
+    .add-rate .add-rate-head  span a.add-rate-company {
+        font-size: 14px;
+    }
+    .add-rate .add-rate-head  span a em {
+        color: #fff;
+        font-size: 14px;
+    }
+    .add-rate table {
+        margin: 13px;
+    }
+    .add-rate table thead {
+        border-bottom: 1px solid rgb( 232, 235, 252 );
+        background: #fff;
+    }
+    .add-rate table thead tr td {
+        width: 1000px;
+        padding: 16px 11px;
+        font-size: 14px;
+        margin-left: 15px;
+    }
+    .add-rate table tbody tr {
+        border-bottom: 1px dashed rgb( 232, 235, 252 );
+    }
+    .add-rate table tbody tr td {
+        padding-bottom: 6px;
+    }
+    .add-rate table tbody tr td >a >img{
+        width: 73px;
+        height: 74px;
+        float: left;
+        margin-top: 16px;
+        margin-left: 23px;
+        border: 1px solid rgb( 231, 231, 231 );
+    }
+    .add-rate table tbody tr td .add-rate-item-info {
+        display: inline-block;
+        width: 178px;
+        float: left;
+        margin-top: 15px;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce {
+        display: block;
+        margin: 0px 10px;
+        font-size: 14px;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce span {
+        float: left;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce span.add-rate-item-link {
+        max-width: 178px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: inline-block;
+        white-space: nowrap;
+        height: 24px;
+        line-height: 24px;
+    }
+    .add-rate table tbody .record-num {
+        border: none;
+    }
+    .add-rate table tbody .record-num td .count-tip{
+        float: right;
+        margin-right: 10px;
+        margin-top: 10px;
+    }
+    .add-rate .submitBox {
+        text-align: center;
+        margin: 35px auto;
+    }
+    .add-rate .submitBox >span.submit-btn {
+        font-size: 14px;
+        padding: 4px 17px;
+        background: #5078cb;
+        color: #fff;
+        cursor: pointer;
+    }
+    .add-rate .submitBox .rate-status {
+        display: inline-block;
+        margin-right: 10px;
+    }
+    .add-rate .submitBox .rate-status i {
+        font-size: 14px;
+    }
+    .add-rate .submitBox .rate-status .no-rate {
+        width: 12px;
+        height: 12px;
+        display: inline-block;
+        background: #ccc;
+        border: 1px solid;
+        border-radius: 2px;
+        position: relative;
+        top: 2px;
+    }
+    .add-rate .submitBox .rate-status span:last-child {
+        color: #999;
+        font-size: 14px;
+    }
+    .add-rate table thead tr.line02 {
+        background: #f5f8fe;
+    }
+    .add-rate table thead tr.line02 .describe-title {
+        color: #5078cb;
+        font-weight: bold;
+        margin-left: 12px!important;
+    }
+    .add-rate table thead tr.line02 .describe-option {
+        margin-right: 55px;
+        margin-left: 20px;
+    }
+    .add-rate table thead tr.line02 .describe-option img {
+        margin-left: -5px;
+        position: relative;
+        top: -3px;
+    }
+    .add-rate table thead tr.line01 td >span {
+        margin-left: 5px;
+        float: left;
+        margin-top: 5px;
+    }
+    .add-rate table thead tr td >div {
+        display: inline-block;
+        width: 43%;
+        background: #f9f9f9;
+        padding: 5px 10px;
+    }
+    .add-rate table thead tr td >div >span {
+        display: block;
+    }
+    .add-rate table thead tr td >div >span.add-rate-item01 span {
+        float: right;
+        display: block;
+        width: 329px;
+        height: 50px;
+        word-break: break-all;
+        overflow-y: scroll;
+    }
+    .add-rate table thead tr.line01 td >span >img {
+        margin-right: 5px;
+        margin-bottom: 3px;
+    }
+    .add-rate table thead tr td >div >span.add-rate-item02 {
+        margin-top: 18px;
+        color: #999;
+        font-size: 12px;
+    }
+    .add-rate table .buyer-first-rate {
+        width: 726px;
+        float: right;
+        margin-top: 12px;
+    }
+    .add-rate table .buyer-first-rate >div {
+        width: 311px;
+        display: inline-block;
+        background: #f9f9f9;
+        padding: 0 10px;
+        overflow: hidden;
+        height: 87px;
+        cursor: default;
+    }
+    .add-rate table .buyer-first-rate >div >div {
+    }
+    .add-rate table .buyer-first-rate >div .rate-date {
+        color: #a8a8a8;
+        margin-top: 10px;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div {
+        display: inline-block;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div >span {
+        display: block;
+        margin-top: 10px;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div >span img {
+        margin-right: 5px;
+        position: relative;
+        top: -2px;
+    }
+    .add-rate table .buyer-first-rate .comment {
+        width: 215px;
+        float: right;
+        height: 67px;
+    }
+    .add-rate table .buyer-first-rate .comment span{
+        height: 60px;
+        width: 215px;
+        overflow-y: auto;
+        word-break: break-all;
+    }
+    .add-rate table tbody tr td .first-rate-item-textBox {
+        display: inline-block;
+        float: right;
+        background: #f5f8ff;
+        padding: 7px 12px;
+        position: relative;
+    }
+    .add-rate table tbody tr td .first-rate-item-textBox textarea {
+        width: 207px;
+        height: 75px;
+        overflow-y: scroll;
+        padding: 3px 8px 15px 8px;
+        border-color: rgb( 236, 242, 255 );
+        resize: none;
+    }
+    .add-rate table tbody tr td .first-rate-item-textBox .add-rate-remind {
+        color: #999;
+        position: absolute;
+        right: 29px;
+        bottom: 10px;
+    }
+    .add-rate table thead .temp-line td{
+        padding: 0;
+    }
+    .add-rate table thead .temp-line td div {
+        height: 0px;
+        background: #fff;
+        display: block;
+        width: 100%;
+        border-top: 1px solid #e6edff;
+    }
+    .seller-contact .contact-title {
+        height: 26px;
+        background-color: #5078cb;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 26px;
+        color: white;
+    }
+
+    .seller-contact .contact-title a, .seller-contact .contact-title a:hover {
+        color: white;
+    }
+
+    .seller-contact .contact-seller-info {
+        margin-left: 24px;
+        margin-right: 24px;
+        background-color: #5078cb;
+        color: #ffffff;
+        margin-top: 15px;
+        margin-bottom: 12px;
+        border-radius: 4px;
+        font-family: "Microsoft Yahei", "微软雅黑";
+        height: 150px;
+    }
+
+    .seller-contact .contact-seller-info div {
+        text-align: left;
+        font-size: 14px;
+        padding-left: 15px;
+        padding-right: 15px;
+    }
+
+    .seller-contact .contact-seller-info .company-name {
+        text-align: center;
+        font-size: 18px;
+        padding-top: 15px;
+    }
+
+    .seller-contact .send-message {
+        width: 553px;
+        height: 258px;
+        background-color: #F7F7F6;
+        padding-left: 13px;
+        padding-top: 15px;
+        border-radius: 4px;
+    }
+
+    .seller-contact-info {
+        position: absolute;
+        z-index: 2;
+        height: 210px;<!--506-->
+        border: 1px solid #E7E5E2;
+        opacity: 1;
+        background-color: white;
+        width: 600px;
+        top: 40px;
+        left: -130px;
+        border: 1px solid #E7E5E2;
+        -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        box-shadow: 0 5px 15px rgba(0,0,0,.5);
+
+</style>
+
+<div class="add-rate">
+    <div class="add-rate-head">
+        <span style="width: 27%;">
+            <a href="store/{{::order.storeid}}" target="_blank" class="add-rate-company">
+                <img src="static/img/user/images/shop_home.png"/>
+                <em>{{order.sellername}}</em>
+            </a>
+        </span>
+        <span style="position: relative; width: 10%; margin-left: 50px;">
+            <img src="static/img/common/songguo.png"/>
+            <a href="javascript:void(0)" class="contact_btn" ng-click="cont = !cont">联系卖家</a>
+            <div class="seller-contact" ng-if="cont" ng-class="{true : 'seller-contact-info', false : 'display-none'}[cont]">
+                                 <div class="contact-title">
+                                     <a ng-click="setContFalse()"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
+                                 </div>
+                                 <div class="contact-seller-info">
+                                     <div class="company-name" ng-bind="::order.sellername"></div>
+                                     <div>
+                                         <em>手机:<em ng-bind="::order.sellPhone || '暂无联系电话'"></em></em>
+                                         <em style="margin-left: 60px;">邮箱:<em ng-bind="::order.sellEmail || '暂无电子邮箱'"></em></em>
+                                     </div>
+                                     <div>地址:<em ng-bind="order.sellCompanyAddress || order.sellCompanyArea || '暂无地址信息'"></em></div>
+                                 </div>
+                                 <div style="display: none;">
+                                     <textarea class="send-message" placeholder="给卖家发送站内消息"></textarea>
+                                 </div>
+                                 <div style="display: none;" class="send-button"><a class="send">发送</a></div>
+                            </div>
+        </span>
+        <span style="float: right;margin-right: 46px; font-size: 12px;">其他买家需要你的建议喔</span>
+    </div>
+    <table ng-table="showRateTableParams">
+        <thead>
+        <tr class="line01" ng-if="vendorRateBuyer.id">
+            <td>
+                <span><img src="static/img/user/images/{{vendorRateBuyer.level == 1?'rate1.png':vendorRateBuyer.level == 2?'rate2.png':'rate3.png'}}" alt=""><span ng-bind="vendorRateBuyer.level == 1?'好评':vendorRateBuyer.level == 2?'中评':'差评'"></span></span>
+                <div style="margin-left: 20px;float: left">
+                    <span class="add-rate-item01">卖家初评:<span ng-bind="vendorRateBuyer.vendorRate"></span></span>
+                    <span class="add-rate-item02" ng-bind="vendorRateBuyer.vendorRateTime | date:'yyyy-MM-dd'"></span>
+                </div>
+                <div style="margin-left: 40px;height: 46px;" ng-if="vendorRateBuyer.vendorAfterRate">
+                    <span class="add-rate-item01">卖家追评:<span ng-bind="vendorRateBuyer.vendorAfterRate"></span></span>
+                    <span class="add-rate-item02" ng-bind="vendorRateBuyer.vendorAfterRateTime | date:'yyyy-MM-dd'"></span>
+                </div>
+            </td>
+        </tr>
+        <tr class="temp-line">
+            <td>
+                <div></div>
+            </td>
+        </tr>
+        <tr class="line02">
+            <td>
+                <span class="describe-title describe-option">店铺评价:</span>
+                <span>描述相符</span>
+                <span class="rate-level describe-option">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 0 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 1 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 2 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 3 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 4 > 0">
+                    </span>
+                <span>卖家服务</span>
+                <span class="rate-level describe-option">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 0 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 1 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 2 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 3 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 4 > 0">
+                    </span>
+                <span>物流服务</span>
+                <span class="rate-level describe-option">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 0 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 1 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 2 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 3 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 4 > 0">
+                    </span>
+            </td>
+        </tr>
+        </thead>
+        <tbody>
+
+        <tr ng-repeat="detail in buyerRate track by $index">
+            <td>
+                <a href="store/{{::order.storeid}}#/batchInfo/{{::detail.goodsDetail.batchCode}}" target="_blank"><img ng-src="{{detail.goodsDetail.img || 'static/img/store/common/default.png'}}" width="55" height="55"/></a>
+                <div class="add-rate-item-info">
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">类目:<a href="product#/kinds/{{::detail.goodsDetail.kindUuid}}" target="_blank"><em ng-bind="::detail.goodsDetail.kiName" title="{{::detail.goodsDetail.kiName}}"></em></a><br/></span></span>
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">型号:<a href="store/{{::order.storeid}}#/batchInfo/{{::detail.goodsDetail.batchCode}}" target="_blank"><em ng-bind="::detail.goodsDetail.cmpCode" title="{{::detail.goodsDetail.cmpCode}}"></em></a><br/></span></span>
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">品牌:<a href="product#/brand/{{::detail.goodsDetail.branduuid}}/" target="_blank"><em ng-bind="::detail.goodsDetail.brName" title="{{::detail.goodsDetail.brName}}"></em></a></span></span>
+                </div>
+                    <div class="buyer-first-rate">
+                        <div class="buyer-first-rate02" style="margin-left: 100px">
+                            <div>
+                                <span>买家初评:</span>
+                                <span><img src="static/img/user/images/{{detail.level == 1?'rate1.png':detail.level == 2?'rate2.png':'rate3.png'}}" alt=""><span ng-bind="detail.level == 1?'好评':detail.level == 2?'中评':'差评'"></span></span>
+                                <span class="rate-date" ng-bind="detail.buyerRateTime | date:'yyyy-MM-dd'"></span>
+                            </div>
+                            <div class="comment">
+                                <span ng-bind="detail.buyerRate"></span></div>
+                        </div>
+                        <div class="buyer-first-rate02" style="background: #fff">
+                            <div style="margin-top: 10px;">买家追评:</div>
+                            <div class="first-rate-item-textBox">
+                                <textarea id="rateContent" placeholder="快来分享您的使用感受吧!" rows="10" cols="20" ng-change="listenRateContent(detail)" ng-model="detail.buyerAfterRate"></textarea>
+                                <div class="add-rate-remind">
+                                    <span>{{detail.buyerAfterRate.length || 0}}</span>
+                                    <span>/200</span>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+            </td>
+        </tr>
+        <tr class="record-num">
+            <td colspan="6">
+                <span class="count-tip">显示<span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span>,共:<span ng-bind="$$kdnData.totalElements" style="color: #5078cb;"></span>个</span>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+    <div class="submitBox">
+        <div class="rate-status">
+            <i class="fa fa-check-square" aria-hidden="true" ng-if="isAnony"></i>
+            <span class="no-rate" ng-if="!isAnony"></span>
+            <span>匿名评价</span>
+        </div>
+        <span class="submit-btn" ng-click="submit()">提交</span>
+    </div>
+</div>

+ 26 - 3
src/main/webapp/resources/view/usercenter/forstore/buyer_order.html

@@ -590,7 +590,7 @@
 				<li ng-class="{'active' : status == 'tobereceive'}" ng-click="toggleStatus('tobereceive')"><a>待收货(<em ng-class="{'color-black': !AllOrderInfo['tobereceive']}" ng-bind="AllOrderInfo['tobereceive'] || 0"></em>)</a></li>
 				<li ng-class="{'active' : status == 'success'}" ng-click="toggleStatus('success')"><a>交易结束(<em ng-class="{'color-black': !AllOrderInfo['success']}" ng-bind="AllOrderInfo['success'] || 0"></em>)</a></li>
 				<li ng-class="{'active' : status == 'unavailable'}" ng-click="toggleStatus('unavailable')"><a>已取消(<em ng-class="{'color-black': !AllOrderInfo['unavailable']}" ng-bind="AllOrderInfo['unavailable'] || 0"></em>)</a></li>
-				<li ng-class="{'active' : status == 'tobecomment'}" ng-click="toggleStatus('tobecomment')"><a>待评价(<em ng-bind="0" class="color-black"></em>)</a></li>
+				<li ng-class="{'active' : status == 'tobecomment'}" ng-click="toggleStatus('tobecomment')"><a>待评价(<em ng-class="{'color-black': !AllOrderInfo['tobecomment']}" ng-bind="AllOrderInfo['tobecomment'] || 0"></em>)</a></li>
 			</ul>
 		</div>
 		<!--搜索时间筛选-->
@@ -678,13 +678,13 @@
                         </span>
 						<span style="text-align: left;">日期:<em ng-bind="::order.creattime | date: 'yyyy-MM-dd'"></em></span>
 						<span style="width: 25%; text-align: left;">订单号:<a class="action-link" ng-bind="::order.orderid" href="user#/order/detail/{{order.orderid | EncryptionFilter}}"></a></span>
-						<span style="width: 30%;">
+						<span style="width: 27%;">
                             <a href="store/{{::order.storeid}}" target="_blank">
                                 <img src="static/img/user/images/shop_home.png"/>
                                 <em ng-bind="::order.sellername" title="{{::order.sellername}}"></em>
                             </a>
                         </span>
-						<span style="position: relative;">
+						<span style="position: relative; width: 10%;">
                             <img src="static/img/common/songguo.png"/>
                             <!--<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-controller="ChatContactCtrl as chat" ng-click="chat.contactWithOther(order.sellPhone, order.sellerenuu, chat.UserType.STORE)">联系卖家</a>-->
 							<a name="{{order.id}}" href="javascript:void(0)" class="contact_btn" ng-click="contactSeller(order)">联系卖家</a>
@@ -739,10 +739,27 @@
 								<div ng-bind="::order.status | statusFilter"></div>
 								<a href="user#/order/detail/{{order.orderid | EncryptionFilter}}" class="oder_d action-link" style="display: block;" target="_blank">订单详情</a>
 								<a class="action-link" href="user#/buyerQueryLogistics/{{order.orderid | EncryptionFilter}}" ng-if="order.status == 404 || order.status == 520 || order.status == 405 || order.status == 521" style="display: block;" target="_blank">查看物流</a>
+
+								<a class="action-link" href="user#/buyerQueryLogistics/{{order.orderid | EncryptionFilter}}" ng-if="order.status == 404" style="display: block;" target="_blank">查看物流</a>
+								<a ng-if="order.isEachRate && (order.rateStatus == 523 || order.rateStatus == 522)" class="oder_d action-link" target="_blank" href="user#/rate/showRate/{{order.orderid | EncryptionFilter}}" style="display: block;">
+                                  双方已评
+                              	</a>
+								<div ng-if="!order.isEachRate && (order.rateStatus == 523 || order.rateStatus == 522)">
+                                  我已评价
+                              	</div>
+								<div ng-if="order.isEachRate && !order.rateStatus">
+                                  对方已评
+                              	</div>
 							</div>
 						</span>
 						<span class="oder_deal" ng-class="{'order-border-bottom-solid' : $index == order.orderDetails.length -1 || $index==2}">
                             <div ng-if="$index == 0">
+                                <a ng-if="(order.status == 405 || order.status == 520) && !order.rateStatus" class="operate-height" target="_blank" href="user#/rate/firstRate/{{order.orderid | EncryptionFilter}}" style="display: block;">
+                                  <em class="order-operation">评价</em>
+                              	</a>
+								<a ng-if="order.rateStatus == 523" class="operate-height" target="_blank" href="user#/rate/addRate/{{order.orderid | EncryptionFilter}}" style="display: block;">
+                                  <em class="order-operation">追加评价</em>
+                              	</a>
                               <a class="operate-height" href="user#/order/pay/{{order.orderid | EncryptionFilter}}" ng-if="(order.status == 503 || order.status == 501) && order.auditPayFailReason == null" style="display: block;">
                                   <em class="order-operation">立即付款</em>
                               </a>
@@ -752,6 +769,12 @@
                               <div ng-if="order.status == 503" class="clock-mind">
                                   <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="order.availabletime | restTime"></em>
                               </div>
+								<!--<div ng-if="order.status == 520" class="clock-mind">
+                                  <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="order.reciptTime + 1728000000 | restTime"></em>&lt;!&ndash;暂时设定30天自动初评&ndash;&gt;
+                              </div>
+								<div ng-if="order.status == 523" class="clock-mind">
+                                  <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="order.reciptTime + 15552000000 | restTime"></em>&lt;!&ndash;暂时设定180天自动追评&ndash;&gt;
+                              </div>-->
                               <a class="action-link operate-height" ng-if="order.status == 503 || order.status == 501 || order.status == 502" style="display: block;line-height: 20px; height: 20px;" ng-click="cancle(order.orderid)">
                                   取消订单
                               </a>

+ 354 - 0
src/main/webapp/resources/view/usercenter/forstore/first_rate.html

@@ -0,0 +1,354 @@
+<style>
+    .first-rate {
+        width: 1026px;
+        float: right;
+        background: #fff;
+    }
+    .first-rate .first-rate-head {
+        background: #89affa;
+        color: #fff;
+        padding: 0px 24px;
+        height: 40px;
+        line-height: 40px;
+    }
+    .first-rate .first-rate-head  span a.first-rate-company {
+        font-size: 14px;
+    }
+    .first-rate .first-rate-head  span a em {
+        color: #fff;
+        font-size: 14px;
+    }
+    .first-rate table {
+        margin: 13px;
+    }
+    .first-rate table thead {
+        background: #f5f8fe;
+    }
+    .first-rate table thead tr td {
+        width: 1000px;
+        padding: 16px 11px;
+        font-size: 14px;
+        margin-left: 15px;
+    }
+    .first-rate table thead tr td .describe-title {
+        color: #5078cb;
+        font-weight: bold;
+        margin-left: 0!important;
+    }
+    .first-rate table thead tr td .describe-option {
+        margin-right: 55px;
+        margin-left: 20px;
+    }
+    .first-rate table thead tr td .describe-option img {
+        cursor: pointer;
+        margin-left: -5px;
+        position: relative;
+        top: -2px;
+    }
+    .first-rate table tbody tr {
+        border-bottom: 1px dashed rgb( 232, 235, 252 );
+    }
+    .first-rate table tbody tr td >a >img{
+        width: 73px;
+        height: 74px;
+        float: left;
+        margin-top: 20px;
+        border: 1px solid rgb( 231, 231, 231 );
+        margin-left: 23px;
+    }
+    .first-rate table tbody tr td .first-rate-item-info {
+        display: inline-block;
+        width: 200px;
+        float: left;
+        margin-top: 15px;
+    }
+    .first-rate table tbody tr td .first-rate-item-introduce {
+        display: block;
+        margin: 0px 10px;
+        font-size: 14px;
+    }
+    .first-rate table tbody tr td .first-rate-item-introduce span {
+        float: left;
+    }
+    .first-rate table tbody tr td .first-rate-item-introduce span.first-rate-item-link {
+        max-width: 190px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: inline-block;
+        white-space: nowrap;
+        height: 27px;
+        line-height: 27px;
+    }
+    .first-rate table tbody tr td .first-rate-item-rate {
+        display: inline-block;
+        float: right;
+        margin-right: 39px;
+    }
+    .first-rate table tbody tr td .first-rate-item-rate .rate-item {
+        display: inline-block;
+        margin-right: 5px;
+        margin-top: 12px;
+        font-size: 14px;
+    }
+    .first-rate table tbody tr td .first-rate-item-rate .rate-item .check-act img {
+        position: relative;
+        top: -2px;
+    }
+    .first-rate table tbody tr td .first-rate-item-rate .rate-item >label {
+        display: block;
+        font-weight: normal;
+        margin-top: 10px;
+    }
+    .first-rate table tbody tr td .first-rate-item-textBox {
+        display: inline-block;
+        float: right;
+        background: #f5f8ff;
+        padding: 7px 15px;
+        margin: 5px 0;
+        position: relative;
+    }
+    .first-rate table tbody tr td .first-rate-item-textBox .add-rate-remind {
+        color: #999;
+        position: absolute;
+        right: 33px;
+        bottom: 13px;
+    }
+    .first-rate table tbody tr td .first-rate-item-textBox textarea {
+        width: 484px;
+        height: 87px;
+        overflow-y: scroll;
+        padding: 5px 10px;
+        border-color: rgb( 236, 242, 255 );
+        resize: none;
+        padding-bottom: 15px;
+    }
+    .first-rate table tbody .record-num {
+        border: none;
+    }
+    .first-rate table tbody .record-num td .count-tip{
+        float: right;
+        margin-right: 10px;
+        margin-top: 10px;
+    }
+    .first-rate .submitBox {
+        text-align: center;
+        margin: 35px auto;
+    }
+    .first-rate .submitBox label {
+        font-size: 14px;
+        font-weight: normal;
+        margin-right: 22px;
+    }
+    .first-rate .submitBox >span.submit-btn {
+        font-size: 14px;
+        padding: 4px 17px;
+        background: #5078cb;
+        color: #fff;
+        cursor: pointer;
+    }
+    .first-rate .rate-item .check-act input {
+        margin: 0;
+        margin-left: 4px;
+        display: none;
+    }
+    .first-rate .rate-item .check-act .rate-radio-label {
+        background: url(static/img/icon/check-rule.png) no-repeat;
+        width: 15px;
+        height: 15px;
+        background-position: 3px 3px;
+        margin: 0;
+    }
+    .first-rate .rate-item .check-act .rate-radio-label.active {
+        background-position: -12px 3px;
+    }
+    .seller-contact .contact-title {
+        height: 26px;
+        background-color: #5078cb;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 26px;
+        color: white;
+    }
+
+    .seller-contact .contact-title a, .seller-contact .contact-title a:hover {
+        color: white;
+    }
+
+    .seller-contact .contact-seller-info {
+        margin-left: 24px;
+        margin-right: 24px;
+        background-color: #5078cb;
+        color: #ffffff;
+        margin-top: 15px;
+        margin-bottom: 12px;
+        border-radius: 4px;
+        font-family: "Microsoft Yahei", "微软雅黑";
+        height: 150px;
+    }
+
+    .seller-contact .contact-seller-info div {
+        text-align: left;
+        font-size: 14px;
+        padding-left: 15px;
+        padding-right: 15px;
+    }
+
+    .seller-contact .contact-seller-info .company-name {
+        text-align: center;
+        font-size: 18px;
+        padding-top: 15px;
+    }
+
+    .seller-contact .send-message {
+        width: 553px;
+        height: 258px;
+        background-color: #F7F7F6;
+        padding-left: 13px;
+        padding-top: 15px;
+        border-radius: 4px;
+    }
+
+    .seller-contact-info {
+        position: absolute;
+        z-index: 2;
+        height: 210px;
+    <!-- 506 --> border: 1px solid #E7E5E2;
+        opacity: 1;
+        background-color: white;
+        width: 600px;
+        top: 40px;
+        left: -130px;
+        border: 1px solid #E7E5E2;
+        -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
+        box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
+    }
+
+</style>
+
+<div class="first-rate">
+    <div class="first-rate-head">
+        <span style="width: 27%;">
+            <a href="store/{{::order.storeid}}" target="_blank" class="first-rate-company">
+                <img src="static/img/user/images/shop_home.png"/>
+                <em>{{order.sellername}}</em>
+            </a>
+        </span>
+        <span style="position: relative; width: 10%; margin-left: 50px;">
+            <img src="static/img/common/songguo.png"/>
+            <a href="javascript:void(0)" class="contact_btn" ng-click="cont = !cont">联系卖家</a>
+            <div class="seller-contact" ng-if="cont" ng-class="{true : 'seller-contact-info', false : 'display-none'}[cont]">
+                                 <div class="contact-title">
+                                     <a ng-click="setContFalse()"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
+                                 </div>
+                                 <div class="contact-seller-info">
+                                     <div class="company-name" ng-bind="::order.sellername"></div>
+                                     <div>
+                                         <em>手机:<em ng-bind="::order.sellPhone || '暂无联系电话'"></em></em>
+                                         <em style="margin-left: 60px;">邮箱:<em ng-bind="::order.sellEmail || '暂无电子邮箱'"></em></em>
+                                     </div>
+                                     <div>地址:<em ng-bind="order.sellCompanyAddress || order.sellCompanyArea || '暂无地址信息'"></em></div>
+                                 </div>
+                                 <div style="display: none;">
+                                     <textarea class="send-message" placeholder="给卖家发送站内消息"></textarea>
+                                 </div>
+                                 <div style="display: none;" class="send-button"><a class="send">发送</a></div>
+                            </div>
+        </span>
+        <span style="float: right;margin-right: 46px; font-size: 12px;">其他买家需要你的建议喔</span>
+    </div>
+    <table>
+        <thead>
+            <tr>
+                <td>
+                    <span class="describe-title describe-option">店铺评价:</span>
+                    <span>描述相符</span>
+                    <span class="rate-level describe-option">
+                        <img ng-src="static/img/user/images/{{descObj.a - 0 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('a',1)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.a - 1 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('a',2)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.a - 2 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('a',3)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.a - 3 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('a',4)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.a - 4 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('a',5)" alt="">
+                    </span>
+                    <span>卖家服务</span>
+                    <span class="rate-level describe-option">
+                        <img ng-src="static/img/user/images/{{descObj.b - 0 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('b',1)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.b - 1 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('b',2)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.b - 2 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('b',3)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.b - 3 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('b',4)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.b - 4 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('b',5)" alt="">
+                    </span>
+                    <span>物流服务</span>
+                    <span class="rate-level describe-option">
+                        <img ng-src="static/img/user/images/{{descObj.c - 0 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('c',1)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.c - 1 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('c',2)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.c - 2 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('c',3)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.c - 3 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('c',4)" alt="">
+                        <img ng-src="static/img/user/images/{{descObj.c - 4 > 0? 'rateGood':'rateBad'}}.png" ng-click="setLevel('c',5)" alt="">
+                    </span>
+                </td>
+            </tr>
+        </thead>
+        <tbody>
+            <tr ng-repeat="detail in order.orderDetails track by $index">
+                <td>
+                    <a href="store/{{::order.storeid}}#/batchInfo/{{::detail.batchCode}}" target="_blank"><img ng-src="{{detail.img || 'static/img/store/common/default.png'}}" width="55" height="55"/></a>
+
+                    <div class="first-rate-item-info">
+                        <span class="first-rate-item-introduce"><span class="first-rate-item-link">类目:<a href="product#/kinds/{{::detail.kindUuid}}" target="_blank"><em ng-bind="::detail.kiName" title="{{::detail.kiName}}"></em></a><br/></span></span>
+                        <span class="first-rate-item-introduce"><span class="first-rate-item-link">型号:<a href="store/{{::order.storeid}}#/batchInfo/{{::detail.batchCode}}" target="_blank"><em ng-bind="::detail.cmpCode" title="{{::detail.cmpCode}}"></em></a><br/></span></span>
+                        <span class="first-rate-item-introduce"><span class="first-rate-item-link">品牌:<a href="product#/brand/{{::detail.branduuid}}/" target="_blank"><em ng-bind="::detail.brName" title="{{::detail.brName}}"></em></a></span></span>
+                    </div>
+                    <div class="first-rate-item-rate">
+                        <div class="rate-item">
+                           <!-- <label class="check-act">
+                                <img src="static/img/user/images/rate1.png" alt="">
+                                <span>好评</span>
+                                <input type="radio" id="{{1*($index)+1}}" name="radio{{$index}}" value="1" ng-model="goodsRate[$index].level" />
+                                <label for="{{1*($index)+1}}"></label>
+                            </label>-->
+                            <label class="check-act">
+                                <img src="static/img/user/images/rate1.png" alt="">
+                                <span>好评</span>
+                                <input type="radio" value="1" id="{{($index+1)*($index+1)+1}}" name="radio{{$index}}"  ng-model="goodsRate[$index].level">
+                                <label for="{{($index+1)*($index+1)+1}}" class="rate-radio-label" ng-class="{'active':goodsRate[$index].level==1}"></label>
+                            </label>
+                            <label class="check-act">
+                                <img src="static/img/user/images/rate2.png" alt="">
+                                <span>中评</span>
+                                <input type="radio" id="{{($index+1)*($index+1)+2}}" name="radio{{$index}}" value="2" ng-model="goodsRate[$index].level" />
+                                <label for="{{($index+1)*($index+1)+2}}" class="rate-radio-label" ng-class="{'active':goodsRate[$index].level==2}"></label>
+                            </label>
+                            <label class="check-act">
+                                <img src="static/img/user/images/rate3.png" alt="">
+                                <span>差评</span>
+                                <input type="radio" id="{{($index+1)*($index+1)+3}}" name="radio{{$index}}" value="3" ng-model="goodsRate[$index].level" />
+                                <label for="{{($index+1)*($index+1)+3}}" class="rate-radio-label" ng-class="{'active':goodsRate[$index].level==3}"></label>
+                            </label>
+                        </div>
+                        <div class="first-rate-item-textBox">
+                            <textarea id="rateContent" placeholder="请输入您对产品的评价" ng-change="listenRateContent($index)" ng-model="goodsRate[$index].buyerRate"></textarea>
+                            <div class="add-rate-remind">
+                                <span>{{goodsRate[$index].buyerRate.length || 0}}</span>
+                                <span>/200</span>
+                            </div>
+                        </div>
+                    </div>
+                </td>
+            </tr>
+
+            <tr class="record-num">
+                <td colspan="6">
+                    <span class="count-tip">显示<span ng-bind="$$kdnData.start">23</span>-<span ng-bind="$$kdnData.end">10</span>,共:<span ng-bind="$$kdnData.totalElements" style="color: #5078cb;">23</span>个</span>
+                </td>
+            </tr>
+        </tbody>
+    </table>
+    <div class="submitBox">
+        <label class="check-active">
+            <input ng-model="isSetTop" type="checkbox" id="check-act" class="ng-pristine ng-untouched ng-valid" ng-checked="isAnony" ng-click="isAnony = 1-isAnony">
+            <label for="check-act"></label>
+            <span style="font-size: 14px; color: black">匿名评价</span>
+        </label>
+        <span class="submit-btn" ng-click="submit()">提交</span>
+    </div>
+</div>

+ 405 - 0
src/main/webapp/resources/view/usercenter/forstore/show_rate.html

@@ -0,0 +1,405 @@
+<style>
+    .add-rate {
+        width: 1026px;
+        float: right;
+        background: #fff;
+    }
+    .add-rate .add-rate-head {
+        background: #89affa;
+        color: #fff;
+        padding: 0px 24px;
+        height: 40px;
+        line-height: 40px;
+    }
+    .add-rate .add-rate-head  span a.add-rate-company {
+        font-size: 14px;
+    }
+    .add-rate .add-rate-head  span a em {
+        color: #fff;
+        font-size: 14px;
+    }
+    .add-rate table {
+        margin: 13px;
+    }
+    .add-rate table thead {
+        background: #fff;
+    }
+    .add-rate table thead tr td {
+        width: 1000px;
+        padding: 14px 11px;
+        font-size: 14px;
+        margin-left: 15px;
+    }
+    .add-rate table tbody tr {
+        border-bottom: 1px dashed rgb( 232, 235, 252 );
+    }
+    .add-rate table tbody tr td >a >img{
+        width: 73px;
+        height: 74px;
+        float: left;
+        margin-top: 20px;
+        border: 1px solid rgb( 231, 231, 231 );
+        margin-left: 23px;
+    }
+    .add-rate table tbody tr td .add-rate-item-info {
+        display: inline-block;
+        width: 170px;
+        float: left;
+        margin-top: 15px;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce {
+        display: block;
+        margin: 0px 10px;
+        font-size: 14px;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce span {
+        float: left;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce span.add-rate-item-link {
+        max-width: 200px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: inline-block;
+        white-space: nowrap;
+        height: 27px;
+        line-height: 27px;
+    }
+    .add-rate table tbody .record-num {
+        border: none;
+    }
+    .add-rate table tbody .record-num td .count-tip{
+        float: right;
+        margin-right: 10px;
+        margin-top: 10px;
+    }
+    .add-rate .submitBox {
+        text-align: center;
+        margin: 35px auto;
+    }
+    .add-rate .submitBox label {
+        font-size: 14px;
+        font-weight: normal;
+        margin-right: 22px;
+    }
+    .add-rate .submitBox >span.submit-btn {
+        font-size: 14px;
+        padding: 4px 17px;
+        background: #5078cb;
+        color: #fff;
+    }
+    .add-rate table thead tr.line01 td {
+        padding-bottom: 24px;
+    }
+    .add-rate table thead tr.line02 td {
+        margin-top: 10px;
+    }
+    .add-rate table thead tr.line01 td >span {
+        margin-left: 5px;
+        float: left;
+        margin-top: 5px;
+    }
+    .add-rate table thead tr.line01 td >span >img {
+        margin-right: 5px;
+        margin-bottom: 3px;
+    }
+    .add-rate table thead tr.line02 td >span >img {
+        margin-left: -3px;
+        position: relative;
+        top: -2px;
+    }
+    .add-rate table thead tr td >div {
+        display: inline-block;
+        width: 43%;
+        background: #f9f9f9;
+        padding: 5px 10px;
+        height: 46px;
+        cursor: default;
+    }
+    .add-rate table thead tr td >div >span {
+        display: block;
+    }
+    .add-rate table thead tr td >div >span.add-rate-item01 span {
+        float: right;
+        display: block;
+        width: 329px;
+        height: 35px;
+        word-break: break-all;
+        overflow-y: scroll;
+    }
+    .add-rate table thead tr td >div >span.add-rate-item02 {
+        margin-top: 5px;
+        color: #999;
+        font-size: 12px;
+    }
+    .add-rate table thead tr.line01 {
+        border-bottom: 1px solid rgb( 232, 235, 252 );
+    }
+    .add-rate table thead tr.line02 {
+        background: #f5f8fe;
+    }
+    .add-rate table thead tr.line02 .describe-title {
+        color: #5078cb;
+        font-weight: bold;
+        margin-left: 15px!important;
+    }
+    .add-rate table thead tr.line02 .describe-option {
+        margin-right: 55px;
+        margin-left: 20px;
+    }
+    .add-rate table .buyer-first-rate {
+        width: 726px;
+        float: right;
+        margin-top: 12px;
+        margin-right: 8px;
+    }
+    .add-rate table .buyer-first-rate >div {
+        width: 311px;
+        display: inline-block;
+        background: #f9f9f9;
+        padding: 0 10px;
+        overflow: hidden;
+        height: 87px;
+        cursor: default;
+    }
+    .add-rate table .buyer-first-rate >div.isLeft {
+        margin-left: 100px;
+    }
+    .add-rate table .buyer-first-rate >div.isRight {
+       float: right;
+    }
+    .add-rate table .buyer-first-rate >div .rate-date {
+        color: #999;
+        margin-top: 10px;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div {
+        display: inline-block;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div >span {
+        display: block;
+        margin-top: 10px;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div >span img{
+        margin-right: 3px;
+        position: relative;
+        top: -2px;
+    }
+    .add-rate table .buyer-first-rate .comment {
+        width: 215px;
+        float: right;
+        height: 67px;
+    }
+    .add-rate table .buyer-first-rate .comment span{
+        height: 60px;
+        width: 215px;
+        overflow-y: auto;
+        word-break: break-all;
+    }
+    .add-rate table thead .temp-line td{
+        padding: 0;
+    }
+    .add-rate table thead .temp-line td div {
+        height: 0px;
+        background: #fff;
+        display: block;
+    }
+    .seller-contact .contact-title {
+        height: 26px;
+        background-color: #5078cb;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 26px;
+        color: white;
+    }
+
+    .seller-contact .contact-title a, .seller-contact .contact-title a:hover {
+        color: white;
+    }
+
+    .seller-contact .contact-seller-info {
+        margin-left: 24px;
+        margin-right: 24px;
+        background-color: #5078cb;
+        color: #ffffff;
+        margin-top: 15px;
+        margin-bottom: 12px;
+        border-radius: 4px;
+        font-family: "Microsoft Yahei", "微软雅黑";
+        height: 150px;
+    }
+
+    .seller-contact .contact-seller-info div {
+        text-align: left;
+        font-size: 14px;
+        padding-left: 15px;
+        padding-right: 15px;
+    }
+
+    .seller-contact .contact-seller-info .company-name {
+        text-align: center;
+        font-size: 18px;
+        padding-top: 15px;
+    }
+
+    .seller-contact .send-message {
+        width: 553px;
+        height: 258px;
+        background-color: #F7F7F6;
+        padding-left: 13px;
+        padding-top: 15px;
+        border-radius: 4px;
+    }
+
+    .seller-contact-info {
+        position: absolute;
+        z-index: 2;
+        height: 210px;<!--506-->
+        border: 1px solid #E7E5E2;
+        opacity: 1;
+        background-color: white;
+        width: 600px;
+        top: 40px;
+        left: -130px;
+        border: 1px solid #E7E5E2;
+        -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        box-shadow: 0 5px 15px rgba(0,0,0,.5);
+    }
+
+</style>
+
+<div class="add-rate">
+    <div class="add-rate-head">
+        <span style="width: 27%;">
+            <a href="store/{{::order.storeid}}" target="_blank" class="add-rate-company">
+                <img src="static/img/user/images/shop_home.png"/>
+                <em>{{order.sellername}}</em>
+            </a>
+        </span>
+        <span style="position: relative; width: 10%; margin-left: 50px;">
+            <img src="static/img/common/songguo.png"/>
+            <a href="javascript:void(0)" class="contact_btn" ng-click="cont = !cont">联系卖家</a>
+            <div class="seller-contact" ng-if="cont" ng-class="{true : 'seller-contact-info', false : 'display-none'}[cont]">
+                                 <div class="contact-title">
+                                     <a ng-click="setContFalse()"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
+                                 </div>
+                                 <div class="contact-seller-info">
+                                     <div class="company-name" ng-bind="::order.sellername"></div>
+                                     <div>
+                                         <em>手机:<em ng-bind="::order.sellPhone || '暂无联系电话'"></em></em>
+                                         <em style="margin-left: 60px;">邮箱:<em ng-bind="::order.sellEmail || '暂无电子邮箱'"></em></em>
+                                     </div>
+                                     <div>地址:<em ng-bind="order.sellCompanyAddress || order.sellCompanyArea || '暂无地址信息'"></em></div>
+                                 </div>
+                                 <div style="display: none;">
+                                     <textarea class="send-message" placeholder="给卖家发送站内消息"></textarea>
+                                 </div>
+                                 <div style="display: none;" class="send-button"><a class="send">发送</a></div>
+                            </div>
+        </span>
+        <span style="float: right;margin-right: 46px; font-size: 12px;">其他买家需要你的建议喔</span>
+    </div>
+    <table ng-table="showRateTableParams">
+        <thead>
+            <tr class="line01" ng-if="vendorRateBuyer.id">
+                <td>
+                    <span><img src="static/img/user/images/{{vendorRateBuyer.level == 1?'rate1.png':vendorRateBuyer.level == 2?'rate2.png':'rate3.png'}}" alt=""><span ng-bind="vendorRateBuyer.level == 1?'好评':vendorRateBuyer.level == 2?'中评':'差评'"></span></span>
+                    <div style="margin-left: 20px; float: left">
+                        <span class="add-rate-item01">卖家初评:<span ng-bind="vendorRateBuyer.vendorRate"></span></span>
+                        <span class="add-rate-item02" ng-bind="vendorRateBuyer.vendorRateTime | date:'yyyy-MM-dd'"></span>
+                    </div>
+                    <div style="margin-left: 40px;" ng-if="vendorRateBuyer.vendorAfterRate">
+                        <span class="add-rate-item01">卖家追评:<span ng-bind="vendorRateBuyer.vendorAfterRate"></span></span>
+                        <span class="add-rate-item02" ng-bind="vendorRateBuyer.vendorAfterRateTime | date:'yyyy-MM-dd'"></span>
+                    </div>
+                </td>
+            </tr>
+            <tr class="temp-line">
+                <td>
+                    <div></div>
+                </td>
+            </tr>
+            <tr class="line02">
+                <td>
+                    <span class="describe-title describe-option">店铺评价:</span>
+                    <span>描述相符</span>
+                    <span class="rate-level describe-option">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 0 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 1 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 2 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 3 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.describeLevel - 4 > 0">
+                    </span>
+                    <span>卖家服务</span>
+                    <span class="rate-level describe-option">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 0 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 1 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 2 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 3 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.vendorLevel - 4 > 0">
+                    </span>
+                    <span>物流服务</span>
+                    <span class="rate-level describe-option">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 0 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 1 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 2 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 3 > 0">
+                    <img ng-src="static/img/user/images/rateGood.png" alt="" ng-show="vendorRate.logisticsLevel - 4 > 0">
+                    </span>
+                </td>
+            </tr>
+        </thead>
+        <tbody>
+        <tr ng-repeat="detail in buyerRate track by $index">
+            <td>
+                <a href="store/{{::order.storeid}}#/batchInfo/{{::detail.goodsDetail.batchCode}}" target="_blank"><img ng-src="{{detail.goodsDetail.img || 'static/img/store/common/default.png'}}" width="55" height="55"/></a>
+                <div class="add-rate-item-info">
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">类目:<a href="product#/kinds/{{::detail.goodsDetail.kindUuid}}" target="_blank"><em ng-bind="::detail.goodsDetail.kiName" title="{{::detail.goodsDetail.kiName}}"></em></a><br/></span></span>
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">型号:<a href="store/{{::order.storeid}}#/batchInfo/{{::detail.goodsDetail.batchCode}}" target="_blank"><em ng-bind="::detail.goodsDetail.cmpCode" title="{{::detail.goodsDetail.cmpCode}}"></em></a><br/></span></span>
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">品牌:<a href="product#/brand/{{::detail.goodsDetail.branduuid}}/" target="_blank"><em ng-bind="::detail.goodsDetail.brName" title="{{::detail.goodsDetail.brName}}"></em></a></span></span>
+                </div>
+                <div class="buyer-first-rate">
+                    <div class="buyer-first-rate02 isLeft">
+                        <div>
+                            <span>买家初评:</span>
+                            <span><img src="static/img/user/images/{{detail.level == 1?'rate1.png':detail.level == 2?'rate2.png':'rate3.png'}}" alt=""><span ng-bind="detail.level == 1?'好评':detail.level == 2?'中评':'差评'"></span></span>
+                            <span class="rate-date" ng-bind="detail.buyerRateTime | date:'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.buyerRate"></span></div>
+                    </div>
+                    <div class="buyer-first-rate02" isRight ng-if="detail.buyerAfterRate">
+                        <div>
+                            <span>买家追评:</span>
+                            <span class="rate-date" ng-bind="detail.buyerAfterRateTime | date:'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.buyerAfterRate"></span></div>
+                    </div>
+                </div>
+                <div class="buyer-first-rate">
+                    <div class="buyer-first-rate02 isLeft" style="margin-left: 100px" ng-if="detail.returnMeg">
+                        <div>
+                            <span style="color:#6083ce;">卖家回复</span>
+                            <span class="rate-date" ng-bind="detail.returnMegTime  | date:'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.returnMeg"></span></div>
+                    </div>
+                    <div class="buyer-first-rate02 isRight" ng-if="detail.afterReturnMeg">
+                        <div>
+                            <span style="color:#6083ce;">卖家回复</span>
+                            <span class="rate-date" ng-bind="detail.afterReturnMegTime  | date:'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.afterReturnMeg"></span></div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        <tr class="record-num">
+            <td colspan="6">
+                <span class="count-tip">显示<span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span>,共:<span ng-bind="$$kdnData.totalElements" style="color: #5078cb;"></span>个</span>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>

+ 607 - 0
src/main/webapp/resources/view/vendor/forstore/showRate.html

@@ -0,0 +1,607 @@
+<style>
+    .add-rate {
+        width: 1026px;
+        float: right;
+        background: #fff;
+    }
+    .add-rate .add-rate-head {
+        background: #89affa;
+        color: #fff;
+        padding: 0px 24px;
+        height: 40px;
+        line-height: 40px;
+    }
+    .add-rate .add-rate-head  span a.add-rate-company {
+        font-size: 14px;
+    }
+    .add-rate .add-rate-head  span a em {
+        color: #fff;
+        font-size: 14px;
+    }
+    .add-rate table {
+        margin: 13px;
+    }
+    .add-rate table thead {
+        border-bottom: 1px solid rgb( 232, 235, 252 );
+        background: #fff;
+    }
+    .add-rate table thead tr td {
+        width: 1000px;
+        padding: 14px 11px;
+        font-size: 14px;
+        margin-left: 15px;
+    }
+    .add-rate table tbody tr {
+        border-bottom: 1px dashed rgb( 232, 235, 252 );
+    }
+    .add-rate table tbody tr td >a >img{
+        width: 73px;
+        height: 74px;
+        float: left;
+        margin-top: 20px;
+        border: 1px solid rgb( 231, 231, 231 );
+    }
+    .add-rate table tbody tr td .add-rate-item-info {
+        display: inline-block;
+        width: 200px;
+        float: left;
+        margin-top: 15px;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce {
+        display: block;
+        margin: 0px 10px;
+        font-size: 14px;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce span {
+        float: left;
+    }
+    .add-rate table tbody tr td .add-rate-item-introduce span.add-rate-item-link {
+        max-width: 200px;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: inline-block;
+        white-space: nowrap;
+        height: 27px;
+        line-height: 27px;
+    }
+    .add-rate table tbody .record-num {
+        border: none;
+    }
+    .add-rate table tbody .record-num td .count-tip{
+        float: right;
+        margin-right: 10px;
+    }
+    .add-rate .submitBox {
+        text-align: center;
+        margin: 35px auto;
+    }
+    .add-rate .submitBox label {
+        font-size: 14px;
+        font-weight: normal;
+        margin-right: 22px;
+    }
+    .add-rate .submitBox >span.submit-btn {
+        font-size: 14px;
+        padding: 4px 17px;
+        background: #5078cb;
+        color: #fff;
+    }
+    .add-rate table thead tr.line01 td >span {
+        margin-left: 5px;
+        float: left;
+        margin-top: 5px;
+    }
+    .add-rate table thead tr.line01 td >span >img {
+        margin-right: 5px;
+        margin-bottom: 3px;
+    }
+    .add-rate table thead tr.line02 td >span >img {
+        margin-left: -3px;
+    }
+    .add-rate table thead tr td >div {
+        display: inline-block;
+        width: 43%;
+        background: #f9f9f9;
+        padding: 5px 10px;
+        cursor: default;
+    }
+    .add-rate table thead tr td >div >span {
+        display: block;
+    }
+    .add-rate table thead tr td >div >span.add-rate-item01 span {
+        float: right;
+        display: block;
+        width: 329px;
+        height: 50px;
+        word-break: break-all;
+        overflow-y: scroll;
+    }
+    .add-rate table thead tr td >div >span.add-rate-item02 {
+        margin-top: 18px;
+        color: #999;
+        font-size: 12px;
+    }
+    .add-rate table thead tr.line01 {
+        border-bottom: 1px solid rgb( 232, 235, 252 );
+    }
+    .add-rate table thead tr.line02 {
+        background: #f5f8fe;
+    }
+    .add-rate table thead tr.line02 .describe-title {
+        color: #5078cb;
+        font-weight: bold;
+        margin-left: 15px;
+    }
+    .add-rate table thead tr.line02 .describe-option {
+        margin-right: 55px;
+    }
+    .add-rate table .batch-reply, .add-rate .reply-box .modal-btn {
+        color: #fff;
+        background: #ff8623;
+        border-radius: 3px;
+        padding: 4px 10px;
+        float: right;
+        cursor: pointer;
+    }
+    .add-rate table tbody .single-reply {
+        position: absolute;
+        top: 61px;
+        left: 265px;
+    }
+    .add-rate table .buyer-first-rate {
+        width: 726px;
+        float: right;
+        margin-top: 12px;
+    }
+    .add-rate table .buyer-first-rate >div {
+        width: 311px;
+        display: inline-block;
+        background: #f9f9f9;
+        padding: 0 10px;
+        overflow: hidden;
+        height: 87px;
+        position: relative;
+        cursor: default;
+    }
+    .add-rate table .buyer-first-rate >div >div {
+    }
+    .add-rate table .buyer-first-rate >div .rate-date {
+        color: #999;
+        margin-top: 10px;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div {
+        display: inline-block;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div >span {
+        display: block;
+        margin-top: 10px;
+    }
+    .add-rate table .buyer-first-rate .buyer-first-rate02 >div >span img{
+        margin-right: 3px;
+        position: relative;
+        top: -2px;
+    }
+    .add-rate table .buyer-first-rate .comment {
+        width: 215px;
+        float: right;
+        height: 67px;
+    }
+    .add-rate table .buyer-first-rate .comment span{
+        height: 60px;
+        width: 215px;
+        overflow-y: auto;
+        word-break: break-all;
+    }
+    .add-rate table .buyer-first-rate >div.isLeft {
+        margin-left: 100px;
+    }
+    .add-rate table .buyer-first-rate >div.isRight {
+        float: right;
+    }
+    .add-rate .reply-box {
+        position: fixed;
+        width: 391px;
+        min-height: 282px;
+        background: #fff;
+        top: 187px;
+        left: 650px;
+        box-shadow: 2.5px 4.33px 5px 0px rgb( 187, 186, 186 );
+        padding-left: 35px;
+        padding-top: 30px;
+    }
+    .add-rate .reply-box >img {
+        position: absolute;
+        top: 10px;
+        right: 10px;
+        cursor: pointer;
+    }
+    .add-rate .reply-box .modal-head {
+        width: 324px;
+        height: 30px;
+        border: 1px solid rgb( 233, 233, 233 );
+        padding-left: 10px;
+    }
+    .add-rate .reply-box .modal-select {
+        width: 200px;
+        height: 30px;
+        display: inline-block;
+        margin-left: 42px;
+        cursor: default;
+        background: #fff;
+    }
+    .add-rate .reply-box .modal-list {
+        position: absolute;
+        left: 124px;
+        z-index: 100;
+        box-shadow: 0 6px 12px rgba(0,0,0,.175);
+    }
+    .add-rate .reply-box .modal-list >span {
+        width: 200px;
+        height: 30px;
+        line-height: 30px;
+        cursor: pointer;
+        overflow: hidden;
+        color: #999;
+        font-size: 12px;
+        text-align: center;
+        background: #efedee;
+        padding: 0;
+        display: block;
+    }
+    .add-rate .reply-box .modal-list >span:hover {
+        background: #efedee;
+        color: #999;
+    }
+    .add-rate .reply-box .modal-list >span img{
+        margin-right: 8px;
+        margin-bottom: 3px;
+    }
+    .add-rate .reply-box ul {
+        max-height: 120px;
+        overflow-y: auto;
+        overflow-x: hidden;
+    }
+    .add-rate .reply-box ul li {
+        width: 200px;
+        height: 30px;
+        line-height: 30px;
+        background: #fff;
+        padding-left: 12px;
+        cursor: pointer;
+        overflow: hidden;
+    }
+   /* .add-rate .reply-box ul li.add-modal {
+        color: #999;
+        font-size: 12px;
+        text-align: center;
+        background: #efedee;
+        padding: 0;
+    }*/
+    .add-rate .reply-box ul li.add-modal img {
+        margin-right: 8px;
+        margin-bottom: 3px;
+    }
+    .add-rate .reply-box ul li:hover {
+        background: #5079cb;
+        color: #fff;
+    }
+   /* .add-rate .reply-box ul li.add-modal:hover {
+        background: #efedee;
+        color: #999;
+    }*/
+    .add-rate .reply-box .reply-box-text {
+        margin-top: 10px;
+        position: relative;
+    }
+    .add-rate .reply-box .reply-box-text >textarea {
+        width: 325px;
+        height: 156px;
+        display: block;
+        background: #f9f9f9;
+        font-size: 14px;
+        color: #999;
+        padding-top: 10px;
+        padding-left: 10px;
+        overflow-y: scroll;
+        border: 1px solid rgb( 233, 233, 233 );
+        resize: none;
+        padding-bottom: 15px;
+    }
+    .add-rate .reply-box .reply-box-btn {
+        text-align: center;
+        margin-top: 15px;
+        width: 324px;
+    }
+    .add-rate .reply-box .reply-box-btn .modal-btn {
+        float: none;
+        border-radius: 0;
+        font-size: 14px;
+        margin-right: 10px;
+    }
+    .add-rate .reply-box .reply-box-btn .modify-modal {
+    }
+    .add-rate .reply-box .reply-box-btn .cancel-modal {
+        background: #c2c3c5;
+    }
+    .add-rate .reply-box .reply-box-btn .submit-modal {
+        background: #5079cb;
+        margin: 0;
+    }
+    .add-rate .reply-box .reply-box-text >textarea.active{
+        background: #fff;
+        color: #333;
+    }
+    .add-rate .reply-box .reply-box-text .add-rate-remind {
+        position: absolute;
+        bottom: 2px;
+        right: 50px;
+        font-size: 12px;
+        color: #999;
+    }
+    .add-rate .reply-box .reply-box-text >textarea:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
+        color: #999;
+        font-size: 12px;
+    }
+
+    .add-rate .reply-box .reply-box-text >textarea::-moz-placeholder { /* Mozilla Firefox 19+ */
+        color: #999;
+        font-size: 12px;
+    }
+
+    .add-rate .reply-box .reply-box-text >textarea:-ms-input-placeholder{
+        color: #999;
+        font-size: 12px;
+    }
+
+    .add-rate .reply-box .reply-box-text >textarea::-webkit-input-placeholder{
+        color: #999;
+        font-size: 12px;
+    }
+    .add-rate .bg-f5f8fe {
+        background: #f5f8fe!important;
+    }
+    .buyer-contact-info {
+        position: absolute;
+        z-index: 2;
+        height: 155px;<!--506-->
+        border: 1px solid #E7E5E2;
+        opacity: 1;
+        background-color: white;
+        width: 600px;
+        top: 40px;
+        left: -130px;
+        border: 1px solid #E7E5E2;
+        -webkit-box-shadow: 0 5px 15px rgba(0,0,0,.5);
+        box-shadow: 0 5px 15px rgba(0,0,0,.5);
+    }
+
+    .display-none {
+        display: none;
+    }
+    .buyer-contact .contact-title {
+        height: 26px;
+        background-color: #5078cb;
+        text-align: right;
+        padding-right: 15px;
+        line-height: 26px;
+        color: white;
+    }
+
+    .buyer-contact .contact-title a, .buyer-contact .contact-title a:hover {
+        color: white;
+    }
+
+    .buyer-contact .contact-buyer-info {
+        margin-left: 24px;
+        margin-right: 24px;
+        background-color: #5078cb;
+        color: #ffffff;
+        margin-top: 15px;
+        margin-bottom: 12px;
+        border-radius: 4px;
+        font-family: "Microsoft Yahei", "微软雅黑";
+        height: 100px;
+    }
+
+    .buyer-contact .contact-buyer-info div {
+        text-align: left;
+        font-size: 14px;
+        padding-left: 15px;
+        padding-right: 15px;
+    }
+
+    .buyer-contact .contact-buyer-info .company-name {
+        text-align: center;
+        font-size: 18px;
+    }
+
+    .buyer-contact .send-message {
+        width: 553px;
+        height: 258px;
+        background-color: #F7F7F6;
+        padding-left: 13px;
+        padding-top: 15px;
+        border-radius: 4px;
+        border: none;
+    }
+
+    .buyer-contact .send-button .send{
+        width: 100px;
+        background-color: #3A76E3;
+        color: white;
+        display: inline-block;
+        border-radius: 3px;
+        height: 32px;
+        line-height: 32px;
+    }
+</style>
+
+<div class="add-rate">
+    <div class="add-rate-head">
+        <span style="width: 27%;">
+            <a target="_blank" class="add-rate-company"> <!--href="store/{{::order.storeid}}" -->
+               <!-- <img src="static/img/user/images/shop_home.png"/>-->
+                <em>{{order.buyername + ' | ' + order.sellername}}</em>
+            </a>
+        </span>
+        <span style="position: relative; width: 10%; margin-left: 50px;">
+            <img src="static/img/common/songguo.png"/>
+            <a href="javascript:void(0)" class="contact_btn" ng-click="cont = !cont">联系买家</a>
+            <div class="buyer-contact" ng-if="cont" ng-class="{true : 'buyer-contact-info', false : 'display-none'}[cont]">
+                                 <div class="contact-title">
+                                     <a ng-click="setContFalse()"><i class="fa fa-close fa-lg" aria-hidden="true"></i></a>
+                                 </div>
+                                 <div class="contact-buyer-info">
+                                     <div class="company-name" ng-bind="::order.buyername || '买家姓名没获取到'"></div>
+                                     <div>
+                                         <em>手机:<em ng-bind="::order.buyerTel || '暂无联系电话'"></em></em>
+                                         <em style="margin-left: 60px;">邮箱:<em ng-bind="::buyEmail || '暂无电子邮箱'"></em></em>
+                                     </div>
+                                 </div>
+                                 <div style="display: none;">
+                                     <textarea class="send-message" placeholder="给买家发送站内消息"></textarea>
+                                 </div>
+                                 <div style="display: none;" class="send-button"><a class="send">发送</a></div>
+                            </div>
+        </span>
+        <!--<span style="float: right;margin-right: 46px; font-size: 12px;">其他买家需要你的建议喔</span>-->
+    </div>
+    <table ng-table="showRateTableParams">
+        <thead>
+        <tr class="line01">
+            <td>
+                <span ng-if="sellerRateBuyer.level"><img ng-src="static/img/user/images/rate{{sellerRateBuyer.level}}.png" alt="">{{sellerRateBuyer.level == 1?'好评':sellerRateBuyer.level == 2?'中评':'差评'}}</span>
+                <div style="margin-left: 20px;" ng-if="sellerRateBuyer.vendorRate">
+                    <span class="add-rate-item01">卖家初评:<span ng-bind="sellerRateBuyer.vendorRate"></span></span>
+                    <span class="add-rate-item02" ng-bind="sellerRateBuyer.vendorRateTime | date:'yyyy-MM-dd'"></span>
+                </div>
+                <div style="margin-left: 40px;" ng-if="sellerRateBuyer.vendorAfterRate">
+                    <span class="add-rate-item01">卖家追评:<span ng-bind="sellerRateBuyer.vendorAfterRate"></span></span>
+                    <span class="add-rate-item02" ng-bind="sellerRateBuyer.vendorRateTime | date:'yyyy-MM-dd'"></span>
+                </div>
+            </td>
+        </tr>
+        <tr class="line02">
+            <td>
+                <span class="describe-title describe-option">店铺评价:</span>
+                <span>描述相符:</span>
+                <span class="rate-level describe-option">
+                    <img ng-if="buyerRateSeller.describeLevel && buyerRateSeller.describeLevel > 0" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.describeLevel && buyerRateSeller.describeLevel > 1" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.describeLevel && buyerRateSeller.describeLevel > 2" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.describeLevel && buyerRateSeller.describeLevel > 3" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.describeLevel && buyerRateSeller.describeLevel > 4" src="static/img/user/images/rateGood.png" alt="">
+                </span>
+                <span>卖家服务:</span>
+                <span class="rate-level describe-option">
+                    <img ng-if="buyerRateSeller.vendorLevel && buyerRateSeller.vendorLevel > 0" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.vendorLevel && buyerRateSeller.vendorLevel > 1" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.vendorLevel && buyerRateSeller.vendorLevel > 2" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.vendorLevel && buyerRateSeller.vendorLevel > 3" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.vendorLevel && buyerRateSeller.vendorLevel > 4" src="static/img/user/images/rateGood.png" alt="">
+                </span>
+                <span>物流服务:</span>
+                <span class="rate-level describe-option">
+                    <img ng-if="buyerRateSeller.logisticsLevel && buyerRateSeller.logisticsLevel > 0" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.logisticsLevel && buyerRateSeller.logisticsLevel > 1" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.logisticsLevel && buyerRateSeller.logisticsLevel > 2" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.logisticsLevel && buyerRateSeller.logisticsLevel > 3" src="static/img/user/images/rateGood.png" alt="">
+                    <img ng-if="buyerRateSeller.logisticsLevel && buyerRateSeller.logisticsLevel > 4" src="static/img/user/images/rateGood.png" alt="">
+                </span>
+                <span class="batch-reply" ng-click="getModal(null,'allRate')">批量回复</span>
+            </td>
+        </tr>
+        </thead>
+        <tbody>
+        <tr ng-repeat="detail in buyerRateGoods">
+            <td>
+                <a href="store/{{::order.storeid}}#/batchInfo/{{::detail.goodsDetail.batchCode}}" target="_blank"><img ng-src="{{detail.goodsDetail.img || 'static/img/store/common/default.png'}}" width="55" height="55"/></a>
+                <div class="add-rate-item-info">
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">类目:<a href="product#/kinds/{{::detail.goodsDetail.kindUuid}}" target="_blank"><em ng-bind="::detail.goodsDetail.kiName" title="{{::detail.goodsDetail.kiName}}"></em></a><br/></span></span>
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">型号:<a href="store/{{::order.storeid}}#/batchInfo/{{::detail.goodsDetail.batchCode}}" target="_blank"><em ng-bind="::detail.goodsDetail.cmpCode" title="{{::detail.goodsDetail.cmpCode}}"></em></a><br/></span></span>
+                    <span class="add-rate-item-introduce"><span class="add-rate-item-link">品牌:<a href="product#/brand/{{::detail.goodsDetail.branduuid}}/" target="_blank"><em ng-bind="::detail.goodsDetail.brName" title="{{::detail.goodsDetail.brName}}"></em></a></span></span>
+                </div>
+                <div class="buyer-first-rate">
+                    <div class="buyer-first-rate02 isLeft" ng-class="{'bg-f5f8fe':detail.showRateReply && !detail.returnMeg}" style="margin-left: 100px" ng-mouseenter="detail.showRateReply = true" ng-mouseleave="detail.showRateReply = false">
+                        <div>
+                            <span>买家初评:</span>
+                            <span><img ng-src="static/img/user/images/{{detail.level == 1?'rate1.png':detail.level == 2?'rate2.png':'rate3.png'}}" alt=""><span ng-bind="detail.level == 1?'好评':detail.level == 2?'中评':'差评'"></span></span>
+                            <span class="rate-date" ng-bind="detail.buyerRateTime | date:'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.buyerRate"></span></div>
+                        <span class="batch-reply single-reply" ng-if="detail.buyerRate != '此用户没有填写评价!' && detail.buyerRate != '此用户未及时做出评价,系统默认好评!'" ng-show="detail.showRateReply && !detail.returnMeg" ng-click="getModal(detail, 'firstRate')">回复</span>
+                    </div>
+                    <div class="buyer-first-rate02 isRight" ng-class="{'bg-f5f8fe':detail.showAddRateReply && !detail.afterReturnMeg}" ng-mouseenter="detail.showAddRateReply = true" ng-mouseleave="detail.showAddRateReply = false" ng-if="detail.buyerAfterRate">
+                        <div>
+                            <span>买家追评:</span>
+                            <span class="rate-date" ng-bind="detail.buyerAfterRateTime | date:'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.buyerAfterRate"></span>
+                        </div>
+                        <span class="batch-reply single-reply" ng-show="detail.showAddRateReply && !detail.afterReturnMeg" ng-click="getModal(detail, 'addRate')">回复</span>
+                    </div>
+                </div>
+                <div class="buyer-first-rate" >
+                    <div class="buyer-first-rate02 isLeft" style="margin-left: 100px" ng-if="detail.returnMeg">
+                        <div>
+                            <span style="color:#6083ce;">卖家回复</span>
+                            <span class="rate-date" ng-bind="detail.returnMegTime | date: 'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.returnMeg"></span></div>
+                    </div>
+                    <div class="buyer-first-rate02 isRight" ng-if="detail.afterReturnMeg">
+                        <div>
+                            <span style="color:#6083ce;">卖家回复</span>
+                            <span class="rate-date" ng-bind="detail.afterReturnMegTime | date: 'yyyy-MM-dd'"></span>
+                        </div>
+                        <div class="comment">
+                            <span ng-bind="detail.afterReturnMeg"></span></div>
+                    </div>
+                </div>
+            </td>
+        </tr>
+        <tr class="record-num">
+            <td colspan="6">
+                <span class="count-tip">显示 <span ng-bind="$$kdnData.start"></span>-<span ng-bind="$$kdnData.end"></span> 条,共 <span ng-bind="$$kdnData.totalElements" style="color: #5078cb;"></span> 条</span>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+    <div class="reply-box" ng-if="showRateBoxFlag">
+        <img src="static/img/vendor/images/rate-box-del.png" ng-click="setShowRateBoxFlag(false)" alt="">
+        <div style="position: relative;" ng-show="boxStatus == 1 || boxStatus == 2">
+            <label class="check-active" style="height: 34px;line-height: 34px;">
+                <input type="checkbox" id="check-act" ng-click="setGo()" ng-checked="boxStatus == 1" class="ng-pristine ng-untouched ng-valid">
+                <label for="check-act"></label>
+                <span style="font-size: 14px; color: black; font-weight: normal">使用模板</span>
+            </label>
+            <input type="search" ng-model="modalTempData.modalTitle" ng-show="boxStatus == 1" class="form-control modal-select" ng-focus="setShowModalListFlag(true)" ng-blur="setShowModalListFlag(false)" readonly>
+            <div ng-show="showModalListFlag" class="modal-list" ng-mouseenter="setIsInListFlag(true)" ng-mouseleave="setIsInListFlag(false)">
+                <ul>
+                    <li ng-repeat="modal in modalData" ng-bind="modal.rateTemplateName" ng-click="chooseModal(modal)"></li>
+                </ul>
+                <span ng-click="addModal()" class="add-modal"><img src="static/img/vendor/images/rate-add.png" alt="">新增模板</span>
+            </div>
+        </div>
+        <div>
+            <input type="text" ng-model="modalTempData.modalTitle" ng-change="listenModalTitle()" ng-trim="false" ng-if="boxStatus == 3 || boxStatus == 4" class="modal-head" placeholder="请填写模板名称">
+        </div>
+        <div class="reply-box-text">
+            <textarea id="rateContent" ng-disabled="boxStatus == 1" ng-aria-readonly="boxStatus == 1" ng-trim="false" placeholder="{{boxStatus==2?'请填写您对此评价的回复':boxStatus==3||boxStatus==4?'请填写模板内容':''}}" ng-change="listenRateContent()" ng-class="{'active': boxStatus != 1}" ng-model="modalTempData.rateContent"></textarea>
+            <div class="add-rate-remind" ng-show="boxStatus != 1">
+                <span>{{modalTempData.rateContent.length || 0}}</span>
+                <span>/200</span>
+            </div>
+        </div>
+        <div class="reply-box-btn">
+            <span class="modal-btn modify-modal" ng-click="setBoxStatus(4)" ng-show="boxStatus == 1 && modalTempData.modalTitle">修改模板</span>
+            <span class="modal-btn cancel-modal" ng-click="setShowRateBoxFlag(false)" ng-show="boxStatus == 1 || boxStatus == 2">取消</span>
+            <span class="modal-btn cancel-modal" ng-click="returnStep1()" ng-show="boxStatus == 3 || boxStatus == 4">返回上一步</span>
+            <span class="modal-btn submit-modal" ng-show="boxStatus == 3 || boxStatus == 4" ng-click="saveModal()">保存</span>
+            <span ng-class="!modalTempData.rateContent || modalTempData.rateContent == ''?'modal-btn cancel-modal':'modal-btn submit-modal'" ng-show="boxStatus == 1 || boxStatus == 2" ng-click="!modalTempData.rateContent || modalTempData.rateContent == ''?'':submitRate()">提交</span>
+        </div>
+    </div>
+</div>

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

@@ -136,6 +136,12 @@
 		background-color: #4574E8;
 		color: white !important;
 	}
+	.clock-mind {
+		font-size: 12px;
+		color: #C2BEB7;
+		line-height: 20px;
+		height: 20px;
+	}
 	ul.pagination.ng-table-pagination > li > a > span {
 		height: 17px;
 		line-height: 17px;
@@ -733,6 +739,228 @@
 	.form-control[readonly]{
 		background-color: #ffffff;
 	}
+	.sellOder .reply-box {
+		position: fixed;
+		width: 391px;
+		background: #fff;
+		top: 187px;
+		left: 650px;
+		box-shadow: 2.5px 4.33px 5px 0px rgb( 187, 186, 186 );
+	}
+	.sellOder .reply-box .vendor-modal-content {
+		padding-left: 24px;
+	}
+	.sellOder .reply-box >img {
+		position: absolute;
+		top: 10px;
+		right: 10px;
+		cursor: pointer;
+	}
+	.sellOder .reply-box .modal-select {
+		width: 200px;
+		height: 30px;
+		display: inline-block;
+		margin-left: 42px;
+		cursor: default;
+		background: #fff;
+	}
+	.sellOder .reply-box .modal-list {
+		position: absolute;
+		left: 124px;
+		z-index: 100;
+		box-shadow: 0 6px 12px rgba(0,0,0,.175);
+	}
+	.sellOder .reply-box .modal-list >span {
+		width: 200px;
+		height: 30px;
+		line-height: 30px;
+		cursor: pointer;
+		overflow: hidden;
+		color: #999;
+		font-size: 12px;
+		text-align: center;
+		background: #efedee;
+		padding: 0;
+		display: block;
+	}
+	.sellOder .reply-box .modal-list >span:hover {
+		background: #efedee;
+		color: #999;
+	}
+	.sellOder .reply-box .modal-list >span img{
+		margin-right: 8px;
+		margin-bottom: 3px;
+	}
+	.sellOder .reply-box ul {
+		max-height: 120px;
+		overflow-y: auto;
+		overflow-x: hidden;
+	}
+	.sellOder .reply-box ul li {
+		width: 200px;
+		height: 30px;
+		line-height: 30px;
+		background: #fff;
+		padding-left: 12px;
+		cursor: pointer;
+		overflow: hidden;
+	}
+	/*.sellOder .reply-box ul li.add-modal {
+		color: #999;
+		font-size: 12px;
+		text-align: center;
+		background: #efedee;
+		padding: 0;
+	}*/
+	.sellOder .reply-box ul li.add-modal img {
+		margin-right: 8px;
+		margin-bottom: 3px;
+	}
+	.sellOder .reply-box ul li:hover {
+		background: #5079cb;
+		color: #fff;
+	}
+	.sellOder .reply-box ul li.add-modal:hover {
+		background: #efedee;
+		color: #999;
+	}
+	.sellOder .reply-box .reply-box-text {
+		margin-top: 10px;
+        position: relative;
+	}
+	.sellOder .reply-box .reply-box-text >textarea {
+		width: 325px;
+		height: 156px;
+		display: block;
+		background: #f9f9f9;
+		font-size: 14px;
+		color: #999;
+		padding-top: 10px;
+		padding-left: 10px;
+		overflow-y: scroll;
+		border: 1px solid rgb( 233, 233, 233 );
+		resize: none;
+		padding-bottom: 15px;
+	}
+	.sellOder .reply-box .reply-box-text >textarea.active{
+		background: #fff;
+		color: #333;
+	}
+	.sellOder .reply-box .reply-box-btn {
+		text-align: center;
+		margin: 20px 0;
+		width: 324px;
+	}
+	.sellOder .reply-box .modal-head {
+		width: 324px;
+		height: 30px;
+		border: 1px solid rgb( 233, 233, 233 );
+		padding-left: 10px;
+		margin-top: 30px;
+	}
+	.sellOder .reply-box .reply-box-btn .modal-btn {
+		float: none;
+		border-radius: 0;
+		font-size: 14px;
+		margin-right: 10px;
+		color: #fff;
+		padding: 4px 10px;
+		cursor: pointer;
+	}
+	.sellOder .reply-box .reply-box-btn .modify-modal {
+		background: #ff8623;
+	}
+	.sellOder .reply-box .reply-box-btn .cancel-modal {
+		background: #c2c3c5;
+	}
+	.sellOder .reply-box .reply-box-btn .submit-modal {
+		background: #5079cb;
+		margin: 0;
+	}
+	.sellOder .reply-box .vendor-modal-header {
+		margin-bottom: 15px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-add-rate {
+		background: #ededef;
+		padding: 10px 24px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate {
+		padding-top: 24px;
+		padding-left: 24px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate >span {
+		font-size: 14px;
+		margin-right: 60px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-add-rate {
+		font-size: 14px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate >span img,
+	.sellOder .reply-box .vendor-modal-header .modal-add-rate >div >span img
+	{
+		position: relative;
+		right: 3px;
+		top: -1px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate label span {
+		font-weight: normal;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate label input {
+		margin: 0;
+		display: none;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-add-rate .rate-item {
+		display: block;
+		margin-bottom: 10px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-add-rate .rate-content {
+		width: 243px;
+		display: inline-block;
+		overflow: auto;
+		float: right;
+		height: 52px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-add-rate .rate-content span {
+		word-break: break-all;
+	}
+    .sellOder .reply-box .reply-box-text .add-rate-remind {
+        position: absolute;
+        bottom: 2px;
+        right: 60px;
+        font-size: 12px;
+        color: #999;
+    }
+	.sellOder .reply-box .reply-box-text >textarea:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
+		color: #999;
+		font-size: 12px;
+	}
+
+	.sellOder .reply-box .reply-box-text >textarea::-moz-placeholder { /* Mozilla Firefox 19+ */
+		color: #999;
+		font-size: 12px;
+	}
+
+	.sellOder .reply-box .reply-box-text >textarea:-ms-input-placeholder{
+		color: #999;
+		font-size: 12px;
+	}
+
+	.sellOder .reply-box .reply-box-text >textarea::-webkit-input-placeholder{
+		color: #999;
+		font-size: 12px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate .check-act .rate-radio-label {
+		background: url(static/img/icon/check-rule.png) no-repeat;
+		width: 16px;
+		height: 16px;
+		background-position: 3px 3px;
+		margin: 0;
+		position: relative;
+		top: 1px;
+	}
+	.sellOder .reply-box .vendor-modal-header .modal-first-rate .check-act .rate-radio-label.active {
+		background-position: -12px 3px;
+	}
 </style>
 <div class="user_right fr">
 	<!--订单中心-->
@@ -931,6 +1159,9 @@
                                 <a href="vendor#/purchase/detail/{{purchase.purchaseid | EncryptionFilter}}" class="oder_d action-link" target="_blank">订单详情</a><br/>
                                 <em ng-if="purchase.buyerNotifyShip && (purchase.status == 502 || purchase.status == 406)" style="display: block;">买家催促发货</em>
                                 <a class="oder_d action-link" href="vendor#/logistics/query/{{purchase.purchaseid | EncryptionFilter}}" ng-if="purchase.status == 404 || purchase.status == 520 || purchase.status == 405 || purchase.status == 503 || purchase.status == 514" target="_blank">查看物流</a>
+                           		<a class="oder_d action-link" target="_blank" href="vendor#/showRate/{{purchase.orderid | EncryptionFilter}}/{{purchase.buyEmail}}" style="display: block;" ng-if="purchase.isEachRate && purchase.isFirstRate">双方已评</a>
+								<div ng-if="!purchase.isEachRate && purchase.isFirstRate">我已评价</div>
+								<div ng-if="purchase.isEachRate && !purchase.isFirstRate">对方已评</div>
                             </div>
                         </span>
 						<span class="click_shop" style="position: relative">
@@ -938,8 +1169,16 @@
                                 <a class="order-operation" href="javascript:void(0)" ng-if="(purchase.status == 502 || purchase.status == 406)&&(purchase.uasPurcid == null)" ng-click="toBeShiped(purchase)">点击发货</a>
 								<a ng-if="purchase.uasPurcid" style="text-decoration: none;color: #323232;">来源UAS</a>
                                 <!--<a class="order-operation" href="javascript:void(0)" ng-if="purchase.status == 404 && purchase.lgtId&&!purchase.uasPurcid" ng-click="toBeShiped(purchase)" style="position: relative;">修改物流</a>-->
-								<a class="order-operation" href="javascript:void(0)" ng-if="purchase.status == 404&&!purchase.uasPurcid" ng-click="modifyLogistic(purchase)" style="position: relative;">修改物流</a>
-                                <div class="seller-ship-tip" ng-if="purchase.status == 404 && purchase.lgtId &&!purchase.uasPurcid" style="position: relative;">
+                                <a class="order-operation" href="javascript:void(0)" ng-if="purchase.status == 404 && purchase.lgtId&&!purchase.uasPurcid" ng-click="toBeShiped(purchase)" style="position: relative;">修改物流</a>
+								<a class="order-operation" href="javascript:void(0)" ng-click="getModal(purchase,'addRate')" style="position: relative;" ng-if="[405,503,514,506,511,520].indexOf(purchase.status) != -1 && !purchase.isAfterRate && purchase.isFirstRate && requestOver==purchases.length">追加评价</a>
+								<a class="order-operation" href="javascript:void(0)" style="position: relative;" ng-click="getModal(purchase,'firstRate')" ng-if="[405,503,514,506,511,520].indexOf(purchase.status) != -1 && !purchase.isFirstRate && requestOver==purchases.length">评价</a>
+								<!--<div ng-if="purchase.status == 520" class="clock-mind">
+                                  <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="purchase.complete + 1728000000 | restTime"></em>&lt;!&ndash;暂时设定30天自动初评&ndash;&gt;
+                              </div>
+								<div ng-if="purchase.status == 523" class="clock-mind">
+                                  <i class="fa fa-clock-o" aria-hidden="true"></i>&nbsp; <em ng-bind="purchase.complete + 15552000000 | restTime"></em>&lt;!&ndash;暂时设定180天自动追评&ndash;&gt;
+                              </div>-->
+								<div class="seller-ship-tip" ng-if="purchase.status == 404 && purchase.lgtId &&!purchase.uasPurcid" style="position: relative;">
                                     <img src="static/img/common/notice-tip.png" ng-mouseover="purchase.noticeTip = true" ng-mouseleave="purchase.noticeTip = false"/>
                                     <div class="ship-notify" ng-if="purchase.noticeTip">
                                       <div class="arrow"></div>
@@ -1014,6 +1253,79 @@
 				</div>
 			</dl>
 		</div>
+		<div class="reply-box" ng-show="showRateBoxFlag">
+			<img src="static/img/vendor/images/rate-box-del.png" ng-click="setShowRateBoxFlag(false)" alt="">
+			<div class="vendor-modal-header" ng-show="boxStatus == 1 || boxStatus == 2">
+				<div class="modal-first-rate" ng-show="rateType == 'firstRate'">
+					<span>
+						<label class="check-act">
+                                <img src="static/img/user/images/rate1.png" alt="">
+                                <span>好评</span>
+                                <input type="radio" id="1" name="rate" ng-model="rateContent.level" value="1"/>
+                                <label for="1" class="rate-radio-label" ng-class="{'active':rateContent.level==1}"></label>
+                            </label>
+					</span>
+					<span>
+						<label class="check-act">
+                                <img src="static/img/user/images/rate2.png" alt="">
+                                <span>中评</span>
+                                <input type="radio" id="2" name="rate" ng-model="rateContent.level" value="2"/>
+                                <label for="2" class="rate-radio-label" ng-class="{'active':rateContent.level==2}"></label>
+                            </label>
+					</span>
+					<span>
+						<label class="check-act">
+                                <img src="static/img/user/images/rate3.png" alt="">
+                                <span>差评</span>
+                                <input type="radio" id="3" name="rate" ng-model="rateContent.level" value="3"/>
+                                <label for="3" class="rate-radio-label" ng-class="{'active':rateContent.level==3}"></label>
+                            </label>
+					</span>
+				</div>
+				<div class="modal-add-rate" ng-show="rateType == 'addRate'">
+					<div style="width: 70px;display: inline-block;">
+						<span class="rate-item">初次评价:</span>
+						<span><img src="static/img/user/images/{{rateBuyer.level == 1?'rate1.png':rateBuyer.level == 2?'rate2.png':'rate3.png'}}" alt=""><span ng-bind="rateBuyer.level == 1?'好评':rateBuyer.level == 2?'中评':'差评'"></span></span>
+					</div>
+					<div class="rate-content" >
+						<span ng-bind="rateBuyer.vendorRate"></span>
+					</div>
+				</div>
+			</div>
+			<div class="vendor-modal-content">
+				<div style="position: relative;height: 30px;line-height: 30px;" ng-show="boxStatus == 1 || boxStatus == 2">
+					<label class="check-active">
+						<input type="checkbox" id="check-act" ng-click="setGo()" ng-checked="boxStatus == 1" class="ng-pristine ng-untouched ng-valid">
+						<label for="check-act"></label>
+						<span style="font-size: 14px; color: black; font-weight: normal" >使用模板</span>
+					</label>
+					<input type="search" ng-model="modalTempData.modalTitle" ng-show="boxStatus == 1" class="form-control modal-select" ng-focus="setShowModalListFlag(true)" ng-blur="setShowModalListFlag(false)" readonly>
+					<div ng-show="showModalListFlag" class="modal-list" ng-mouseenter="setIsInListFlag(true)" ng-mouseleave="setIsInListFlag(false)">
+						<ul>
+							<li ng-repeat="modal in modalData" ng-bind="modal.rateTemplateName" ng-click="chooseModal(modal)"></li>
+						</ul>
+						<span ng-click="addModal()" class="add-modal"><img src="static/img/vendor/images/rate-add.png" alt="">新增模板</span>
+					</div>
+				</div>
+				<div>
+					<input type="text" ng-model="modalTempData.modalTitle" ng-trim="false" ng-change="listenModalTitle()" ng-if="boxStatus == 3 || boxStatus == 4" class="modal-head" placeholder="请填写模板名称">
+				</div>
+				<div class="reply-box-text">
+					<textarea id="rateContent" ng-disabled="boxStatus == 1" ng-trim="false" ng-change="listenRateContent()" placeholder="{{boxStatus==2?'请输入不超过200字的评价':boxStatus==3||boxStatus==4?'请填写模板内容':''}}" ng-class="{'active': boxStatus != 1}" ng-model="modalTempData.rateContent"></textarea>
+                    <div class="add-rate-remind" ng-show="boxStatus != 1">
+                        <span>{{modalTempData.rateContent.length || 0}}</span>
+                        <span>/200</span>
+                    </div>
+                </div>
+				<div class="reply-box-btn">
+					<span class="modal-btn modify-modal" ng-click="setBoxStatus(4)" ng-show="boxStatus == 1 && modalTempData.modalTitle">修改模板</span>
+					<span class="modal-btn cancel-modal" ng-click="setShowRateBoxFlag(false)" ng-show="boxStatus == 1 || boxStatus == 2">取消</span>
+					<span class="modal-btn cancel-modal" ng-click="returnStep1()" ng-show="boxStatus == 3 || boxStatus == 4">返回上一步</span>
+					<span class="modal-btn submit-modal" ng-show="boxStatus == 3 || boxStatus == 4" ng-click="saveModal()">保存</span>
+					<span ng-class="!modalTempData.rateContent || modalTempData.rateContent == ''?'modal-btn cancel-modal':'modal-btn submit-modal'" ng-show="boxStatus == 1 || boxStatus == 2" ng-click="!modalTempData.rateContent || modalTempData.rateContent == ''?'':submitRate()">提交</span>
+				</div>
+			</div>
+		</div>
 	</div>
 	<!--猜你喜欢-->
 	<!--<div class="love_list">