Browse Source

添加isSend状态

animeic 2 years ago
parent
commit
7e031fea8e
2 changed files with 15 additions and 2 deletions
  1. 13 1
      boxcost/api/plan.go
  2. 2 1
      boxcost/api/supplier.go

+ 13 - 1
boxcost/api/plan.go

@@ -988,6 +988,7 @@ func GetProductPlan(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	}
 
 	billStates := map[string]string{}
+	billIsSend := map[string]bool{}
 	if plan.Pack != nil && plan.Pack.Components != nil {
 		for _, comp := range plan.Pack.Components {
 			if comp.Stages != nil {
@@ -1008,9 +1009,19 @@ func GetProductPlan(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 							collectName = repo.CollectionBillProduct
 						}
 
-						ok, state := repo.RepoSeachDocMap(apictx.CreateRepoCtx(), &repo.DocSearchOptions{CollectName: collectName, Query: repo.Map{"_id": stage.BillId}, Project: []string{"status"}})
+						ok, state := repo.RepoSeachDocMap(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
+							CollectName: collectName,
+							Query:       repo.Map{"_id": stage.BillId},
+							Project:     []string{"status", "isSend", "serialNumber", "remark"}})
 						if ok {
 							billStates[stage.BillId] = state["status"].(string)
+							if v, ok := state["isSend"]; ok {
+								billIsSend[stage.BillId] = v.(bool)
+
+							} else {
+								billIsSend[stage.BillId] = false
+							}
+
 						}
 					}
 
@@ -1022,6 +1033,7 @@ func GetProductPlan(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	return map[string]interface{}{
 		"plan":       plan,
 		"billStates": billStates,
+		"billIsSend": billIsSend,
 	}, nil
 }
 

+ 2 - 1
boxcost/api/supplier.go

@@ -45,7 +45,8 @@ func Supplier(r *GinRouter) {
 
 // 把订单分配给供应商
 // purchase produce product
-// /supplier/bill/list?id=xxx&type=purchase
+// id为订单id
+// /supplier/bill/alloc?id=xxx&type=purchase
 func SupplierBillAlloc(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	billId, _ := primitive.ObjectIDFromHex(c.Query("id"))
 	if billId.IsZero() {