去除引用common.props
This commit is contained in:
@@ -5,7 +5,6 @@ using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.Extras.CollectiveOAuth.Models;
|
||||
using JNPF.Extras.CollectiveOAuth.Utils;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
@@ -106,7 +105,7 @@ namespace Tnb.ProductionMgr
|
||||
// }
|
||||
// return data!;
|
||||
// }
|
||||
|
||||
|
||||
private async Task<dynamic> GetList(VisualDevModelListQueryInput input)
|
||||
{
|
||||
var db = _repository.AsSugarClient();
|
||||
@@ -119,22 +118,22 @@ namespace Tnb.ProductionMgr
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b, c) => c.EnCode == DictConst.MeasurementUnit)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d) => c.Id == d.DictionaryTypeId && a.unit_id == d.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e) => a.mo_status == e.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e,f) => a.mo_type==f.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b, c, d, e, f) => a.mo_type == f.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(moCode), (a, b, c, d, e) => a.mo_code.Contains(moCode))
|
||||
.WhereIF(!string.IsNullOrEmpty(combineMoCode),
|
||||
(a, b, c, d, e) => a.combine_mo_code.Contains(combineMoCode))
|
||||
.WhereIF(!string.IsNullOrEmpty(moStatus), (a, b, c, d, e) => a.mo_status == moStatus)
|
||||
.Where(a=>SqlFunc.IsNullOrEmpty(a.parent_id))
|
||||
.OrderByDescending(a=>a.create_time)
|
||||
.Select((a, b, c, d, e,f) => new PrdMoListOuput
|
||||
.Where(a => SqlFunc.IsNullOrEmpty(a.parent_id))
|
||||
.OrderByDescending(a => a.create_time)
|
||||
.Select((a, b, c, d, e, f) => new PrdMoListOuput
|
||||
{
|
||||
id = a.id,
|
||||
mo_type = f.FullName,
|
||||
mo_source = a.mo_source=="1" ? "ERP同步" : "新建/导入",
|
||||
mo_source = a.mo_source == "1" ? "ERP同步" : "新建/导入",
|
||||
mo_code = a.mo_code,
|
||||
plan_start_date = a.plan_start_date==null ? "" : a.plan_start_date.Value.ToString("yyyy-MM-dd"),
|
||||
plan_end_date = a.plan_end_date==null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"),
|
||||
material_id = b.code+"/"+b.name,
|
||||
plan_start_date = a.plan_start_date == null ? "" : a.plan_start_date.Value.ToString("yyyy-MM-dd"),
|
||||
plan_end_date = a.plan_end_date == null ? "" : a.plan_end_date.Value.ToString("yyyy-MM-dd"),
|
||||
material_id = b.code + "/" + b.name,
|
||||
material_id_id = b.id,
|
||||
plan_qty = a.plan_qty,
|
||||
unit_id = d.FullName,
|
||||
@@ -145,17 +144,17 @@ namespace Tnb.ProductionMgr
|
||||
.LeftJoin<DictionaryTypeEntity>((aa, bb, cc) => cc.EnCode == DictConst.MeasurementUnit)
|
||||
.LeftJoin<DictionaryDataEntity>((aa, bb, cc, dd) => cc.Id == dd.DictionaryTypeId && aa.unit_id == dd.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((aa, bb, cc, dd, ee) => aa.mo_status == ee.Id)
|
||||
.LeftJoin<DictionaryDataEntity>((aa, bb, cc, dd, ee,ff) => aa.mo_type==ff.Id)
|
||||
.Where(aa=>aa.parent_id==a.id)
|
||||
.ToList((aa,bb,cc,dd,ee,ff)=>new PrdMoListOuput
|
||||
.LeftJoin<DictionaryDataEntity>((aa, bb, cc, dd, ee, ff) => aa.mo_type == ff.Id)
|
||||
.Where(aa => aa.parent_id == a.id)
|
||||
.ToList((aa, bb, cc, dd, ee, ff) => new PrdMoListOuput
|
||||
{
|
||||
id = aa.id,
|
||||
mo_type = ff.FullName,
|
||||
mo_source = aa.mo_source=="1" ? "ERP同步" : "新建/导入",
|
||||
mo_source = aa.mo_source == "1" ? "ERP同步" : "新建/导入",
|
||||
mo_code = aa.mo_code,
|
||||
plan_start_date = aa.plan_start_date==null ? "" : aa.plan_start_date.Value.ToString("yyyy-MM-dd"),
|
||||
plan_end_date = aa.plan_end_date==null ? "" : aa.plan_end_date.Value.ToString("yyyy-MM-dd"),
|
||||
material_id = bb.code+"/"+bb.name,
|
||||
plan_start_date = aa.plan_start_date == null ? "" : aa.plan_start_date.Value.ToString("yyyy-MM-dd"),
|
||||
plan_end_date = aa.plan_end_date == null ? "" : aa.plan_end_date.Value.ToString("yyyy-MM-dd"),
|
||||
material_id = bb.code + "/" + bb.name,
|
||||
material_id_id = bb.id,
|
||||
plan_qty = aa.plan_qty,
|
||||
unit_id = dd.FullName,
|
||||
@@ -296,7 +295,7 @@ namespace Tnb.ProductionMgr
|
||||
// }
|
||||
// return multi;
|
||||
// }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 关联同组工单
|
||||
/// </summary>
|
||||
@@ -308,9 +307,9 @@ namespace Tnb.ProductionMgr
|
||||
(bool executeRes, string errMsg) multi = (true, "");
|
||||
var list = await _repository.AsSugarClient().Queryable<PrdMo>()
|
||||
.LeftJoin<ToolMoldsMaterial>((a, b) => a.material_id == b.material_id)
|
||||
.LeftJoin<ToolMolds>((a,b,c)=>b.mold_id==c.id)
|
||||
.Where((a, b,c) => input.WorkOrderIds.Contains(a.id))
|
||||
.Select((a, b,c) => new
|
||||
.LeftJoin<ToolMolds>((a, b, c) => b.mold_id == c.id)
|
||||
.Where((a, b, c) => input.WorkOrderIds.Contains(a.id))
|
||||
.Select((a, b, c) => new
|
||||
{
|
||||
planDate = a.plan_start_date,
|
||||
mold_code = c.mold_code,
|
||||
@@ -386,24 +385,24 @@ namespace Tnb.ProductionMgr
|
||||
scheduled_qty = a.scheduled_qty,
|
||||
tobe_scheduled_qty = a.plan_qty - a.scheduled_qty,
|
||||
reported_work_qty = a.reported_work_qty,
|
||||
complete_rate = a.reported_work_qty==null?0:SqlFunc.ToDecimal(a.reported_work_qty*100)/SqlFunc.ToDecimal(a.plan_qty),
|
||||
complete_rate = a.reported_work_qty == null ? 0 : SqlFunc.ToDecimal(a.reported_work_qty * 100) / SqlFunc.ToDecimal(a.plan_qty),
|
||||
children = SqlFunc.Subqueryable<PrdMoTask>()
|
||||
.LeftJoin<DictionaryDataEntity>((x,y)=>x.mo_task_status==y.EnCode && y.DictionaryTypeId==DictConst.PrdTaskStatusTypeId)
|
||||
.Where(x=>x.mo_id==a.id && SqlFunc.IsNullOrEmpty(x.parent_id))
|
||||
.OrderByDesc((x,y)=>x.create_time)
|
||||
.ToList((x,y)=>new PrdMoStatisticsDetailOutput()
|
||||
{
|
||||
id = x.id,
|
||||
mo_task_code = x.mo_task_code,
|
||||
mo_task_status = y.FullName,
|
||||
estimated_start_date = x.estimated_start_date==null ? "" : x.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = x.estimated_end_date==null ? "" : x.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
scheduled_qty = x.scheduled_qty,
|
||||
reported_work_qty = x.reported_work_qty,
|
||||
scrap_qty = x.scrap_qty,
|
||||
}),
|
||||
.LeftJoin<DictionaryDataEntity>((x, y) => x.mo_task_status == y.EnCode && y.DictionaryTypeId == DictConst.PrdTaskStatusTypeId)
|
||||
.Where(x => x.mo_id == a.id && SqlFunc.IsNullOrEmpty(x.parent_id))
|
||||
.OrderByDesc((x, y) => x.create_time)
|
||||
.ToList((x, y) => new PrdMoStatisticsDetailOutput()
|
||||
{
|
||||
id = x.id,
|
||||
mo_task_code = x.mo_task_code,
|
||||
mo_task_status = y.FullName,
|
||||
estimated_start_date = x.estimated_start_date == null ? "" : x.estimated_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
estimated_end_date = x.estimated_end_date == null ? "" : x.estimated_end_date.Value.ToString(DbTimeFormat.SS),
|
||||
scheduled_qty = x.scheduled_qty,
|
||||
reported_work_qty = x.reported_work_qty,
|
||||
scrap_qty = x.scrap_qty,
|
||||
}),
|
||||
})
|
||||
.MergeTable().OrderByDescending(a=>a.complete_rate)
|
||||
.MergeTable().OrderByDescending(a => a.complete_rate)
|
||||
.ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
|
||||
return PageResult<PrdMoStatisticsOutput>.SqlSugarPageResult(result);
|
||||
@@ -432,8 +431,8 @@ namespace Tnb.ProductionMgr
|
||||
if (!string.IsNullOrEmpty(input.barcode))
|
||||
{
|
||||
ids2 = await _db.Queryable<PrdReport>()
|
||||
.LeftJoin<PrdMoTask>((a,b)=>a.mo_task_id==b.id)
|
||||
.Where((a,b) => a.barcode.Contains(input.barcode)).Select((a,b) => b.mo_id).ToListAsync();
|
||||
.LeftJoin<PrdMoTask>((a, b) => a.mo_task_id == b.id)
|
||||
.Where((a, b) => a.barcode.Contains(input.barcode)).Select((a, b) => b.mo_id).ToListAsync();
|
||||
ids = ids2;
|
||||
}
|
||||
|
||||
@@ -441,27 +440,27 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
ids = ids1.Intersect(ids2).ToList();
|
||||
}
|
||||
|
||||
|
||||
var result = await _db.Queryable<PrdMo>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(input.mo_code),(a,b)=>a.mo_code.Contains(input.mo_code))
|
||||
.WhereIF(ids!=null && ids.Count>0,(a,b)=>ids.Contains(a.id))
|
||||
.WhereIF(!string.IsNullOrEmpty(input.mo_code), (a, b) => a.mo_code.Contains(input.mo_code))
|
||||
.WhereIF(ids != null && ids.Count > 0, (a, b) => ids.Contains(a.id))
|
||||
.Select((a, b) =>
|
||||
new PrdMoFromOneListOutput
|
||||
{
|
||||
id = a.id,
|
||||
mo_code = a.mo_code,
|
||||
material_id = a.material_id,
|
||||
type = (a.mo_type==DictConst.PrdMoTypeZS || a.mo_type==DictConst.PrdMoTypeJC ) ? 1 : 2,
|
||||
type = (a.mo_type == DictConst.PrdMoTypeZS || a.mo_type == DictConst.PrdMoTypeJC) ? 1 : 2,
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
material_standard = b.material_standard,
|
||||
act_start_date = a.act_start_date==null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
act_end_date = a.act_end_date==null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS)
|
||||
act_start_date = a.act_start_date == null ? "" : a.act_start_date.Value.ToString(DbTimeFormat.SS),
|
||||
act_end_date = a.act_end_date == null ? "" : a.act_end_date.Value.ToString(DbTimeFormat.SS)
|
||||
}).ToPagedListAsync(input.currentPage, input.pageSize);
|
||||
return PageResult<PrdMoFromOneListOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单追溯二级列表
|
||||
/// </summary>
|
||||
@@ -476,22 +475,22 @@ namespace Tnb.ProductionMgr
|
||||
List<string> ids = new List<string>();
|
||||
if (!string.IsNullOrEmpty(barcode))
|
||||
{
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync();
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
PrdMo prdMo = await _repository.GetSingleAsync(x => x.id == mo_id);
|
||||
if (prdMo.mo_type is DictConst.PrdMoTypeZS or DictConst.PrdMoTypeJC)
|
||||
{
|
||||
return await _db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<OrganizeRelationEntity>((a,b,c)=>a.eqp_id==c.ObjectId && c.ObjectType=="Eqp")
|
||||
.LeftJoin<OrganizeEntity>((a,b,c,d)=>c.OrganizeId==d.Id)
|
||||
.LeftJoin<OrganizeEntity>((a,b,c,d,e)=>d.OrganizeIdTree.Contains(e.Id) && e.Category==DictConst.RegionCategoryWorkshopCode)
|
||||
.LeftJoin<EqpEquipment>((a,b,c,d,e,f)=>a.eqp_id==f.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_id),(a,b,c,d)=>a.mo_id==mo_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),(a,b,c,d)=>a.mo_task_code==mo_task_code)
|
||||
.WhereIF(ids!=null && ids.Count>0,(a,b,c,d)=>ids.Contains(a.id))
|
||||
.Select((a, b, c, d,e,f) =>
|
||||
.LeftJoin<OrganizeRelationEntity>((a, b, c) => a.eqp_id == c.ObjectId && c.ObjectType == "Eqp")
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d) => c.OrganizeId == d.Id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c, d, e) => d.OrganizeIdTree.Contains(e.Id) && e.Category == DictConst.RegionCategoryWorkshopCode)
|
||||
.LeftJoin<EqpEquipment>((a, b, c, d, e, f) => a.eqp_id == f.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_id), (a, b, c, d) => a.mo_id == mo_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c, d) => a.mo_task_code == mo_task_code)
|
||||
.WhereIF(ids != null && ids.Count > 0, (a, b, c, d) => ids.Contains(a.id))
|
||||
.Select((a, b, c, d, e, f) =>
|
||||
new PrdMoFromTwoListOutput
|
||||
{
|
||||
id = a.id,
|
||||
@@ -513,9 +512,9 @@ namespace Tnb.ProductionMgr
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<OrganizeEntity>((a, b, c) => a.workline_id == c.Id)
|
||||
.LeftJoin<BasMbom>((a, b, c, d) => a.bom_id == d.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_id),(a,b,c,d)=>a.mo_id==mo_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),(a,b,c,d)=>a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(ids!=null && ids.Count>0,(a,b,c,d)=>ids.Contains(a.id))
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_id), (a, b, c, d) => a.mo_id == mo_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c, d) => a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(ids != null && ids.Count > 0, (a, b, c, d) => ids.Contains(a.id))
|
||||
.Select((a, b, c, d) =>
|
||||
new PrdMoFromTwoListOutput
|
||||
{
|
||||
@@ -531,9 +530,9 @@ namespace Tnb.ProductionMgr
|
||||
mbom_version = d.version
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单追溯三级级列表
|
||||
/// </summary>
|
||||
@@ -548,19 +547,19 @@ namespace Tnb.ProductionMgr
|
||||
List<string> ids = new List<string>();
|
||||
if (!string.IsNullOrEmpty(barcode))
|
||||
{
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync();
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
PrdMoTask prdMoTask = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == mo_task_id);
|
||||
List<BasProcessStation> processStations = await _db.Queryable<BasProcessStation>().Where(x=>x.process_id==prdMoTask.process_id).ToListAsync();
|
||||
List<BasProcessStation> processStations = await _db.Queryable<BasProcessStation>().Where(x => x.process_id == prdMoTask.process_id).ToListAsync();
|
||||
List<string> orgIds = processStations.Select(x => x.id).ToList();
|
||||
List<OrganizeEntity> orgs = await _db.Queryable<OrganizeEntity>().Where(x=>x.Category==DictConst.RegionCategoryStationCode && x.DeleteMark==null).ToListAsync();
|
||||
List<OrganizeEntity> orgs = await _db.Queryable<OrganizeEntity>().Where(x => x.Category == DictConst.RegionCategoryStationCode && x.DeleteMark == null).ToListAsync();
|
||||
return await _db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<BasProcess>((a,b,c)=>a.process_id==c.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_id),(a,b,c)=>a.id==mo_task_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code),(a,b,c)=>a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(ids!=null && ids.Count>0,(a,b,c)=>ids.Contains(a.id))
|
||||
.LeftJoin<BasProcess>((a, b, c) => a.process_id == c.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_id), (a, b, c) => a.id == mo_task_id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_code), (a, b, c) => a.mo_task_code.Contains(mo_task_code))
|
||||
.WhereIF(ids != null && ids.Count > 0, (a, b, c) => ids.Contains(a.id))
|
||||
.Select((a, b, c) =>
|
||||
new PrdMoFromThreeListOutput
|
||||
{
|
||||
@@ -574,16 +573,16 @@ namespace Tnb.ProductionMgr
|
||||
process_name = c.process_name,
|
||||
}).Mapper(x =>
|
||||
{
|
||||
List<string> orgId1 = orgs.Where(y => y.OrganizeIdTree.Contains(x.workline_id)).Select(y=>y.Id).ToList();
|
||||
List<string> orgId1 = orgs.Where(y => y.OrganizeIdTree.Contains(x.workline_id)).Select(y => y.Id).ToList();
|
||||
string station_id = orgIds.Intersect(orgId1)?.FirstOrDefault();
|
||||
if (!string.IsNullOrEmpty(station_id))
|
||||
{
|
||||
x.station_name = orgs.FirstOrDefault(y => y.Id == station_id)?.FullName;
|
||||
}
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单追溯人列表
|
||||
/// </summary>
|
||||
@@ -597,15 +596,15 @@ namespace Tnb.ProductionMgr
|
||||
List<string> ids = new List<string>();
|
||||
if (!string.IsNullOrEmpty(barcode))
|
||||
{
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync();
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync();
|
||||
}
|
||||
|
||||
return await _db.Queryable<PrdReport>()
|
||||
.LeftJoin<UserEntity>((a, b) => a.create_id == b.Id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_id), (a, b) => a.mo_task_id == mo_task_id)
|
||||
// .WhereIF(ids!=null && ids.Count>0,(a,b)=>ids.Contains(a.mo_task_id))
|
||||
.WhereIF(!string.IsNullOrEmpty(barcode),(a,b)=>a.barcode.Contains(barcode))
|
||||
.GroupBy((a,b)=>new {a.create_id,employee_name = b.RealName})
|
||||
.WhereIF(!string.IsNullOrEmpty(barcode), (a, b) => a.barcode.Contains(barcode))
|
||||
.GroupBy((a, b) => new { a.create_id, employee_name = b.RealName })
|
||||
.Select((a, b) => new PrdMoFromManListOutput()
|
||||
{
|
||||
// id = a.id,
|
||||
@@ -618,7 +617,7 @@ namespace Tnb.ProductionMgr
|
||||
})
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单追溯机列表
|
||||
/// </summary>
|
||||
@@ -632,21 +631,21 @@ namespace Tnb.ProductionMgr
|
||||
List<string> ids = new List<string>();
|
||||
if (!string.IsNullOrEmpty(barcode))
|
||||
{
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync();
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync();
|
||||
}
|
||||
|
||||
return await _db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<EqpEquipment>((a, b) => a.eqp_id == b.id)
|
||||
.LeftJoin<ToolMolds>((a,b,c)=>a.mold_id==c.id)
|
||||
.LeftJoin<ToolMolds>((a, b, c) => a.mold_id == c.id)
|
||||
.WhereIF(!string.IsNullOrEmpty(mo_task_id), (a, b) => a.id == mo_task_id)
|
||||
.WhereIF(ids!=null && ids.Count>0,(a,b)=>ids.Contains(a.id))
|
||||
.Select((a, b,c) => new PrdMoFromEquipListOutput()
|
||||
.WhereIF(ids != null && ids.Count > 0, (a, b) => ids.Contains(a.id))
|
||||
.Select((a, b, c) => new PrdMoFromEquipListOutput()
|
||||
{
|
||||
equip_code = b.code,
|
||||
mold_code = b.code,
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 工单追溯料列表
|
||||
/// </summary>
|
||||
@@ -660,7 +659,7 @@ namespace Tnb.ProductionMgr
|
||||
List<string> ids = new List<string>();
|
||||
if (!string.IsNullOrEmpty(barcode))
|
||||
{
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x=>x.mo_task_id).ToListAsync();
|
||||
ids = await _db.Queryable<PrdReport>().Where(x => x.barcode.Contains(barcode)).Select(x => x.mo_task_id).ToListAsync();
|
||||
}
|
||||
PrdMoTask prdMoTask = await _db.Queryable<PrdMoTask>().SingleAsync(x => x.id == mo_task_id);
|
||||
PrdMo prdMo = await _db.Queryable<PrdMo>().SingleAsync(x => x.id == prdMoTask.mo_id);
|
||||
@@ -675,10 +674,10 @@ namespace Tnb.ProductionMgr
|
||||
if (prdMoTask.schedule_type == 1)
|
||||
{
|
||||
return await _db.Queryable<BasEbomH>()
|
||||
.LeftJoin<BasEbomD>((a,b)=>a.id==b.ebom_id)
|
||||
.LeftJoin<BasMaterial>((a,b,c)=>b.material_id==c.id)
|
||||
.Where((a,b,c)=>a.id==prdMoTask.ebom_id)
|
||||
.Select((a,b,c)=>new PrdMoFromMaterialListOutput()
|
||||
.LeftJoin<BasEbomD>((a, b) => a.id == b.ebom_id)
|
||||
.LeftJoin<BasMaterial>((a, b, c) => b.material_id == c.id)
|
||||
.Where((a, b, c) => a.id == prdMoTask.ebom_id)
|
||||
.Select((a, b, c) => new PrdMoFromMaterialListOutput()
|
||||
{
|
||||
material_code = c.code,
|
||||
material_name = c.name,
|
||||
@@ -687,9 +686,9 @@ namespace Tnb.ProductionMgr
|
||||
else
|
||||
{
|
||||
return await _db.Queryable<BasMbomInput>()
|
||||
.LeftJoin<BasMaterial>((a,b)=>a.material_id==b.id)
|
||||
.Where((a,b)=>a.mbom_id==prdMoTask.bom_id)
|
||||
.Select((a,b)=>new PrdMoFromMaterialListOutput()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.Where((a, b) => a.mbom_id == prdMoTask.bom_id)
|
||||
.Select((a, b) => new PrdMoFromMaterialListOutput()
|
||||
{
|
||||
material_code = b.code,
|
||||
material_name = b.name,
|
||||
@@ -699,7 +698,7 @@ namespace Tnb.ProductionMgr
|
||||
else
|
||||
{
|
||||
PrdReport prdReport = await _db.Queryable<PrdReport>().Where(x => x.barcode == barcode).FirstAsync();
|
||||
List<PrdReport> prdReports = await _db.Queryable<PrdReport>().Where(x=>x.create_time<=prdReport.create_time && x.barcode!=barcode && x.mo_task_id==mo_task_id).ToListAsync();
|
||||
List<PrdReport> prdReports = await _db.Queryable<PrdReport>().Where(x => x.create_time <= prdReport.create_time && x.barcode != barcode && x.mo_task_id == mo_task_id).ToListAsync();
|
||||
int? beforeReportNum = prdReports.Sum(x => x.reported_qty);
|
||||
List<string> prdFeedingIds = new List<string>();
|
||||
if (prdMoTask.schedule_type == 1)
|
||||
@@ -713,7 +712,7 @@ namespace Tnb.ProductionMgr
|
||||
List<PrdFeedingD> prdFeedingDs = await _db.Queryable<PrdFeedingD>()
|
||||
.LeftJoin<PrdFeedingH>((a, b) => a.feeding_id == b.id)
|
||||
.Where((a, b) => a.material_id == item.material_id && b.mo_task_id == mo_task_id)
|
||||
.OrderBy((a,b)=>b.create_time)
|
||||
.OrderBy((a, b) => b.create_time)
|
||||
.Select((a, b) => a).ToListAsync();
|
||||
decimal sum1 = 0;
|
||||
decimal sum2 = 0;
|
||||
@@ -737,7 +736,7 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return await _db.Queryable<PrdFeedingD>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<PrdMaterialReceiptD>((a, b, c) => a.material_receipt_detail_id == c.id)
|
||||
@@ -754,40 +753,40 @@ namespace Tnb.ProductionMgr
|
||||
instock_time = c.instock_time.ToString(DbTimeFormat.SS),
|
||||
feeding_time = e.create_time == null ? "" : e.create_time.Value.ToString(DbTimeFormat.SS),
|
||||
}).ToListAsync();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
List<BasMbomInput> basMbomInputs = await _db.Queryable<BasMbomInput>().Where(x=>x.mbom_process_id==prdMoTask.mbom_process_id).ToListAsync();
|
||||
List<BasMbomInput> basMbomInputs = await _db.Queryable<BasMbomInput>().Where(x => x.mbom_process_id == prdMoTask.mbom_process_id).ToListAsync();
|
||||
BasMbom basMbom = await _db.Queryable<BasMbom>().SingleAsync(x => x.id == prdMoTask.bom_id);
|
||||
BasMbomProcess basMbomProcess = await _db.Queryable<BasMbomProcess>().SingleAsync(x => x.id == prdMoTask.mbom_process_id);
|
||||
List<string> lastPrdReportIds = new List<string>();
|
||||
foreach (var item in basMbomInputs)
|
||||
{
|
||||
BasMbomOutput basMbomOutput = await _db.Queryable<BasMbomOutput>().Where(x=>x.mbom_process_id==basMbomProcess.id && x.material_id==prdMoTask.material_id).FirstAsync();
|
||||
if (basMbomOutput == null) break;
|
||||
BasMbomOutput basMbomOutput = await _db.Queryable<BasMbomOutput>().Where(x => x.mbom_process_id == basMbomProcess.id && x.material_id == prdMoTask.material_id).FirstAsync();
|
||||
if (basMbomOutput == null) break;
|
||||
decimal? num1 = beforeReportNum / Convert.ToDecimal(basMbomOutput.num) * item.num;
|
||||
List<PrdFeedingD> prdFeedingDs = await _db.Queryable<PrdFeedingD>()
|
||||
.LeftJoin<PrdFeedingH>((a, b) => a.feeding_id == b.id)
|
||||
.Where((a, b) => a.material_id == item.material_id && b.mo_task_id == mo_task_id)
|
||||
.OrderBy((a,b)=>b.create_time)
|
||||
.OrderBy((a, b) => b.create_time)
|
||||
.Select((a, b) => a).ToListAsync();
|
||||
|
||||
|
||||
if (prdFeedingDs == null || prdFeedingDs.Count <= 0)
|
||||
{
|
||||
if (string.IsNullOrEmpty(basMbomProcess.last_process_no)) continue;
|
||||
|
||||
List<BasMbomProcess> lastBasMbomProcesses = await _db.Queryable<BasMbomProcess>().Where(x=>x.no==basMbomProcess.last_process_no && x.mbom_id==prdMoTask.bom_id).ToListAsync();
|
||||
|
||||
List<BasMbomProcess> lastBasMbomProcesses = await _db.Queryable<BasMbomProcess>().Where(x => x.no == basMbomProcess.last_process_no && x.mbom_id == prdMoTask.bom_id).ToListAsync();
|
||||
foreach (var lastBasMbomProcess in lastBasMbomProcesses)
|
||||
{
|
||||
List<PrdReport> lastPrdReports = await _db.Queryable<PrdReport>()
|
||||
.Where(x=>x.mbom_process_id==lastBasMbomProcess.id && x.material_id==item.material_id)
|
||||
.OrderBy(x=>x.create_time)
|
||||
.Where(x => x.mbom_process_id == lastBasMbomProcess.id && x.material_id == item.material_id)
|
||||
.OrderBy(x => x.create_time)
|
||||
.ToListAsync();
|
||||
if (lastPrdReports == null || lastPrdReports.Count <= 0) continue;
|
||||
|
||||
PrdMoTask lastPrdMoTask = await _db.Queryable<PrdMoTask>().FirstAsync(x=>x.mo_id==prdMo.id && x.mbom_process_id==lastBasMbomProcess.id);
|
||||
|
||||
|
||||
PrdMoTask lastPrdMoTask = await _db.Queryable<PrdMoTask>().FirstAsync(x => x.mo_id == prdMo.id && x.mbom_process_id == lastBasMbomProcess.id);
|
||||
|
||||
decimal sum1 = 0;
|
||||
decimal sum2 = 0;
|
||||
foreach (var lastPrdReport in lastPrdReports)
|
||||
@@ -809,9 +808,9 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
@@ -839,7 +838,7 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var queryable1 = _db.Queryable<PrdFeedingD>()
|
||||
.LeftJoin<BasMaterial>((a, b) => a.material_id == b.id)
|
||||
.LeftJoin<PrdMaterialReceiptD>((a, b, c) => a.material_receipt_detail_id == c.id)
|
||||
@@ -877,14 +876,14 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
return await queryable1.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 反向工单追溯相关
|
||||
|
||||
/// <summary>
|
||||
@@ -908,7 +907,7 @@ namespace Tnb.ProductionMgr
|
||||
["currentPage"] = 1,
|
||||
["pageSize"] = int.MaxValue,
|
||||
};
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE,JsonConvert.SerializeObject(postData),header);
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE, JsonConvert.SerializeObject(postData), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||
@@ -918,15 +917,15 @@ namespace Tnb.ProductionMgr
|
||||
}
|
||||
else
|
||||
{
|
||||
PageResult<PrdMoReverseFromMaterialoutput> output = JsonConvert.DeserializeObject<PageResult<PrdMoReverseFromMaterialoutput>>(authResponse.data.ToString(),new Tnb.Common.Utils.DateTimeJsonConverter());
|
||||
PageResult<PrdMoReverseFromMaterialoutput> output = JsonConvert.DeserializeObject<PageResult<PrdMoReverseFromMaterialoutput>>(authResponse.data.ToString(), new Tnb.Common.Utils.DateTimeJsonConverter());
|
||||
if (output.list != null && output.list.Count > 0)
|
||||
{
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x=>x.id==output.list[0].material_id);
|
||||
BasSupplier basSupplier = await _db.Queryable<BasSupplier>().SingleAsync(x=>x.id==output.list[0].supplier_id);
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().SingleAsync(x => x.id == output.list[0].material_id);
|
||||
BasSupplier basSupplier = await _db.Queryable<BasSupplier>().SingleAsync(x => x.id == output.list[0].supplier_id);
|
||||
DictionaryDataEntity unit = await _db.Queryable<DictionaryTypeEntity>()
|
||||
.LeftJoin<DictionaryDataEntity>((a,b)=>a.Id==b.DictionaryTypeId)
|
||||
.Where((a,b)=>a.EnCode==DictConst.MeasurementUnit && b.EnCode==output.list[0].unit_id)
|
||||
.Select((a,b)=>b)
|
||||
.LeftJoin<DictionaryDataEntity>((a, b) => a.Id == b.DictionaryTypeId)
|
||||
.Where((a, b) => a.EnCode == DictConst.MeasurementUnit && b.EnCode == output.list[0].unit_id)
|
||||
.Select((a, b) => b)
|
||||
.FirstAsync();
|
||||
output.list[0].feeding_num = await _db.Queryable<PrdMaterialReceiptD>()
|
||||
.LeftJoin<PrdFeedingD>((a, b) => a.id == b.material_receipt_detail_id)
|
||||
@@ -935,15 +934,15 @@ namespace Tnb.ProductionMgr
|
||||
output.list[0].material_standard = basMaterial.material_standard;
|
||||
output.list[0].supplier_name = basSupplier?.supplier_name ?? "";
|
||||
output.list[0].unit_name = unit?.FullName ?? "";
|
||||
|
||||
|
||||
return output.list[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return Array.Empty<string>();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物料反向追溯投料信息
|
||||
/// </summary>
|
||||
@@ -995,7 +994,7 @@ namespace Tnb.ProductionMgr
|
||||
return result;
|
||||
// return PageResult<PrdMoReverseFromFeedingOutput>.SqlSugarPageResult(result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 物料反向追溯产出信息
|
||||
/// </summary>
|
||||
@@ -1006,12 +1005,12 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
string feeding_detail_id = prdMoReverseFromOutInfoQueryInput.feeding_detail_id ?? "";
|
||||
PrdFeedingD prdFeedingD = await _db.Queryable<PrdFeedingD>().FirstAsync(x => x.id == feeding_detail_id);
|
||||
if(prdFeedingD.use_num<=0) return Array.Empty<string>();
|
||||
if (prdFeedingD.use_num <= 0) return Array.Empty<string>();
|
||||
PrdFeedingH prdFeedingH = await _db.Queryable<PrdFeedingH>().FirstAsync(x => x.id == prdFeedingD.feeding_id);
|
||||
PrdMoTask prdMoTask = await _db.Queryable<PrdMoTask>().FirstAsync(x => x.id == prdFeedingH.mo_task_id);
|
||||
List<PrdFeedingD> prdFeedingDs = await _db.Queryable<PrdFeedingD>()
|
||||
.LeftJoin<PrdFeedingH>((a, b) => a.feeding_id == b.id)
|
||||
.Where((a, b) => a.material_id == prdFeedingD.material_id && b.mo_task_id == prdFeedingH.mo_task_id && b.create_time<=prdFeedingH.create_time && a.id!=prdFeedingD.id)
|
||||
.Where((a, b) => a.material_id == prdFeedingD.material_id && b.mo_task_id == prdFeedingH.mo_task_id && b.create_time <= prdFeedingH.create_time && a.id != prdFeedingD.id)
|
||||
.Select((a, b) => a).ToListAsync();
|
||||
decimal beforeIn = prdFeedingDs.Sum(x => x.num);
|
||||
List<string> reportIds = new List<string>();
|
||||
@@ -1022,7 +1021,7 @@ namespace Tnb.ProductionMgr
|
||||
BasEbomD basEbomD = basEbomDs.Where(x => x.material_id == prdFeedingD.material_id).FirstOrDefault();
|
||||
if (basEbomD != null)
|
||||
{
|
||||
List<PrdReport> prdReports = await _db.Queryable<PrdReport>().Where(x => x.mo_task_id == prdMoTask.id).OrderBy(x=>x.create_time).ToListAsync();
|
||||
List<PrdReport> prdReports = await _db.Queryable<PrdReport>().Where(x => x.mo_task_id == prdMoTask.id).OrderBy(x => x.create_time).ToListAsync();
|
||||
if (prdReports != null && prdReports.Count > 0)
|
||||
{
|
||||
bool flag = true;
|
||||
@@ -1048,7 +1047,7 @@ namespace Tnb.ProductionMgr
|
||||
reportIds.Add(prdReport.id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
flag = false;
|
||||
continue;
|
||||
|
||||
@@ -1058,7 +1057,8 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
residueNeed -= needNum;
|
||||
reportIds.Add(prdReport.id);
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
reportIds.Add(prdReport.id);
|
||||
break;
|
||||
@@ -1075,30 +1075,30 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
List<PrdReport> prdReports = await _db.Queryable<PrdMoTask>()
|
||||
.LeftJoin<BasMbomProcess>((a, b) => a.mbom_process_id == b.id)
|
||||
.LeftJoin<PrdReport>((a, b, c) => a.id == c.mo_task_id)
|
||||
.Where((a, b, c) => a.mo_id == prdMoTask.mo_id && b.next_process_no == null)
|
||||
.OrderBy((a,b,c)=>c.create_time)
|
||||
.OrderBy((a, b, c) => c.create_time)
|
||||
.Select((a, b, c) => c).ToListAsync();
|
||||
|
||||
if (prdReports != null && prdReports.Count > 0)
|
||||
{
|
||||
List<string> mbomProcesssIds = new List<string>(){prdMoTask.mbom_process_id};
|
||||
BasMbomProcess startMbomProcess = await _db.Queryable<BasMbomProcess>().Where(x=>x.id==prdMoTask.mbom_process_id).FirstAsync();
|
||||
List<BasMbomProcess> allMbomProcesses = await _db.Queryable<BasMbomProcess>().Where(x=>x.mbom_id==prdMoTask.bom_id).ToListAsync();
|
||||
List<string> mbomProcesssIds = new List<string>() { prdMoTask.mbom_process_id };
|
||||
BasMbomProcess startMbomProcess = await _db.Queryable<BasMbomProcess>().Where(x => x.id == prdMoTask.mbom_process_id).FirstAsync();
|
||||
List<BasMbomProcess> allMbomProcesses = await _db.Queryable<BasMbomProcess>().Where(x => x.mbom_id == prdMoTask.bom_id).ToListAsync();
|
||||
string startNo = startMbomProcess.next_process_no;
|
||||
if (!string.IsNullOrEmpty(startNo))
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
BasMbomProcess nextMbomProcess = allMbomProcesses.FirstOrDefault(x=>x.no==startNo);
|
||||
BasMbomProcess nextMbomProcess = allMbomProcesses.FirstOrDefault(x => x.no == startNo);
|
||||
|
||||
if (nextMbomProcess==null || nextMbomProcess.no==null)
|
||||
if (nextMbomProcess == null || nextMbomProcess.no == null)
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -1120,23 +1120,23 @@ namespace Tnb.ProductionMgr
|
||||
List<BasMbomOutput> outputList = await _db.Queryable<BasMbomProcess>()
|
||||
.LeftJoin<BasMbomOutput>((a, b) => a.id == b.mbom_process_id)
|
||||
.Where((a, b) => mbomProcesssIds.Contains(a.id))
|
||||
.Select((a,b)=>b).ToListAsync();
|
||||
|
||||
.Select((a, b) => b).ToListAsync();
|
||||
|
||||
List<BasMbomInput> inputList = await _db.Queryable<BasMbomProcess>()
|
||||
.LeftJoin<BasMbomInput>((a, b) => a.id == b.mbom_process_id)
|
||||
.Where((a, b) => mbomProcesssIds.Contains(a.id))
|
||||
.Select((a,b)=>b).ToListAsync();
|
||||
.Select((a, b) => b).ToListAsync();
|
||||
|
||||
decimal? needNum = 1;//一个最终物料需要本任务单投入物料的数量
|
||||
string tempMaterialId = outputList.FirstOrDefault(x=>x.mbom_process_id==mbomProcesssIds[mbomProcesssIds.Count-1])?.material_id;
|
||||
for (int i = mbomProcesssIds.Count - 1; i > 0;i--)
|
||||
string tempMaterialId = outputList.FirstOrDefault(x => x.mbom_process_id == mbomProcesssIds[mbomProcesssIds.Count - 1])?.material_id;
|
||||
for (int i = mbomProcesssIds.Count - 1; i > 0; i--)
|
||||
{
|
||||
|
||||
List<BasMbomInput> inputs = inputList.Where(x => x.mbom_process_id == mbomProcesssIds[i]).ToList();
|
||||
BasMbomOutput output = outputList.FirstOrDefault(x => x.mbom_process_id == mbomProcesssIds[i] && x.material_id==tempMaterialId);
|
||||
BasMbomOutput output = outputList.FirstOrDefault(x => x.mbom_process_id == mbomProcesssIds[i] && x.material_id == tempMaterialId);
|
||||
List<string> inputMaterialIds = inputs.Select(x => x.material_id).ToList();
|
||||
List<BasMbomOutput> lastOutputs = outputList.Where(x=>x.mbom_process_id==mbomProcesssIds[i-1]).ToList();
|
||||
decimal? inputNum = inputs.FirstOrDefault(x => inputMaterialIds.Contains(x.material_id))?.num;
|
||||
List<BasMbomOutput> lastOutputs = outputList.Where(x => x.mbom_process_id == mbomProcesssIds[i - 1]).ToList();
|
||||
decimal? inputNum = inputs.FirstOrDefault(x => inputMaterialIds.Contains(x.material_id))?.num;
|
||||
if (inputNum == null)
|
||||
{
|
||||
throw new Exception("生产bom投入产出物料配置错误");
|
||||
@@ -1171,7 +1171,7 @@ namespace Tnb.ProductionMgr
|
||||
reportIds.Add(prdReport.id);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
flag = false;
|
||||
continue;
|
||||
|
||||
@@ -1181,25 +1181,26 @@ namespace Tnb.ProductionMgr
|
||||
{
|
||||
residueNeed -= needNumTotal;
|
||||
reportIds.Add(prdReport.id);
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
reportIds.Add(prdReport.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
|
||||
List<string> barCodes = await _db.Queryable<PrdReport>().Where(x=>reportIds.Contains(x.id)).Select(x=>x.barcode).ToListAsync();
|
||||
|
||||
|
||||
List<string> barCodes = await _db.Queryable<PrdReport>().Where(x => reportIds.Contains(x.id)).Select(x => x.barcode).ToListAsync();
|
||||
|
||||
string domain = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
Dictionary<string, object> header = new Dictionary<string, object>()
|
||||
{
|
||||
@@ -1212,7 +1213,7 @@ namespace Tnb.ProductionMgr
|
||||
["currentPage"] = 1,
|
||||
["pageSize"] = int.MaxValue,
|
||||
};
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE,JsonConvert.SerializeObject(postData),header);
|
||||
var sendResult = HttpUtils.RequestPost(domain + WebApiConst.MES_FETCH_IN_OUT_STOCK_INFO_BY_BAR_CODE, JsonConvert.SerializeObject(postData), header);
|
||||
Log.Information(sendResult);
|
||||
|
||||
AuthResponse authResponse = JsonConvert.DeserializeObject<AuthResponse>(sendResult);
|
||||
@@ -1223,7 +1224,7 @@ namespace Tnb.ProductionMgr
|
||||
else
|
||||
{
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().FirstAsync(x => x.id == prdMoTask.material_id);
|
||||
PageResult<PrdMoReverseFromOutput> output = JsonConvert.DeserializeObject<PageResult<PrdMoReverseFromOutput>>(authResponse.data.ToString(),new Tnb.Common.Utils.DateTimeJsonConverter());
|
||||
PageResult<PrdMoReverseFromOutput> output = JsonConvert.DeserializeObject<PageResult<PrdMoReverseFromOutput>>(authResponse.data.ToString(), new Tnb.Common.Utils.DateTimeJsonConverter());
|
||||
if (output.list != null && output.list.Count > 0)
|
||||
{
|
||||
foreach (var item in output.list)
|
||||
@@ -1235,7 +1236,7 @@ namespace Tnb.ProductionMgr
|
||||
return output.list;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user