feat: 采购价格仅展示选定规格 (#113)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user