zhaowc
7 小时以前 4de417b106a062452f5ac86e626e7e225b753eab
Wms/WMS.BLL/BllTransServer/HopperTransportServer.cs
@@ -506,7 +506,7 @@
                        BitPalletMark = "0",
                        InspectStatus = "1",
                    };
                    Db.Insertable(stockDetailNew).ExecuteCommand();
                    Db.Updateable(stockDetailNew).ExecuteCommand();
                }
                else
                {
@@ -588,7 +588,7 @@
                    {
                        logTaskEntry.IsSuccess = 0;
                        logTaskEntry.Information = agvMsg;
                        Db.Insertable(logTaskEntry).ExecuteCommand();
                        Db.Updateable(logTaskEntry).ExecuteCommand();
                    }
                }
@@ -596,7 +596,7 @@
                {
                    logTaskEntry.IsSuccess = 0;
                    logTaskEntry.Information = "货架与货位绑定失败,原因:"+agvBindMsg;
                    Db.Insertable(logTaskEntry).ExecuteCommand();
                    Db.Updateable(logTaskEntry).ExecuteCommand();
                }
                
@@ -1125,7 +1125,7 @@
                                //logTaskEntry.IsCancel = 0;
                                logTaskEntry.BackDate = DateTime.Now;
                                logTaskEntry.Status = "1";//正在执行
                                Db.Insertable(logTaskEntry).ExecuteCommand();
                                Db.Updateable(logTaskEntry).ExecuteCommand();
                                //修改移出储位状态
                                locatInfo.Status = "5";//移出中
@@ -1139,7 +1139,7 @@
                            {
                                logTaskEntry.IsSuccess = 0;
                                logTaskEntry.Information = agvMsg;
                                Db.Insertable(logTaskEntry).ExecuteCommand();
                                Db.Updateable(logTaskEntry).ExecuteCommand();
                                throw new Exception($"给小车下发移库任务失败,桶号:{palletInfoYi.PalletNo}");
                            }
@@ -1148,7 +1148,7 @@
                        {
                            logTaskEntry.IsSuccess = 0;
                            logTaskEntry.Information = agvBindMsg;
                            Db.Insertable(logTaskEntry).ExecuteCommand();
                            Db.Updateable(logTaskEntry).ExecuteCommand();
                            throw new Exception($"给小车下发移库任务失败,桶号:{palletInfoYi.PalletNo}");
                        }
@@ -1239,7 +1239,7 @@
                            //logTaskEntry.IsCancel = 0;
                            logTaskInfoZ.BackDate = DateTime.Now;
                            logTaskInfoZ.Status = "1";//正在执行
                            Db.Insertable(logTaskInfoZ).ExecuteCommand();
                            Db.Updateable(logTaskInfoZ).ExecuteCommand();
                            //修改移出储位状态
                            startLocatInfoZ.Status = "5";//移出中
@@ -1253,7 +1253,7 @@
                        {
                            logTaskInfoZ.IsSuccess = 0;
                            logTaskInfoZ.Information = agvMsg;
                            Db.Insertable(logTaskInfoZ).ExecuteCommand();
                            Db.Updateable(logTaskInfoZ).ExecuteCommand();
                            throw new Exception($"给小车下发移库任务失败,桶号:{logTaskInfoZ.PalletNo}");
                        }
@@ -1262,7 +1262,7 @@
                    {
                        logTaskInfoZ.IsSuccess = 0;
                        logTaskInfoZ.Information = agvBindMsg;
                        Db.Insertable(logTaskInfoZ).ExecuteCommand();
                        Db.Updateable(logTaskInfoZ).ExecuteCommand();
                        throw new Exception($"给小车下发移库任务失败,桶号:{logTaskInfoZ.PalletNo}");
                    }
@@ -1371,7 +1371,7 @@
                                //logTaskEntry.IsCancel = 0;
                                logTaskEntry.BackDate = DateTime.Now;
                                logTaskEntry.Status = "1";//正在执行
                                Db.Insertable(logTaskEntry).ExecuteCommand();
                                Db.Updateable(logTaskEntry).ExecuteCommand();
                                //修改移出储位状态
                                locatModel.Status = "5";//移出中
@@ -1385,7 +1385,7 @@
                            {
                                logTaskEntry.IsSuccess = 0;
                                logTaskEntry.Information = agvMsg;
                                Db.Insertable(logTaskEntry).ExecuteCommand();
                                Db.Updateable(logTaskEntry).ExecuteCommand();
                                throw new Exception($"给小车下发移库任务失败,桶号:{detailInfo.PalletNo}");
                            }
@@ -1394,7 +1394,7 @@
                        {
                            logTaskEntry.IsSuccess = 0;
                            logTaskEntry.Information = agvBindMsg;
                            Db.Insertable(logTaskEntry).ExecuteCommand();
                            Db.Updateable(logTaskEntry).ExecuteCommand();
                            throw new Exception($"给小车下发移库任务失败,桶号:{detailInfo.PalletNo}");
                        }
@@ -1442,15 +1442,15 @@
                        if (zonghong == "M12" || zonghong == "M13")
                        {
                            //先查到同物料的组
                            string sql = $@"select Row from SysStorageLocat where LocatNo in(
                            string sql = $@"select Row,AreaNo from SysStorageLocat where LocatNo in(
                                                   select LocatNo from DataStockDetail where SkuNo='{skuNo}' and LotNo = '{lotNo}' and Standard='{standard}' 
                                                    and AreaNo in ('C02','C25')
                                                ) group by Row";
                                                ) group by Row,AreaNo";
                            var RowList = Db.Ado.SqlQuery<TableMan>(sql).ToList();
                            List<int> RowList = Db.Ado.SqlQuery<int>(sql).ToList();
                            foreach (var rowItem in RowList)
                            {
                                endLocatInfo = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Flag == "0" && w.Row == rowItem)
                                endLocatInfo = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Flag == "0" && w.Row == rowItem.Row && w.AreaNo == rowItem.AreaNo  && (w.WareHouseNo == "M01"||w.WareHouseNo == "M16"))
                                               .OrderByDescending(o => o.Column).First();
                                if (endLocatInfo.LocatNo != null)
                                {
@@ -1472,15 +1472,15 @@
                            areaNo = Db.Queryable<SysStorageArea>().Where(w => w.IsDel == "0" && w.WareHouseNo == houseNo && w.Type == "1").Select(s => s.AreaNo).First();
                            //分配储位
                            //先查到同物料的组
                            string sql = $@"select Row from SysStorageLocat where WareHouseNo='{houseNo}' and AreaNo='{areaNo}' and Status = '0' and LocatNo in(
                            string sql = $@"select Row,AreaNo from SysStorageLocat where WareHouseNo='{houseNo}' and AreaNo='{areaNo}' and Status = '0' and LocatNo in(
                                                   select LocatNo from DataStockDetail where SkuNo='{skuNo}' and LotNo = '{lotNo}' and Standard='{standard}' and WareHouseNo='{houseNo}' and AreaNo='{areaNo}' 
                                                ) group by Row";
                                                ) group by Row,AreaNo";
                            List<int> RowList = Db.Ado.SqlQuery<int>(sql).ToList();
                            var RowList = Db.Ado.SqlQuery<TableMan>(sql).ToList();
                            foreach (var rowItem in RowList)
                            {
                                endLocatInfo = Db.Queryable<SysStorageLocat>().Where(w => w.IsDel == "0" && w.Status == "0" && w.Flag == "0"
                                               && w.WareHouseNo == houseNo && w.AreaNo == areaNo && w.Row == rowItem)
                                               && w.WareHouseNo == houseNo && w.AreaNo == areaNo && w.Row == rowItem.Row && w.AreaNo == rowItem.AreaNo && (w.WareHouseNo == "M01" || w.WareHouseNo == "M16"))
                                               .OrderByDescending(o => o.Column).First();
                                if (endLocatInfo.LocatNo != null)
@@ -1508,13 +1508,13 @@
                        //分配储位
                        //料斗清洗暂存间
                        endLocatInfo = ztLocat.Where(w => w.AreaNo == "C54").FirstOrDefault();
                        if (string.IsNullOrEmpty(endLocatInfo.LocatNo))
                        if (endLocatInfo == null)
                        {
                            endLocatInfo = ztLocat.Where(w => w.AreaNo == "C26").FirstOrDefault();
                            if (string.IsNullOrEmpty(endLocatInfo.LocatNo))
                            if (endLocatInfo == null)
                            {
                                endLocatInfo = ztLocat.Where(w => w.AreaNo == "C03").FirstOrDefault();
                                if (string.IsNullOrEmpty(endLocatInfo.LocatNo))
                                if (endLocatInfo == null)
                                {
                                    throw new Exception("无可用脏桶库位");
                                }