hao
2025-10-22 89d384623e1acdb3c58ec6d4094f9e8f2ec5ca57
销售发货同步防呆+合并单号
已修改3个文件
20 ■■■■■ 文件已修改
StandardInterface/MES.Service/Dto/webApi/ErpSalesDeliveryDto.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StandardInterface/MES.Service/Modes/SalesDeliveryNotice.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StandardInterface/MES.Service/service/BasicData/Sales/SalesDeliveryNoticeManager.cs 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
StandardInterface/MES.Service/Dto/webApi/ErpSalesDeliveryDto.cs
@@ -44,6 +44,7 @@
    public string? FCancelStatus { get; set; } // 作废状态
    public string? FCancellerId { get; set; } // 作废人
    public string? FCancelDate { get; set; } // 作废日期
    public string? HbDh { get; set; } // 作废日期
    
}
StandardInterface/MES.Service/Modes/SalesDeliveryNotice.cs
@@ -229,7 +229,12 @@
        public string? BillStatus { get; set; }
        /// <summary>
        /// 单据状态
        ///</summary>
        [SugarColumn(ColumnName = "HB_DH")]
        public string? HbDh { get; set; }
    }
}
StandardInterface/MES.Service/service/BasicData/Sales/SalesDeliveryNoticeManager.cs
@@ -90,6 +90,15 @@
        private bool SaveOrUpdateData(SqlSugarScope db, SalesDeliveryNotice mesSalesDelivery,
            List<SalesDeliveryNoticeDetail> mesSalesDeliveryDatas, string type)
        {
            // 1. 校验是否存在领料记录(MES_INV_ITEM_OUTS)
            var hasMaterialOut = db.Queryable<MesInvItemOuts>()
                                   .Any(x => x.WorkNo == mesSalesDelivery.BillNo);
            if (hasMaterialOut)
            {
                throw new Exception($"MES已有领料记录,单号:{mesSalesDelivery.BillNo},不能更新!");
            }
            if (mesSalesDelivery.Id != null) base.DeleteById(mesSalesDelivery.Id);
            if (mesSalesDeliveryDatas.Count > 0)
@@ -176,7 +185,8 @@
                CloseStatus = erpDto.FBillCloseStatus, // 关闭状态
                BillStatus = erpDto.FDocumentStatus, //单据状态
                DeliveryOrg = erpDto.FDeliveryOrgID, //发货组织
                SalesOrg    = erpDto.FSaleOrgId //销售组织
                SalesOrg    = erpDto.FSaleOrgId, //销售组织
                HbDh    = erpDto.HbDh //销售组织
            };