|
@@ -161,6 +161,10 @@ func (c *TaskDataController) TaskData_List() {
|
|
Time_end := c.GetString("Time_end")
|
|
Time_end := c.GetString("Time_end")
|
|
T_sn := c.GetString("T_sn")
|
|
T_sn := c.GetString("T_sn")
|
|
T_id := c.GetString("T_id")
|
|
T_id := c.GetString("T_id")
|
|
|
|
+ T_layout_no := c.GetString("T_layout_no") // 替换之前的T_id
|
|
|
|
+ if len(T_layout_no) > 0 {
|
|
|
|
+ T_id = T_layout_no
|
|
|
|
+ }
|
|
|
|
|
|
T_task_id := c.GetString("T_task_id")
|
|
T_task_id := c.GetString("T_task_id")
|
|
Task_r, is := Task.Read_Task(T_task_id)
|
|
Task_r, is := Task.Read_Task(T_task_id)
|
|
@@ -223,6 +227,10 @@ func (c *TaskDataController) UserTaskData_List() {
|
|
Time_end := c.GetString("Time_end")
|
|
Time_end := c.GetString("Time_end")
|
|
T_sn := c.GetString("T_sn")
|
|
T_sn := c.GetString("T_sn")
|
|
T_id := c.GetString("T_id")
|
|
T_id := c.GetString("T_id")
|
|
|
|
+ T_layout_no := c.GetString("T_layout_no") // 替换之前的T_id
|
|
|
|
+ if len(T_layout_no) > 0 {
|
|
|
|
+ T_id = T_layout_no
|
|
|
|
+ }
|
|
|
|
|
|
T_task_id := c.GetString("T_task_id")
|
|
T_task_id := c.GetString("T_task_id")
|
|
Task_r, is := Task.Read_Task(T_task_id)
|
|
Task_r, is := Task.Read_Task(T_task_id)
|
|
@@ -1096,7 +1104,7 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sn,
|
|
y += 30
|
|
y += 30
|
|
|
|
|
|
var textH float64 = 20 // if text height is 25px.
|
|
var textH float64 = 20 // if text height is 25px.
|
|
- if y > 790 {
|
|
|
|
|
|
+ if y >= 790 {
|
|
addStampImage(pdf, 455, y-150)
|
|
addStampImage(pdf, 455, y-150)
|
|
pdf.AddPage()
|
|
pdf.AddPage()
|
|
y = 30
|
|
y = 30
|
|
@@ -1237,13 +1245,13 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sn,
|
|
y = 20
|
|
y = 20
|
|
}
|
|
}
|
|
|
|
|
|
- var StampImageX float64
|
|
|
|
|
|
+ StampImageX := x
|
|
for j, t := range timeList2 {
|
|
for j, t := range timeList2 {
|
|
if j > 0 {
|
|
if j > 0 {
|
|
y += 20
|
|
y += 20
|
|
}
|
|
}
|
|
- x = 10
|
|
|
|
- if y > 790 {
|
|
|
|
|
|
+
|
|
|
|
+ if y >= 790 {
|
|
addStampImage(pdf, StampImageX-130, y-130)
|
|
addStampImage(pdf, StampImageX-130, y-130)
|
|
pdf.AddPage()
|
|
pdf.AddPage()
|
|
y = pdf.GetY()
|
|
y = pdf.GetY()
|
|
@@ -1260,6 +1268,7 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sn,
|
|
y += 20
|
|
y += 20
|
|
x = 10
|
|
x = 10
|
|
}
|
|
}
|
|
|
|
+ x = 10
|
|
if y == 20 {
|
|
if y == 20 {
|
|
w = 120.7
|
|
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)
|
|
@@ -1339,6 +1348,12 @@ func (c *TaskDataController) TaskData_Pdf(Time_start, Time_end, T_task_id, T_sn,
|
|
}
|
|
}
|
|
func addStampImage(pdf *gopdf.GoPdf, x, y float64) {
|
|
func addStampImage(pdf *gopdf.GoPdf, x, y float64) {
|
|
imagePath := "./static/commonSeal.jpg"
|
|
imagePath := "./static/commonSeal.jpg"
|
|
|
|
+ if x < 10 {
|
|
|
|
+ x = 10
|
|
|
|
+ }
|
|
|
|
+ if y < 20 {
|
|
|
|
+ y = 20
|
|
|
|
+ }
|
|
err := pdf.Image(imagePath, x, y, &gopdf.Rect{W: 123, H: 128.6})
|
|
err := pdf.Image(imagePath, x, y, &gopdf.Rect{W: 123, H: 128.6})
|
|
if err != nil {
|
|
if err != nil {
|
|
log.Print(err.Error())
|
|
log.Print(err.Error())
|