Browse Source

更新红点获取已经设置已读方法

hejq 7 years ago
parent
commit
9509a67bdc

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

@@ -120,7 +120,7 @@ public interface MakeOrderDao extends JpaSpecificationExecutor<MakeOrder>, JpaRe
      * @param status 单据状态
      * @return 未阅读数量
      */
-    @Query("select p.id from MakeOrder p where p.id in :ids and p.status=:status")
+    @Query("select count(1) from MakeOrder p where p.id in :ids and p.status=:status")
 	Integer findReadCount(@Param("ids") List<Long> ids, @Param("status") Short status);
 
 	/**

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

@@ -75,7 +75,7 @@ public interface PurchaseOrderDao extends JpaSpecificationExecutor<PurchaseOrder
      * @param status  单据状态
      * @return 已回复单据id号集合
      */
-    @Query("select p.id from PurchaseOrderAll p where p.id in :ids and p.status=:status and IFNULL(p.end,0)=0")
+    @Query("select count(1) from PurchaseOrderAll p where p.id in :ids and p.status=:status and IFNULL(p.end,0)=0")
     Integer findReadCount(@Param("ids") List<Long> ids, @Param("status") Short status);
 
     /**

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

@@ -21,7 +21,7 @@ import java.util.Date;
  * @date 2018-09-17 9:20
  */
 @Table(name = "reddot$all", indexes = {
-    @Index(name = "reddot$all_orderId_type_number_IDX", columnList = "red_orid,red_ortype", unique = true),
+    @Index(name = "reddot$all_orderId_type_IDX", columnList = "red_orid,red_ortype"),
     @Index(name = "reddot$all_vendUU_IDX", columnList = "red_venduu"),
     @Index(name = "reddot$all_enUU_IDX", columnList = "red_enuu")
 })

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

@@ -250,7 +250,7 @@ public class OrderRedDotServiceImpl implements OrderRedDotService {
             buffer.append(" where red_enuu = ?");
         }
         buffer.append(" and red_ortype = ? and not exists (select 1 from reddot$done where red_done_redid = red_id and red_done_enuu = ? and red_done_useruu = ?)");
-        return commonDao.query(buffer.toString(), Long.class, enUU, orderType, enUU, SystemSession.getUser().getUserUU());
+        return commonDao.queryForList(buffer.toString(), Long.class, enUU, orderType, enUU, SystemSession.getUser().getUserUU());
     }
 
     /**
@@ -286,7 +286,7 @@ public class OrderRedDotServiceImpl implements OrderRedDotService {
             buffer.append(" where red_enuu = ?");
         }
         buffer.append(" and red_ortype = ? and not exists (select 1 from reddot$done where red_done_redid = red_id and red_done_enuu = ? and red_done_useruu = ?)");
-        return commonDao.query(buffer.toString(), Long.class, enUU, orderType, enUU, SystemSession.getUser().getUserUU());
+        return commonDao.queryForList(buffer.toString(), Long.class, enUU, orderType, enUU, SystemSession.getUser().getUserUU());
     }
 
     /**