质检记录
This commit is contained in:
@@ -20,6 +20,8 @@ using Tnb.BasicData.Entities;
|
||||
using Tnb.BasicData;
|
||||
using Tnb.ProductionMgr.Entities.Entity;
|
||||
using ModuleConst = Tnb.ProductionMgr.ModuleConst;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -60,12 +62,40 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
string id = dic["id"];
|
||||
string qcRes = dic["qc_res"];
|
||||
|
||||
WmsPurchaseD wmsPurchaseD = await _db.Queryable<WmsPurchaseD>().SingleAsync(x => x.id == id);
|
||||
|
||||
string purchaseHId = wmsPurchaseD?.bill_id ?? "";
|
||||
WmsPurchaseH wmsPurchaseH = await _db.Queryable<WmsPurchaseH>().SingleAsync(x => x.id == purchaseHId);
|
||||
|
||||
#region 插入质检记录
|
||||
|
||||
string? create_id = _userManager.User.Id;
|
||||
|
||||
if (qcRes != (wmsPurchaseD.qc_res ?? ""))
|
||||
{
|
||||
BasMaterial basMaterial = await _db.Queryable<BasMaterial>().Where(r => r.id == wmsPurchaseD.material_id).FirstAsync();
|
||||
WmsPurchaseQcrecord wmsPurchaseQcrecord = new WmsPurchaseQcrecord();
|
||||
wmsPurchaseQcrecord.create_id = create_id;
|
||||
wmsPurchaseQcrecord.create_time = DateTime.Now;
|
||||
wmsPurchaseQcrecord.type = "采购收货";
|
||||
wmsPurchaseQcrecord.ori_bill_code = wmsPurchaseH.bill_code;
|
||||
wmsPurchaseQcrecord.ori_detail_id = wmsPurchaseD.id;
|
||||
wmsPurchaseQcrecord.warehouse_id = WmsWareHouseConst.WAREHOUSE_YCL_ID;
|
||||
wmsPurchaseQcrecord.material_id = basMaterial.id;
|
||||
wmsPurchaseQcrecord.material_code = basMaterial.code;
|
||||
wmsPurchaseQcrecord.material_name = basMaterial.name;
|
||||
wmsPurchaseQcrecord.material_spec = basMaterial.material_specification;
|
||||
wmsPurchaseQcrecord.unit_id = wmsPurchaseD.unit_id;
|
||||
wmsPurchaseQcrecord.batchno = wmsPurchaseD.code_batch;
|
||||
wmsPurchaseQcrecord.purchase_qty = wmsPurchaseD.purchase_qty;
|
||||
wmsPurchaseQcrecord.purchase_prqty = wmsPurchaseD.purchase_prqty;
|
||||
wmsPurchaseQcrecord.purchase_arriveqty = wmsPurchaseD.purchase_arriveqty;
|
||||
wmsPurchaseQcrecord.result = qcRes;
|
||||
|
||||
await _db.Insertable(wmsPurchaseQcrecord).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
List<WmsOutinStockDetail> wmsOutinStockDetails = await _db.Queryable<WmsOutinStockDetail>()
|
||||
.Where(x => x.source_detail_id == wmsPurchaseD.id && x.source_type == WmsWareHouseConst.BIZTYPE_WMSINSTOCK_ID)
|
||||
.ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user