Bläddra i källkod

refactor(system): 移除行政许可、行政处罚和营业执照信息类中的数据脱敏方法

- 删除了 CrmAdministrativeLicense、CrmAdministrativePenalty 和 CrmBusinessLicenseInformation 类中的数据脱敏方法
- 移除了用于身份证号和电话号码脱敏的正则表达式模式
- 保留了姓名脱敏的方法
林仔 1 år sedan
förälder
incheckning
a2b46c073e

+ 0 - 15
zksy-system/src/main/java/com/zksy/system/basicData/domain/CrmAdministrativeLicense.java

@@ -206,21 +206,6 @@ public class CrmAdministrativeLicense extends Model<CrmAdministrativeLicense> {
     @ExcelImport(value = "备注")
     @ExcelExport(value = "备注")
     private String remarks;
-
-    // 缓存编译后的正则表达式以提高性能
-    private static final Pattern ID_CARD_MASK_PATTERN = Pattern.compile("(?<=\\d{6})\\d(?=\\d{4})");
-    private static final Pattern PHONE_NUMBER_MASK_PATTERN = Pattern.compile("(\\d{3})\\d{4}(\\d{4})");
-
-    /**
-     * 法定代表人证件号码脱敏:显示前6位和后4位,中间用*代替
-     */
-    public String getLegalRepresentativeIdNumber() {
-        if (this.legalRepresentativeIdNumber == null || this.legalRepresentativeIdNumber.length() <= 10) {
-            return this.legalRepresentativeIdNumber;
-        }
-        return ID_CARD_MASK_PATTERN.matcher(this.legalRepresentativeIdNumber).replaceAll("*");
-    }
-
     /**
      * 法定代表人姓名脱敏:只保留姓氏,名字部分用*代替
      */

+ 0 - 9
zksy-system/src/main/java/com/zksy/system/basicData/domain/CrmAdministrativePenalty.java

@@ -31,8 +31,6 @@ public class CrmAdministrativePenalty extends Model<CrmAdministrativePenalty> {
 
 private static final long serialVersionUID=1L;
 
-    private static final Pattern ID_CARD_MASK_PATTERN = Pattern.compile("(?<=\\d{6})\\d(?=\\d{4})");
-
 @ApiModelProperty(value = "主键")
     /** 主键 */
         @TableId(type = IdType.AUTO)
@@ -92,13 +90,6 @@ private static final long serialVersionUID=1L;
                 @ExcelImport(value = "法定代表人证件号码")
                 @ExcelExport(value = "法定代表人证件号码")
     private String legalRepresentativeIdNumber;
-    // 身份证号脱敏:显示前6位和后4位,中间用*代替
-    public String getLegalRepresentativeIdNumber() {
-        if (this.legalRepresentativeIdNumber == null || this.legalRepresentativeIdNumber.length() <= 10) {
-            return this.legalRepresentativeIdNumber;
-        }
-        return ID_CARD_MASK_PATTERN.matcher(this.legalRepresentativeIdNumber).replaceAll("*");
-    }
 
 @ApiModelProperty(value = "证件类型")
     /** 证件类型 */

+ 0 - 33
zksy-system/src/main/java/com/zksy/system/basicData/domain/CrmBusinessLicenseInformation.java

@@ -176,32 +176,6 @@ private static final long serialVersionUID=1L;
                 @ExcelExport(value = "注销时间")
     private String cancellationTime;
 
-    private static final Pattern ID_CARD_MASK_PATTERN = Pattern.compile("(?<=\\d{6})\\d(?=\\d{4})");
-    private static final Pattern PHONE_NUMBER_MASK_PATTERN = Pattern.compile("(\\d{3})\\d{4}(\\d{4})");
-
-    // 身份证号脱敏:显示前6位和后4位,中间用*代替
-    public String getLegalRepresentativeId() {
-        if (this.legalRepresentativeId == null || this.legalRepresentativeId.length() <= 10) {
-            return this.legalRepresentativeId;
-        }
-        return ID_CARD_MASK_PATTERN.matcher(this.legalRepresentativeId).replaceAll("*");
-    }
-
-    // 电话号码脱敏:显示前3位和后4位,中间用*代替
-    public String getContactPhone() {
-        if (this.contactPhone == null || this.contactPhone.length() < 7) {
-            return this.contactPhone;
-        }
-        return PHONE_NUMBER_MASK_PATTERN.matcher(this.contactPhone).replaceAll("$1****$2");
-    }
-    // 企业联系电话
-    public String getEnterprisePhone() {
-        if (this.enterprisePhone == null || this.enterprisePhone.length() < 7) {
-            return this.enterprisePhone;
-        }
-        return PHONE_NUMBER_MASK_PATTERN.matcher(this.enterprisePhone).replaceAll("$1****$2");
-    }
-
     // 姓名脱敏:只保留姓氏,名字部分用*代替
     public String getLegalRepresentative() {
         if (this.legalRepresentative == null || this.legalRepresentative.length() <= 1) {
@@ -210,11 +184,4 @@ private static final long serialVersionUID=1L;
         return this.legalRepresentative.substring(0, 1) + "*";
     }
 
-    public String getContactName() {
-        if (this.contactName == null || this.contactName.length() <= 1) {
-            return this.contactName;
-        }
-        return this.contactName.substring(0, 1) + "*";
-    }
-
         }