|
|
@@ -296,9 +296,9 @@ public class AiSipCallController extends AppBaseController {
|
|
|
getCompanyUserId(), startTime, endTime, encryptedMobile, remark, callStatus);
|
|
|
if (list != null) {
|
|
|
for (CrmCustomer c : list) {
|
|
|
- if (StringUtils.isNotBlank(c.getMobile())) {
|
|
|
+ if(StringUtils.isNotBlank(c.getMobile())){
|
|
|
+ String decrypted = PhoneUtil.decryptPhone(c.getMobile());
|
|
|
try {
|
|
|
- String decrypted = PhoneUtil.decryptPhone(c.getMobile());
|
|
|
c.setMobile(decrypted.replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
} catch (Exception e) {
|
|
|
log.warn("[aiSipCall] 解密手机号失败, customerId={}", c.getCustomerId());
|
|
|
@@ -319,11 +319,27 @@ public class AiSipCallController extends AppBaseController {
|
|
|
@ApiOperation("根据客户ID查询呼叫记录")
|
|
|
@GetMapping("/getCallRecordByCustomerId")
|
|
|
public TableDataInfo getCallRecordByCustomerId(
|
|
|
- @RequestParam("customerId") Long customerId,
|
|
|
+ @RequestParam(value = "customerId", required = false) Long customerId,
|
|
|
+ @RequestParam(value = "startTime", required = false) String startTime,
|
|
|
+ @RequestParam(value = "endTime", required = false) String endTime,
|
|
|
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
|
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
|
AiSipCallOutboundCdr query = new AiSipCallOutboundCdr();
|
|
|
- query.setCustomerId(customerId);
|
|
|
+ if (customerId != null) {
|
|
|
+ query.setCustomerId(customerId);
|
|
|
+ } else {
|
|
|
+ CompanyUser companyUser = companyUserService.selectCompanyUserById(getCompanyUserId());
|
|
|
+ if (companyUser != null) {
|
|
|
+ query.setOpnum(companyUser.getUserName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(startTime)) {
|
|
|
+ query.setStartTimeStart(startTime);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(endTime)) {
|
|
|
+ query.setStartTimeEnd(endTime);
|
|
|
+ }
|
|
|
+
|
|
|
PageHelper.startPage(pageNum, pageSize);
|
|
|
List<AiSipCallOutboundCdr> list = aiSipCallOutboundCdrService.selectAiSipCallOutboundCdrList(query);
|
|
|
return getDataTable(list);
|
|
|
@@ -349,6 +365,21 @@ public class AiSipCallController extends AppBaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置客户解密状态为已解锁
|
|
|
+ */
|
|
|
+ @Login
|
|
|
+ @ApiOperation("设置客户解密状态为已解锁")
|
|
|
+ @PostMapping("/unlockCustomerDecrypt")
|
|
|
+ public AjaxResult unlockCustomerDecrypt(@RequestParam("customerId") Long customerId) {
|
|
|
+ if (customerId == null) {
|
|
|
+ return AjaxResult.error("客户ID不能为空");
|
|
|
+ }
|
|
|
+ int rows = crmCustomerMapper.updateCanDecryptByCustomerId(customerId);
|
|
|
+ String encryptedMobile = crmCustomerMapper.selectCrmCustomerPhoneByCustomerId(customerId);
|
|
|
+ return rows > 0 ? AjaxResult.success(PhoneUtil.decryptPhone(encryptedMobile)) : AjaxResult.error("解锁失败,客户不存在");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 生成6位随机串(替代 his_java 中的 com.fs.his.utils.RandomUtil#generateRandomCode)
|