This commit is contained in:
2024-10-22 13:54:56 +08:00
7 changed files with 25 additions and 8 deletions

View File

@@ -103,6 +103,16 @@ public partial class WmsPurchaseQcrecord : BaseEntity<string>
/// 批次
/// </summary>
public string? batchno { get; set; }
/// <summary>
/// 质检人
/// </summary>
public string? checker { get; set; }
/// <summary>
/// 质检时间
/// </summary>
public DateTime? check_time { get; set; }
/// <summary>
///
/// </summary>

View File

@@ -507,7 +507,6 @@ namespace Tnb.WarehouseMgr
{
cyDb = _db.CopyNew();
}
List<Tuple<string, WmsCarryH, WmsCarryCode, BasLocation>> items = cyDb.Queryable<WmsCarryH>().LeftJoin<WmsCarryCode>((a, b) => a.id == b.carry_id)
.LeftJoin<BasLocation>((a, b, c) => a.location_id == c.id)
.Where(whereExpr)

View File

@@ -108,6 +108,8 @@ namespace Tnb.WarehouseMgr
wmsPurchaseQcrecord.purchase_prqty = wmsOutsourceD.actual_quantity;
wmsPurchaseQcrecord.purchase_arriveqty = wmsOutsourceD.actual_quantity;
wmsPurchaseQcrecord.result = qcRes;
wmsPurchaseQcrecord.checker = create_id;
wmsPurchaseQcrecord.check_time = DateTime.Now;
await _db.Insertable(wmsPurchaseQcrecord).ExecuteCommandAsync();
}

View File

@@ -317,13 +317,13 @@ namespace Tnb.WarehouseMgr
item.actual_quantity += outsource_arriveqty;
if (item.actual_quantity > item.outsource_quantity)
{
throw Oops.Bah($"委外收货单明细行物料{item.matcode} 批次{item.code_batch} 到货数量不能超过采购数量!");
//throw Oops.Bah($"委外收货单明细行物料{item.matcode} 批次{item.code_batch} 到货数量不能超过采购数量!");
}
WmsOutsourceOrderD wmsOutsourceOrderD = wmsOutsourceOrderDs.Where(r => r.erp_line_pk == item.erp_outsource_order_d_pk).First();
wmsOutsourceOrderD.actual_quantity += outsource_arriveqty;
if (wmsOutsourceOrderD.actual_quantity > wmsOutsourceOrderD.outsource_quantity)
{
throw Oops.Bah($"采购订单明细行物料{wmsOutsourceOrderD.matcode} 批次{wmsOutsourceOrderD.code_batch} 到货数量不能超过采购数量!");
//throw Oops.Bah($"采购订单明细行物料{wmsOutsourceOrderD.matcode} 批次{wmsOutsourceOrderD.code_batch} 到货数量不能超过采购数量!");
}
}
await _db.Updateable(dList).UpdateColumns(r => r.actual_quantity).ExecuteCommandAsync();

View File

@@ -108,6 +108,8 @@ namespace Tnb.WarehouseMgr
wmsPurchaseQcrecord.purchase_prqty = wmsPurchaseD.purchase_prqty;
wmsPurchaseQcrecord.purchase_arriveqty = wmsPurchaseD.purchase_arriveqty;
wmsPurchaseQcrecord.result = qcRes;
wmsPurchaseQcrecord.checker = create_id;
wmsPurchaseQcrecord.check_time = DateTime.Now;
await _db.Insertable(wmsPurchaseQcrecord).ExecuteCommandAsync();

View File

@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using JNPF.Common.Core.Manager;
using JNPF.Common.Filter;
using JNPF.Systems.Entitys.Permission;
using JNPF.Systems.Entitys.System;
using JNPF.Systems.Interfaces.System;
using JNPF.VisualDev;
@@ -76,7 +77,7 @@ namespace Tnb.WarehouseMgr
{
type = JObject.Parse(input.queryJson).Value<string>("type");
material_code = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.material_code));
batchno = JObject.Parse(input.queryJson).Value<string>("batchno");
batchno = JObject.Parse(input.queryJson).Value<string>("code_batch");
material_specification = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.material_specification));
container_no = JObject.Parse(input.queryJson).Value<string>(nameof(WmsCarryCode.container_no));
if (JObject.Parse(input.queryJson).ContainsKey("time"))
@@ -100,6 +101,7 @@ namespace Tnb.WarehouseMgr
.InnerJoin<BasMaterial>((a, b) => a.material_id == b.id)
.LeftJoin<DictionaryDataEntity>((a, b, c) => c.EnCode == b.unit_id && c.DictionaryTypeId == WmsWareHouseConst.UNITTYPEID)
.LeftJoin<WmsPurchaseD>((a, b, c, d) => d.id == a.ori_detail_id)
.LeftJoin<UserEntity>((a, b, c, d, e) => e.Id == a.checker)
.WhereIF(!string.IsNullOrEmpty(material_specification), (a, b, c, d) => b.material_specification.Contains(material_specification))
.WhereIF(!string.IsNullOrEmpty(batchno), (a, b, c, d) => a.batchno.Contains(batchno))
.WhereIF(!string.IsNullOrEmpty(container_no), (a, b, c, d) => b.material_standard.Contains(container_no))
@@ -107,7 +109,7 @@ namespace Tnb.WarehouseMgr
.WhereIF(!string.IsNullOrEmpty(type), (a, b, c, d) => a.type == type)
.WhereIF(_start_time != 0, (a, b, c, d) => a.create_time >= start_time)
.WhereIF(_end_time != 0, (a, b, c, d) => a.create_time <= end_time)
.Select((a, b, c, d) => new WmsPurchaseQcrecord
.Select((a, b, c, d, e) => new WmsPurchaseQcrecord
{
material_id = a.material_id,
material_code = a.material_code,
@@ -122,7 +124,9 @@ namespace Tnb.WarehouseMgr
result = SqlFunc.IF(a.result.Equals("await") || string.IsNullOrEmpty(a.result)).Return("待检")
.ElseIF(a.result.Equals("vergeOk")).Return("让步接收").ElseIF(a.result.Equals("ok")).Return("合格")
.ElseIF(a.result.Equals("no")).Return("不合格").End(""),
create_time = d.create_time
create_time = d.create_time,
checker = e.RealName,
check_time = a.check_time
}).ToListAsync();
total_qty = data.Count;

View File

@@ -222,7 +222,7 @@ namespace Tnb.WarehouseMgr
item.purchase_prqty += purchase_arriveqty;
if (item.purchase_prqty > item.purchase_qty)
{
throw Oops.Bah($"采购收货单明细行物料{item.material_code} 批次{item.code_batch} 到货数量不能超过采购数量!");
//throw Oops.Bah($"采购收货单明细行物料{item.material_code} 批次{item.code_batch} 到货数量不能超过采购数量!");
}
if (wmsPurchaseOrderDs.Count > 0)
@@ -231,7 +231,7 @@ namespace Tnb.WarehouseMgr
wmsPurchaseOrderD.actual_quantity += purchase_arriveqty;
if (wmsPurchaseOrderD.actual_quantity > wmsPurchaseOrderD.purchase_quantity)
{
throw Oops.Bah($"采购订单明细行物料{wmsPurchaseOrderD.matcode} 批次{wmsPurchaseOrderD.code_batch} 到货数量不能超过采购数量!");
//throw Oops.Bah($"采购订单明细行物料{wmsPurchaseOrderD.matcode} 批次{wmsPurchaseOrderD.code_batch} 到货数量不能超过采购数量!");
}
}