Commit 8de75800 authored by tangwei's avatar tangwei

修改扫描bug

parent 1af9b72d
......@@ -93,7 +93,9 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
log.setDealTimes(0);
if (!ValidationUtil.isEmpty(callRecord)) {
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 { // 无录音地址记录日志
iVoiceRecordLogServiceImpl.save(log);
}
......@@ -133,12 +135,12 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
@Override
public List<FusionDto> getCarList(Boolean hasFusion) {
List<FusionDto> fusionDtos = new ArrayList<>();
List carList = equipFeignClient.getCarFusionList().getResult();
List<Map<String,Object>> carList = equipFeignClient.getCarFusionList().getResult();
List<String> employeeIDs = getAllOnlineUser(hasFusion);
if (!ValidationUtil.isEmpty(carList)) {
carList.forEach(x -> {
FusionDto fusionDto = new FusionDto();
Map map = (Map) x;
Map<String,Object> map = (Map<String,Object>) x;
fusionDto.setName(String.valueOf(map.get("name")));
fusionDto.setCarNum(String.valueOf(map.get("carNum")));
buildFusionDtoAndId(fusionDto, employeeIDs, hasFusion, map);
......@@ -211,16 +213,16 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
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");
carPropertyList.forEach(carProperty -> {
Map carPropertyMap = (Map) carProperty;
Map<String,Object> carPropertyMap = (Map<String,Object>) carProperty;
Object nameKey = carPropertyMap.get("nameKey");
if (hasFusion && PropertyEnum.GIS.getValue().equals(nameKey)) {
fusionDto.setId(String.valueOf(carPropertyMap.get("value")));
} else if (!hasFusion && PropertyEnum.VIDEO.getValue().equals(nameKey)) {
if((hasFusion &&PropertyEnum.GIS.getValue().equals(nameKey))|| (!hasFusion &&PropertyEnum.VIDEO.getValue().equals(nameKey))){
fusionDto.setId(String.valueOf(carPropertyMap.get("value")));
}
});
buildFusionDto(fusionDto, employeeIDs, hasFusion);
return fusionDto;
......
......@@ -64,7 +64,8 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
// @Scheduled(fixedDelay=ONE_Minute)
public void fixedDelayJob(){
// 设置token
System.out.println(JSON.toJSONString(RequestContext.cloneRequestContext()));
String logs=JSON.toJSONString(RequestContext.cloneRequestContext());
logger.info(logs);
// 首先查找未完成 且失败次数少于5 的 记录
List<VoiceRecordLog> logList = this.list(new LambdaQueryWrapper<VoiceRecordLog>().eq(VoiceRecordLog::getIsDeal,false).lt(VoiceRecordLog::getDealTimes,5));
if(logList != null && logList.size() >0) {
......@@ -77,10 +78,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
}
l.setDealTimes(dealTimes);
Map<String, String> map = fusionService.getCallRecordByCID(l.getConnectId());
// if(ctiInfos == null || ctiInfos.size() == 0) {
// this.updateById(l);
// return;
// }
VoiceRecordFileDto model = new VoiceRecordFileDto();
model.setAlertId(l.getAlertId());
model.setCaller(map.get("caller"));
......@@ -105,15 +103,7 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
}
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()) {
this.updateById(l);
return;
......@@ -121,34 +111,10 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
for(Map.Entry<String,String> file : downloadFile.entrySet()) {
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 {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
private EquipFeignClient quipFeignClient1;
@PostConstruct
public void init(){
......
......@@ -19,7 +19,8 @@ public class YesServiceImpl implements IHomePageService {
@Autowired
EquipFeignClient quipFeignClient;
private static EquipFeignClient quipFeignClient1;
private EquipFeignClient quipFeignClient1;
@PostConstruct
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