cdk
23 小时以前 1cd4e66b490e4b6cc3368771cdff164990e152e7
MES.Service/service/BasicData/MesRohInManager.cs
@@ -24,11 +24,11 @@
            return rohInErpRohIn.Type switch
            {
                "2" or "4" or "5" => SaveOrUpdateData(db, mesRohIn,
                    mesRohInDatas)
                    mesRohInDatas, rohInErpRohIn.Type)
                    ? 1
                    : 0,
                "3" => SaveOrUpdateData(db, mesRohIn,
                    mesRohInDatas)
                    mesRohInDatas, rohInErpRohIn.Type)
                    ? 1
                    : 0, //UpdateData(db, mesRohIn, mesRohInDatas) ? 1 : 0,//反审核不删除,做update。
                _ => throw new NotImplementedException(
@@ -59,8 +59,14 @@
    // 插入或更新数据的方法
    private bool SaveOrUpdateData(SqlSugarScope db, MesRohIn mesRohIn,
        List<MesRohInData> mesRohInDatas)
        List<MesRohInData> mesRohInDatas, string type)
    {
        if (type == "3" || (mesRohIn.DocumentStatus != null && mesRohIn.DocumentStatus != "C"))
        {
            mesRohIn.BillNo = mesRohIn.BillNo + "F" + mesRohIn.EbelnK3id.ToString();
        }
        if (mesRohIn.Guid != null)
            db.Deleteable<MesRohIn>().Where(s => s.Guid == mesRohIn.Guid)
                .ExecuteCommand();
@@ -77,7 +83,14 @@
            .IgnoreColumnsNull()
            .ExecuteCommand() > 0;
        if (orUpdate && baOrUpdate) return true;
        if (orUpdate && baOrUpdate)
        {
            if (!string.IsNullOrEmpty(mesRohIn.BillNo))
            {
                db.Ado.ExecuteCommand("exec [dbo].[prc_unit_check] @BillNo, '采购'", new { BillNo = mesRohIn.BillNo });
            }
            return true;
        }
        throw new NotImplementedException("插入或更新失败");
    }