animeic 1 year ago
parent
commit
ec2aa0674e

+ 9 - 11
boxcost/api/bill-produce-excel.go

@@ -152,7 +152,7 @@ func (b *ProduceBillExcel) drawSubTitles() error {
 		}
 		b.Excel.SetCellValue(b.SheetName, left1Cell, value)
 		// 设置行高
-		b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:I"), 18)})
+		b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:I"))})
 		return nil
 	}
 
@@ -183,7 +183,7 @@ func (b *ProduceBillExcel) drawSubTitles() error {
 		}
 		b.Excel.SetCellValue(b.SheetName, left1Cell, value)
 		// 设置行高
-		b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:L"), 18)})
+		b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:L"))})
 		return nil
 	}
 
@@ -201,7 +201,7 @@ func (b *ProduceBillExcel) drawSubTitles() error {
 			}
 			b.Excel.SetCellValue(b.SheetName, left1Cell, value)
 			// 设置行高
-			b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:F"), 18)})
+			b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:F"))})
 			return nil
 		}
 
@@ -232,7 +232,7 @@ func (b *ProduceBillExcel) drawSubTitles() error {
 			}
 			b.Excel.SetCellValue(b.SheetName, left1Cell, value)
 			// 设置行高
-			b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:H"), 18)})
+			b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:H"))})
 			return nil
 		}
 		if b.Content.IsLam {
@@ -249,7 +249,7 @@ func (b *ProduceBillExcel) drawSubTitles() error {
 				}
 				b.Excel.SetCellValue(b.SheetName, left1Cell, value)
 				// 设置行高
-				b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:F"), 18)})
+				b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:F"))})
 				return nil
 			}
 
@@ -280,7 +280,7 @@ func (b *ProduceBillExcel) drawSubTitles() error {
 				}
 				b.Excel.SetCellValue(b.SheetName, left1Cell, value)
 				// 设置行高
-				b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:I"), 18)})
+				b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{rowIndex: getRowHeight(value, b.getRangeWidth("A:I"))})
 				return nil
 			}
 
@@ -534,16 +534,16 @@ func (b *ProduceBillExcel) drawSupplierRemark() error {
 
 	sendToEndCell := fmt.Sprintf("L%d", b.Row)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:L"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:L"))})
 	if !b.Content.IsPrint {
 		sendToEndCell = fmt.Sprintf("H%d", b.Row)
 		// 设置行高
-		b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:H"), 18)})
+		b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:H"))})
 
 		if b.Content.IsLam {
 			sendToEndCell = fmt.Sprintf("I%d", b.Row)
 			// 设置行高
-			b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:I"), 18)})
+			b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:I"))})
 
 		}
 	}
@@ -627,8 +627,6 @@ func (b *ProduceBillExcel) drawTableSignature() error {
 		}
 	}
 
-	b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
-
 	return nil
 }
 

+ 5 - 8
boxcost/api/bill-product-excel.go

@@ -167,7 +167,7 @@ func (b *ProductBillExcel) drawSubTitles() error {
 	supplierContent := fmt.Sprintf("供应商名称:%s", b.Content.Supplier)
 	drawLeft(b.Row+1, supplierContent)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 1: getRowHeight(supplierContent, b.getRangeWidth("A:F"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 1: getRowHeight(supplierContent, b.getRangeWidth("A:F"))})
 
 	timeformat := b.Content.CreateTime.Local().Format("2006年01月02号 15:04:05")
 	drawRight(b.Row+1, "下单时间:"+timeformat)
@@ -175,7 +175,7 @@ func (b *ProductBillExcel) drawSubTitles() error {
 	//第三行
 	drawLeft(b.Row+2, "产品名称:"+b.Content.ProductName)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 2: getRowHeight("产品名称:"+b.Content.ProductName, b.getRangeWidth("A:F"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 2: getRowHeight("产品名称:"+b.Content.ProductName, b.getRangeWidth("A:F"))})
 	status := ""
 	if b.Content.Status == "complete" {
 		status = "已完成"
@@ -188,7 +188,7 @@ func (b *ProductBillExcel) drawSubTitles() error {
 	// 第四行
 	drawLall(b.Row+3, "包含工序:"+b.Content.CompProduceName)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 3: getRowHeight("包含工序:"+b.Content.CompProduceName, b.getRangeWidth("A:F"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 3: getRowHeight("包含工序:"+b.Content.CompProduceName, b.getRangeWidth("A:F"))})
 
 	return nil
 }
@@ -304,10 +304,9 @@ func (b *ProductBillExcel) drawTableFooter() error {
 	b.Excel.SetCellValue(b.SheetName, sendToStartCell, "送货地址:"+b.Content.SendTo)
 	b.Excel.MergeCell(b.SheetName, supplierStartCell, supplierEndCell)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("送货地址:"+b.Content.SendTo, b.getRangeWidth("A:F"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("送货地址:"+b.Content.SendTo, b.getRangeWidth("A:F"))})
 	b.Excel.SetCellStyle(b.SheetName, supplierStartCell, supplierEndCell, styleLeft)
 	b.Excel.SetCellValue(b.SheetName, supplierStartCell, " 供应商签字:")
-	b.Excel.SetRowHeight(b.SheetName, b.Row, 32)
 
 	return nil
 }
@@ -334,7 +333,7 @@ func (b *ProductBillExcel) drawSupplierRemark() error {
 	b.Excel.SetCellStyle(b.SheetName, sendToStartCell, sendToEndCell, styleLeft)
 	b.Excel.SetCellValue(b.SheetName, sendToStartCell, "供应商备注:"+b.Content.SupplierRemark)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:I"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:I"))})
 	return nil
 
 }
@@ -410,8 +409,6 @@ func (b *ProductBillExcel) drawTableSignature() error {
 		}
 	}
 
-	b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
-
 	return nil
 }
 

+ 6 - 9
boxcost/api/bill-purchase-excel.go

@@ -166,12 +166,12 @@ func (b *PurchaseBillExcel) drawSubTitles() error {
 	timeformat := b.Content.CreateTime.Local().Format("2006年01月02号 15:04:05")
 	drawRight(b.Row+1, "下单时间:"+timeformat)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 1: getRowHeight(supplierContent, b.getRangeWidth("A:G"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 1: getRowHeight(supplierContent, b.getRangeWidth("A:G"))})
 
 	//第三行
 	drawLeft(b.Row+2, "产品名称:"+b.Content.ProductName)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 2: getRowHeight("产品名称:"+b.Content.ProductName, b.getRangeWidth("A:G"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 2: getRowHeight("产品名称:"+b.Content.ProductName, b.getRangeWidth("A:G"))})
 
 	status := ""
 	if b.Content.Status == "complete" {
@@ -186,7 +186,7 @@ func (b *PurchaseBillExcel) drawSubTitles() error {
 	// 第四行
 	drawLall(b.Row+3, "包含工序:"+b.Content.CompProduceName)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 3: getRowHeight("包含工序:"+b.Content.CompProduceName, b.getRangeWidth("A:G"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row + 3: getRowHeight("包含工序:"+b.Content.CompProduceName, b.getRangeWidth("A:G"))})
 
 	return nil
 }
@@ -337,11 +337,10 @@ func (b *PurchaseBillExcel) drawTableFooter() error {
 	b.Excel.SetCellStyle(b.SheetName, sendToStartCell, sendToEndCell, styleLeft)
 	b.Excel.SetCellValue(b.SheetName, sendToStartCell, "送货地址:"+b.Content.SendTo)
 	b.Excel.MergeCell(b.SheetName, supplierStartCell, supplierEndCell)
-	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("送货地址:"+b.Content.SendTo, b.getRangeWidth("A:G"), 18)})
 	b.Excel.SetCellStyle(b.SheetName, supplierStartCell, supplierEndCell, styleLeft)
 	b.Excel.SetCellValue(b.SheetName, supplierStartCell, "供应商签字:")
-	b.Excel.SetRowHeight(b.SheetName, b.Row, 32)
+	// 设置行高
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("送货地址:"+b.Content.SendTo, b.getRangeWidth("A:G"))})
 
 	return nil
 }
@@ -367,7 +366,7 @@ func (b *PurchaseBillExcel) drawSupplierRemark() error {
 	b.Excel.SetCellStyle(b.SheetName, sendToStartCell, sendToEndCell, styleLeft)
 	b.Excel.SetCellValue(b.SheetName, sendToStartCell, "供应商备注:"+b.Content.SupplierRemark)
 	// 设置行高
-	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:J"), 18)})
+	b.RowsHeightArray = append(b.RowsHeightArray, map[int]float64{b.Row: getRowHeight("供应商备注:"+b.Content.SupplierRemark, b.getRangeWidth("A:J"))})
 	return nil
 
 }
@@ -424,8 +423,6 @@ func (b *PurchaseBillExcel) drawTableSignature() error {
 		}
 	}
 
-	b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
-
 	return nil
 }
 

+ 1 - 1
boxcost/api/callback.go

@@ -10,7 +10,7 @@ import (
 )
 
 // https://auth.3dqueen.cloud/login/oauth/authorize?client_id=9f22d6616ae14fe59dc4&redirect_uri=https://www.3dqueen.cloud/box/v1/boxcost/callback&response_type=code&scope=openid&state=STATE
-// 需要在第三方提供商配置回调 https://www.3dqueen.cloud/callback
+// 需要在第三方提供商配置回调 https://auth.3dqueen.cloud/callback
 func callback(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	authConf := apictx.Svc.Conf.Auth
 	pemByte, err := os.ReadFile(authConf.Certificate)