质检记录
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Common.Security;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.WarehouseMgr.Entities.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// 收货质检记录
|
||||
/// </summary>
|
||||
[SugarTable("wms_purchase_qcrecord")]
|
||||
public partial class WmsPurchaseQcrecord : BaseEntity<string>
|
||||
{
|
||||
public WmsPurchaseQcrecord()
|
||||
{
|
||||
id = SnowflakeIdHelper.NextId();
|
||||
}
|
||||
/// <summary>
|
||||
/// 创建用户
|
||||
/// </summary>
|
||||
public string? create_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
public DateTime? create_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改用户
|
||||
/// </summary>
|
||||
public string? modify_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
/// </summary>
|
||||
public DateTime? modify_time { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单据
|
||||
/// </summary>
|
||||
public string? type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源单号
|
||||
/// </summary>
|
||||
public string? ori_bill_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 来源明细id
|
||||
/// </summary>
|
||||
public string? ori_detail_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 仓库
|
||||
/// </summary>
|
||||
public string? warehouse_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料id
|
||||
/// </summary>
|
||||
public string? material_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料编码
|
||||
/// </summary>
|
||||
public string? material_code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料名称
|
||||
/// </summary>
|
||||
public string? material_name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 物料型号
|
||||
/// </summary>
|
||||
public string? material_spec { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 采购数量
|
||||
/// </summary>
|
||||
public decimal? purchase_qty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 已到货数量
|
||||
/// </summary>
|
||||
public decimal? purchase_prqty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 本次到货数量
|
||||
/// </summary>
|
||||
public decimal? purchase_arriveqty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 质检结论
|
||||
/// </summary>
|
||||
public string? result { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 单位
|
||||
/// </summary>
|
||||
public string? unit_id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 批次
|
||||
/// </summary>
|
||||
public string? batchno { get; set; }
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
@@ -35,6 +35,8 @@ using Tnb.ProductionMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using JNPF.VisualDev.Interfaces;
|
||||
using JNPF.VisualDev.Entitys;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -48,16 +50,25 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly ISqlSugarClient _db;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IRunService _runService;
|
||||
private readonly IVisualDevService _visualDevService;
|
||||
public WmsPurchaseService(ISqlSugarRepository<WmsPurchaseH> repo, IUserManager userManager, IQcCheckPlanService qcCheckPlanService, IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService)
|
||||
IWareHouseService wareHouseService, IRunService runService,
|
||||
IVisualDevService visualDevService)
|
||||
: base(repo, userManager, qcCheckPlanService)
|
||||
{
|
||||
_db = repo.AsSugarClient();
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private async Task<dynamic> xxx(VisualDevModelDataCrInput input)
|
||||
{
|
||||
PurchaseAndReceiveUpInput input2 = new();
|
||||
|
||||
Reference in New Issue
Block a user