fix
zhangqian
2024-06-25 deecdeec560af558b5a3e745b1540332959009ec
fix
1个文件已修改
21 ■■■■■ 已修改文件
service/operation.go 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/operation.go
@@ -291,6 +291,7 @@
            Cost:             v.Cost,
            SalePrice:        v.SalePrice,
        })
    }
        if len(outputDetails) > 0 {
            opTypeId, err := GetTargetOperationTypeIdByOperation(originOperation, constvar.BaseOperationTypeOutgoing)
            if err != nil {
@@ -310,7 +311,6 @@
            }
            if err := models.NewOperationSearch().SetOrm(tx).Create(operation); err != nil {
                return err
            }
        }
    }
    return nil
@@ -365,23 +365,7 @@
                Remark:         v.Remark,
            })
        }
        //if locAmount, aok := mapLocAmount[strconv.Itoa(v.ToLocationID)+v.ProductId]; aok {
        //    locAmount.Amount = v.Amount
        //    if err := models.NewLocationProductAmountSearch().SetOrm(tx).SetID(locAmount.Id).Save(locAmount); err != nil {
        //        return err
        //    }
        //} else {
        //    if err := models.NewLocationProductAmountSearch().SetOrm(tx).Create(&models.LocationProductAmount{
        //        LocationId:        v.ToLocationID,
        //        ProductCategoryID: v.Product.CategoryId,
        //        ProductId:         v.ProductId,
        //        Amount:            v.Amount,
        //        CreateDate:        time.Now().Format("2006-01-02 15:04:05"),
        //    }); err != nil {
        //        return err
        //    }
        //}
    }
        if len(inputDetails) > 0 {
            opTypeId, err := GetTargetOperationTypeIdByOperation(originOperation, constvar.BaseOperationTypeIncoming)
            if err != nil {
@@ -420,7 +404,6 @@
            }
            if err := models.NewOperationSearch().SetOrm(tx).Create(operation); err != nil {
                return err
            }
        }
    }
    return nil