This commit is contained in:
2024-11-12 11:38:48 +08:00
10 changed files with 303 additions and 3 deletions

View File

@@ -100,4 +100,12 @@ namespace Tnb.WarehouseMgr.Entities.Dto.ErpInputs
public string? warehouse_instock_id { get; set; }
}
public class TransferOrderDelInput
{
/// <summary>
/// 主表主键
/// </summary>
public string erp_pk { get; set; }
}
}

View File

@@ -1,5 +1,6 @@
using JNPF.Common.Contracts;
using JNPF.Common.Security;
using NPOI.OpenXmlFormats.Dml;
using SqlSugar;
namespace Tnb.WarehouseMgr.Entities;
@@ -412,7 +413,14 @@ public partial class WmsCarryStockReportExcel
/// 绑定时间
/// </summary>
public string? bind_time { get; set; }
/// <summary>
/// 物料规格
/// </summary>
public string? material_specification { get; set; }
/// <summary>
/// 物料型号
/// </summary>
public string? container_no { get;set; }
}

View File

@@ -2461,6 +2461,53 @@ namespace Tnb.WarehouseMgr
}
}
/// <summary>
/// 删除调拨订单
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="AppFriendlyException"></exception>
[HttpPost, NonUnify, AllowAnonymous]
public async Task<Entities.Dto.Outputs.Result> DelTransferOrder(TransferOrderDelInput input)
{
LoggerErp2Mes.LogInformation($"【TransferOrderDelInput】ERP传入数据:{JsonConvert.SerializeObject(input)}");
var db = _repository.AsSugarClient();
try
{
if (string.IsNullOrEmpty(input.erp_pk))
{
_LoggerErp2Mes.LogWarning($"【TransferOrderDelInput】主表主键不能为空");
throw new AppFriendlyException($@"主表主键不能为空!", 500);
}
await db.Ado.BeginTranAsync();
// 判断调拨订单主表是否存在
WmsTransferOrderH wmsTransferOrderH = await db.Queryable<WmsTransferOrderH>().Where(r => r.erp_pk == input.erp_pk).FirstAsync();
if (wmsTransferOrderH != null)
{
await db.Deleteable<WmsTransferOrderH>().Where(r => r.id == wmsTransferOrderH.id).ExecuteCommandAsync();
await db.Deleteable<WmsTransferOrderD>().Where(r => r.bill_id == wmsTransferOrderH.id).ExecuteCommandAsync();
}
await db.Ado.CommitTranAsync();
return await ToApiResult(HttpStatusCode.OK, "成功");
}
catch (Exception ex)
{
LoggerErp2Mes.LogError($"【TransferOrderDelInput】{ex.Message}");
LoggerErp2Mes.LogError($"【TransferOrderDelInput】{ex.StackTrace}");
await db.Ado.RollbackTranAsync();
return await ToApiResult(HttpStatusCode.InternalServerError, ex.Message);
}
finally
{
}
}
/// <summary>
/// 材料出库单
/// </summary>

View File

@@ -3372,6 +3372,7 @@ namespace Tnb.WarehouseMgr
["cvendorvid"] = erpExtendFields.Find(x => x.table_id == wmsCarryCode?.auxprop_gys)?.supplier_vid ?? "",
["dbizdate"] = nowStr,
["nnum"] = item.qty,
["nshouldnum"]=item.qty,//应发主数量
["pk_group"] = erpOrg.pk_group,
["pk_org"] = erpOrg.pk_org,
["pk_org_v"] = erpOrg.pk_org_v,

View File

@@ -290,6 +290,8 @@ namespace Tnb.WarehouseMgr
WmsCarryCode.codeqty = detail.codeqty;
WmsCarryCode.create_id = input.create_id;
WmsCarryCode.create_time = DateTime.Now;
WmsCarryCode.auxprop_gys = auxprop_gys;
WmsCarryCode.auxprop_xph=auxprop_xph;
WmsCarryCodes.Add(WmsCarryCode);
WmsTempCode wmsTempCode = wmsTempCodes.Where(r => r.barcode == detail.barcode).First();

View File

@@ -272,7 +272,9 @@ namespace Tnb.WarehouseMgr
material_name = f.name,
unit = e.unit_id,
creator = e.create_id,
bind_time = e.create_time != null ? e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
bind_time = e.create_time != null ? e.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
material_specification= f.material_specification,
container_no= f.material_standard,
})
.OrderBy((a) => a.location_code)
.ToListAsync();
@@ -314,7 +316,9 @@ namespace Tnb.WarehouseMgr
material_name = g.name,
unit = f.unit_id,
creator = f.create_id,
bind_time = f.create_time != null ? f.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
bind_time = f.create_time != null ? f.create_time.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
material_specification=g.material_specification,
container_no=g.material_standard
})
.OrderBy((a) => a.location_code)
.ToListAsync();
@@ -345,6 +349,8 @@ namespace Tnb.WarehouseMgr
wmsCarryStockReportCode.unit = x.unit;
//wmsCarryStockReportCode.创建用户 = x.操作用户;
wmsCarryStockReportCode.bind_time = x.bind_time;
wmsCarryStockReportCode.material_specification= x.material_specification;
wmsCarryStockReportCode.container_no = x.container_no;
wmsCarryStockReportExcels.Add(wmsCarryStockReportCode);
});

View File

@@ -643,6 +643,7 @@ namespace Tnb.WarehouseMgr
["cvendorvid"] = erpExtendFields.Find(x => x.table_id == wmsCarryCodes[0]?.auxprop_gys)?.supplier_vid ?? "",
["dbizdate"] = nowStr,
["nnum"] = wmsMaterialTransferd.qty,
["nshouldnum"] = wmsMaterialTransferd.qty,//应发主数量
["pk_group"] = erpOrg.pk_group,
["pk_org"] = erpOrg.pk_org,
["pk_org_v"] = erpOrg.pk_org_v,

View File

@@ -1378,6 +1378,7 @@ namespace Tnb.WarehouseMgr
["cvendorvid"] = erpExtendFields.Find(x => x.table_id == wmsCarryCodes[0]?.auxprop_gys)?.supplier_vid ?? "",
["dbizdate"] = nowStr,
["nnum"] = qty,
["nshouldnum"] = wmsMaterialTransferd.qty,//应发主数量
["pk_group"] = erpOrg.pk_group,
["pk_org"] = erpOrg.pk_org,
["pk_org_v"] = erpOrg.pk_org_v,