Commit aabad90d by Java - 段鹏举

过滤重复记录,查sql改为代码

parent 78bb4186
...@@ -70,14 +70,26 @@ public class CallService extends BaseService<CallDao> { ...@@ -70,14 +70,26 @@ public class CallService extends BaseService<CallDao> {
} }
//过滤重复记录 //过滤重复记录
List<CallRecordListEntity> templist = new ArrayList<CallRecordListEntity>(); List<CallRecordListEntity> templist = new ArrayList<CallRecordListEntity>();
for (CallRecordListEntity callRecordListEntity : list) { // for (CallRecordListEntity callRecordListEntity : list) {
if ("FAILD".equals(callRecordListEntity.getEndStatus())) { // if ("FAILD".equals(callRecordListEntity.getEndStatus())) {
List<CallRecordListEntity> entity = dao.get(callRecordListEntity); // List<CallRecordListEntity> entity = dao.get(callRecordListEntity);
if(entity.size()>0 && "SUCCESS".equals(entity.get(0).getEndStatus())){ // if(entity.size()>0 && "SUCCESS".equals(entity.get(0).getEndStatus())){
// templist.add(callRecordListEntity);
// }
// }
// }
for (int i = 0; i < list.size(); i++) {
CallRecordListEntity callRecordListEntity = list.get(i);
if (i > 0 && "FAILD".equals(callRecordListEntity.getEndStatus())) {
CallRecordListEntity last = list.get(i - 1);
if ("SUCCESS".equals(last.getEndStatus())
&& callRecordListEntity.getCreateName().equals(last.getCreateName())
&& callRecordListEntity.getUsername().equals(last.getUsername())
&& callRecordListEntity.getEndTime().after(last.getStartTime())) {
templist.add(callRecordListEntity); templist.add(callRecordListEntity);
} }
} }
} }
if(templist.size()>0){ if(templist.size()>0){
list.removeAll(templist); list.removeAll(templist);
pageInfo.setSize(list.size()); pageInfo.setSize(list.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment