|
@@ -21,364 +21,364 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
{
|
|
|
public partial class WcsService
|
|
|
{
|
|
|
- public RpcResponse<object> GetItemUpTable(PageBo page, AppBCItemVo item, ShowSyncedState showSynced, string tag)
|
|
|
- {
|
|
|
- var itemWorkNoFilter = item.ItemWorkNo == null ? "1=1" : item.ItemWorkNo == "" ? "1=1" : $"ItemWorkNo_Str='{item.ItemWorkNo}'";
|
|
|
- var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
- var itemNoFilter = item.ItemNo == null ? "1=1" : item.ItemNo == "" ? "1=1" : $"ItemNo_Str='{item.ItemNo}'";
|
|
|
- var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
- var syncedFilter = showSynced == ShowSyncedState.Synced ? "IsSynced_Bit='1'" : showSynced == ShowSyncedState.NotSynced ? "IsSynced_Bit='0' and ( Remark_Str is null or Remark_Str = '') " : showSynced == ShowSyncedState.SyncedError ? "IsSynced_Bit='0' and ( Remark_Str is not null or Remark_Str != '')" : $"1=1";
|
|
|
- var tagFilter = tag == "L-" ? "SourceLocationTag_Str like '%L-%'" : tag == "DQA-" ? "SourceLocationTag_Str like '%DQA-%'" : $"1=1";
|
|
|
- var filterStr = $"{itemWorkNoFilter} and {billNoFilter} and {itemNoFilter} and {itemCodeFilter} and {syncedFilter} and {tagFilter}";
|
|
|
- var sqlStr = GetTableSql("App_BC_ItemUp", filterStr, page);
|
|
|
- var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemVo>();
|
|
|
- return new RpcResponse<object>()
|
|
|
- {
|
|
|
- Data = taskTable
|
|
|
- };
|
|
|
- }
|
|
|
+ //public RpcResponse<object> GetItemUpTable(PageBo page, AppBCItemVo item, ShowSyncedState showSynced, string tag)
|
|
|
+ //{
|
|
|
+ // var itemWorkNoFilter = item.ItemWorkNo == null ? "1=1" : item.ItemWorkNo == "" ? "1=1" : $"ItemWorkNo_Str='{item.ItemWorkNo}'";
|
|
|
+ // var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
+ // var itemNoFilter = item.ItemNo == null ? "1=1" : item.ItemNo == "" ? "1=1" : $"ItemNo_Str='{item.ItemNo}'";
|
|
|
+ // var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
+ // var syncedFilter = showSynced == ShowSyncedState.Synced ? "IsSynced_Bit='1'" : showSynced == ShowSyncedState.NotSynced ? "IsSynced_Bit='0' and ( Remark_Str is null or Remark_Str = '') " : showSynced == ShowSyncedState.SyncedError ? "IsSynced_Bit='0' and ( Remark_Str is not null or Remark_Str != '')" : $"1=1";
|
|
|
+ // var tagFilter = tag == "L-" ? "SourceLocationTag_Str like '%L-%'" : tag == "DQA-" ? "SourceLocationTag_Str like '%DQA-%'" : $"1=1";
|
|
|
+ // var filterStr = $"{itemWorkNoFilter} and {billNoFilter} and {itemNoFilter} and {itemCodeFilter} and {syncedFilter} and {tagFilter}";
|
|
|
+ // var sqlStr = GetTableSql("App_BC_ItemUp", filterStr, page);
|
|
|
+ // var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemVo>();
|
|
|
+ // return new RpcResponse<object>()
|
|
|
+ // {
|
|
|
+ // Data = taskTable
|
|
|
+ // };
|
|
|
+ //}
|
|
|
|
|
|
- public RpcResponse<object> AddEditItemUpTableRow(int action, AppBCItemVo item)
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- if (action == 1)
|
|
|
- {
|
|
|
- return res;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var ok = Env.DAL.App_BC_ItemUp.Update($"ItemNo_Str='{item.ItemNo}'",
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemUp.ActualTotalQty_Dec, item.ActualTotalQty),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemUp.SourceLocations_Str, item.SourceLocations),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemUp.LocationItemsNum_Str, item.LocationItemsNum)
|
|
|
- );
|
|
|
- string taskNosStr = null;
|
|
|
- item.ItemNo.Split('/').ToList().ForEach(t =>
|
|
|
- {
|
|
|
- if (taskNosStr == null)
|
|
|
- {
|
|
|
- taskNosStr = $"'{t}'"; ;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- taskNosStr = $"{taskNosStr},'{t}'";
|
|
|
- }
|
|
|
- });
|
|
|
- var filter = $" TaskNo_Str in ({taskNosStr})";
|
|
|
- var filterStr = $"{filter}";
|
|
|
- var itemTasks = Env.DAL.App_BC_ItemTask.GetData<AppBCItemTaskModel>(filterStr);
|
|
|
- bool dbRes;
|
|
|
- if (itemTasks?.Count != 0)
|
|
|
- {
|
|
|
- foreach (var it in itemTasks)
|
|
|
- {
|
|
|
- if (item.ActualTotalQty >= it.PlannedQty)
|
|
|
- {
|
|
|
- it.ActualQty = it.PlannedQty;
|
|
|
- item.ActualTotalQty -= it.PlannedQty;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- it.ActualQty = item.ActualTotalQty;
|
|
|
- item.ActualTotalQty = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
- itemTasks,
|
|
|
- t => new { t.TaskNo },
|
|
|
- null,
|
|
|
- t => new { t.ActualQty }
|
|
|
- );
|
|
|
- if (ok == false || dbRes == false)
|
|
|
- {
|
|
|
- res.IsSucceed = false;
|
|
|
- res.Message = (string)ok.ErrorMessage;
|
|
|
- return res;
|
|
|
- }
|
|
|
- }
|
|
|
- res.Message = "更改成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
- }
|
|
|
+ //public RpcResponse<object> AddEditItemUpTableRow(int action, AppBCItemVo item)
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // if (action == 1)
|
|
|
+ // {
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // var ok = Env.DAL.App_BC_ItemUp.Update($"ItemNo_Str='{item.ItemNo}'",
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemUp.ActualTotalQty_Dec, item.ActualTotalQty),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemUp.SourceLocations_Str, item.SourceLocations),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemUp.LocationItemsNum_Str, item.LocationItemsNum)
|
|
|
+ // );
|
|
|
+ // string taskNosStr = null;
|
|
|
+ // item.ItemNo.Split('/').ToList().ForEach(t =>
|
|
|
+ // {
|
|
|
+ // if (taskNosStr == null)
|
|
|
+ // {
|
|
|
+ // taskNosStr = $"'{t}'"; ;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // taskNosStr = $"{taskNosStr},'{t}'";
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // var filter = $" TaskNo_Str in ({taskNosStr})";
|
|
|
+ // var filterStr = $"{filter}";
|
|
|
+ // var itemTasks = Env.DAL.App_BC_ItemTask.GetData<AppBCItemTaskModel>(filterStr);
|
|
|
+ // bool dbRes;
|
|
|
+ // if (itemTasks?.Count != 0)
|
|
|
+ // {
|
|
|
+ // foreach (var it in itemTasks)
|
|
|
+ // {
|
|
|
+ // if (item.ActualTotalQty >= it.PlannedQty)
|
|
|
+ // {
|
|
|
+ // it.ActualQty = it.PlannedQty;
|
|
|
+ // item.ActualTotalQty -= it.PlannedQty;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // it.ActualQty = item.ActualTotalQty;
|
|
|
+ // item.ActualTotalQty = 0;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
+ // itemTasks,
|
|
|
+ // t => new { t.TaskNo },
|
|
|
+ // null,
|
|
|
+ // t => new { t.ActualQty }
|
|
|
+ // );
|
|
|
+ // if (ok == false || dbRes == false)
|
|
|
+ // {
|
|
|
+ // res.IsSucceed = false;
|
|
|
+ // res.Message = (string)ok.ErrorMessage;
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // res.Message = "更改成功";
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
- public RpcResponse<object> GetItemLowTable(PageBo page, AppBCItemVo item, ShowSyncedState showSynced, string tag)
|
|
|
- {
|
|
|
- var itemWorkNoFilter = item.ItemWorkNo == null ? "1=1" : item.ItemWorkNo == "" ? "1=1" : $"ItemWorkNo_Str='{item.ItemWorkNo}'";
|
|
|
- var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
- var itemNoFilter = item.ItemNo == null ? "1=1" : item.ItemNo == "" ? "1=1" : $"ItemNo_Str='{item.ItemNo}'";
|
|
|
- var workCenterFilter = item.WorkCenter == null ? "1=1" : item.WorkCenter == "" ? "1=1" : $"WorkCenter_Str='{item.WorkCenter}'";
|
|
|
- var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
- var syncedFilter = showSynced == ShowSyncedState.Synced ? "IsSynced_Bit='1'" : showSynced == ShowSyncedState.NotSynced ? "IsSynced_Bit='0' and ( Remark_Str is null or Remark_Str = '') " : showSynced == ShowSyncedState.SyncedError ? "IsSynced_Bit='0' and ( Remark_Str is not null or Remark_Str != '')" : $"1=1";
|
|
|
- var tagFilter = tag == "L-" ? "SourceLocationTag_Str like '%L-%'" : tag == "DQA-" ? "SourceLocationTag_Str like '%DQA-%'" : $"1=1";
|
|
|
- var filterStr = $"{itemWorkNoFilter} and {billNoFilter} and {itemNoFilter} and {itemCodeFilter} and {syncedFilter} and {workCenterFilter} and {tagFilter}";
|
|
|
- var sqlStr = GetTableSql("App_BC_ItemLow", filterStr, page);
|
|
|
- var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemVo>();
|
|
|
- return new RpcResponse<object>()
|
|
|
- {
|
|
|
- Data = taskTable
|
|
|
- };
|
|
|
- }
|
|
|
+ //public RpcResponse<object> GetItemLowTable(PageBo page, AppBCItemVo item, ShowSyncedState showSynced, string tag)
|
|
|
+ //{
|
|
|
+ // var itemWorkNoFilter = item.ItemWorkNo == null ? "1=1" : item.ItemWorkNo == "" ? "1=1" : $"ItemWorkNo_Str='{item.ItemWorkNo}'";
|
|
|
+ // var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
+ // var itemNoFilter = item.ItemNo == null ? "1=1" : item.ItemNo == "" ? "1=1" : $"ItemNo_Str='{item.ItemNo}'";
|
|
|
+ // var workCenterFilter = item.WorkCenter == null ? "1=1" : item.WorkCenter == "" ? "1=1" : $"WorkCenter_Str='{item.WorkCenter}'";
|
|
|
+ // var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
+ // var syncedFilter = showSynced == ShowSyncedState.Synced ? "IsSynced_Bit='1'" : showSynced == ShowSyncedState.NotSynced ? "IsSynced_Bit='0' and ( Remark_Str is null or Remark_Str = '') " : showSynced == ShowSyncedState.SyncedError ? "IsSynced_Bit='0' and ( Remark_Str is not null or Remark_Str != '')" : $"1=1";
|
|
|
+ // var tagFilter = tag == "L-" ? "SourceLocationTag_Str like '%L-%'" : tag == "DQA-" ? "SourceLocationTag_Str like '%DQA-%'" : $"1=1";
|
|
|
+ // var filterStr = $"{itemWorkNoFilter} and {billNoFilter} and {itemNoFilter} and {itemCodeFilter} and {syncedFilter} and {workCenterFilter} and {tagFilter}";
|
|
|
+ // var sqlStr = GetTableSql("App_BC_ItemLow", filterStr, page);
|
|
|
+ // var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemVo>();
|
|
|
+ // return new RpcResponse<object>()
|
|
|
+ // {
|
|
|
+ // Data = taskTable
|
|
|
+ // };
|
|
|
+ //}
|
|
|
|
|
|
- public RpcResponse<object> AddEditItemLowTableRow(int action, AppBCItemVo item)
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- if (action == 1)
|
|
|
- {
|
|
|
- return res;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var ok = Env.DAL.App_BC_ItemLow.Update($"ItemNo_Str='{item.ItemNo}'",
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemLow.ActualTotalQty_Dec, item.ActualTotalQty),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemLow.SourceLocations_Str, item.SourceLocations),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemLow.LocationItemsNum_Str, item.LocationItemsNum)
|
|
|
- );
|
|
|
- string taskNosStr = null;
|
|
|
- item.ItemNo.Split('/').ToList().ForEach(t =>
|
|
|
- {
|
|
|
- if (taskNosStr == null)
|
|
|
- {
|
|
|
- taskNosStr = $"'{t}'"; ;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- taskNosStr = $"{taskNosStr},'{t}'";
|
|
|
- }
|
|
|
- });
|
|
|
- var filter = $" TaskNo_Str in ({taskNosStr})";
|
|
|
- var filterStr = $"{filter}";
|
|
|
- var itemTasks = Env.DAL.App_BC_ItemTask.GetData<AppBCItemTaskModel>(filterStr);
|
|
|
- bool dbRes;
|
|
|
- if (itemTasks?.Count != 0)
|
|
|
- {
|
|
|
- foreach (var it in itemTasks)
|
|
|
- {
|
|
|
- if (item.ActualTotalQty >= it.PlannedQty)
|
|
|
- {
|
|
|
- it.ActualQty = it.PlannedQty;
|
|
|
- item.ActualTotalQty -= it.PlannedQty;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- it.ActualQty = item.ActualTotalQty;
|
|
|
- item.ActualTotalQty = 0;
|
|
|
- }
|
|
|
- }
|
|
|
- dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
- itemTasks,
|
|
|
- t => new { t.TaskNo },
|
|
|
- null,
|
|
|
- t => new { t.ActualQty }
|
|
|
- );
|
|
|
- if (ok == false || dbRes == false)
|
|
|
- {
|
|
|
- res.IsSucceed = false;
|
|
|
- res.Message = (string)ok.ErrorMessage;
|
|
|
- return res;
|
|
|
- }
|
|
|
- }
|
|
|
- res.Message = "更改成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
- }
|
|
|
+ //public RpcResponse<object> AddEditItemLowTableRow(int action, AppBCItemVo item)
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // if (action == 1)
|
|
|
+ // {
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // var ok = Env.DAL.App_BC_ItemLow.Update($"ItemNo_Str='{item.ItemNo}'",
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemLow.ActualTotalQty_Dec, item.ActualTotalQty),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemLow.SourceLocations_Str, item.SourceLocations),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemLow.LocationItemsNum_Str, item.LocationItemsNum)
|
|
|
+ // );
|
|
|
+ // string taskNosStr = null;
|
|
|
+ // item.ItemNo.Split('/').ToList().ForEach(t =>
|
|
|
+ // {
|
|
|
+ // if (taskNosStr == null)
|
|
|
+ // {
|
|
|
+ // taskNosStr = $"'{t}'"; ;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // taskNosStr = $"{taskNosStr},'{t}'";
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // var filter = $" TaskNo_Str in ({taskNosStr})";
|
|
|
+ // var filterStr = $"{filter}";
|
|
|
+ // var itemTasks = Env.DAL.App_BC_ItemTask.GetData<AppBCItemTaskModel>(filterStr);
|
|
|
+ // bool dbRes;
|
|
|
+ // if (itemTasks?.Count != 0)
|
|
|
+ // {
|
|
|
+ // foreach (var it in itemTasks)
|
|
|
+ // {
|
|
|
+ // if (item.ActualTotalQty >= it.PlannedQty)
|
|
|
+ // {
|
|
|
+ // it.ActualQty = it.PlannedQty;
|
|
|
+ // item.ActualTotalQty -= it.PlannedQty;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // it.ActualQty = item.ActualTotalQty;
|
|
|
+ // item.ActualTotalQty = 0;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
+ // itemTasks,
|
|
|
+ // t => new { t.TaskNo },
|
|
|
+ // null,
|
|
|
+ // t => new { t.ActualQty }
|
|
|
+ // );
|
|
|
+ // if (ok == false || dbRes == false)
|
|
|
+ // {
|
|
|
+ // res.IsSucceed = false;
|
|
|
+ // res.Message = (string)ok.ErrorMessage;
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // res.Message = "更改成功";
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
|
|
|
- public RpcResponse<object> GetItemTaskTable(PageBo page, List<string> taskNos)
|
|
|
- {
|
|
|
- string taskNosStr = null;
|
|
|
- taskNos.ForEach(item =>
|
|
|
- {
|
|
|
- if (taskNosStr == null)
|
|
|
- {
|
|
|
- taskNosStr = $"'{item}'"; ;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- taskNosStr = $"{taskNosStr},'{item}'";
|
|
|
- }
|
|
|
- });
|
|
|
- var filter = $" TaskNo_Str in ({taskNosStr})";
|
|
|
- var filterStr = $"{filter}";
|
|
|
- var sqlStr = GetTableSql("App_BC_ItemTask", filterStr, page);
|
|
|
- var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemTaskVo>();
|
|
|
- return new RpcResponse<object>()
|
|
|
- {
|
|
|
- Data = taskTable
|
|
|
- };
|
|
|
- }
|
|
|
+ //public RpcResponse<object> GetItemTaskTable(PageBo page, List<string> taskNos)
|
|
|
+ //{
|
|
|
+ // string taskNosStr = null;
|
|
|
+ // taskNos.ForEach(item =>
|
|
|
+ // {
|
|
|
+ // if (taskNosStr == null)
|
|
|
+ // {
|
|
|
+ // taskNosStr = $"'{item}'"; ;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // taskNosStr = $"{taskNosStr},'{item}'";
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // var filter = $" TaskNo_Str in ({taskNosStr})";
|
|
|
+ // var filterStr = $"{filter}";
|
|
|
+ // var sqlStr = GetTableSql("App_BC_ItemTask", filterStr, page);
|
|
|
+ // var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemTaskVo>();
|
|
|
+ // return new RpcResponse<object>()
|
|
|
+ // {
|
|
|
+ // Data = taskTable
|
|
|
+ // };
|
|
|
+ //}
|
|
|
|
|
|
- public RpcResponse<object> AddEditItemTaskTableRow(int action, AppBCItemTaskVo task)
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- if (action == 1)
|
|
|
- {
|
|
|
- var ok = Env.DAL.App_BC_ItemTask.Insert(
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.BillNo_Str, task.BillNo),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.ItemCode_Str, task.ItemCode),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.ItemName_Str, task.ItemName),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.OrgID_Int, task.OrgID),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.TaskNo_Str, task.TaskNo),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.State_Int, task.State),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.OnhandState_Int, task.OnhandState),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.UnitCode_Str, task.UnitCode),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.TaskGroupNo_Str, task.TaskGroupNo),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.TechStation_Str, task.TechStation),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.ItemExtPropName_Str, task.ItemExtPropName),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.WarehouseCode_Str, task.WarehouseCode),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.ActualQty_Dec, task.ActualQty),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.SourceLocation_Str, task.SourceLocation),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.Lot_Str, task.Lot),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.Lpn_Str, task.Lpn),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.StorageArea_Str, task.StorageArea),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.TaskType_Bit, task.TaskType),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.IsMerged_Bit, 1),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt01_Str, task.LotAtt01),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt02_Str, task.LotAtt02),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt03_Str, task.LotAtt03),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt04_Str, task.LotAtt04),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt05_Str, task.LotAtt05),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt06_Str, task.LotAtt06),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt07_Str, task.LotAtt07),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt08_Str, task.LotAtt08),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt09_Str, task.LotAtt09),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt10_Str, task.LotAtt10),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt11_Str, task.LotAtt11),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt12_Str, task.LotAtt12)
|
|
|
- );
|
|
|
- if (!ok)
|
|
|
- {
|
|
|
- res.IsSucceed = false;
|
|
|
- res.Message = (string)ok.ErrorMessage;
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.Message = "新增成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var ok = Env.DAL.App_BC_ItemTask.Update($"ID='{task.ID}'",
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.SourceLocation_Str, task.SourceLocation),
|
|
|
- new UpdateItem(T_Col_Name.App_BC_ItemTask.ActualQty_Dec, task.ActualQty)
|
|
|
- );
|
|
|
- if (!ok)
|
|
|
- {
|
|
|
- res.IsSucceed = false;
|
|
|
- res.Message = (string)ok.ErrorMessage;
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.Message = "更改成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
- }
|
|
|
- public RpcResponse<object> DelItemTaskTableRow(int id)
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- var ok = Env.DAL.App_BC_ItemTask.Delete("ID", id);
|
|
|
- if (!ok)
|
|
|
- {
|
|
|
- res.IsSucceed = false;
|
|
|
- res.Data = ok.ErrorMessage;
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.Message = "删除成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
+ //public RpcResponse<object> AddEditItemTaskTableRow(int action, AppBCItemTaskVo task)
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // if (action == 1)
|
|
|
+ // {
|
|
|
+ // var ok = Env.DAL.App_BC_ItemTask.Insert(
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.BillNo_Str, task.BillNo),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.ItemCode_Str, task.ItemCode),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.ItemName_Str, task.ItemName),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.OrgID_Int, task.OrgID),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.TaskNo_Str, task.TaskNo),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.State_Int, task.State),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.OnhandState_Int, task.OnhandState),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.UnitCode_Str, task.UnitCode),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.TaskGroupNo_Str, task.TaskGroupNo),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.TechStation_Str, task.TechStation),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.ItemExtPropName_Str, task.ItemExtPropName),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.WarehouseCode_Str, task.WarehouseCode),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.ActualQty_Dec, task.ActualQty),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.SourceLocation_Str, task.SourceLocation),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.Lot_Str, task.Lot),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.Lpn_Str, task.Lpn),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.StorageArea_Str, task.StorageArea),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.TaskType_Bit, task.TaskType),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.IsMerged_Bit, 1),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt01_Str, task.LotAtt01),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt02_Str, task.LotAtt02),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt03_Str, task.LotAtt03),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt04_Str, task.LotAtt04),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt05_Str, task.LotAtt05),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt06_Str, task.LotAtt06),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt07_Str, task.LotAtt07),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt08_Str, task.LotAtt08),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt09_Str, task.LotAtt09),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt10_Str, task.LotAtt10),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt11_Str, task.LotAtt11),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.LotAtt12_Str, task.LotAtt12)
|
|
|
+ // );
|
|
|
+ // if (!ok)
|
|
|
+ // {
|
|
|
+ // res.IsSucceed = false;
|
|
|
+ // res.Message = (string)ok.ErrorMessage;
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // res.Message = "新增成功";
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // var ok = Env.DAL.App_BC_ItemTask.Update($"ID='{task.ID}'",
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.SourceLocation_Str, task.SourceLocation),
|
|
|
+ // new UpdateItem(T_Col_Name.App_BC_ItemTask.ActualQty_Dec, task.ActualQty)
|
|
|
+ // );
|
|
|
+ // if (!ok)
|
|
|
+ // {
|
|
|
+ // res.IsSucceed = false;
|
|
|
+ // res.Message = (string)ok.ErrorMessage;
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // res.Message = "更改成功";
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //public RpcResponse<object> DelItemTaskTableRow(int id)
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // var ok = Env.DAL.App_BC_ItemTask.Delete("ID", id);
|
|
|
+ // if (!ok)
|
|
|
+ // {
|
|
|
+ // res.IsSucceed = false;
|
|
|
+ // res.Data = ok.ErrorMessage;
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // res.Message = "删除成功";
|
|
|
+ // return res;
|
|
|
+ //}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 下发堆垛机任务,更新子表库位信息
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemNoAndSourceLocation"></param>
|
|
|
- /// <returns></returns>
|
|
|
- public RpcResponse<object> AddMachineTask(Dictionary<string, string> itemNoAndSourceLocation)
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- var sourceLocationList = new List<OperationBo>();
|
|
|
- var itemTaskList = new List<AppBCItemTaskModel>();
|
|
|
- var endLine1 = 1;
|
|
|
- var endLine2 = 3;
|
|
|
- foreach (var item in itemNoAndSourceLocation)
|
|
|
- {
|
|
|
- var sourceLocationArray = item.Value.Split('/');
|
|
|
- var itemNo = item.Key.Split('/');
|
|
|
- for (var i = 0; i < itemNo.Length; i++)
|
|
|
- {
|
|
|
- itemTaskList.Add(new AppBCItemTaskModel()
|
|
|
- {
|
|
|
- TaskNo = itemNo[i],
|
|
|
- SourceLocation = sourceLocationArray[0]
|
|
|
- });
|
|
|
- }
|
|
|
- var sourceLocation = sourceLocationArray[0].Split('-');
|
|
|
- var crane = 2;
|
|
|
- var endCol = 65;
|
|
|
- var endRow = endLine2;
|
|
|
- if (Convert.ToInt32(sourceLocation[1]) == 1 || Convert.ToInt32(sourceLocation[1]) == 2)
|
|
|
- {
|
|
|
- crane = 1;
|
|
|
- endCol = 47;
|
|
|
- endRow = endLine1;
|
|
|
- }
|
|
|
- sourceLocationList.Add(new OperationBo()
|
|
|
- {
|
|
|
- StartRow = Convert.ToInt32(sourceLocation[1]),
|
|
|
- StartCol = Convert.ToInt32(sourceLocation[2]),
|
|
|
- StartLayer = Convert.ToInt32(sourceLocation[3]),
|
|
|
- IsStart = false,
|
|
|
- OperateNo = Guid.NewGuid().ToString(),
|
|
|
- MachineTaskId = 5,
|
|
|
- Crane = crane,
|
|
|
- Line = endRow,
|
|
|
- EndRow = endRow,
|
|
|
- EndCol = endCol,
|
|
|
- EndLayer = 1,
|
|
|
- });
|
|
|
- if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 1)
|
|
|
- {
|
|
|
- endLine1 = 2;
|
|
|
- }
|
|
|
- else if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 2)
|
|
|
- {
|
|
|
- endLine1 = 1;
|
|
|
- }
|
|
|
- if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 3)
|
|
|
- {
|
|
|
- endLine2 = 4;
|
|
|
- }
|
|
|
- else if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 4)
|
|
|
- {
|
|
|
- endLine2 = 3;
|
|
|
- }
|
|
|
- }
|
|
|
- var operationCrane1List = sourceLocationList.Where(i => i.Crane == 1).ToList();
|
|
|
- var operationCrane2List = sourceLocationList.Where(i => i.Crane == 2).ToList();
|
|
|
- operationCrane1List.ForEach(t =>
|
|
|
- {
|
|
|
- if (!CustomerEnv.OperationCrane1List.Any(i => i.StartLayer == t.StartLayer && i.StartCol == t.StartCol && i.StartRow == t.StartRow))
|
|
|
- {
|
|
|
- CustomerEnv.OperationCrane1List.Add(t);
|
|
|
- }
|
|
|
- });
|
|
|
- operationCrane2List.ForEach(t =>
|
|
|
- {
|
|
|
- if (!CustomerEnv.OperationCrane2List.Any(i => i.StartLayer == t.StartLayer && i.StartCol == t.StartCol && i.StartRow == t.StartRow))
|
|
|
- {
|
|
|
- CustomerEnv.OperationCrane2List.Add(t);
|
|
|
- }
|
|
|
- });
|
|
|
- var dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
- itemTaskList,
|
|
|
- t => new { t.TaskNo }, //更新条件
|
|
|
- null,
|
|
|
- t => new { t.SourceLocation } //更新字段
|
|
|
- ); //批量更新
|
|
|
- if (dbRes)
|
|
|
- {
|
|
|
- res.Message = $"下发堆垛机任务成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.IsSucceed = false;
|
|
|
- res.Message = $"下发堆垛机任务失败";
|
|
|
- return res;
|
|
|
- }
|
|
|
+ ///// <summary>
|
|
|
+ ///// 下发堆垛机任务,更新子表库位信息
|
|
|
+ ///// </summary>
|
|
|
+ ///// <param name="itemNoAndSourceLocation"></param>
|
|
|
+ ///// <returns></returns>
|
|
|
+ //public RpcResponse<object> AddMachineTask(Dictionary<string, string> itemNoAndSourceLocation)
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // var sourceLocationList = new List<OperationBo>();
|
|
|
+ // var itemTaskList = new List<AppBCItemTaskModel>();
|
|
|
+ // var endLine1 = 1;
|
|
|
+ // var endLine2 = 3;
|
|
|
+ // foreach (var item in itemNoAndSourceLocation)
|
|
|
+ // {
|
|
|
+ // var sourceLocationArray = item.Value.Split('/');
|
|
|
+ // var itemNo = item.Key.Split('/');
|
|
|
+ // for (var i = 0; i < itemNo.Length; i++)
|
|
|
+ // {
|
|
|
+ // itemTaskList.Add(new AppBCItemTaskModel()
|
|
|
+ // {
|
|
|
+ // TaskNo = itemNo[i],
|
|
|
+ // SourceLocation = sourceLocationArray[0]
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // var sourceLocation = sourceLocationArray[0].Split('-');
|
|
|
+ // var crane = 2;
|
|
|
+ // var endCol = 65;
|
|
|
+ // var endRow = endLine2;
|
|
|
+ // if (Convert.ToInt32(sourceLocation[1]) == 1 || Convert.ToInt32(sourceLocation[1]) == 2)
|
|
|
+ // {
|
|
|
+ // crane = 1;
|
|
|
+ // endCol = 47;
|
|
|
+ // endRow = endLine1;
|
|
|
+ // }
|
|
|
+ // sourceLocationList.Add(new OperationBo()
|
|
|
+ // {
|
|
|
+ // StartRow = Convert.ToInt32(sourceLocation[1]),
|
|
|
+ // StartCol = Convert.ToInt32(sourceLocation[2]),
|
|
|
+ // StartLayer = Convert.ToInt32(sourceLocation[3]),
|
|
|
+ // IsStart = false,
|
|
|
+ // OperateNo = Guid.NewGuid().ToString(),
|
|
|
+ // MachineTaskId = 5,
|
|
|
+ // Crane = crane,
|
|
|
+ // Line = endRow,
|
|
|
+ // EndRow = endRow,
|
|
|
+ // EndCol = endCol,
|
|
|
+ // EndLayer = 1,
|
|
|
+ // });
|
|
|
+ // if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 1)
|
|
|
+ // {
|
|
|
+ // endLine1 = 2;
|
|
|
+ // }
|
|
|
+ // else if ((Convert.ToInt32(sourceLocation[1]) == 01 || Convert.ToInt32(sourceLocation[1]) == 02) && endLine1 == 2)
|
|
|
+ // {
|
|
|
+ // endLine1 = 1;
|
|
|
+ // }
|
|
|
+ // if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 3)
|
|
|
+ // {
|
|
|
+ // endLine2 = 4;
|
|
|
+ // }
|
|
|
+ // else if ((Convert.ToInt32(sourceLocation[1]) == 03 || Convert.ToInt32(sourceLocation[1]) == 04) && endLine2 == 4)
|
|
|
+ // {
|
|
|
+ // endLine2 = 3;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // var operationCrane1List = sourceLocationList.Where(i => i.Crane == 1).ToList();
|
|
|
+ // var operationCrane2List = sourceLocationList.Where(i => i.Crane == 2).ToList();
|
|
|
+ // operationCrane1List.ForEach(t =>
|
|
|
+ // {
|
|
|
+ // if (!CustomerEnv.OperationCrane1List.Any(i => i.StartLayer == t.StartLayer && i.StartCol == t.StartCol && i.StartRow == t.StartRow))
|
|
|
+ // {
|
|
|
+ // CustomerEnv.OperationCrane1List.Add(t);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // operationCrane2List.ForEach(t =>
|
|
|
+ // {
|
|
|
+ // if (!CustomerEnv.OperationCrane2List.Any(i => i.StartLayer == t.StartLayer && i.StartCol == t.StartCol && i.StartRow == t.StartRow))
|
|
|
+ // {
|
|
|
+ // CustomerEnv.OperationCrane2List.Add(t);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // var dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
+ // itemTaskList,
|
|
|
+ // t => new { t.TaskNo }, //更新条件
|
|
|
+ // null,
|
|
|
+ // t => new { t.SourceLocation } //更新字段
|
|
|
+ // ); //批量更新
|
|
|
+ // if (dbRes)
|
|
|
+ // {
|
|
|
+ // res.Message = $"下发堆垛机任务成功";
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // res.IsSucceed = false;
|
|
|
+ // res.Message = $"下发堆垛机任务失败";
|
|
|
+ // return res;
|
|
|
+ //}
|
|
|
|
|
|
//public RpcResponse<object> UpdateItemUpInventory()
|
|
|
//{
|
|
@@ -404,123 +404,123 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
//}
|
|
|
|
|
|
// 更新任务库存 防止新物料 下架任务比上架任务先到 而下架库存不更新1
|
|
|
- public RpcResponse<object> UpdateItemLowInventory()
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- var wmsItemLowList = Env.DAL.ReadDataTable($"select * from App_BC_ItemLow where IsSynced_Bit = 0 and SourceLocations_Str = '新'").DtToList<AppBCItemLowModel>();
|
|
|
- if (wmsItemLowList?.Count != 0)
|
|
|
- {
|
|
|
- CustomerEnv.AddWMSItemLowList(wmsItemLowList);
|
|
|
- var itemTaskList = new List<AppBCItemTaskModel>();
|
|
|
- foreach (var item in wmsItemLowList)
|
|
|
- {
|
|
|
- var sourceLocationArray = item.SourceLocations.Split('/');
|
|
|
- var itemNo = item.ItemNo.Split('/');
|
|
|
- for (var i = 0; i < itemNo.Length; i++)
|
|
|
- {
|
|
|
- itemTaskList.Add(new AppBCItemTaskModel()
|
|
|
- {
|
|
|
- TaskNo = itemNo[i],
|
|
|
- SourceLocation = sourceLocationArray[0]
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- var dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
- itemTaskList,
|
|
|
- t => new { t.TaskNo }, //更新条件
|
|
|
- null,
|
|
|
- t => new { t.SourceLocation } //更新字段
|
|
|
- ); //批量更新
|
|
|
- res.Message = "库位更新成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
- res.Message = "无库位更新";
|
|
|
- return res;
|
|
|
- }
|
|
|
+ //public RpcResponse<object> UpdateItemLowInventory()
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // var wmsItemLowList = Env.DAL.ReadDataTable($"select * from App_BC_ItemLow where IsSynced_Bit = 0 and SourceLocations_Str = '新'").DtToList<AppBCItemLowModel>();
|
|
|
+ // if (wmsItemLowList?.Count != 0)
|
|
|
+ // {
|
|
|
+ // CustomerEnv.AddWMSItemLowList(wmsItemLowList);
|
|
|
+ // var itemTaskList = new List<AppBCItemTaskModel>();
|
|
|
+ // foreach (var item in wmsItemLowList)
|
|
|
+ // {
|
|
|
+ // var sourceLocationArray = item.SourceLocations.Split('/');
|
|
|
+ // var itemNo = item.ItemNo.Split('/');
|
|
|
+ // for (var i = 0; i < itemNo.Length; i++)
|
|
|
+ // {
|
|
|
+ // itemTaskList.Add(new AppBCItemTaskModel()
|
|
|
+ // {
|
|
|
+ // TaskNo = itemNo[i],
|
|
|
+ // SourceLocation = sourceLocationArray[0]
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // var dbRes = Env.DAL.BatchUpdateOrInsert(
|
|
|
+ // itemTaskList,
|
|
|
+ // t => new { t.TaskNo }, //更新条件
|
|
|
+ // null,
|
|
|
+ // t => new { t.SourceLocation } //更新字段
|
|
|
+ // ); //批量更新
|
|
|
+ // res.Message = "库位更新成功";
|
|
|
+ // return res;
|
|
|
+ // }
|
|
|
+ // res.Message = "无库位更新";
|
|
|
+ // return res;
|
|
|
+ //}
|
|
|
|
|
|
- /// <summary>
|
|
|
- /// 删除任务接口 6
|
|
|
- /// </summary>
|
|
|
- /// <param name="itemTaskType">1上架0下架</param>
|
|
|
- /// <returns></returns>
|
|
|
- public RpcResponse<object> CloseItemTask(int itemTaskType)
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- string upOrLow;
|
|
|
- if (itemTaskType == 0)
|
|
|
- {
|
|
|
- upOrLow = "App_BC_ItemLow";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- upOrLow = "App_BC_ItemUp";
|
|
|
- }
|
|
|
- var wmsCloseItemTaskList = Env.DAL.ReadDataTable($"select * from App_BC_ItemTask where State_Int = 6 and TaskType_Bit = {itemTaskType} ").DtToList<AppBCItemTaskModel>();
|
|
|
- wmsCloseItemTaskList.Sort((item1, item2) => item1.TaskNo.CompareTo(item2.TaskNo));
|
|
|
- var ColseItemTaskList = wmsCloseItemTaskList.ToLookup(item => new { item.BillNo, item.WorkCenter, item.ItemCode,item.WarehouseCode });
|
|
|
- var selectFilter = "";
|
|
|
- foreach (var itemKey in ColseItemTaskList)
|
|
|
- {
|
|
|
- var itemKeyFilter = "";
|
|
|
- foreach (var itemValue in itemKey)
|
|
|
- {
|
|
|
- if (itemKeyFilter == "")
|
|
|
- {
|
|
|
- itemKeyFilter = $"{itemValue.TaskNo}";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- itemKeyFilter += $"/{itemValue.TaskNo}";
|
|
|
- }
|
|
|
- }
|
|
|
- if (selectFilter == "")
|
|
|
- {
|
|
|
- selectFilter = $"'{itemKeyFilter}'";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- selectFilter += $",'{itemKeyFilter}'";
|
|
|
- }
|
|
|
- }
|
|
|
- var deleteItemFilter = "";
|
|
|
- dynamic closeItem;
|
|
|
- if (itemTaskType == 0)
|
|
|
- {
|
|
|
- closeItem = Env.DAL.ReadDataTable($" SELECT * FROM {upOrLow} where ItemNo_Str in ({selectFilter}) ").DtToList<AppBCItemLowModel>();
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- closeItem = Env.DAL.ReadDataTable($" SELECT * FROM {upOrLow} where ItemNo_Str in ({selectFilter}) ").DtToList<AppBCItemUpModel>();
|
|
|
- }
|
|
|
- if (closeItem.Count == 0) { res.IsSucceed = false; res.Message = $"无任务需关闭"; return res; }
|
|
|
- for (int i = 0; i < closeItem.Count; i++)
|
|
|
- {
|
|
|
- if (deleteItemFilter == "")
|
|
|
- {
|
|
|
- deleteItemFilter = $"'{closeItem[i].ItemNo}'";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- deleteItemFilter += $",'{closeItem[i].ItemNo}'";
|
|
|
- }
|
|
|
- }
|
|
|
- Env.DAL.ReadDataTable($"delete from {upOrLow} where ItemNo_Str in ({deleteItemFilter}) ");
|
|
|
- var splitDeleteItemFilter = deleteItemFilter.Split('\'', '/', ',').Where(item => item != "").ToList();
|
|
|
- var deleteItemTaskFilter = "";
|
|
|
- for (int j = 0; j < splitDeleteItemFilter.Count; j++)
|
|
|
- {
|
|
|
- if (deleteItemTaskFilter == "")
|
|
|
- {
|
|
|
- deleteItemTaskFilter = $"'{splitDeleteItemFilter[j]}'";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- deleteItemTaskFilter += $",'{splitDeleteItemFilter[j]}'";
|
|
|
- }
|
|
|
- }
|
|
|
- Env.DAL.ReadDataTable($"delete from App_BC_ItemTask where TaskNo_Str in ({deleteItemTaskFilter}) ");
|
|
|
- res.Message = $"关闭任务成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
+ ///// <summary>
|
|
|
+ ///// 删除任务接口 6
|
|
|
+ ///// </summary>
|
|
|
+ ///// <param name="itemTaskType">1上架0下架</param>
|
|
|
+ ///// <returns></returns>
|
|
|
+ //public RpcResponse<object> CloseItemTask(int itemTaskType)
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // string upOrLow;
|
|
|
+ // if (itemTaskType == 0)
|
|
|
+ // {
|
|
|
+ // upOrLow = "App_BC_ItemLow";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // upOrLow = "App_BC_ItemUp";
|
|
|
+ // }
|
|
|
+ // var wmsCloseItemTaskList = Env.DAL.ReadDataTable($"select * from App_BC_ItemTask where State_Int = 6 and TaskType_Bit = {itemTaskType} ").DtToList<AppBCItemTaskModel>();
|
|
|
+ // wmsCloseItemTaskList.Sort((item1, item2) => item1.TaskNo.CompareTo(item2.TaskNo));
|
|
|
+ // var ColseItemTaskList = wmsCloseItemTaskList.ToLookup(item => new { item.BillNo, item.WorkCenter, item.ItemCode,item.WarehouseCode });
|
|
|
+ // var selectFilter = "";
|
|
|
+ // foreach (var itemKey in ColseItemTaskList)
|
|
|
+ // {
|
|
|
+ // var itemKeyFilter = "";
|
|
|
+ // foreach (var itemValue in itemKey)
|
|
|
+ // {
|
|
|
+ // if (itemKeyFilter == "")
|
|
|
+ // {
|
|
|
+ // itemKeyFilter = $"{itemValue.TaskNo}";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // itemKeyFilter += $"/{itemValue.TaskNo}";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (selectFilter == "")
|
|
|
+ // {
|
|
|
+ // selectFilter = $"'{itemKeyFilter}'";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // selectFilter += $",'{itemKeyFilter}'";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // var deleteItemFilter = "";
|
|
|
+ // dynamic closeItem;
|
|
|
+ // if (itemTaskType == 0)
|
|
|
+ // {
|
|
|
+ // closeItem = Env.DAL.ReadDataTable($" SELECT * FROM {upOrLow} where ItemNo_Str in ({selectFilter}) ").DtToList<AppBCItemLowModel>();
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // closeItem = Env.DAL.ReadDataTable($" SELECT * FROM {upOrLow} where ItemNo_Str in ({selectFilter}) ").DtToList<AppBCItemUpModel>();
|
|
|
+ // }
|
|
|
+ // if (closeItem.Count == 0) { res.IsSucceed = false; res.Message = $"无任务需关闭"; return res; }
|
|
|
+ // for (int i = 0; i < closeItem.Count; i++)
|
|
|
+ // {
|
|
|
+ // if (deleteItemFilter == "")
|
|
|
+ // {
|
|
|
+ // deleteItemFilter = $"'{closeItem[i].ItemNo}'";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // deleteItemFilter += $",'{closeItem[i].ItemNo}'";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Env.DAL.ReadDataTable($"delete from {upOrLow} where ItemNo_Str in ({deleteItemFilter}) ");
|
|
|
+ // var splitDeleteItemFilter = deleteItemFilter.Split('\'', '/', ',').Where(item => item != "").ToList();
|
|
|
+ // var deleteItemTaskFilter = "";
|
|
|
+ // for (int j = 0; j < splitDeleteItemFilter.Count; j++)
|
|
|
+ // {
|
|
|
+ // if (deleteItemTaskFilter == "")
|
|
|
+ // {
|
|
|
+ // deleteItemTaskFilter = $"'{splitDeleteItemFilter[j]}'";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // deleteItemTaskFilter += $",'{splitDeleteItemFilter[j]}'";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // Env.DAL.ReadDataTable($"delete from App_BC_ItemTask where TaskNo_Str in ({deleteItemTaskFilter}) ");
|
|
|
+ // res.Message = $"关闭任务成功";
|
|
|
+ // return res;
|
|
|
+ //}
|
|
|
}
|
|
|
}
|