feat: 采购价格仅展示选定规格 (#113)

This commit is contained in:
chengma
2026-08-10 17:56:03 +08:00
parent b509b15f23
commit 66565d50cc
6 changed files with 93 additions and 33 deletions
+10 -2
View File
@@ -157,8 +157,10 @@ func mappingIsValid(context repository.SybOrderContext) bool {
// PurchaseTaskRequest 是一条采购任务的人工确认输入。价格单位固定为人民币分。
type PurchaseTaskRequest struct {
SybID string
MaxPriceCent int64
SybID string
MaxPriceCent int64
MappingOptionKey string
ContextVersion string
}
const LivePurchaseConfirmation = "创建未付款订单"
@@ -308,6 +310,12 @@ func validatePurchaseRequest(q repository.Execer, request PurchaseTaskRequest) (
if choice == nil {
return "已保存的 PDD 规格已失效,请重新匹配", context, "", nil
}
if request.MappingOptionKey != "" && request.MappingOptionKey != context.MappingOptionKey {
return "规格映射已变化,请刷新页面后重新确认", context, "", nil
}
if request.ContextVersion != "" && request.ContextVersion != mappingContextVersion(*context) {
return "商品或规格数据已变化,请刷新页面后重新确认", context, "", nil
}
if context.Order.Quantity <= 0 {
return "采购数量必须大于 0", context, "", nil
}