zhanghonglin
9 天以前 10775e2b00cee12fb4b405e18a507c629990051a
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -305,11 +305,12 @@
                //}
                if (workTpe.Equals("In"))
                {
                    task = BaseDal.QueryData(v => (v.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu || v.TaskType == (int)TaskInboundTypeEnum.Inbound) && v.TaskState == (int)TaskInStatusEnum.InNew).OrderByDescending(v => v.Grade).OrderBy(v => v.CreateDate).First();
                    //OrderBy(升序排序)
                    task = BaseDal.QueryData(v => (v.TaskType == (int)TaskInboundTypeEnum.TiChuRuKu || v.TaskType == (int)TaskInboundTypeEnum.Inbound) && v.TaskState == (int)TaskInStatusEnum.InNew).OrderByDescending(v => v.Grade).First();
                }
                else if (workTpe.Equals("Out"))
                {
                    task = BaseDal.QueryData(v => (v.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu || v.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu || v.TaskType == (int)TaskOutboundTypeEnum.Outbound || v.TaskType == (int)TaskOutboundTypeEnum.OutInventory) && v.TaskState == (int)TaskOutStatusEnum.OutNew).OrderBy(v => v.CreateDate).First();
                    task = BaseDal.QueryData(v => (v.TaskType == (int)TaskOutboundTypeEnum.TiChuChuKu || v.TaskType == (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu || v.TaskType == (int)TaskOutboundTypeEnum.Outbound || v.TaskType == (int)TaskOutboundTypeEnum.OutInventory) && v.TaskState == (int)TaskOutStatusEnum.OutNew).OrderByDescending(v => v.Grade).First();
                }
            }
@@ -1031,7 +1032,7 @@
                    stock.LocationCode = nawtask.TargetAddress;
                    stock.StockStatus = (int)stockEnum.Free;
                    stock.BatchNo = batck.InBatch;
                    stock.Remark = 3;
                    stock.Remark = (int)MateTypeEnum.TiChu;
                    //修改货位信息
                    var location = _locationRepository.QueryFirst(v => v.LocationCode == nawtask.TargetAddress);
                    location.LocationStatus = (int)LocationStatusEnum.InStock;
@@ -1356,6 +1357,11 @@
                //{
                //    throw new Exception($"整形机天车放板信号为false");
                //}
                var location = _locationRepository.QueryFirst(v => v.LocationCode == wei);
                if (location.LocationType != (int)LocationTypeEnum.Flat)
                {
                    return content.OK("5");
                }
                //查询当前任务池中是否存在出库任务,出库任务只能存在一条
                var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound);
                if (oldtask != null)
@@ -1426,7 +1432,7 @@
                if (oldhtytask == null)
                {
                    task.Grade = 3;
                    task.Remark = (int)MateTypeEnum.ZiChan;
                    task.Remark = (int)MateTypeEnum.TiChu;
                    task.NextAddress = "text";
                    task.Roadway = "TC01";
                    task.TaskType = (int)TaskOutboundTypeEnum.TiChuZhiJieChuKu;
@@ -1453,11 +1459,15 @@
            //{
            //    throw new Exception($"规整机剔除架子可放板或剔除上料模式信号为false");
            //}
            //查询当前任务池中是否存在出库任务,出库任务只能存在一条
            var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound);
            var isout = _outStockRepository.QueryFirst(v => v.Id == 1);
            if (isout.isout == 0)
            {
                var oldtask = _dt_taskRepositiry.QueryFirst(v => v.TaskType == (int)TaskOutboundTypeEnum.Outbound);
                var location = _locationRepository.QueryFirst(v => v.LocationCode == wei);
                if(location.LocationType != (int)LocationTypeEnum.Cube)
                {
                    return content.OK("5");
                }
                if (oldtask != null)
                {
                    throw new Exception($"当前任务池中已存在一条出库任务");
@@ -1482,7 +1492,7 @@
                {
                    task.SourceAddress = wei;
                    task.Grade = 3;
                    task.Remark = (int)MateTypeEnum.ZiChan;
                    task.Remark = (int)MateTypeEnum.TiChu;
                    task.NextAddress = "text";
                    task.Roadway = "TC01";
                    task.TaskType = (int)TaskOutboundTypeEnum.TiChuChuKu;
@@ -1497,6 +1507,10 @@
                    _unitOfWorkManage.CommitTran();
                    return content.OK("2");
                }
            }
            else
            {
                return content.OK("1");
            }   
            return content.OK("3");
        }
@@ -1512,6 +1526,11 @@
            var isout = _outStockRepository.QueryFirst(v => v.Id == 1);
            if (isout.isout == 0)
            {
                var location = _locationRepository.QueryFirst(v => v.LocationCode == wei);
                if (location.LocationType != (int)LocationTypeEnum.Cube)
                {
                    return content.OK("5");
                }
                //判断库存是否有货
                //查询货位
                Dt_LocationInfo huo = _LocationInfoRepository.QueryFirst(v => v.LocationCode == wei);
@@ -1527,7 +1546,7 @@
                {
                    task.TargetAddress = wei;
                    task.Grade = 3;
                    task.Remark = (int)MateTypeEnum.ZiChan;
                    task.Remark = (int)MateTypeEnum.TiChu;
                    task.NextAddress = "text";
                    task.Roadway = "TC01";
                    task.TaskType = (int)TaskInboundTypeEnum.TiChuRuKu;