kyy
2025-09-17 b7c6607e6937df8f60d99a076178f3173213af1e
1、送货条码操作类型修改
已修改1个文件
14 ■■■■ 文件已修改
MES.Service/service/BasicData/DeliveryBarcodeManager.cs 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
MES.Service/service/BasicData/DeliveryBarcodeManager.cs
@@ -29,9 +29,9 @@
            // 按Type区分操作类型(0=新增,1=删除)
            switch (barcodeDto.Type)
            {
                case "0":
                    return InsertBarcode(barcodeEntity);
                case "1":
                    return InsertBarcode(barcodeEntity);
                case "2":
                    return DeleteBarcode(barcodeEntity.Id);
                default:
                    throw new ArgumentOutOfRangeException( nameof(barcodeDto.Type), barcodeDto.Type, "条码操作类型错误:仅支持 0(新增)、1(删除)");
@@ -78,14 +78,14 @@
            {
                switch (type)
                {
                    case "0":
                    case "1":
                        groupResultList.Add(InsertBarcodeBatch(entityGroup));
                        break;
                    case "1":
                    case "2":
                        groupResultList.Add(DeleteBarcodeBatch(entityGroup.Select(e => e.Id).ToArray()));
                        break;
                    default:
                        throw new ArgumentOutOfRangeException(nameof(type),type,"批量操作中存在非法Type:仅支持 0(新增)、1(删除)");
                        throw new ArgumentOutOfRangeException(nameof(type),type,"批量操作中存在非法Type:仅支持 1(新增)、2(删除)");
                }
            }
@@ -304,7 +304,7 @@
    /// </summary>
    private BarcodeInformation ConvertDtoToEntity(DeliveryBarcodeInfo dto)
    {
        var entityId = dto.Type == "0" ? Guid.NewGuid() : (string.IsNullOrEmpty(dto.SmallBarcode) ? Guid.Empty : Guid.Parse(dto.SmallBarcode));
        var entityId = dto.Type == "1" ? Guid.NewGuid() : (string.IsNullOrEmpty(dto.SmallBarcode) ? Guid.Empty : Guid.NewGuid());
        return new BarcodeInformation
        {
@@ -316,7 +316,7 @@
            DeliveryNo = dto.DeliveryNo,
            DnLines = dto.LineNo,
            PackLevel = dto.BarcodeType,
            CreateTime = dto.Type == "0" ? DateTime.Now : (DateTime?)null,
            CreateTime = dto.Type == "1" ? DateTime.Now : (DateTime?)null,
            UpdateTime = DateTime.Now,
            // 扩展字段赋默认值
            BigBarcode = null,