Compare commits
2 Commits
6147878dfe
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 451d869361 | |||
| 08ea153cac |
@@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"tyapi-server/internal/domains/api/dto"
|
"tyapi-server/internal/domains/api/dto"
|
||||||
"tyapi-server/internal/domains/api/services/processors"
|
"tyapi-server/internal/domains/api/services/processors"
|
||||||
@@ -20,6 +21,10 @@ func ProcessIVYZ9363Request(ctx context.Context, params []byte, deps *processors
|
|||||||
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
if err := deps.Validator.ValidateStruct(paramsDto); err != nil {
|
||||||
return nil, errors.Join(processors.ErrInvalidParam, err)
|
return nil, errors.Join(processors.ErrInvalidParam, err)
|
||||||
}
|
}
|
||||||
|
// 新增:身份证一致性校验
|
||||||
|
if strings.EqualFold(strings.TrimSpace(paramsDto.ManIDCard), strings.TrimSpace(paramsDto.WomanIDCard)) {
|
||||||
|
return nil, errors.Join(processors.ErrInvalidParam, errors.New("请正确填写身份信息"))
|
||||||
|
}
|
||||||
|
|
||||||
encryptedManName, err := deps.WestDexService.Encrypt(paramsDto.ManName)
|
encryptedManName, err := deps.WestDexService.Encrypt(paramsDto.ManName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -44,7 +49,7 @@ func ProcessIVYZ9363Request(ctx context.Context, params []byte, deps *processors
|
|||||||
reqData := map[string]interface{}{
|
reqData := map[string]interface{}{
|
||||||
"data": map[string]interface{}{
|
"data": map[string]interface{}{
|
||||||
"name_man": encryptedManName,
|
"name_man": encryptedManName,
|
||||||
"idcard_man": encryptedManIDCard,
|
"idcard_man": encryptedManIDCard,
|
||||||
"name_woman": encryptedWomanName,
|
"name_woman": encryptedWomanName,
|
||||||
"idcard_woman": encryptedWomanIDCard,
|
"idcard_woman": encryptedWomanIDCard,
|
||||||
},
|
},
|
||||||
@@ -60,4 +65,4 @@ func ProcessIVYZ9363Request(ctx context.Context, params []byte, deps *processors
|
|||||||
}
|
}
|
||||||
|
|
||||||
return respBytes, nil
|
return respBytes, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,23 +212,17 @@ func (g *PDFGeneratorRefactored) generatePDF(product *entities.Product, doc *ent
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 在所有接口文档渲染完成后,统一添加二维码和后勤服务说明
|
// 在所有接口文档渲染完成后,统一添加二维码和后勤服务说明
|
||||||
// 使用主产品文档(如果存在),否则使用第一个子产品文档,如果都没有则创建一个空的文档对象
|
// 使用主产品文档(如果存在),否则使用第一个子产品文档
|
||||||
var finalDoc *entities.ProductDocumentation
|
var finalDoc *entities.ProductDocumentation
|
||||||
if doc != nil {
|
if doc != nil {
|
||||||
finalDoc = doc
|
finalDoc = doc
|
||||||
} else if len(subProductDocs) > 0 {
|
} else if len(subProductDocs) > 0 {
|
||||||
finalDoc = subProductDocs[0]
|
finalDoc = subProductDocs[0]
|
||||||
} else {
|
|
||||||
// 如果没有文档,创建一个空的文档对象,用于添加二维码和说明
|
|
||||||
finalDoc = &entities.ProductDocumentation{
|
|
||||||
ProductID: product.ID,
|
|
||||||
RequestMethod: "POST",
|
|
||||||
Version: "1.0",
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 始终添加二维码和后勤服务说明
|
if finalDoc != nil {
|
||||||
pageBuilder.AddAdditionalInfo(pdf, finalDoc, chineseFontAvailable)
|
pageBuilder.AddAdditionalInfo(pdf, finalDoc, chineseFontAvailable)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 普通产品:使用原来的方法(包含二维码和说明)
|
// 普通产品:使用原来的方法(包含二维码和说明)
|
||||||
if doc != nil {
|
if doc != nil {
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 1.3 MiB |
Reference in New Issue
Block a user