Bladeren bron

更新

master
huangjiajun 1 maand geleden
bovenliggende
commit
8b36769df9
4 gewijzigde bestanden met toevoegingen van 18 en 2 verwijderingen
  1. +1
    -1
      app/hdl/hdl_settle_center.go
  2. +2
    -0
      app/md/md_settle_center.go
  3. +14
    -0
      app/svc/svc_settle_center.go
  4. +1
    -1
      go.mod

+ 1
- 1
app/hdl/hdl_settle_center.go Bestand weergeven

@@ -203,7 +203,7 @@ func SettleCenterSettleFileDown(c *gin.Context) {
pdf.Text(left, 230, "日期:")

// 保存PDF文件
pdfName := num + ".pdf"
pdfName := medium.CompanyName + "(" + strings.ReplaceAll(date, "-", "") + ")结算单.pdf"
err := pdf.OutputFileAndClose(path + "/" + pdfName)
if err != nil {
fmt.Println(err)


+ 2
- 0
app/md/md_settle_center.go Bestand weergeven

@@ -64,6 +64,7 @@ type SettleCenterDataData struct {
State string `json:"state" example:"结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)"`
Label string `json:"label"`
SettleFile string `json:"settle_file" example:"结算单"`
DownUrl string `json:"down_url"`
}

type SettleCenterDataDetailRes struct {
@@ -86,6 +87,7 @@ type SettleCenterDataDetail struct {
OtherIncome string `json:"other_income" example:"其他调整"`
PayState string `json:"pay_state" example:"结算单支付状态(0:未开始 1:待审核发票 2:发票审核中 3:发票审核拒绝 4:付款中 5:已付款)"`
State string `json:"state" example:"结算单状态(0:未开始 1:核算中 2:待签订 3:完成签订)"`
DownUrl string `json:"down_url"`
}
type Invoice struct {
Type string `json:"type"`


+ 14
- 0
app/svc/svc_settle_center.go Bestand weergeven

@@ -19,6 +19,12 @@ func SettleCenterList(c *gin.Context, req md.SettleCenterDataReq) md.SettleCente
MediumList, total, _ := NewMediumSettlementDb.FindMediumSettlementList(c.GetString("mid"), utils.IntToStr(user.MediumId), "", "", "", req.StartTime, req.EndTime, utils.StrToInt(req.Page), utils.StrToInt(req.Limit))
data := make([]md.SettleCenterDataData, 0)
if len(MediumList) > 0 {
NewUserAppDomainDb := implement.NewUserAppDomainDb(db.Db)
domain, _ := NewUserAppDomainDb.GetUserAppDomainByPlatform(utils.StrToInt(c.GetString("mid")), "medium")
host := c.Request.Host
if domain != nil {
host = domain.Domain
}
for _, v := range MediumList {
var tmp = md.SettleCenterDataData{
Id: utils.IntToStr(v.Id),
@@ -32,6 +38,7 @@ func SettleCenterList(c *gin.Context, req md.SettleCenterDataReq) md.SettleCente
Label: "预估",
SettleFile: v.SettleFile,
}
tmp.DownUrl = "http://" + host + "/api/settle/file/down?id=" + utils.IntToStr(v.Id)
if v.EndDate != "" && v.EndDate != "0000-00-00" {
if v.EndDate != v.StartDate {
tmp.TimeStr += "~" + v.EndDate
@@ -88,6 +95,13 @@ func SettleCenterDetail(c *gin.Context, req md.CommDetailReq) md.SettleCenterDat
tmp.TimeStr += "~" + data.EndDate
}
}
NewUserAppDomainDb := implement.NewUserAppDomainDb(db.Db)
domain, _ := NewUserAppDomainDb.GetUserAppDomainByPlatform(utils.StrToInt(c.GetString("mid")), "medium")
host := c.Request.Host
if domain != nil {
host = domain.Domain
}
tmp.DownUrl = "http://" + host + "/api/settle/file/down?id=" + utils.IntToStr(data.Id)
res := md.SettleCenterDataDetailRes{
Data: tmp,
InvoiceCate: md.InvoiceCate,


+ 1
- 1
go.mod Bestand weergeven

@@ -6,7 +6,7 @@ go 1.18

//
require (
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20241030025944-2a0971f8eb9d
code.fnuoos.com/zhimeng/model.git v0.0.3-0.20241030071009-67f1ca108f52
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5
github.com/boombuler/barcode v1.0.1
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5


Laden…
Annuleren
Opslaan