zhanghonglin
5 天以前 48ed41879227c9b495f48ecd7cfde0acfd375da3
项目代码/WCS/WIDESEAWCS_Server/WIDESEAWCS_TaskInfoService/TaskService.cs
@@ -1567,5 +1567,61 @@
            }
            return content.OK("3");
        }
        public WebResponseContent zxjruku(string wei,string weis)
        {
            Dt_Task task = new Dt_Task();
            WebResponseContent content = new WebResponseContent();
            //if (!OHTJob.oHTReadData.R_ZXJ_isWork)
            //{
            //    throw new Exception($"鏁村舰鏈烘姇鍏ヤ娇鐢ㄤ俊鍙蜂负false");
            //}
            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.Flat)
                {
                    return content.OK("5");
                }
                //鍒ゆ柇搴撳瓨鏄惁鏈夎揣
                //鏌ヨ璐т綅
                Dt_LocationInfo huo = _LocationInfoRepository.QueryFirst(v => v.LocationCode == wei);
                Dt_LocationInfo huos = _LocationInfoRepository.QueryFirst(v => v.LocationCode == weis);
                if (huo.LocationStatus != 0)
                {
                    return content.OK("4");
                }
                huo.LocationStatus = 1;
                huos.LocationStatus = 1;
                var station = _dt_stationInfoRepository.QueryFirst(v => v.msg == "鏁村舰鏈烘斁鏂欎綅");
                task.SourceAddress = station.Row + "-" + station.Column + "-1";
                var oldhtytask = _dt_taskRepositiry.QueryFirst(v => v.SourceAddress == task.SourceAddress);
                if (oldhtytask == null)
                {
                    task.TargetAddress = wei;
                    task.Grade = 3;
                    task.Remark = (int)MateTypeEnum.ZiChan;
                    task.NextAddress = weis;
                    task.Roadway = "TC01";
                    task.TaskType = (int)TaskInboundTypeEnum.Inbound;
                    task.TaskState = (int)TaskInStatusEnum.InNew;
                    task.PalletCode = "text";
                    task.CurrentAddress = "text";
                    task.WMSId = 2;
                    _unitOfWorkManage.BeginTran();
                    _dt_taskRepositiry.AddData(task);
                    _LocationInfoRepository.UpdateData(huo);
                    _LocationInfoRepository.UpdateData(huos);
                    _unitOfWorkManage.CommitTran();
                    return content.OK("2");
                }
            }
            else
            {
                return content.OK("1");
            }
            return content.OK("3");
        }
    }
}