|
|
@@ -172,7 +172,7 @@ public class OrderRedDotServiceImpl implements OrderRedDotService {
|
|
|
*
|
|
|
* @param orderType 单据类型
|
|
|
* @param roleName 角色
|
|
|
- * @return
|
|
|
+ * @return 未读单据的id,原表id
|
|
|
*/
|
|
|
@Override
|
|
|
public List<Long> getUnreadIds(String orderType, String roleName) {
|
|
|
@@ -192,13 +192,15 @@ public class OrderRedDotServiceImpl implements OrderRedDotService {
|
|
|
*
|
|
|
* @param orderType 单据类型
|
|
|
* @param roleName 角色
|
|
|
- * @return 数量
|
|
|
+ * @return 设置已读的数量
|
|
|
*/
|
|
|
@Override
|
|
|
public Integer setReadByState(String orderType, String roleName) {
|
|
|
List<Long> redAllIdList = getUnreadRedAllIdList(orderType, roleName);
|
|
|
- List<List<Long>> idsList = SplitArray.splitAry(redAllIdList, SplitArray.QUERY_MAX_NUMBER);
|
|
|
- idsList.forEach(ids -> setReadByIdList(ids));
|
|
|
+ if (!CollectionUtil.isEmpty(redAllIdList)) {
|
|
|
+ List<List<Long>> idsList = SplitArray.splitAry(redAllIdList, SplitArray.QUERY_MAX_NUMBER);
|
|
|
+ idsList.forEach(this::setReadByIdList);
|
|
|
+ }
|
|
|
return redAllIdList.size();
|
|
|
}
|
|
|
|
|
|
@@ -210,7 +212,7 @@ public class OrderRedDotServiceImpl implements OrderRedDotService {
|
|
|
* @return List<Long>
|
|
|
*/
|
|
|
private List<Long> getUnreadRedAllIdList(String orderType, String roleName) {
|
|
|
- StringBuffer buffer = new StringBuffer("select red_id from reddot$all");
|
|
|
+ StringBuilder buffer = new StringBuilder("select red_id from reddot$all");
|
|
|
Long enUU = SystemSession.getUser().getEnterprise().getUu();
|
|
|
if (Role.SELLER.equals(roleName)) {
|
|
|
buffer.append(" where red_venduu = ?");
|