已修改7个文件
131 ■■■■■ 文件已修改
MES.Service/Modes/MesUnitMatrixing.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesCustomerManager.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesItemsManager.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesSupplierManager.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/MesUnitMatrixingManager.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/WomcaaManager.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MESApplication/Controllers/WomcaaController.cs 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/Modes/MesUnitMatrixing.cs
@@ -86,5 +86,11 @@
    [SugarColumn(ColumnName = "FUMBRELLA")]
    public string? Fumbrella { get; set; }
    /// <summary>
    ///     物料id
    /// </summary>
    [SugarColumn(ColumnName = "ITEM_ID")]
    public string? ItemId { get; set; }
    [SugarColumn(IsIgnore = true)] public string? Type { get; set; }
}
MES.Service/service/BasicData/MesCustomerManager.cs
@@ -173,6 +173,20 @@
            Fumbrella = string.IsNullOrEmpty(customer.FCreateOrgId) ? "1" : customer.FCreateOrgId,
        };
        //销售员编码转ID,Fseller = customer.Fseller,
        var entityFseller = Db.Queryable<MesStaff>()
        .Where(x => x.StaffNo == customer.Fseller)
        .Select(x => x.Id.ToString())
        .First();
        if (!string.IsNullOrWhiteSpace(entityFseller))
        {
            entity.Fseller = entityFseller;
        }
        else
        {
            entity.Fseller = "0";
        }
        // ERP: 0=未禁用, 1=禁用
        // MES: A=未禁用, B=禁用
        if (customer.FForbidStatus.IsNullOrEmpty())
MES.Service/service/BasicData/MesItemsManager.cs
@@ -197,10 +197,6 @@
        {
            entity.ItemUnit = entityItemUnit;
        }
        else if (!string.IsNullOrWhiteSpace(item.FBaseUnitId))
        {
            entity.ItemUnit = item.FBaseUnitId;
        }
        else
        {
            entity.ItemUnit = "0";
@@ -214,10 +210,6 @@
        if (!string.IsNullOrWhiteSpace(entitySaleunit))
        {
            entity.Saleunit = entitySaleunit;
        }
        else if (!string.IsNullOrWhiteSpace(item.FSaleUnitId))
        {
            entity.Saleunit = item.FSaleUnitId;
        }
        else
        {
@@ -233,10 +225,6 @@
        {
            entity.Storeunit = entityStoreunit;
        }
        else if (!string.IsNullOrWhiteSpace(item.FStoreUnitID))
        {
            entity.Storeunit = item.FStoreUnitID;
        }
        else
        {
            entity.Storeunit = "0";
@@ -250,10 +238,6 @@
        if (!string.IsNullOrWhiteSpace(entityFpurchaseunitid))
        {
            entity.Fpurchaseunitid = entityFpurchaseunitid;
        }
        else if (!string.IsNullOrWhiteSpace(item.FPurchaseUnitId))
        {
            entity.Fpurchaseunitid = item.FPurchaseUnitId;
        }
        else
        {
@@ -269,10 +253,6 @@
        {
            entity.ProduceUnit = entityProduceUnit;
        }
        else if (!string.IsNullOrWhiteSpace(item.FPRODUCEUNITID))
        {
            entity.ProduceUnit = item.FPRODUCEUNITID;
        }
        else
        {
            entity.ProduceUnit = "0";
@@ -286,10 +266,6 @@
        if (!string.IsNullOrWhiteSpace(entitySubconUnit))
        {
            entity.SubconUnit = entitySubconUnit;
        }
        else if (!string.IsNullOrWhiteSpace(item.FSUBCONUNITID))
        {
            entity.SubconUnit = item.FSUBCONUNITID;
        }
        else
        {
@@ -305,10 +281,6 @@
        {
            entity.DepotCode = entityDepotCode;
        }
        else if (!string.IsNullOrWhiteSpace(item.FStockId))
        {
            entity.DepotCode = item.FStockId;
        }
        else
        {
            entity.DepotCode = "0";
@@ -323,10 +295,6 @@
        {
            entity.Fpurchaserid = entityFpurchaserid;
        }
        else if (!string.IsNullOrWhiteSpace(item.FPurchaserId))
        {
            entity.Fpurchaserid = item.FPurchaserId;
        }
        else
        {
            entity.Fpurchaserid = "0";
@@ -340,10 +308,6 @@
        if (!string.IsNullOrWhiteSpace(entityProductionWorkshop))
        {
            entity.ProductionWorkshop = entityProductionWorkshop;
        }
        else if (!string.IsNullOrWhiteSpace(item.FWorkShopId))
        {
            entity.ProductionWorkshop = item.FWorkShopId;
        }
        else
        {
MES.Service/service/BasicData/MesSupplierManager.cs
@@ -159,10 +159,6 @@
        {
            entity.Fstaffid = entitySubconUnit;
        }
        else if (!string.IsNullOrWhiteSpace(supplier.FStaffId))
        {
            entity.Fstaffid = supplier.FStaffId;
        }
        else
        {
            entity.Fstaffid = "0";
MES.Service/service/BasicData/MesUnitMatrixingManager.cs
@@ -1,4 +1,5 @@
using AngleSharp.Dom;
using Castle.Core.Resource;
using MES.Service.DB;
using MES.Service.Dto.webApi;
using MES.Service.Modes;
@@ -137,6 +138,20 @@
            Fumbrella = string.IsNullOrEmpty(unit.FCreateOrgId) ? "1" : unit.FCreateOrgId,
        };
        //物料编码转ID,ItemNo=unit.FNumber,
        var entityItemNo = Db.Queryable<MesItems>()
        .Where(x => x.ItemNo == unit.FNumber)
        .Select(x => x.Id.ToString())
        .First();
        if (!string.IsNullOrWhiteSpace(entityItemNo))
        {
            entity.ItemNo = entityItemNo;
        }
        else
        {
            entity.ItemNo = "0";
        }
        // ERP: 0=未禁用, 1=禁用
        // MES: A=未禁用, B=禁用
        if (string.IsNullOrEmpty(unit.FForbidStatus))
MES.Service/service/WomcaaManager.cs
@@ -400,6 +400,7 @@
            throw new InvalidOperationException($"生成子表ID失败,无法获取数据库序列值: {ex.Message}", ex);
        }
    }
    //唯一键组合:主表就是工单单别+工单单号,子表是工单单号+工单单号+材料品号
    /// <summary>
    /// 整单删除,调用存储过程
@@ -421,7 +422,7 @@
        new SugarParameter("@outSum", outSum, typeof(int), ParameterDirection.Output)
    };
            Db.Ado.UseStoredProcedure().ExecuteCommand("ERP_DeleteMesRohInByBillNo", parameters);
            Db.Ado.UseStoredProcedure().ExecuteCommand("ERP_DeleteWomcaaByBillNo", parameters);
            outMsg = parameters[2].Value?.ToString() ?? "";
            outSum = parameters[3].Value != null ? Convert.ToInt32(parameters[index: 3].Value) : -1;
@@ -429,7 +430,7 @@
        }
        catch (Exception ex)
        {
            throw new InvalidOperationException($"调用存储过程 ERP_DeleteMesRohInByBillNo 失败: {ex.Message}", ex);
            throw new InvalidOperationException($"调用存储过程 ERP_DeleteWomcaaByBillNo 失败: {ex.Message}", ex);
        }
    }
}
MESApplication/Controllers/WomcaaController.cs
@@ -258,4 +258,55 @@
            return ResponseResult.ResponseError(ex);
        }
    }
    /// <summary>
    ///     整单删除
    /// </summary>
    /// <returns></returns>
    [HttpPost("Delete")]
    public ResponseResult Delete([FromBody] DeleteRequestDto data)
    {
        var entity = new MessageCenter();
        entity.TableName = TableName;
        entity.Url = URL + "Delete";
        entity.Method = METHOD;
        entity.Data = JsonConvert.SerializeObject(data);
        entity.Status = 1;
        entity.CreateBy = "PL017";
        entity.Route = data.FBillNo;
        try
        {
            dynamic resultInfos = new ExpandoObject();
            // 调用删除,获取存储过程返回的状态和消息
            var (outSum, outMsg) = m.Delete(data.FBillNo, data.FBillTypeID);
            resultInfos.OutSum = outSum;
            resultInfos.OutMsg = outMsg;
            entity.Result = 0;
            if (resultInfos.OutSum == 1) entity.Result = 1;
            entity.DealWith = 1;
            _manager.save(entity);
            entity.ResultData = outMsg;
            return new ResponseResult
            {
                //status = outSum,
                status = 0,
                message = outMsg,
            };
        }
        catch (Exception ex)
        {
            entity.Result = 0;
            entity.DealWith = 0;
            entity.ResultData = ex.Message;
            _manager.save(entity);
            return ResponseResult.ResponseError(ex);
        }
    }
}