|
|
@@ -21,6 +21,7 @@ import com.inspur.mapper.ElevatorPersonInfoMapper;
|
|
|
import com.inspur.mapper.ElevatorWorkNodeMapper;
|
|
|
import com.inspur.mapper.ElevatorWorkOrderMapper;
|
|
|
import com.inspur.system.service.ISysConfigService;
|
|
|
+import com.inspur.thrid.AreaCodeEnum;
|
|
|
import com.inspur.thrid.IPBXService;
|
|
|
import com.inspur.thrid.PBXConstant;
|
|
|
import com.inspur.websoket.client.bean.ws.*;
|
|
|
@@ -279,6 +280,12 @@ public class PBXServiceImpl implements IPBXService {
|
|
|
|| PBXConstant.IVR_CODE_BUSY_CODE.equals(dtmf)) {
|
|
|
return;
|
|
|
}
|
|
|
+ String configLastCallCode = configService.selectConfigByKey("sys.pbx.lastCallCode");
|
|
|
+ // 排除dtmf出现保底电话 119的情况
|
|
|
+ if (dtmf.startsWith("09") && dtmf.endsWith(configLastCallCode)) {
|
|
|
+ log.info("dtmf ends with configLastCallCode, return!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (dtmf.length() > 6) {
|
|
|
log.info("dtmf length > 6, dtmf : {}",dtmf);
|
|
|
// bugfix dtmf出现转接的电话号码
|
|
|
@@ -345,7 +352,9 @@ public class PBXServiceImpl implements IPBXService {
|
|
|
}else {
|
|
|
createOrderNode_2(workOrder,wsDtmfMessage,1,dtmf);
|
|
|
}
|
|
|
- String lastCallCode = configService.selectConfigByKey("sys.pbx.lastCallCode");
|
|
|
+ // 根据电梯所在区域,获取电话区号,并赋值给保底电话
|
|
|
+ String phoneAreaCode = getAreaCodeInfoByAreaCode(elevatorInfo.getAreaCode());
|
|
|
+ String lastCallCode = phoneAreaCode + configLastCallCode;
|
|
|
// 根据电梯信息 查询所有的维保人员
|
|
|
List<ElevatorPersonInfo> personInfoList = elevatorPersonInfoMapper.selectElevatorPersonInfoByElevatorId(elevatorInfo.getDeviceId());
|
|
|
if (CollectionUtils.isEmpty(personInfoList)) {
|
|
|
@@ -368,6 +377,15 @@ public class PBXServiceImpl implements IPBXService {
|
|
|
trasnferCallThread.start();
|
|
|
}
|
|
|
|
|
|
+ private String getAreaCodeInfoByAreaCode(String areaCode) {
|
|
|
+ for (AreaCodeEnum areaCodeEnum : AreaCodeEnum.values()) {
|
|
|
+ if (areaCodeEnum.getCode().equals(areaCode)) {
|
|
|
+ return areaCodeEnum.getInfo();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AreaCodeEnum.BING_TUAN.getInfo();
|
|
|
+ }
|
|
|
+
|
|
|
private void hangupCall(WsDtmfMessage wsDtmfMessage) {
|
|
|
String pbxToken = redisCache.getCacheObject(PBXConstant.PBX_TOKEN_KEY);
|
|
|
Map<String, String> params = new HashMap<String, String>(6);
|
|
|
@@ -622,10 +640,16 @@ public class PBXServiceImpl implements IPBXService {
|
|
|
params.put("channel_id", channelId);
|
|
|
// params.put("number", callNumber);
|
|
|
// params.put("number", "0" + callNumber);
|
|
|
- if (isLocalCall(callNumber)) {
|
|
|
+ // 如果是呼叫119 直接根据完整号码呼叫
|
|
|
+ String configLastCallCode = configService.selectConfigByKey("sys.pbx.lastCallCode");
|
|
|
+ if (callNumber.startsWith("09") && callNumber.endsWith(configLastCallCode)) {
|
|
|
params.put("number", callNumber);
|
|
|
}else {
|
|
|
- params.put("number", "0" + callNumber);
|
|
|
+ if (isLocalCall(callNumber)) {
|
|
|
+ params.put("number", callNumber);
|
|
|
+ }else {
|
|
|
+ params.put("number", "0" + callNumber);
|
|
|
+ }
|
|
|
}
|
|
|
params.put("dial_permission","1000");
|
|
|
|
|
|
@@ -885,8 +909,9 @@ public class PBXServiceImpl implements IPBXService {
|
|
|
continue;
|
|
|
}
|
|
|
// 如果手机号开头是0 去除掉0
|
|
|
- if (toPhone.startsWith("0")) {
|
|
|
+ if (toPhone.startsWith("0") && toPhone.length() > 11) {
|
|
|
toPhone = toPhone.substring(1,12);
|
|
|
+ log.info("toPhone start with 0,get sub toPhone : " + toPhone);
|
|
|
}
|
|
|
String callId = redisCache.getCacheObject(PBXConstant.PBX_TRANSFER_CODE_KEY + toPhone);
|
|
|
if (StringUtils.isEmpty(callId)) {
|