sun-pc-linux hai 7 meses
pai
achega
d8d4a74893
Modificáronse 3 ficheiros con 35 adicións e 38 borrados
  1. 35 35
      boxcost/api/plan.go
  2. 0 1
      boxcost/go.mod
  3. 0 2
      boxcost/go.sum

+ 35 - 35
boxcost/api/plan.go

@@ -232,41 +232,41 @@ func updateBilltoStage(c *gin.Context, planId primitive.ObjectID, idStatges map[
 }
 
 // 更新供应商确定数量与plan中stage项的同步
-func updateStageCount(c *gin.Context, planId primitive.ObjectID, idCounts map[string]int, apictx *ApiSession) (interface{}, error) {
-	if len(idCounts) == 0 {
-		return true, nil
-	}
-
-	plan := model.ProductPlan{}
-	found, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
-		CollectName: repo.CollectionProductPlan,
-		Query:       repo.Map{"_id": planId},
-	}, &plan)
-	if !found || err != nil {
-		return nil, errors.New("数据未找到")
-	}
-	for _, comp := range plan.Pack.Components {
-		if comp.Id == "" || len(comp.Stages) == 0 {
-			continue
-		}
-		for _, stage := range comp.Stages {
-			if v, ok := idCounts[stage.Id]; ok {
-				stage.ConfirmCount = v
-			}
-		}
-
-	}
-	plan.UpdateTime = time.Now()
-	userId, _ := primitive.ObjectIDFromHex(apictx.User.ID)
-	user, _ := getUserById(apictx, userId)
-	// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionProductPlan, planId.Hex(), &plan)
-	return repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionProductPlan, planId.Hex(), &plan, &repo.RecordLogReq{
-		Path:     c.Request.URL.Path,
-		UserInfo: user,
-		TargetId: planId.Hex(),
-		Type:     "sync",
-	})
-}
+// func updateStageCount(c *gin.Context, planId primitive.ObjectID, idCounts map[string]int, apictx *ApiSession) (interface{}, error) {
+// 	if len(idCounts) == 0 {
+// 		return true, nil
+// 	}
+
+// 	plan := model.ProductPlan{}
+// 	found, err := repo.RepoSeachDoc(apictx.CreateRepoCtx(), &repo.DocSearchOptions{
+// 		CollectName: repo.CollectionProductPlan,
+// 		Query:       repo.Map{"_id": planId},
+// 	}, &plan)
+// 	if !found || err != nil {
+// 		return nil, errors.New("数据未找到")
+// 	}
+// 	for _, comp := range plan.Pack.Components {
+// 		if comp.Id == "" || len(comp.Stages) == 0 {
+// 			continue
+// 		}
+// 		for _, stage := range comp.Stages {
+// 			if v, ok := idCounts[stage.Id]; ok {
+// 				stage.ConfirmCount = v
+// 			}
+// 		}
+
+// 	}
+// 	plan.UpdateTime = time.Now()
+// 	userId, _ := primitive.ObjectIDFromHex(apictx.User.ID)
+// 	user, _ := getUserById(apictx, userId)
+// 	// return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionProductPlan, planId.Hex(), &plan)
+// 	return repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), repo.CollectionProductPlan, planId.Hex(), &plan, &repo.RecordLogReq{
+// 		Path:     c.Request.URL.Path,
+// 		UserInfo: user,
+// 		TargetId: planId.Hex(),
+// 		Type:     "sync",
+// 	})
+// }
 
 type SupplierPlanCost struct {
 	*model.ProductPlan

+ 0 - 1
boxcost/go.mod

@@ -12,7 +12,6 @@ require (
 	github.com/go-redis/redis/v8 v8.11.5
 	github.com/huaweicloud/huaweicloud-sdk-go-obs v3.21.12+incompatible
 	github.com/natefinch/lumberjack v2.0.0+incompatible
-	github.com/sergi/go-diff v1.3.1
 	github.com/spf13/viper v1.9.0
 	github.com/xuri/excelize/v2 v2.6.1
 	go.mongodb.org/mongo-driver v1.11.1

+ 0 - 2
boxcost/go.sum

@@ -1120,8 +1120,6 @@ github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo=
 github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
-github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
-github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
 github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 github.com/shopspring/decimal v0.0.0-20200227202807-02e2044944cc/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
 github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=