feat: 任务改用采集采购独立序号 (#172)
This commit is contained in:
@@ -240,8 +240,12 @@ func CreatePurchaseTasksWithOptions(db *sql.DB, actor *model.User, requests []Pu
|
||||
result.Failures = append(result.Failures, TaskCreateError{SybID: request.SybID, Reason: reason})
|
||||
continue
|
||||
}
|
||||
taskID, err := repository.NextTaskID(tx, model.TaskPurchase)
|
||||
if err != nil {
|
||||
return PurchaseTaskResult{}, err
|
||||
}
|
||||
if err := repository.InsertPurchaseTask(tx, model.Task{
|
||||
TaskID: newPurchaseTaskID(), AssignedClient: clientID,
|
||||
TaskID: taskID, AssignedClient: clientID,
|
||||
CreatedByUserID: actor.UserID,
|
||||
ExecutionMode: executionMode, LiveConfirmedBy: confirmedBy, LiveConfirmedAt: confirmedAt,
|
||||
SybID: context.Order.SybID, OrderNo: context.Order.OrderNo,
|
||||
@@ -315,14 +319,6 @@ func validatePurchaseRequest(q repository.Execer, request PurchaseTaskRequest) (
|
||||
return "", context, choice.OptionsJSON, nil
|
||||
}
|
||||
|
||||
func newPurchaseTaskID() string {
|
||||
id := newID()
|
||||
if len(id) > 16 {
|
||||
id = id[:16]
|
||||
}
|
||||
return "PUR-" + id
|
||||
}
|
||||
|
||||
// parsePriceYuanToCent 把网页输入的人民币元精确转成分,不使用浮点数。
|
||||
func ParsePriceYuanToCent(raw string) (int64, error) {
|
||||
raw = strings.TrimSpace(raw)
|
||||
|
||||
Reference in New Issue
Block a user