啊鑫
18 小时以前 ed05efdc17aab076146b134ebe105b6382f221d7
MES.Service/service/BasicData/MesDeliveryNoteBarcodeManager.cs
@@ -1,5 +1,4 @@
using AngleSharp.Dom;
using MES.Service.DB;
using MES.Service.DB;
using MES.Service.Dto.webApi;
using MES.Service.Modes;
using SqlSugar;
@@ -23,9 +22,10 @@
                    return SaveOrUpdateData(db, mesDeliveryNoteBarcode) ? 1 : 0;
                case "3":
                case "6":
                    return DeleteData(db, mesDeliveryNoteBarcode) ? 1: 0;
                    return DeleteData(db, mesDeliveryNoteBarcode) ? 1 : 0;
                default:
                    throw new ArgumentNullException($"type没有{barcode.Type}这个类型的参数");
                    throw new ArgumentNullException(
                        $"type没有{barcode.Type}这个类型的参数");
            }
            throw new NotImplementedException("操作失败");
@@ -33,7 +33,8 @@
    }
    // 更新数据的方法
    private bool DeleteData(SqlSugarScope db, MesDeliveryNoteBarcode mesDeliveryNoteBarcode)
    private bool DeleteData(SqlSugarScope db,
        MesDeliveryNoteBarcode mesDeliveryNoteBarcode)
    {
        var detect = base.DeleteById(mesDeliveryNoteBarcode.Id);
@@ -44,12 +45,11 @@
    // 删除数据的方法
    private bool DeleteBarcode(SqlSugarScope db, DelBarcode barcode)
    {
        var del = db.Deleteable<MesDeliveryNoteBarcode>().Where(s => s.SmallBarcode == barcode.SmallBarcode).ExecuteCommand() > 0;
        var del = db.Deleteable<MesDeliveryNoteBarcode>()
            .Where(s => s.SmallBarcode == barcode.SmallBarcode)
            .ExecuteCommand() > 0;
        if (del)
        {
            return true;
        }
        if (del) return true;
        throw new NotImplementedException("删除失败");
    }
@@ -68,9 +68,11 @@
    }
    // 插入或更新数据的方法
    private bool SaveOrUpdateData(SqlSugarScope db, MesDeliveryNoteBarcode mesDeliveryNoteBarcode)
    private bool SaveOrUpdateData(SqlSugarScope db,
        MesDeliveryNoteBarcode mesDeliveryNoteBarcode)
    {
        if (mesDeliveryNoteBarcode.Id != null) base.DeleteById(mesDeliveryNoteBarcode.Id);
        if (mesDeliveryNoteBarcode.Id != null)
            base.DeleteById(mesDeliveryNoteBarcode.Id);
        var orUpdate = base.Insert(mesDeliveryNoteBarcode);
        if (orUpdate) return true;
@@ -88,20 +90,20 @@
    public MesDeliveryNoteBarcode GetMesDeliveryNoteBarcode(ErpBarcode barcode)
    {
        var mesDeliveryNoteBarcode = new MesDeliveryNoteBarcode();
        var single = base.GetSingle(it => it.SmallBarcode == barcode.SmallBarcode);
        var single =
            base.GetSingle(it => it.SmallBarcode == barcode.SmallBarcode);
        if (single != null) mesDeliveryNoteBarcode.Id = single.Id;
        mesDeliveryNoteBarcode.DeliveryNo = barcode.DeliveryNo;
        mesDeliveryNoteBarcode.ProductCode = barcode.ProductCode;
        mesDeliveryNoteBarcode.SmallBarcode= barcode.SmallBarcode;
        mesDeliveryNoteBarcode.IncludeQty= Convert.ToDecimal(barcode.IncludeQty);
        mesDeliveryNoteBarcode.LineNo=Convert.ToDecimal(barcode.LineNo);
        mesDeliveryNoteBarcode.SmallBarcode = barcode.SmallBarcode;
        mesDeliveryNoteBarcode.IncludeQty =
            Convert.ToDecimal(barcode.IncludeQty);
        mesDeliveryNoteBarcode.LineNo = Convert.ToDecimal(barcode.LineNo);
        mesDeliveryNoteBarcode.CreateDate = DateTime.Now;
        mesDeliveryNoteBarcode.SuppNo = barcode.SupplierId;
        return mesDeliveryNoteBarcode;
    }
}