|
|
@@ -10,6 +10,7 @@ import com.uas.ps.core.page.PageParams;
|
|
|
import com.uas.ps.core.page.criteria.LogicalExpression;
|
|
|
import com.uas.ps.core.page.criteria.PredicateUtils;
|
|
|
import com.uas.ps.core.page.criteria.SimpleExpression;
|
|
|
+import com.uas.ps.core.util.ArrayUtils;
|
|
|
import com.uas.ps.message.dao.AppDao;
|
|
|
import com.uas.ps.message.dao.MessageDao;
|
|
|
import com.uas.ps.message.domain.App;
|
|
|
@@ -111,18 +112,18 @@ public class MessageServiceImpl implements MessageService {
|
|
|
SimpleExpression receiverUuExp = PredicateUtils.eq("receiverUu", Long.valueOf(receiverUu), true);
|
|
|
// 消息接收企业过滤
|
|
|
SimpleExpression receiverEnuuExp = PredicateUtils.eq("receiverEnuu", Long.valueOf(receiverEnuu), true);
|
|
|
- SimpleExpression[] simpleExpressions = new SimpleExpression[]{receiverUuExp, receiverEnuuExp};
|
|
|
+ SimpleExpression[] simpleExpressions = new SimpleExpression[] {receiverUuExp, receiverEnuuExp};
|
|
|
|
|
|
// 读取状态
|
|
|
if (!StringUtils.isEmpty(isRead)) {
|
|
|
SimpleExpression isReadExp = PredicateUtils.eq("isRead", Short.valueOf(isRead), true);
|
|
|
- simpleExpressions[simpleExpressions.length - 1] = isReadExp;
|
|
|
+ simpleExpressions = ArrayUtils.concat(simpleExpressions, new SimpleExpression[] {isReadExp});
|
|
|
}
|
|
|
|
|
|
// 关键词搜索
|
|
|
if (!StringUtils.isEmpty(keyword)) {
|
|
|
SimpleExpression contentExp = PredicateUtils.like("content", keyword, true);
|
|
|
- simpleExpressions[simpleExpressions.length - 1] = contentExp;
|
|
|
+ simpleExpressions = ArrayUtils.concat(simpleExpressions, new SimpleExpression[] {contentExp});
|
|
|
}
|
|
|
|
|
|
final LogicalExpression logicalExpression = PredicateUtils.and(simpleExpressions);
|
|
|
@@ -158,8 +159,8 @@ public class MessageServiceImpl implements MessageService {
|
|
|
throw new IllegalOperatorException("接收应用不存在");
|
|
|
}
|
|
|
|
|
|
- List<Message> messages = messageDao.findByReceiverUuAndReceiverEnuuAndConsumerAppId(Long.valueOf(receiverUu), Long.valueOf(receiverEnuu),
|
|
|
- consumerAppExists.getId());
|
|
|
+ List<Message> messages = messageDao.findByReceiverUuAndReceiverEnuuAndConsumerAppId(Long.valueOf(receiverUu),
|
|
|
+ Long.valueOf(receiverEnuu), consumerAppExists.getId());
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
resultMap.put("success", "success");
|
|
|
@@ -221,7 +222,8 @@ public class MessageServiceImpl implements MessageService {
|
|
|
throw new IllegalOperatorException("消息不存在,请重新确认消息信息");
|
|
|
}
|
|
|
if (receiverUu == null || StringUtils.isEmpty(String.valueOf(receiverEnuu)) || receiverEnuu == null
|
|
|
- || StringUtils.isEmpty(String.valueOf(receiverUu)) || StringUtils.isEmpty(String.valueOf(consumerApp))) {
|
|
|
+ || StringUtils.isEmpty(String.valueOf(receiverUu))
|
|
|
+ || StringUtils.isEmpty(String.valueOf(consumerApp))) {
|
|
|
throw new ParameterMissingException("用户信息为空,无法读取消息");
|
|
|
}
|
|
|
if (!Long.valueOf(String.valueOf(receiverEnuu)).equals(message.getReceiverEnuu())
|