| | |
| | | //就查看有没有空的排了。 |
| | | //if (endBit != null) /// 寻找未满排, 直接返回结果。 |
| | | return endBit; |
| | | //LogHelper.Info(" _tempList over!"); |
| | | |
| | | //这里开始 寻找空排 |
| | | Empty: |
| | |
| | | } |
| | | if (endBit == null && _tempList.Any()) |
| | | { |
| | | LogHelper.Info(" ar_RplaceRow over!"); |
| | | var ar_RplaceRows = LocationHelper.GetLocList(x => x.S_AREA_CODE != area1 && x.S_AREA_CODE.Contains(are) && x.S_LOCK_STATE != "报废");//.Select(x => x.N_ROW).Distinct(); |
| | | //var ar_RplaceRow1 = ar_RplaceRows.FindAll(x => x.S_LOCK_STATE != "无").Select(x => x.N_ROW).Distinct(); |
| | | IEnumerable<int> ar_RplaceRow1 = ar_RplaceRows.FindAll(x => "入库锁;出库锁".Contains(x.S_LOCK_STATE?.Trim())).Select(x => x.N_ROW).Distinct(); |
| | | LogHelper.Info(" 有锁排 - " + JsonConvert.SerializeObject(ar_RplaceRow1)); //LogHelper.Info(" 有锁排 - " + JsonConvert.SerializeObject(ar_RplaceRow1)); |
| | | var ar_RplaceRow2 = ar_RplaceRows.FindAll(x => x.N_CURRENT_NUM > 0).Select(x => x.N_ROW).Distinct(); |
| | | LogHelper.Info(" 有货排: - " + JsonConvert.SerializeObject(ar_RplaceRow2)); |
| | | var ar_RplaceRow_rowlock = LocationHelper.GetRowLock(x => x.S_AREA_CODE.Contains(are))?.Select(x => x.N_ROW); |
| | | LogHelper.Info(" ar_RplaceRow over!" + JsonConvert.SerializeObject(_tempList.Select(x => x.N_ROW).Distinct())); |
| | | //var ar_RplaceRows = LocationHelper.GetLocList(x => x.S_AREA_CODE != area1 && x.S_AREA_CODE.Contains(are) && x.S_LOCK_STATE != "报废");//.Select(x => x.N_ROW).Distinct(); |
| | | // //var ar_RplaceRow1 = ar_RplaceRows.FindAll(x => x.S_LOCK_STATE != "无").Select(x => x.N_ROW).Distinct(); |
| | | //IEnumerable<int> ar_RplaceRow1 = ar_RplaceRows.FindAll(x => "入库锁;出库锁".Contains(x.S_LOCK_STATE?.Trim())).Select(x => x.N_ROW).Distinct(); |
| | | //LogHelper.Info(" 有锁排 - " + JsonConvert.SerializeObject(ar_RplaceRow1)); //LogHelper.Info(" 有锁排 - " + JsonConvert.SerializeObject(ar_RplaceRow1)); |
| | | //var ar_RplaceRow2 = ar_RplaceRows.FindAll(x => x.N_CURRENT_NUM > 0).Select(x => x.N_ROW).Distinct(); |
| | | //LogHelper.Info(" 有货排: - " + JsonConvert.SerializeObject(ar_RplaceRow2)); |
| | | //var ar_RplaceRow_rowlock = LocationHelper.GetRowLock(x => x.S_AREA_CODE.Contains(are))?.Select(x => x.N_ROW); |
| | | |
| | | var ar_RplaceRow = ar_RplaceRow1.Concat(ar_RplaceRow2).Concat(ar_RplaceRow_rowlock).Distinct(); |
| | | //var ar_RplaceRow = ar_RplaceRow1.Concat(ar_RplaceRow2).Concat(ar_RplaceRow_rowlock).Distinct(); |
| | | |
| | | if (ar_RplaceRow.Any()) |
| | | { |
| | | LogHelper.Info("排除非空排 - " + JsonConvert.SerializeObject(ar_RplaceRow)); |
| | | _tempList.RemoveAll(x => ar_RplaceRow.Contains(x.N_ROW)); |
| | | } |
| | | if (_tempList.Any())//三个库区的交集空排 |
| | | { |
| | | endBit = _tempList.OrderBy(x => x.N_ROW).ThenBy(x => x.N_COL).FirstOrDefault(); |
| | | } |
| | | //if (ar_RplaceRow.Any()) |
| | | //{ |
| | | // LogHelper.Info("排除非空排 - " + JsonConvert.SerializeObject(ar_RplaceRow)); |
| | | // _tempList.RemoveAll(x => ar_RplaceRow.Contains(x.N_ROW)); |
| | | //} |
| | | //if (_tempList.Any())//三个库区的交集空排 |
| | | //{ |
| | | // endBit = _tempList.OrderBy(x => x.N_ROW).ThenBy(x => x.N_COL).FirstOrDefault(); |
| | | //} |
| | | endBit = _tempList.OrderBy(x => x.N_ROW).ThenBy(x => x.N_COL).FirstOrDefault(); |
| | | } |
| | | |
| | | #endregion |