dengjunjie
2025-06-11 2ae5aa151f7b40a082e34aa7ed22b4b64edd1d3c
´úÂë¹ÜÀí/WMS/WIDESEA_WMSServer/WIDESEA_TaskInfoRepository/TaskRepository.cs
@@ -20,7 +20,9 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WIDESEA_Core.Attributes;
using WIDESEA_Core.BaseRepository;
using WIDESEA_Core.Helper;
using WIDESEA_ITaskInfoRepository;
using WIDESEA_Model.Models;
@@ -32,5 +34,29 @@
        {
        }
        public int GetTaskNum(string sequenceName)
        {
            return Db.Ado.GetScalar($"SELECT NEXT VALUE FOR {sequenceName}").ObjToInt();
        }
        public override int AddData(Dt_Task entity)
        {
            return base.AddData(entity);
        }
        public override int AddData(List<Dt_Task> listEntity)
        {
            if (listEntity.GroupBy(x => x.PalletCode).Select(x => x.Count()).Any(x => x > 1))
            {
                throw new Exception("任务数组数据托盘号重复");
            }
            if (QueryFirst(x => listEntity.Select(v => v.PalletCode).Contains(x.PalletCode)) != null)
            {
                throw new Exception("有重复任务");
            }
            return base.AddData(listEntity);
        }
    }
}