入库检验修改
This commit is contained in:
@@ -201,6 +201,24 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置全部不合格
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="packcode_select"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("setAllUnQualified")]
|
||||||
|
public IActionResult SetAllUnQualified(string workorder_selected)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(workorder_selected))
|
||||||
|
{
|
||||||
|
return SUCCESS(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
var response = _WmFgentryInspectService.SetAllUnQualified(workorder_selected, HttpContext.GetName());
|
||||||
|
|
||||||
|
return ToResponse(response);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,24 @@ namespace ZR.Model.MES.wms.Dto
|
|||||||
public int? Result_null { get; set; }
|
public int? Result_null { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品描述
|
||||||
|
/// </summary>
|
||||||
|
public string ProductDescription { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 规格
|
||||||
|
/// </summary>
|
||||||
|
public string Specifications { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 颜色
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
public string Colour { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -90,5 +108,22 @@ namespace ZR.Model.MES.wms.Dto
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 产品描述
|
||||||
|
/// </summary>
|
||||||
|
public string ProductDescription { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 规格
|
||||||
|
/// </summary>
|
||||||
|
public string Specifications { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 颜色
|
||||||
|
/// </summary>
|
||||||
|
///
|
||||||
|
public string Colour { get; set; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,7 @@ namespace ZR.Service.mes.wms.IService
|
|||||||
int BatchQualified(string[] packcode_select,string updateby);
|
int BatchQualified(string[] packcode_select,string updateby);
|
||||||
|
|
||||||
int SetAllQualified(string workorder_selected, string updateby);
|
int SetAllQualified(string workorder_selected, string updateby);
|
||||||
|
int SetAllUnQualified(string workorder_selected, string updateby);
|
||||||
int BatchUnQualified(string[] packcode_select,string updateby);
|
int BatchUnQualified(string[] packcode_select,string updateby);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ using ZR.Model.MES.wms.Dto;
|
|||||||
using Mapster;
|
using Mapster;
|
||||||
using System.Reflection.PortableExecutable;
|
using System.Reflection.PortableExecutable;
|
||||||
using Microsoft.AspNetCore.Http.HttpResults;
|
using Microsoft.AspNetCore.Http.HttpResults;
|
||||||
|
using ZR.Model.MES.pro;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
namespace ZR.Service.mes.wms
|
namespace ZR.Service.mes.wms
|
||||||
{
|
{
|
||||||
@@ -101,13 +103,26 @@ namespace ZR.Service.mes.wms
|
|||||||
ProductionNum = SqlFunc.AggregateSum(it.ProductionNum ?? 0),
|
ProductionNum = SqlFunc.AggregateSum(it.ProductionNum ?? 0),
|
||||||
// Result= SqlFunc.AggregateSum(it.Result??0),
|
// Result= SqlFunc.AggregateSum(it.Result??0),
|
||||||
Partnumber = SqlFunc.AggregateMax(it.Partnumber)
|
Partnumber = SqlFunc.AggregateMax(it.Partnumber)
|
||||||
}).ToList();
|
})
|
||||||
|
.LeftJoin<ProWorkorder_v2>((s, w) => s.Workorder==w.ClientWorkorder)
|
||||||
|
.Select((s,w)=>new WmFgentryInspect_parentDto
|
||||||
|
{
|
||||||
|
Workorder= s.Workorder,
|
||||||
|
ProductionNum=s.ProductionNum,
|
||||||
|
Partnumber=s.Partnumber,
|
||||||
|
ProductDescription=w.ProductDescription,
|
||||||
|
Specifications=w.Specifications,
|
||||||
|
Colour = w.Colour
|
||||||
|
})
|
||||||
|
.ToList();
|
||||||
|
|
||||||
foreach (var inspect in inspects)
|
foreach (var inspect in inspects)
|
||||||
{
|
{
|
||||||
inspect.Result_good = Queryable().Where(it => it.Workorder == inspect.Workorder).Where(it => it.Result == 1).Count();
|
inspect.Result_good = Queryable().Where(it => it.Workorder == inspect.Workorder).Where(it => it.Result == 1).Count();
|
||||||
inspect.Result_bad = Queryable().Where(it => it.Workorder == inspect.Workorder).Where(it => it.Result == 2).Count();
|
inspect.Result_bad = Queryable().Where(it => it.Workorder == inspect.Workorder).Where(it => it.Result == 2).Count();
|
||||||
inspect.Result_null = Queryable().Where(it => it.Workorder == inspect.Workorder).Where(it => it.Result == 0 || it.Result == null).Count();
|
inspect.Result_null = Queryable().Where(it => it.Workorder == inspect.Workorder).Where(it => it.Result == 0 || it.Result == null).Count();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -133,16 +148,26 @@ namespace ZR.Service.mes.wms
|
|||||||
public PagedInfo<WmFgentryInspectDto> GetList_second(WmFgentryInspectQueryDto parm)
|
public PagedInfo<WmFgentryInspectDto> GetList_second(WmFgentryInspectQueryDto parm)
|
||||||
{
|
{
|
||||||
var predicate = Expressionable.Create<WmFgentryInspect>()
|
var predicate = Expressionable.Create<WmFgentryInspect>()
|
||||||
.AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder))
|
.AndIF(!string.IsNullOrEmpty(parm.Workorder), s => s.Workorder.Contains(parm.Workorder))
|
||||||
.AndIF(!string.IsNullOrEmpty(parm.Packcode), it => it.Packcode.Contains(parm.Packcode))
|
.AndIF(!string.IsNullOrEmpty(parm.Packcode), s => s.Packcode.Contains(parm.Packcode))
|
||||||
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), it => it.Partnumber.Contains(parm.Partnumber))
|
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), s=> s.Partnumber.Contains(parm.Partnumber))
|
||||||
.AndIF(parm.starttime != null && parm.starttime > new DateTime(1999, 1, 1), it => it.CreatedTime > parm.starttime)
|
.AndIF(parm.starttime != null && parm.starttime > new DateTime(1999, 1, 1), s => s.CreatedTime > parm.starttime)
|
||||||
.AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), it => it.CreatedTime < parm.endtime)
|
.AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), s => s.CreatedTime < parm.endtime)
|
||||||
;
|
;
|
||||||
var response = Queryable()
|
var response = Queryable()
|
||||||
.Where(it => it.Bitwm == 0)
|
.LeftJoin<ProWorkorder_v2>((s, w) => s.Workorder == w.ClientWorkorder)
|
||||||
|
.Where(s => s.Bitwm == 0)
|
||||||
.Where(predicate.ToExpression())
|
.Where(predicate.ToExpression())
|
||||||
.ToPage<WmFgentryInspect, WmFgentryInspectDto>(parm);
|
.Select((s, w) => new WmFgentryInspectDto
|
||||||
|
{
|
||||||
|
Workorder = s.Workorder,
|
||||||
|
ProductionNum = s.ProductionNum,
|
||||||
|
Partnumber = s.Partnumber,
|
||||||
|
ProductDescription = w.ProductDescription,
|
||||||
|
Specifications = w.Specifications,
|
||||||
|
Colour = w.Colour
|
||||||
|
})
|
||||||
|
.ToPage<WmFgentryInspectDto, WmFgentryInspectDto>(parm);
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,6 +252,20 @@ namespace ZR.Service.mes.wms
|
|||||||
.ExecuteCommand();
|
.ExecuteCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置全部批量不合格
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="workorder_selected"></param>
|
||||||
|
/// <param name="updateby"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public int SetAllUnQualified(string workorder_selected, string updateby)
|
||||||
|
{
|
||||||
|
return Context.Updateable<WmFgentryInspect>()
|
||||||
|
.SetColumns(it => it.Result == 2)
|
||||||
|
.Where(it => it.Workorder == workorder_selected)
|
||||||
|
.ExecuteCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user