animeic 2 年之前
父節點
當前提交
091f1f34eb

+ 4 - 4
boxcost/api/bill-process-excel.go

@@ -180,7 +180,7 @@ func (b *ProcessBillExcel) drawTableContent() error {
 		confirmCount := "-"
 		realAmount := "-"
 		// 预算金额
-		budgetAmount := fmt.Sprintf("%.2f", b.Content.BudgetAmount)
+		budgetAmount := fmt.Sprintf("%.3f", b.Content.BudgetAmount)
 		b.FormatToEmpty(&budgetAmount)
 
 		// 实际完成数
@@ -188,12 +188,12 @@ func (b *ProcessBillExcel) drawTableContent() error {
 		b.FormatToEmpty(&confirmCount)
 
 		// 实际金额
-		realAmount = fmt.Sprintf("%.2f", b.Content.RealAmount)
+		realAmount = fmt.Sprintf("%.3f", b.Content.RealAmount)
 		b.FormatToEmpty(&realAmount)
 
 		// a采购项目 b规格 c下单数量 d单位 e完成数量 f单价 g预算金额 h实际金额 i交货时间 j备注
 		orderCount := fmt.Sprintf("%d", ps.OrderCount)
-		price := fmt.Sprintf("%.2f", ps.Price)
+		price := fmt.Sprintf("%.3f", ps.Price)
 		b.FormatToEmpty(&price)
 		DrawRow(row, ps.Name, ps.Norm, orderCount, ps.Unit, confirmCount, price, budgetAmount, realAmount, deliveryTime, ps.Remark)
 		row++
@@ -347,7 +347,7 @@ func NewProcessBill(f *excelize.File) *ProcessBillExcel {
 }
 
 func (b *ProcessBillExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 

+ 2 - 2
boxcost/api/bill-produce-excel.go

@@ -194,7 +194,7 @@ func (b *ProduceBillExcel) drawTableContent() error {
 		for _, produce := range produces {
 			confirmCount := "-"
 			price := produce.Price
-			priceStr := fmt.Sprintf("%.2f", price)
+			priceStr := fmt.Sprintf("%.3f", price)
 			b.FormatToEmpty(&priceStr)
 			// 预算金额
 			orderRealPrice := "-"
@@ -358,7 +358,7 @@ func NewProduceBill(f *excelize.File) *ProduceBillExcel {
 }
 
 func (b *ProduceBillExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 

+ 5 - 5
boxcost/api/bill-purchase-excel.go

@@ -230,11 +230,11 @@ func (b *PurchaseBillExcel) drawTableContent() error {
 
 			confirmCount := "-"
 			realAmount := "-"
-			price := fmt.Sprintf("%.2f", paper.Price)
-			price2 := fmt.Sprintf("%.2f", paper.Price2)
+			price := fmt.Sprintf("%.3f", paper.Price)
+			price2 := fmt.Sprintf("%.3f", paper.Price2)
 
 			// 预算金额
-			budgetAmount := fmt.Sprintf("%.2f", b.Content.BudgetAmount)
+			budgetAmount := fmt.Sprintf("%.3f", b.Content.BudgetAmount)
 			b.FormatToEmpty(&budgetAmount)
 
 			if b.Content.Status == "complete" {
@@ -243,7 +243,7 @@ func (b *PurchaseBillExcel) drawTableContent() error {
 				b.FormatToEmpty(&confirmCount)
 
 				// 实际金额
-				realAmount = fmt.Sprintf("%.2f", b.Content.RealAmount)
+				realAmount = fmt.Sprintf("%.3f", b.Content.RealAmount)
 				b.FormatToEmpty(&realAmount)
 			}
 
@@ -391,7 +391,7 @@ func NewPurchaseBill(f *excelize.File) *PurchaseBillExcel {
 }
 
 func (b *PurchaseBillExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 

+ 1 - 0
boxcost/api/iFace.go

@@ -17,4 +17,5 @@ type IRPurchBill interface {
 	SetContent(*model.PurchaseBill)
 	SetOffset(int)
 	SetTitle(string)
+	SetRow(int)
 }

+ 21 - 21
boxcost/api/plan-cost-excel.go

@@ -181,15 +181,15 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 							confirmCount := fmt.Sprintf("%d", mat.ConfirmCount)
 							b.FormatToEmpty(&confirmCount)
 							// 单价
-							orderPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderPrice)
+							orderPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderPrice)
 							b.FormatToEmpty(&orderPrice)
 							// 预算金额
-							orderRealPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderRealPrice)
+							orderRealPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderRealPrice)
 							perOrderRealPrice += mat.Supplier.OrderRealPrice
 							b.FormatToEmpty(&orderRealPrice)
 							// 实际金额
 							perRealPrice += mat.RealPrice
-							realPrice := fmt.Sprintf("%.2f", mat.RealPrice)
+							realPrice := fmt.Sprintf("%.3f", mat.RealPrice)
 							b.FormatToEmpty(&realPrice)
 							b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, confirmCount, orderPrice, orderRealPrice, realPrice)
 
@@ -227,7 +227,7 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 									// 实际数量
 									confirmCount := fmt.Sprintf("%d", craft.ConfirmCount)
 									b.FormatToEmpty(&confirmCount)
-									price := fmt.Sprintf("%.2f", craft.Supplier.OrderPrice)
+									price := fmt.Sprintf("%.3f", craft.Supplier.OrderPrice)
 									b.FormatToEmpty(&price)
 
 									// 预算金额
@@ -347,15 +347,15 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 				row++
 				if len(b.Content.Process) > 0 {
 					for _, ps := range b.Content.Process {
-						orderCount := fmt.Sprintf("%.2f", ps.Supplier.OrderCount)
+						orderCount := fmt.Sprintf("%.3f", ps.Supplier.OrderCount)
 						confirmCount := fmt.Sprintf("%d", ps.ConfirmCount)
-						price := fmt.Sprintf("%.2f", ps.Supplier.OrderPrice)
+						price := fmt.Sprintf("%.3f", ps.Supplier.OrderPrice)
 						b.FormatToEmpty(&price)
 						totalOrderRealPrice += ps.Supplier.OrderRealPrice
 						totalRealPrice += ps.RealPrice
-						orderRealPrice := fmt.Sprintf("%.2f", ps.Supplier.OrderRealPrice)
+						orderRealPrice := fmt.Sprintf("%.3f", ps.Supplier.OrderRealPrice)
 						b.FormatToEmpty(&orderRealPrice)
-						realPrice := fmt.Sprintf("%.2f", ps.RealPrice)
+						realPrice := fmt.Sprintf("%.3f", ps.RealPrice)
 						supplierName := ""
 						if ps.Supplier.SupplierInfo != nil {
 							supplierName = ps.Supplier.SupplierInfo.Name
@@ -394,13 +394,13 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 
 	// 生产预算汇总
 	b.Excel.SetCellStyle(b.SheetName, LCell, LCell, b.AlignCenterStyle)
-	planOrderRealPrice := fmt.Sprintf("%.2f", totalOrderRealPrice)
+	planOrderRealPrice := fmt.Sprintf("%.3f", totalOrderRealPrice)
 	b.FormatToEmpty(&planOrderRealPrice)
 	b.Excel.SetCellValue(b.SheetName, LCell, planOrderRealPrice)
 
 	// 生产实际汇总
 	b.Excel.SetCellStyle(b.SheetName, MCell, MCell, b.AlignCenterStyle)
-	planRealPrice := fmt.Sprintf("%.2f", totalRealPrice)
+	planRealPrice := fmt.Sprintf("%.3f", totalRealPrice)
 	b.FormatToEmpty(&planRealPrice)
 	b.Excel.SetCellValue(b.SheetName, MCell, planRealPrice)
 
@@ -460,15 +460,15 @@ func (b *PlanCostExcel) drawAllContent() error {
 					confirmCount := fmt.Sprintf("%d", mat.ConfirmCount)
 					b.FormatToEmpty(&confirmCount)
 					// 单价
-					orderPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderPrice)
+					orderPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderPrice)
 					b.FormatToEmpty(&orderPrice)
 					// 预算金额
-					orderRealPrice := fmt.Sprintf("%.2f", mat.Supplier.OrderRealPrice)
+					orderRealPrice := fmt.Sprintf("%.3f", mat.Supplier.OrderRealPrice)
 					perOrderRealPrice += mat.Supplier.OrderRealPrice
 					b.FormatToEmpty(&orderRealPrice)
 					// 实际金额
 					perRealPrice += mat.RealPrice
-					realPrice := fmt.Sprintf("%.2f", mat.RealPrice)
+					realPrice := fmt.Sprintf("%.3f", mat.RealPrice)
 					b.FormatToEmpty(&realPrice)
 					b.drawRow(row, "", mat.MatInfo.Name, "", supplierName, mat.MatInfo.Norm, matHeigth, matWidth, mat.MatInfo.Unit, orderCount, confirmCount, orderPrice, orderRealPrice, realPrice)
 
@@ -496,7 +496,7 @@ func (b *PlanCostExcel) drawAllContent() error {
 							// 实际数量
 							confirmCount := fmt.Sprintf("%d", craft.ConfirmCount)
 							b.FormatToEmpty(&confirmCount)
-							price := fmt.Sprintf("%.2f", craft.Supplier.OrderPrice)
+							price := fmt.Sprintf("%.3f", craft.Supplier.OrderPrice)
 							b.FormatToEmpty(&price)
 
 							// 预算金额
@@ -597,15 +597,15 @@ func (b *PlanCostExcel) drawAllContent() error {
 		row++
 		if len(b.Content.Process) > 0 {
 			for _, ps := range b.Content.Process {
-				orderCount := fmt.Sprintf("%.2f", ps.Supplier.OrderCount)
+				orderCount := fmt.Sprintf("%.3f", ps.Supplier.OrderCount)
 				confirmCount := fmt.Sprintf("%d", ps.ConfirmCount)
-				price := fmt.Sprintf("%.2f", ps.Supplier.OrderPrice)
+				price := fmt.Sprintf("%.3f", ps.Supplier.OrderPrice)
 				b.FormatToEmpty(&price)
 				totalOrderRealPrice += ps.Supplier.OrderRealPrice
 				totalRealPrice += ps.RealPrice
-				orderRealPrice := fmt.Sprintf("%.2f", ps.Supplier.OrderRealPrice)
+				orderRealPrice := fmt.Sprintf("%.3f", ps.Supplier.OrderRealPrice)
 				b.FormatToEmpty(&orderRealPrice)
-				realPrice := fmt.Sprintf("%.2f", ps.RealPrice)
+				realPrice := fmt.Sprintf("%.3f", ps.RealPrice)
 				supplierName := ""
 				if ps.Supplier.SupplierInfo != nil {
 					supplierName = ps.Supplier.SupplierInfo.Name
@@ -639,13 +639,13 @@ func (b *PlanCostExcel) drawAllContent() error {
 
 	// 生产预算汇总
 	b.Excel.SetCellStyle(b.SheetName, LCell, LCell, b.AlignCenterStyle)
-	planOrderRealPrice := fmt.Sprintf("%.2f", totalOrderRealPrice)
+	planOrderRealPrice := fmt.Sprintf("%.3f", totalOrderRealPrice)
 	b.FormatToEmpty(&planOrderRealPrice)
 	b.Excel.SetCellValue(b.SheetName, LCell, planOrderRealPrice)
 
 	// 生产实际汇总
 	b.Excel.SetCellStyle(b.SheetName, MCell, MCell, b.AlignCenterStyle)
-	planRealPrice := fmt.Sprintf("%.2f", totalRealPrice)
+	planRealPrice := fmt.Sprintf("%.3f", totalRealPrice)
 	b.FormatToEmpty(&planRealPrice)
 	b.Excel.SetCellValue(b.SheetName, MCell, planRealPrice)
 
@@ -693,7 +693,7 @@ func NewPlanCostExcel(f *excelize.File) *PlanCostExcel {
 }
 
 func (b *PlanCostExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 

+ 8 - 37
boxcost/api/report-process-excel.go

@@ -181,7 +181,7 @@ func (b *ReportProcessExcel) drawTableContent() error {
 		confirmCount := "-"
 		realAmount := "-"
 		// 预算金额
-		budgetAmount := fmt.Sprintf("%.2f", b.Content.BudgetAmount)
+		budgetAmount := fmt.Sprintf("%.3f", b.Content.BudgetAmount)
 		b.FormatToEmpty(&budgetAmount)
 
 		// 实际完成数
@@ -189,12 +189,12 @@ func (b *ReportProcessExcel) drawTableContent() error {
 		b.FormatToEmpty(&confirmCount)
 
 		// 实际金额
-		realAmount = fmt.Sprintf("%.2f", b.Content.RealAmount)
+		realAmount = fmt.Sprintf("%.3f", b.Content.RealAmount)
 		b.FormatToEmpty(&realAmount)
 
 		// a采购项目 b规格 c下单数量 d单位 e完成数量 f单价 g预算金额 h实际金额 i交货时间 j备注
 		orderCount := fmt.Sprintf("%d", ps.OrderCount)
-		price := fmt.Sprintf("%.2f", ps.Price)
+		price := fmt.Sprintf("%.3f", ps.Price)
 		b.FormatToEmpty(&price)
 		DrawRow(row, ps.Name, ps.Norm, orderCount, ps.Unit, confirmCount, price, budgetAmount, realAmount, deliveryTime, ps.Remark)
 		row++
@@ -206,38 +206,6 @@ func (b *ReportProcessExcel) drawTableContent() error {
 	return nil
 }
 
-func (b *ReportProcessExcel) drawTableFooter() error {
-	left1Cell := fmt.Sprintf("A%d", b.Row)
-	border := []excelize.Border{
-		{Type: "top", Style: 1, Color: "000000"},
-		{Type: "left", Style: 1, Color: "000000"},
-		{Type: "right", Style: 1, Color: "000000"},
-		{Type: "bottom", Style: 1, Color: "000000"},
-	}
-	styleLeft, _ := b.Excel.NewStyle(&excelize.Style{
-		Alignment: &excelize.Alignment{Horizontal: "left", Vertical: "center"},
-		Border:    border,
-	})
-
-	b.Excel.SetCellStyle(b.SheetName, left1Cell, left1Cell, styleLeft)
-	b.Excel.SetCellValue(b.SheetName, left1Cell, "送货地址:")
-
-	addCel := fmt.Sprintf("B%d", b.Row)
-
-	b.Excel.MergeCell(b.SheetName, addCel, fmt.Sprintf("E%d", b.Row))
-	b.Excel.SetCellStyle(b.SheetName, addCel, fmt.Sprintf("E%d", b.Row), styleLeft)
-	b.Excel.SetCellValue(b.SheetName, addCel, b.Content.SendTo)
-
-	sureCel := fmt.Sprintf("F%d", b.Row)
-	b.Excel.MergeCell(b.SheetName, sureCel, fmt.Sprintf("J%d", b.Row))
-	b.Excel.SetCellStyle(b.SheetName, sureCel, fmt.Sprintf("J%d", b.Row), styleLeft)
-	b.Excel.SetCellValue(b.SheetName, sureCel, "供应商签字:")
-
-	b.Excel.SetRowHeight(b.SheetName, b.Row, 30)
-
-	return nil
-}
-
 func (b *ReportProcessExcel) drawRemark() error {
 	// 填备注
 	b.Row++
@@ -263,7 +231,6 @@ func (b *ReportProcessExcel) Draws() {
 	b.drawSubTitles()
 	b.drawTableTitle()
 	b.drawTableContent()
-	b.drawTableFooter()
 	b.drawRemark()
 }
 
@@ -296,7 +263,7 @@ func NewReportProcessBill(f *excelize.File) *ReportProcessExcel {
 }
 
 func (b *ReportProcessExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 
@@ -318,3 +285,7 @@ func (b *ReportProcessExcel) SetOffset(offset int) {
 	b.Offset = offset
 
 }
+func (b *ReportProcessExcel) SetRow(row int) {
+	b.Row = row
+
+}

+ 2 - 2
boxcost/api/report-produce-excel.go

@@ -199,7 +199,7 @@ func (b *ReportProduceExcel) drawTableContent() error {
 			realAmount := "-"
 			price := produce.Price
 
-			priceStr := fmt.Sprintf("%.2f", price)
+			priceStr := fmt.Sprintf("%.3f", price)
 			b.FormatToEmpty(&priceStr)
 
 			// 预算金额
@@ -289,7 +289,7 @@ func NewReportProduceExcel(f *excelize.File) *ReportProduceExcel {
 }
 
 func (b *ReportProduceExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 }

+ 11 - 5
boxcost/api/report-purchase-excel.go

@@ -32,6 +32,7 @@ type ReportPurchaseExcel struct {
 func (b *ReportPurchaseExcel) drawTitle() error {
 	marginLeft := excelize.PageMarginLeft(0.15)
 	b.Excel.SetPageMargins(b.SheetName, marginLeft)
+
 	tileIndex := b.Offset + 1
 	startCell := fmt.Sprintf("A%d", tileIndex)
 	err := b.Excel.MergeCell(b.SheetName, startCell, fmt.Sprintf("L%d", tileIndex))
@@ -231,11 +232,11 @@ func (b *ReportPurchaseExcel) drawTableContent() error {
 
 			confirmCount := "-"
 			realAmount := "-"
-			price := fmt.Sprintf("%.2f", paper.Price)
-			price2 := fmt.Sprintf("%.2f", paper.Price2)
+			price := fmt.Sprintf("%.3f", paper.Price)
+			price2 := fmt.Sprintf("%.3f", paper.Price2)
 
 			// 预算金额
-			budgetAmount := fmt.Sprintf("%.2f", b.Content.BudgetAmount)
+			budgetAmount := fmt.Sprintf("%.3f", b.Content.BudgetAmount)
 			b.FormatToEmpty(&budgetAmount)
 			b.BudgetCount += b.Content.BudgetAmount
 
@@ -244,7 +245,7 @@ func (b *ReportPurchaseExcel) drawTableContent() error {
 			b.FormatToEmpty(&confirmCount)
 
 			// 实际金额
-			realAmount = fmt.Sprintf("%.2f", b.Content.RealAmount)
+			realAmount = fmt.Sprintf("%.3f", b.Content.RealAmount)
 			b.FormatToEmpty(&realAmount)
 			b.RealCount += b.Content.RealAmount
 
@@ -296,7 +297,7 @@ func NewReportPurchaseExcel(f *excelize.File) *ReportPurchaseExcel {
 }
 
 func (b *ReportPurchaseExcel) FormatToEmpty(str *string) {
-	if *str == "0" || *str == "0.00" {
+	if *str == "0" || *str == "0.000" {
 		*str = ""
 	}
 
@@ -319,3 +320,8 @@ func (b *ReportPurchaseExcel) SetTitle(title string) {
 	b.Title = title
 
 }
+
+func (b *ReportPurchaseExcel) SetRow(row int) {
+	b.Row = row
+
+}

+ 28 - 15
boxcost/api/report.go

@@ -105,7 +105,7 @@ func ReportProduceDownload(c *gin.Context, apictx *ApiSession) (interface{}, err
 	budgetCountCell := fmt.Sprintf("%s%d", "I", row)
 	budgetCountStr := ""
 	if realCount > 0 {
-		budgetCountStr = fmt.Sprintf("%.2f", budgetCount)
+		budgetCountStr = fmt.Sprintf("%.3f", budgetCount)
 	}
 	f.SetCellValue(sheetName, budgetCountCell, budgetCountStr)
 	f.SetCellStyle(sheetName, budgetCountCell, budgetCountCell, alignCenterStyle)
@@ -115,7 +115,7 @@ func ReportProduceDownload(c *gin.Context, apictx *ApiSession) (interface{}, err
 
 	realCountStr := ""
 	if realCount > 0 {
-		realCountStr = fmt.Sprintf("%.2f", realCount)
+		realCountStr = fmt.Sprintf("%.3f", realCount)
 	}
 	f.SetCellValue(sheetName, RealCountCell, realCountStr)
 	f.SetCellStyle(sheetName, RealCountCell, RealCountCell, alignCenterStyle)
@@ -159,23 +159,36 @@ func ReportPurchaseDownload(c *gin.Context, apictx *ApiSession) (interface{}, er
 		Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
 		Border:    border,
 	})
-	offset := 0
+	// offset := 0
 	companyName := getCompanyName(apictx)
 	var budgetCount float64 = 0
 	var realCount float64 = 0
 	var row int = 0
 
 	for _, purchase := range purchases {
-		purchaseExcel := NewReportPurchaseExcel(f)
-		purchaseExcel.Content = &purchase
-		purchaseExcel.Title = fmt.Sprintf("%s原材料采购单", companyName)
-		//设置对应的数据
-		purchaseExcel.Offset = offset
-		purchaseExcel.Draws()
-		budgetCount += purchaseExcel.BudgetCount
-		realCount += purchaseExcel.RealCount
-		offset += 15
-		row = purchaseExcel.Row
+		var reportBill IRPurchBill
+		// if purchase.Process != nil {
+		// 	reportBill = NewReportProcessBill(f)
+
+		// }
+		if len(purchase.Paper) > 0 {
+			reportBill = NewReportPurchaseExcel(f)
+		}
+		reportBill.SetContent(&purchase)
+		reportBill.SetTitle(fmt.Sprintf("%s原材料采购单", companyName))
+		reportBill.Draws()
+		// budgetCount += reportBill.
+
+		// purchaseExcel := NewReportPurchaseExcel(f)
+		// purchaseExcel.Content = &purchase
+		// purchaseExcel.Title = fmt.Sprintf("%s原材料采购单", companyName)
+		// //设置对应的数据
+		// purchaseExcel.Offset = offset
+		// purchaseExcel.Draws()
+		budgetCount += purchase.BudgetAmount
+		realCount += purchase.RealAmount
+		// offset += 15
+		// row = purchaseExcel.Row
 	}
 	row++
 	startCell := fmt.Sprintf("%s%d", "A", row)
@@ -188,7 +201,7 @@ func ReportPurchaseDownload(c *gin.Context, apictx *ApiSession) (interface{}, er
 	budgetCountCell := fmt.Sprintf("%s%d", "I", row)
 	budgetCountStr := ""
 	if realCount > 0 {
-		budgetCountStr = fmt.Sprintf("%.2f", budgetCount)
+		budgetCountStr = fmt.Sprintf("%.3f", budgetCount)
 	}
 	f.SetCellValue(sheetName, budgetCountCell, budgetCountStr)
 	f.SetCellStyle(sheetName, budgetCountCell, budgetCountCell, alignCenterStyle)
@@ -198,7 +211,7 @@ func ReportPurchaseDownload(c *gin.Context, apictx *ApiSession) (interface{}, er
 
 	realCountStr := ""
 	if realCount > 0 {
-		realCountStr = fmt.Sprintf("%.2f", realCount)
+		realCountStr = fmt.Sprintf("%.3f", realCount)
 	}
 	f.SetCellValue(sheetName, RealCountCell, realCountStr)
 	f.SetCellStyle(sheetName, RealCountCell, RealCountCell, alignCenterStyle)

+ 1 - 1
boxcost/db/db.go

@@ -35,7 +35,7 @@ func (db *MongoDB) GetOrCreateDatabase(name string) *mongo.Database {
 }
 
 func NewMongoDB(bus *comm.NatsBus) *MongoDB {
-	inst, err := bus.NewMongoDBFromConfig("box-mongo")
+	inst, err := bus.NewMongoDBFromConfigDev("box-mongo")
 	if err != nil {
 		panic(err)
 	}

+ 1 - 1
boxcost/db/model/bill.go

@@ -79,7 +79,7 @@ type PurchaseBill struct {
 	RealAmount float64 `bson:"realAmount,omitempty" json:"realAmount"`
 
 	// 预算金额
-	BudgetAmount float64 `bson:"budgetAmount,omitempty" json:"realAmbudgetAmountount"`
+	BudgetAmount float64 `bson:"budgetAmount,omitempty" json:"budgetAmount"`
 
 	//确认收货数量
 	ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`

+ 1 - 1
boxcost/db/redis.go

@@ -6,7 +6,7 @@ import (
 )
 
 func NewRedisClient(bus *comm.NatsBus) *redis.Client {
-	client, err := bus.NewRedisFromConfig("box-redis")
+	client, err := bus.NewRedisFromConfigDev("box-redis")
 	if err != nil {
 		return nil
 	}