animeic 2 лет назад
Родитель
Сommit
ee342f0c93
2 измененных файлов с 1 добавлено и 51 удалено
  1. 0 51
      boxcost/api/plan-cost-excel.go
  2. 1 0
      boxcost/api/utils.go

+ 0 - 51
boxcost/api/plan-cost-excel.go

@@ -254,31 +254,6 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 						return err
 					}
 					b.Excel.SetCellValue(b.SheetName, startACell, comp.Name)
-					fmt.Println("startACell:", startACell)
-					fmt.Println("endACell:", endACell)
-					fmt.Println("compName:", comp.Name)
-					// // 供应商组件预算汇总
-					// startLCell := fmt.Sprintf("%s%d", "N", startRow)
-					// endLCell := fmt.Sprintf("%s%d", "N", endRow)
-					// b.Excel.MergeCell(b.SheetName, startLCell, endLCell)
-					// err = b.Excel.SetCellStyle(b.SheetName, startLCell, endLCell, b.AlignCenterStyle)
-					// if err != nil {
-					// 	return err
-					// }
-					// compTotalPrice := fmt.Sprintf("%.2f", totalOrderRealPrice)
-					// b.FormatToEmpty(&compTotalPrice)
-					// b.Excel.SetCellValue(b.SheetName, startLCell, compTotalPrice)
-					// // 供应商组件实际汇总
-					// startOCell := fmt.Sprintf("%s%d", "O", startRow)
-					// endOCell := fmt.Sprintf("%s%d", "O", endRow)
-					// b.Excel.MergeCell(b.SheetName, startOCell, endOCell)
-					// err = b.Excel.SetCellStyle(b.SheetName, startOCell, endOCell, b.AlignCenterStyle)
-					// if err != nil {
-					// 	return err
-					// }
-					// compConfirmTotalPrice := fmt.Sprintf("%.2f", totalConfirmRealPrice)
-					// b.FormatToEmpty(&compConfirmTotalPrice)
-					// b.Excel.SetCellValue(b.SheetName, startLCell, compConfirmTotalPrice)
 
 				}
 
@@ -351,12 +326,6 @@ func (b *PlanCostExcel) drawAllContent() error {
 					b.FormatToEmpty(&matWidth)
 					orderCount := fmt.Sprintf("%d", int(mat.Supplier.OrderCount))
 					b.FormatToEmpty(&orderCount)
-					// orderPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderPrice)
-					// b.FormatToEmpty(&orderPrice)
-
-					// orderRealPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderRealPrice)
-					// b.FormatToEmpty(&orderRealPrice)
-					// b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, orderPrice, orderRealPrice, "")
 
 					// 实际数量
 					confirmCount := fmt.Sprintf("%d", mat.ConfirmCount)
@@ -364,7 +333,6 @@ func (b *PlanCostExcel) drawAllContent() error {
 					// 单价
 					orderPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderPrice)
 					b.FormatToEmpty(&orderPrice)
-					// totalOrderRealPrice += mat.Supplier.OrderRealPrice
 					orderRealPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderRealPrice)
 					b.FormatToEmpty(&orderRealPrice)
 					// 实际金额
@@ -389,11 +357,6 @@ func (b *PlanCostExcel) drawAllContent() error {
 							b.FormatToEmpty(&carftHeigth)
 							carftWidth := fmt.Sprintf("%d", craft.BatchSizeWidth)
 							b.FormatToEmpty(&carftWidth)
-							// carftOrderPrice := fmt.Sprintf("%.2f", craft.Supplier.OrderPrice)
-							// b.FormatToEmpty(&carftOrderPrice)
-							// carftOrderRealPrice := fmt.Sprintf("%.2f", craft.Supplier.OrderRealPrice)
-							// b.FormatToEmpty(&carftOrderRealPrice)
-							// b.drawRow(row, "", "", craft.CraftInfo.Name, craftSupplierName, craft.CraftInfo.Norm, carftHeigth, carftWidth, craft.CraftInfo.Unit, carftOrderCount, carftOrderPrice, carftOrderRealPrice, "")
 
 							// 实际数量
 							confirmCraftCount := fmt.Sprintf("%d", craft.ConfirmCount)
@@ -401,7 +364,6 @@ func (b *PlanCostExcel) drawAllContent() error {
 
 							carftOrderPrice := fmt.Sprintf("%.2f", craft.Supplier.OrderPrice)
 							b.FormatToEmpty(&carftOrderPrice)
-							// totalOrderRealPrice += craft.Supplier.OrderRealPrice
 							carftOrderRealPrice := fmt.Sprintf("%.2f", craft.Supplier.OrderRealPrice)
 							b.FormatToEmpty(&carftOrderRealPrice)
 
@@ -428,19 +390,6 @@ func (b *PlanCostExcel) drawAllContent() error {
 					return err
 				}
 				b.Excel.SetCellValue(b.SheetName, startACell, comp.Name)
-				// // 组件汇总金额
-				// startLCell := fmt.Sprintf("%s%d", "L", startRow)
-				// endLCell := fmt.Sprintf("%s%d", "L", endRow)
-				// b.Excel.MergeCell(b.SheetName, startLCell, endLCell)
-				// err = b.Excel.SetCellStyle(b.SheetName, startLCell, endLCell, b.AlignCenterStyle)
-				// if err != nil {
-				// 	return err
-				// }
-				// compTotalPrice := fmt.Sprintf("%.2f", comp.TotalPrice)
-				// b.FormatToEmpty(&compTotalPrice)
-				// b.Excel.SetCellValue(b.SheetName, startLCell, compTotalPrice)
-				// confirmTotalPlanPrice += totalConfirmRealPrice
-
 			}
 		}
 		// 生产汇总金额

+ 1 - 0
boxcost/api/utils.go

@@ -115,6 +115,7 @@ func getUserById(apictx *ApiSession, id primitive.ObjectID) (*model.UserSmaple,
 // }
 
 // 获取时间跨度的起始终止时间
+// startDate/endDate 2023-01-31
 func getTimeRange(startDate, endDate string) (start, end time.Time) {
 	loc, _ := time.LoadLocation("Local")
 	startDateTime := startDate + " 00:00:00"