|
@@ -179,7 +179,7 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sni
|
|
if idw > 20 {
|
|
if idw > 20 {
|
|
idWidthMap[sn_id[1]] = idw + 12
|
|
idWidthMap[sn_id[1]] = idw + 12
|
|
} else {
|
|
} else {
|
|
- idWidthMap[sn_id[1]] = 30
|
|
|
|
|
|
+ idWidthMap[sn_id[1]] = 30.3
|
|
}
|
|
}
|
|
sort.Slice(List, func(i, j int) bool {
|
|
sort.Slice(List, func(i, j int) bool {
|
|
return List[i].T_time < List[j].T_time
|
|
return List[i].T_time < List[j].T_time
|
|
@@ -363,13 +363,13 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sni
|
|
sort.Slice(T_snid_list2, func(i, j int) bool {
|
|
sort.Slice(T_snid_list2, func(i, j int) bool {
|
|
return extractSecondElement(T_snid_list2[i]) < extractSecondElement(T_snid_list2[j])
|
|
return extractSecondElement(T_snid_list2[i]) < extractSecondElement(T_snid_list2[j])
|
|
})
|
|
})
|
|
- chunks := splitData(T_snid_list2, 450, idWidthMap)
|
|
|
|
|
|
+ chunks := splitData(T_snid_list2, 454.5, idWidthMap)
|
|
for _, list := range chunks {
|
|
for _, list := range chunks {
|
|
x = 10
|
|
x = 10
|
|
- w = 120
|
|
|
|
|
|
+ w = 120.7
|
|
lib.RectFillColor(pdf, "时间", 12, x, y, w, 20, 255, 255, 255, lib.AlignCenter, lib.ValignMiddle)
|
|
lib.RectFillColor(pdf, "时间", 12, x, y, w, 20, 255, 255, 255, lib.AlignCenter, lib.ValignMiddle)
|
|
x += w
|
|
x += w
|
|
- w = 30
|
|
|
|
|
|
+ w = 30.3
|
|
for _, v2 := range list {
|
|
for _, v2 := range list {
|
|
sn_id2 := strings.Split(v2, ",")
|
|
sn_id2 := strings.Split(v2, ",")
|
|
id2 := sn_id2[1]
|
|
id2 := sn_id2[1]
|
|
@@ -385,10 +385,10 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sni
|
|
pdf.SetNewY(y, textH)
|
|
pdf.SetNewY(y, textH)
|
|
y = pdf.GetY()
|
|
y = pdf.GetY()
|
|
if y == 20 {
|
|
if y == 20 {
|
|
- w = 120
|
|
|
|
|
|
+ w = 120.7
|
|
lib.RectFillColor(pdf, "时间", 12, x, y, w, 20, 255, 255, 255, lib.AlignCenter, lib.ValignMiddle)
|
|
lib.RectFillColor(pdf, "时间", 12, x, y, w, 20, 255, 255, 255, lib.AlignCenter, lib.ValignMiddle)
|
|
x += w
|
|
x += w
|
|
- w = 30
|
|
|
|
|
|
+ w = 30.3
|
|
for _, v2 := range list {
|
|
for _, v2 := range list {
|
|
sn_id2 := strings.Split(v2, ",")
|
|
sn_id2 := strings.Split(v2, ",")
|
|
id2 := sn_id2[1]
|
|
id2 := sn_id2[1]
|
|
@@ -399,10 +399,10 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sni
|
|
y += 20
|
|
y += 20
|
|
x = 10
|
|
x = 10
|
|
}
|
|
}
|
|
- w = 120
|
|
|
|
|
|
+ w = 120.7
|
|
lib.RectFillColor(pdf, t, 12, x, y, w, 20, 255, 255, 255, lib.AlignCenter, lib.ValignMiddle)
|
|
lib.RectFillColor(pdf, t, 12, x, y, w, 20, 255, 255, 255, lib.AlignCenter, lib.ValignMiddle)
|
|
x += w
|
|
x += w
|
|
- w = 30
|
|
|
|
|
|
+ w = 30.3
|
|
for _, v := range list {
|
|
for _, v := range list {
|
|
sn_id := strings.Split(v, ",")
|
|
sn_id := strings.Split(v, ",")
|
|
id := sn_id[1]
|
|
id := sn_id[1]
|
|
@@ -457,7 +457,7 @@ func splitData(data []string, threshold float64, idWidthMap map[string]float64)
|
|
sn_id := strings.Split(item, ",")
|
|
sn_id := strings.Split(item, ",")
|
|
if len(sn_id) == 2 {
|
|
if len(sn_id) == 2 {
|
|
wd := idWidthMap[sn_id[1]]
|
|
wd := idWidthMap[sn_id[1]]
|
|
- if currentSum+wd > threshold {
|
|
|
|
|
|
+ if currentSum+wd > threshold+0.1 {
|
|
// 当前批次超过阈值,切分
|
|
// 当前批次超过阈值,切分
|
|
result = append(result, currentBatch)
|
|
result = append(result, currentBatch)
|
|
// 重置当前批次和当前总和
|
|
// 重置当前批次和当前总和
|