入库检验修改

This commit is contained in:
qianhao.xu
2024-04-20 14:05:35 +08:00
parent 82cd1954e7
commit 73e2ec79f7
4 changed files with 101 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -55,6 +55,24 @@ namespace ZR.Model.MES.wms.Dto
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>
@@ -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; }
}
}

View File

@@ -29,6 +29,7 @@ namespace ZR.Service.mes.wms.IService
int BatchQualified(string[] packcode_select,string updateby);
int SetAllQualified(string workorder_selected, string updateby);
int SetAllUnQualified(string workorder_selected, string updateby);
int BatchUnQualified(string[] packcode_select,string updateby);
}

View File

@@ -13,6 +13,8 @@ using ZR.Model.MES.wms.Dto;
using Mapster;
using System.Reflection.PortableExecutable;
using Microsoft.AspNetCore.Http.HttpResults;
using ZR.Model.MES.pro;
using System.Drawing;
namespace ZR.Service.mes.wms
{
@@ -101,13 +103,26 @@ namespace ZR.Service.mes.wms
ProductionNum = SqlFunc.AggregateSum(it.ProductionNum ?? 0),
// Result= SqlFunc.AggregateSum(it.Result??0),
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)
{
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_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)
{
var predicate = Expressionable.Create<WmFgentryInspect>()
.AndIF(!string.IsNullOrEmpty(parm.Workorder), it => it.Workorder.Contains(parm.Workorder))
.AndIF(!string.IsNullOrEmpty(parm.Packcode), it => it.Packcode.Contains(parm.Packcode))
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), it => it.Partnumber.Contains(parm.Partnumber))
.AndIF(parm.starttime != null && parm.starttime > new DateTime(1999, 1, 1), it => it.CreatedTime > parm.starttime)
.AndIF(parm.endtime != null && parm.endtime > new DateTime(1999, 1, 1), it => it.CreatedTime < parm.endtime)
.AndIF(!string.IsNullOrEmpty(parm.Workorder), s => s.Workorder.Contains(parm.Workorder))
.AndIF(!string.IsNullOrEmpty(parm.Packcode), s => s.Packcode.Contains(parm.Packcode))
.AndIF(!string.IsNullOrEmpty(parm.Partnumber), s=> s.Partnumber.Contains(parm.Partnumber))
.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), s => s.CreatedTime < parm.endtime)
;
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())
.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;
}
@@ -227,6 +252,20 @@ namespace ZR.Service.mes.wms
.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>