|
|
@@ -21,6 +21,7 @@ import com.fs.crm.service.ICrmCustomerService;
|
|
|
import com.fs.crm.vo.CrmCustomerExportVO;
|
|
|
import com.fs.crm.vo.CrmCustomerListVO;
|
|
|
import com.fs.framework.web.service.TokenService;
|
|
|
+import com.fs.his.utils.PhoneUtil;
|
|
|
import com.fs.system.service.ISysRoleService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -56,9 +57,34 @@ public class CrmCustomerController extends BaseController
|
|
|
startPage();
|
|
|
crmCustomer.setIsLine(1);
|
|
|
List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListVO(crmCustomer);
|
|
|
+ if (list != null && !list.isEmpty()) {
|
|
|
+ list.forEach(customer -> {
|
|
|
+ if (customer.getMobile() != null && !customer.getMobile().isEmpty()) {
|
|
|
+ // 如果手机号长度大于11,说明是加密的,需要解密后脱敏
|
|
|
+ if (customer.getMobile().length() > 11) {
|
|
|
+ customer.setMobile(PhoneUtil.decryptPhoneMk(customer.getMobile()));
|
|
|
+ } else {
|
|
|
+ // 如果是明文手机号,直接脱敏
|
|
|
+ customer.setMobile(maskPhoneMiddleFive(customer.getMobile()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 手机号中间4位脱敏处理 (例如: 13812345678 -> 138****5678)
|
|
|
+ * @param phone 原始手机号
|
|
|
+ * @return 脱敏后的手机号
|
|
|
+ */
|
|
|
+ private String maskPhoneMiddleFive(String phone) {
|
|
|
+ if (phone == null || phone.isEmpty()) {
|
|
|
+ return phone;
|
|
|
+ }
|
|
|
+ return phone.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
|
|
|
+ }
|
|
|
+
|
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:addLine')")
|
|
|
@Log(title = "创建线索客户", businessType = BusinessType.INSERT)
|
|
|
@PostMapping("/addLine")
|
|
|
@@ -86,7 +112,9 @@ public class CrmCustomerController extends BaseController
|
|
|
@GetMapping(value = "/queryLine/{customerId}")
|
|
|
public AjaxResult getLineInfo(@PathVariable("customerId") Long customerId)
|
|
|
{
|
|
|
- return AjaxResult.success(crmCustomerService.selectCrmCustomerById(customerId));
|
|
|
+ CrmCustomer crmCustomer = crmCustomerService.selectCrmCustomerById(customerId);
|
|
|
+ crmCustomer.setMobile(null);
|
|
|
+ return AjaxResult.success(crmCustomer);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -197,9 +225,9 @@ public class CrmCustomerController extends BaseController
|
|
|
}
|
|
|
List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListQueryParam(crmCustomer);
|
|
|
if (list != null) {
|
|
|
- boolean checkPhone = isCheckPhone();
|
|
|
+ //boolean checkPhone = isCheckPhone();
|
|
|
for (CrmCustomerListVO vo : list) {
|
|
|
- if(vo.getMobile()!=null && !checkPhone){
|
|
|
+ if(vo.getMobile()!=null){
|
|
|
vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
}
|
|
|
|
|
|
@@ -232,6 +260,7 @@ public class CrmCustomerController extends BaseController
|
|
|
public R getInfo(@PathVariable("customerId") Long customerId)
|
|
|
{
|
|
|
CrmCustomer customer=crmCustomerService.selectCrmCustomerById(customerId);
|
|
|
+ customer.setMobile(null);
|
|
|
Company company=companyService.selectCompanyById(customer.getCompanyId());
|
|
|
return R.ok().put("customer",customer).put("company",company);
|
|
|
}
|