Merge branch 'master' of http://115.190.214.62:3001/Teams/kunshan-bzfm-mes-backend
This commit is contained in:
@@ -5,8 +5,6 @@ using DOAN.Repository;
|
|||||||
using DOAN.Service.MES.product.IService;
|
using DOAN.Service.MES.product.IService;
|
||||||
using Infrastructure.Attribute;
|
using Infrastructure.Attribute;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace DOAN.Service.MES.product;
|
namespace DOAN.Service.MES.product;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -18,7 +16,6 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
public List<BaseWorkRoute> GetRoute()
|
public List<BaseWorkRoute> GetRoute()
|
||||||
{
|
{
|
||||||
return Context.Queryable<BaseWorkRoute>().ToList();
|
return Context.Queryable<BaseWorkRoute>().ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -27,16 +24,19 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<BaseWorkProcesses> GetBaseWorkProcesses()
|
public List<BaseWorkProcesses> GetBaseWorkProcesses()
|
||||||
{
|
{
|
||||||
return Context.Queryable<BaseWorkProcesses>().ToList();
|
return Context.Queryable<BaseWorkProcesses>().ToList();
|
||||||
}
|
}
|
||||||
public List<BaseWorkProcesses> GetProcessByRoute(int route_id)
|
|
||||||
|
public List<BaseWorkProcesses> GetProcessByRoute(int route_id)
|
||||||
{
|
{
|
||||||
return Context.Queryable<BaseRelWorkRouteProcesses>()
|
return Context
|
||||||
.LeftJoin<BaseWorkProcesses>((rel,pro)=>rel.FkWorkProcesses==pro.Id)
|
.Queryable<BaseRelWorkRouteProcesses>()
|
||||||
.Where((rel,pro)=>rel.FkWorkRoute==route_id)
|
.LeftJoin<BaseWorkProcesses>((rel, pro) => rel.FkWorkProcesses == pro.Id)
|
||||||
.Select((rel,pro)=>pro)
|
.Where((rel, pro) => rel.FkWorkRoute == route_id)
|
||||||
|
.Select((rel, pro) => pro)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查询报工列表
|
/// 查询报工列表
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -46,21 +46,17 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
{
|
{
|
||||||
var predicate = QueryExp(parm);
|
var predicate = QueryExp(parm);
|
||||||
|
|
||||||
var query = Queryable()
|
var query = Queryable().Where(predicate.ToExpression());
|
||||||
.Where(predicate.ToExpression());
|
var response = Context
|
||||||
var response = Context.Queryable(query).LeftJoin<BaseWorkProcesses>((q, w) => q.ProcessId == w.Id)
|
.Queryable(query)
|
||||||
.OrderBy((q,w)=>new { q.Workorder ,w.Id})
|
.LeftJoin<BaseWorkProcesses>((q, w) => q.ProcessId == w.Id)
|
||||||
.Select((q, w) => new ProReportworkDto
|
.OrderBy((q, w) => new { q.Workorder, w.Id })
|
||||||
{
|
.Select((q, w) => new ProReportworkDto { ProcessName = w.Name }, true)
|
||||||
ProcessName = w.Name
|
|
||||||
}, true
|
|
||||||
)
|
|
||||||
.ToPage_NO_Convert(parm);
|
.ToPage_NO_Convert(parm);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取详情
|
/// 获取详情
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -68,9 +64,7 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public ProReportwork01 GetInfo(string Id)
|
public ProReportwork01 GetInfo(string Id)
|
||||||
{
|
{
|
||||||
var response = Queryable()
|
var response = Queryable().Where(x => x.Id == Id).First();
|
||||||
.Where(x => x.Id == Id)
|
|
||||||
.First();
|
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -83,11 +77,13 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
public ProReportwork01 AddProReportwork(ProReportwork01 model)
|
public ProReportwork01 AddProReportwork(ProReportwork01 model)
|
||||||
{
|
{
|
||||||
//出货工序
|
//出货工序
|
||||||
if(model.ProcessId== 90&& !string.IsNullOrEmpty(model.Workorder))
|
if (model.ProcessId == 90 && !string.IsNullOrEmpty(model.Workorder))
|
||||||
{
|
{
|
||||||
Context.Updateable<ProWorkorder>()
|
Context
|
||||||
|
.Updateable<ProWorkorder>()
|
||||||
.SetColumns(it => it.ShipmentNum == model.FinishNum)
|
.SetColumns(it => it.ShipmentNum == model.FinishNum)
|
||||||
.Where(it => it.Workorder == model.Workorder).ExecuteCommand();
|
.Where(it => it.Workorder == model.Workorder)
|
||||||
|
.ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
return Insertable(model).ExecuteReturnEntity();
|
return Insertable(model).ExecuteReturnEntity();
|
||||||
@@ -103,9 +99,11 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
//出货工序
|
//出货工序
|
||||||
if (model.ProcessId == 90 && !string.IsNullOrEmpty(model.Workorder))
|
if (model.ProcessId == 90 && !string.IsNullOrEmpty(model.Workorder))
|
||||||
{
|
{
|
||||||
Context.Updateable<ProWorkorder>()
|
Context
|
||||||
|
.Updateable<ProWorkorder>()
|
||||||
.SetColumns(it => it.ShipmentNum == model.FinishNum)
|
.SetColumns(it => it.ShipmentNum == model.FinishNum)
|
||||||
.Where(it => it.Workorder == model.Workorder).ExecuteCommand();
|
.Where(it => it.Workorder == model.Workorder)
|
||||||
|
.ExecuteCommand();
|
||||||
}
|
}
|
||||||
return Update(model, true);
|
return Update(model, true);
|
||||||
}
|
}
|
||||||
@@ -117,20 +115,25 @@ public class ProReportworkService : BaseService<ProReportwork01>, IProReportwork
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private static Expressionable<ProReportwork01> QueryExp(ProReportworkQueryDto parm)
|
private static Expressionable<ProReportwork01> QueryExp(ProReportworkQueryDto parm)
|
||||||
{
|
{
|
||||||
var predicate = Expressionable.Create<ProReportwork01>()
|
var predicate = Expressionable
|
||||||
.AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder))
|
.Create<ProReportwork01>()
|
||||||
//.AndIF(!string.IsNullOrEmpty(parm.Worker), it => it.Worker.Contains(parm.Worker))
|
.AndIF(
|
||||||
.AndIF(!string.IsNullOrEmpty(parm.Worker), it => it.Worker==parm.Worker)
|
!string.IsNullOrEmpty(parm.Workorder),
|
||||||
.AndIF(parm.RouteId>0, it => it.RouteId == parm.RouteId)
|
it => it.Workorder.Contains(parm.Workorder)
|
||||||
.AndIF(parm.ProcessId > 0, it => it.ProcessId == parm.ProcessId)
|
)
|
||||||
.AndIF(parm.JobDateTime != null && parm.JobDateTime[0] > DateTime.MinValue, it => it.JobDateTime >= parm.JobDateTime[0])
|
//.AndIF(!string.IsNullOrEmpty(parm.Worker), it => it.Worker.Contains(parm.Worker))
|
||||||
.AndIF(parm.JobDateTime != null && parm.JobDateTime[1] > DateTime.MinValue, it => it.JobDateTime <= parm.JobDateTime[1].AddDays(1))
|
.AndIF(!string.IsNullOrEmpty(parm.Worker), it => it.Worker.Contains(parm.Worker))
|
||||||
;
|
.AndIF(parm.RouteId > 0, it => it.RouteId == parm.RouteId)
|
||||||
|
.AndIF(parm.ProcessId > 0, it => it.ProcessId == parm.ProcessId)
|
||||||
|
.AndIF(
|
||||||
|
parm.JobDateTime != null && parm.JobDateTime[0] > DateTime.MinValue,
|
||||||
|
it => it.JobDateTime >= parm.JobDateTime[0]
|
||||||
|
)
|
||||||
|
.AndIF(
|
||||||
|
parm.JobDateTime != null && parm.JobDateTime[1] > DateTime.MinValue,
|
||||||
|
it => it.JobDateTime <= parm.JobDateTime[1].AddDays(1)
|
||||||
|
);
|
||||||
|
|
||||||
return predicate;
|
return predicate;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user