fix(planting-service): 合同PDF显示完整手机号和身份证号

- 移除 PDF 生成时对手机号和身份证号的脱敏处理
- 表单字段模式和坐标定位模式都直接使用原始值
- 删除 maskIdCard() 和 maskPhone() 脱敏方法
- 签订合同需要显示完整信息

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-25 18:55:55 -08:00
parent 285465827d
commit 1e15b820b4
1 changed files with 4 additions and 21 deletions

View File

@ -139,8 +139,8 @@ export class PdfGeneratorService {
const fieldMappings: Array<{ name: string; value: string }> = [
{ name: FORM_FIELDS.CONTRACT_NO, value: data.contractNo },
{ name: FORM_FIELDS.USER_NAME, value: data.userRealName || '未认证' },
{ name: FORM_FIELDS.USER_ID_CARD, value: this.maskIdCard(data.userIdCard) },
{ name: FORM_FIELDS.USER_PHONE, value: this.maskPhone(data.userPhone) },
{ name: FORM_FIELDS.USER_ID_CARD, value: data.userIdCard || '未认证' },
{ name: FORM_FIELDS.USER_PHONE, value: data.userPhone || '未认证' },
{ name: FORM_FIELDS.TREE_COUNT, value: data.treeCount.toString() },
{ name: FORM_FIELDS.SIGN_YEAR, value: year },
{ name: FORM_FIELDS.SIGN_MONTH, value: month },
@ -197,7 +197,7 @@ export class PdfGeneratorService {
color: textColor,
});
page2.drawText(this.maskIdCard(data.userIdCard), {
page2.drawText(data.userIdCard || '未认证', {
x: 130,
y: 557,
size: fontSize,
@ -205,7 +205,7 @@ export class PdfGeneratorService {
color: textColor,
});
page2.drawText(this.maskPhone(data.userPhone), {
page2.drawText(data.userPhone || '未认证', {
x: 130,
y: 531,
size: fontSize,
@ -358,21 +358,4 @@ export class PdfGeneratorService {
return pdfBuffer;
}
/**
*
*/
private maskIdCard(idCard: string | undefined): string {
if (!idCard) return '****';
if (idCard.length < 6) return '****';
return idCard.slice(0, 6) + '********' + idCard.slice(-4);
}
/**
*
*/
private maskPhone(phone: string | undefined): string {
if (!phone) return '****';
if (phone.length < 7) return '****';
return phone.slice(0, 3) + '****' + phone.slice(-4);
}
}