V0 FT记录
This commit is contained in:
parent
75d953272f
commit
c83d2bcb2a
@ -970,7 +970,7 @@ func FTList(r *request.FTList) ([]*model.FTShowList, int64) {
|
|||||||
}
|
}
|
||||||
var ftLists []*model.FTList
|
var ftLists []*model.FTList
|
||||||
var total int64
|
var total int64
|
||||||
global.PostGreSQL.Debug().Where(sql).Order("order_date desc").Find(&ftLists).Count(&total).
|
global.PostGreSQL.Where(sql).Order("order_date desc").Find(&ftLists).Count(&total).
|
||||||
Offset(r.Page * r.PageSize).Limit(r.PageSize).
|
Offset(r.Page * r.PageSize).Limit(r.PageSize).
|
||||||
Preload("FTListStock").Find(&ftLists)
|
Preload("FTListStock").Find(&ftLists)
|
||||||
var ftShowLists []*model.FTShowList
|
var ftShowLists []*model.FTShowList
|
||||||
@ -1267,9 +1267,32 @@ func FTList(r *request.FTList) ([]*model.FTShowList, int64) {
|
|||||||
var quantity float64
|
var quantity float64
|
||||||
var reportProportion string
|
var reportProportion string
|
||||||
|
|
||||||
reportSoftBinQuantityDecimal := decimal.NewFromFloat(hardBinQuantity)
|
var reportHardBinQuantity string
|
||||||
quantity = hardBinQuantity
|
if hardBin == "1" {
|
||||||
reportProportion = reportSoftBinQuantityDecimal.Div(testQuantityDecimal).Round(4).
|
reportHardBinQuantity = finalReport.Bin1
|
||||||
|
} else if hardBin == "2" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin2
|
||||||
|
} else if hardBin == "3" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin3
|
||||||
|
} else if hardBin == "4" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin4
|
||||||
|
} else if hardBin == "5" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin5
|
||||||
|
} else if hardBin == "6" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin6
|
||||||
|
} else if hardBin == "7" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin7
|
||||||
|
} else if hardBin == "8" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin8
|
||||||
|
} else if hardBin == "9" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin9
|
||||||
|
} else if hardBin == "10" {
|
||||||
|
reportHardBinQuantity = finalReport.Bin10
|
||||||
|
}
|
||||||
|
reportSoftBinQuantityDecimal, _ := decimal.NewFromString(reportHardBinQuantity)
|
||||||
|
reportTestQuantityDecimalDecimal, _ := decimal.NewFromString(finalReport.ReportTestQuantity)
|
||||||
|
quantity, _ = reportSoftBinQuantityDecimal.Float64()
|
||||||
|
reportProportion = reportSoftBinQuantityDecimal.Div(reportTestQuantityDecimalDecimal).Round(4).
|
||||||
Mul(decimal.NewFromInt(100)).String() + "%"
|
Mul(decimal.NewFromInt(100)).String() + "%"
|
||||||
|
|
||||||
hardBinFail = append(hardBinFail, &model.ReportBinFail{
|
hardBinFail = append(hardBinFail, &model.ReportBinFail{
|
||||||
@ -1372,7 +1395,7 @@ func FTList(r *request.FTList) ([]*model.FTShowList, int64) {
|
|||||||
Proportion: hardBinQuantityDecimal.Div(testQuantityDecimal).Round(4).
|
Proportion: hardBinQuantityDecimal.Div(testQuantityDecimal).Round(4).
|
||||||
Mul(decimal.NewFromInt(100)).String() + "%",
|
Mul(decimal.NewFromInt(100)).String() + "%",
|
||||||
ReportQuantity: reportHardBinFailMap[hardBin],
|
ReportQuantity: reportHardBinFailMap[hardBin],
|
||||||
ReportProportion: reportSoftBinQuantityDecimal.Div(testQuantityDecimal).Round(4).
|
ReportProportion: reportSoftBinQuantityDecimal.Div(reportTestQuantityDecimal).Round(4).
|
||||||
Mul(decimal.NewFromInt(100)).String() + "%",
|
Mul(decimal.NewFromInt(100)).String() + "%",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user