Merge branch 'jng-0924' into dev

This commit is contained in:
JNG 2025-09-28 14:41:31 +08:00
commit c153b9b8eb

View File

@ -24,6 +24,32 @@ func GetReconciliationList(c *gin.Context) {
service.Error(c, err) service.Error(c, err)
return return
} }
res := &bundle.GetReconciliationListResp{}
// Step 1: 如果有姓名/电话筛选,先查用户列表
if req.UserName != "" {
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
BlurNameTel: req.UserName,
Domain: "app",
})
if err != nil {
service.Error(c, err)
return
}
if len(userListResp.UserList) == 0 {
// 没查到用户,直接返回空结果
res.Page = req.Page
res.PageSize = req.PageSize
res.Total = 0
service.Success(c, res)
return
}
// 提取用户ID列表
for _, u := range userListResp.UserList {
req.UserIDS = append(req.UserIDS, u.Id)
}
}
detail, detailErr := service.BundleProvider.GetReconciliationList(context.Background(), &req) detail, detailErr := service.BundleProvider.GetReconciliationList(context.Background(), &req)
if detailErr != nil { if detailErr != nil {
service.Error(c, detailErr) service.Error(c, detailErr)
@ -63,6 +89,31 @@ func GetReconciliationListDownload(c *gin.Context) {
service.Error(c, err) service.Error(c, err)
return return
} }
res := &bundle.GetReconciliationListResp{}
if req.UserName != "" {
userListResp, err := service.AccountFieeProvider.UserList(context.Background(), &accountFiee.UserListRequest{
BlurNameTel: req.UserName,
Domain: "app",
})
if err != nil {
service.Error(c, err)
return
}
if len(userListResp.UserList) == 0 {
// 没查到用户,直接返回空结果
res.Page = req.Page
res.PageSize = req.PageSize
res.Total = 0
service.Success(c, res)
return
}
// 提取用户ID列表
for _, u := range userListResp.UserList {
req.UserIDS = append(req.UserIDS, u.Id)
}
}
detail, detailErr := service.BundleProvider.GetReconciliationList(context.Background(), &req) detail, detailErr := service.BundleProvider.GetReconciliationList(context.Background(), &req)
if detailErr != nil { if detailErr != nil {
service.Error(c, detailErr) service.Error(c, detailErr)
@ -306,7 +357,7 @@ func AutoCreateUserAndOrder(c *gin.Context) {
) )
// 当前 未将 签名 写入合同中 todo 金额和有效时间待修改 // 当前 未将 签名 写入合同中 todo 金额和有效时间待修改
contract := "https://e-cdn.fontree.cn/fonchain-main/prod/file/saas/contract/template-25032801.pdf" contract := "https://e-cdn.fontree.cn/fonchain-main/prod/file/saas/contract/template-25032801.pdf"
expirationDay = t.AddDate(10, 0, 0).Format("2006-01-02") expirationDay = t.AddDate(1, 0, 0).Format("2006-01-02")
signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay) signContract, signContractErr := logic.SignContractV2(userReq.UserNum, contract, TotalPrice, expirationDay)
if signContractErr != nil { if signContractErr != nil {
service.Error(c, signContractErr) service.Error(c, signContractErr)