@@ -1228,7 +1228,10 @@ func CreateProductPlan(c *gin.Context, apictx *ApiSession) (interface{}, error)
if plan.Total == 0 {
return nil, errors.New("生产计划数应不为0")
}
-
+ if plan.TotalPrice == nil {
+ var zero float64 = 0
+ plan.TotalPrice = &zero
+ }
plan.Status = "process" // 进行中
plan.CreateTime = time.Now()
plan.UpdateTime = time.Now()
@@ -98,7 +98,7 @@ func SummarySupplierPlan(c *gin.Context, apictx *ApiSession) (interface{}, error
CreateUser: plan.CreateUser,
Total: plan.Total,
Status: plan.Status,
- TotalPrice: plan.TotalPrice,
+ TotalPrice: *plan.TotalPrice,
CreateTime: plan.CreateTime,
// 选供应商
@@ -22,7 +22,7 @@ type ProductPlan struct {
Status string `bson:"status,omitempty" json:"status"`
//总价
- TotalPrice float64 `bson:"totalPrice,omitempty" json:"totalPrice"`
+ TotalPrice *float64 `bson:"totalPrice,omitempty" json:"totalPrice"`
UpdateTime time.Time `bson:"updteTime,omitempty" json:"updateTime"`