xwt
6 小时以前 41975878bf0b8d3632d8c5f21714502a57632070
StandardInterface/MES.Service/service/WomcaaManager.cs
@@ -60,7 +60,7 @@
            .IgnoreColumns(true).ExecuteCommand() > 0;
        //批量插入忽略空字段
        var baOrUpdate = db.Insertable(mesWomcabs).PageSize(1)
        var baOrUpdate = db.Insertable(mesWomcabs).PageSize(10)
            .IgnoreColumnsNull()
            .ExecuteCommand() > 0;
@@ -72,13 +72,27 @@
        List<Womcab> mesWomcabs)
    {
        var decimals = mesWomcabs.Select(s => s.Id).ToArray();
        var update = base.DeleteById(mesWomcaa.Id);
        var insertOrUpdate = db
            .Deleteable<Womcab>().In(decimals)
            .ExecuteCommand() > 0;
        if (update && insertOrUpdate) return true;
        var update = true;
        if (mesWomcaa != null)
        {
            if (mesWomcaa.Id != null)
            {
                update = base.DeleteById(mesWomcaa.Id);
            }
        }
        var insertOrUpdate = true;
        if (decimals != null || decimals.Length > 0)
        {
            insertOrUpdate = db.Deleteable<Womcab>().In(decimals).ExecuteCommand() > 0;
        }
        if (update && insertOrUpdate)
        {
            return true;
        }
        throw new NotImplementedException("更新失败");
    }
    private Womcaa MapErpCAAtoWomcaa(ErpCAA dto)
@@ -200,8 +214,17 @@
            Typea = dto.TypeA, ///     单据状态
            RkOrg = dto.RK_ORG,           //入库组织
            Rcn=dto.RCN,                 //日产能
            Cglineid=dto.CG_LINE_ID, //采购订单行id
            Kh=dto.KH,
            Khjc=dto.KH_JCZL,
            Scph=dto.SC_PH,
            Moldno=dto.MOLd_no,
            Oldmoldno=dto.Old_mold_no,
            Jt=dto.JT,
            Xscn=dto.XS_CN,
            Sjxs=dto.SJ_xs,
            Nextgx=dto.NEXT_Gx,
            Rks=dto.RKS,
            //沃尔新增
            // WR_F_SCDD_SCTZD = dto.F_SCDD_SCTZD
            //WR_F_SCDD_XH = dto.F_SCDD_XH
@@ -265,8 +288,13 @@
            var entity = Db.Queryable<Womcab>()
                .Where(s => s.Erpid == womcab.Erpid).Single();
            if (entity != null) womcab.Id = entity.Id;
            if (entity != null)
            {
                // 删除已有的 Erpid 相关的 Womcab 数据
              //  Db.Deleteable<Womcab>().Where(s => s.Erpid == womcab.Erpid).ExecuteCommand();
                womcab.Id = entity.Id;
            }
            womcabList.Add(womcab);
        }