animeic 2 years ago
parent
commit
6a0d22e966
3 changed files with 22 additions and 21 deletions
  1. 0 1
      boxcost/api/bill-product.go
  2. 20 18
      boxcost/api/plan.go
  3. 2 2
      boxcost/db/model/pack.go

+ 0 - 1
boxcost/api/bill-product.go

@@ -254,7 +254,6 @@ func DownProductBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	}
 
 	f := excelize.NewFile()
-	// Create a new sheet.
 	index := f.NewSheet("Sheet1")
 	f.SetActiveSheet(index)
 	f.SetDefaultFont("宋体")

+ 20 - 18
boxcost/api/plan.go

@@ -115,30 +115,32 @@ type SupplierPlanCost struct {
 // 		return nil, errors.New("该组件数据不存在")
 // 	}
 // 	f := excelize.NewFile()
-// 	// Create a new sheet.
 // 	index := f.NewSheet("Sheet1")
 // 	f.SetActiveSheet(index)
 // 	f.SetDefaultFont("宋体")
 
 // 	companyName := getCompanyName(apictx)
 
-// offset := 0
-// for _, mat := range curComp.Stages {
-// 	// 采购单
-// 	_purchaseId := mat.BillId
-// 	purchaseId, err := primitive.ObjectIDFromHex(_purchaseId)
-// 	if err == nil {
-// 		purchase := model.PurchaseBill{}
-// 		found, _ := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
-// 			CollectName: repo.CollectionBillPurchase,
-// 			Query:       repo.Map{"_id": purchaseId},
-// 		}, &purchase)
-// 		fmt.Println(purchase)
-// 		if found {
-// 			var billExcel IPurchBill
-// if purchase.Process != nil {
-// 	billExcel = NewProcessBill(f)
-// }
+// 	offset := 0
+// 	for _, stage := range curComp.Stages {
+// 		_billId := stage.BillId
+// 		billId, _ := primitive.ObjectIDFromHex(_billId)
+// 		if !billId.IsZero(){
+// 			// 采购单
+// 			if stage.Type == 1
+// 		}
+// 		if err == nil {
+// 			purchase := model.PurchaseBill{}
+// 			found, _ := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
+// 				CollectName: repo.CollectionBillPurchase,
+// 				Query:       repo.Map{"_id": purchaseId},
+// 			}, &purchase)
+// 			fmt.Println(purchase)
+// 			if found {
+// 				var billExcel IPurchBill
+// 				if purchase.Process != nil {
+// 					billExcel = NewProcessBill(f)
+// 				}
 
 // 				if len(purchase.Paper) > 0 {
 // 					billExcel = NewPurchaseBill(f)

+ 2 - 2
boxcost/db/model/pack.go

@@ -77,7 +77,7 @@ type ComponentStage struct {
 	Norm       string    `bson:"norm,omitempty" json:"norm"`         // 规格
 	CreateTime time.Time `bson:"createTime,omitempty" json:"createTime"`
 	UpdateTime time.Time `bson:"updateTime,omitempty" json:"updateTime"`
-	Type       int       `bson:"type,omitempty" json:"type"`     //1-材料 2-供应 3-成品
-	Group      string    `bson:"group,omitempty" json:"group"`   //工序合标记,相同MatGroup的数据合并成一个单据
+	Type       int       `bson:"type,omitempty" json:"type"`     //1-材料 2-工艺 3-成品
+	Group      string    `bson:"group,omitempty" json:"group"`   //工序合标记,相同Group的数据合并成一个单据
 	BillId     string    `bson:"billId,omitempty" json:"billId"` //订单Id
 }