批量入库
This commit is contained in:
@@ -164,6 +164,25 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置全部合格
|
||||
/// </summary>
|
||||
/// <param name="packcode_select"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("setAllQualified")]
|
||||
public IActionResult SetAllQualified(string workorder_selected)
|
||||
{
|
||||
if (string.IsNullOrEmpty(workorder_selected))
|
||||
{
|
||||
return SUCCESS(null);
|
||||
}
|
||||
|
||||
var response = _WmFgentryInspectService.SetAllQualified(workorder_selected, HttpContext.GetName());
|
||||
|
||||
return ToResponse(response);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,12 @@ namespace ZR.Model.MES.wms
|
||||
/// </summary>
|
||||
public int? Result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否入库(0未入,1入库)
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "bit_wm")]
|
||||
public int? Bitwm { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace ZR.Service.mes.wms.IService
|
||||
int UpdateWmFgentryInspect(WmFgentryInspect parm);
|
||||
|
||||
int BatchQualified(string[] packcode_select,string updateby);
|
||||
|
||||
int SetAllQualified(string workorder_selected, string updateby);
|
||||
int BatchUnQualified(string[] packcode_select,string updateby);
|
||||
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace ZR.Service.mes.wms
|
||||
}
|
||||
|
||||
wmGood.PackageCode = Getpack_no(resultionPackage.WorkoderID, flow_num.ToString("000"));
|
||||
|
||||
wmGood.PackageCodeClient = resultionPackage.PatchCode;
|
||||
wmGood.Partnumber = resultionPackage.PartNumner;
|
||||
wmGood.PackageCodeOriginal = resultionPackage.originalCode;
|
||||
@@ -68,6 +69,28 @@ namespace ZR.Service.mes.wms
|
||||
}
|
||||
|
||||
}
|
||||
// 修改入库检验 为入库完成 WmFgentryInspect
|
||||
UseTran2(() =>
|
||||
{
|
||||
if(preparegoodsList!=null&& preparegoodsList.Count() > 0) {
|
||||
foreach(var preparegood in preparegoodsList)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(preparegood.PackageCode))
|
||||
{
|
||||
Context.Updateable<WmFgentryInspect>()
|
||||
.SetColumns(it=>it.Bitwm==1)
|
||||
.Where(it => it.Packcode == preparegood.PackageCode)
|
||||
.ExecuteCommand();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
int result = Context.Insertable(preparegoodsList).ExecuteCommand();
|
||||
return result;
|
||||
@@ -239,6 +262,20 @@ namespace ZR.Service.mes.wms
|
||||
{
|
||||
return "标签解析异常!";
|
||||
}
|
||||
//1.2 判断是否检验合格
|
||||
WmFgentryInspect inspect = Context.Queryable<WmGoodsNowProduction>()
|
||||
.LeftJoin<WmFgentryInspect>((g, f) => g.PackageCode == f.Packcode)
|
||||
.Where(g => g.PackageCodeClient == resultionPackage.PatchCode)
|
||||
.Select((g, f) => new WmFgentryInspect()
|
||||
{
|
||||
Result = f.Result
|
||||
|
||||
}).First();
|
||||
if (inspect == null || inspect.Result == 2)
|
||||
{
|
||||
return "该箱号GP12 检验不合格";
|
||||
}
|
||||
|
||||
// 2.判断是否已入库
|
||||
bool isExistedWarehouse = Context.Queryable<WmGoodsNowProduction>().Where(it => it.PackageCodeClient == resultionPackage.PatchCode).Any();
|
||||
if (isExistedWarehouse)
|
||||
@@ -284,11 +321,11 @@ namespace ZR.Service.mes.wms
|
||||
}
|
||||
return "ok";
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
return "标签存在异常!";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace ZR.Service.mes.wms
|
||||
|
||||
List<WmFgentryInspect_parentDto> inspects = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.Where(it=>it.Bitwm==0)
|
||||
.GroupBy(it => it.Workorder)
|
||||
.Select(it => new WmFgentryInspect_parentDto()
|
||||
{
|
||||
@@ -100,6 +101,7 @@ namespace ZR.Service.mes.wms
|
||||
.AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), it => it.CreatedTime < parm.endtime)
|
||||
;
|
||||
var response = Queryable()
|
||||
.Where(it => it.Bitwm == 0)
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<WmFgentryInspect, WmFgentryInspectDto>(parm);
|
||||
return response;
|
||||
@@ -172,6 +174,22 @@ namespace ZR.Service.mes.wms
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置全部批量合格
|
||||
/// </summary>
|
||||
/// <param name="workorder_selected"></param>
|
||||
/// <param name="updateby"></param>
|
||||
/// <returns></returns>
|
||||
public int SetAllQualified(string workorder_selected, string updateby)
|
||||
{
|
||||
return Context.Updateable<WmFgentryInspect>()
|
||||
.SetColumns(it=>it.Result==1)
|
||||
.Where(it=>it.Workorder==workorder_selected)
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 批量修改合格
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user