Commit 8de75800 authored by tangwei's avatar tangwei

修改扫描bug

parent 1af9b72d
...@@ -93,7 +93,9 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto, ...@@ -93,7 +93,9 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
log.setDealTimes(0); log.setDealTimes(0);
if (!ValidationUtil.isEmpty(callRecord)) { if (!ValidationUtil.isEmpty(callRecord)) {
model.setFilePath(String.format("/%s/%s", callRecord.get("subPath"), callRecord.get("recordName").replace("wav", "mp3"))); model.setFilePath(String.format("/%s/%s", callRecord.get("subPath"), callRecord.get("recordName").replace("wav", "mp3")));
logger.info(String.format("音频地址:【%s】", String.format("/%s/%s", callRecord.get("subPath"), callRecord.get("recordName")))); String logs=String.format("音频地址:【%s】", String.format("/%s/%s", callRecord.get("subPath"), callRecord.get("recordName")));
logger.info(logs);
} else { // 无录音地址记录日志 } else { // 无录音地址记录日志
iVoiceRecordLogServiceImpl.save(log); iVoiceRecordLogServiceImpl.save(log);
} }
...@@ -133,12 +135,12 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto, ...@@ -133,12 +135,12 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
@Override @Override
public List<FusionDto> getCarList(Boolean hasFusion) { public List<FusionDto> getCarList(Boolean hasFusion) {
List<FusionDto> fusionDtos = new ArrayList<>(); List<FusionDto> fusionDtos = new ArrayList<>();
List carList = equipFeignClient.getCarFusionList().getResult(); List<Map<String,Object>> carList = equipFeignClient.getCarFusionList().getResult();
List<String> employeeIDs = getAllOnlineUser(hasFusion); List<String> employeeIDs = getAllOnlineUser(hasFusion);
if (!ValidationUtil.isEmpty(carList)) { if (!ValidationUtil.isEmpty(carList)) {
carList.forEach(x -> { carList.forEach(x -> {
FusionDto fusionDto = new FusionDto(); FusionDto fusionDto = new FusionDto();
Map map = (Map) x; Map<String,Object> map = (Map<String,Object>) x;
fusionDto.setName(String.valueOf(map.get("name"))); fusionDto.setName(String.valueOf(map.get("name")));
fusionDto.setCarNum(String.valueOf(map.get("carNum"))); fusionDto.setCarNum(String.valueOf(map.get("carNum")));
buildFusionDtoAndId(fusionDto, employeeIDs, hasFusion, map); buildFusionDtoAndId(fusionDto, employeeIDs, hasFusion, map);
...@@ -211,16 +213,16 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto, ...@@ -211,16 +213,16 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
return employeeIDs; return employeeIDs;
} }
private FusionDto buildFusionDtoAndId(FusionDto fusionDto, List<String> employeeIDs, Boolean hasFusion, Map map) { private FusionDto buildFusionDtoAndId(FusionDto fusionDto, List<String> employeeIDs, Boolean hasFusion, Map<String,Object> map) {
List carPropertyList = (List) map.get("carPropertyList"); List carPropertyList = (List) map.get("carPropertyList");
carPropertyList.forEach(carProperty -> { carPropertyList.forEach(carProperty -> {
Map carPropertyMap = (Map) carProperty; Map<String,Object> carPropertyMap = (Map<String,Object>) carProperty;
Object nameKey = carPropertyMap.get("nameKey"); Object nameKey = carPropertyMap.get("nameKey");
if (hasFusion && PropertyEnum.GIS.getValue().equals(nameKey)) {
fusionDto.setId(String.valueOf(carPropertyMap.get("value"))); if((hasFusion &&PropertyEnum.GIS.getValue().equals(nameKey))|| (!hasFusion &&PropertyEnum.VIDEO.getValue().equals(nameKey))){
} else if (!hasFusion && PropertyEnum.VIDEO.getValue().equals(nameKey)) {
fusionDto.setId(String.valueOf(carPropertyMap.get("value"))); fusionDto.setId(String.valueOf(carPropertyMap.get("value")));
} }
}); });
buildFusionDto(fusionDto, employeeIDs, hasFusion); buildFusionDto(fusionDto, employeeIDs, hasFusion);
return fusionDto; return fusionDto;
......
...@@ -64,7 +64,8 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -64,7 +64,8 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
// @Scheduled(fixedDelay=ONE_Minute) // @Scheduled(fixedDelay=ONE_Minute)
public void fixedDelayJob(){ public void fixedDelayJob(){
// 设置token // 设置token
System.out.println(JSON.toJSONString(RequestContext.cloneRequestContext())); String logs=JSON.toJSONString(RequestContext.cloneRequestContext());
logger.info(logs);
// 首先查找未完成 且失败次数少于5 的 记录 // 首先查找未完成 且失败次数少于5 的 记录
List<VoiceRecordLog> logList = this.list(new LambdaQueryWrapper<VoiceRecordLog>().eq(VoiceRecordLog::getIsDeal,false).lt(VoiceRecordLog::getDealTimes,5)); List<VoiceRecordLog> logList = this.list(new LambdaQueryWrapper<VoiceRecordLog>().eq(VoiceRecordLog::getIsDeal,false).lt(VoiceRecordLog::getDealTimes,5));
if(logList != null && logList.size() >0) { if(logList != null && logList.size() >0) {
...@@ -77,10 +78,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -77,10 +78,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
} }
l.setDealTimes(dealTimes); l.setDealTimes(dealTimes);
Map<String, String> map = fusionService.getCallRecordByCID(l.getConnectId()); Map<String, String> map = fusionService.getCallRecordByCID(l.getConnectId());
// if(ctiInfos == null || ctiInfos.size() == 0) {
// this.updateById(l);
// return;
// }
VoiceRecordFileDto model = new VoiceRecordFileDto(); VoiceRecordFileDto model = new VoiceRecordFileDto();
model.setAlertId(l.getAlertId()); model.setAlertId(l.getAlertId());
model.setCaller(map.get("caller")); model.setCaller(map.get("caller"));
...@@ -105,15 +103,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -105,15 +103,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
} }
Map<String, String> downloadFile = null; Map<String, String> downloadFile = null;
try {
// JSONObject jsonObject = fusionService.getCallRecordByCID(l.getConnectId());
// Map<String, String> map = voiceRecordFileService.getResult(jsonObject);
// downloadFile = ctiService.downLoadRecordFile(recordInfo.getString("connectionid"));
} catch (Exception e) {
e.printStackTrace();
this.updateById(l);
return;
}
if(downloadFile.isEmpty()) { if(downloadFile.isEmpty()) {
this.updateById(l); this.updateById(l);
return; return;
...@@ -121,34 +111,10 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi ...@@ -121,34 +111,10 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
for(Map.Entry<String,String> file : downloadFile.entrySet()) { for(Map.Entry<String,String> file : downloadFile.entrySet()) {
model.setFilePath(file.getKey()); model.setFilePath(file.getKey());
} }
// AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
// if(alertDto == null || alertDto.getAlertCalledDto() == null) {
// this.updateById(l);
// return;
// }
// model.setAlertStage(alertDto.getAlertCalledDto().getAlertStage());
// model.setAlertStageCode(alertDto.getAlertCalledDto().getAlertStageCode());
// model.setSourceId(-1l);
// voiceRecordFileServiceImpl.createWithModel(model);
// JSONObject json = new JSONObject();
// json.put("alertId",model.getAlertId());
// try {
// emqKeeper.getMqttClient().publish(ctiMessage, json.toJSONString().getBytes(), 2, false);
// try {
// redisUtils.del(RedisKey.jcs_ALERTCALLED_ID+model.getAlertId());
// } catch (Exception e) {
// e.printStackTrace();
// logger.error("删除redis失败:" + e.getMessage());
// }
// } catch (MqttException e) {
// logger.error("推送失败");
// }
// l.setIsDeal(true);
// this.updateById(l);
}); });
} }
System.out.println("执行通话记录任务"); logger.info("执行通话记录任务");
} }
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ public class WarningServiceImpl implements IHomePageService { ...@@ -19,7 +19,7 @@ public class WarningServiceImpl implements IHomePageService {
@Autowired @Autowired
EquipFeignClient quipFeignClient; EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1; private EquipFeignClient quipFeignClient1;
@PostConstruct @PostConstruct
public void init(){ public void init(){
......
...@@ -19,7 +19,8 @@ public class YesServiceImpl implements IHomePageService { ...@@ -19,7 +19,8 @@ public class YesServiceImpl implements IHomePageService {
@Autowired @Autowired
EquipFeignClient quipFeignClient; EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
private EquipFeignClient quipFeignClient1;
@PostConstruct @PostConstruct
public void init(){ public void init(){
......
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