11
啊鑫
5 天以前 caabe3ba39cedbe0daf18c231a22df1e693b49be
11
已修改2个文件
47 ■■■■ 文件已修改
MES.Service/service/BasicData/ProductionOrderManager.cs 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/WomcaaManager.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/ProductionOrderManager.cs
@@ -21,7 +21,8 @@
    public bool Save(ErpWYOrder wyOrder)
    {
        var erpProductionOrderDto = wyOrder.OrderDto;
        var mesRohIn = ConvertErpToProductionOrder(erpProductionOrderDto, wyOrder.Items[0].FBILLNO);
        var mesRohIn = ConvertErpToProductionOrder(erpProductionOrderDto,
            wyOrder.Items[0].FBILLNO);
        var mesRohInDatas =
            ConvertErpToProductionOrderSub(wyOrder.Items);
@@ -77,7 +78,9 @@
        if (mesRohInDatas.Count > 0)
            db.Deleteable<ProductionOrderSub>()
                .Where(s => s.ErpProductionEntryCode == mesRohIn.ErpProductionEntryCode).ExecuteCommand();
                .Where(s =>
                    s.ErpProductionEntryCode == mesRohIn.ErpProductionEntryCode)
                .ExecuteCommand();
        var orUpdate = db.Insertable(mesRohIn)
            .IgnoreColumns(true).ExecuteCommand() > 0;
@@ -86,7 +89,7 @@
        var baOrUpdate = db.Insertable(mesRohInDatas).PageSize(1)
            .IgnoreColumnsNull()
            .ExecuteCommand() > 0;
        if (orUpdate && baOrUpdate) return true;
        throw new NotImplementedException("插入或更新失败");
@@ -100,7 +103,7 @@
    }
    private ProductionOrder ConvertErpToProductionOrder(
        ErpProductionOrderDto erpDto,string SUBBOM)
        ErpProductionOrderDto erpDto, string SUBBOM)
    {
        DateTime parsedDate;
@@ -142,7 +145,7 @@
            ErpProductionOrderId = erpDto.FSUBID,
            ErpProductionOrderLineNo = erpDto.FSUBBILLNOSEQ,
            ErpProductionOrderNo = erpDto.FSUBBILLNO,
            SourceOrderType = erpDto.FSrcBillType,
            SourceOrderNo = erpDto.FSrcBillNo,
            SourceOrderEntryNo = erpDto.FSrcBillEntrySeq,
            DemandOrderNo = erpDto.FSALEORDERNO,
@@ -166,7 +169,22 @@
            Typea = erpDto.TypeA,
        };
        var single = base.GetSingle(it => it.ErpProductionEntryCode == erpDto.FSUBENTRYID);
        productionOrder.SourceOrderType = erpDto.FSrcBillType switch
        {
            //SourceOrderType = erpDto.FSrcBillType,
            "0" => "无来源",
            "1" => "销售订单行号",
            "2" => "预测",
            "3" => "出口订单行号",
            "4" => "需求分类代号",
            "5" => "销售订单号",
            "6" => "出口订单号",
            "7" or "8" => "生产订单",
            _ => "委外订单"
        };
        var single = base.GetSingle(it =>
            it.ErpProductionEntryCode == erpDto.FSUBENTRYID);
        if (single != null) productionOrder.Guid = single.Guid;
        return productionOrder;
MES.Service/service/WomcaaManager.cs
@@ -134,7 +134,7 @@
            Caa013 = dto.FBomId, ///     BOM版次
            CreateType = dto.FCreateType, ///     生成方式
            SrcBillType = dto.FSrcBillType, ///     源单类型
            SrcBillNo = dto.FSrcBillNo, ///     源单编号
            SrcBillentryseq = dto.FSrcBillEntrySeq, ///     源单分录行号
            SaleOrderNo = dto.FSaleOrderNo, ///     需求单据号
@@ -219,7 +219,20 @@
                .First();
            entity.Caa009 = unit.ToString();
        }
        entity.SrcBillType = dto.FSrcBillType switch
        {
            // SrcBillType = dto.FSrcBillType, ///     源单类型
            "0" => "无来源",
            "1" => "销售订单行",
            "2" => "",
            "3" => "出口订单行",
            "4" => "需求分类",
            "5" => "销售订单",
            "6" => "出口订单",
            _ => ""
        };
        //CreateDate = dto.FDate, ///     单据日期
        if (!dto.FDate.IsNullOrEmpty())
        {