sun-pc 7 months ago
parent
commit
3543d95512
2 changed files with 17 additions and 13 deletions
  1. 4 1
      boxcost/api/aadiffupdatetest.http
  2. 13 12
      boxcost/db/repo/repo.go

+ 4 - 1
boxcost/api/aadiffupdatetest.http

@@ -9,6 +9,9 @@ POST http://{{host}}/boxcost/diffUpdatePlanTest HTTP/1.1
 Content-Type: application/json
 Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjI4MjU4OTIsImlkIjoiNjQyYTUyNGY1ZjUwYmM5MDNmOTg2Mzk0Iiwia2V5IjoiYm94Y29zdCIsIm5hbWUiOiLlrZnog5wiLCJvcmlnX2lhdCI6MTcyMjIyMTA5MiwicGFyZW50IjoiNjQyYTUyNGY1ZjUwYmM5MDNmOTg2Mzk0IiwicGhvbmUiOiIxMzQwODU0NzgyMyIsInJvbGUiOiIiLCJzdGF0ZSI6MSwidXNlclR5cGUiOjJ9.Cz7qI3-Vah0io5ZLIFDyVOf8qsqdmbT8WHdprrjbdXw
 
+{
+  
+}
  
 ###
 # 工艺单日志记录测试
@@ -96,7 +99,7 @@ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MjI4MjU4O
 	// CollectionPlanTrack   = "plan-track"
 ###
 # 打印更改差异
-GET http://{{host}}/boxcost/printDiff?query={"targetId":"64aa52935cca777202101884","collection":"product-plan_copy1"} HTTP/1.1
+GET http://{{host}}/boxcost/logs/list?query={"targetId":"64aa52935cca777202101884","collection":"product-plan_copy1"} HTTP/1.1
 Content-Type: application/json
 
 

+ 13 - 12
boxcost/db/repo/repo.go

@@ -152,6 +152,7 @@ func RepoUpdateSetDoc1(ctx *RepoSession, collectName string, idstr string, model
 
 	// 获取模型对应的数据表
 	collection := getModel2Collection(model)
+	fmt.Println(collection)
 
 	uid, _ := primitive.ObjectIDFromHex(idstr)
 
@@ -214,29 +215,29 @@ func getModel2Collection(omodel interface{}) string {
 	if _, ok := omodel.(*dm.PurchaseBill); ok {
 		return CollectionBillPurchase
 	}
-	// if _, ok := omodel.(*dm.ProduceBill); ok {
-	// 	return CollectionBillProduce
-	// }
-
-	// test
 	if _, ok := omodel.(*dm.ProduceBill); ok {
-		return "bill-produce_copy1"
+		return CollectionBillProduce
 	}
 
+	// test
+	// if _, ok := omodel.(*dm.ProduceBill); ok {
+	// 	return "bill-produce_copy1"
+	// }
+
 	if _, ok := omodel.(*dm.ProductBill); ok {
 		return CollectionBillProduct
 	}
 
 	// 计划
-	// if _, ok := omodel.(*dm.ProductPlan); ok {
-	// 	return CollectionProductPlan
-	// }
-
-	// test
 	if _, ok := omodel.(*dm.ProductPlan); ok {
-		return "product-plan_copy1"
+		return CollectionProductPlan
 	}
 
+	// test
+	// if _, ok := omodel.(*dm.ProductPlan); ok {
+	// 	return "product-plan_copy1"
+	// }
+
 	if _, ok := omodel.(*dm.Product); ok {
 		return CollectionProduct
 	}