| | |
| | | "wms/constvar" |
| | | "wms/extend/code" |
| | | "wms/extend/util" |
| | | "wms/middleware" |
| | | "wms/models" |
| | | "wms/pkg/logx" |
| | | "wms/pkg/mysqlx" |
| | |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | |
| | | userInfo := middleware.GetUserInfo(c) |
| | | params.CreatedBy = userInfo.Username |
| | | params.Status = constvar.OperationStatus_Ready |
| | | //params.Number = strconv.FormatInt(time.Now().Unix(), 10) |
| | | params.BaseOperationType = operationType.BaseOperationType |
| | |
| | | mapLocAmount[strconv.Itoa(v.LocationId)+v.ProductId] = v |
| | | } |
| | | } |
| | | userInfo := middleware.GetUserInfo(c) |
| | | |
| | | err = models.WithTransaction(func(tx *gorm.DB) error { |
| | | if err := models.NewOperationSearch().SetOrm(tx).SetID(id).Update(&models.Operation{Status: constvar.OperationStatus_Finish, AuditDate: time.Now().Format("2006-01-02 15:04:05")}); err != nil { |
| | | if err := models.NewOperationSearch().SetOrm(tx).SetID(id).Update(&models.Operation{ |
| | | Status: constvar.OperationStatus_Finish, |
| | | CheckedBy: userInfo.Username, |
| | | CheckedAt: time.Now(), |
| | | AuditDate: time.Now().Format("2006-01-02 15:04:05")}); err != nil { |
| | | return err |
| | | } |
| | | if err := AddMoveHistory([]*models.Operation{operation}, tx); err != nil { |
| | |
| | | Comment: operation.Comment, |
| | | BaseOperationType: constvar.BaseOperationTypeInternal, |
| | | Details: details, |
| | | CheckedAt: time.Now(), |
| | | CheckedBy: userInfo.Username, |
| | | }).Error; err != nil { |
| | | return err |
| | | } |
| | |
| | | util.ResponseFormat(c, code.RequestError, err.Error()) |
| | | return |
| | | } |
| | | |
| | | //修改其他系统订单状态 |
| | | if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { |
| | | if operation.Source != "" { |