|
@@ -64,18 +64,37 @@ public class FsCompanyCustomerController extends BaseController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
public TableDataInfo list(FsCompanyCustomer fsCompanyCustomer) {
|
|
public TableDataInfo list(FsCompanyCustomer fsCompanyCustomer) {
|
|
|
- LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
|
- fsCompanyCustomer.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
|
|
- //管理员查看所有数据
|
|
|
|
|
- Long isAdmin = roleMapper.companyUserIsAdmin(fsCompanyCustomer.getCompanyUserId());
|
|
|
|
|
- if (isAdmin != null) {
|
|
|
|
|
- fsCompanyCustomer.setCompanyUserId(null);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// LoginUser loginUser = SecurityUtils.getLoginUser();
|
|
|
|
|
+// fsCompanyCustomer.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
|
|
+// //管理员查看所有数据
|
|
|
|
|
+// Long isAdmin = roleMapper.companyUserIsAdmin(fsCompanyCustomer.getCompanyUserId());
|
|
|
|
|
+// if (isAdmin != null) {
|
|
|
|
|
+// fsCompanyCustomer.setCompanyUserId(null);
|
|
|
|
|
+// }
|
|
|
PageHelper.startPage(fsCompanyCustomer.getPageNum(), fsCompanyCustomer.getPageSize());
|
|
PageHelper.startPage(fsCompanyCustomer.getPageNum(), fsCompanyCustomer.getPageSize());
|
|
|
List<FsCompanyCustomer> list = fsCompanyCustomerService.selectFsCompanyCustomerList(fsCompanyCustomer);
|
|
List<FsCompanyCustomer> list = fsCompanyCustomerService.selectFsCompanyCustomerList(fsCompanyCustomer);
|
|
|
|
|
+ // 遍历集合,对每个对象的 phone 属性进行脱敏赋值
|
|
|
|
|
+ list.forEach(customer -> {
|
|
|
|
|
+ customer.setPhone(maskPhoneMiddleFive(customer.getPhone()));
|
|
|
|
|
+ });
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 手机号中间5位脱敏处理 (例如: 13812345678 -> 138******678)
|
|
|
|
|
+ * @param phone 原始手机号
|
|
|
|
|
+ * @return 脱敏后的手机号
|
|
|
|
|
+ */
|
|
|
|
|
+ public static String maskPhoneMiddleFive(String phone) {
|
|
|
|
|
+ // 判断是否为空,不为空才进行替换处理
|
|
|
|
|
+ if (phone == null || phone.isEmpty()) {
|
|
|
|
|
+ return phone;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 使用正则表达式将中间5位数字替换为 *****
|
|
|
|
|
+ // (\\d{3}) 匹配前3位并作为分组1,\\d{5} 匹配中间5位,(\\d{3}) 匹配后3位并作为分组2
|
|
|
|
|
+ return phone.replaceAll("(\\d{3})\\d{5}(\\d{3})", "$1*****$2");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 导出客户信息
|
|
* 导出客户信息
|
|
|
*/
|
|
*/
|