|
@@ -122,6 +122,7 @@ func UpdateExcel(client *mongo.Client, plans []*model.ProductPlan) {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ fmt.Println(tbills)
|
|
|
|
|
|
// 如果tbills为空,说明该部件没有订单
|
|
|
if len(tbills) == 0 {
|
|
@@ -223,6 +224,39 @@ func UpdateCell(planCompStatus []map[string]string) {
|
|
|
}
|
|
|
excelIndex := tmpfile.GetActiveSheetIndex()
|
|
|
sheetName := tmpfile.GetSheetName(excelIndex)
|
|
|
+ // 定义样式
|
|
|
+ style, err := tmpfile.NewStyle(&excelize.Style{
|
|
|
+ Border: []excelize.Border{
|
|
|
+ {
|
|
|
+ Type: "left",
|
|
|
+ Color: "FF000000",
|
|
|
+ Style: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Type: "right",
|
|
|
+ Color: "FF000000",
|
|
|
+ Style: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Type: "top",
|
|
|
+ Color: "FF000000",
|
|
|
+ Style: 1,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Type: "bottom",
|
|
|
+ Color: "FF000000",
|
|
|
+ Style: 1,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ Fill: excelize.Fill{
|
|
|
+ Type: "pattern",
|
|
|
+ Pattern: 1, // 1 表示实心填充
|
|
|
+ Color: []string{CELL_BACKGROUND},
|
|
|
+ },
|
|
|
+ })
|
|
|
+ if err != nil {
|
|
|
+ log.Fatal(err)
|
|
|
+ }
|
|
|
|
|
|
for _, compStatus := range planCompStatus {
|
|
|
// fmt.Println("-----------------------------------------------")
|
|
@@ -237,41 +271,6 @@ func UpdateCell(planCompStatus []map[string]string) {
|
|
|
// 设置背景
|
|
|
if csv == CELL_BACKGROUND {
|
|
|
// 设置单元格的值
|
|
|
-
|
|
|
- // 定义样式
|
|
|
- style, err := tmpfile.NewStyle(&excelize.Style{
|
|
|
- Border: []excelize.Border{
|
|
|
- {
|
|
|
- Type: "left",
|
|
|
- Color: "FF000000",
|
|
|
- Style: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- Type: "right",
|
|
|
- Color: "FF000000",
|
|
|
- Style: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- Type: "top",
|
|
|
- Color: "FF000000",
|
|
|
- Style: 1,
|
|
|
- },
|
|
|
- {
|
|
|
- Type: "bottom",
|
|
|
- Color: "FF000000",
|
|
|
- Style: 1,
|
|
|
- },
|
|
|
- },
|
|
|
- Fill: excelize.Fill{
|
|
|
- Type: "pattern",
|
|
|
- Pattern: 1, // 1 表示实心填充
|
|
|
- Color: []string{CELL_BACKGROUND},
|
|
|
- },
|
|
|
- })
|
|
|
- if err != nil {
|
|
|
- log.Fatal(err)
|
|
|
- }
|
|
|
-
|
|
|
err = tmpfile.SetCellStyle(sheetName, cell, cell, style)
|
|
|
if err != nil {
|
|
|
log.Fatal(err)
|