123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- package api
- import (
- "box-cost/db/model"
- "box-cost/db/repo"
- "fmt"
- "github.com/gin-gonic/gin"
- "go.mongodb.org/mongo-driver/bson"
- "go.mongodb.org/mongo-driver/bson/primitive"
- )
- func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
-
-
-
-
- id, err := primitive.ObjectIDFromHex("")
- if err != nil {
- fmt.Println(err)
- }
- fmt.Println(id.IsZero())
- return nil, nil
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- func RemovePlanSyncBill(c *gin.Context, apictx *ApiSession) (interface{}, error) {
- plans := []*model.ProductPlan{}
- err := repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
- CollectName: repo.CollectionProductPlan,
- Project: []string{"_id"},
- }, &plans)
- if err != nil {
- return nil, err
- }
- planIds := make([]primitive.ObjectID, 0)
- for _, plan := range plans {
- fmt.Println(plan.Id.Hex())
- planIds = append(planIds, plan.Id)
- }
-
-
-
-
-
-
- produces := []*model.ProduceBill{}
- repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
- CollectName: repo.CollectionBillProduce,
- Query: repo.Map{"planId": bson.M{"$nin": planIds}},
- Project: []string{"planId", "serialNumber"},
- }, &produces)
-
-
-
-
-
-
-
-
-
- return produces, nil
- }
|