fix: 合并多件档口入库码回写 (#240)

This commit is contained in:
chengma
2026-08-15 14:27:31 +08:00
parent 5d72141f2f
commit 8e500606c5
10 changed files with 204 additions and 31 deletions
+4 -3
View File
@@ -431,7 +431,8 @@ func TestClient_DetailListByStock_超过100个id报错(t *testing.T) {
}
}
func TestClient_InnerCodeWrite_参数和路径正确且只发送一次(t *testing.T) {
func TestClient_InnerCodeWrite_聚合码参数和路径正确且只发送一次(t *testing.T) {
targetCode := "DK260815A160101,DK260815A160102"
var requests atomic.Int32
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
requests.Add(1)
@@ -443,7 +444,7 @@ func TestClient_InnerCodeWrite_参数和路径正确且只发送一次(t *testin
}
case "/am/stock/detail/updateDetailCode":
query := r.URL.Query()
if query.Get("t") != "0" || query.Get("id") != "11" || query.Get("detailId") != "22" || query.Get("code") != "DK-001" {
if query.Get("t") != "0" || query.Get("id") != "11" || query.Get("detailId") != "22" || query.Get("code") != targetCode {
t.Errorf("update query=%v", query)
}
default:
@@ -459,7 +460,7 @@ func TestClient_InnerCodeWrite_参数和路径正确且只发送一次(t *testin
if err := client.DeleteInnerCode(context.Background(), 22); err != nil {
t.Fatal(err)
}
if err := client.UpdateDetailCode(context.Background(), 11, 22, " DK-001 "); err != nil {
if err := client.UpdateDetailCode(context.Background(), 11, 22, " "+targetCode+" "); err != nil {
t.Fatal(err)
}
if requests.Load() != 2 {