jiangshuai
2023-12-28 6ae9a1f35f59d13075ac931558bc38a11b7a6e54
grpc接口关于operation 位置信息数据结构的变动
2个文件已修改
13 ■■■■■ 已修改文件
proto/inventory_order/server.go 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/purchase_wms/server.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
proto/inventory_order/server.go
@@ -55,10 +55,12 @@
        operation.Status = constvar.OperationStatus_Ready
        operation.OperationTypeName = operationType.Name
        operation.OperationTypeId = operationType.Id
        operation.FromLocationID = fromLocation.Id
        operation.ToLocationID = toLocation.Id
        operation.BaseOperationType = constvar.BaseOperationTypeOutgoing
        operation.Source = req.Source
        operation.LocationID = fromLocation.Id
        if req.OperationType == 1 {
            operation.LocationID = toLocation.Id
        }
        or.WorkOrderId = operation.SourceNumber
        or.Number = operation.Number
        operationResp = append(operationResp, &or)
@@ -69,6 +71,8 @@
            var detail models.OperationDetails
            detail.ProductId = product.ProductNumber
            detail.Amount = decimal.NewFromInt(product.Amount)
            detail.FromLocationID = fromLocation.Id
            detail.ToLocationID = toLocation.Id
            details = append(details, &detail)
        }
        operation.Details = details
proto/purchase_wms/server.go
@@ -38,17 +38,18 @@
    if err != nil {
        return nil, err
    }
    operation.ToLocationID = location.Id
    first, err := models.NewLocationSearch().SetType(int(constvar.LocationTypeVendor)).First()
    if err != nil {
        return nil, err
    }
    operation.FromLocationID = first.Id
    operation.LocationID = location.Id
    operation.BaseOperationType = constvar.BaseOperationTypeIncoming
    for _, product := range req.Product {
        var detail models.OperationDetails
        detail.ProductId = product.Id
        detail.Amount = decimal.NewFromInt(product.Amount)
        detail.FromLocationID = first.Id
        detail.ToLocationID = location.Id
        details = append(details, &detail)
    }
    err = models.WithTransaction(func(db *gorm.DB) error {