日志打印

master
wjt 1 year ago
parent c61f3b5ec8
commit 900b06217c

@ -5,7 +5,6 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import com.baiye.common.CommonLog;
import com.baiye.config.properties.FileProperties;
import com.baiye.constant.DefaultNumberConstants;
import com.baiye.exception.BadRequestException;
@ -73,11 +72,9 @@ public class ExcellentCasesServiceImpl implements ExcellentCasesService {
inputStreamToFile(inputStream, substring);
url = "cases" + File.separator + substring;
} catch (Exception e) {
CommonLog.error("保存案例失败,获取录音错误");
throw new BadRequestException("保存失败,获取录音错误");
}
if (StrUtil.isBlank(url)) {
CommonLog.error("保存案例失败,未获取到录音");
throw new BadRequestException("保存失败,未获取到录音");
}
excellentCases.setUrl(url);

@ -53,14 +53,12 @@ public class TelephoneCallController {
public CommonResponse<TelephoneCallStopDTO> doubleCallReq(@Validated @RequestBody TelephoneCallReqDTO telephoneCallReqDTO) {
int hour = DateUtil.hour(DateUtil.date(), true);
if (hour < DefaultNumberConstants.EIGHT_NUMBER || hour >= DefaultNumberConstants.TWENTY_ONE) {
CommonLog.error("请在8点-21点之间拨打电话");
return CommonResponse.createByErrorMessage("请在8点-21点之间拨打电话");
}
//判断账号是否到期
Date expirationTime = userService.findExpirationTimeByUserId(SecurityUtils.getCurrentUserId());
if (ObjectUtil.isNull(expirationTime)
|| DateUtil.compare(expirationTime, DateUtil.date()) < DefaultNumberConstants.ZERO_NUMBER) {
CommonLog.error("您的账号已到期,请联系管理员");
return CommonResponse.createByErrorMessage("您的账号已到期,请联系管理员");
}
Long companyId = SecurityUtils.getCompanyId();
@ -73,11 +71,9 @@ public class TelephoneCallController {
}
Company company = companyService.findById(companyId);
if (ObjectUtil.isNull(organize) || ObjectUtil.isNull(company)) {
CommonLog.error("缺失小组信息或公司信息");
return CommonResponse.createByErrorMessage("缺失小组信息或公司信息");
}
if (organize.getCallMode() == null) {
CommonLog.error("请指定呼叫方式后使用");
return CommonResponse.createByErrorMessage("请指定呼叫方式后使用");
}
//呼叫方式0:双呼 1:点呼 2:AXB
@ -151,7 +147,7 @@ public class TelephoneCallController {
}
telephoneCallService.rollCallBack(rollCallBackDTO);
} catch (Exception e) {
log.error("点呼回调话单错误 参数 {},错误:{}", json, e.getMessage());
CommonLog.error("点呼回调话单错误:" + json);
return CommonResponse.createByError();
}
return CommonResponse.createBySuccess();

@ -236,12 +236,10 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
//获取分机号
Integer number = extensionUserRepository.findNumberByMemberId(telephoneCallReqDTO.getMemberId());
if (number == null) {
CommonLog.error("未分配分机号");
throw new BadRequestException("未分配分机号");
}
ExtensionDisplay extensionDisplay = extensionDisplayRepository.findExtensionDisplayByCompanyId(companyId);
if (ObjectUtil.isNull(extensionDisplay)) {
CommonLog.error("未配置去显号");
throw new BadRequestException("未配置去显号");
}
telephoneCallReqDTO.setTelA(String.valueOf(number));
@ -250,28 +248,24 @@ public class TelephoneCallServiceImpl implements TelephoneCallService {
switch (telephoneCallReqDTO.getClueType()) {
case DefaultNumberConstants.THREE_NUMBER:
if (extensionDisplay.getDyDisplay() == null) {
CommonLog.error("未配置抖音去显号");
throw new BadRequestException("未配置抖音去显号");
}
display = extensionDisplay.getDyDisplay();
break;
case DefaultNumberConstants.FOUR_NUMBER:
if (extensionDisplay.getDeliveryDisplay() == null) {
CommonLog.error("未配置投流去显号");
throw new BadRequestException("未配置投流去显号");
}
display = extensionDisplay.getDeliveryDisplay();
break;
case DefaultNumberConstants.FIVE_NUMBER:
if (extensionDisplay.getTokerDisplay() == null) {
CommonLog.error("未配置拓客去显号");
throw new BadRequestException("未配置拓客去显号");
}
display = extensionDisplay.getTokerDisplay();
break;
default:
if (extensionDisplay.getDisplay() == null) {
CommonLog.error("未配置去显号");
throw new BadRequestException("未配置去显号");
}
display = extensionDisplay.getDisplay();

Loading…
Cancel
Save