|
@@ -165,91 +165,49 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
// return res;
|
|
|
//}
|
|
|
|
|
|
- // 获取任务表 上架
|
|
|
- public RpcResponse<object> GetItemUpTaskTable(PageBo page, AppBCItemTaskVo item, int show, int taskState)
|
|
|
- {
|
|
|
- var taskNoSql = item.TaskNo.Split(',');
|
|
|
- var taskNoinFiler = "";
|
|
|
- for (var i = 0; i < taskNoSql.Length; i++)
|
|
|
- {
|
|
|
- if (taskNoinFiler == "")
|
|
|
- {
|
|
|
- taskNoinFiler = $"'{taskNoSql[i]}'";
|
|
|
- }
|
|
|
- else taskNoinFiler += $",'{taskNoSql[i]}'";
|
|
|
- }
|
|
|
- var taskNoFilterStr = $" TaskNo_Str in ({taskNoinFiler})";
|
|
|
- var woNoSql = item.WoNo.Split(',');
|
|
|
- var woNoinFiler = "";
|
|
|
- for (var i = 0; i < woNoSql.Length; i++)
|
|
|
- {
|
|
|
- if (woNoinFiler == "")
|
|
|
- {
|
|
|
- woNoinFiler = $"'{woNoSql[i]}'";
|
|
|
- }
|
|
|
- else woNoinFiler += $",'{woNoSql[i]}'";
|
|
|
- }
|
|
|
- var woNoFilterStr = $" WoNo_Str in ({woNoinFiler})";
|
|
|
- var woNoFilter = item.WoNo == null ? "1=1" : item.WoNo == "" ? "1=1" : $"{woNoFilterStr}";
|
|
|
- var taskNoFilter = item.TaskNo == null ? "1=1" : item.TaskNo == "" ? "1=1" : $"{taskNoFilterStr}";
|
|
|
- var typefilter = $"TaskType_Bit = 1";
|
|
|
- var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
- var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
- var sourceLocationGroupFilter = item.SourceLocationGroup == null ? "1=1" : item.SourceLocationGroup == "" ? "1=1" : $"SourceLocationGroup_Str='{item.SourceLocationGroup}'";
|
|
|
- var mergedFilter = show == 1 ? "IsMerged_Bit='1'" : show == 0 ? "IsMerged_Bit='0'" : $"1=1";
|
|
|
- var taskStateFilter = taskState == 10 ? "1=1" : $"State_Int='{taskState}'";
|
|
|
- var filterStr = $"{typefilter} and {billNoFilter} and {taskNoFilter} and {itemCodeFilter} and {woNoFilter} and {mergedFilter} and {sourceLocationGroupFilter} and {taskStateFilter}";
|
|
|
- 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> GetItemLowTaskTable(PageBo page, AppBCItemTaskVo item, int show, int taskState)
|
|
|
- {
|
|
|
- var taskNoSql = item.TaskNo.Split(',');
|
|
|
- var taskNoinFiler = "";
|
|
|
- for (var i = 0; i < taskNoSql.Length; i++)
|
|
|
- {
|
|
|
- if (taskNoinFiler == "")
|
|
|
- {
|
|
|
- taskNoinFiler = $"'{taskNoSql[i]}'";
|
|
|
- }
|
|
|
- else taskNoinFiler += $",'{taskNoSql[i]}'";
|
|
|
- }
|
|
|
- var taskNoFilterStr = $" TaskNo_Str in ({taskNoinFiler})";
|
|
|
+ // 获取任务表 上架
|
|
|
+ //public RpcResponse<object> GetItemUpTaskTable(PageBo page, AppBCItemTaskVo item, int show, int taskState)
|
|
|
+ //{
|
|
|
+ // var taskNoSql = item.TaskNo.Split(',');
|
|
|
+ // var taskNoinFiler = "";
|
|
|
+ // for (var i = 0; i < taskNoSql.Length; i++)
|
|
|
+ // {
|
|
|
+ // if (taskNoinFiler == "")
|
|
|
+ // {
|
|
|
+ // taskNoinFiler = $"'{taskNoSql[i]}'";
|
|
|
+ // }
|
|
|
+ // else taskNoinFiler += $",'{taskNoSql[i]}'";
|
|
|
+ // }
|
|
|
+ // var taskNoFilterStr = $" TaskNo_Str in ({taskNoinFiler})";
|
|
|
+ // var woNoSql = item.WoNo.Split(',');
|
|
|
+ // var woNoinFiler = "";
|
|
|
+ // for (var i = 0; i < woNoSql.Length; i++)
|
|
|
+ // {
|
|
|
+ // if (woNoinFiler == "")
|
|
|
+ // {
|
|
|
+ // woNoinFiler = $"'{woNoSql[i]}'";
|
|
|
+ // }
|
|
|
+ // else woNoinFiler += $",'{woNoSql[i]}'";
|
|
|
+ // }
|
|
|
+ // var woNoFilterStr = $" WoNo_Str in ({woNoinFiler})";
|
|
|
+ // var woNoFilter = item.WoNo == null ? "1=1" : item.WoNo == "" ? "1=1" : $"{woNoFilterStr}";
|
|
|
+ // var taskNoFilter = item.TaskNo == null ? "1=1" : item.TaskNo == "" ? "1=1" : $"{taskNoFilterStr}";
|
|
|
+ // var typefilter = $"TaskType_Bit = 1";
|
|
|
+ // var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
+ // var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
+ // var sourceLocationGroupFilter = item.SourceLocationGroup == null ? "1=1" : item.SourceLocationGroup == "" ? "1=1" : $"SourceLocationGroup_Str='{item.SourceLocationGroup}'";
|
|
|
+ // var mergedFilter = show == 1 ? "IsMerged_Bit='1'" : show == 0 ? "IsMerged_Bit='0'" : $"1=1";
|
|
|
+ // var taskStateFilter = taskState == 10 ? "1=1" : $"State_Int='{taskState}'";
|
|
|
+ // var filterStr = $"{typefilter} and {billNoFilter} and {taskNoFilter} and {itemCodeFilter} and {woNoFilter} and {mergedFilter} and {sourceLocationGroupFilter} and {taskStateFilter}";
|
|
|
+ // var sqlStr = GetTableSql("App_BC_ItemTask", filterStr, page);
|
|
|
+ // var taskTable = Env.DAL.ReadDataTable(sqlStr).DtToList<AppBCItemTaskVo>();
|
|
|
+ // return new RpcResponse<object>()
|
|
|
+ // {
|
|
|
+ // Data = taskTable
|
|
|
+ // };
|
|
|
+ //}
|
|
|
|
|
|
- var woNoSql = item.WoNo.Split(',');
|
|
|
- var woNoinFiler = "";
|
|
|
- for (var i = 0; i < woNoSql.Length; i++)
|
|
|
- {
|
|
|
- if (woNoinFiler == "")
|
|
|
- {
|
|
|
- woNoinFiler = $"'{woNoSql[i]}'";
|
|
|
- }
|
|
|
- else woNoinFiler += $",'{woNoSql[i]}'";
|
|
|
- }
|
|
|
- var woNoFilterStr = $" WoNo_Str in ({woNoinFiler})";
|
|
|
- var typefilter = $"TaskType_Bit = 0";
|
|
|
- var billNoFilter = item.BillNo == null ? "1=1" : item.BillNo == "" ? "1=1" : $"BillNo_Str='{item.BillNo}'";
|
|
|
- var woNoFilter = item.WoNo == null ? "1=1" : item.WoNo == "" ? "1=1" : $"{woNoFilterStr}";
|
|
|
- var taskNoFilter = item.TaskNo == null ? "1=1" : item.TaskNo == "" ? "1=1" : $"{taskNoFilterStr}";
|
|
|
- var itemCodeFilter = item.ItemCode == null ? "1=1" : item.ItemCode == "" ? "1=1" : $"ItemCode_Str='{item.ItemCode}'";
|
|
|
- var mergedFilter = show == 1 ? "IsMerged_Bit='1'" : show == 0 ? "IsMerged_Bit='0'" : $"1=1";
|
|
|
- var sourceLocationGroupFilter = item.SourceLocationGroup == null ? "1=1" : item.SourceLocationGroup == "" ? "1=1" : $"SourceLocationGroup_Str='{item.SourceLocationGroup}'";
|
|
|
- var taskStateFilter = taskState == 10 ? "1=1" : $"State_Int='{taskState}'";
|
|
|
- var workCenterFilter = item.WorkCenter == null ? "1=1" : item.WorkCenter == "" ? "1=1" : $"WorkCenter_Str='{item.WorkCenter}'";
|
|
|
- var filterStr = $"{typefilter} and {billNoFilter} and {taskNoFilter} and {itemCodeFilter} and {woNoFilter} and {mergedFilter} and {sourceLocationGroupFilter} and {taskStateFilter} and {workCenterFilter}";
|
|
|
- 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> MergeItemLowList(string workNos, string sourceLocationGroup)
|
|
@@ -645,56 +603,28 @@ namespace SCADA_DAQ.Customer.Service
|
|
|
// return new RpcResponse<object>();
|
|
|
//}
|
|
|
|
|
|
- public RpcResponse<object> UpdateItemTaskSourceLocation()
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- var ok = Env.DAL.ReadDataTable($@" UPDATE App_BC_ItemTask
|
|
|
- SET SourceLocation_Str = COALESCE((
|
|
|
- SELECT b.SourceLocation_Str
|
|
|
- FROM (
|
|
|
- SELECT App_BC_Inventory.Qty_Dec, App_BC_Inventory.SourceLocation_Str FROM App_BC_Inventory
|
|
|
- WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
- ORDER BY App_BC_Inventory.Qty_Dec DESC
|
|
|
- ) b
|
|
|
- ), null),
|
|
|
- SourceLocationTag_Str = COALESCE((
|
|
|
- SELECT b.LocationName_Str
|
|
|
- FROM (
|
|
|
- SELECT App_BC_Inventory.Qty_Dec, App_BC_Inventory.LocationName_Str FROM App_BC_Inventory
|
|
|
- WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
- ORDER BY App_BC_Inventory.Qty_Dec DESC
|
|
|
- ) b
|
|
|
- ), null)
|
|
|
- WHERE EXISTS (
|
|
|
- SELECT 1
|
|
|
- FROM App_BC_Inventory
|
|
|
- WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
- AND App_BC_ItemTask.State_Int = 0
|
|
|
- ) AND (App_BC_ItemTask.SourceLocation_Str is null or App_BC_ItemTask.SourceLocation_Str = '') And TaskType_Bit = 1 ");
|
|
|
- res.Message = "上架任务库位已分配";
|
|
|
- return res;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
- public RpcResponse<object> UpdateItemTaskSourceLocation1()
|
|
|
- {
|
|
|
- var res = new RpcResponse<object>();
|
|
|
- var ok = Env.DAL.ReadDataTable($@" UPDATE App_BC_ItemTask
|
|
|
- SET SourceLocation_Str = COALESCE((
|
|
|
- SELECT b.SourceLocation_Str
|
|
|
- FROM (
|
|
|
- SELECT App_BC_Inventory.Qty_Dec, App_BC_Inventory.SourceLocation_Str FROM App_BC_Inventory
|
|
|
- WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
- ORDER BY App_BC_Inventory.Qty_Dec DESC
|
|
|
- ) b
|
|
|
- ), null)
|
|
|
- WHERE EXISTS (
|
|
|
- SELECT 1
|
|
|
- FROM App_BC_Inventory
|
|
|
- WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
- AND App_BC_ItemTask.State_Int = 0
|
|
|
- ) AND (App_BC_ItemTask.SourceLocation_Str is null or App_BC_ItemTask.SourceLocation_Str = '') And TaskType_Bit = 0 ");
|
|
|
- res.Message = "更新库位成功";
|
|
|
- return res;
|
|
|
- }
|
|
|
+ //public RpcResponse<object> UpdateItemTaskSourceLocation1()
|
|
|
+ //{
|
|
|
+ // var res = new RpcResponse<object>();
|
|
|
+ // var ok = Env.DAL.ReadDataTable($@" UPDATE App_BC_ItemTask
|
|
|
+ // SET SourceLocation_Str = COALESCE((
|
|
|
+ // SELECT b.SourceLocation_Str
|
|
|
+ // FROM (
|
|
|
+ // SELECT App_BC_Inventory.Qty_Dec, App_BC_Inventory.SourceLocation_Str FROM App_BC_Inventory
|
|
|
+ // WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
+ // ORDER BY App_BC_Inventory.Qty_Dec DESC
|
|
|
+ // ) b
|
|
|
+ // ), null)
|
|
|
+ // WHERE EXISTS (
|
|
|
+ // SELECT 1
|
|
|
+ // FROM App_BC_Inventory
|
|
|
+ // WHERE App_BC_Inventory.ItemCode_Str = App_BC_ItemTask.ItemCode_Str AND App_BC_Inventory.WarehouseCode_Str = App_BC_ItemTask.WarehouseCode_Str
|
|
|
+ // AND App_BC_ItemTask.State_Int = 0
|
|
|
+ // ) AND (App_BC_ItemTask.SourceLocation_Str is null or App_BC_ItemTask.SourceLocation_Str = '') And TaskType_Bit = 0 ");
|
|
|
+ // res.Message = "更新库位成功";
|
|
|
+ // return res;
|
|
|
+ //}
|
|
|
}
|
|
|
}
|