Commit 78bb4186 by Java - 段鹏举

过滤重复记录

parent a66b5e2b
...@@ -179,7 +179,8 @@ ...@@ -179,7 +179,8 @@
WHERE r.end_status !='INIT' WHERE r.end_status !='INIT'
and r.create_name = #{createName} and r.create_name = #{createName}
and p.username = #{username} and p.username = #{username}
and r.start_time = #{endTime} and r.start_time <= #{endTime}
ORDER BY r.start_time DESC
</select> </select>
<!-- 通过通话的电话号查询用户信息 --> <!-- 通过通话的电话号查询用户信息 -->
......
package com.ejweb.modules.call.service; package com.ejweb.modules.call.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sound.midi.VoiceStatus;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ejweb.core.base.BaseService; import com.ejweb.core.base.BaseService;
import com.ejweb.core.base.PageEntity; import com.ejweb.core.base.PageEntity;
import com.ejweb.core.util.IdWorker; import com.ejweb.core.util.IdWorker;
...@@ -22,17 +8,18 @@ import com.ejweb.modules.call.bean.CallFindPhoneInfoBean; ...@@ -22,17 +8,18 @@ import com.ejweb.modules.call.bean.CallFindPhoneInfoBean;
import com.ejweb.modules.call.bean.CallPhoneBean; import com.ejweb.modules.call.bean.CallPhoneBean;
import com.ejweb.modules.call.bean.CallRecordListBean; import com.ejweb.modules.call.bean.CallRecordListBean;
import com.ejweb.modules.call.dao.CallDao; import com.ejweb.modules.call.dao.CallDao;
import com.ejweb.modules.call.entity.CallPhoneAreaEntity; import com.ejweb.modules.call.entity.*;
import com.ejweb.modules.call.entity.CallPhoneInfoListEntity;
import com.ejweb.modules.call.entity.CallRecordEntity;
import com.ejweb.modules.call.entity.CallRecordListEntity;
import com.ejweb.modules.call.entity.CallSoundRecordBean;
import com.ejweb.modules.call.entity.HuaweiNumListEntity;
import com.ejweb.modules.call.entity.MemberEntity;
import com.ejweb.modules.call.util.PhoneAreaEntity; import com.ejweb.modules.call.util.PhoneAreaEntity;
import com.ejweb.modules.call.util.PhoneAreaUtil; import com.ejweb.modules.call.util.PhoneAreaUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@Service @Service
@Transactional(readOnly = true) @Transactional(readOnly = true)
...@@ -84,14 +71,18 @@ public class CallService extends BaseService<CallDao> { ...@@ -84,14 +71,18 @@ 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) {
List<CallRecordListEntity> entity = dao.get(callRecordListEntity); if ("FAILD".equals(callRecordListEntity.getEndStatus())) {
if(entity.size()>0){ List<CallRecordListEntity> entity = dao.get(callRecordListEntity);
templist.add(callRecordListEntity); if(entity.size()>0 && "SUCCESS".equals(entity.get(0).getEndStatus())){
} templist.add(callRecordListEntity);
}
}
} }
if(templist.size()>0){ if(templist.size()>0){
list.removeAll(templist); list.removeAll(templist);
} pageInfo.setSize(list.size());
pageInfo.setTotal(list.size());
}
PageEntity<CallRecordListEntity> page = new PageEntity<CallRecordListEntity>(); PageEntity<CallRecordListEntity> page = new PageEntity<CallRecordListEntity>();
page.setPageNo(pageInfo.getPageNum()); page.setPageNo(pageInfo.getPageNum());
page.setPageSize(pageInfo.getPageSize()); page.setPageSize(pageInfo.getPageSize());
......
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