|
|
@@ -359,18 +359,25 @@ public class KdzlTask {
|
|
|
* 根据电话号码同步客户信息表的通话状态
|
|
|
*
|
|
|
*/
|
|
|
- public void syncCallStatusByPhone() {
|
|
|
+ public int syncCallStatusByPhone() {
|
|
|
List<UserPhoneAndCallStatusVO> phoneAndCallStatusVOList =kdzlCallRecordMapper.selectUserPhoneAndCallStatus();
|
|
|
if (CollectionUtils.isEmpty(phoneAndCallStatusVOList)){
|
|
|
- return;
|
|
|
+ return 0;
|
|
|
}
|
|
|
for (UserPhoneAndCallStatusVO item : phoneAndCallStatusVOList) {
|
|
|
- if ("".equals(item.getCallStatus())||item.getCallStatus()==null){
|
|
|
+ if (item == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (item.getCallStatus() == null || item.getCallStatus().isEmpty()){
|
|
|
item.setCallStatus("2");//未接通
|
|
|
}
|
|
|
}
|
|
|
+ // 更新前过滤掉 phone 为空的元素(避免更新时匹配不到)
|
|
|
+ List<UserPhoneAndCallStatusVO> validList = phoneAndCallStatusVOList.stream()
|
|
|
+ .filter(vo -> vo != null && vo.getPhone() != null && !vo.getPhone().isEmpty())
|
|
|
+ .collect(Collectors.toList());
|
|
|
//根据电话号码更新客户信息表的通话状态
|
|
|
- int update=companyCustomerMapper.updateBatchFsCompanyCustomerCallStatusByPhoneList(phoneAndCallStatusVOList);
|
|
|
+ return companyCustomerMapper.updateBatchFsCompanyCustomerCallStatusByPhoneList(validList);
|
|
|
}
|
|
|
|
|
|
/**
|