fix: 回写档口入库码时 t 固定为 0 (#278)

顺运宝把 t 绑成 Java Integer,毫秒时间戳溢出后 19 号回写全部失败。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
chengma
2026-08-19 11:28:18 +08:00
co-authored by Cursor
parent 08a5d8c3d0
commit 417cd73afa
3 changed files with 20 additions and 4 deletions
+5 -1
View File
@@ -795,8 +795,12 @@ func (c *Client) UpdateDetailCode(ctx context.Context, stockID, detailID int64,
return fmt.Errorf("code 不能包含控制字符")
}
}
// t 固定传 "0"。顺运宝把查询参数 t 绑成 Java Integer(上限 2147483647)。
// #250 改成当前毫秒时间戳后,19 号全部回写被拒:msg=Can not parse the
// parameter "1787108752485" to Integer value。不得改回 UnixMilli,也不得
// 改成 Unix 秒——秒目前能进 Integer,2038 年仍会溢出;#234 已用 t=0 通过参数绑定。
_, err := c.do(ctx, http.MethodPost, "/am/stock/detail/updateDetailCode", url.Values{
"t": {strconv.FormatInt(time.Now().UnixMilli(), 10)}, "id": {strconv.FormatInt(stockID, 10)},
"t": {"0"}, "id": {strconv.FormatInt(stockID, 10)},
"detailId": {strconv.FormatInt(detailID, 10)}, "code": {code},
}, nil)
return classifyInnerCodeWriteError(err)