cdk
2 天以前 1cd4e66b490e4b6cc3368771cdff164990e152e7
MES.Service/service/BasicData/ProductionOrderManager.cs
@@ -74,9 +74,10 @@
    private bool SaveOrUpdateData(SqlSugarScope db, ProductionOrder mesRohIn,
        List<ProductionOrderSub> mesRohInDatas, string type)
    {
        if(type == "3")
        if(type == "3" || (mesRohIn.DocumentStatus != null && mesRohIn.DocumentStatus != "C"))
        {
            mesRohIn.Typea = "3";  // 新增字段赋值
            mesRohIn.OrderNo = mesRohIn.OrderNo + "F" + mesRohIn.ErpProductionEntryCode;
        }
        if (StringUtil.CheckGuid(mesRohIn.Guid))
@@ -95,9 +96,14 @@
        var baOrUpdate = db.Insertable(mesRohInDatas).PageSize(1)
            .IgnoreColumnsNull()
            .ExecuteCommand() > 0;
        if (orUpdate && baOrUpdate) return true;
        if (orUpdate && baOrUpdate)
        {
            db.Ado.ExecuteCommand("exec [dbo].[prc_unit_check] @billno, @ModuleType",
                new { billno = mesRohIn.OrderNo, ModuleType = "委外工单" });
            return true;
        }
        throw new NotImplementedException("插入或更新失败");
    }
@@ -173,10 +179,18 @@
            ReqSrc = erpDto.FReqSrc,
            SrcSplitSeq = erpDto.SrcSplitSeq,
            Typea = erpDto.TypeA,
            DocumentStatus = erpDto.FDocumentStatus
        };
        var single = base.GetSingle(it => it.ErpProductionEntryCode == erpDto.FSUBENTRYID);
        if (single != null) productionOrder.Guid = single.Guid;
        if (single != null)
        {
            productionOrder.Guid = single.Guid;
            productionOrder.AuditDate = single.AuditDate;
            productionOrder.AuditStatus = single.AuditStatus;
            productionOrder.Auditor = single.Auditor;
        }
        return productionOrder;
    }