|
@@ -1,10 +1,15 @@
|
|
|
package com.slibra.business.service.impl;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
+import com.slibra.business.domain.TCutOffWater;
|
|
|
+import com.slibra.business.domain.TUserInfo;
|
|
|
+import com.slibra.business.mapper.TCutOffWaterMapper;
|
|
|
+import com.slibra.business.mapper.TUserInfoMapper;
|
|
|
import com.slibra.business.res.Ele;
|
|
|
import com.slibra.common.exception.ServiceException;
|
|
|
import com.slibra.common.utils.DateUtils;
|
|
@@ -36,6 +41,12 @@ public class TCallRecordServiceImpl implements ITCallRecordService
|
|
|
@Autowired
|
|
|
private TCallRecordMapper tCallRecordMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TUserInfoMapper tUserInfoMapper;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TCutOffWaterMapper cutOffWaterMapper;
|
|
|
+
|
|
|
@Value("${ALIYUN_AK_ID}")
|
|
|
private String accessKeyId;
|
|
|
|
|
@@ -139,10 +150,32 @@ public class TCallRecordServiceImpl implements ITCallRecordService
|
|
|
if(!CollectionUtils.isEmpty(tCallRecords)){
|
|
|
TCallRecord tCallRecord = tCallRecords.get(0);
|
|
|
tCallRecord.setCurrentCallRecords(this.tCallRecordMapper.getContentsBySessionId(sessionId));//[当前通话记录]
|
|
|
+ this.addExtra(tCallRecord);
|
|
|
+ return tCallRecord;
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
+ private void addExtra(TCallRecord tCallRecord) {
|
|
|
+ String phone = tCallRecord.getPhone();
|
|
|
+ //获取历史通话记录(不包含本次)
|
|
|
+ List<TCallRecord> histories = this.tCallRecordMapper.selectHistoriesByPhone(phone, tCallRecord.getId());
|
|
|
+ /*tCallRecord.setCounts(this.tCallRecordMapper.getCallCountsByPhone(phone));*/
|
|
|
+ //户号水费小区名称
|
|
|
+ List<TUserInfo> tUserInfos = this.tUserInfoMapper.selectTUserInfoList(TUserInfo.builder().phone(phone).build());
|
|
|
+ tCallRecord.setUserInfos(tUserInfos);
|
|
|
+ tCallRecord.setCallRecords(histories);
|
|
|
+ tCallRecord.setCounts(histories.size());
|
|
|
+ //正在进行的停水信息
|
|
|
+ if(!CollectionUtils.isEmpty(tUserInfos)){
|
|
|
+ List<TCutOffWater> cutOffWaters = new ArrayList<>();
|
|
|
+ for (TUserInfo tUserInfo : tUserInfos) {
|
|
|
+ cutOffWaters.addAll(this.cutOffWaterMapper.getCutOffWaterByNeighbourhoodName(tUserInfo.getNeighbourhoodName()));
|
|
|
+ }
|
|
|
+ tCallRecord.setCutOffWaters(cutOffWaters);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<HashMap<String, Object>> getAgentList() {
|
|
|
return this.tCallRecordMapper.getAgentList();
|
|
@@ -154,12 +187,12 @@ public class TCallRecordServiceImpl implements ITCallRecordService
|
|
|
TCallRecord tCallRecord = this.tCallRecordMapper.selectTCallRecordById(id);
|
|
|
if(Objects.isNull(tCallRecord))
|
|
|
throw new ServiceException("请输入正确的ID");
|
|
|
- String url = tCallRecord.getUrl();
|
|
|
- if(StringUtils.isBlank(url))
|
|
|
- throw new ServiceException("此次通话记录,未记录录音文件,无法转换");
|
|
|
Long hasParsed = tCallRecord.getHasParsed();
|
|
|
if(!Objects.isNull(hasParsed) && 1== hasParsed)
|
|
|
throw new ServiceException("此次通话记录已经做过转换了,无需重复转换");
|
|
|
+ String url = tCallRecord.getUrl();
|
|
|
+ if(StringUtils.isBlank(url))
|
|
|
+ throw new ServiceException("此次通话记录,未记录录音文件,无法转换");
|
|
|
/*final String accessKeyId = "LTAI5tQ2HmiHCygZkt5BYrYR";
|
|
|
final String accessKeySecret = "KhmxTd14SUcXafpFk5yofA43FoeM99";
|
|
|
final String appKey = "OKt6jogp6fRjHQVp";*/
|