Compare commits

...

19 Commits
main ... dev

Author SHA1 Message Date
c250930722 Merge branch 'jng' into dev 2025-05-28 15:32:06 +08:00
ed7b95d707 Merge branch 'jng' into dev 2025-05-28 15:04:59 +08:00
jhc
5bbf97eaf2 修改引用问题 2025-05-27 10:56:19 +08:00
jhc
c1978c9ee7 修改冲突 2025-05-27 10:49:22 +08:00
jhc
73f269f847 导出文件 上传 oss 2025-05-27 10:46:36 +08:00
60caecc1b9 Merge branch 'jng' into dev 2025-05-27 09:53:45 +08:00
a23504c746 Merge branch 'jng' into dev 2025-05-27 09:41:45 +08:00
d0cf3bb208 Merge branch 'jng' into dev 2025-05-27 09:36:16 +08:00
8d43eaf18d Merge branch 'jng' into dev 2025-05-27 09:15:44 +08:00
8e30f6c984 Merge branch 'jng' into dev 2025-05-26 17:16:54 +08:00
2d0a24100e Merge branch 'jng' into dev 2025-05-26 17:03:15 +08:00
ef50c8626a 解决冲突 2025-05-26 16:32:36 +08:00
db0a50ed33 Merge branch 'jng' into dev 2025-05-26 09:17:47 +08:00
b4c173df5f Merge branch 'jng' into dev 2025-05-26 09:13:22 +08:00
a6919e8396 11 2025-05-23 11:16:03 +08:00
2779dcc5bd 11 2025-05-23 11:06:08 +08:00
8562d64dd5 11 2025-05-23 10:57:29 +08:00
2de0d9dc9b 解决冲突 2025-05-23 10:54:31 +08:00
a357389fac 11 2025-05-22 20:43:47 +08:00
3 changed files with 89 additions and 2 deletions

1
go.mod
View File

@ -5,6 +5,7 @@ go 1.18
replace (
github.com/fonchain_enterprise/utils/aes => ../utils/aes
github.com/fonchain_enterprise/utils/objstorage => ../utils/objstorage
//github.com/fonchain_enterprise/utils/objstorage => ../../tyfon-/utils/objstorage
)
//

View File

@ -32,7 +32,7 @@ func BundleOrderRouter(r *gin.RouterGroup) {
//bundleOrderWebRoute := bundleOrderRoute.Group("web")
{
bundleOrderWebRoute.POST("financial-confirm", bundle.UpdateFinancialConfirmationStatus)
bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfo)
bundleOrderWebRoute.POST("order-export", bundle.ExportOrderInfoOss)
}
bundleOrderAppRoute := bundleOrderRoute.Group("app")

View File

@ -12,6 +12,7 @@ import (
"fonchain-fiee/pkg/service/bundle/common"
"fonchain-fiee/pkg/service/bundle/logic"
bundleModel "fonchain-fiee/pkg/service/bundle/model"
"fonchain-fiee/pkg/service/upload"
"math/big"
"strconv"
"strings"
@ -426,8 +427,93 @@ func ExportOrderInfo(c *gin.Context) {
}
}
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/static", 1)
var exportUrl = strings.Replace(strings.Replace(filePath, ".", fmt.Sprintf("%s://%s", httpType, c.Request.Host), 1), "runtime", "api/fiee/static", 1)
//var exportUrl = fmt.Sprintf("%s%s/%s", httpType, c.Request.Host, dirPath + path)
fmt.Println("exportUrl : ", exportUrl)
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
}
func ExportOrderInfoOss(c *gin.Context) {
var req bundle.OrderRecordsRequest
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
service.Error(c, err)
return
}
res, err := service.BundleProvider.OrderRecordsList(context.Background(), &req)
if err != nil {
service.Error(c, err)
return
}
rows := make([][]interface{}, 0)
for _, orderRecord := range res.OrderRecords {
if orderRecord.CustomerID != "" {
var userID uint64
userID, err = strconv.ParseUint(orderRecord.CustomerID, 10, 64)
if err != nil {
err = nil
continue
}
userInfo, _ := service.AccountFieeProvider.Info(context.Background(), &accountFiee.InfoRequest{
Domain: "app",
ID: userID,
})
if userInfo != nil {
orderRecord.Sex = userInfo.Sex
orderRecord.Nationality = userInfo.Nationality
orderRecord.TelNum = userInfo.TelNum
}
}
status := ""
if orderRecord.Status == bundleModel.OrderSigned {
status = "未支付"
} else if orderRecord.Status == bundleModel.OrderPaid {
status = "已支付"
}
financialConfirmation := ""
if orderRecord.FinancialConfirmation == bundleModel.UnConfirm {
financialConfirmation = "未确认"
} else if orderRecord.FinancialConfirmation == bundleModel.Confirmed {
financialConfirmation = "已确认"
}
rows = append(rows, []interface{}{
orderRecord.OrderNo,
orderRecord.CustomerNum,
orderRecord.CustomerName,
orderRecord.Sex,
orderRecord.TelNum,
orderRecord.Nationality,
orderRecord.BundleName,
orderRecord.SignedTime,
orderRecord.Amount,
orderRecord.Num,
orderRecord.ValueAddBundleAmount,
orderRecord.TotalAmount,
status,
orderRecord.PayTime,
financialConfirmation,
})
}
dirPath := "./runtime"
filePath, err := logic.WriteToExcel(dirPath, rows)
if err != nil {
service.Error(c, err)
return
}
exportUrl, err := upload.PutBos(filePath, "excel", true)
if err != nil {
service.Error(c, err)
return
}
service.Success(c, &bundleModel.ExportResponse{ExportUrl: exportUrl})
}